Git init
authorKibum Kim <kb0929.kim@samsung.com>
Fri, 6 Jan 2012 16:08:51 +0000 (01:08 +0900)
committerKibum Kim <kb0929.kim@samsung.com>
Fri, 6 Jan 2012 16:08:51 +0000 (01:08 +0900)
764 files changed:
bitmap/AUTHORS [new file with mode: 0644]
bitmap/BitEdit.c [new file with mode: 0644]
bitmap/Bitmap.c [new file with mode: 0644]
bitmap/Bitmap.h [new file with mode: 0644]
bitmap/BitmapP.h [new file with mode: 0644]
bitmap/COPYING [new file with mode: 0644]
bitmap/ChangeLog [new file with mode: 0644]
bitmap/CutPaste.c [new file with mode: 0644]
bitmap/Dashes [new file with mode: 0644]
bitmap/Dialog.c [new file with mode: 0644]
bitmap/Dialog.h [new file with mode: 0644]
bitmap/Down [new file with mode: 0644]
bitmap/Excl [new file with mode: 0644]
bitmap/FlipHoriz [new file with mode: 0644]
bitmap/FlipVert [new file with mode: 0644]
bitmap/Fold [new file with mode: 0644]
bitmap/Graphics.c [new file with mode: 0644]
bitmap/Handlers.c [new file with mode: 0644]
bitmap/INSTALL [new file with mode: 0644]
bitmap/Left [new file with mode: 0644]
bitmap/Makefile.am [new file with mode: 0644]
bitmap/Makefile.in [new file with mode: 0644]
bitmap/NEWS [new file with mode: 0644]
bitmap/README [new file with mode: 0644]
bitmap/ReqMach.c [new file with mode: 0644]
bitmap/Requests.h [new file with mode: 0644]
bitmap/Right [new file with mode: 0644]
bitmap/RotateLeft [new file with mode: 0644]
bitmap/RotateRight [new file with mode: 0644]
bitmap/Stipple [new file with mode: 0644]
bitmap/Term [new file with mode: 0644]
bitmap/Up [new file with mode: 0644]
bitmap/aclocal.m4 [new file with mode: 0644]
bitmap/app-defaults/Bitmap [new file with mode: 0644]
bitmap/app-defaults/Bitmap-color [new file with mode: 0644]
bitmap/app-defaults/Bitmap-nocase [new file with mode: 0644]
bitmap/atobm.c [new file with mode: 0644]
bitmap/autogen.sh [new file with mode: 0755]
bitmap/bitmap.icon [new file with mode: 0644]
bitmap/bitmap.man [new file with mode: 0644]
bitmap/bmtoa.c [new file with mode: 0644]
bitmap/compile [new file with mode: 0755]
bitmap/config.guess [new file with mode: 0755]
bitmap/config.h.in [new file with mode: 0644]
bitmap/config.sub [new file with mode: 0755]
bitmap/configure [new file with mode: 0755]
bitmap/configure.ac [new file with mode: 0644]
bitmap/depcomp [new file with mode: 0755]
bitmap/install-sh [new file with mode: 0755]
bitmap/missing [new file with mode: 0755]
debian/README.source [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/patches/01_xedit_mkdir_races.diff [new file with mode: 0644]
debian/patches/02_xedit_manpage_typos.diff [new file with mode: 0644]
debian/patches/03_xconsole_implicit_pointer_conversion.diff [new file with mode: 0644]
debian/patches/05_xmore_fix_segv_without_xprint.diff [new file with mode: 0644]
debian/patches/series [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/watch.bitmap [new file with mode: 0644]
debian/watch.ico [new file with mode: 0644]
debian/watch.oclock [new file with mode: 0644]
debian/watch.x11perf [new file with mode: 0644]
debian/watch.xbiff [new file with mode: 0644]
debian/watch.xcalc [new file with mode: 0644]
debian/watch.xclipboard [new file with mode: 0644]
debian/watch.xclock [new file with mode: 0644]
debian/watch.xconsole [new file with mode: 0644]
debian/watch.xcursorgen [new file with mode: 0644]
debian/watch.xditview [new file with mode: 0644]
debian/watch.xedit [new file with mode: 0644]
debian/watch.xeyes [new file with mode: 0644]
debian/watch.xgc [new file with mode: 0644]
debian/watch.xload [new file with mode: 0644]
debian/watch.xlogo [new file with mode: 0644]
debian/watch.xmag [new file with mode: 0644]
debian/watch.xman [new file with mode: 0644]
debian/watch.xmore [new file with mode: 0644]
debian/watch.xwd [new file with mode: 0644]
debian/watch.xwud [new file with mode: 0644]
debian/x11-apps.install [new file with mode: 0644]
debian/x11-apps.menu [new file with mode: 0644]
debian/xsfbs/repack.sh [new file with mode: 0755]
debian/xsfbs/xsfbs.mk [new file with mode: 0755]
debian/xsfbs/xsfbs.sh [new file with mode: 0644]
ico/AUTHORS [new file with mode: 0644]
ico/COPYING [new file with mode: 0644]
ico/ChangeLog [new file with mode: 0644]
ico/INSTALL [new file with mode: 0644]
ico/Makefile.am [new file with mode: 0644]
ico/Makefile.in [new file with mode: 0644]
ico/NEWS [new file with mode: 0644]
ico/README [new file with mode: 0644]
ico/aclocal.m4 [new file with mode: 0644]
ico/allobjs.h [new file with mode: 0644]
ico/config.guess [new file with mode: 0755]
ico/config.h.in [new file with mode: 0644]
ico/config.sub [new file with mode: 0755]
ico/configure [new file with mode: 0755]
ico/configure.ac [new file with mode: 0644]
ico/depcomp [new file with mode: 0755]
ico/ico.c [new file with mode: 0644]
ico/ico.man [new file with mode: 0644]
ico/install-sh [new file with mode: 0755]
ico/missing [new file with mode: 0755]
ico/objcube.h [new file with mode: 0644]
ico/objico.h [new file with mode: 0644]
ico/objocta.h [new file with mode: 0644]
ico/objplane.h [new file with mode: 0644]
ico/objpyr.h [new file with mode: 0644]
ico/polyinfo.h [new file with mode: 0644]
oclock/AUTHORS [new file with mode: 0644]
oclock/COPYING [new file with mode: 0644]
oclock/ChangeLog [new file with mode: 0644]
oclock/Clock-color.ad [new file with mode: 0644]
oclock/Clock.c [new file with mode: 0644]
oclock/Clock.h [new file with mode: 0644]
oclock/ClockP.h [new file with mode: 0644]
oclock/INSTALL [new file with mode: 0644]
oclock/Makefile.am [new file with mode: 0644]
oclock/Makefile.in [new file with mode: 0644]
oclock/NEWS [new file with mode: 0644]
oclock/README [new file with mode: 0644]
oclock/aclocal.m4 [new file with mode: 0644]
oclock/compile [new file with mode: 0755]
oclock/config.guess [new file with mode: 0755]
oclock/config.h.in [new file with mode: 0644]
oclock/config.sub [new file with mode: 0755]
oclock/configure [new file with mode: 0755]
oclock/configure.ac [new file with mode: 0644]
oclock/depcomp [new file with mode: 0755]
oclock/install-sh [new file with mode: 0755]
oclock/missing [new file with mode: 0755]
oclock/mkinstalldirs [new file with mode: 0755]
oclock/oclmask.bit [new file with mode: 0644]
oclock/oclock.bit [new file with mode: 0644]
oclock/oclock.c [new file with mode: 0644]
oclock/oclock.man [new file with mode: 0644]
oclock/transform.c [new file with mode: 0644]
oclock/transform.h [new file with mode: 0644]
packaging/xorg-x11-apps.spec [new file with mode: 0644]
x11perf/AUTHORS [new file with mode: 0644]
x11perf/COPYING [new file with mode: 0755]
x11perf/ChangeLog [new file with mode: 0755]
x11perf/INSTALL [new file with mode: 0755]
x11perf/Makefile.am [new file with mode: 0755]
x11perf/Makefile.in [new file with mode: 0755]
x11perf/NEWS [new file with mode: 0644]
x11perf/README [new file with mode: 0755]
x11perf/Xmark [new file with mode: 0755]
x11perf/Xmark.man [new file with mode: 0755]
x11perf/aclocal.m4 [new file with mode: 0644]
x11perf/bitmaps.c [new file with mode: 0755]
x11perf/bitmaps.h [new file with mode: 0755]
x11perf/config.guess [new file with mode: 0755]
x11perf/config.h.in [new file with mode: 0755]
x11perf/config.sub [new file with mode: 0755]
x11perf/configure [new file with mode: 0755]
x11perf/configure.ac [new file with mode: 0755]
x11perf/depcomp [new file with mode: 0755]
x11perf/do_arcs.c [new file with mode: 0755]
x11perf/do_blt.c [new file with mode: 0755]
x11perf/do_complex.c [new file with mode: 0755]
x11perf/do_dots.c [new file with mode: 0755]
x11perf/do_lines.c [new file with mode: 0755]
x11perf/do_movewin.c [new file with mode: 0755]
x11perf/do_rects.c [new file with mode: 0755]
x11perf/do_segs.c [new file with mode: 0755]
x11perf/do_simple.c [new file with mode: 0755]
x11perf/do_tests.c [new file with mode: 0755]
x11perf/do_text.c [new file with mode: 0755]
x11perf/do_traps.c [new file with mode: 0755]
x11perf/do_tris.c [new file with mode: 0755]
x11perf/do_valgc.c [new file with mode: 0755]
x11perf/do_windows.c [new file with mode: 0755]
x11perf/fillblnk [new file with mode: 0755]
x11perf/install-sh [new file with mode: 0755]
x11perf/missing [new file with mode: 0755]
x11perf/perfboth [new file with mode: 0755]
x11perf/perfratio [new file with mode: 0755]
x11perf/x11pcomp.cpp [new file with mode: 0755]
x11perf/x11perf.c [new file with mode: 0755]
x11perf/x11perf.h [new file with mode: 0755]
x11perf/x11perf.man [new file with mode: 0755]
x11perf/x11perfcomp.man [new file with mode: 0755]
xbiff/COPYING [new file with mode: 0644]
xbiff/ChangeLog [new file with mode: 0644]
xbiff/INSTALL [new file with mode: 0644]
xbiff/Mailbox.c [new file with mode: 0644]
xbiff/Mailbox.h [new file with mode: 0644]
xbiff/MailboxP.h [new file with mode: 0644]
xbiff/Makefile.am [new file with mode: 0644]
xbiff/Makefile.in [new file with mode: 0644]
xbiff/README [new file with mode: 0644]
xbiff/aclocal.m4 [new file with mode: 0644]
xbiff/bitmaps/mail-down [new file with mode: 0644]
xbiff/bitmaps/mail-down-mask [new file with mode: 0644]
xbiff/bitmaps/mail-up [new file with mode: 0644]
xbiff/bitmaps/mail-up-mask [new file with mode: 0644]
xbiff/config.guess [new file with mode: 0755]
xbiff/config.h.in [new file with mode: 0644]
xbiff/config.sub [new file with mode: 0755]
xbiff/configure [new file with mode: 0755]
xbiff/configure.ac [new file with mode: 0644]
xbiff/depcomp [new file with mode: 0755]
xbiff/install-sh [new file with mode: 0755]
xbiff/missing [new file with mode: 0755]
xbiff/xbiff.c [new file with mode: 0644]
xbiff/xbiff.man [new file with mode: 0644]
xcalc/COPYING [new file with mode: 0644]
xcalc/ChangeLog [new file with mode: 0644]
xcalc/INSTALL [new file with mode: 0644]
xcalc/Makefile.am [new file with mode: 0644]
xcalc/Makefile.in [new file with mode: 0644]
xcalc/README [new file with mode: 0644]
xcalc/aclocal.m4 [new file with mode: 0644]
xcalc/actions.c [new file with mode: 0644]
xcalc/app-defaults/XCalc [new file with mode: 0644]
xcalc/app-defaults/XCalc-color [new file with mode: 0644]
xcalc/autogen.sh [new file with mode: 0755]
xcalc/config.guess [new file with mode: 0755]
xcalc/config.h.in [new file with mode: 0644]
xcalc/config.sub [new file with mode: 0755]
xcalc/configure [new file with mode: 0755]
xcalc/configure.ac [new file with mode: 0644]
xcalc/depcomp [new file with mode: 0755]
xcalc/install-sh [new file with mode: 0755]
xcalc/math.c [new file with mode: 0644]
xcalc/missing [new file with mode: 0755]
xcalc/xcalc.c [new file with mode: 0644]
xcalc/xcalc.h [new file with mode: 0644]
xcalc/xcalc.man [new file with mode: 0644]
xclipboard/AUTHORS [new file with mode: 0644]
xclipboard/COPYING [new file with mode: 0644]
xclipboard/ChangeLog [new file with mode: 0644]
xclipboard/INSTALL [new file with mode: 0644]
xclipboard/Makefile.am [new file with mode: 0644]
xclipboard/Makefile.in [new file with mode: 0644]
xclipboard/NEWS [new file with mode: 0644]
xclipboard/README [new file with mode: 0644]
xclipboard/aclocal.m4 [new file with mode: 0644]
xclipboard/app-defaults/XClipboard [new file with mode: 0644]
xclipboard/config.guess [new file with mode: 0755]
xclipboard/config.h.in [new file with mode: 0644]
xclipboard/config.sub [new file with mode: 0755]
xclipboard/configure [new file with mode: 0755]
xclipboard/configure.ac [new file with mode: 0644]
xclipboard/depcomp [new file with mode: 0755]
xclipboard/install-sh [new file with mode: 0755]
xclipboard/missing [new file with mode: 0755]
xclipboard/xclipboard.c [new file with mode: 0644]
xclipboard/xclipboard.man [new file with mode: 0644]
xclipboard/xcutsel.c [new file with mode: 0644]
xclipboard/xcutsel.man [new file with mode: 0644]
xclock/AUTHORS [new file with mode: 0644]
xclock/COPYING [new file with mode: 0644]
xclock/ChangeLog [new file with mode: 0644]
xclock/Clock.c [new file with mode: 0644]
xclock/Clock.h [new file with mode: 0644]
xclock/ClockP.h [new file with mode: 0644]
xclock/INSTALL [new file with mode: 0644]
xclock/Makefile.am [new file with mode: 0644]
xclock/Makefile.in [new file with mode: 0644]
xclock/NEWS [new file with mode: 0644]
xclock/README [new file with mode: 0644]
xclock/aclocal.m4 [new file with mode: 0644]
xclock/app-defaults/XClock [new file with mode: 0644]
xclock/app-defaults/XClock-color [new file with mode: 0644]
xclock/clmask.bit [new file with mode: 0644]
xclock/clock.bit [new file with mode: 0644]
xclock/config.guess [new file with mode: 0755]
xclock/config.h.in [new file with mode: 0644]
xclock/config.sub [new file with mode: 0755]
xclock/configure [new file with mode: 0755]
xclock/configure.ac [new file with mode: 0644]
xclock/depcomp [new file with mode: 0755]
xclock/install-sh [new file with mode: 0755]
xclock/missing [new file with mode: 0755]
xclock/xclock.c [new file with mode: 0644]
xclock/xclock.man [new file with mode: 0644]
xconsole/AUTHORS [new file with mode: 0644]
xconsole/COPYING [new file with mode: 0644]
xconsole/ChangeLog [new file with mode: 0644]
xconsole/INSTALL [new file with mode: 0644]
xconsole/Makefile.am [new file with mode: 0644]
xconsole/Makefile.in [new file with mode: 0644]
xconsole/NEWS [new file with mode: 0644]
xconsole/README [new file with mode: 0644]
xconsole/XConsole.ad [new file with mode: 0644]
xconsole/aclocal.m4 [new file with mode: 0644]
xconsole/config.guess [new file with mode: 0755]
xconsole/config.h.in [new file with mode: 0644]
xconsole/config.sub [new file with mode: 0755]
xconsole/configure [new file with mode: 0755]
xconsole/configure.ac [new file with mode: 0644]
xconsole/depcomp [new file with mode: 0755]
xconsole/install-sh [new file with mode: 0755]
xconsole/missing [new file with mode: 0755]
xconsole/xconsole.c [new file with mode: 0644]
xconsole/xconsole.man [new file with mode: 0644]
xcursorgen/AUTHORS [new file with mode: 0755]
xcursorgen/COPYING [new file with mode: 0755]
xcursorgen/ChangeLog [new file with mode: 0755]
xcursorgen/INSTALL [new file with mode: 0755]
xcursorgen/Makefile.am [new file with mode: 0755]
xcursorgen/Makefile.in [new file with mode: 0755]
xcursorgen/NEWS [new file with mode: 0644]
xcursorgen/README [new file with mode: 0755]
xcursorgen/aclocal.m4 [new file with mode: 0755]
xcursorgen/autogen.sh [new file with mode: 0755]
xcursorgen/config.guess [new file with mode: 0755]
xcursorgen/config.h.in [new file with mode: 0755]
xcursorgen/config.sub [new file with mode: 0755]
xcursorgen/configure [new file with mode: 0755]
xcursorgen/configure.ac [new file with mode: 0755]
xcursorgen/depcomp [new file with mode: 0755]
xcursorgen/install-sh [new file with mode: 0755]
xcursorgen/missing [new file with mode: 0755]
xcursorgen/xcursorgen.c [new file with mode: 0755]
xcursorgen/xcursorgen.man [new file with mode: 0755]
xditview/AUTHORS [new file with mode: 0644]
xditview/COPYING [new file with mode: 0644]
xditview/ChangeLog [new file with mode: 0644]
xditview/Dvi.c [new file with mode: 0644]
xditview/Dvi.h [new file with mode: 0644]
xditview/DviChar.c [new file with mode: 0644]
xditview/DviChar.h [new file with mode: 0644]
xditview/DviP.h [new file with mode: 0644]
xditview/INSTALL [new file with mode: 0644]
xditview/Makefile.am [new file with mode: 0644]
xditview/Makefile.in [new file with mode: 0644]
xditview/Menu.h [new file with mode: 0644]
xditview/NEWS [new file with mode: 0644]
xditview/README [new file with mode: 0644]
xditview/XFontName.c [new file with mode: 0644]
xditview/XFontName.h [new file with mode: 0644]
xditview/Xditview-chrtr.ad [new file with mode: 0644]
xditview/Xditview.ad [new file with mode: 0644]
xditview/aclocal.m4 [new file with mode: 0644]
xditview/compile [new file with mode: 0755]
xditview/config.guess [new file with mode: 0755]
xditview/config.h.in [new file with mode: 0644]
xditview/config.sub [new file with mode: 0755]
xditview/configure [new file with mode: 0755]
xditview/configure.ac [new file with mode: 0644]
xditview/depcomp [new file with mode: 0755]
xditview/draw.c [new file with mode: 0644]
xditview/font.c [new file with mode: 0644]
xditview/install-sh [new file with mode: 0755]
xditview/ldblarrow [new file with mode: 0644]
xditview/lex.c [new file with mode: 0644]
xditview/missing [new file with mode: 0755]
xditview/mkinstalldirs [new file with mode: 0755]
xditview/page.c [new file with mode: 0644]
xditview/parse.c [new file with mode: 0644]
xditview/rdblarrow [new file with mode: 0644]
xditview/xdit.bm [new file with mode: 0644]
xditview/xdit_mask.bm [new file with mode: 0644]
xditview/xditview.c [new file with mode: 0644]
xditview/xditview.man [new file with mode: 0644]
xedit/AUTHORS [new file with mode: 0644]
xedit/COPYING [new file with mode: 0644]
xedit/ChangeLog [new file with mode: 0644]
xedit/INSTALL [new file with mode: 0644]
xedit/Makefile.am [new file with mode: 0644]
xedit/Makefile.in [new file with mode: 0644]
xedit/NEWS [new file with mode: 0644]
xedit/README [new file with mode: 0644]
xedit/aclocal.m4 [new file with mode: 0644]
xedit/app-defaults/Xedit-color.ad [new file with mode: 0644]
xedit/app-defaults/Xedit-noxprint.ad [new file with mode: 0644]
xedit/app-defaults/Xedit-sample [new file with mode: 0644]
xedit/app-defaults/Xedit-xprint.ad [new file with mode: 0644]
xedit/commands.c [new file with mode: 0644]
xedit/compile [new file with mode: 0755]
xedit/config.guess [new file with mode: 0755]
xedit/config.h.in [new file with mode: 0644]
xedit/config.sub [new file with mode: 0755]
xedit/configure [new file with mode: 0755]
xedit/configure.ac [new file with mode: 0644]
xedit/depcomp [new file with mode: 0755]
xedit/hash.c [new file with mode: 0644]
xedit/hook.c [new file with mode: 0644]
xedit/install-sh [new file with mode: 0755]
xedit/ispell.c [new file with mode: 0644]
xedit/lisp.c [new file with mode: 0644]
xedit/lisp/README [new file with mode: 0644]
xedit/lisp/TODO [new file with mode: 0644]
xedit/lisp/bytecode.c [new file with mode: 0644]
xedit/lisp/bytecode.h [new file with mode: 0644]
xedit/lisp/compile.c [new file with mode: 0644]
xedit/lisp/core.c [new file with mode: 0644]
xedit/lisp/core.h [new file with mode: 0644]
xedit/lisp/debugger.c [new file with mode: 0644]
xedit/lisp/debugger.h [new file with mode: 0644]
xedit/lisp/env.c [new file with mode: 0644]
xedit/lisp/format.c [new file with mode: 0644]
xedit/lisp/format.h [new file with mode: 0644]
xedit/lisp/hash.c [new file with mode: 0644]
xedit/lisp/hash.h [new file with mode: 0644]
xedit/lisp/helper.c [new file with mode: 0644]
xedit/lisp/helper.h [new file with mode: 0644]
xedit/lisp/internal.h [new file with mode: 0644]
xedit/lisp/io.c [new file with mode: 0644]
xedit/lisp/io.h [new file with mode: 0644]
xedit/lisp/lisp.c [new file with mode: 0644]
xedit/lisp/lisp.h [new file with mode: 0644]
xedit/lisp/lsp.c [new file with mode: 0644]
xedit/lisp/math.c [new file with mode: 0644]
xedit/lisp/math.h [new file with mode: 0644]
xedit/lisp/mathimp.c [new file with mode: 0644]
xedit/lisp/modules/indent.lsp [new file with mode: 0644]
xedit/lisp/modules/lisp.lsp [new file with mode: 0644]
xedit/lisp/modules/progmodes/auto.lsp [new file with mode: 0644]
xedit/lisp/modules/progmodes/c.lsp [new file with mode: 0644]
xedit/lisp/modules/progmodes/html.lsp [new file with mode: 0644]
xedit/lisp/modules/progmodes/imake.lsp [new file with mode: 0644]
xedit/lisp/modules/progmodes/lisp.lsp [new file with mode: 0644]
xedit/lisp/modules/progmodes/make.lsp [new file with mode: 0644]
xedit/lisp/modules/progmodes/man.lsp [new file with mode: 0644]
xedit/lisp/modules/progmodes/patch.lsp [new file with mode: 0644]
xedit/lisp/modules/progmodes/perl.lsp [new file with mode: 0644]
xedit/lisp/modules/progmodes/python.lsp [new file with mode: 0644]
xedit/lisp/modules/progmodes/rpm.lsp [new file with mode: 0644]
xedit/lisp/modules/progmodes/sgml.lsp [new file with mode: 0644]
xedit/lisp/modules/progmodes/sh.lsp [new file with mode: 0644]
xedit/lisp/modules/progmodes/xconf.lsp [new file with mode: 0644]
xedit/lisp/modules/progmodes/xlog.lsp [new file with mode: 0644]
xedit/lisp/modules/progmodes/xrdb.lsp [new file with mode: 0644]
xedit/lisp/modules/psql.c [new file with mode: 0644]
xedit/lisp/modules/syntax.lsp [new file with mode: 0644]
xedit/lisp/modules/x11.c [new file with mode: 0644]
xedit/lisp/modules/xaw.c [new file with mode: 0644]
xedit/lisp/modules/xedit.lsp [new file with mode: 0644]
xedit/lisp/modules/xt.c [new file with mode: 0644]
xedit/lisp/mp/mp.c [new file with mode: 0644]
xedit/lisp/mp/mp.h [new file with mode: 0644]
xedit/lisp/mp/mpi.c [new file with mode: 0644]
xedit/lisp/mp/mpr.c [new file with mode: 0644]
xedit/lisp/package.c [new file with mode: 0644]
xedit/lisp/package.h [new file with mode: 0644]
xedit/lisp/pathname.c [new file with mode: 0644]
xedit/lisp/pathname.h [new file with mode: 0644]
xedit/lisp/private.h [new file with mode: 0644]
xedit/lisp/re/README [new file with mode: 0644]
xedit/lisp/re/re.c [new file with mode: 0644]
xedit/lisp/re/re.h [new file with mode: 0644]
xedit/lisp/re/rec.c [new file with mode: 0644]
xedit/lisp/re/reo.c [new file with mode: 0644]
xedit/lisp/re/rep.h [new file with mode: 0644]
xedit/lisp/re/tests.c [new file with mode: 0644]
xedit/lisp/re/tests.txt [new file with mode: 0644]
xedit/lisp/read.c [new file with mode: 0644]
xedit/lisp/read.h [new file with mode: 0644]
xedit/lisp/regex.c [new file with mode: 0644]
xedit/lisp/regex.h [new file with mode: 0644]
xedit/lisp/require.c [new file with mode: 0644]
xedit/lisp/require.h [new file with mode: 0644]
xedit/lisp/stream.c [new file with mode: 0644]
xedit/lisp/stream.h [new file with mode: 0644]
xedit/lisp/string.c [new file with mode: 0644]
xedit/lisp/string.h [new file with mode: 0644]
xedit/lisp/struct.c [new file with mode: 0644]
xedit/lisp/struct.h [new file with mode: 0644]
xedit/lisp/test/hello.lsp [new file with mode: 0644]
xedit/lisp/test/list.lsp [new file with mode: 0644]
xedit/lisp/test/math.lsp [new file with mode: 0644]
xedit/lisp/test/psql-1.lsp [new file with mode: 0644]
xedit/lisp/test/psql-2.lsp [new file with mode: 0644]
xedit/lisp/test/psql-3.lsp [new file with mode: 0644]
xedit/lisp/test/regex.lsp [new file with mode: 0644]
xedit/lisp/test/stream.lsp [new file with mode: 0644]
xedit/lisp/test/widgets.lsp [new file with mode: 0644]
xedit/lisp/time.c [new file with mode: 0644]
xedit/lisp/time.h [new file with mode: 0644]
xedit/lisp/write.c [new file with mode: 0644]
xedit/lisp/write.h [new file with mode: 0644]
xedit/lisp/xedit.c [new file with mode: 0644]
xedit/lisp/xedit.h [new file with mode: 0644]
xedit/missing [new file with mode: 0755]
xedit/options.c [new file with mode: 0644]
xedit/print.c [new file with mode: 0644]
xedit/print.h [new file with mode: 0644]
xedit/printdialog.c [new file with mode: 0644]
xedit/printdialog.h [new file with mode: 0644]
xedit/printdialogprivates.h [new file with mode: 0644]
xedit/realpath.c [new file with mode: 0644]
xedit/strcasecmp.c [new file with mode: 0644]
xedit/tags.c [new file with mode: 0644]
xedit/util.c [new file with mode: 0644]
xedit/util.h [new file with mode: 0644]
xedit/xedit.c [new file with mode: 0644]
xedit/xedit.h [new file with mode: 0644]
xedit/xedit.man [new file with mode: 0644]
xeyes/COPYING [new file with mode: 0644]
xeyes/ChangeLog [new file with mode: 0644]
xeyes/Eyes.c [new file with mode: 0644]
xeyes/Eyes.h [new file with mode: 0644]
xeyes/EyesP.h [new file with mode: 0644]
xeyes/INSTALL [new file with mode: 0644]
xeyes/Makefile.am [new file with mode: 0644]
xeyes/Makefile.in [new file with mode: 0644]
xeyes/README [new file with mode: 0644]
xeyes/aclocal.m4 [new file with mode: 0644]
xeyes/config.guess [new file with mode: 0755]
xeyes/config.h.in [new file with mode: 0644]
xeyes/config.sub [new file with mode: 0755]
xeyes/configure [new file with mode: 0755]
xeyes/configure.ac [new file with mode: 0644]
xeyes/depcomp [new file with mode: 0755]
xeyes/eyes.bit [new file with mode: 0644]
xeyes/eyesmask.bit [new file with mode: 0644]
xeyes/install-sh [new file with mode: 0755]
xeyes/missing [new file with mode: 0755]
xeyes/transform.c [new file with mode: 0644]
xeyes/transform.h [new file with mode: 0644]
xeyes/xeyes.c [new file with mode: 0644]
xeyes/xeyes.man [new file with mode: 0644]
xgc/AUTHORS [new file with mode: 0644]
xgc/Bugs [new file with mode: 0644]
xgc/COPYING [new file with mode: 0644]
xgc/ChangeLog [new file with mode: 0644]
xgc/INSTALL [new file with mode: 0644]
xgc/Makefile.am [new file with mode: 0644]
xgc/Makefile.in [new file with mode: 0644]
xgc/NEWS [new file with mode: 0644]
xgc/README [new file with mode: 0644]
xgc/Written/FilledRects [new file with mode: 0644]
xgc/Written/Interface [new file with mode: 0644]
xgc/Written/Jim [new file with mode: 0644]
xgc/Written/Notes [new file with mode: 0644]
xgc/Written/Notes2 [new file with mode: 0644]
xgc/Written/Outline [new file with mode: 0644]
xgc/Written/Widget [new file with mode: 0644]
xgc/aclocal.m4 [new file with mode: 0644]
xgc/app-defaults/Xgc [new file with mode: 0644]
xgc/app-defaults/Xgc-color [new file with mode: 0644]
xgc/choice.c [new file with mode: 0644]
xgc/config.guess [new file with mode: 0755]
xgc/config.h.in [new file with mode: 0644]
xgc/config.sub [new file with mode: 0755]
xgc/configure [new file with mode: 0755]
xgc/configure.ac [new file with mode: 0644]
xgc/constants.h [new file with mode: 0644]
xgc/dashlist.c [new file with mode: 0644]
xgc/depcomp [new file with mode: 0755]
xgc/getfile.c [new file with mode: 0644]
xgc/gram.c [new file with mode: 0644]
xgc/gram.h [new file with mode: 0644]
xgc/gram.y [new file with mode: 0644]
xgc/install-sh [new file with mode: 0755]
xgc/interpret.c [new file with mode: 0644]
xgc/lex.c [new file with mode: 0644]
xgc/lex.l [new file with mode: 0644]
xgc/main.c [new file with mode: 0644]
xgc/missing [new file with mode: 0755]
xgc/planemask.c [new file with mode: 0644]
xgc/record.c [new file with mode: 0644]
xgc/testfrac.c [new file with mode: 0644]
xgc/tests.c [new file with mode: 0644]
xgc/text.c [new file with mode: 0644]
xgc/tile [new file with mode: 0644]
xgc/xgc.h [new file with mode: 0644]
xgc/xgc.man [new file with mode: 0644]
xgc/ylwrap [new file with mode: 0755]
xload/AUTHORS [new file with mode: 0644]
xload/COPYING [new file with mode: 0644]
xload/ChangeLog [new file with mode: 0644]
xload/INSTALL [new file with mode: 0644]
xload/Makefile.am [new file with mode: 0644]
xload/Makefile.in [new file with mode: 0644]
xload/NEWS [new file with mode: 0644]
xload/README [new file with mode: 0644]
xload/XLoad.ad [new file with mode: 0644]
xload/aclocal.m4 [new file with mode: 0644]
xload/compile [new file with mode: 0755]
xload/config.guess [new file with mode: 0755]
xload/config.h.in [new file with mode: 0644]
xload/config.sub [new file with mode: 0755]
xload/configure [new file with mode: 0755]
xload/configure.ac [new file with mode: 0644]
xload/depcomp [new file with mode: 0755]
xload/get_load.c [new file with mode: 0644]
xload/get_rload.c [new file with mode: 0644]
xload/install-sh [new file with mode: 0755]
xload/missing [new file with mode: 0755]
xload/xload.bit [new file with mode: 0644]
xload/xload.c [new file with mode: 0644]
xload/xload.h [new file with mode: 0644]
xload/xload.man [new file with mode: 0644]
xlogo/COPYING [new file with mode: 0644]
xlogo/ChangeLog [new file with mode: 0644]
xlogo/INSTALL [new file with mode: 0644]
xlogo/Logo.c [new file with mode: 0644]
xlogo/Logo.h [new file with mode: 0644]
xlogo/LogoP.h [new file with mode: 0644]
xlogo/Makefile.am [new file with mode: 0644]
xlogo/Makefile.in [new file with mode: 0644]
xlogo/README [new file with mode: 0644]
xlogo/RenderLogo.c [new file with mode: 0644]
xlogo/RenderLogo.h [new file with mode: 0644]
xlogo/aclocal.m4 [new file with mode: 0644]
xlogo/app-defaults/XLogo [new file with mode: 0644]
xlogo/app-defaults/XLogo-color [new file with mode: 0644]
xlogo/config.guess [new file with mode: 0755]
xlogo/config.h.in [new file with mode: 0644]
xlogo/config.sub [new file with mode: 0755]
xlogo/configure [new file with mode: 0755]
xlogo/configure.ac [new file with mode: 0644]
xlogo/depcomp [new file with mode: 0755]
xlogo/install-sh [new file with mode: 0755]
xlogo/missing [new file with mode: 0755]
xlogo/xlogo.c [new file with mode: 0644]
xlogo/xlogo.h [new file with mode: 0644]
xlogo/xlogo.man [new file with mode: 0644]
xmag/AUTHORS [new file with mode: 0644]
xmag/COPYING [new file with mode: 0644]
xmag/ChangeLog [new file with mode: 0644]
xmag/CutPaste.c [new file with mode: 0644]
xmag/CutPaste.h [new file with mode: 0644]
xmag/INSTALL [new file with mode: 0644]
xmag/Makefile.am [new file with mode: 0644]
xmag/Makefile.in [new file with mode: 0644]
xmag/NEWS [new file with mode: 0644]
xmag/README [new file with mode: 0644]
xmag/RootWin.c [new file with mode: 0644]
xmag/RootWin.h [new file with mode: 0644]
xmag/RootWinP.h [new file with mode: 0644]
xmag/Scale.c [new file with mode: 0644]
xmag/Scale.h [new file with mode: 0644]
xmag/Scale.txt [new file with mode: 0644]
xmag/ScaleP.h [new file with mode: 0644]
xmag/aclocal.m4 [new file with mode: 0644]
xmag/app-defaults/Xmag [new file with mode: 0644]
xmag/config.guess [new file with mode: 0755]
xmag/config.h.in [new file with mode: 0644]
xmag/config.sub [new file with mode: 0755]
xmag/configure [new file with mode: 0755]
xmag/configure.ac [new file with mode: 0644]
xmag/depcomp [new file with mode: 0755]
xmag/install-sh [new file with mode: 0755]
xmag/missing [new file with mode: 0755]
xmag/xmag.c [new file with mode: 0644]
xmag/xmag.icon [new file with mode: 0644]
xmag/xmag.man [new file with mode: 0644]
xman/AUTHORS [new file with mode: 0644]
xman/COPYING [new file with mode: 0644]
xman/ChangeLog [new file with mode: 0644]
xman/INSTALL [new file with mode: 0644]
xman/Makefile.am [new file with mode: 0644]
xman/Makefile.in [new file with mode: 0644]
xman/NEWS [new file with mode: 0644]
xman/README [new file with mode: 0644]
xman/ScrollByL.c [new file with mode: 0644]
xman/ScrollByL.h [new file with mode: 0644]
xman/ScrollByLP.h [new file with mode: 0644]
xman/aclocal.m4 [new file with mode: 0644]
xman/app-defaults/Xman [new file with mode: 0644]
xman/buttons.c [new file with mode: 0644]
xman/config.guess [new file with mode: 0755]
xman/config.h.in [new file with mode: 0644]
xman/config.sub [new file with mode: 0755]
xman/configure [new file with mode: 0755]
xman/configure.ac [new file with mode: 0644]
xman/defs.h [new file with mode: 0644]
xman/depcomp [new file with mode: 0755]
xman/globals.c [new file with mode: 0644]
xman/globals.h [new file with mode: 0644]
xman/handler.c [new file with mode: 0644]
xman/help.c [new file with mode: 0644]
xman/icon_help.h [new file with mode: 0644]
xman/icon_open.h [new file with mode: 0644]
xman/iconclosed.h [new file with mode: 0644]
xman/install-sh [new file with mode: 0755]
xman/main.c [new file with mode: 0644]
xman/man.c [new file with mode: 0644]
xman/man.h [new file with mode: 0644]
xman/misc.c [new file with mode: 0644]
xman/missing [new file with mode: 0755]
xman/search.c [new file with mode: 0644]
xman/tkfuncs.c [new file with mode: 0644]
xman/vendor.c [new file with mode: 0644]
xman/vendor.h [new file with mode: 0644]
xman/version.h [new file with mode: 0644]
xman/xman.help [new file with mode: 0644]
xman/xman.man [new file with mode: 0644]
xmore/AUTHORS [new file with mode: 0644]
xmore/COPYING [new file with mode: 0644]
xmore/ChangeLog [new file with mode: 0644]
xmore/INSTALL [new file with mode: 0644]
xmore/Makefile.am [new file with mode: 0644]
xmore/Makefile.in [new file with mode: 0644]
xmore/NEWS [new file with mode: 0644]
xmore/README [new file with mode: 0644]
xmore/XMore.ad [new file with mode: 0644]
xmore/aclocal.m4 [new file with mode: 0644]
xmore/compile [new file with mode: 0755]
xmore/config.guess [new file with mode: 0755]
xmore/config.h.in [new file with mode: 0644]
xmore/config.sub [new file with mode: 0755]
xmore/configure [new file with mode: 0755]
xmore/configure.ac [new file with mode: 0644]
xmore/depcomp [new file with mode: 0755]
xmore/install-sh [new file with mode: 0755]
xmore/missing [new file with mode: 0755]
xmore/mkinstalldirs [new file with mode: 0755]
xmore/print.c [new file with mode: 0644]
xmore/print.h [new file with mode: 0644]
xmore/printdialog.c [new file with mode: 0644]
xmore/printdialog.h [new file with mode: 0644]
xmore/printdialogprivates.h [new file with mode: 0644]
xmore/xmore.c [new file with mode: 0644]
xmore/xmore.h [new file with mode: 0644]
xmore/xmore.man [new file with mode: 0644]
xmore/xmore.sgml [new file with mode: 0644]
xwd/AUTHORS [new file with mode: 0644]
xwd/COPYING [new file with mode: 0755]
xwd/ChangeLog [new file with mode: 0755]
xwd/INSTALL [new file with mode: 0755]
xwd/Makefile.am [new file with mode: 0755]
xwd/Makefile.in [new file with mode: 0755]
xwd/NEWS [new file with mode: 0644]
xwd/README [new file with mode: 0755]
xwd/aclocal.m4 [new file with mode: 0755]
xwd/clientwin.c [new file with mode: 0755]
xwd/clientwin.h [new file with mode: 0755]
xwd/config.guess [new file with mode: 0755]
xwd/config.h.in [new file with mode: 0755]
xwd/config.sub [new file with mode: 0755]
xwd/configure [new file with mode: 0755]
xwd/configure.ac [new file with mode: 0755]
xwd/depcomp [new file with mode: 0755]
xwd/dsimple.c [new file with mode: 0755]
xwd/dsimple.h [new file with mode: 0755]
xwd/install-sh [new file with mode: 0755]
xwd/list.c [new file with mode: 0755]
xwd/list.h [new file with mode: 0755]
xwd/missing [new file with mode: 0755]
xwd/multiVis.c [new file with mode: 0755]
xwd/multiVis.h [new file with mode: 0755]
xwd/wsutils.h [new file with mode: 0755]
xwd/xwd.c [new file with mode: 0755]
xwd/xwd.man [new file with mode: 0755]
xwud/AUTHORS [new file with mode: 0644]
xwud/COPYING [new file with mode: 0755]
xwud/ChangeLog [new file with mode: 0755]
xwud/INSTALL [new file with mode: 0755]
xwud/Makefile.am [new file with mode: 0755]
xwud/Makefile.in [new file with mode: 0755]
xwud/NEWS [new file with mode: 0644]
xwud/README [new file with mode: 0755]
xwud/aclocal.m4 [new file with mode: 0755]
xwud/config.guess [new file with mode: 0755]
xwud/config.h.in [new file with mode: 0755]
xwud/config.sub [new file with mode: 0755]
xwud/configure [new file with mode: 0755]
xwud/configure.ac [new file with mode: 0755]
xwud/depcomp [new file with mode: 0755]
xwud/install-sh [new file with mode: 0755]
xwud/missing [new file with mode: 0755]
xwud/xwud.c [new file with mode: 0755]
xwud/xwud.man [new file with mode: 0755]

diff --git a/bitmap/AUTHORS b/bitmap/AUTHORS
new file mode 100644 (file)
index 0000000..623e682
--- /dev/null
@@ -0,0 +1,2 @@
+bitmap:                Davor Matic, MIT X Consortium
+atobm/bmtoa:   Jim Fulton, MIT X Consortium
diff --git a/bitmap/BitEdit.c b/bitmap/BitEdit.c
new file mode 100644 (file)
index 0000000..60ef2ab
--- /dev/null
@@ -0,0 +1,1122 @@
+/*
+
+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.
+
+*/
+
+/*
+ * Author:  Davor Matic, MIT X Consortium
+ */
+
+
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Xaw/Paned.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Box.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Toggle.h>
+#include <X11/Xaw/MenuButton.h>
+#include <X11/Xaw/SimpleMenu.h>
+#include <X11/Xaw/SmeLine.h>
+#include <X11/Xaw/SmeBSB.h>
+#include <X11/Xmu/SysUtil.h>
+#include "Bitmap.h"
+
+#include <X11/bitmaps/xlogo16>
+
+static char *usage = "[-options ...] filename\n\
+\n\
+where options include all standard toolkit options plus:\n\
+     -size WIDTHxHEIGHT\n\
+     -sw dimension\n\
+     -sh dimension\n\
+     -gt dimension\n\
+     -grid, +grid\n\
+     -axes, +axes\n\
+     -dashed, +dashed\n\
+     -stippled, +stippled\n\
+     -proportional, +proportional\n\
+     -basename basename\n\
+     -dashes filename\n\
+     -stipple filename\n\
+     -hl color\n\
+     -fr color\n\
+\n\
+The default WIDTHxHEIGHT is 16x16.\n";
+
+static XrmOptionDescRec options[] = {
+  { "-axes",       "*bitmap.axes",         XrmoptionNoArg,     "True"},
+  { "+axes",       "*bitmap.axes",         XrmoptionNoArg,     "False"},
+  { "-basename",    "*bitmap.basename",            XrmoptionSepArg,    NULL},
+  { "-dashed",     "*bitmap.dashed",       XrmoptionNoArg,     "True"},
+  { "+dashed",     "*bitmap.dashed",       XrmoptionNoArg,     "False"},
+  { "-dashes",     "*bitmap.dashes",       XrmoptionSepArg,    NULL},
+  { "-fr",         "*bitmap.frame",        XrmoptionSepArg,    NULL},
+  { "-gt",         "*bitmap.gridTolerance",XrmoptionSepArg,    NULL},
+  { "-grid",       "*bitmap.grid",         XrmoptionNoArg,     "True"},
+  { "+grid",       "*bitmap.grid",         XrmoptionNoArg,     "False"},
+  { "-hl",         "*bitmap.highlight",    XrmoptionSepArg,    NULL},
+  { "-proportional","*bitmap.proportional", XrmoptionNoArg,    "True"},
+  { "+proportional","*bitmap.proportional", XrmoptionNoArg,    "False"},
+  { "-size",       "*bitmap.size",         XrmoptionSepArg,    NULL},
+  { "-sh",         "*bitmap.squareHeight", XrmoptionSepArg,    NULL},
+  { "-sw",         "*bitmap.squareWidth",  XrmoptionSepArg,    NULL},
+  { "-stipple",            "*bitmap.stipple",      XrmoptionSepArg,    NULL},
+  { "-stippled",    "*bitmap.stippled",            XrmoptionNoArg,     "True"},
+  { "+stippled",    "*bitmap.stippled",            XrmoptionNoArg,     "False"},
+};
+
+typedef struct {
+  int             id;
+  String          name;
+  Boolean         trap;
+  Widget          widget;
+  } ButtonRec;
+
+static ButtonRec file_menu[] = {
+#define New 101
+  {New, "new", True},
+#define Load 102
+  {Load, "load", True},
+#define Insert 103
+  {Insert, "insert", True},
+#define Save 104
+  {Save, "save", True},
+#define SaveAs 105
+  {SaveAs, "saveAs", True},
+#define Resize 106
+  {Resize, "resize", True},
+#define Rescale 107
+  {Rescale, "rescale", True},
+#define Filename 108
+  {Filename, "filename", True},
+#define Basename 109
+  {Basename, "basename", True},
+#define Dummy -1
+  {Dummy, "line", False},
+#define Quit 110
+  {Quit, "quit", True},
+};
+
+static ButtonRec edit_menu[] = {
+#define Image 201
+  {Image, "image", True},
+#define Grid 203
+  {Grid, "grid", True},
+#define Dashed 204
+  {Dashed, "dashed", True},
+#define Axes 205
+  {Axes, "axes", True},
+#define Stippled 206
+  {Stippled, "stippled", True},
+#define Proportional 207
+  {Proportional, "proportional", True},
+#define Zoom 208
+  {Zoom, "zoom", True},
+/* Dummy */
+  {Dummy, "line", False},
+#define Cut 209
+  {Cut, "cut", True},
+#define Copy 210
+  {Copy, "copy", True},
+#define Paste 211
+  {Paste, "paste", True},
+};
+
+static ButtonRec buttons[] = {
+/*#define Clear 1*/
+  {Clear, "clear", False},
+/*#define Set 2*/
+  {Set, "set", False},
+/*#define Invert 3*/
+  {Invert, "invert", False},
+#define Mark 26
+  {Mark, "mark", True},
+#define Unmark 27
+  {Unmark, "unmark", False},
+#define CopyImm 4
+  {CopyImm, "copy", True},
+#define MoveImm 5
+  {MoveImm, "move", True},
+#define FlipHoriz 6
+  {FlipHoriz, "flipHoriz", False},
+#define Up 7
+  {Up, "up", False},
+#define FlipVert 8
+  {FlipVert, "flipVert", False},
+#define Left 9
+  {Left, "left", False},
+#define Fold 10
+  {Fold, "fold", False},
+#define Right 11
+  {Right, "right", False},
+#define RotateLeft 12
+  {RotateLeft, "rotateLeft", False},
+#define Down 13
+  {Down, "down", False},
+#define RotateRight 14
+  {RotateRight, "rotateRight", False},
+#define Point 15
+  {Point, "point", True},
+#define Curve 16
+  {Curve, "curve", True},
+#define Line 17
+  {Line, "line", True},
+#define Rectangle 18
+  {Rectangle, "rectangle", True},
+#define FilledRectangle 19
+  {FilledRectangle, "filledRectangle", True},
+#define Circle 20
+  {Circle, "circle", True},
+#define FilledCircle 21
+  {FilledCircle, "filledCircle", True},
+#define FloodFill 22
+  {FloodFill, "floodFill", True},
+#define SetHotSpot 23
+  {SetHotSpot, "setHotSpot", True},
+#define ClearHotSpot 24
+  {ClearHotSpot, "clearHotSpot", False},
+#define Undo 25
+  {Undo, "undo", False},
+};
+
+#include "Dialog.h"
+
+static Widget 
+    top_widget, 
+    parent_widget,
+    formy_widget,
+    fileMenu_widget,
+    editMenu_widget,
+    status_widget,
+    pane_widget, 
+    form_widget,
+    bitmap_widget,
+    image_shell,
+    box_widget,
+    normal_image_widget,
+    inverted_image_widget;
+static Boolean image_visible = False;
+static Pixmap check_mark;
+static Dialog input_dialog, error_dialog, qsave_dialog;
+static Time btime;
+static String filename = NULL, base_name = NULL, format;
+static char message[80];
+
+
+void FixMenu ( Widget w, XEvent *event, String *params, Cardinal *num_params );
+void SwitchImage ( void );
+void SwitchGrid( void );
+void SwitchDashed( void );
+void SwitchAxes( void );
+void SwitchStippled( void );
+void SwitchProportional( void );
+void SwitchZoom( void );
+void DoCut( void );
+void DoCopy( void );
+void DoPaste( void );
+void DoNew( void );
+void DoLoad( void );
+void DoInsert( void );
+void DoSave( void );
+void DoSaveAs( void );
+void DoResize( void );
+void DoRescale( void );
+void DoFilename( void );
+void DoBasename( void );
+void DoQuit ( Widget w, XEvent *event, String *params, Cardinal *num_params );
+
+static XtActionsRec actions_table[] = {
+  {"fix-menu", FixMenu},
+  {"switch-image", (XtActionProc)SwitchImage},
+  {"switch-grid", (XtActionProc)SwitchGrid},
+  {"switch-dashed", (XtActionProc)SwitchDashed},
+  {"switch-axes", (XtActionProc)SwitchAxes},
+  {"switch-stippled", (XtActionProc)SwitchStippled},
+  {"switch-proportional", (XtActionProc)SwitchProportional},
+  {"switch-zoom", (XtActionProc)SwitchZoom},
+  {"do-cut", (XtActionProc)DoCut},
+  {"do-copy", (XtActionProc)DoCopy},
+  {"do-paste", (XtActionProc)DoPaste},
+  {"do-new", (XtActionProc)DoNew},
+  {"do-load", (XtActionProc)DoLoad},
+  {"do-insert", (XtActionProc)DoInsert},
+  {"do-save", (XtActionProc)DoSave},
+  {"do-save-as", (XtActionProc)DoSaveAs},
+  {"do-resize", (XtActionProc)DoResize},
+  {"do-rescale", (XtActionProc)DoRescale},
+  {"do-filename", (XtActionProc)DoFilename},
+  {"do-basename", (XtActionProc)DoBasename},
+  {"do-quit", DoQuit}
+};
+
+static Atom wm_delete_window;
+
+static void 
+FixImage(void)
+{
+    Pixmap old_image, image;
+    int n;
+    Arg wargs[2];
+
+    if (!image_visible) return;
+    
+    n=0;
+    XtSetArg(wargs[n], XtNbitmap, &old_image); n++;
+    XtGetValues(normal_image_widget, wargs, n);
+    
+    
+    image = BWGetUnzoomedPixmap(bitmap_widget);
+    
+    n=0;
+    XtSetArg(wargs[n], XtNbitmap, image); n++;
+    XtSetValues(normal_image_widget, wargs, n);
+    XtSetValues(inverted_image_widget, wargs, n);
+
+    if (old_image != XtUnspecifiedPixmap)
+       XFreePixmap(XtDisplay(bitmap_widget), old_image);
+}
+
+static void 
+FixStatus(void)
+{
+    int n;
+    Arg wargs[2];
+    String str, label;
+
+    str = BWUnparseStatus(bitmap_widget);
+
+    n=0;
+    XtSetArg(wargs[n], XtNlabel, &label); n++;
+    XtGetValues(status_widget, wargs, n);
+
+    if (strcmp(str, label)) {
+      n = 0;
+      XtSetArg(wargs[n], XtNlabel, str); n++;
+      XtSetValues(status_widget, wargs, n);
+    }
+
+    /*XtFree(str); */
+}
+
+static void 
+FixUp(void)
+{
+  FixImage();
+  FixStatus();
+}
+
+static void 
+FixEntry(Widget w, int *id)
+{
+    int n;
+    Arg wargs[2];
+    Time dummy = 0;
+
+    n = 0;
+    
+    switch (*id) {
+       
+    case Image:
+       XtSetArg(wargs[n], XtNleftBitmap, 
+                image_visible ? check_mark : None); n++;
+       break;
+       
+    case Grid:
+       XtSetArg(wargs[n], XtNleftBitmap, 
+                BWQueryGrid(bitmap_widget) ? check_mark : None); n++;
+       break;
+       
+    case Dashed:
+       XtSetArg(wargs[n], XtNleftBitmap, 
+                BWQueryDashed(bitmap_widget) ? check_mark : None); n++;
+       break;
+       
+    case Axes:
+       XtSetArg(wargs[n], XtNleftBitmap, 
+                BWQueryAxes(bitmap_widget) ? check_mark : None); n++;
+       break;
+       
+    case Stippled:
+       XtSetArg(wargs[n], XtNleftBitmap, 
+                BWQueryStippled(bitmap_widget) ? check_mark : None); n++;
+       break;
+       
+    case Proportional:
+       XtSetArg(wargs[n], XtNleftBitmap, 
+                BWQueryProportional(bitmap_widget) ? check_mark : None); n++;
+       break;
+       
+    case Zoom:
+       XtSetArg(wargs[n], XtNleftBitmap, 
+                BWQueryZooming(bitmap_widget) ? check_mark : None); n++;
+       break;
+
+    case Copy:
+    case Cut:
+       XtSetArg(wargs[n], XtNsensitive, BWQueryMarked(bitmap_widget)); n++;
+       break;
+
+    case Paste:
+       XtSetArg(wargs[n], XtNsensitive, 
+                BWQuerySelection(bitmap_widget, dummy)); n++;
+       break;
+
+    default:
+       return;
+    }
+    
+    XtSetValues(w, wargs, n);
+}
+
+/* ARGSUSED */
+void FixMenu(Widget w, 
+            XEvent *event, 
+            String *params, 
+            Cardinal *num_params)
+{
+    int i;
+
+    btime = event->xbutton.time;
+    
+    for (i = 0; i < XtNumber(edit_menu); i++)
+       FixEntry(edit_menu[i].widget, &edit_menu[i].id);
+}
+
+static int zero = 0;
+#define Plain  (char *)&zero,sizeof(int)
+/* ARGSUSED */
+static void 
+TheCallback(Widget w,  /* not used */
+           XtPointer clientData, 
+           XtPointer callData)
+{
+    int *id = (int *)clientData;
+    switch (*id) {
+       
+    case New:
+      DoNew();
+      break;
+
+    case Load:
+      DoLoad();
+      break;
+       
+    case Insert:
+      DoInsert();
+      break;
+       
+    case Save:
+      DoSave();
+      break;
+       
+    case SaveAs:
+      DoSaveAs();
+      break;
+       
+    case Resize:
+      DoResize();
+      break;
+
+    case Rescale:
+      DoRescale();
+      break;
+
+    case Filename:
+      DoFilename();
+      break;
+
+    case Basename:
+      DoBasename();
+      break;
+       
+    case Image:
+      SwitchImage();
+      break;
+
+    case Grid:
+      SwitchGrid();
+      break;
+       
+    case Dashed:
+      SwitchDashed();
+      break;
+
+    case Axes:
+      SwitchAxes();
+      break;   
+
+    case Stippled:
+      SwitchStippled();
+      break;
+      
+    case Proportional:
+      SwitchProportional();
+      break;
+               
+    case Zoom:
+      SwitchZoom();
+      break;
+      
+    case Cut:
+      DoCut();
+      break;
+      
+    case Copy:
+      DoCopy();
+      break;
+      
+    case Paste:
+      DoPaste();
+      break;
+       
+    case Clear:
+       BWStoreToBuffer(bitmap_widget);
+       BWClear(bitmap_widget);
+       BWChangeNotify(bitmap_widget);
+       BWSetChanged(bitmap_widget);
+       break;
+       
+    case Set:
+       BWStoreToBuffer(bitmap_widget);
+       BWSet(bitmap_widget);
+       BWChangeNotify(bitmap_widget);
+       BWSetChanged(bitmap_widget);
+break;
+       
+    case Invert:
+       BWStoreToBuffer(bitmap_widget);
+       BWInvert(bitmap_widget);
+       BWChangeNotify(bitmap_widget);
+       BWSetChanged(bitmap_widget);
+       break;
+
+    case Mark:
+        BWRemoveAllRequests(bitmap_widget);
+        BWEngageRequest(bitmap_widget, MarkRequest, True, Plain);
+        break;
+
+    case Unmark:
+        BWUnmark(bitmap_widget);
+        break;
+
+    case CopyImm:
+       BWRemoveAllRequests(bitmap_widget);
+       if (BWQueryMarked(bitmap_widget)) {
+           BWAddRequest(bitmap_widget, MarkRequest, False, Plain);
+           BWEngageRequest(bitmap_widget, CopyRequest, True, Plain);
+       }
+       else {
+           BWEngageRequest(bitmap_widget, MarkRequest, False, Plain);
+           BWAddRequest(bitmap_widget, CopyRequest, True, Plain);
+       }
+       break;
+       
+    case MoveImm:
+       BWRemoveAllRequests(bitmap_widget);
+       if (BWQueryMarked(bitmap_widget)) {
+           BWAddRequest(bitmap_widget, MarkRequest, False, Plain);
+           BWEngageRequest(bitmap_widget, MoveRequest, True, Plain);
+       }
+       else {
+           BWEngageRequest(bitmap_widget, MarkRequest, False, Plain);
+           BWAddRequest(bitmap_widget, MoveRequest, True, Plain);
+       }
+       break;
+               
+    case Up:
+       BWStoreToBuffer(bitmap_widget);
+       BWUp(bitmap_widget);
+       BWChangeNotify(bitmap_widget);
+       BWSetChanged(bitmap_widget);
+       break;
+       
+    case Down:
+       BWStoreToBuffer(bitmap_widget);
+       BWDown(bitmap_widget);
+       BWChangeNotify(bitmap_widget);
+       BWSetChanged(bitmap_widget);
+       break;
+       
+    case Left:
+       BWStoreToBuffer(bitmap_widget);
+       BWLeft(bitmap_widget);
+       BWChangeNotify(bitmap_widget);
+       BWSetChanged(bitmap_widget);
+       break;
+       
+    case Right:
+       BWStoreToBuffer(bitmap_widget);
+       BWRight(bitmap_widget);
+       BWChangeNotify(bitmap_widget);
+       BWSetChanged(bitmap_widget);
+       break;
+       
+    case Fold:
+       BWStoreToBuffer(bitmap_widget);
+       BWFold(bitmap_widget);
+       BWChangeNotify(bitmap_widget);
+       BWSetChanged(bitmap_widget);
+       break;
+       
+    case FlipHoriz:
+       BWStoreToBuffer(bitmap_widget);
+       BWFlipHoriz(bitmap_widget);
+       BWChangeNotify(bitmap_widget);
+       BWSetChanged(bitmap_widget);
+       break;
+       
+    case FlipVert:
+       BWStoreToBuffer(bitmap_widget);
+       BWFlipVert(bitmap_widget);
+       BWChangeNotify(bitmap_widget);
+       BWSetChanged(bitmap_widget);
+       break;
+       
+    case RotateRight:
+       BWStoreToBuffer(bitmap_widget);
+       BWRotateRight(bitmap_widget);
+       BWChangeNotify(bitmap_widget);
+       BWSetChanged(bitmap_widget);
+       break;
+       
+    case RotateLeft:
+       BWStoreToBuffer(bitmap_widget);
+       BWRotateLeft(bitmap_widget);
+       BWChangeNotify(bitmap_widget);
+       BWSetChanged(bitmap_widget);
+       break;
+       
+    case Point:
+       BWRemoveAllRequests(bitmap_widget);
+       BWEngageRequest(bitmap_widget, PointRequest, True, Plain);
+       break;
+
+    case Curve:
+       BWRemoveAllRequests(bitmap_widget);
+       BWEngageRequest(bitmap_widget, CurveRequest, True, Plain);
+       break;
+       
+    case Line:
+       BWRemoveAllRequests(bitmap_widget);
+       BWEngageRequest(bitmap_widget, LineRequest, True, Plain);
+       break;
+       
+    case Rectangle:
+       BWRemoveAllRequests(bitmap_widget);
+       BWEngageRequest(bitmap_widget, RectangleRequest, True, Plain);
+       break;
+       
+    case FilledRectangle:
+       BWRemoveAllRequests(bitmap_widget);
+       BWEngageRequest(bitmap_widget, FilledRectangleRequest, True, Plain);
+       break;
+       
+    case Circle:
+       BWRemoveAllRequests(bitmap_widget);
+       BWEngageRequest(bitmap_widget, CircleRequest, True, Plain);
+       break;
+       
+    case FilledCircle:
+       BWRemoveAllRequests(bitmap_widget);
+       BWEngageRequest(bitmap_widget, FilledCircleRequest, True, Plain);
+       break;
+       
+    case FloodFill:
+       BWRemoveAllRequests(bitmap_widget);
+       BWEngageRequest(bitmap_widget, FloodFillRequest, True, Plain);
+       break;
+       
+    case SetHotSpot:
+       BWRemoveAllRequests(bitmap_widget);
+       BWEngageRequest(bitmap_widget, HotSpotRequest, True, Plain);
+       break;
+       
+    case ClearHotSpot:
+       BWStoreToBuffer(bitmap_widget);
+       BWClearHotSpot(bitmap_widget);
+       BWChangeNotify(bitmap_widget);
+       BWSetChanged(bitmap_widget);
+       break;
+
+    case Undo:
+       BWUndo(bitmap_widget);
+       BWChangeNotify(bitmap_widget);
+       BWSetChanged(bitmap_widget);
+       break;  
+
+    case Quit:
+      DoQuit(bitmap_widget, NULL, NULL, NULL);
+      break;   
+    } /* don't add anything below this line */
+}
+
+/* ARGSUSED */
+
+void SwitchImage(void)
+{
+  if (image_visible) {
+    XtPopdown(image_shell);
+    image_visible = False;
+  }
+  else {
+    Position image_x, image_y;
+    int n;
+    Arg wargs[3];
+    
+    XtTranslateCoords(bitmap_widget,
+                     10, 10, &image_x, &image_y);
+    
+    n = 0;
+    XtSetArg(wargs[n], XtNx, image_x); n++;
+    XtSetArg(wargs[n], XtNy, image_y); n++;
+    XtSetValues(image_shell, wargs, n);
+    
+    image_visible = True;
+    
+    FixImage();
+    XtPopup(image_shell, XtGrabNone);
+    FixImage();
+  }
+}
+
+void SwitchGrid(void)
+{
+  BWSwitchGrid(bitmap_widget);
+}
+
+void SwitchDashed(void)
+{
+  BWSwitchDashed(bitmap_widget);
+}
+
+void SwitchAxes(void)
+{
+  BWSwitchAxes(bitmap_widget);
+}
+
+void SwitchStippled(void)
+{
+  BWSwitchStippled(bitmap_widget); 
+}
+
+void SwitchProportional(void)
+{
+  BWSwitchProportional(bitmap_widget);
+}
+
+void SwitchZoom(void)
+{
+  if (BWQueryZooming(bitmap_widget)) {
+    BWZoomOut(bitmap_widget);
+    BWChangeNotify(bitmap_widget);
+  }
+  else {
+    if (BWQueryMarked(bitmap_widget)) {
+      BWStoreToBuffer(bitmap_widget);
+      BWZoomMarked(bitmap_widget);
+      BWChangeNotify(bitmap_widget);
+    }
+    else {
+      BWEngageRequest(bitmap_widget, ZoomInRequest, False, Plain);
+    }
+  }
+}
+
+void DoCut(void)
+{
+  BWStore(bitmap_widget);
+  BWStoreToBuffer(bitmap_widget);
+  BWClearMarked(bitmap_widget);
+  BWUnmark(bitmap_widget);
+  BWChangeNotify(bitmap_widget);
+  BWSetChanged(bitmap_widget);
+}
+
+void DoCopy(void)
+{
+  BWStore(bitmap_widget);
+  BWUnmark(bitmap_widget);
+}
+
+void DoPaste(void)
+{
+  BWRequestSelection(bitmap_widget, btime, TRUE); 
+  BWEngageRequest(bitmap_widget, RestoreRequest, False, Plain);
+}
+
+void DoNew(void)
+{
+  BWGetFilename(bitmap_widget, &filename);
+  if (PopupDialog(input_dialog, "New file:",
+                 filename, &filename, XtGrabExclusive) == Okay) {
+    BWChangeFilename(bitmap_widget, filename);
+    BWChangeBasename(bitmap_widget, filename);
+    BWStoreToBuffer(bitmap_widget);
+    BWClear(bitmap_widget);
+    BWClearHotSpot(bitmap_widget);
+    BWChangeNotify(bitmap_widget);
+    BWClearChanged(bitmap_widget);
+    BWUnmark(bitmap_widget);
+    FixStatus();
+  }
+}
+
+void DoLoad(void)
+{
+  if (BWQueryChanged(bitmap_widget)) {
+    BWGetFilename(bitmap_widget, &filename);
+  RetryLoadSave:
+    switch (PopupDialog(qsave_dialog, "Save file before loading?",
+                       filename, &filename, XtGrabExclusive)) {
+    case Yes:
+      if (BWWriteFile(bitmap_widget, filename, NULL)
+         != BitmapSuccess) {
+       XmuSnprintf(message, sizeof(message), "Can't write file: %s", filename);
+       if (PopupDialog(error_dialog, message,
+                       NULL, NULL, XtGrabExclusive) == Retry)
+         goto RetryLoadSave;
+      }
+      break;
+      
+    case Cancel:
+      return;
+    }
+  }
+  BWGetFilepath(bitmap_widget, &filename);
+ RetryLoad:
+  if (PopupDialog(input_dialog, "Load file:",
+                 filename, &filename, XtGrabExclusive) == Okay) {
+    if (BWReadFile(bitmap_widget, filename, NULL) != BitmapSuccess) {
+      XmuSnprintf(message, sizeof(message), "Can't read file: %s", filename);
+      if (PopupDialog(error_dialog, message,
+                     NULL, NULL, XtGrabExclusive) == Retry)
+       goto RetryLoad;
+    }
+    else {
+      BWChangeNotify(bitmap_widget);
+      BWClearChanged(bitmap_widget);
+      FixStatus();
+    }
+  }
+}
+
+void DoInsert(void)
+{
+  BWGetFilepath(bitmap_widget, &filename);
+ RetryInsert:
+  if (PopupDialog(input_dialog, "Insert file:",
+                 filename, &filename, XtGrabExclusive) == Okay) {
+    if (BWStoreFile(bitmap_widget, filename, NULL) != BitmapSuccess) {
+      XmuSnprintf(message, sizeof(message), "Can't read file: %s", filename);
+      if (PopupDialog(error_dialog, message,
+                     NULL, NULL, XtGrabExclusive) == Retry)
+       goto RetryInsert;
+    }
+    else {
+      BWEngageRequest(bitmap_widget, RestoreRequest, False, Plain);
+    }
+  }
+}
+
+void DoSave(void)
+{
+  BWGetFilename(bitmap_widget, &filename);
+  if (!strcmp(filename, "")) 
+    DoSaveAs();
+  else if (BWWriteFile(bitmap_widget, NULL, NULL) != BitmapSuccess) {
+    XmuSnprintf(message, sizeof(message), "Can't write file: %s", filename);
+    if (PopupDialog(error_dialog, message,
+                   NULL, NULL, XtGrabExclusive) == Retry) 
+      DoSaveAs();
+  }
+  else {
+    BWClearChanged(bitmap_widget);
+  }
+}
+
+void DoSaveAs(void)
+{
+  BWGetFilename(bitmap_widget, &filename);
+ RetrySave:
+  if (PopupDialog(input_dialog, "Save file:",
+                 filename, &filename, XtGrabExclusive) == Okay) {
+    if (BWWriteFile(bitmap_widget, filename, NULL) != BitmapSuccess) {
+      XmuSnprintf(message, sizeof(message), "Can't write file: %s", filename);
+      if (PopupDialog(error_dialog, message,
+                     NULL, NULL, XtGrabExclusive) == Retry)
+       goto RetrySave;
+    }
+    else {
+      BWClearChanged(bitmap_widget);
+      FixStatus();
+    }
+  }
+}
+
+void DoResize(void)
+{
+  Dimension width, height;
+  format = "";
+ RetryResize:
+  if (PopupDialog(input_dialog, "Resize to WIDTHxHEIGHT:",
+                 format, &format, XtGrabExclusive) == Okay) {
+    if (BWParseSize(format, &width, &height)) {
+      BWResize(bitmap_widget, width, height);
+      BWChangeNotify(bitmap_widget);
+      BWSetChanged(bitmap_widget);
+      FixStatus();
+    }
+    else {
+      XmuSnprintf(message, sizeof(message), "Wrong format: %s", format);
+      if (PopupDialog(error_dialog, message,
+                     NULL, NULL, XtGrabExclusive) == Retry)
+       goto RetryResize;
+    }
+  }
+}
+
+void DoRescale(void)
+{
+  Dimension width, height;
+
+  format = "";
+ RetryRescale:
+  if (PopupDialog(input_dialog, "Rescale to WIDTHxHEIGHT:",
+                 format, &format, XtGrabExclusive) == Okay) {
+    if (BWParseSize(format, &width, &height)) {
+      BWRescale(bitmap_widget, width, height);
+      BWChangeNotify(bitmap_widget);
+      BWSetChanged(bitmap_widget);
+      FixStatus();
+    }
+    else {
+      XmuSnprintf(message, sizeof(message), "Wrong format: %s", format);
+      if (PopupDialog(error_dialog, message,
+                     NULL, NULL, XtGrabExclusive) == Retry)
+       goto RetryRescale;
+    }
+  }
+}
+
+void DoFilename(void)
+{
+  BWGetFilename(bitmap_widget, &filename);
+  if (PopupDialog(input_dialog, "Change filename:",
+                 filename, &filename, XtGrabExclusive) == Okay) {
+    BWChangeFilename(bitmap_widget, filename);
+    FixStatus();
+  }
+}
+
+void DoBasename(void)
+{  
+  BWGetBasename(bitmap_widget, &base_name);
+  if (PopupDialog(input_dialog, "Change basename:",
+                 base_name, &base_name, XtGrabExclusive) == Okay) {
+    BWChangeBasename(bitmap_widget, base_name);
+    FixStatus();
+  }
+}
+
+void DoQuit(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+  if (BWQueryChanged(bitmap_widget)) {
+    BWGetFilename(bitmap_widget, &filename);
+  RetryQuit:
+    switch (PopupDialog(qsave_dialog, "Save file before quitting?",
+                       filename, &filename, XtGrabExclusive)) {
+    case Yes:
+      if (BWWriteFile(bitmap_widget, filename, NULL) 
+         != BitmapSuccess) {
+       XmuSnprintf(message, sizeof(message), "Can't write file: %s", filename);
+       if (PopupDialog(error_dialog, message, 
+                       NULL, NULL, XtGrabExclusive) == Retry) 
+         goto RetryQuit;
+       else return;
+      }
+      break;
+      
+    case Cancel:
+      return;
+    }
+  }
+  exit(0);
+}
+
+int main(int argc, char *argv[])
+{
+    int i, n;
+    Arg wargs[2];
+    Widget w;
+    Widget radio_group = NULL; 
+    XtPointer radio_data = NULL;
+    
+    top_widget = XtInitialize(NULL, "Bitmap", 
+                             options, XtNumber(options), &argc, argv);
+
+    if (argc > 2) {
+       fprintf(stderr, usage);
+       exit (0);
+    }
+
+    check_mark = XCreateBitmapFromData(XtDisplay(top_widget),
+                                     RootWindowOfScreen(XtScreen(top_widget)),
+                                     (char *) xlogo16_bits, 
+                                     xlogo16_width, 
+                                     xlogo16_height);
+
+    XtAddActions(actions_table, XtNumber(actions_table));
+    XtOverrideTranslations
+      (top_widget,
+       XtParseTranslationTable("<Message>WM_PROTOCOLS: do-quit()"));
+
+    parent_widget = XtCreateManagedWidget("parent", panedWidgetClass,
+                                        top_widget, NULL, 0);
+
+    formy_widget = XtCreateManagedWidget("formy", formWidgetClass,
+                                      parent_widget, NULL, 0);
+
+    fileMenu_widget = XtCreatePopupShell("fileMenu", 
+                                        simpleMenuWidgetClass, 
+                                        formy_widget, NULL, 0);
+    
+    (void) XtCreateManagedWidget("fileButton",
+                                menuButtonWidgetClass, 
+                                formy_widget, NULL, 0);
+
+    for (i = 0; i < XtNumber(file_menu); i++) {
+       w = XtCreateManagedWidget(file_menu[i].name, 
+                                 (file_menu[i].trap ? 
+                                  smeBSBObjectClass : smeLineObjectClass),
+                                 fileMenu_widget, NULL, 0),
+       XtAddCallback(w,
+                     XtNcallback,
+                     TheCallback,
+                     (XtPointer)&file_menu[i].id);
+       
+       file_menu[i].widget = w;
+    }
+        
+    editMenu_widget = XtCreatePopupShell("editMenu", 
+                                        simpleMenuWidgetClass, 
+                                        formy_widget, NULL, 0);
+    
+    (void) XtCreateManagedWidget("editButton", 
+                                menuButtonWidgetClass, 
+                                formy_widget, NULL, 0);
+
+    for (i = 0; i < XtNumber(edit_menu); i++) {
+       w = XtCreateManagedWidget(edit_menu[i].name, 
+                                 (edit_menu[i].trap ? 
+                                  smeBSBObjectClass : smeLineObjectClass),
+                                 editMenu_widget, NULL, 0),
+       XtAddCallback(w,
+                     XtNcallback,
+                     TheCallback,
+                     (XtPointer)&edit_menu[i].id);
+       
+       edit_menu[i].widget = w;
+    }
+
+    status_widget = XtCreateManagedWidget("status", labelWidgetClass,
+                                         formy_widget, NULL, 0);
+
+    pane_widget = XtCreateManagedWidget("pane", panedWidgetClass,
+                                       parent_widget, NULL, 0);
+
+    form_widget = XtCreateManagedWidget("form", formWidgetClass, 
+                                       pane_widget, NULL, 0);
+        
+    for (i = 0; i < XtNumber(buttons); i++) {
+       w = XtCreateManagedWidget(buttons[i].name, 
+                                 (buttons[i].trap ? 
+                                  toggleWidgetClass : commandWidgetClass),
+                                 form_widget, NULL, 0);
+
+       XtAddCallback(w,
+                     XtNcallback,
+                     TheCallback,
+                     (XtPointer)&buttons[i].id);
+
+       buttons[i].widget = w;
+
+       if (buttons[i].id == Point) {
+           radio_group = buttons[i].widget;
+           radio_data  = buttons[i].name;
+       }
+    }
+    bitmap_widget = XtCreateManagedWidget("bitmap", bitmapWidgetClass,
+                                         pane_widget, NULL, 0);
+    XtRealizeWidget(top_widget);
+    if (argc > 1)
+      if (BWReadFile(bitmap_widget, argv[1], NULL)) 
+
+    wm_delete_window = XInternAtom(XtDisplay(top_widget), "WM_DELETE_WINDOW",
+                                  False);
+    (void) XSetWMProtocols (XtDisplay(top_widget), XtWindow(top_widget),
+                            &wm_delete_window, 1);
+
+    
+    image_shell = XtCreatePopupShell("image", transientShellWidgetClass,
+                                    top_widget, NULL, 0);
+
+    box_widget = XtCreateManagedWidget("box", boxWidgetClass,
+                                      image_shell, NULL, 0);
+
+    normal_image_widget = XtCreateManagedWidget("normalImage", 
+                                               labelWidgetClass,
+                                               box_widget, NULL, 0);
+
+    inverted_image_widget = XtCreateManagedWidget("invertedImage", 
+                                                 labelWidgetClass,
+                                                 box_widget, NULL, 0);
+    
+    n=0;
+    XtSetArg(wargs[n], XtNbitmap, BWGetUnzoomedPixmap(bitmap_widget)); n++;
+    XtSetValues(normal_image_widget, wargs, n);
+    XtSetValues(inverted_image_widget, wargs, n);
+    
+    XtRealizeWidget(image_shell);
+
+    BWNotify(bitmap_widget, (XtActionProc)FixUp);
+
+    FixStatus();
+
+    input_dialog = CreateDialog(top_widget, "input", Okay | Cancel);
+    error_dialog = CreateDialog(top_widget, "error", Abort | Retry);    
+    qsave_dialog = CreateDialog(top_widget, "qsave", Yes | No | Cancel);
+
+    XawToggleSetCurrent(radio_group, radio_data);
+    BWEngageRequest(bitmap_widget, PointRequest, True, Plain);
+
+    XtMainLoop();
+    exit(0);
+}
diff --git a/bitmap/Bitmap.c b/bitmap/Bitmap.c
new file mode 100644 (file)
index 0000000..c2fc30e
--- /dev/null
@@ -0,0 +1,1948 @@
+/*
+
+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.
+
+*/
+
+/*
+ * Author:  Davor Matic, MIT X Consortium
+ */
+
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <X11/Xaw/XawInit.h>
+#include <X11/Xmu/CharSet.h>
+#include <X11/Xmu/Drawing.h>
+#include <X11/Xmu/SysUtil.h>
+#include <X11/Xatom.h>
+#include <X11/Xfuncs.h>
+#include <X11/Xos.h>
+#include "BitmapP.h"
+#include "Bitmap.h"
+    
+#include <stdio.h>
+#include <math.h>
+
+#define min(x, y)                     ((((int)(x)) < (int)(y)) ? (x) : (y))
+#define max(x, y)                     ((((int)(x)) > (int)(y)) ? (x) : (y))
+
+Boolean DEBUG;
+
+#define DefaultGridTolerance 8
+#define DefaultBitmapSize    "16x16"
+#define FallbackBitmapWidth  16
+#define FallbackBitmapHeight 16
+#define DefaultGrid          TRUE
+#define DefaultDashed        TRUE
+#define DefaultStippled      TRUE
+#define DefaultProportional  TRUE
+#define DefaultAxes          FALSE
+#define DefaultMargin        16
+#define DefaultSquareWidth   16
+#define DefaultSquareHeight  16
+#define DefaultFilename      ""
+
+#define Offset(field) XtOffsetOf(BitmapRec, bitmap.field)
+
+static XtResource resources[] = {
+{XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
+     Offset(foreground_pixel), XtRString, XtDefaultForeground},
+{XtNhighlight, XtCHighlight, XtRPixel, sizeof(Pixel),
+     Offset(highlight_pixel), XtRString, XtDefaultForeground},
+{XtNframe, XtCFrame, XtRPixel, sizeof(Pixel),
+     Offset(frame_pixel), XtRString, XtDefaultForeground},
+{XtNgridTolerance, XtCGridTolerance, XtRDimension, sizeof(Dimension),
+     Offset(grid_tolerance), XtRImmediate, (XtPointer) DefaultGridTolerance},
+{XtNsize, XtCSize, XtRString, sizeof(String),
+     Offset(size), XtRImmediate, (XtPointer) DefaultBitmapSize},
+{XtNdashed, XtCDashed, XtRBoolean, sizeof(Boolean),
+     Offset(dashed), XtRImmediate, (XtPointer) DefaultDashed},
+{XtNgrid, XtCGrid, XtRBoolean, sizeof(Boolean),
+     Offset(grid), XtRImmediate, (XtPointer) DefaultGrid},
+{XtNstippled, XtCStippled, XtRBoolean, sizeof(Boolean),
+     Offset(stippled), XtRImmediate, (XtPointer) DefaultStippled},
+{XtNproportional, XtCProportional, XtRBoolean, sizeof(Boolean),
+     Offset(proportional), XtRImmediate, (XtPointer) DefaultProportional},
+{XtNaxes, XtCAxes, XtRBoolean, sizeof(Boolean),
+     Offset(axes), XtRImmediate, (XtPointer) DefaultAxes},
+{XtNsquareWidth, XtCSquareWidth, XtRDimension, sizeof(Dimension),
+     Offset(squareW), XtRImmediate, (XtPointer) DefaultSquareWidth},
+{XtNsquareHeight, XtCSquareHeight, XtRDimension, sizeof(Dimension),
+     Offset(squareH), XtRImmediate, (XtPointer) DefaultSquareHeight},
+{XtNmargin, XtCMargin, XtRDimension, sizeof(Dimension),
+     Offset(margin), XtRImmediate, (XtPointer) DefaultMargin},
+{XtNxHot, XtCXHot, XtRPosition, sizeof(Position),
+     Offset(hot.x), XtRImmediate, (XtPointer) NotSet},
+{XtNyHot, XtCYHot, XtRPosition, sizeof(Position),
+     Offset(hot.y), XtRImmediate, (XtPointer) NotSet},
+{XtNbutton1Function, XtCButton1Function, XtRButtonFunction, sizeof(int),
+     Offset(button_function[0]), XtRImmediate, (XtPointer) Set},
+{XtNbutton2Function, XtCButton2Function, XtRButtonFunction, sizeof(int),
+     Offset(button_function[1]), XtRImmediate, (XtPointer) Invert},
+{XtNbutton3Function, XtCButton3Function, XtRButtonFunction, sizeof(int),
+     Offset(button_function[2]), XtRImmediate, (XtPointer) Clear},
+{XtNbutton4Function, XtCButton4Function, XtRButtonFunction, sizeof(int),
+     Offset(button_function[3]), XtRImmediate, (XtPointer) Clear},
+{XtNbutton5Function, XtCButton5Function, XtRButtonFunction, sizeof(int),
+     Offset(button_function[4]), XtRImmediate, (XtPointer) Clear},
+{XtNfilename, XtCFilename, XtRString, sizeof(String),
+     Offset(filename), XtRImmediate, (XtPointer) DefaultFilename},
+{XtNbasename, XtCBasename, XtRString, sizeof(String),
+     Offset(basename), XtRImmediate, (XtPointer) DefaultFilename},
+{XtNdashes, XtCDashes, XtRBitmap, sizeof(Pixmap),
+     Offset(dashes), XtRImmediate, (XtPointer) XtUnspecifiedPixmap},
+{XtNstipple, XtCStipple, XtRBitmap, sizeof(Pixmap),
+     Offset(stipple), XtRImmediate, (XtPointer) XtUnspecifiedPixmap},
+};
+#undef Offset
+
+
+static XtActionsRec actions[] =
+{
+{"mark",               (XtActionProc)BWTMark},
+{"mark-all",           (XtActionProc)BWTMarkAll},
+{"unmark",             (XtActionProc)BWTUnmark},
+{"paste",              (XtActionProc)BWTPaste},
+{"bw-debug",           (XtActionProc)BWDebug},
+{"abort",              (XtActionProc)BWAbort},
+{"store-to-buffer",    (XtActionProc)BWStoreToBuffer},
+{"change-notify",      (XtActionProc)BWChangeNotify},
+{"set-changed",        (XtActionProc)BWSetChanged},
+{"up",                 (XtActionProc)BWUp},
+{"down",               (XtActionProc)BWDown},
+{"left",               (XtActionProc)BWLeft},
+{"right",              (XtActionProc)BWRight},
+{"fold",               (XtActionProc)BWFold},
+{"flip-horiz",         (XtActionProc)BWFlipHoriz},
+{"flip-vert",          (XtActionProc)BWFlipVert},
+{"rotate-right",       (XtActionProc)BWRotateRight},
+{"rotate-left",        (XtActionProc)BWRotateLeft},
+{"set",                (XtActionProc)BWSet},
+{"clear",              (XtActionProc)BWClear},
+{"invert",             (XtActionProc)BWInvert},
+{"undo",               (XtActionProc)BWUndo},
+{"redraw",             (XtActionProc)BWRedraw},
+};
+
+static char translations1[] =
+"\
+Shift<Btn1Down>: mark()\n\
+Shift<Btn2Down>: mark-all()\n\
+Shift<Btn3Down>: unmark()\n\
+Ctrl<BtnDown>:   paste()\n\
+Ctrl<Key>l: redraw()\n\
+<Key>d:     bw-debug()\n\
+<Key>a:     abort()\n\
+<Key>Up:    store-to-buffer()\
+            up()\
+            change-notify()\
+            set-changed()\n\
+<Key>KP_Up: store-to-buffer()\
+            up()\
+            change-notify()\
+            set-changed()\n\
+<Key>Down:  store-to-buffer()\
+            down()\
+            change-notify()\
+            set-changed()\n\
+<Key>KP_Down: store-to-buffer()\
+            down()\
+            change-notify()\
+            set-changed()\n\
+<Key>Left:  store-to-buffer()\
+            left()\
+            change-notify()\
+            set-changed()\n\
+<Key>KP_Left: store-to-buffer()\
+            left()\
+            change-notify()\
+            set-changed()\n\
+<Key>Right: store-to-buffer()\
+            right()\
+            change-notify()\
+            set-changed()\n\
+<Key>KP_Right: store-to-buffer()\
+            right()\
+            change-notify()\
+            set-changed()\n\
+<Key>f:     store-to-buffer()\
+            fold()\
+            change-notify()\
+            set-changed()\n\
+<Key>h:     store-to-buffer()\
+            flip-horiz()\
+            change-notify()\
+            set-changed()\n\
+";
+
+static char translations2[] =
+"<Key>v:     store-to-buffer()\
+            flip-vert()\
+            change-notify()\
+            set-changed()\n\
+<Key>r:     store-to-buffer()\
+            rotate-right()\
+            change-notify()\
+            set-changed()\n\
+<Key>l:     store-to-buffer()\
+            rotate-left()\
+            change-notify()\
+            set-changed()\n\
+<Key>s:     store-to-buffer()\
+            set()\
+            change-notify()\
+            set-changed()\n\
+<Key>c:     store-to-buffer()\
+            clear()\
+            change-notify()\
+            set-changed()\n\
+<Key>i:     store-to-buffer()\
+            invert()\
+            change-notify()\
+            set-changed()\n\
+<Key>u:     undo()\
+            change-notify()\
+            set-changed()\n\
+";
+
+static Atom targets[] = {
+    XA_BITMAP,
+    XA_PIXMAP
+};
+
+#include "Requests.h"
+
+
+static BWRequestRec requests[] = 
+{
+{MarkRequest, sizeof(BWStatus),
+     TwoPointsEngage, (XtPointer) BWDrawRectangle,
+     TwoPointsTerminateTimed, (XtPointer) BWSelect,
+     NULL, (XtPointer) NULL},
+{RestoreRequest, sizeof(BWStatus),
+     OnePointEngage, (XtPointer) BWDragStored,
+     OnePointTerminate, (XtPointer) BWRestore,
+     NULL, (XtPointer) NULL},
+{ImmediateCopyRequest, sizeof(BWStatus),
+     OnePointEngage, (XtPointer) BWDragMarked,
+     OnePointTerminate, (XtPointer) BWCopy,
+     NULL, (XtPointer) NULL},
+{ImmediateMoveRequest, sizeof(BWStatus),
+     OnePointEngage, (XtPointer) BWDragMarked,
+     OnePointTerminate, (XtPointer) BWMove,
+     NULL, (XtPointer) NULL},
+{CopyRequest, sizeof(BWStatus),
+     DragOnePointEngage, (XtPointer) Paste,
+     DragOnePointTerminate, (XtPointer) ImmediateCopyRequest,
+     Interface, (XtPointer) BWUnmark},
+{MoveRequest, sizeof(BWStatus),
+     DragOnePointEngage, (XtPointer) Paste,
+     DragOnePointTerminate, (XtPointer) ImmediateMoveRequest,
+     Interface, (XtPointer) BWUnmark},
+{PointRequest, sizeof(BWStatus),
+     DragOnePointEngage, (XtPointer) BWDrawPoint,
+     DragOnePointTerminate, (XtPointer) BWDrawPoint,
+     NULL, (XtPointer) NULL},
+{CurveRequest, sizeof(BWStatus),
+     DragTwoPointsEngage, (XtPointer) BWBlindLine,
+     DragTwoPointsTerminate, (XtPointer) BWBlindLine,
+     NULL, (XtPointer) NULL},
+{LineRequest, sizeof(BWStatus), 
+     TwoPointsEngage, (XtPointer) BWDrawLine, 
+     TwoPointsTerminate, (XtPointer) BWDrawLine,
+     NULL, (XtPointer) NULL},
+{RectangleRequest, sizeof(BWStatus), 
+     TwoPointsEngage, (XtPointer) BWDrawRectangle,
+     TwoPointsTerminate, (XtPointer) BWDrawRectangle,
+     NULL, (XtPointer) NULL},
+{FilledRectangleRequest, sizeof(BWStatus), 
+     TwoPointsEngage, (XtPointer) BWDrawRectangle,
+     TwoPointsTerminate, (XtPointer) BWDrawFilledRectangle,
+     NULL, (XtPointer) NULL},
+{CircleRequest, sizeof(BWStatus), 
+     TwoPointsEngage, (XtPointer) BWDrawCircle,
+     TwoPointsTerminate, (XtPointer) BWDrawCircle,
+     NULL, (XtPointer) NULL},
+{FilledCircleRequest, sizeof(BWStatus), 
+     TwoPointsEngage, (XtPointer) BWDrawCircle, 
+     TwoPointsTerminate, (XtPointer) BWDrawFilledCircle,
+     NULL, (XtPointer) NULL},
+{FloodFillRequest, sizeof(BWStatus),
+     OnePointEngage, (XtPointer) NULL,
+     OnePointTerminate, (XtPointer) BWFloodFill,
+     NULL, (XtPointer) NULL},
+{HotSpotRequest, sizeof(BWStatus),
+     OnePointEngage, (XtPointer) BWDrawHotSpot,
+     OnePointTerminate, (XtPointer) BWDrawHotSpot,
+     NULL, (XtPointer) NULL},
+{ZoomInRequest, sizeof(BWStatus),
+     TwoPointsEngage, (XtPointer) BWDrawRectangle,
+     TwoPointsTerminate, (XtPointer) BWZoomIn,
+     NULL, (XtPointer) NULL},
+};
+
+static void ClassInitialize(void);
+static void Initialize(Widget wrequest, Widget wnew, 
+                      ArgList argv, Cardinal *argc);
+static void Redisplay(Widget w, XEvent *event, Region region);
+static void Resize(Widget w);
+static void Destroy(Widget w);
+static void Refresh(BitmapWidget BW, Position x, Position y, 
+                   Dimension width, Dimension height);
+static Boolean SetValues(Widget old, Widget request, Widget new,
+                        ArgList args, Cardinal *num_args);
+BitmapClassRec bitmapClassRec = {
+{   /* core fields */
+    /* superclass              */      (WidgetClass) &simpleClassRec,
+    /* class_name              */      "Bitmap",
+    /* widget_size             */      sizeof(BitmapRec),
+    /* class_initialize                */      ClassInitialize,
+    /* class_part_initialize   */      NULL,
+    /* class_inited            */      FALSE,
+    /* initialize              */      Initialize,
+    /* initialize_hook         */      NULL,
+    /* realize                 */      XtInheritRealize,
+    /* actions                 */      actions,
+    /* num_actions             */      XtNumber(actions),
+    /* resources               */      resources,
+    /* num_resources           */      XtNumber(resources),
+    /* xrm_class               */      NULLQUARK,
+    /* compress_motion         */      TRUE,
+    /* compress_exposure       */      FALSE,
+    /* compress_enterleave     */      TRUE,
+    /* visible_interest                */      TRUE,
+    /* destroy                 */      Destroy,
+    /* resize                  */      Resize,
+    /* expose                  */      Redisplay,
+    /* set_values              */      SetValues,
+    /* set_values_hook         */      NULL,
+    /* set_values_almost       */      XtInheritSetValuesAlmost,
+    /* get_values_hook         */      NULL,
+    /* accept_focus            */      NULL,
+    /* version                 */      XtVersion,
+    /* callback_private                */      NULL,
+    /* tm_table                        */      NULL , /* set in code */
+    /* query_geometry          */      XtInheritQueryGeometry,
+    /* display_accelerator     */      XtInheritDisplayAccelerator,
+    /* extension               */      NULL,
+  },
+  { 
+    /* empty                   */      XtInheritChangeSensitive,
+  },
+  {
+    /* targets                  */      targets,
+    /* num_trets                */      XtNumber(targets),
+    /* requests                 */      requests,
+    /* num_requests             */      XtNumber(requests),
+  }
+};
+WidgetClass bitmapWidgetClass = (WidgetClass) &bitmapClassRec;
+    
+/* ARGSUSED */
+
+void 
+BWDebug(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    DEBUG ^= True;
+}
+
+Pixmap 
+BWGetPixmap(Widget w) 
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    return GetPixmap(BW, BW->bitmap.zoom.image);
+}
+
+Pixmap 
+BWGetUnzoomedPixmap(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    GC gc;
+    Pixmap pix;
+    
+    if (BW->bitmap.zooming) {    
+       pix = XCreatePixmap(XtDisplay(w), XtWindow(w), 
+                           BW->bitmap.zoom.image->width, 
+                           BW->bitmap.zoom.image->height, 1);
+       if (!(gc = XCreateGC(XtDisplay(w), pix, 
+                            (unsigned long) 0, (XGCValues *) 0)))
+           return (Pixmap) None;
+       
+       XPutImage(XtDisplay(w), pix, gc, 
+                 BW->bitmap.zoom.image, 
+                 0, 0, 0, 0, 
+                 BW->bitmap.zoom.image->width, 
+                 BW->bitmap.zoom.image->height);
+       XPutImage(XtDisplay(w), pix, gc, 
+                 BW->bitmap.image, 
+                 0, 0, 
+                 BW->bitmap.zoom.at_x,
+                 BW->bitmap.zoom.at_y,
+                 BW->bitmap.image->width, 
+                 BW->bitmap.image->height);
+    }
+    else {
+       pix = XCreatePixmap(XtDisplay(w), XtWindow(w), 
+                           BW->bitmap.image->width, 
+                           BW->bitmap.image->height, 1);
+       if (! (gc = XCreateGC(XtDisplay(w), pix, 
+                             (unsigned long) 0, (XGCValues *) 0)))
+           return (Pixmap) None;
+       
+       XPutImage(XtDisplay(w), pix, gc, 
+                 BW->bitmap.image, 
+                 0, 0, 0, 0,
+                 BW->bitmap.image->width, 
+                 BW->bitmap.image->height);
+    }
+    XFreeGC(XtDisplay(w), gc);
+    return(pix);
+}
+
+
+XImage *
+GetImage(BitmapWidget BW, Pixmap pixmap)
+{
+    Window root;
+    int x, y;
+    unsigned int width, height, border_width, depth;
+    XImage *source, *image;
+
+    XGetGeometry(XtDisplay(BW), pixmap, &root, &x, &y,
+                &width, &height, &border_width, &depth);
+
+    source = XGetImage(XtDisplay(BW), pixmap, x, y, width, height,
+                    1, XYPixmap);
+
+    image = ConvertToBitmapImage(BW, source);
+
+    return image;
+}
+
+XImage *
+CreateBitmapImage(BitmapWidget BW, char *data, 
+                 Dimension width, Dimension height)
+{
+    XImage *image = XCreateImage(XtDisplay(BW),
+                                DefaultVisual(XtDisplay(BW), 
+                                              DefaultScreen(XtDisplay(BW))),
+                                1, XYBitmap, 0, 
+                                data, width, height,
+                                8, ((int)width + 7) / 8);
+
+    image->height = height;
+    image->width = width;
+    image->depth = 1;
+    image->xoffset = 0;
+    image->format = XYBitmap;
+    image->data = (char *)data;
+    image->byte_order = LSBFirst;
+    image->bitmap_unit = 8;
+    image->bitmap_bit_order = LSBFirst;
+    image->bitmap_pad = 8;
+    image->bytes_per_line = ((int)width + 7) / 8;
+
+    return image;
+}
+
+void 
+DestroyBitmapImage(XImage **image)
+{
+    /*XDestroyImage(*image);*/
+    if (image) {
+       if (*image) {
+           if ((*image)->data)
+               XtFree((*image)->data);
+           XtFree((char *)*image);
+       }
+       *image = NULL;
+    }
+}
+
+#if 0
+XImage *
+BWGetImage(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    return BW->bitmap.image;
+}
+#endif
+
+void 
+BWChangeNotify(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    if (BW->bitmap.notify)
+       (*BW->bitmap.notify)(w, NULL, NULL, NULL);
+}
+
+void 
+BWNotify(Widget w, XtActionProc proc)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    BW->bitmap.notify = proc;
+}
+
+void 
+BWSetChanged(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+       
+    BW->bitmap.changed = True;
+}
+
+Boolean 
+BWQueryChanged(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+       
+    return BW->bitmap.changed;
+}
+
+void 
+BWClearChanged(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    BW->bitmap.changed = False;
+}
+
+Boolean 
+BWQueryStored(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    return (BW->bitmap.storage != NULL);
+}
+
+Boolean 
+BWQueryStippled(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    return BW->bitmap.stippled;
+}
+
+static void 
+RedrawStippled(BitmapWidget BW)
+{
+  XExposeEvent event;
+  
+  event.type = Expose;
+  event.display = XtDisplay((Widget)BW);
+  event.window = XtWindow((Widget)BW);
+  event.x = 0;
+  event.y = 0;
+  event.width = BW->core.width;
+  event.height = BW->core.height;
+  event.count = 0;
+  
+  BWRedrawMark((Widget)BW);
+  
+  BW->bitmap.stipple_change_expose_event = True; 
+  
+  XtDispatchEvent((XEvent *)&event);
+  
+  BW->bitmap.stipple_change_expose_event = False;
+}
+
+void 
+BWSwitchStippled(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    RedrawStippled(BW);
+
+    BW->bitmap.stippled ^= True;
+    XSetFillStyle(XtDisplay(BW), BW->bitmap.highlighting_gc,
+                 (BW->bitmap.stippled ? FillStippled : FillSolid));
+
+    RedrawStippled(BW);    
+}
+
+void 
+BWSelect(Widget w, Position from_x, Position from_y, 
+        Position to_x, Position to_y, Time btime)
+{
+    BWMark(w, from_x, from_y, to_x, to_y);
+
+    BWGrabSelection(w, btime);
+}
+
+Boolean 
+BWQueryAxes(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    return BW->bitmap.axes;
+}
+
+void 
+BWSwitchAxes(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    BW->bitmap.axes ^= True;
+    BWHighlightAxes(w);
+}
+
+void 
+BWAxes(Widget w, Boolean _switch)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    if (BW->bitmap.axes != _switch)
+       BWSwitchAxes(w);
+}
+
+void 
+BWRedrawAxes(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    if (BW->bitmap.axes)
+       BWHighlightAxes(w);
+}
+
+#if 0
+void 
+BWPutImage(BitmapWidget w, Display *display, Drawable drawable, GC gc, 
+          Position x, Position y)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+  XPutImage(display, drawable, gc, BW->bitmap.image,
+           0, 0, x, y, BW->bitmap.image->width, BW->bitmap.image->height);
+}
+#endif
+
+static String 
+StripFilename(String filename)
+{
+    char *begin = strrchr(filename, '/');
+    char *end, *result;
+    int length;
+    
+    if (filename) {
+       begin = (begin ? begin + 1 : filename);
+       end = strchr(begin, '.'); /* change to strrchr to allow longer names */
+       length = (end ? (end - begin) : strlen (begin));
+       result = (char *) XtMalloc (length + 1);
+       strncpy (result, begin, length);
+       result [length] = '\0';
+       return (result);
+    }
+    else
+       return (NULL);
+}
+
+static int 
+XmuWriteBitmapDataToFile(String filename, String basename, 
+                        int width, int height, char *datap, 
+                        int x_hot, int y_hot)
+{
+    FILE *file;
+    int i, data_length;
+    
+    data_length = Length(width, height);
+    
+    if(!filename || !strcmp(filename, "") || !strcmp(filename, "-")) {   
+       file = stdout;
+       filename = "dummy";
+       }
+    else
+       file = fopen(filename, "w+");
+    
+    if (!basename || !strcmp(basename, "") || !strcmp(basename, "-"))
+       basename = StripFilename(filename);
+    
+    if (file) {
+       fprintf(file, "#define %s_width %d\n", basename, width);
+       fprintf(file, "#define %s_height %d\n", basename, height);
+       if (QuerySet(x_hot, y_hot)) {
+           fprintf(file, "#define %s_x_hot %d\n", basename, x_hot);
+           fprintf(file, "#define %s_y_hot %d\n", basename, y_hot);
+       }
+       fprintf(file, "static unsigned char %s_bits[] = {\n   0x%02x",
+               basename, (unsigned char) datap[0]);
+       for(i = 1; i < data_length; i++) {
+           fprintf(file, ",");
+           fprintf(file, (i % 12) ? " " : "\n   ");
+           fprintf(file, "0x%02x", (unsigned char) datap[i]);
+       }
+       fprintf(file, "};\n");
+       
+       if (file != stdout)
+           fclose(file);
+
+       return BitmapSuccess;
+    }
+    
+    return 1;
+}
+
+/*
+ *
+ */
+
+                               /* ARGSUSED */
+static void 
+CvtStringToButtonFunction(XrmValuePtr args, /* not used */
+                         Cardinal *num_args, /* not used */
+                         XrmValuePtr from_val, 
+                         XrmValuePtr to_val)
+{
+  static int button_function;
+  char lower_name[80];
+  XmuCopyISOLatin1Lowered (lower_name, (char*)from_val->addr);
+  
+  if (!strcmp(lower_name, XtClear)) {
+    button_function = Clear;
+    to_val->addr = (XPointer) &button_function;
+    to_val->size = sizeof(button_function);
+    return;
+  }
+  
+  if (!strcmp(lower_name, XtSet)) {
+    button_function = Set;
+    to_val->addr = (XPointer) &button_function;
+    to_val->size = sizeof(button_function);
+    return;
+  }
+
+  if (!strcmp(lower_name, XtInvert)) {
+    button_function = Invert;
+    to_val->addr = (XPointer) &button_function;
+    to_val->size = sizeof(button_function);
+    return;
+  }
+  
+  XtStringConversionWarning(from_val->addr, XtRButtonFunction);
+  button_function = Clear;
+  to_val->addr = (XPointer) &button_function;
+  to_val->size = sizeof(button_function);
+  
+}
+
+static void 
+ClassInitialize(void)
+{
+  char *tm_table = XtMalloc(strlen(translations1) + strlen(translations2) + 1);
+  strcpy(tm_table, translations1);
+  strcat(tm_table, translations2);
+  bitmapClassRec.core_class.tm_table = tm_table;
+
+  XawInitializeWidgetSet();
+  XtAddConverter(XtRString, XtRButtonFunction, CvtStringToButtonFunction,
+                NULL, 0);
+  DEBUG = False;
+}
+
+static void 
+SetSizeFromSizeResource(BitmapWidget bw)
+{
+  if (BWParseSize(bw->bitmap.size, 
+                 &bw->bitmap.width,
+                 &bw->bitmap.height)
+      ==
+      False) {
+    bw->bitmap.width = FallbackBitmapWidth;
+    bw->bitmap.height = FallbackBitmapHeight;
+    XtWarning("Cannot parse the size resource.  BitmapWidget");
+  }
+}
+
+
+/* ARGSUSED */
+static void 
+Initialize(Widget wrequest, Widget wnew, ArgList argv, Cardinal *argc)
+{
+    BitmapWidget new = (BitmapWidget) wnew;
+
+    XGCValues  values;
+    XtGCMask   mask;
+    char *image_data, *buffer_data;
+
+    new->bitmap.stipple_change_expose_event = False;
+    new->bitmap.notify = NULL;
+    new->bitmap.cardinal = 0;
+    new->bitmap.current = 0;
+    new->bitmap.fold = False;
+    new->bitmap.changed = False;
+    new->bitmap.zooming = False;
+    new->bitmap.selection.own = False;
+    new->bitmap.selection.limbo = False;
+
+    new->bitmap.request_stack = (BWRequestStack *)
+       XtMalloc(sizeof(BWRequestStack));
+
+    new->bitmap.request_stack[0].request = NULL;
+    new->bitmap.request_stack[0].call_data = NULL;
+    new->bitmap.request_stack[0].trap = False;
+
+    SetSizeFromSizeResource(new);
+
+    new->core.width = new->bitmap.width * new->bitmap.squareW + 
+       2 * new->bitmap.margin;
+    new->core.height = new->bitmap.height * new->bitmap.squareH + 
+       2 * new->bitmap.margin;
+  
+    new->bitmap.hot.x = new->bitmap.hot.y = NotSet;
+    new->bitmap.buffer_hot.x = new->bitmap.buffer_hot.y = NotSet;
+  
+    new->bitmap.mark.from_x = new->bitmap.mark.from_y = NotSet;
+    new->bitmap.mark.to_x = new->bitmap.mark.to_y = NotSet;
+    new->bitmap.buffer_mark.from_x = new->bitmap.buffer_mark.from_y = NotSet;
+    new->bitmap.buffer_mark.to_x = new->bitmap.buffer_mark.to_y = NotSet;
+
+    values.foreground = new->bitmap.foreground_pixel;
+    values.background = new->core.background_pixel;
+    values.foreground ^= values.background;
+    values.function = GXxor;
+    mask = GCForeground | GCBackground | GCFunction;
+    new->bitmap.drawing_gc = XCreateGC(XtDisplay(new), 
+                                      RootWindow(XtDisplay(new), 
+                                      DefaultScreen(XtDisplay(new))),
+                                      mask, &values);
+
+    values.foreground = new->bitmap.highlight_pixel;
+    values.background = new->core.background_pixel;
+    values.foreground ^= values.background;
+    values.function = GXxor;
+    mask = GCForeground | GCBackground | GCFunction;
+    if (new->bitmap.stipple != XtUnspecifiedPixmap)
+    {
+       values.stipple = new->bitmap.stipple;
+       mask |= GCStipple | GCFillStyle;
+    }
+    values.fill_style = (new->bitmap.stippled ? FillStippled : FillSolid);
+
+    new->bitmap.highlighting_gc = XCreateGC(XtDisplay(new), 
+                                           RootWindow(XtDisplay(new), 
+                                              DefaultScreen(XtDisplay(new))), 
+                                           mask, &values);
+
+
+    values.foreground = new->bitmap.frame_pixel;
+    values.background = new->core.background_pixel;
+    values.foreground ^= values.background;
+    mask = GCForeground | GCBackground | GCFunction;
+    if (new->bitmap.dashes != XtUnspecifiedPixmap)
+    {
+       values.stipple = new->bitmap.dashes;
+       mask |= GCStipple | GCFillStyle;
+    }
+    values.fill_style = (new->bitmap.dashed ? FillStippled : FillSolid);
+
+    new->bitmap.frame_gc = XCreateGC(XtDisplay(new), 
+                                    RootWindow(XtDisplay(new), 
+                                               DefaultScreen(XtDisplay(new))),
+                                    mask, &values);
+
+    values.foreground = new->bitmap.highlight_pixel;
+    values.background = new->core.background_pixel;
+    values.foreground ^= values.background;
+    mask = GCForeground | GCBackground | GCFunction;
+    new->bitmap.axes_gc = XCreateGC(XtDisplay(new), 
+                                    RootWindow(XtDisplay(new), 
+                                               DefaultScreen(XtDisplay(new))),
+                                    mask, &values);
+
+    image_data = CreateCleanData(Length(new->bitmap.width, 
+                                       new->bitmap.height));
+    buffer_data = CreateCleanData(Length(new->bitmap.width, 
+                                        new->bitmap.height));
+
+    new->bitmap.storage = NULL;
+    
+    new->bitmap.image = CreateBitmapImage(new, 
+                                         image_data,
+                                         new->bitmap.width,
+                                         new->bitmap.height);
+    new->bitmap.buffer = CreateBitmapImage(new, 
+                                          buffer_data,
+                                          new->bitmap.width,
+                                          new->bitmap.height);
+
+    /* Read file */
+    {
+       int status;
+       XImage *image, *buffer;
+       unsigned char *image_data;
+       char *buffer_data;
+       unsigned int width, height;
+       int x_hot, y_hot;
+       
+       status = XmuReadBitmapDataFromFile(new->bitmap.filename, 
+                                          &width, &height, &image_data,
+                                          &x_hot, &y_hot);
+       if (status == BitmapSuccess) {
+           
+           buffer_data = CreateCleanData(Length(width, height));
+           
+           image = CreateBitmapImage(new, (char *)image_data, width, height);
+           buffer = CreateBitmapImage(new, buffer_data, width, height);
+       
+           TransferImageData(new->bitmap.image, buffer);
+       
+           DestroyBitmapImage(&new->bitmap.image);
+           DestroyBitmapImage(&new->bitmap.buffer);
+       
+           new->bitmap.image = image;
+           new->bitmap.buffer = buffer;
+           new->bitmap.width = width;
+           new->bitmap.height = height;
+           
+           new->bitmap.hot.x = x_hot;
+           new->bitmap.hot.y = y_hot;
+           
+           new->bitmap.changed = False;
+           new->bitmap.zooming = False;
+       }
+
+       new->bitmap.filename = XtNewString(new->bitmap.filename);
+       
+       if (!strcmp(new->bitmap.basename, "")) {
+           new->bitmap.basename = StripFilename(new->bitmap.filename);
+       }
+       else
+         new->bitmap.basename = XtNewString(new->bitmap.basename);
+    }
+
+    Resize((Widget)new);
+}
+
+
+/* returns False if the format is wrong */
+Boolean 
+BWParseSize(String size, Dimension *width, Dimension *height)
+{
+  int x, y;
+  unsigned int w, h;
+  int status;
+
+  status = XParseGeometry(size, &x, &y, &w, &h);
+
+  if (status & (WidthValue | HeightValue)) {
+    *width = (Dimension) w;
+    *height = (Dimension) h;
+    return True;
+  }
+  else return False;
+
+}
+
+
+Boolean 
+BWQueryMarked(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    return QuerySet(BW->bitmap.mark.from_x, BW->bitmap.mark.from_y);
+}
+
+static void 
+FixMark(BitmapWidget BW)
+{
+    if (QuerySet(BW->bitmap.mark.from_x, BW->bitmap.mark.from_y)) {
+       BW->bitmap.mark.from_x = min(BW->bitmap.mark.from_x, 
+                                    BW->bitmap.image->width);
+       BW->bitmap.mark.from_y = min(BW->bitmap.mark.from_y, 
+                                    BW->bitmap.image->height);
+       BW->bitmap.mark.to_x = min(BW->bitmap.mark.to_x, 
+                                  BW->bitmap.image->width);
+       BW->bitmap.mark.to_y = min(BW->bitmap.mark.to_y, 
+                                  BW->bitmap.image->height);
+       
+       if((BW->bitmap.mark.from_x == BW->bitmap.mark.from_y) &&
+          (BW->bitmap.mark.to_x   == BW->bitmap.mark.to_y))
+           BW->bitmap.mark.from_x = 
+               BW->bitmap.mark.from_y =
+                   BW->bitmap.mark.to_x = 
+                       BW->bitmap.mark.to_y = NotSet;
+    }
+}
+
+/* ARGSUSED */
+int 
+BWStoreFile(Widget w, String filename, String *basename)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    int status;
+    unsigned char *storage_data;
+    unsigned int width, height;
+    int x_hot, y_hot;
+    
+    status = XmuReadBitmapDataFromFile(filename, &width, &height,
+                                      &storage_data, &x_hot, &y_hot);
+    if (status == BitmapSuccess) {
+
+       DestroyBitmapImage(&BW->bitmap.storage);
+       
+       BW->bitmap.storage = CreateBitmapImage(BW, (char *)storage_data, width, height);
+
+       return BitmapSuccess;
+    }
+    else
+       XtWarning(" read file failed.  BitmapWidget");
+    
+    return status;
+}
+
+String 
+BWUnparseStatus(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    XmuSnprintf(BW->bitmap.status, sizeof(BW->bitmap.status),
+           "Filename: %s  Basename: %s  Size: %dx%d",
+           (strcmp(BW->bitmap.filename, "") ? BW->bitmap.filename : "<none>"),
+           (strcmp(BW->bitmap.basename, "") ? BW->bitmap.basename : "<none>"),
+           BW->bitmap.width, BW->bitmap.height);
+
+    return BW->bitmap.status;
+}
+
+void 
+BWChangeFilename(Widget w, String str)
+{
+  BitmapWidget BW = (BitmapWidget) w;
+  
+  if (str) {
+    XtFree(BW->bitmap.filename);
+    BW->bitmap.filename = XtNewString( str);
+  }
+}
+
+void 
+BWChangeBasename(Widget w, String str)
+{
+  BitmapWidget BW = (BitmapWidget) w;
+  
+  if (str) {
+    XtFree(BW->bitmap.basename);
+    BW->bitmap.basename = XtNewString(str);
+  }
+}
+
+
+int 
+BWReadFile(Widget w, String filename, String basename) /* ARGSUSED */
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    int status;
+    XImage *image, *buffer;
+    unsigned char *image_data;
+    char *buffer_data;
+    unsigned int width, height;
+    int x_hot, y_hot;
+    
+    if (!filename)
+       filename = BW->bitmap.filename;
+
+    status = XmuReadBitmapDataFromFile(filename, &width, &height, &image_data,
+                                      &x_hot, &y_hot);
+    if (status == BitmapSuccess) {
+       
+       buffer_data = CreateCleanData(Length(width, height));
+       
+       image = CreateBitmapImage(BW, (char *)image_data, width, height);
+       buffer = CreateBitmapImage(BW, buffer_data, width, height);
+       
+       TransferImageData(BW->bitmap.image, buffer);
+       
+       DestroyBitmapImage(&BW->bitmap.image);
+       DestroyBitmapImage(&BW->bitmap.buffer);
+       
+       BW->bitmap.image = image;
+       BW->bitmap.buffer = buffer;
+       BW->bitmap.width = width;
+       BW->bitmap.height = height;
+       
+       BW->bitmap.hot.x = x_hot;
+       BW->bitmap.hot.y = y_hot;
+       
+       BW->bitmap.changed = False;
+       BW->bitmap.zooming = False;
+       
+       XtFree(BW->bitmap.filename);
+       BW->bitmap.filename = XtNewString(filename);
+       XtFree(BW->bitmap.basename);
+       BW->bitmap.basename= XtNewString(StripFilename(filename));
+
+       BWUnmark(w);
+       
+       Resize((Widget)BW);
+
+       if (BW->core.visible) {
+           XClearArea(XtDisplay(BW), XtWindow(BW),
+                      0, 0, 
+                      BW->core.width, BW->core.height,
+                      True);
+       }
+       
+       return BitmapSuccess;
+    }
+    else
+       XtWarning(" read file failed.  BitmapWidget");
+    
+    return status;
+}
+
+#if 0
+void 
+BWSetImage(Widget w, XImage *image)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    XImage *buffer;
+    char *buffer_data;
+    
+    buffer_data = CreateCleanData(Length(image->width, image->height));
+    buffer = CreateBitmapImage(BW, buffer_data, 
+                              (Dimension) image->width, 
+                              (Dimension) image->height);
+    
+    TransferImageData(BW->bitmap.image, buffer);
+    
+    DestroyBitmapImage(&BW->bitmap.image);
+    DestroyBitmapImage(&BW->bitmap.buffer);
+    
+    BW->bitmap.image = image;
+    BW->bitmap.buffer = buffer;
+    BW->bitmap.width = image->width;
+    BW->bitmap.height = image->height;
+    
+    Resize((Widget)BW);
+    
+    if (BW->core.visible) {
+       XClearArea(XtDisplay(BW), XtWindow(BW),
+                  0, 0, 
+                  BW->core.width, BW->core.height,
+                  True);    
+    }
+}
+#endif
+
+int 
+BWWriteFile(Widget w, String filename, String basename)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    char *data;
+    XImage *image;
+    XPoint hot;
+    int status;
+    
+    if (BW->bitmap.zooming) {
+        data = XtMalloc(Length(BW->bitmap.zoom.image->width, 
+                              BW->bitmap.zoom.image->height));
+       memmove( data, BW->bitmap.zoom.image->data, 
+             Length(BW->bitmap.zoom.image->width, 
+                    BW->bitmap.zoom.image->height));
+       image = CreateBitmapImage(BW, data,
+                                 (Dimension) BW->bitmap.zoom.image->width,
+                                 (Dimension) BW->bitmap.zoom.image->height);
+       CopyImageData(BW->bitmap.image, image, 
+                     0, 0, 
+                     BW->bitmap.image->width - 1,
+                     BW->bitmap.image->height - 1,
+                     BW->bitmap.zoom.at_x, BW->bitmap.zoom.at_y);
+       
+       if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)) {
+           hot.x = BW->bitmap.hot.x + BW->bitmap.zoom.at_x;
+           hot.y = BW->bitmap.hot.y + BW->bitmap.zoom.at_y;
+       }
+       else
+           hot = BW->bitmap.zoom.hot;
+    }
+    else {
+       image = BW->bitmap.image;
+       hot = BW->bitmap.hot;
+    }
+    
+    if (!filename) filename = BW->bitmap.filename;
+    else {
+       XtFree(BW->bitmap.filename);
+       BW->bitmap.filename = XtNewString(filename);
+       XtFree(BW->bitmap.basename);
+       BW->bitmap.basename= XtNewString(StripFilename(filename));
+    }
+    if (!basename) basename = BW->bitmap.basename;
+    else {
+       XtFree(BW->bitmap.basename);
+       BW->bitmap.basename = XtNewString(basename);
+    }
+
+    if (DEBUG)
+       fprintf(stderr, "Saving filename: %s %s\n", filename, basename);
+
+    status = XmuWriteBitmapDataToFile(filename, basename,
+                                     image->width, image->height, image->data,
+                                     hot.x, hot.y);
+    if (BW->bitmap.zooming)
+       DestroyBitmapImage(&image);
+    
+    if (status == BitmapSuccess)
+       BW->bitmap.changed = False;
+    
+    return status;
+}
+
+String 
+BWGetFilename(Widget w, String *str)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    *str = XtNewString(BW->bitmap.filename);
+
+    return *str;
+}
+
+String 
+BWGetFilepath(Widget w, String *str)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    String end;
+
+    *str = XtNewString(BW->bitmap.filename);
+    end = strrchr(*str, '/');
+
+    if (end)
+       *(end + 1) = '\0';
+    else 
+       **str = '\0';
+
+    return *str;
+}
+
+
+String 
+BWGetBasename(Widget w, String *str)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    *str = XtNewString(BW->bitmap.basename);
+
+    return *str;
+}
+
+static void 
+FixHotSpot(BitmapWidget BW)
+{
+    if (!QueryInBitmap(BW, BW->bitmap.hot.x, BW->bitmap.hot.y))
+       BW->bitmap.hot.x = BW->bitmap.hot.y = NotSet;
+}
+
+static void 
+ZoomOut(BitmapWidget BW)
+{
+    CopyImageData(BW->bitmap.image, BW->bitmap.zoom.image, 
+                 0, 0, 
+                 BW->bitmap.image->width - 1,
+                 BW->bitmap.image->height - 1,
+                 BW->bitmap.zoom.at_x, BW->bitmap.zoom.at_y);
+    
+    DestroyBitmapImage(&BW->bitmap.image);
+    DestroyBitmapImage(&BW->bitmap.buffer);
+    
+    BW->bitmap.image = BW->bitmap.zoom.image;
+    BW->bitmap.buffer = BW->bitmap.zoom.buffer;
+    BW->bitmap.width = BW->bitmap.image->width;
+    BW->bitmap.height = BW->bitmap.image->height;
+    BW->bitmap.fold = BW->bitmap.zoom.fold;
+    BW->bitmap.changed |= BW->bitmap.zoom.changed;
+    BW->bitmap.grid = BW->bitmap.zoom.grid;
+
+    if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)) {
+       BW->bitmap.hot.x += BW->bitmap.zoom.at_x;
+       BW->bitmap.hot.y += BW->bitmap.zoom.at_y;
+    }
+    else
+       BW->bitmap.hot = BW->bitmap.zoom.hot;
+    
+    BW->bitmap.mark.from_x = NotSet;
+    BW->bitmap.mark.from_y = NotSet;
+    BW->bitmap.mark.to_x = NotSet;
+    BW->bitmap.mark.to_y = NotSet;
+    BW->bitmap.zooming = False;
+}    
+
+void 
+BWZoomOut(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    if (BW->bitmap.zooming) {
+       ZoomOut(BW);
+       
+       Resize((Widget)BW);
+       if (BW->core.visible)
+           XClearArea(XtDisplay(BW), XtWindow(BW),
+                      0, 0, 
+                      BW->core.width, BW->core.height,
+                      True);
+    }
+}
+
+
+void 
+BWZoomMarked(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    BWZoomIn(w, 
+            BW->bitmap.mark.from_x, BW->bitmap.mark.from_y,
+            BW->bitmap.mark.to_x,   BW->bitmap.mark.to_y);
+}
+
+void 
+BWZoomIn(Widget w, 
+        Position from_x, Position from_y, 
+        Position to_x, Position to_y)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    XImage *image, *buffer;    
+    Dimension width, height;
+    char *image_data, *buffer_data;
+  
+    if (BW->bitmap.zooming)
+       ZoomOut(BW);
+    
+    QuerySwap(from_x, to_x);
+    QuerySwap(from_y, to_y);
+    from_x = max(0, from_x);
+    from_y = max(0, from_y);
+    to_x = min(BW->bitmap.width - 1, to_x);
+    to_y = min(BW->bitmap.height - 1, to_y);
+    
+    width = to_x - from_x + 1;
+    height = to_y - from_y + 1;
+
+    image_data = CreateCleanData(Length(width, height));
+    buffer_data = CreateCleanData(Length(width, height));
+
+    image = CreateBitmapImage(BW, image_data, width, height);
+    buffer = CreateBitmapImage(BW, buffer_data, width, height);
+
+    CopyImageData(BW->bitmap.image, image, from_x, from_y, to_x, to_y, 0, 0);
+    CopyImageData(BW->bitmap.buffer, buffer, from_x, from_y, to_x, to_y, 0, 0);
+    
+    BW->bitmap.zoom.image = BW->bitmap.image;
+    BW->bitmap.zoom.buffer = BW->bitmap.buffer;
+    BW->bitmap.zoom.at_x = from_x;
+    BW->bitmap.zoom.at_y = from_y;
+    BW->bitmap.zoom.fold = BW->bitmap.fold;
+    BW->bitmap.zoom.changed = BW->bitmap.changed;
+    BW->bitmap.zoom.hot = BW->bitmap.hot;
+    BW->bitmap.zoom.grid = BW->bitmap.grid;
+
+    BW->bitmap.image = image;
+    BW->bitmap.buffer = buffer;
+    BW->bitmap.width = width;
+    BW->bitmap.height = height;
+    BW->bitmap.changed = False;
+    BW->bitmap.hot.x -= from_x;
+    BW->bitmap.hot.y -= from_y;
+    BW->bitmap.mark.from_x = NotSet;
+    BW->bitmap.mark.from_y = NotSet;
+    BW->bitmap.mark.to_x = NotSet;
+    BW->bitmap.mark.to_y = NotSet;
+    BW->bitmap.zooming = True;
+    BW->bitmap.grid = True; /* potencially true, could use a resource here */
+
+    FixHotSpot(BW);
+
+    Resize((Widget)BW);
+    if (BW->core.visible)
+       XClearArea(XtDisplay(BW), XtWindow(BW),
+                  0, 0, 
+                  BW->core.width, BW->core.height,
+                  True);
+}
+
+
+void 
+BWRescale(Widget w, Dimension width, Dimension height)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    XImage *image, *buffer;
+    char *buffer_data;
+
+    if (BW->bitmap.zooming)
+       ZoomOut(BW);
+        
+    image = ScaleBitmapImage(BW, BW->bitmap.image, 
+                      (double) width / (double) BW->bitmap.image->width,
+                      (double) height / (double) BW->bitmap.image->height);
+
+    buffer_data = CreateCleanData(Length(image->width, image->height));
+    buffer = CreateBitmapImage(BW, buffer_data, 
+                              (Dimension) image->width, 
+                              (Dimension) image->height);
+    
+    TransferImageData(BW->bitmap.buffer, buffer);
+
+    DestroyBitmapImage(&BW->bitmap.image);
+    DestroyBitmapImage(&BW->bitmap.buffer);
+    
+    BW->bitmap.image = image;
+    BW->bitmap.buffer = buffer;
+    BW->bitmap.width = image->width;
+    BW->bitmap.height = image->height;
+    
+    FixHotSpot(BW);
+    FixMark(BW);
+
+    Resize((Widget)BW);
+    if (BW->core.visible)
+       XClearArea(XtDisplay(BW), XtWindow(BW),
+                  0, 0, 
+                  BW->core.width, BW->core.height,
+                  True);
+}
+
+Boolean 
+BWQueryZooming(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    return BW->bitmap.zooming;
+}
+
+
+static void 
+ResizeGrid(BitmapWidget BW, Dimension width, Dimension height)
+{
+  XImage *image, *buffer;
+  char *image_data, *buffer_data;
+  
+  if (BW->bitmap.zooming)
+    ZoomOut(BW);
+  
+  image_data = CreateCleanData(Length(width, height));
+  buffer_data = CreateCleanData(Length(width, height));
+  
+  image = CreateBitmapImage(BW, image_data, width, height);
+  buffer = CreateBitmapImage(BW, buffer_data, width, height);
+  
+  TransferImageData(BW->bitmap.image, image);
+  TransferImageData(BW->bitmap.buffer, buffer);
+  
+  DestroyBitmapImage(&BW->bitmap.image);
+  DestroyBitmapImage(&BW->bitmap.buffer);
+  
+  BW->bitmap.image = image;
+  BW->bitmap.buffer = buffer;
+  BW->bitmap.width = width;
+  BW->bitmap.height = height;
+  
+  FixHotSpot(BW);
+  FixMark(BW);
+}
+
+void 
+BWResize(Widget w, Dimension width, Dimension height)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    ResizeGrid(BW, width, height);
+
+    Resize((Widget)BW);
+    if (BW->core.visible)
+       XClearArea(XtDisplay(BW), XtWindow(BW),
+                  0, 0, 
+                  BW->core.width, BW->core.height,
+                  True);
+}
+
+static void 
+Destroy(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    XFreeGC(XtDisplay(w), BW->bitmap.drawing_gc);
+    XFreeGC(XtDisplay(w), BW->bitmap.highlighting_gc);
+    XFreeGC(XtDisplay(w), BW->bitmap.frame_gc);
+    XFreeGC(XtDisplay(w), BW->bitmap.axes_gc);
+    BWRemoveAllRequests(w);
+
+    XtFree(BW->bitmap.filename);
+    XtFree(BW->bitmap.basename);
+}
+
+
+static void 
+Resize(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    Dimension squareW, squareH;
+
+    squareW = max(1, ((int)BW->core.width - 2 * (int)BW->bitmap.margin) / 
+                 (int)BW->bitmap.width);
+    squareH = max(1, ((int)BW->core.height - 2 * (int)BW->bitmap.margin) / 
+                 (int)BW->bitmap.height);
+
+    if (BW->bitmap.proportional)
+       BW->bitmap.squareW = BW->bitmap.squareH = min(squareW, squareH);
+    else {
+       BW->bitmap.squareW = squareW;
+       BW->bitmap.squareH = squareH;
+    }
+    
+    BW->bitmap.horizOffset = max((Position)BW->bitmap.margin, 
+                                (Position)(BW->core.width - 
+                                           BW->bitmap.width * 
+                                           BW->bitmap.squareW) / 2);
+    BW->bitmap.vertOffset = max((Position)BW->bitmap.margin, 
+                               (Position)(BW->core.height - 
+                                          BW->bitmap.height * 
+                                          BW->bitmap.squareH) / 2);
+
+    BW->bitmap.grid &= ((BW->bitmap.squareW > BW->bitmap.grid_tolerance) && 
+                       (BW->bitmap.squareH > BW->bitmap.grid_tolerance));
+}
+
+/* ARGSUSED */
+static void 
+Redisplay(Widget w, XEvent *event, Region region)
+{
+     BitmapWidget BW = (BitmapWidget) w;
+
+  if(event->type == Expose
+     &&
+     BW->core.visible)
+    if (BW->bitmap.stipple_change_expose_event == False)
+      Refresh(BW, 
+             event->xexpose.x, event->xexpose.y,
+             event->xexpose.width, event->xexpose.height);
+}
+
+void 
+BWClip(Widget w, Position x, Position y, Dimension width, Dimension height)
+{
+    Position      from_x, from_y,
+                  to_x, to_y;
+    BitmapWidget BW = (BitmapWidget) w;
+    XRectangle rectangle;
+  
+    from_x = InBitmapX(BW, x);
+    from_y = InBitmapY(BW, y);
+    to_x = InBitmapX(BW, x + width);
+    to_y = InBitmapY(BW, y + height);
+    QuerySwap(from_x, to_x);
+    QuerySwap(from_y, to_y);
+    from_x = max(0, from_x);
+    from_y = max(0, from_y);
+    to_x = min(BW->bitmap.width - 1, to_x);
+    to_y = min(BW->bitmap.height - 1, to_y);
+
+    rectangle.x = InWindowX(BW, from_x);
+    rectangle.y = InWindowY(BW, from_y);
+    rectangle.width = InWindowX(BW, to_x  + 1) - InWindowX(BW, from_x);
+    rectangle.height = InWindowY(BW, to_y + 1) - InWindowY(BW, from_y);
+    XSetClipRectangles(XtDisplay(BW),
+                      BW->bitmap.highlighting_gc,
+                      0, 0,
+                      &rectangle, 1,
+                      Unsorted);
+    XSetClipRectangles(XtDisplay(BW),
+                      BW->bitmap.drawing_gc,
+                      0, 0,
+                      &rectangle, 1,
+                      Unsorted);
+    XSetClipRectangles(XtDisplay(BW),
+                      BW->bitmap.frame_gc,
+                      0, 0,
+                      &rectangle, 1,
+                      Unsorted);
+    XSetClipRectangles(XtDisplay(BW),
+                      BW->bitmap.axes_gc,
+                      0, 0,
+                      &rectangle, 1,
+                      Unsorted);
+}
+
+void 
+BWUnclip(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    XRectangle rectangle;
+  
+    rectangle.x = InWindowX(BW, 0);
+    rectangle.y = InWindowY(BW, 0);
+    rectangle.width = InWindowX(BW, BW->bitmap.width) - InWindowX(BW, 0);
+    rectangle.height = InWindowY(BW, BW->bitmap.height) - InWindowY(BW, 0);
+    XSetClipRectangles(XtDisplay(BW),
+                      BW->bitmap.highlighting_gc,
+                      0, 0,
+                      &rectangle, 1,
+                      Unsorted);
+    XSetClipRectangles(XtDisplay(BW),
+                      BW->bitmap.drawing_gc,
+                      0, 0,
+                      &rectangle, 1,
+                      Unsorted);
+    XSetClipRectangles(XtDisplay(BW),
+                      BW->bitmap.frame_gc,
+                      0, 0,
+                      &rectangle, 1,
+                      Unsorted);
+    XSetClipRectangles(XtDisplay(BW),
+                      BW->bitmap.axes_gc,
+                      0, 0,
+                      &rectangle, 1,
+                      Unsorted);
+}
+
+static void 
+Refresh(BitmapWidget BW, Position x, Position y, 
+       Dimension width, Dimension height)
+{
+    XRectangle rectangle;
+
+    rectangle.x = min(x, InWindowX(BW, InBitmapX(BW, x)));
+    rectangle.y = min(y, InWindowY(BW, InBitmapY(BW, y)));
+    rectangle.width = max(x + width,
+                    InWindowX(BW, InBitmapX(BW, x + width)+1)) - rectangle.x;
+    rectangle.height = max(y + height,
+                    InWindowY(BW, InBitmapY(BW, y + height)+1)) - rectangle.y;
+    
+    XClearArea(XtDisplay(BW), XtWindow(BW),
+              rectangle.x, rectangle.y,
+              rectangle.width, rectangle.height,
+              False);
+
+    XSetClipRectangles(XtDisplay(BW),
+                      BW->bitmap.frame_gc,
+                      0, 0,
+                      &rectangle, 1,
+                      Unsorted);
+
+    XDrawRectangle(XtDisplay(BW), XtWindow(BW),
+                  BW->bitmap.frame_gc,
+                  InWindowX(BW, 0) - 1, InWindowY(BW, 0) - 1,
+                  InWindowX(BW, BW->bitmap.width) - InWindowX(BW, 0) + 1, 
+                  InWindowY(BW, BW->bitmap.height) - InWindowY(BW, 0) + 1);
+
+    BWClip((Widget) BW, x, y, width, height);
+
+    BWRedrawGrid((Widget) BW, x, y, width, height);
+
+    BWRedrawSquares((Widget) BW, x, y, width, height);
+
+    BWRedrawMark((Widget) BW);
+    BWRedrawHotSpot((Widget) BW);
+    BWRedrawAxes((Widget) BW);
+    BWUnclip((Widget) BW);
+}
+
+Boolean 
+BWQueryGrid(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    return BW->bitmap.grid;
+}
+
+void 
+BWSwitchGrid(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    BW->bitmap.grid ^= TRUE;
+    BWDrawGrid(w,
+              0, 0,
+              BW->bitmap.image->width - 1, BW->bitmap.image->height - 1);
+}
+
+void 
+BWGrid(Widget w, Boolean _switch)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    if (BW->bitmap.grid != _switch)
+       BWSwitchGrid(w);
+}
+
+Boolean 
+BWQueryDashed(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    return (BW->bitmap.dashed);
+}
+
+void 
+BWSwitchDashed(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    XRectangle rectangle;
+
+    BWRedrawGrid(w, 0, 0, BW->bitmap.width - 1, BW->bitmap.height - 1);
+
+    rectangle.x = 0;
+    rectangle.y = 0;
+    rectangle.width = BW->core.width;
+    rectangle.height = BW->core.height;
+
+    XSetClipRectangles(XtDisplay(BW),
+                      BW->bitmap.frame_gc,
+                      0, 0,
+                      &rectangle, 1,
+                      Unsorted);
+
+    XDrawRectangle(XtDisplay(BW), XtWindow(BW),
+                  BW->bitmap.frame_gc,
+                  InWindowX(BW, 0) - 1, InWindowY(BW, 0) - 1,
+                  InWindowX(BW, BW->bitmap.width) - InWindowX(BW, 0) + 1, 
+                  InWindowY(BW, BW->bitmap.height) - InWindowY(BW, 0) + 1);
+    
+    BW->bitmap.dashed ^= True;
+    XSetFillStyle(XtDisplay(BW), BW->bitmap.frame_gc,
+                 (BW->bitmap.dashed ? FillStippled : FillSolid));
+    XDrawRectangle(XtDisplay(BW), XtWindow(BW),
+                  BW->bitmap.frame_gc,
+                  InWindowX(BW, 0) - 1, InWindowY(BW, 0) - 1,
+                  InWindowX(BW, BW->bitmap.width) - InWindowX(BW, 0) + 1, 
+                  InWindowY(BW, BW->bitmap.height) - InWindowY(BW, 0) + 1);
+
+    BWUnclip(w);
+   
+    BWRedrawGrid(w, 0, 0, BW->bitmap.width - 1, BW->bitmap.height - 1);
+}
+
+void 
+BWDashed(Widget w, Boolean _switch)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    if (BW->bitmap.dashed != _switch)
+       BWSwitchDashed(w);
+}
+
+static Boolean 
+SetValues(Widget old, Widget request, Widget new, 
+         ArgList args, Cardinal *num_args) /* ARGSUSED */
+{
+  BitmapWidget oldbw = (BitmapWidget) old;
+  BitmapWidget newbw = (BitmapWidget) new;
+  Boolean resize = False;
+  Boolean redisplay = False;
+
+#define NE(field) (oldbw->field != newbw->field)
+
+  if (NE(bitmap.grid))
+    BWSwitchGrid(old);
+
+  if (NE(bitmap.dashed))
+    BWSwitchDashed(old);
+
+  if (NE(bitmap.axes))
+    BWSwitchAxes(old);
+
+  if (NE(bitmap.stippled))
+    BWSwitchStippled(old);
+
+  if (NE(bitmap.proportional))
+    resize = True;
+
+  if (NE(bitmap.filename) || NE(bitmap.basename)  || NE(bitmap.size))
+    BWChangeNotify(old);
+
+  if (NE(bitmap.filename)) {
+    if (newbw->bitmap.filename) {
+      XtFree(oldbw->bitmap.filename);
+      newbw->bitmap.filename = XtNewString(newbw->bitmap.filename);
+    }
+    else 
+      newbw->bitmap.filename = oldbw->bitmap.filename;
+  }
+
+  if (NE(bitmap.basename)) {
+    if (newbw->bitmap.basename) {
+      XtFree(oldbw->bitmap.basename);
+      newbw->bitmap.basename = XtNewString(newbw->bitmap.basename);
+    }
+    else 
+      newbw->bitmap.basename = oldbw->bitmap.basename;
+  }
+  
+  if (NE(bitmap.size)) {
+    Dimension width, height;
+    
+    if (BWParseSize(newbw->bitmap.size, &width, &height)) { 
+      ResizeGrid(newbw, width, height);
+      resize = True;
+    }
+  }
+  
+  if (NE(bitmap.margin) || 
+      NE(bitmap.grid_tolerance) ||
+      NE(bitmap.squareW) ||
+      NE(bitmap.squareH) ||
+      NE(core.height) ||
+      NE(core.width))
+    resize = True;
+
+  if (NE(bitmap.hot.x) || NE(bitmap.hot.y))
+    BWSetHotSpot(old, newbw->bitmap.hot.x, newbw->bitmap.hot.y);
+    
+  if (NE(bitmap.foreground_pixel) || NE(core.background_pixel)) {
+    XSetForeground(XtDisplay(new), 
+                  newbw->bitmap.drawing_gc,
+                  newbw->bitmap.foreground_pixel 
+                  ^ 
+                  newbw->core.background_pixel);
+    redisplay = True;
+  }
+
+  if (NE(bitmap.frame_pixel) || NE(core.background_pixel)) {
+    XSetForeground(XtDisplay(new), 
+                  newbw->bitmap.frame_gc,
+                  newbw->bitmap.frame_pixel
+                  ^ 
+                  newbw->core.background_pixel);
+    redisplay = True;
+  }
+
+  if (NE(bitmap.dashes)) {
+    XSetStipple(XtDisplay(new),
+               newbw->bitmap.frame_gc,
+               newbw->bitmap.dashes);
+    redisplay = True;
+  }
+
+  if (NE(bitmap.highlight_pixel) || NE(core.background_pixel)) {
+    RedrawStippled(newbw);
+    XSetForeground(XtDisplay(new), 
+                  newbw->bitmap.highlighting_gc,
+                  newbw->bitmap.highlight_pixel
+                  ^ 
+                  newbw->core.background_pixel);
+    RedrawStippled(newbw);
+  }
+  if (NE(bitmap.stipple)) {
+    RedrawStippled(newbw);
+    XSetStipple(XtDisplay(new),
+               newbw->bitmap.highlighting_gc,
+               newbw->bitmap.stipple);
+    RedrawStippled(newbw);
+  }
+  
+  if (resize) Resize((Widget)newbw);
+
+    return (redisplay || resize);
+
+#undef NE
+}
+
+Boolean 
+BWQueryProportional(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    return (BW->bitmap.proportional);
+}
+
+void 
+BWSwitchProportional(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    BW->bitmap.proportional ^= True;
+
+    Resize((Widget)BW);
+    if (BW->core.visible)
+       XClearArea(XtDisplay(BW), XtWindow(BW),
+                  0, 0, 
+                  BW->core.width, BW->core.height,
+                  True);
+}
+
+#if 0
+void 
+BWProportional(Widget w, Boolean _switch)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    if (BW->bitmap.proportional != _switch)
+       BWSwitchProportional(w);
+}
+#endif
+
+void 
+BWTPaste(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    BWRequestSelection(w, event->xbutton.time, TRUE);
+
+    if (!BWQueryStored(w))
+       return;
+    
+    BWEngageRequest(w, RestoreRequest, False, 
+                   (char *)&(event->xbutton.state), sizeof(int));
+    
+    OnePointHandler(w,
+              (BWStatus*) BW->bitmap.request_stack[BW->bitmap.current].status,
+              event, NULL);
+}
+
+void 
+BWTMark(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    BWEngageRequest(w, MarkRequest, False,
+                   (char *)&(event->xbutton.state), sizeof(int));
+    TwoPointsHandler(w,
+            (BWStatus*) BW->bitmap.request_stack[BW->bitmap.current].status,
+            event, NULL);
+
+}
+
+void 
+BWTMarkAll(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    BWMarkAll(w);
+
+    BWGrabSelection(w, event->xkey.time);
+}
+
+void 
+BWTUnmark(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    BWUnmark(w);
+}
+
+/*****************************************************************************/
diff --git a/bitmap/Bitmap.h b/bitmap/Bitmap.h
new file mode 100644 (file)
index 0000000..9d6d61e
--- /dev/null
@@ -0,0 +1,284 @@
+/*
+
+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.
+
+*/
+
+/*
+ * Author:  Davor Matic, MIT X Consortium
+ */
+
+
+#ifndef _Bitmap_h
+#define _Bitmap_h
+
+/****************************************************************
+ *
+ * Bitmap widget
+ *
+ ****************************************************************/
+
+#include <X11/Xaw/Simple.h>
+
+/* Resources:
+
+ Name               Class              RepType         Default Value
+ ----               -----              -------         ------------- 
+ background         Background         Pixel           XtDefaultBackground
+ foreground          Foredround         Pixel           XtDefaultForeground
+ highlight           Highlight          Pixel           XtDefaultForeground
+ frame               Frame              Pixel           XtDefaultForeground
+ border                     BorderColor        Pixel           XtDefaultForeground
+ borderWidth        BorderWidth        Dimension       1
+ mappedWhenManaged   MappedWhenManaged Boolean         True
+ resize              Resize             Boolean         True
+ sensitive          Sensitive          Boolean         True
+ width              Width              Dimension       0
+ height                     Height             Dimension       0
+ size                Size               String          32x32
+ squareWidht         SquareWidht        Dimension       16
+ squareHeight        SquareHeight       Dimension       16
+ x                  Position           Position        320
+ y                  Position           Position        320
+ xHot                XHot               Position        NotSet
+ yHot                YHot               Position        NotSet
+ margin              Margin             Dimension       16
+ grid                Grid               Boolean         True
+ gridTolerance       GridTolerance      Dimension       8
+ dashed              Dashed             Boolean         True
+ dashes              Dashes             Bitmap          XtUnspecifiedPixmap
+ stippled            Stippled           Boolean         True
+ stipple             Stipple            Bitmap          XtUnspecifiedPixmap
+ proportional        Proportional       Boolean         True
+ axes                Axes               Boolean         True
+ button1Function     Button1Function    ButtonFunction  Set  
+ button2Function     Button2Function    ButtonFunction  Invert
+ button3Function     Button3Function    ButtonFunction  Clear
+ button4Function     Button4Function    ButtonFunction  Invert
+ button5Function     Button5Function    ButtonFunction  Invert
+ filename            Filename           String          None
+ basename            Basename           String          None
+*/
+
+/* define any special resource names here that are not in <X11/StringDefs.h> */
+
+#define XtNbitmapResource "bitmapResource"
+#define XtNstipple "stipple"
+#define XtNstippled "stippled"
+#define XtNdashes "dashes"
+#define XtNdashed "dashed"
+#define XtNgrid "grid"
+#define XtNgridTolerance "gridTolerance"
+#define XtNaxes "axes"
+#define XtNbitmapSize "bitmapSize"
+#define XtNsize "size"
+#define XtNsquareWidth "squareWidth"
+#define XtNsquareHeight "squareHeight"
+#define XtNxHot "xHot"
+#define XtNyHot "yHot"
+#define XtNbutton1Function "button1Function"
+#define XtNbutton2Function "button2Function"
+#define XtNbutton3Function "button3Function"
+#define XtNbutton4Function "button4Function"
+#define XtNbutton5Function "button5Function"
+#define XtNfilename "filename"
+#define XtNbasename "basename"
+#define XtNmouseForeground "mouseForeground"
+#define XtNmouseBackground "mouseBackground"
+#define XtNframe "frame"
+#define XtNmargin "margin"
+#define XtNproportional "proportional"
+
+#define XtCBitmapResource "BitmapResource"
+#define XtCHighlight "Highlight"
+#define XtCStipple "Stipple"
+#define XtCStippled "Stippled"
+#define XtCDashes "Dashes"
+#define XtCDashed "Dashed"
+#define XtCGrid "Grid"
+#define XtCGridTolerance "GridTolerance"
+#define XtCAxes "Axes"
+#define XtBitmapSize "BitmapSize"
+#define XtCSize "Size"
+#define XtCSquareWidth "SquareWidth"
+#define XtCSquareHeight "SquareHeight"
+#define XtCXHot "XHot"
+#define XtCYHot "YHot"
+#define XtCButton1Function "Button1Function"
+#define XtCButton2Function "Button2Function"
+#define XtCButton3Function "Button3Function"
+#define XtCButton4Function "Button4Function"
+#define XtCButton5Function "Button5Function"
+#define XtCFilename "Filename"
+#define XtCBasename "Basename"
+#define XtCFrame "Frame"
+#ifndef XtCMargin
+#define XtCMargin "Margin"
+#endif
+#define XtCProportional "Proportional"
+
+#define XtRButtonFunction "ButtonFunction"
+
+/* bitmap defines */
+
+#define NotSet   -1
+#define Clear     0
+#define Set       1
+#define Invert    2
+#define Highlight 3
+#define On        True
+#define Off       False
+
+#define XtClear "clear"
+#define XtSet "set"
+#define XtInvert "invert"
+
+#define MarkRequest "MarkRequest"
+#define StoreRequest "StoreRequest"
+#define RestoreRequest "RestoreRequest"
+#define CopyRequest "CopyRequest"
+#define MoveRequest "MoveRequest"
+#define PointRequest "PointRequest"
+#define LineRequest "LineRequest"
+#define CurveRequest "CurveRequest"
+#define RectangleRequest "RectangleRequest"
+#define FilledRectangleRequest "FilledRectangleRequest"
+#define CircleRequest "CircleRequest"
+#define FilledCircleRequest "FilledCircleRequest"
+#define FloodFillRequest "FloodFillRequest"
+#define HotSpotRequest "HotSpotRequest"
+#define ZoomInRequest "ZoomInRequest"
+#define PasteRequest "PasteRequest"
+#define ImmediateCopyRequest "ImmediateCopyRequest"
+#define ImmediateMoveRequest "ImmediateMoveRequest"
+
+/* bitmap exports */
+
+typedef struct _BWRequestRec BWRequestRec;
+typedef char *BWRequest;
+
+/* declare specific BitmapWidget class and instance datatypes */
+
+typedef struct _BitmapClassRec *BitmapWidgetClass;
+typedef struct _BitmapRec      *BitmapWidget;
+/* declare the class constant */
+
+extern WidgetClass bitmapWidgetClass;
+
+extern Boolean BWEngageRequest(Widget w, BWRequest name, Boolean trap, 
+                              XtPointer call_data, Cardinal call_data_size);
+extern Boolean BWTerminateRequest(Widget w, Boolean cont);
+
+extern void BWUp ( Widget w );
+extern void BWDown ( Widget w );
+extern void BWLeft ( Widget w );
+extern void BWRight ( Widget w );
+extern void BWRotateRight ( Widget w );
+extern void BWRotateLeft ( Widget w );
+extern void BWSwitchGrid ( Widget w );
+extern void BWGrid ( Widget w, Boolean _switch );
+extern void BWSwitchDashed ( Widget w );
+extern void BWDashed ( Widget w, Boolean _switch );
+extern void BWSwitchAxes ( Widget w );
+extern void BWAxes ( Widget w, Boolean _switch );
+extern void BWRedrawAxes( Widget w );
+extern void BWDrawLine ( Widget w, Position from_x, Position from_y, Position to_x, Position to_y, int value );
+extern void BWDrawRectangle ( Widget w, Position from_x, Position from_y, Position to_x, Position to_y, int value );
+extern void BWDrawFilledRectangle ( Widget w, Position from_x, Position from_y, Position to_x, Position to_y, int value );
+extern void BWDrawCircle ( Widget w, Position origin_x, Position origin_y, Position point_x, Position point_y, int value );
+extern void BWDrawFilledCircle ( Widget w, Position origin_x, Position origin_y, Position point_x, Position point_y, int value );
+extern void BWFloodFill ( Widget w, Position x, Position y, int value );
+extern void BWMark ( Widget w, Position from_x, Position from_y, Position to_x, Position to_y );
+extern void BWMarkAll ( Widget w );
+extern void BWUnmark ( Widget w );
+extern void BWSelect ( Widget w, Position from_x, Position from_y, Position to_x, Position to_y, Time btime );
+extern void BWStore ( Widget w );
+extern void BWStoreToBuffer ( Widget w );
+extern void BWUndo ( Widget w );
+extern void BWResize ( Widget w, Dimension width, Dimension height );
+extern void BWClip ( Widget w, Position x, Position y, Dimension width, Dimension height );
+extern void BWUnclip ( Widget w );
+extern void BWGrabSelection ( Widget w, Time btime );
+extern void BWRequestSelection ( Widget w, Time btime, Boolean wait );
+extern void BWSetChanged ( Widget w );
+extern Boolean BWQueryChanged ( Widget w );
+extern int BWReadFile ( Widget w, String filename, String basename );
+extern int BWWriteFile ( Widget w, String filename, String basename );
+extern String BWUnparseStatus ( Widget w );
+extern String BWGetFilename ( Widget w, String *str );
+extern String BWGetBasename ( Widget w, String *str );
+extern void BWChangeBasename ( Widget w, String str );
+extern void BWRemoveAllRequests ( Widget w );
+extern void BWClearHotSpot ( Widget w );
+extern Boolean BWQueryMarked ( Widget w );
+extern void BWFold ( Widget w );
+extern void BWClear ( Widget w );
+extern void BWSet ( Widget w );
+extern void BWInvert ( Widget w );
+extern void BWFlipHoriz ( Widget w );
+extern void BWFlipVert ( Widget w );
+extern void BWClearMarked ( Widget w );
+extern Boolean BWAddRequest ( Widget w, BWRequest name, Boolean trap, XtPointer call_data, Cardinal call_data_size );
+extern void BWChangeNotify ( Widget w );
+extern Pixmap BWGetUnzoomedPixmap ( Widget w );
+extern void BWClearChanged ( Widget w );
+extern Boolean BWQueryStored ( Widget w );
+extern Boolean BWQueryStippled ( Widget w );
+extern void BWSwitchStippled ( Widget w );
+extern void BWRedrawMark ( Widget w );
+extern Boolean BWQueryAxes ( Widget w );
+extern void BWHighlightAxes ( Widget w );
+extern String BWGetFilepath ( Widget w, String *str );
+extern void BWZoomOut ( Widget w );
+extern void BWZoomMarked ( Widget w );
+extern void BWRescale ( Widget w, Dimension width, Dimension height );
+extern Boolean BWQueryZooming ( Widget w );
+extern void BWRedrawGrid ( Widget w, Position x, Position y, Dimension width, Dimension height );
+extern void BWRedrawSquares ( Widget w, Position x, Position y, Dimension width, Dimension height );
+extern void BWRedrawHotSpot ( Widget w );
+extern void BWSetHotSpot(Widget w, Position x, Position y);
+extern Boolean BWQueryGrid ( Widget w );
+extern Boolean BWQueryDashed ( Widget w );
+extern Boolean BWQueryProportional ( Widget w );
+extern void BWSwitchProportional ( Widget w );
+extern void BWDrawGrid ( Widget w, Position from_x, Position from_y, Position to_x, Position to_y );
+extern void BWChangeFilename ( Widget w, String str );
+extern Boolean BWParseSize ( String size, Dimension *width, Dimension *height );
+extern Boolean BWQuerySelection ( Widget w, Time btime );
+extern int BWStoreFile ( Widget w, String filename, String *basename );
+extern void BWNotify ( Widget w, XtActionProc proc );
+extern void BWTMark ( Widget w, XEvent *event, String *params, Cardinal *num_params  );
+extern void BWTMarkAll ( Widget w, XEvent *event, String *params, Cardinal *num_params );
+extern void BWTUnmark ( Widget w, XEvent *event, String *params, Cardinal *num_params );
+extern void BWTPaste ( Widget w, XEvent *event, String *params, Cardinal *num_params );
+extern void BWDebug ( Widget w, XEvent *event, String *params, Cardinal *num_params );
+extern void BWAbort ( Widget w );
+extern Boolean BWRemoveRequest ( Widget w );
+extern void BWRedraw ( Widget w );
+extern Pixmap BWGetPixmap( Widget w );
+
+#endif /* _Bitmap_h */
+
+
diff --git a/bitmap/BitmapP.h b/bitmap/BitmapP.h
new file mode 100644 (file)
index 0000000..7957f23
--- /dev/null
@@ -0,0 +1,211 @@
+/*
+
+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.
+
+*/
+
+/*
+ * Author:  Davor Matic, MIT X Consortium
+ */
+
+
+
+#ifndef _BitmapP_h
+#define _BitmapP_h
+
+#define bit int
+
+#include "Bitmap.h"
+#include "Requests.h"
+#include <X11/Xaw/SimpleP.h>
+
+typedef struct {
+    Atom           *targets;
+    Cardinal        num_targets;
+    BWRequestRec   *requests;
+    Cardinal        num_requests;
+    BWRequestRec   *request[100];
+  
+} BitmapClassPart;
+
+/* Full class record declaration */
+typedef struct _BitmapClassRec {
+  CoreClassPart          core_class;
+  SimpleClassPart        simple_class;
+  BitmapClassPart        bitmap_class;
+} BitmapClassRec;
+
+extern BitmapClassRec bitmapClassRec;
+
+typedef void (*EngageProc)(Widget, BWStatus *, XtPointer, int *);
+typedef void (*TerminateProc)( Widget, BWStatus *, XtPointer);
+typedef void (*RemoveProc)(Widget w, BWStatus *, XtPointer);
+
+/**********/
+struct _BWRequestRec {
+  char         *name;
+  int           status_size;
+  EngageProc    engage;
+  XtPointer     engage_client_data;
+  TerminateProc terminate;
+  XtPointer     terminate_client_data;
+  RemoveProc    remove;
+  XtPointer     remove_client_data;
+} ;
+
+typedef struct {
+  Position from_x, from_y,
+           to_x, to_y;
+} BWArea;
+
+typedef struct {
+    BWRequestRec *request;
+    XtPointer     status;
+    Boolean       trap;
+    XtPointer     call_data;
+} BWRequestStack;
+
+typedef struct {
+    XImage   *image, *buffer;
+    XPoint    hot;
+    Position  at_x, at_y;
+    Boolean   fold;
+    Boolean   grid;
+    Boolean   changed;
+} BWZoom;
+
+typedef struct {
+    Boolean   own;
+    Boolean   limbo;
+} BWSelection;
+
+/* New fields for the Bitmap widget record */
+typedef struct {
+  /* resources */
+  Pixel            foreground_pixel;
+  Pixel            highlight_pixel;
+  Pixel            frame_pixel;
+  Pixmap           stipple;
+  Boolean          stippled;
+  Boolean          proportional;
+  Boolean          grid;
+  Dimension        grid_tolerance;
+  Pixmap           dashes;
+  Boolean          dashed;
+  Boolean          axes;
+  Boolean          resize;
+  Dimension        margin, squareW, squareH, width, height;
+  XPoint           hot;
+  int              button_function[5];
+  String           filename, basename;
+  /* private state */
+  String           size;
+  Position         horizOffset, vertOffset;
+  XtActionProc     notify;
+  BWRequestStack  *request_stack;
+  Cardinal         cardinal, current;
+  /*Boolean          trapping;*/
+  XImage          *image, *buffer, *storage;
+  XPoint           buffer_hot;
+  BWArea           mark, buffer_mark;
+  GC               drawing_gc;
+  GC               highlighting_gc;
+  GC               frame_gc;
+  GC               axes_gc;
+  Boolean          changed;
+  Boolean          fold;
+  Boolean          zooming;
+  BWZoom           zoom;
+  XtPointer        *value;
+  char             status[80];
+  BWSelection      selection;
+  Boolean          stipple_change_expose_event;
+} BitmapPart;
+
+/* Full instance record declaration */
+typedef struct _BitmapRec {
+  CorePart      core;
+  SimplePart    simple;
+  BitmapPart    bitmap;
+} BitmapRec;
+
+/* Private functions */
+
+#define Length(width, height)\
+        (((int)(width) + 7) / 8 * (height))
+
+#define InBitmapX(BW, x)\
+       (Position)(min((Position)((Dimension)(max(BW->bitmap.horizOffset,x)  -\
+                                  BW->bitmap.horizOffset) /\
+                                  BW->bitmap.squareW), BW->bitmap.width - 1))
+    
+#define InBitmapY(BW, y)\
+       (Position)(min((Position)((Dimension)(max(BW->bitmap.vertOffset, y)  -\
+                                  BW->bitmap.vertOffset) /\
+                                  BW->bitmap.squareH), BW->bitmap.height - 1))
+    
+#define InWindowX(BW, x)\
+       (Position) (BW->bitmap.horizOffset + ((x) * BW->bitmap.squareW))
+
+#define InWindowY(BW, y)\
+       (Position) (BW->bitmap.vertOffset + ((y) * BW->bitmap.squareH))
+     
+#define GetPixmap(BW, image)\
+    XCreateBitmapFromData(XtDisplay(BW), XtWindow(BW),\
+                         image->data, image->width, image->height)
+
+
+#define QuerySet(x, y) (((x) != NotSet) && ((y) != NotSet))
+
+#define bit int
+
+#define QueryZero(x, y) (((x) == 0) || ((y) == 0))
+
+#define Swap(x, y) {Position t; t = x; x = y; y = t;}
+
+#define QuerySwap(x, y) if(x > y) Swap(x, y)
+
+#define QueryInBitmap(BW, x, y)\
+  (((x) >= 0) && ((x) < BW->bitmap.image->width) &&\
+   ((y) >= 0) && ((y) < BW->bitmap.image->height))
+
+#define Value(BW, button)   (BW->bitmap.button_function[button - 1])
+
+#define CreateCleanData(length) XtCalloc(length, sizeof(char))
+XImage *CreateBitmapImage(BitmapWidget BW, char *data, Dimension width, Dimension height);
+void DestroyBitmapImage(XImage **image);
+void  TransferImageData(XImage *source, XImage *destination);
+void CopyImageData(XImage *source, XImage *destination, 
+             Position from_x, Position from_y, 
+             Position to_x, Position to_y, 
+             Position at_x, Position at_y);
+XImage *GetImage(BitmapWidget BW, Pixmap pixmap);
+XImage *ConvertToBitmapImage(BitmapWidget BW, XImage *image);
+XImage *ScaleBitmapImage(BitmapWidget BW, XImage *src, 
+                        double scale_x, double scale_y);
+
+extern Boolean DEBUG;
+
+#endif /* _BitmapP_h */
diff --git a/bitmap/COPYING b/bitmap/COPYING
new file mode 100644 (file)
index 0000000..7a8c5fc
--- /dev/null
@@ -0,0 +1,23 @@
+Copyright 1988, 1993, 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.
diff --git a/bitmap/ChangeLog b/bitmap/ChangeLog
new file mode 100644 (file)
index 0000000..772977d
--- /dev/null
@@ -0,0 +1,361 @@
+commit 7c4c903a1612528e09858554c6fdaab05d2ba095
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Sep 22 19:49:57 2009 -0700
+
+    bitmap 1.0.4
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 4abbf05633f16cae587f9f24881d18c22e43800d
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Sep 22 19:39:08 2009 -0700
+
+    Migrate to xorg macros 1.3 & XORG_DEFAULT_OPTIONS
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit fb4778c1a6a114df03f3cefc87e747fab983355f
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Sep 22 19:30:35 2009 -0700
+
+    Strip RCS/CVS ids
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 948a119b19bf2e1822c63c2e6e86482e36df0cc0
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Sep 22 19:25:04 2009 -0700
+
+    Fill in COPYING, README, & AUTHORS
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 8337c277db59b5fb8e13428ab65a43725546bcdb
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Jan 13 14:29:53 2009 -0200
+
+    Rename app-defaults files to match "pattern" used on other applications.
+
+commit e23fbaa033e064efc7fcfa6ec49901c241736340
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Mon Jan 12 16:11:00 2009 -0200
+
+    Ansification and compile warning fixes.
+    
+      This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, and corrects
+    make distcheck.
+
+commit 7527b67979d61609bff5bc8c54d2b11874a7bbfa
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Wed Aug 20 10:32:48 2008 -0400
+
+    xaw8 is gone, use xaw7
+
+commit 3dc6744ae0332efc9c4a621401c1257e4d4c3c6d
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Fri May 16 14:22:16 2008 +0200
+
+    $(builddir) is the current directory
+    
+    Apparently automake doesn't always export the builddir variable.
+    This fixes my previous commit.
+
+commit 3154399310460759466d66cb17e723548e205776
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Sun Apr 20 19:25:40 2008 +0200
+
+    Fix build with builddir != srcdir
+
+commit 5d6bff83b62c3c9626503b36d2e5190a602bf43b
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Sun Apr 20 19:22:40 2008 +0200
+
+    Fix typo in bitmap.man
+
+commit 8003d22d2c12fe47d1fc06216c60dc813ed39f98
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Thu Mar 27 19:22:22 2008 -0700
+
+    Build fix for case-insensitive file systems
+
+commit 088006f9bb62db2523117dac568d028bd96db488
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Dec 6 15:51:03 2007 -0500
+
+    Add missing PHONY line for automatic ChangeLog generation
+
+commit d79bd0857961669aff4c155f4c3205af4c89b18e
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Aug 10 15:47:13 2007 -0700
+
+    Add AM_PROG_CC_C_O to configure.ac to make automake-1.10 happier
+    
+    Makefile.am:53: compiling `atobm.c' with per-target flags requires `AM_PROG_CC_C_O' in `configure.ac'
+
+commit 0fa2f5aa4b0e62ceb4685123182bf018c27e293a
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Jan 23 13:42:25 2007 -0800
+
+    Version bump: 1.0.3
+
+commit 4d02bf25b4e64d0a3fb2270491d3dbe4fc18effc
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Jan 23 13:42:01 2007 -0800
+
+    Replace static changelog with dist-hook to generate from git log
+
+commit 2c5045d72ee4120c52cfc7e008237a438a1c2d30
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Jan 22 19:45:08 2007 -0800
+
+    Remove on/off form of options from bitmap.man man page
+    
+    Turns out the previous formatting error that hid these was an attempt
+    to comment them out since they aren't implemented, so we'll just delete them.
+
+commit 5c1c01c8222eac13e9a65a36d3b953ae6f75ae6b
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Jan 2 14:37:42 2007 -0800
+
+    renamed: .cvsignore -> .gitignore
+
+commit ad55b1108f61ae0e3643bdffe430c71973d3d7ae
+Author: Eric S. Raymond <esr@thyrsus.com>
+Date:   Tue Jan 2 14:34:17 2007 -0800
+
+    Bug 9511: Garbled macro invocation in bitmap.1x manual page.
+    
+    <https://bugs.freedesktop.org/show_bug.cgi?id=9511>
+
+commit 3537d2121dcc68e3ecb93eaa2b341d759b0fbc88
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Fri May 12 16:19:54 2006 +0000
+
+    Bump to 1.0.2
+
+commit d8f719a352cd4d4ace60566b73a077175940a351
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue May 9 21:55:08 2006 +0000
+
+    Bug #5628 <https://bugs.freedesktop.org/show_bug.cgi?id=5628> Shadow pages
+        not created correctly when MANDIR & MANSUFFIX don't match.
+
+commit 545a878fa367a32059b33a21b9253a69ed95ccf6
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 21 02:29:42 2005 +0000
+
+    Update package version for X11R7 release.
+
+commit 038d4cc67674fcecd638489625cedfdc57f4bcea
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Dec 19 16:22:39 2005 +0000
+
+    Stub COPYING files
+
+commit ab8a9596b7c9729914b1444208521e939f35535f
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:24:01 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+commit d1ae6091d49c8af843e6895cb438225078a0f797
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 7 16:17:58 2005 +0000
+
+    Change to use the app-defaults default dir configured in libXt.
+
+commit 07cfe6f6de483aefcc18836fd3f03bdc5d6cd823
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 6 22:48:16 2005 +0000
+
+    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit f0e1e5f67882635777fa9a25496265a661c40a02
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Dec 3 05:49:15 2005 +0000
+
+    Update package version number for X11R7 RC3 release.
+
+commit d1dac2d6d7470212e3b2366702923a03950b9834
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+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 c361bb94796e409437ac71714c9a3746da0136dc
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Mon Nov 21 10:34:55 2005 +0000
+
+    Another pass at .cvsignores for apps.
+
+commit eb1544cfc467a48074e11118a85fec3b4980460d
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Sun Nov 20 22:08:47 2005 +0000
+
+    Add/improve .cvsignore files for apps.
+
+commit 0909ff9192c30720ce6a82043d10b4f7ce6fab83
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:47:47 2005 +0000
+
+    Update package version number for RC1 release.
+
+commit 905ded4a3825727326ccacd48a76ca221ff59a81
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Oct 18 00:32:54 2005 +0000
+
+    Change default install dir for app-default files from
+        $(sysconfdir)/X11/app-defaults to $(libdir)/X11/app-defaults to match
+        the monolith & allow localization
+
+commit fde7c43f092eba195a4a93391d9518f321ec9e40
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+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 0dbcf2d9436b3860ed33563e0f2daf0b2bc78dd9
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Oct 17 21:13:15 2005 +0000
+
+    Rename .shadows.DONE to shadows.DONE to avoid some make's thinking it's a
+        suffix rule (reported by Matthieu Herrb)
+
+commit 00b3817d8c24dd400ff870bb02bc1c6ba2db1f05
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Fri Oct 14 01:12:07 2005 +0000
+
+    Add shadow man pages for atobm and bmtoa.
+
+commit ba5f0c8d40af187191bcda8c8e72b3e554f3c50a
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Fri Oct 14 00:25:41 2005 +0000
+
+    Use sed to fill in variables in man page
+
+commit 358ae071207882e6202bfaa4c0dd341f7239c307
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Oct 4 23:15:11 2005 +0000
+
+    Add bitmap.icon to EXTRA_DIST
+
+commit c3f282e1aa6176896089ea79be84b7250888a65c
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Thu Sep 29 18:22:01 2005 +0000
+
+    Add Bitmap-nocase app default file to APPDEFAULTFILES.
+
+commit 53c51b2407108d9bcdca53c4d3757449465b3417
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Aug 1 20:25:27 2005 +0000
+
+    Install man pages to section 1 instead of section m (Patch from Donnie
+        Berkholz)
+
+commit 5135ddd5eb135237ea780d7e8c4a4074557ac23c
+Author: Kevin E Martin <kem@kem.org>
+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 6df7e0644c9f0ce2f306331910d8adf903610c1a
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Jul 26 15:44:01 2005 +0000
+
+    Replace more GNU make-ism's with more portable macros
+
+commit 55c2178d52dd695a31676bb7b48c1d19b3c77152
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sat Jul 16 22:07:12 2005 +0000
+
+    Add #ifdef HAVE_CONFIG_H/#include "config.h" to files that need it to get
+        HAS_MKSTEMP defined in modular builds.
+
+commit 40fc1a66cc817dad40851d61011e0a90fa48fe46
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sat Jul 16 22:00:11 2005 +0000
+
+    Convert more app-defaults rules to work with non-GNU make
+
+commit 1bef5390ae91148e61c613235e7db3729d7e8781
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sat Jul 16 21:59:14 2005 +0000
+
+    Define HAS_MKSTEMP if mkstemp() is present (needed for improved protection
+        against tempfile race conditions in many places)
+
+commit cc48a5df41c59071eab0f58818366e10cb1ff4ac
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Fri Jul 15 16:52:07 2005 +0000
+
+    Add dependency on xbitmaps
+
+commit c6129c090ad25cd2f8b191f503ac6e8cd452a31d
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Wed Jul 6 15:47:38 2005 +0000
+
+    Build system for bitmap
+
+commit 9b6257bdb5461131e42a3d81330c76d7a2bc670a
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 19:54:31 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+commit 5285b60deac481a96007a45bad4da61e8ead2552
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:34:49 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit 9f0d53b85896e1c67f770b45edc0dfa5373110c0
+Author: Egbert Eich <eich@suse.de>
+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 632e06aaad484b25e1c1931a8eb579679372d416
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:36:15 2004 +0000
+
+    readding XFree86's cvs IDs
+
+commit c83dc161b34afe817ed47abacbf5bad132c73888
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 09:23:53 2004 +0000
+
+    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit a9a10f80d2b5d444c38eb54e99a6bccb07e0cbd6
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:29:01 2003 +0000
+
+    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit 5b64274abaf585d108e65cb1dae497e74cad856e
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:57 2003 +0000
+
+    XFree86 4.3.0.1
+
+commit 0bd1f9d8ccaf46397745779f5964f3b843186896
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:57 2003 +0000
+
+    Initial revision
+
+commit 9711ac0a780f686806c135045d2db9b99fbe923f
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 15:54:52 2003 +0000
+
+    R6.6 is the Xorg base-line
diff --git a/bitmap/CutPaste.c b/bitmap/CutPaste.c
new file mode 100644 (file)
index 0000000..3a200ee
--- /dev/null
@@ -0,0 +1,204 @@
+/*
+
+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.
+
+*/
+
+/*
+ * Author:  Davor Matic, MIT X Consortium
+ */
+
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <X11/Xatom.h>
+#include "BitmapP.h"
+    
+#include <stdio.h>
+#include <math.h>
+
+#define min(x, y)                     (((x) < (y)) ? (x) : (y))
+#define max(x, y)                     (((x) > (y)) ? (x) : (y))
+
+
+
+/*****************************************************************************
+ *                               Cut and Paste                               *
+ *****************************************************************************/
+
+/* ARGSUSED */
+static Boolean 
+ConvertSelection(Widget w, Atom *selection, Atom *target, Atom *type, 
+                XtPointer *val_ret, unsigned long *length, int *format)
+{
+    XPointer *value = (XPointer *)val_ret;
+    BitmapWidget BW = (BitmapWidget) w;
+    Pixmap *pixmap;
+    char *data;
+    XImage *image;
+    Dimension width, height;
+    switch (*target) {
+
+/*  XA_TARGETS undefined ?!?
+
+    case XA_TARGETS:
+       *type = XA_ATOM;
+       *value = (XPointer) bitmapClassRec.bitmap_class.targets;
+       *length = bitmapClassRec.bitmap_class.num_targets;
+       *format = 32;
+       return True;
+
+*/
+
+    case XA_BITMAP:
+    case XA_PIXMAP:
+       if (BWQueryMarked(w)) {
+         width = BW->bitmap.mark.to_x - BW->bitmap.mark.from_x + 1;
+         height = BW->bitmap.mark.to_y - BW->bitmap.mark.from_y + 1;
+         data = CreateCleanData(Length(width, height));
+         image = CreateBitmapImage(BW, data, width, height);
+         CopyImageData(BW->bitmap.image, image, 
+                       BW->bitmap.mark.from_x, BW->bitmap.mark.from_y,
+                       BW->bitmap.mark.to_x, BW->bitmap.mark.to_y, 0, 0);
+         pixmap = (Pixmap *) XtMalloc(sizeof(Pixmap));
+         *pixmap = GetPixmap(BW, image);
+         DestroyBitmapImage(&image);
+       }
+       else if (BWQueryStored(w)) {
+         pixmap = (Pixmap *) XtMalloc(sizeof(Pixmap));
+         *pixmap = GetPixmap(BW, BW->bitmap.storage);
+       }
+       else return False;
+       *type = XA_PIXMAP;
+       *value = (XPointer) pixmap;
+       *length = 1;
+       *format = 32;
+       return True;
+
+    default:
+       return False;
+    }
+}
+
+/* ARGSUSED */
+static void 
+LoseSelection(Widget w, Atom selection)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    if (DEBUG)
+       fprintf(stderr, "Lost Selection\n");
+    BW->bitmap.selection.own = False;
+
+    BWUnmark(w);
+}
+
+/* ARGSUSED */
+static void 
+SelectionDone(Widget w, Atom *selection, Atom *target)
+{
+/*  Done Automatically ?!?
+
+    BitmapWidget BW = (BitmapWidget) w; 
+
+    if (*target != XA_TARGETS)
+       XtFree(BW->bitmap.value);
+
+*/
+}
+
+void 
+BWGrabSelection(Widget w, Time btime)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    BW->bitmap.selection.own = XtOwnSelection(w, XA_PRIMARY, btime,
+                                             ConvertSelection, 
+                                             (XtLoseSelectionProc)LoseSelection, 
+                                             SelectionDone);
+       if (DEBUG && BW->bitmap.selection.own)
+           fprintf(stderr, "Own the selection\n");
+}
+
+
+/* ARGSUSED */
+static void 
+SelectionCallback(Widget w, XtPointer cldat, Atom *selection, Atom *type, 
+                 XtPointer val, unsigned long *length, int *format)
+{
+    XPointer value = (XPointer)val;
+    BitmapWidget BW = (BitmapWidget) w;
+    Pixmap *pixmap;
+
+   switch (*type) {
+       
+    case XA_BITMAP:
+    case XA_PIXMAP:
+       DestroyBitmapImage(&BW->bitmap.storage);
+       pixmap = (Pixmap *) value;
+       BW->bitmap.storage = GetImage(BW, *pixmap);
+       XFree((char *)pixmap);
+       break;
+       
+    default:
+       XtWarning(" selection request failed.  BitmapWidget");
+       break;
+    }
+
+    BW->bitmap.selection.limbo = FALSE;
+}
+
+void 
+BWRequestSelection(Widget w, Time btime, Boolean wait)
+{
+  BitmapWidget BW = (BitmapWidget) w;
+  
+  if (BW->bitmap.selection.own)
+    BWStore(w);
+  else {
+    XtGetSelectionValue(w, XA_PRIMARY, XA_PIXMAP,
+                       SelectionCallback, NULL, btime);
+    
+    BW->bitmap.selection.limbo = TRUE;
+    
+    if (wait)
+      while (BW->bitmap.selection.limbo) {
+       XEvent event;
+       XtNextEvent(&event);
+       XtDispatchEvent(&event);
+      }
+  }
+}
+
+/* ARGSUSED */
+/* Returns true if there is a transferable selection */
+Boolean 
+BWQuerySelection(Widget w, Time btime)
+{
+/* To be written.  XA_TARGETS to be used.  So far undefined ?!? */
+
+  return True;
+}
+/*****************************************************************************/
diff --git a/bitmap/Dashes b/bitmap/Dashes
new file mode 100644 (file)
index 0000000..e81aa02
--- /dev/null
@@ -0,0 +1,4 @@
+#define Dashes_width 2
+#define Dashes_height 2
+static char Dashes_bits[] = {
+   0x01, 0x02};
diff --git a/bitmap/Dialog.c b/bitmap/Dialog.c
new file mode 100644 (file)
index 0000000..3cd525a
--- /dev/null
@@ -0,0 +1,200 @@
+/*
+
+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.
+
+*/
+
+/*
+ * Author:  Davor Matic, MIT X Consortium
+ */
+
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Shell.h>
+#include <X11/Xaw/Dialog.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xmu/CharSet.h>
+    
+#include "Dialog.h"
+
+#define min(x, y)                     (((x) < (y)) ? (x) : (y))
+#define max(x, y)                     (((x) > (y)) ? (x) : (y))
+
+
+static void SetDialogButton(Widget w, XEvent *event, 
+                           String *argv, Cardinal *argc);
+
+static XtActionsRec actions_table[] = {
+  {"set-dialog-button", SetDialogButton},
+};
+
+static DialogButton dialog_buttons[] = {
+    {"yes", Yes},
+    {"no", No},
+    {"maybe", Maybe},
+    {"okay", Okay},
+    {"abort", Abort},
+    {"cancel", Cancel},
+    {"retry", Retry},
+};
+
+static unsigned long selected;
+
+/* ARGSUSED */
+static void 
+SetSelected(Widget w, XtPointer clientData, XtPointer callData) /* ARGSUSED */
+{
+    String name = (String)clientData;
+    int i;
+    
+    for (i = 0; i < XtNumber(dialog_buttons); i++) 
+       if (!strcmp(dialog_buttons[i].name, name)) 
+           selected |= dialog_buttons[i].flag;
+}
+
+/* ARGSUSED */
+static void 
+SetDialogButton(Widget w,      /* not used */
+               XEvent *event,  /* not used */
+               String *argv, 
+               Cardinal *argc)
+{
+  char button_name[80];
+  XtPointer dummy = NULL;
+  int i;
+
+  for (i = 0; i < *argc; i++) {
+    XmuCopyISOLatin1Lowered (button_name, argv[i]);
+    SetSelected(w, button_name, dummy);
+  }
+}
+
+static Boolean firstTime = True;
+
+Dialog 
+CreateDialog(Widget top_widget, String name, unsigned long options)
+{
+    int i;
+    Dialog popup;
+
+    popup = (Dialog) XtMalloc(sizeof(_Dialog));
+
+    if (popup) {
+        if (firstTime) {
+         XtAddActions(actions_table, XtNumber(actions_table));
+         firstTime = False;
+       }
+       popup->top_widget = top_widget;
+       popup->shell_widget = XtCreatePopupShell(name, 
+                                                transientShellWidgetClass, 
+                                                top_widget, NULL, 0);
+       popup->dialog_widget = XtCreateManagedWidget("dialog", 
+                                                    dialogWidgetClass,
+                                                    popup->shell_widget, 
+                                                    NULL, 0);
+       for (i = 0; i < XtNumber(dialog_buttons); i++)
+           if (options & dialog_buttons[i].flag)
+               XawDialogAddButton(popup->dialog_widget, 
+                                  dialog_buttons[i].name, 
+                                  SetSelected, dialog_buttons[i].name);
+       popup->options = options;
+       return popup;
+    }
+    else
+       return NULL;
+}
+
+void 
+PopdownDialog(Dialog popup, String *answer)
+{
+    if (answer)
+       *answer = XawDialogGetValueString(popup->dialog_widget);
+    
+    XtPopdown(popup->shell_widget);
+}
+
+unsigned long 
+PopupDialog(Dialog popup, String message, String suggestion, 
+           String *answer, XtGrabKind grab)
+{
+  Position popup_x, popup_y, top_x, top_y;
+  Dimension popup_width, popup_height, top_width, top_height, border_width;
+  int n;
+  Arg wargs[4];
+
+  n = 0;
+  XtSetArg(wargs[n], XtNlabel, message); n++;
+  XtSetArg(wargs[n], XtNvalue, suggestion); n++;
+  XtSetValues(popup->dialog_widget, wargs, n);
+
+  XtRealizeWidget(popup->shell_widget);
+
+  n = 0;
+  XtSetArg(wargs[n], XtNx, &top_x); n++;
+  XtSetArg(wargs[n], XtNy, &top_y); n++;
+  XtSetArg(wargs[n], XtNwidth, &top_width); n++;
+  XtSetArg(wargs[n], XtNheight, &top_height); n++;
+  XtGetValues(popup->top_widget, wargs, n);
+
+  n = 0;
+  XtSetArg(wargs[n], XtNwidth, &popup_width); n++;
+  XtSetArg(wargs[n], XtNheight, &popup_height); n++;
+  XtSetArg(wargs[n], XtNborderWidth, &border_width); n++;
+  XtGetValues(popup->shell_widget, wargs, n);
+
+  popup_x = max(0, 
+       min(top_x + ((Position)top_width - (Position)popup_width) / 2, 
+           (Position)DisplayWidth(XtDisplay(popup->shell_widget), 
+                  DefaultScreen(XtDisplay(popup->shell_widget))) -
+           (Position)popup_width - 2 * (Position)border_width));
+  popup_y = max(0, 
+       min(top_y + ((Position)top_height - (Position)popup_height) / 2,
+           (Position)DisplayHeight(XtDisplay(popup->shell_widget), 
+                   DefaultScreen(XtDisplay(popup->shell_widget))) -
+           (Position)popup_height - 2 * (Position)border_width));
+  n = 0;
+  XtSetArg(wargs[n], XtNx, popup_x); n++;
+  XtSetArg(wargs[n], XtNy, popup_y); n++;
+  XtSetValues(popup->shell_widget, wargs, n);
+
+  selected = None;
+
+  XtPopup(popup->shell_widget, grab);
+  XWarpPointer(XtDisplay(popup->shell_widget), 
+              XtWindow(popup->top_widget),
+              XtWindow(popup->shell_widget), 
+              0, 0, top_width, top_height,
+              popup_width / 2, popup_height / 2);
+
+  while ((selected & popup->options) == None) {
+      XEvent event;
+      XtNextEvent(&event);
+      XtDispatchEvent(&event);
+  }
+
+  PopdownDialog(popup, answer);
+
+  return (selected & popup->options);
+}
diff --git a/bitmap/Dialog.h b/bitmap/Dialog.h
new file mode 100644 (file)
index 0000000..d5727ff
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+
+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.
+
+*/
+
+/*
+ * Author:  Davor Matic, MIT X Consortium
+ */
+
+
+/*#define None   0*/
+#define Yes    1<<1
+#define No     1<<2
+#define Maybe  1<<3  /* :-) */
+#define Okay   1<<4
+#define Abort  1<<5
+#define Cancel 1<<6
+#define Retry  1<<7
+
+typedef struct {
+  Widget top_widget, shell_widget, dialog_widget;
+  unsigned long options;
+} _Dialog, *Dialog;
+
+typedef struct {
+    String name;
+    unsigned long flag;
+} DialogButton;
+
+extern Dialog CreateDialog(Widget, String, unsigned long);
+extern unsigned long PopupDialog(Dialog, String, String, String *, XtGrabKind);
+extern void PopdownDialog(Dialog, String *);
diff --git a/bitmap/Down b/bitmap/Down
new file mode 100644 (file)
index 0000000..9790e27
--- /dev/null
@@ -0,0 +1,13 @@
+#define Down_width 30
+#define Down_height 30
+static char Down_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x18, 0x03, 0x00,
+   0x00, 0xb8, 0x03, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0x58, 0x03, 0x00,
+   0x00, 0xb8, 0x03, 0x00, 0x00, 0x58, 0x03, 0x00, 0x00, 0xb8, 0x03, 0x00,
+   0x00, 0x58, 0x03, 0x00, 0x00, 0xb8, 0x03, 0x00, 0x00, 0x58, 0x03, 0x00,
+   0x00, 0xb8, 0x03, 0x00, 0x00, 0x58, 0x03, 0x00, 0x00, 0xb8, 0x03, 0x00,
+   0x00, 0x58, 0x03, 0x00, 0xf0, 0xb8, 0xe3, 0x01, 0xf0, 0x59, 0xf3, 0x01,
+   0xb0, 0xbb, 0xbb, 0x01, 0x70, 0x5f, 0xdf, 0x01, 0xe0, 0xbe, 0xef, 0x00,
+   0xc0, 0x5d, 0x77, 0x00, 0x80, 0xab, 0x3a, 0x00, 0x00, 0x57, 0x1d, 0x00,
+   0x00, 0xae, 0x0e, 0x00, 0x00, 0x5c, 0x07, 0x00, 0x00, 0xb8, 0x03, 0x00,
+   0x00, 0xf0, 0x01, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00};
diff --git a/bitmap/Excl b/bitmap/Excl
new file mode 100644 (file)
index 0000000..b172389
--- /dev/null
@@ -0,0 +1,17 @@
+#define Excl_width 40
+#define Excl_height 32
+static char Excl_bits[] = {
+   0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00,
+   0x7e, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x00,
+   0x00, 0x00, 0x80, 0xc3, 0x01, 0x00, 0x00, 0xc0, 0x99, 0x03, 0x00, 0x00,
+   0xc0, 0x34, 0x03, 0x00, 0x00, 0xe0, 0x6a, 0x07, 0x00, 0x00, 0x70, 0x76,
+   0x0e, 0x00, 0x00, 0x70, 0x6a, 0x0e, 0x00, 0x00, 0x38, 0x76, 0x1c, 0x00,
+   0x00, 0x18, 0x6a, 0x18, 0x00, 0x00, 0x1c, 0x76, 0x38, 0x00, 0x00, 0x0e,
+   0x6a, 0x70, 0x00, 0x00, 0x06, 0x76, 0x60, 0x00, 0x00, 0x07, 0x6a, 0xe0,
+   0x00, 0x80, 0x03, 0x76, 0xc0, 0x01, 0x80, 0x03, 0x6a, 0xc0, 0x01, 0xc0,
+   0x01, 0x76, 0x80, 0x03, 0xc0, 0x00, 0x6a, 0x00, 0x03, 0xe0, 0x00, 0x34,
+   0x00, 0x07, 0x70, 0x00, 0x18, 0x00, 0x0e, 0x70, 0x00, 0x00, 0x00, 0x0e,
+   0x38, 0x00, 0x3c, 0x00, 0x1c, 0x1c, 0x00, 0x76, 0x00, 0x38, 0x1c, 0x00,
+   0x6a, 0x00, 0x38, 0x0e, 0x00, 0x76, 0x00, 0x70, 0x0e, 0x00, 0x3c, 0x00,
+   0x70, 0x1e, 0x00, 0x00, 0x00, 0x78, 0xfe, 0xff, 0xff, 0xff, 0x7f, 0xfc,
+   0xff, 0xff, 0xff, 0x3f};
diff --git a/bitmap/FlipHoriz b/bitmap/FlipHoriz
new file mode 100644 (file)
index 0000000..a72da3d
--- /dev/null
@@ -0,0 +1,13 @@
+#define FlipHoriz_width 30
+#define FlipHoriz_height 30
+static char FlipHoriz_bits[] = {
+   0x00, 0x80, 0x07, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x80, 0x1d, 0x00,
+   0x00, 0x80, 0x3b, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0xee, 0x00,
+   0x00, 0x00, 0xdc, 0x01, 0xc0, 0xff, 0xbf, 0x03, 0xe0, 0xff, 0x5f, 0x07,
+   0xb0, 0xaa, 0xaa, 0x0e, 0x58, 0x55, 0x55, 0x1d, 0xac, 0xaa, 0xaa, 0x0e,
+   0xfe, 0xff, 0x5f, 0x07, 0xff, 0xff, 0xbf, 0x03, 0x6b, 0x00, 0xdc, 0x01,
+   0x77, 0x00, 0xee, 0x00, 0x6b, 0x00, 0x77, 0x00, 0x77, 0x80, 0x3b, 0x00,
+   0x6b, 0x80, 0x1d, 0x00, 0x77, 0x80, 0x0f, 0x00, 0x6b, 0x80, 0x07, 0x00,
+   0xff, 0x1f, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0xac, 0x06, 0x00, 0x00,
+   0x58, 0x03, 0x00, 0x00, 0xb0, 0x06, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00,
+   0xc0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmap/FlipVert b/bitmap/FlipVert
new file mode 100644 (file)
index 0000000..f5df65b
--- /dev/null
@@ -0,0 +1,13 @@
+#define FlipVert_width 30
+#define FlipVert_height 30
+static char FlipVert_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00,
+   0x00, 0x1f, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00, 0xc0, 0x75, 0x00, 0x00,
+   0xe0, 0xea, 0x00, 0x00, 0x70, 0xd5, 0x01, 0x00, 0xb8, 0xaa, 0x03, 0x00,
+   0xdc, 0x75, 0x07, 0x00, 0xee, 0xfb, 0x0e, 0x00, 0xf7, 0xf5, 0x1d, 0x00,
+   0xbb, 0xbb, 0x1b, 0x00, 0x9f, 0x35, 0x1f, 0x00, 0x8f, 0x3b, 0x1e, 0x00,
+   0x80, 0x35, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00, 0x80, 0x35, 0x20, 0x08,
+   0x80, 0x3b, 0x60, 0x0c, 0x80, 0x35, 0xe0, 0x0e, 0x80, 0x3b, 0xe0, 0x0f,
+   0x80, 0x35, 0x60, 0x0d, 0x80, 0x3b, 0xe0, 0x0e, 0x80, 0xf5, 0x7f, 0x0d,
+   0x00, 0xfb, 0xff, 0x06, 0x00, 0xb6, 0x6a, 0x03, 0x00, 0x7c, 0xf5, 0x01,
+   0x00, 0xb8, 0xea, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0xe0, 0x3f, 0x00};
diff --git a/bitmap/Fold b/bitmap/Fold
new file mode 100644 (file)
index 0000000..ea59a19
--- /dev/null
@@ -0,0 +1,13 @@
+#define Fold_width 30
+#define Fold_height 30
+static char Fold_bits[] = {
+   0xff, 0x3f, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0x57, 0xf5, 0xab, 0x3a,
+   0xab, 0xff, 0x7f, 0x35, 0xd7, 0x3f, 0xff, 0x3a, 0xab, 0x03, 0x70, 0x35,
+   0x57, 0x07, 0xb8, 0x3a, 0xbb, 0x0e, 0x5c, 0x37, 0x7f, 0x1d, 0xae, 0x3f,
+   0xfb, 0x3a, 0xd7, 0x37, 0xdf, 0xf5, 0xeb, 0x3e, 0x9b, 0xeb, 0x75, 0x36,
+   0x1f, 0xd7, 0x3a, 0x3e, 0x1f, 0xae, 0x1d, 0x3e, 0x0e, 0xfc, 0x0e, 0x1c,
+   0x0e, 0xdc, 0x0f, 0x1c, 0x1f, 0x6e, 0x1d, 0x3e, 0x1f, 0xd7, 0x3a, 0x3e,
+   0x9b, 0xeb, 0x75, 0x36, 0xdf, 0xf5, 0xeb, 0x3e, 0xfb, 0x3a, 0xd7, 0x37,
+   0x7f, 0x1d, 0xae, 0x3f, 0xbb, 0x0e, 0x5c, 0x37, 0x57, 0x07, 0xb8, 0x3a,
+   0xab, 0x03, 0x70, 0x35, 0xd7, 0x3f, 0xff, 0x3a, 0xab, 0xff, 0x7f, 0x35,
+   0x57, 0xf5, 0xab, 0x3a, 0xff, 0xff, 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f};
diff --git a/bitmap/Graphics.c b/bitmap/Graphics.c
new file mode 100644 (file)
index 0000000..f09c41b
--- /dev/null
@@ -0,0 +1,1573 @@
+/*
+
+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.
+
+*/
+
+/*
+ * Author:  Davor Matic, MIT X Consortium
+ */
+
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <X11/Xfuncs.h>
+#include "BitmapP.h"
+#include "Bitmap.h"
+#include "Requests.h"
+    
+#include <stdio.h>
+#include <math.h>
+
+#ifndef abs
+#define abs(x)                        (((x) > 0) ? (x) : -(x))
+#endif
+#define min(x, y)                     (((int)(x) < (int)(y)) ? (x) : (y))
+#define max(x, y)                     (((int)(x) > (int)(y)) ? (x) : (y))
+#ifndef rint
+#define rint(x)                       floor(x + 0.5)
+#endif
+
+/*****************************************************************************\
+ *                                   Graphics                                *
+\*****************************************************************************/
+
+#define GetBit(image, x, y)\
+    ((bit)((*(image->data + (x) / 8 + (y) * image->bytes_per_line) &\
+           (1 << ((x) % 8))) ? 1 : 0))
+
+#if 0
+bit 
+BWGetBit(Widget w, Position x, Position y)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    if (QueryInBitmap(BW, x, y))
+       return GetBit(BW->bitmap.image, x, y);
+    else
+       return NotSet;
+}
+#endif
+
+#define InvertBit(image, x, y)\
+    (*(image->data + (x) / 8 + (y) * image->bytes_per_line) ^=\
+     (bit) (1 << ((x) % 8)))
+
+
+#define SetBit(image, x, y)\
+    (*(image->data + (x) / 8 + (y) * image->bytes_per_line) |=\
+     (bit) (1 << ((x) % 8)))
+
+#define ClearBit(image, x, y)\
+    (*(image->data + (x) / 8 + (y) * image->bytes_per_line) &=\
+     (bit)~(1 << ((x) % 8)))
+
+
+#define HighlightSquare(BW, x, y)\
+    XFillRectangle(XtDisplay(BW), XtWindow(BW),\
+                   BW->bitmap.highlighting_gc,\
+                  InWindowX(BW, x), InWindowY(BW, y),\
+                   BW->bitmap.squareW, BW->bitmap.squareH)
+/*
+void 
+HighlightSquare(BitmapWidget BW, Position x, Position y)
+{
+    XFillRectangle(XtDisplay(BW), XtWindow(BW),
+                   BW->bitmap.highlighting_gc,
+                  InWindowX(BW, x), InWindowY(BW, y),
+                   BW->bitmap.squareW, BW->bitmap.squareH);
+}
+*/
+
+#define DrawSquare(BW, x, y)\
+    XFillRectangle(XtDisplay(BW), XtWindow(BW),\
+                   BW->bitmap.drawing_gc,\
+                  InWindowX(BW, x), InWindowY(BW, y),\
+                   BW->bitmap.squareW, BW->bitmap.squareH) 
+
+/*
+void 
+DrawSquare(BitmapWidget BW, Position x, Position y)
+{
+    XFillRectangle(XtDisplay(BW), XtWindow(BW),
+                   BW->bitmap.drawing_gc,
+                  InWindowX(BW, x), InWindowY(BW, y),
+                   BW->bitmap.squareW, BW->bitmap.squareH);
+}
+*/
+
+#define InvertPoint(BW, x, y)\
+    {InvertBit(BW->bitmap.image, x, y); DrawSquare(BW, x, y);}
+
+#define DrawPoint(BW, x, y, value)\
+    if (GetBit(BW->bitmap.image, x, y) != value)\
+       InvertPoint(BW, x, y)
+
+void 
+BWDrawPoint(Widget w, Position x, Position y, bit value)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    if (QueryInBitmap(BW, x, y)) {
+       if (value == Highlight)
+           HighlightSquare(BW, x, y);
+       else
+           DrawPoint(BW, x, y, value);
+    }
+}
+
+static XPoint *
+HotSpotShape(BitmapWidget BW, Position x, Position y)
+{
+    static XPoint points[5];
+  
+    points[0].x = InWindowX(BW, x);
+    points[0].y = InWindowY(BW, y + 1.0/2);
+    points[1].x = InWindowX(BW, x + 1.0/2);
+    points[1].y = InWindowY(BW, y + 1);
+    points[2].x = InWindowX(BW, x + 1);
+    points[2].y = InWindowY(BW, y + 1.0/2);
+    points[3].x = InWindowX(BW, x + 1.0/2);
+    points[3].y = InWindowY(BW, y);
+    points[4].x = InWindowX(BW, x);
+    points[4].y = InWindowY(BW, y + 1.0/2);
+    
+    return points;
+}
+
+#define DrawHotSpot(BW, x, y)\
+  XFillPolygon(XtDisplay(BW), XtWindow(BW), BW->bitmap.drawing_gc,\
+              HotSpotShape(BW, x, y), 5, Convex, CoordModeOrigin)
+
+#define HighlightHotSpot(BW, x, y)\
+  XFillPolygon(XtDisplay(BW), XtWindow(BW), BW->bitmap.highlighting_gc,\
+              HotSpotShape(BW, x, y), 5, Convex, CoordModeOrigin)
+
+/*
+XImage *CreateBitmapImage();
+void DestroyBitmapImage();
+*/
+
+void 
+BWRedrawHotSpot(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y))
+       DrawHotSpot(BW, BW->bitmap.hot.x, BW->bitmap.hot.y);
+}
+
+void 
+BWClearHotSpot(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)) {
+      DrawHotSpot(BW, BW->bitmap.hot.x, BW->bitmap.hot.y);
+      BW->bitmap.hot.x = BW->bitmap.hot.y = NotSet;
+    }
+}
+
+void 
+BWDrawHotSpot(Widget w, Position x, Position y, int value)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    if (QueryInBitmap(BW, x, y)) {
+       if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y) &&
+           ((BW->bitmap.hot.x == x) && (BW->bitmap.hot.y == y))) {
+           if ((value == Clear) || (value == Invert)) {
+               BWClearHotSpot(w);
+           }
+       }
+       else
+           if ((value == Set) || (value == Invert)) {
+               BWClearHotSpot(w);
+               DrawHotSpot(BW, x, y);
+               BW->bitmap.hot.x = x;
+               BW->bitmap.hot.y = y;
+           }
+       
+       if (value == Highlight)
+           HighlightHotSpot(BW, x, y); 
+    }
+}
+
+void 
+BWSetHotSpot(Widget w, Position x, Position y)
+{
+    if (QuerySet(x, y))
+       BWDrawHotSpot(w, x, y, Set);
+    else
+       BWClearHotSpot(w);
+}
+
+/* high level procedures */
+
+void 
+BWRedrawSquares(Widget w, 
+               Position x, Position y, 
+               Dimension width, Dimension height)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    Position from_x = InBitmapX(BW, x);
+    Position from_y = InBitmapY(BW, y);
+    Position to_x = InBitmapX(BW, x + width);
+    Position to_y = InBitmapY(BW, y + height);
+
+    QuerySwap(from_x, to_x);
+    QuerySwap(from_y, to_y);
+    from_x = max(0, from_x);
+    from_y = max(0, from_y);
+    to_x = min(BW->bitmap.image->width - 1, to_x);
+    to_y = min(BW->bitmap.image->height - 1, to_y);
+  
+    for (x = from_x; x <= to_x; x++)
+       for (y = from_y; y <= to_y; y++)
+           if (GetBit(BW->bitmap.image, x, y)) DrawSquare(BW, x, y);
+}
+
+void 
+BWDrawGrid(Widget w, 
+          Position from_x, Position from_y, 
+          Position to_x, Position to_y)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    int i;
+  
+    QuerySwap(from_x, to_x);
+    QuerySwap(from_y, to_y);
+    from_x = max(0, from_x);
+    from_y = max(0, from_y);
+    to_x = min(BW->bitmap.image->width - 1, to_x);
+    to_y = min(BW->bitmap.image->height - 1, to_y);
+  
+    for(i = from_x + (from_x == 0); i <= to_x; i++)
+       XDrawLine(XtDisplay(BW), XtWindow(BW), 
+                 BW->bitmap.frame_gc,
+                 InWindowX(BW, i), InWindowY(BW, from_y),
+                 InWindowX(BW, i), InWindowY(BW, to_y + 1));
+  
+    for(i = from_y + (from_y == 0); i <= to_y; i++)
+       XDrawLine(XtDisplay(BW), XtWindow(BW), 
+                 BW->bitmap.frame_gc,
+                 InWindowX(BW, from_x), InWindowY(BW, i),
+                 InWindowX(BW, to_x + 1), InWindowY(BW, i));
+}
+
+
+void 
+BWRedrawGrid(Widget w, 
+            Position x, Position y, 
+            Dimension width, Dimension height)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    Position from_x = InBitmapX(BW, x);
+    Position from_y = InBitmapY(BW, y);
+    Position to_x = InBitmapX(BW, x + width);
+    Position to_y = InBitmapY(BW, y + height);
+
+    if (BW->bitmap.grid)
+       BWDrawGrid(w, from_x, from_y, to_x, to_y);
+}
+
+void 
+BWDrawLine(Widget w, 
+          Position from_x, Position from_y, 
+          Position to_x, Position to_y, int value)
+{
+    Position i;
+    register double x, y;
+    double dx, dy, delta;
+
+    dx = to_x - from_x;
+    dy = to_y - from_y;
+    x = from_x + 0.5;
+    y = from_y + 0.5;
+    delta = max(abs(dx), abs(dy));
+    if (delta > 0) {
+       dx /= delta;
+       dy /= delta;
+       for(i = 0; i <= delta; i++) {
+           BWDrawPoint(w, (Position) x, (Position) y, value);
+           x += dx;
+           y += dy;
+       }
+    }
+    else
+       BWDrawPoint(w, from_x, from_y, value);
+}
+
+void 
+BWBlindLine(Widget w, 
+           Position from_x, Position from_y, 
+           Position to_x, Position to_y, int value)
+{
+    Position i;
+    register double x, y;
+    double dx, dy, delta;
+
+    dx = to_x - from_x;
+    dy = to_y - from_y;
+    x = from_x + 0.5;
+    y = from_y + 0.5;
+    delta = max(abs(dx), abs(dy));
+    if (delta > 0) {
+       dx /= delta;
+       dy /= delta;
+       x += dx;
+       y += dy;
+       for(i = 1; i <= delta; i++) {
+           BWDrawPoint(w, (Position) x, (Position) y, value);
+           x += dx;
+           y += dy;
+       }
+    }
+    else
+       BWDrawPoint(w, from_x, from_y, value);
+}
+
+void 
+BWDrawRectangle(Widget w, 
+               Position from_x, Position from_y, 
+               Position to_x, Position to_y, int value)
+{
+    register Position i;
+    Dimension delta, width, height;
+    
+    QuerySwap(from_x, to_x);
+    QuerySwap(from_y, to_y);
+    
+    width = to_x - from_x;
+    height = to_y - from_y;
+
+    delta = max(width, height);
+    
+    if (!QueryZero(width, height)) {
+       for (i = 0; (int)i < (int)delta; i++) {
+           if ((int)i < (int)width) {
+               BWDrawPoint(w, from_x + i, from_y, value);
+               BWDrawPoint(w, to_x - i, to_y, value);
+           }
+           if ((int)i < (int)height) {
+               BWDrawPoint(w, from_x, to_y - i, value);
+               BWDrawPoint(w, to_x, from_y + i, value);
+           }
+       }
+    }
+    else
+       BWDrawLine(w, 
+                  from_x, from_y, 
+                  to_x, to_y, value);
+}
+  
+void 
+BWDrawFilledRectangle(Widget w, 
+                     Position from_x, Position from_y, 
+                     Position to_x, Position to_y, int value)
+{
+    register Position x, y;
+
+    QuerySwap(from_x, to_x);
+    QuerySwap(from_y, to_y);
+    
+    for (x = from_x; x <= to_x; x++)
+       for (y = from_y; y <= to_y; y++)
+           BWDrawPoint(w, x, y, value);
+}
+
+void 
+BWDrawCircle(Widget w, 
+            Position origin_x, Position origin_y, 
+            Position point_x, Position point_y, int value)
+{
+    register Position i, delta;
+    Dimension dx, dy, half;
+    double radius;
+    
+    dx = abs(point_x - origin_x);
+    dy = abs(point_y - origin_y);
+    radius = sqrt((double) ((int)dx * (int)dx + (int)dy * (int)dy));
+    if (radius < 1.0) {
+       BWDrawPoint(w, origin_x, origin_y, value);
+    }
+    else {
+       BWDrawPoint(w, origin_x - (Position) floor(radius), origin_y, value);
+       BWDrawPoint(w, origin_x + (Position) floor(radius), origin_y, value);
+       BWDrawPoint(w, origin_x, origin_y - (Position) floor(radius), value);
+       BWDrawPoint(w, origin_x, origin_y + (Position) floor(radius), value);
+    }
+    half = radius / sqrt(2.0);
+    for(i = 1; (int)i <= (int)half; i++) {
+       delta = sqrt(radius * radius - i * i);
+       BWDrawPoint(w, origin_x - delta, origin_y - i, value);
+       BWDrawPoint(w, origin_x - delta, origin_y + i, value);
+       BWDrawPoint(w, origin_x + delta, origin_y - i, value);
+       BWDrawPoint(w, origin_x + delta, origin_y + i, value);
+       if (i != delta) {
+           BWDrawPoint(w, origin_x - i, origin_y - delta, value);
+           BWDrawPoint(w, origin_x - i, origin_y + delta, value);
+           BWDrawPoint(w, origin_x + i, origin_y - delta, value);
+           BWDrawPoint(w, origin_x + i, origin_y + delta, value);
+       }
+    }
+}
+
+void 
+BWDrawFilledCircle(Widget w, 
+                  Position origin_x, Position origin_y, 
+                  Position point_x, Position point_y, int value)
+{
+    register Position i, j, delta;
+    Dimension dx, dy;
+    double radius;
+    
+    dx = abs(point_x - origin_x);
+    dy = abs(point_y - origin_y);
+    radius = sqrt((double) ((int)dx * (int)dx + (int)dy * (int)dy));
+    for(j = origin_x - (Position) floor(radius); 
+       j <= origin_x + (Position) floor(radius); j++)
+       BWDrawPoint(w, j, origin_y, value);
+    for(i = 1; i <= (Position) floor(radius); i++) {
+       delta = sqrt(radius * radius - i * i);
+       for(j = origin_x - delta; j <= origin_x + delta; j++) {
+           BWDrawPoint(w, j, origin_y - i, value);
+           BWDrawPoint(w, j, origin_y + i, value);
+       }
+    }
+}
+
+#define QueryFlood(BW, x, y, value)\
+    ((GetBit(BW->bitmap.image, x, y) !=\
+      (value & 1)) && QueryInBitmap(BW, x, y))
+
+#define Flood(BW, x, y, value)\
+    {if (value == Highlight) HighlightSquare(BW, x, y);\
+     else InvertPoint(BW, x, y);}
+
+/*
+static void 
+FloodLoop(BitmapWidget BW, Position x, Position y, int value)
+{
+    if (QueryFlood(BW, x, y, value)) {
+       Flood(BW, x, y, value);
+       FloodLoop(BW, x, y - 1, value);
+       FloodLoop(BW, x - 1, y, value);
+       FloodLoop(BW, x, y + 1, value);
+       FloodLoop(BW, x + 1, y, value);
+    }
+}
+*/
+
+static void 
+FloodLoop(BitmapWidget BW, Position x, Position y, int value)
+{
+    Position save_x, save_y, x_left, x_right;
+    
+    if (QueryFlood(BW, x, y, value)) 
+       Flood(BW, x, y, value)
+
+
+    save_x = x;
+    save_y = y;
+
+    x++;
+    while (QueryFlood(BW, x, y, value)) {
+       Flood(BW, x, y, value);
+       x++;
+    }
+    x_right = --x;
+
+    x = save_x;
+    x--;
+    while (QueryFlood(BW, x, y, value)) {
+       Flood(BW, x, y, value);
+       x--;
+    }
+    x_left = ++x;
+
+
+    x = x_left;
+    y = save_y;
+    y++;
+    
+    while (x <= x_right) {
+       Boolean flag = False;
+       Position x_enter;
+       
+       while (QueryFlood(BW, x, y, value) && (x <= x_right)) {
+           flag = True;
+           x++;
+       }
+       
+       if (flag) {
+           if ((x == x_right) && QueryFlood(BW, x, y, value))
+               FloodLoop(BW, x, y, value);
+           else
+               FloodLoop(BW, x - 1, y, value);
+       }
+       
+       x_enter = x;
+       
+       while (!QueryFlood(BW, x, y, value) && (x < x_right))
+           x++;
+       
+       if (x == x_enter) x++;
+    }
+
+    x = x_left;
+    y = save_y;
+    y--;
+
+    while (x <= x_right) {
+       Boolean flag = False;
+       Position x_enter;
+       
+       while (QueryFlood(BW, x, y, value) && (x <= x_right)) {
+           flag = True;
+           x++;
+       }
+       
+       if (flag) {
+           if ((x == x_right) && QueryFlood(BW, x, y, value))
+               FloodLoop(BW, x, y, value);
+           else
+               FloodLoop(BW, x - 1, y, value);
+       }
+       
+       x_enter = x;
+       
+       while (!QueryFlood(BW, x, y, value) && (x < x_right))
+           x++;
+       
+       if (x == x_enter) x++;
+    }
+}
+
+void 
+BWFloodFill(Widget w, Position x, Position y, int value)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    int pixel;
+
+    pixel = GetBit(BW->bitmap.image, x, y);
+
+    if (value == Invert)
+       FloodLoop(BW, x, y, (pixel ? Clear : Set));
+    else if (value != pixel)
+       FloodLoop(BW, x, y, value); 
+}
+
+#define QueryHotInMark(BW)\
+    ((BW->bitmap.hot.x == max(BW->bitmap.mark.from_x,\
+                             min(BW->bitmap.hot.x, BW->bitmap.mark.to_x)))\
+     &&\
+     (BW->bitmap.hot.y == max(BW->bitmap.mark.from_y,\
+                             min(BW->bitmap.hot.y, BW->bitmap.mark.to_y))))
+
+void 
+BWUp(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    register Position x, y;
+    bit first, up, down=0;
+    Position from_x, from_y, to_x, to_y;
+
+    if (BWQueryMarked(w)) {
+       from_x = BW->bitmap.mark.from_x;
+       from_y = BW->bitmap.mark.from_y;
+       to_x = BW->bitmap.mark.to_x;
+       to_y = BW->bitmap.mark.to_y;
+    }
+    else {
+       from_x = 0;
+       from_y = 0;
+       to_x = BW->bitmap.width - 1;
+       to_y = BW->bitmap.height - 1;
+    }
+
+    if ((to_y - from_y) == 0)
+       return;
+    
+    for(x = from_x; x <= to_x; x++) {
+       first = up = GetBit(BW->bitmap.image, x, to_y);
+       for(y = to_y - 1; y >= from_y; y--) {
+           down = GetBit(BW->bitmap.image, x, y);
+           if (up != down) 
+               InvertPoint(BW, x, y);
+           up =down;
+       }
+       if(first != down)
+           InvertPoint(BW, x, to_y);
+    }
+
+    if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)
+       &&
+       !BWQueryMarked(w))
+       BWSetHotSpot(w,
+                    BW->bitmap.hot.x,
+                    (BW->bitmap.hot.y - 1 + BW->bitmap.image->height) % 
+                    BW->bitmap.image->height);
+
+}
+
+void 
+BWDown(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    register Position x, y;
+    bit first, down, up=0;
+    Position from_x, from_y, to_x, to_y;
+
+    if (BWQueryMarked(w)) {
+       from_x = BW->bitmap.mark.from_x;
+       from_y = BW->bitmap.mark.from_y;
+       to_x = BW->bitmap.mark.to_x;
+       to_y = BW->bitmap.mark.to_y;
+    }
+    else {
+       from_x = 0;
+       from_y = 0;
+       to_x = BW->bitmap.width - 1;
+       to_y = BW->bitmap.height - 1;
+    }
+
+    if ((to_y - from_y) == 0)
+       return;
+
+    for(x = from_x; x <= to_x; x++) {
+       first = down = GetBit(BW->bitmap.image, x, from_y);
+       for(y = from_y + 1; y <= to_y; y++) {
+           up = GetBit(BW->bitmap.image, x, y);
+           if (down != up)
+               InvertPoint(BW, x, y);
+           down = up;
+       }
+       if(first != up) 
+           InvertPoint(BW, x, from_y);
+    }
+    
+    if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)
+       &&
+       !BWQueryMarked(w))
+       BWSetHotSpot(w,
+                    BW->bitmap.hot.x,
+                    (BW->bitmap.hot.y + 1) % BW->bitmap.image->height);
+}
+
+void 
+BWLeft(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    register Position x, y;
+    bit first, left, right=0;
+    Position from_x, from_y, to_x, to_y;
+    
+    if (BWQueryMarked(w)) {
+       from_x = BW->bitmap.mark.from_x;
+       from_y = BW->bitmap.mark.from_y;
+       to_x = BW->bitmap.mark.to_x;
+       to_y = BW->bitmap.mark.to_y;
+    }
+    else {
+       from_x = 0;
+       from_y = 0;
+       to_x = BW->bitmap.width - 1;
+       to_y = BW->bitmap.height - 1;
+    }
+
+    if ((to_x - from_x) == 0)
+       return;
+    
+    for(y = from_y; y <= to_y; y++) {
+       first = left = GetBit(BW->bitmap.image, to_x, y);
+       for(x = to_x - 1; x >= from_x; x--) {
+           right = GetBit(BW->bitmap.image, x, y);
+           if (left != right)
+               InvertPoint(BW, x, y);
+           left = right;
+       }
+       if(first != right)
+           InvertPoint(BW, to_x, y);
+    }
+    
+    if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)
+       &&
+       !BWQueryMarked(w))
+       BWSetHotSpot(w,
+                    (BW->bitmap.hot.x - 1 + BW->bitmap.image->width) % 
+                    BW->bitmap.image->width,
+                    BW->bitmap.hot.y);
+}
+
+void 
+BWRight(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    register Position x, y;
+    bit first, right, left=0;
+    Position from_x, from_y, to_x, to_y;
+    
+    if (BWQueryMarked(w)) {
+       from_x = BW->bitmap.mark.from_x;
+       from_y = BW->bitmap.mark.from_y;
+       to_x = BW->bitmap.mark.to_x;
+       to_y = BW->bitmap.mark.to_y;
+    }
+    else {
+       from_x = 0;
+       from_y = 0;
+       to_x = BW->bitmap.width - 1;
+       to_y = BW->bitmap.height - 1;
+    }
+    
+    if ((to_x - from_x) == 0)
+       return;
+    
+    for(y = from_y; y <= to_y; y++) {
+       first = right = GetBit(BW->bitmap.image, from_x, y);
+       for(x = from_x + 1; x <= to_x; x++) {
+           left = GetBit(BW->bitmap.image, x, y);
+           if (right != left)
+               InvertPoint(BW, x, y);
+           right = left;
+       }
+       if(first != left)
+           InvertPoint(BW, from_x, y);
+    }
+
+    if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)
+       &&
+       !BWQueryMarked(w))
+       BWSetHotSpot(w,
+                    (BW->bitmap.hot.x + 1) % BW->bitmap.image->width,
+                    BW->bitmap.hot.y);
+}
+
+/* void TransferImageData(); */
+
+void 
+BWFold(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    Position x, y, new_x, new_y;
+    Dimension horiz, vert;
+    char *storage_data;
+    XImage *storage;
+       
+    storage_data = CreateCleanData(Length(BW->bitmap.image->width, 
+                                         BW->bitmap.image->height));
+
+    storage = CreateBitmapImage(BW, storage_data, 
+                               (Dimension) BW->bitmap.image->width, 
+                               (Dimension) BW->bitmap.image->height);
+
+    TransferImageData(BW->bitmap.image, storage);
+
+    BW->bitmap.fold ^= True;
+    horiz = (BW->bitmap.image->width + BW->bitmap.fold) / 2;
+    vert = (BW->bitmap.image->height + BW->bitmap.fold) / 2;
+    
+    for (x = 0; x < BW->bitmap.image->width; x++)
+       for (y = 0; y < BW->bitmap.image->height; y++) {
+           new_x = (int)(x + horiz) % (int)BW->bitmap.image->width;
+           new_y = (int)(y + vert) % (int)BW->bitmap.image->height;
+           if(GetBit(BW->bitmap.image, new_x, new_y) != 
+              GetBit(storage, x, y))
+               InvertPoint(BW, new_x, new_y);
+       }
+    
+    DestroyBitmapImage(&storage);
+
+    if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y))
+      BWSetHotSpot(w, 
+                  (Position) 
+                  ((int)(BW->bitmap.hot.x+horiz)
+                   %(int)BW->bitmap.image->width),
+                  (Position)
+                  ((int)(BW->bitmap.hot.y+vert)
+                   %(int)BW->bitmap.image->height)
+                  );
+}
+
+
+void 
+BWClear(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    register Position x, y;
+    int i, length;
+
+    length = Length(BW->bitmap.image->width, BW->bitmap.image->height);
+
+    for (x = 0; x < BW->bitmap.image->width; x++)
+       for (y = 0; y < BW->bitmap.image->height; y++)
+           if (GetBit(BW->bitmap.image, x, y))
+               DrawSquare(BW, x, y);
+    
+    for (i = 0; i < length; i++)
+       BW->bitmap.image->data[i] = 0;
+
+}
+
+void 
+BWSet(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    register Position x, y;
+    int i, length;
+    
+    length = Length(BW->bitmap.image->width, BW->bitmap.image->height);
+    
+    for (x = 0; x < BW->bitmap.image->width; x++)
+       for (y = 0; y < BW->bitmap.image->height; y++)
+           if (!GetBit(BW->bitmap.image, x, y))
+               DrawSquare(BW, x, y);
+    
+    for (i = 0; i < length; i++)
+       BW->bitmap.image->data[i] = (char)255;
+
+}
+void 
+BWRedraw(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    XClearArea(XtDisplay(BW), XtWindow(BW),
+              0, 0, BW->core.width, BW->core.height,
+              True);
+}
+
+void 
+BWInvert(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    int i, length;
+
+    length = Length(BW->bitmap.image->width, BW->bitmap.image->height);
+
+    XFillRectangle(XtDisplay(BW), XtWindow(BW),
+                  BW->bitmap.drawing_gc,
+                  InWindowX(BW, 0), InWindowY(BW, 0),
+                  InWindowX(BW, BW->bitmap.image->width) - InWindowX(BW, 0),
+                  InWindowY(BW, BW->bitmap.image->height) - InWindowY(BW, 0));
+    
+    for (i = 0; i < length; i++)
+       BW->bitmap.image->data[i] ^= 255;
+}
+
+void 
+BWFlipHoriz(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    register Position x, y;
+    Position from_x, from_y, to_x, to_y;
+    float half;
+    
+    if (BWQueryMarked(w)) {
+       from_x = BW->bitmap.mark.from_x;
+       from_y = BW->bitmap.mark.from_y;
+       to_x = BW->bitmap.mark.to_x;
+       to_y = BW->bitmap.mark.to_y;
+    }
+    else {
+       from_x = 0;
+       from_y = 0;
+       to_x = BW->bitmap.width - 1;
+       to_y = BW->bitmap.height - 1;
+    }
+    half = (float) (to_y - from_y) / 2.0 + 0.5;
+    
+    if (half == 0.0)
+       return;
+    
+    for (x = from_x; x <= to_x; x++) 
+       for (y = 0; y <  half; y++)
+           if (GetBit(BW->bitmap.image, x, from_y + y) != 
+               GetBit(BW->bitmap.image, x, to_y - y)) {
+               InvertPoint(BW, x, from_y + y);
+               InvertPoint(BW, x, to_y - y);
+           }
+    
+    if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)
+       &&
+       !BWQueryMarked(w))
+       BWSetHotSpot(w,
+                    BW->bitmap.hot.x,
+                    BW->bitmap.image->height - 1 - BW->bitmap.hot.y);
+}
+
+void 
+BWFlipVert(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    register Position x, y;
+    Position from_x, from_y, to_x, to_y;
+    float half;
+    
+    if (BWQueryMarked(w)) {
+       from_x = BW->bitmap.mark.from_x;
+       from_y = BW->bitmap.mark.from_y;
+       to_x = BW->bitmap.mark.to_x;
+       to_y = BW->bitmap.mark.to_y;
+    }
+    else {
+       from_x = 0;
+       from_y = 0;
+       to_x = BW->bitmap.width - 1;
+       to_y = BW->bitmap.height - 1;
+    }
+    half = (float) (to_x - from_x) / 2.0 + 0.5;
+
+    if (half == 0)
+       return;
+
+    for (y = from_y; y <= to_y; y++)
+       for (x = 0; x < half; x++)
+           if (GetBit(BW->bitmap.image, from_x + x, y) != 
+               GetBit(BW->bitmap.image, to_x - x, y)) {
+               InvertPoint(BW, from_x + x, y);
+               InvertPoint(BW, to_x - x, y);
+           }
+    
+    if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)
+       &&
+       !BWQueryMarked(w))
+       BWSetHotSpot(w,
+                    BW->bitmap.image->width - 1 - BW->bitmap.hot.x,
+                    BW->bitmap.hot.y);
+}
+
+
+void 
+BWRotateRight(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    Position x, y, delta, shift, tmp;
+    Position half_width, half_height;
+    XPoint hot;
+    bit quad1, quad2, quad3, quad4;
+    Position from_x, from_y, to_x, to_y;
+    
+    if (BWQueryMarked(w)) {
+       from_x = BW->bitmap.mark.from_x;
+       from_y = BW->bitmap.mark.from_y;
+       to_x = BW->bitmap.mark.to_x;
+       to_y = BW->bitmap.mark.to_y;
+    }
+    else {
+       from_x = 0;
+       from_y = 0;
+       to_x = BW->bitmap.width - 1;
+       to_y = BW->bitmap.height - 1;
+    }
+
+    half_width = floor((to_x - from_x) / 2.0 + 0.5);
+    half_height = floor((to_y - from_y ) / 2.0 + 0.5);
+    shift = min((Position)(to_x - from_x), (Position)(to_y - from_y )) % 2;
+    delta = min((Position) half_width, (Position) half_height) - shift;
+    
+    for (x = 0; x <= delta; x++) {
+       for (y = 1 - shift; y <= delta; y++) {
+           quad1 = GetBit(BW->bitmap.image, 
+                          from_x + (Position)half_width + x, 
+                          from_y + (Position)half_height + y);
+           quad2 = GetBit(BW->bitmap.image, 
+                          from_x + (Position)half_width + y, 
+                          from_y + (Position)half_height - shift - x);
+           quad3 = GetBit(BW->bitmap.image, 
+                          from_x + (Position)half_width - shift - x, 
+                          from_y + (Position)half_height - shift - y);
+           quad4 = GetBit(BW->bitmap.image, 
+                          from_x + (Position)half_width - shift - y, 
+                          from_y + (Position)half_height + x);
+
+           if (quad1 != quad2)
+               InvertPoint(BW, 
+                           from_x + (Position)half_width + x, 
+                           from_y + (Position)half_height + y);
+           if (quad2 != quad3)
+               InvertPoint(BW, 
+                           from_x + (Position)half_width + y, 
+                           from_y + (Position)half_height - shift - x);
+           if (quad3 != quad4)
+               InvertPoint(BW, 
+                           from_x + (Position)half_width - shift - x,
+                           from_y + (Position)half_height - shift - y);
+           if (quad4 != quad1)
+               InvertPoint(BW, 
+                           from_x + (Position)half_width - shift - y, 
+                           from_y + (Position)half_height + x);
+       }
+    }
+    
+    if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)
+       &&
+       !BWQueryMarked(w)) {
+       hot.x = BW->bitmap.hot.x - half_width;
+       hot.y = BW->bitmap.hot.y - half_height;
+       if (hot.x >= 0) hot.x += shift;
+       if (hot.y >= 0) hot.y += shift;
+       tmp = hot.x;
+       hot.x = - hot.y;
+       hot.y = tmp;
+       if (hot.x > 0) hot.x -= shift;
+       if (hot.y > 0) hot.y -= shift;
+       hot.x += half_width;
+       hot.y += half_height;
+       if (QueryInBitmap(BW, hot.x, hot.y))
+           BWSetHotSpot(w, hot.x, hot.y);
+    }
+    
+}
+
+void 
+BWRotateLeft(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    Position x, y,delta, shift, tmp;
+    Position half_width, half_height;
+    XPoint hot;
+    bit quad1, quad2, quad3, quad4;
+    Position from_x, from_y, to_x, to_y;
+    
+    if (BWQueryMarked(w)) {
+       from_x = BW->bitmap.mark.from_x;
+       from_y = BW->bitmap.mark.from_y;
+       to_x = BW->bitmap.mark.to_x;
+       to_y = BW->bitmap.mark.to_y;
+    }
+    else {
+       from_x = 0;
+       from_y = 0;
+       to_x = BW->bitmap.width - 1;
+       to_y = BW->bitmap.height - 1;
+    }
+
+    half_width = floor((to_x - from_x) / 2.0 + 0.5);
+    half_height = floor((to_y - from_y ) / 2.0 + 0.5);
+    shift = min((Position)(to_x - from_x), (Position)(to_y - from_y )) % 2;
+    delta = min((Position) half_width, (Position) half_height) - shift;
+    
+    for (x = 0; x <= delta; x++) {
+       for (y = 1 - shift; y <= delta; y++) {
+           quad1 = GetBit(BW->bitmap.image, 
+                          from_x + (Position)half_width + x, 
+                          from_y + (Position)half_height + y);
+           quad2 = GetBit(BW->bitmap.image, 
+                          from_x + (Position)half_width + y, 
+                          from_y + (Position)half_height - shift - x);
+           quad3 = GetBit(BW->bitmap.image, 
+                          from_x + (Position)half_width - shift - x, 
+                          from_y + (Position)half_height - shift - y);
+           quad4 = GetBit(BW->bitmap.image, 
+                          from_x + (Position)half_width - shift - y, 
+                          from_y + (Position)half_height + x);
+
+           if (quad1 != quad4)
+               InvertPoint(BW, 
+                           from_x + (Position)half_width + x, 
+                           from_y + (Position)half_height + y);
+           if (quad2 != quad1)
+               InvertPoint(BW, 
+                           from_x + (Position)half_width + y, 
+                           from_y + (Position)half_height - shift - x);
+           if (quad3 != quad2)
+               InvertPoint(BW, 
+                           from_x + (Position)half_width - shift - x,
+                           from_y + (Position)half_height - shift - y);
+           if (quad4 != quad3)
+               InvertPoint(BW, 
+                           from_x + (Position)half_width - shift - y, 
+                           from_y + (Position)half_height + x);
+       }
+    }
+    
+    if (QuerySet(BW->bitmap.hot.x, BW->bitmap.hot.y)
+       &&
+       !BWQueryMarked(w)) {
+       hot.x = BW->bitmap.hot.x - half_width;
+       hot.y = BW->bitmap.hot.y - half_height;
+       if (hot.x >= 0) hot.x += shift;
+       if (hot.y >= 0) hot.y += shift;
+       tmp = hot.x;
+       hot.x = hot.y;
+       hot.y = - tmp;
+       if (hot.x > 0) hot.x -= shift;
+       if (hot.y > 0) hot.y -= shift;
+       hot.x += half_width;
+       hot.y += half_height;
+       if (QueryInBitmap(BW, hot.x, hot.y))
+           BWSetHotSpot(w, hot.x, hot.y);
+    }
+}
+
+
+void 
+CopyImageData(XImage *source, XImage *destination, 
+             Position from_x, Position from_y, 
+             Position to_x, Position to_y, 
+             Position at_x, Position at_y)
+{
+    Position x, y, delta_x, delta_y;
+    
+    delta_x = to_x - from_x + 1;
+    delta_y = to_y - from_y + 1;
+    
+    for (x = 0; x < delta_x; x++)
+       for (y = 0; y < delta_y; y++)
+           if (GetBit(source, from_x + x, from_y + y))
+               SetBit(destination, at_x + x, at_y + y);
+           else
+               ClearBit(destination, at_x + x, at_y + y);
+}
+      
+XImage *
+ConvertToBitmapImage(BitmapWidget BW, XImage *image)
+{
+    XImage *bitmap_image;
+    char   *data;
+    Position x, y;
+    
+    data = CreateCleanData(Length(image->width, image->height));
+    bitmap_image = CreateBitmapImage(BW, data, 
+                                    (Dimension) image->width, 
+                                    (Dimension) image->height);
+
+    for (x = 0; x < min(image->width, bitmap_image->width); x++)
+       for (y = 0; y < min(image->height, bitmap_image->height); y++)
+           if ((XGetPixel(image, x, y) != 0) != GetBit(bitmap_image, x, y))
+               InvertBit(bitmap_image, x, y);
+
+    return bitmap_image;
+}
+
+void 
+TransferImageData(XImage *source, XImage *destination)
+{
+    Position x, y;
+    
+    for (x = 0; x < min(source->width, destination->width); x++)
+       for (y = 0; y < min(source->height, destination->height); y++)
+           if (GetBit(source, x, y) != GetBit(destination, x, y))
+               InvertBit(destination, x, y);
+}
+
+void 
+BWStore(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    Dimension width, height;
+    char *storage_data;
+
+    if (QuerySet(BW->bitmap.mark.from_x, BW->bitmap.mark.from_y)) {
+
+       DestroyBitmapImage(&BW->bitmap.storage);
+
+       width = BW->bitmap.mark.to_x - BW->bitmap.mark.from_x + 1;
+       height = BW->bitmap.mark.to_y - BW->bitmap.mark.from_y + 1;
+       
+       storage_data = CreateCleanData(Length(width, height));
+
+       BW->bitmap.storage = CreateBitmapImage(BW,
+                                              storage_data,
+                                              width, height);
+
+       CopyImageData(BW->bitmap.image, BW->bitmap.storage,
+                     BW->bitmap.mark.from_x,  BW->bitmap.mark.from_y,
+                     BW->bitmap.mark.to_x,  BW->bitmap.mark.to_y,
+                     0, 0);
+    }
+}
+
+void 
+BWClearMarked(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    if (QuerySet(BW->bitmap.mark.from_x, BW->bitmap.mark.from_y))
+       BWDrawFilledRectangle(w,
+                             BW->bitmap.mark.from_x,
+                             BW->bitmap.mark.from_y,
+                             BW->bitmap.mark.to_x,
+                             BW->bitmap.mark.to_y,
+                             Clear);
+}
+
+
+void 
+BWDragMarked(Widget w, Position at_x, Position at_y)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    if (QuerySet(BW->bitmap.mark.from_x, BW->bitmap.mark.from_y))
+       BWDrawRectangle(w, 
+                       at_x, at_y, 
+                       at_x + BW->bitmap.mark.to_x - BW->bitmap.mark.from_x,
+                       at_y + BW->bitmap.mark.to_y - BW->bitmap.mark.from_y,
+                       Highlight);
+}
+
+void 
+BWDragStored(Widget w, Position at_x, Position at_y)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    if (BW->bitmap.storage)
+       BWDrawRectangle(w, 
+                       at_x, at_y,
+                       at_x + BW->bitmap.storage->width - 1,
+                       at_y + BW->bitmap.storage->height - 1,
+                       Highlight);
+}
+
+static void 
+DrawImageData(BitmapWidget BW, XImage *image, 
+             Position at_x, Position at_y, int value)
+{
+    Position x, y;
+    Boolean  C, S, I, H;
+    bit      A, B;
+
+    C = value == Clear;
+    S = value == Set;
+    I = value == Invert;
+    H = value == Highlight;
+
+    for (x = 0; x < image->width; x++) 
+       for (y = 0; y < image->height; y++) {
+           A = GetBit(image, x, y);
+           B = GetBit(BW->bitmap.image, at_x + x, at_y + y);
+           if ((A & C) | ((A | B) & S) | ((A ^ B) & I) | ((A | B) & H))
+               value = (A & H) ? Highlight : Set;
+           else
+               value = Clear;
+           BWDrawPoint((Widget) BW, 
+                        at_x + x, at_y + y, 
+                        value);
+       }
+}
+
+void 
+BWRestore(Widget w, Position at_x, Position at_y, int value)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    if (BW->bitmap.storage) {
+      DrawImageData(BW, BW->bitmap.storage, at_x, at_y, value);
+      /*DestroyBitmapImage(&BW->bitmap.storage);*/
+    }
+}
+
+void 
+BWCopy(Widget w, Position at_x, Position at_y, int value)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    XImage *storage;
+    char *storage_data;
+    Dimension width, height;
+
+    if (QuerySet(BW->bitmap.mark.from_x, BW->bitmap.mark.from_y)) {
+
+       width = BW->bitmap.mark.to_x - BW->bitmap.mark.from_x + 1;
+       height = BW->bitmap.mark.to_y - BW->bitmap.mark.from_y + 1;
+       
+       storage_data = CreateCleanData(Length(width, height));
+
+       storage = CreateBitmapImage(BW, storage_data, width, height);
+
+       CopyImageData(BW->bitmap.image, storage,
+                     BW->bitmap.mark.from_x,  BW->bitmap.mark.from_y,
+                     BW->bitmap.mark.to_x,  BW->bitmap.mark.to_y,
+                     0, 0);
+
+       DrawImageData(BW, storage, at_x, at_y, value);
+
+       DestroyBitmapImage(&storage);
+    }
+}
+
+/* void BWMark(); */
+
+void 
+BWMove(Widget w, Position at_x, Position at_y, int value)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    XImage *storage;
+    char *storage_data;
+    Dimension width, height;
+
+    if (QuerySet(BW->bitmap.mark.from_x, BW->bitmap.mark.from_y)) {
+
+       width = BW->bitmap.mark.to_x - BW->bitmap.mark.from_x + 1;
+       height = BW->bitmap.mark.to_y - BW->bitmap.mark.from_y + 1;
+       
+       storage_data = CreateCleanData(Length(width, height));
+
+       storage = CreateBitmapImage(BW, storage_data, width, height);
+
+       CopyImageData(BW->bitmap.image, storage,
+                     BW->bitmap.mark.from_x,  BW->bitmap.mark.from_y,
+                     BW->bitmap.mark.to_x,  BW->bitmap.mark.to_y,
+                     0, 0);
+
+       BWDrawFilledRectangle(w,
+                             BW->bitmap.mark.from_x, BW->bitmap.mark.from_y,
+                             BW->bitmap.mark.to_x, BW->bitmap.mark.to_y,
+                             Clear);
+
+       DrawImageData(BW, storage, at_x, at_y, value);
+
+       BWMark(w, at_x, at_y,
+            at_x + BW->bitmap.mark.to_x - BW->bitmap.mark.from_x,
+            at_y + BW->bitmap.mark.to_y - BW->bitmap.mark.from_y);
+
+       DestroyBitmapImage(&storage);
+    }
+}
+
+void 
+BWRedrawMark(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    if (QuerySet(BW->bitmap.mark.from_x, BW->bitmap.mark.from_y)) 
+       XFillRectangle(XtDisplay(BW), XtWindow(BW), BW->bitmap.highlighting_gc,
+                      InWindowX(BW, BW->bitmap.mark.from_x), 
+                      InWindowY(BW, BW->bitmap.mark.from_y), 
+                      InWindowX(BW, BW->bitmap.mark.to_x + 1) - 
+                      InWindowX(BW, BW->bitmap.mark.from_x),
+                      InWindowY(BW, BW->bitmap.mark.to_y + 1) -
+                      InWindowY(BW, BW->bitmap.mark.from_y));
+}
+
+void 
+BWStoreToBuffer(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    memmove( BW->bitmap.buffer->data, BW->bitmap.image->data, 
+         Length(BW->bitmap.image->width, BW->bitmap.image->height));
+
+    BW->bitmap.buffer_hot = BW->bitmap.hot;
+    BW->bitmap.buffer_mark = BW->bitmap.mark;
+}
+
+void 
+BWUnmark(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    BW->bitmap.buffer_mark = BW->bitmap.mark;
+
+    if (QuerySet(BW->bitmap.mark.from_x, BW->bitmap.mark.from_y)) {
+       XFillRectangle(XtDisplay(BW), XtWindow(BW), BW->bitmap.highlighting_gc,
+                      InWindowX(BW, BW->bitmap.mark.from_x), 
+                      InWindowY(BW, BW->bitmap.mark.from_y), 
+                      InWindowX(BW, BW->bitmap.mark.to_x + 1) - 
+                      InWindowX(BW, BW->bitmap.mark.from_x),
+                      InWindowY(BW, BW->bitmap.mark.to_y + 1) -
+                      InWindowY(BW, BW->bitmap.mark.from_y));
+    
+       BW->bitmap.mark.from_x = BW->bitmap.mark.from_y = NotSet;
+       BW->bitmap.mark.to_x = BW->bitmap.mark.to_y = NotSet;
+    }
+}
+
+void 
+BWMark(Widget w, Position from_x, Position from_y, 
+       Position to_x, Position to_y)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    BWUnmark(w);
+    
+    if (QuerySet(from_x, from_y)) {
+       if ((from_x == to_x) && (from_y == to_y)) {
+           /*
+             BW->bitmap.mark.from_x = 0;
+             BW->bitmap.mark.from_y = 0;
+             BW->bitmap.mark.to_x = BW->bitmap.image->width - 1;
+             BW->bitmap.mark.to_y = BW->bitmap.image->height - 1;
+             */
+           return;
+       }
+       else {
+           QuerySwap(from_x, to_x);
+           QuerySwap(from_y, to_y);
+           from_x = max(0, from_x);
+           from_y = max(0, from_y);
+           to_x = min(BW->bitmap.image->width - 1, to_x);
+           to_y = min(BW->bitmap.image->height - 1, to_y);
+           
+           BW->bitmap.mark.from_x = from_x;
+           BW->bitmap.mark.from_y = from_y;
+           BW->bitmap.mark.to_x = to_x;
+           BW->bitmap.mark.to_y = to_y;
+       }
+       
+       XFillRectangle(XtDisplay(BW), XtWindow(BW), BW->bitmap.highlighting_gc,
+                      InWindowX(BW, BW->bitmap.mark.from_x),
+                      InWindowY(BW, BW->bitmap.mark.from_y), 
+                      InWindowX(BW, BW->bitmap.mark.to_x + 1) -
+                      InWindowX(BW, BW->bitmap.mark.from_x),
+                      InWindowY(BW, BW->bitmap.mark.to_y +1) - 
+                      InWindowY(BW, BW->bitmap.mark.from_y));
+    }
+}
+
+void 
+BWMarkAll(Widget w)
+{
+  BitmapWidget BW = (BitmapWidget) w;
+
+  BWMark(w, 0, 0, BW->bitmap.image->width - 1, BW->bitmap.image->height - 1);
+}
+
+void 
+BWUndo(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    Position x, y;
+    char *tmp_data;
+    XPoint tmp_hot;
+    BWArea tmp_mark;
+    
+    tmp_data = BW->bitmap.image->data;
+    BW->bitmap.image->data = BW->bitmap.buffer->data;
+    BW->bitmap.buffer->data = tmp_data;
+
+    tmp_hot = BW->bitmap.hot;
+    tmp_mark = BW->bitmap.mark;
+    
+    for (x = 0; x < BW->bitmap.image->width; x++)
+       for (y = 0; y < BW->bitmap.image->height; y++)
+        if (GetBit(BW->bitmap.image, x, y) != GetBit(BW->bitmap.buffer, x, y))
+            DrawSquare(BW, x, y);
+
+    BWSetHotSpot(w, BW->bitmap.buffer_hot.x, BW->bitmap.buffer_hot.y);
+/*    
+    BWMark(w, BW->bitmap.buffer_mark.from_x, BW->bitmap.buffer_mark.from_y,
+          BW->bitmap.buffer_mark.to_x, BW->bitmap.buffer_mark.to_y);
+*/
+    BW->bitmap.buffer_hot = tmp_hot;
+    BW->bitmap.buffer_mark= tmp_mark;
+
+}
+
+void 
+BWHighlightAxes(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+
+    XDrawLine(XtDisplay(BW), XtWindow(BW),
+             BW->bitmap.axes_gc,
+             InWindowX(BW, 0), 
+             InWindowY(BW, 0),
+             InWindowX(BW, BW->bitmap.width),
+             InWindowY(BW, BW->bitmap.height));
+    XDrawLine(XtDisplay(BW), XtWindow(BW),
+             BW->bitmap.axes_gc,
+             InWindowX(BW, BW->bitmap.width),
+             InWindowY(BW, 0), 
+             InWindowX(BW, 0),
+             InWindowY(BW, BW->bitmap.height));
+    XDrawLine(XtDisplay(BW), XtWindow(BW),
+             BW->bitmap.axes_gc,
+             InWindowX(BW, 0),
+             InWindowY(BW, (float)BW->bitmap.height / 2.0),
+             InWindowX(BW, BW->bitmap.width),
+             InWindowY(BW, (float)BW->bitmap.height / 2.0));
+    XDrawLine(XtDisplay(BW), XtWindow(BW),
+             BW->bitmap.axes_gc,
+             InWindowX(BW, (float)BW->bitmap.width / 2.0),
+             InWindowY(BW, 0),
+             InWindowX(BW, (float)BW->bitmap.width / 2.0),
+             InWindowY(BW, BW->bitmap.height));
+}
+    
+typedef struct {
+    Position *x, *y;
+    Dimension *width, *height;
+} Table;
+
+XImage *
+ScaleBitmapImage(BitmapWidget BW, XImage *src, 
+                double scale_x, double scale_y)
+{
+    char *data;
+    XImage *dst;
+    Table table;    
+    Position x, y, w, h;
+    Dimension width, height;
+    bit pixel;
+
+    width = max(rint(scale_x * src->width), 1);
+    height = max(rint(scale_y * src->height), 1);
+
+    data = CreateCleanData(Length(width, height));
+    dst = CreateBitmapImage(BW, data, width, height);
+
+    /*
+     * It would be nice to check if width or height < 1.0 and
+     * average the skipped pixels. But, it is slow as it is now.
+     */
+    if (scale_x == 1.0 && scale_y == 1.0)
+       memmove( dst->data, src->data, Length(width, height));
+    else {
+       table.x = (Position *) XtMalloc(sizeof(Position) * src->width);
+       table.y = (Position *) XtMalloc(sizeof(Position) * src->height);
+       table.width = (Dimension *) XtMalloc(sizeof(Dimension) * src->width);
+       table.height = (Dimension *) XtMalloc(sizeof(Dimension) * src->height);
+       
+       for (x = 0; x < src->width; x++) {
+           table.x[x] = rint(scale_x * x);
+           table.width[x] = rint(scale_x * (x + 1)) - rint(scale_x * x);
+       }
+       for (y = 0; y < src->height; y++) {
+           table.y[y] = rint(scale_y * y);
+           table.height[y] = rint(scale_y * (y + 1)) - rint(scale_y * y);
+       }
+       
+       for (x = 0; x < src->width; x++)
+           for (y = 0; y < src->height; y++) {
+               pixel = GetBit(src, x, y);
+               for (w = 0; (int)w < (int)table.width[x]; w++)
+                   for (h = 0; (int)h < (int)table.height[y]; h++)
+                       if (pixel) SetBit(dst, 
+                                       table.x[x] + w, 
+                                       table.y[y] + h);
+           }
+
+       XtFree((char *)table.x);
+       XtFree((char *)table.y);
+       XtFree((char *)table.width);
+       XtFree((char *)table.height);
+    }
+    
+    return (dst);
+}
+
+/*****************************************************************************/
diff --git a/bitmap/Handlers.c b/bitmap/Handlers.c
new file mode 100644 (file)
index 0000000..9137e0f
--- /dev/null
@@ -0,0 +1,675 @@
+/*
+
+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.
+
+*/
+
+/*
+ * Author:  Davor Matic, MIT X Consortium
+ */
+
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include "BitmapP.h"
+    
+#include <stdio.h>
+#include <math.h>
+
+#define min(x, y)                     (((int)(x) < (int)(y)) ? (x) : (y))
+#define max(x, y)                     (((int)(x) > (int)(y)) ? (x) : (y))
+
+#include "Requests.h"
+
+
+/*****************************************************************************
+ *                                  Handlers                                 *
+ *****************************************************************************/
+
+#define QueryInSquare(BW, x, y, square_x, square_y)\
+    ((InBitmapX(BW, x) == (square_x)) &&\
+     (InBitmapY(BW, y) == (square_y)))
+
+
+static void 
+DragOnePointHandler(Widget w, 
+                   XtPointer client_data, 
+                   XEvent *event, 
+                   Boolean *cont) /* ARGSUSED */
+{
+    BWStatus *status = (BWStatus *)client_data;
+    BitmapWidget BW = (BitmapWidget) w;
+
+    if (DEBUG)
+       fprintf(stderr, "D1PH ");
+
+    switch (event->type) {
+    
+    case ButtonPress:
+       if (event->xbutton.state != status->state) return;
+       if (!QuerySet(status->at_x, status->at_y)) {
+           BWStoreToBuffer(w);
+           status->value = Value(BW, event->xbutton.button);
+           status->btime = event->xbutton.time;
+           status->at_x = InBitmapX(BW, event->xbutton.x);
+           status->at_y = InBitmapY(BW, event->xbutton.y);
+           status->success = status->draw ? True : False;
+           if (status->draw)
+               (*(DrawOnePointProc)status->draw)(w,
+                               status->at_x, status->at_y, status->value);
+       }
+       break;
+       
+    case ButtonRelease:
+       if (QuerySet(status->at_x, status->at_y)) {
+           status->value = Value(BW, event->xbutton.button);
+           status->btime = event->xbutton.time;
+           status->at_x = InBitmapX(BW, event->xbutton.x);
+           status->at_y = InBitmapY(BW, event->xbutton.y);
+           status->success = status->draw ? True : False;
+           /* SUPPRESS 701 */
+           BWTerminateRequest(w, TRUE); 
+       }
+       break;
+
+    case MotionNotify:
+       if (QuerySet(status->at_x, status->at_y)) {
+           if (!QueryInSquare(BW, event->xmotion.x, event->xmotion.y,
+                              status->at_x, status->at_y)) {
+               status->at_x = InBitmapX(BW, event->xmotion.x);
+               status->at_y = InBitmapY(BW, event->xmotion.y);
+               if (status->draw)
+                   (*(DrawOnePointProc)status->draw)(w,
+                                   status->at_x, status->at_y, status->value);
+           }
+       }
+       break;
+
+    }
+}
+
+void 
+DragOnePointEngage(Widget w, 
+                  BWStatus *status, 
+                  XtPointer draw, 
+                  int *state)
+{
+    
+    status->at_x = NotSet;
+    status->at_y = NotSet;
+    status->draw = draw;
+    status->success = False;
+    status->state = *state;
+    
+    XtAddEventHandler(w,
+                     ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
+                     FALSE, DragOnePointHandler, (XtPointer)status);
+}
+
+/* ARGSUSED */
+void 
+DragOnePointTerminate(Widget w, 
+                     BWStatus *status, 
+                     XtPointer draw)
+{
+    
+    if (status->success) {
+       BWChangeNotify(w);
+       BWSetChanged(w);
+    }
+    
+    XtRemoveEventHandler(w,
+                ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
+                FALSE, DragOnePointHandler, (XtPointer)status);
+    
+}
+
+void 
+OnePointHandler(Widget w, 
+               XtPointer client_data, 
+               XEvent *event, 
+               Boolean *cont) /* ARGSUSED */
+{
+    BWStatus    *status = (BWStatus *)client_data;
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    if (DEBUG)
+       fprintf(stderr, "1PH ");
+
+    switch (event->type) {
+       
+    case Expose:
+       if (QuerySet(status->at_x, status->at_y)) {
+           BWClip(w, event->xexpose.x, event->xexpose.y,
+                  event->xexpose.width, event->xexpose.height);
+           if (status->draw)
+               (*(DrawOnePointProc)status->draw)(w,
+                               status->at_x, status->at_y, Highlight);
+           
+           BWUnclip(w);
+       }
+       break;
+       
+    case ButtonPress:
+       if (event->xbutton.state != status->state) return;
+       if (!QuerySet(status->at_x, status->at_y)) {
+           status->value = Value(BW, event->xbutton.button);
+           status->btime = event->xbutton.time;
+           status->at_x = InBitmapX(BW, event->xbutton.x);
+           status->at_y = InBitmapY(BW, event->xbutton.y);
+           if (status->draw)
+               (*(DrawOnePointProc)status->draw)(w,
+                               status->at_x, status->at_y, Highlight);
+       }
+       break;
+       
+    case ButtonRelease:
+       if (QuerySet(status->at_x, status->at_y)) {
+           if (status->draw)
+               (*(DrawOnePointProc)status->draw)(w,
+                               status->at_x, status->at_y, Highlight);
+           
+           status->value = Value(BW, event->xbutton.button);
+           status->btime = event->xbutton.time;
+           status->at_x = InBitmapX(BW, event->xbutton.x);
+           status->at_y = InBitmapY(BW, event->xbutton.y);
+           status->success = True;
+           
+           BWTerminateRequest(w, TRUE);
+       }
+       break;
+       
+    case MotionNotify:
+       if (QuerySet(status->at_x, status->at_y)) {
+           if (!QueryInSquare(BW, event->xmotion.x, event->xmotion.y,
+                              status->at_x, status->at_y)) {
+               if (status->draw)
+                   (*(DrawOnePointProc)status->draw)(w,
+                                   status->at_x, status->at_y, Highlight);
+               status->at_x = InBitmapX(BW, event->xmotion.x);
+               status->at_y = InBitmapY(BW, event->xmotion.y);
+               if (status->draw)
+                   (*(DrawOnePointProc)status->draw)(w,
+                                   status->at_x, status->at_y, Highlight);
+           }
+       }      
+       break;
+    }
+}
+
+void 
+OnePointEngage(Widget w, 
+              BWStatus *status, 
+              XtPointer draw, 
+              int *state)
+{
+    status->at_x = NotSet;
+    status->at_y = NotSet;
+    status->draw = draw;
+    status->success = False;
+    status->state = *state;
+
+    XtAddEventHandler(w,
+                     ButtonPressMask | ButtonReleaseMask | 
+                     ExposureMask | PointerMotionMask,
+                     FALSE, OnePointHandler, (XtPointer)status);
+}
+
+#if 0
+void 
+OnePointImmediateEngage(Widget w, 
+                       BWStatus *status, 
+                       XtPointer draw, 
+                       int *state)
+{
+    status->at_x = 0;
+    status->at_y = 0;
+    status->draw = draw;
+    status->success = False;
+    status->state = *state;
+    
+    if (status->draw)
+       (*(DrawOnePointProc)status->draw)(w,
+                       status->at_x, status->at_y, Highlight);
+    
+    XtAddEventHandler(w,
+                     ButtonPressMask | ButtonReleaseMask | 
+                     ExposureMask | PointerMotionMask,
+                     FALSE, OnePointHandler, (XtPointer)status);
+}
+#endif
+
+void 
+OnePointTerminate(Widget w, 
+                 BWStatus *status, 
+                 XtPointer draw)
+{
+    
+    if (status->success && draw) {
+       BWStoreToBuffer(w);
+       (*(DrawOnePointProc)draw)(w,
+               status->at_x, status->at_y,
+               status->value);
+       BWChangeNotify(w);
+       BWSetChanged(w);
+    }    
+    else
+       if (QuerySet(status->at_x, status->at_y))
+           if (status->draw)
+               (*(DrawOnePointProc)status->draw)(w,
+                               status->at_x, status->at_y, Highlight);
+    
+    XtRemoveEventHandler(w,
+                        ButtonPressMask | ButtonReleaseMask | 
+                        ExposureMask | PointerMotionMask,
+                        FALSE, OnePointHandler, (XtPointer)status);
+}
+
+void 
+OnePointTerminateTransparent(Widget w, 
+                            BWStatus *status, 
+                            XtPointer draw)
+{
+    
+    if (status->success && draw)
+       (*(DrawOnePointProc)draw)(w,
+               status->at_x, status->at_y,
+               status->value);
+    else
+       if (QuerySet(status->at_x, status->at_y))
+           if (status->draw)
+               (*(DrawOnePointProc)status->draw)(w,
+                               status->at_x, status->at_y, Highlight);
+    
+    XtRemoveEventHandler(w,
+                        ButtonPressMask | ButtonReleaseMask | 
+                        ExposureMask | PointerMotionMask,
+                        FALSE, OnePointHandler, (XtPointer)status);
+    
+}
+
+
+void 
+TwoPointsHandler(Widget w, 
+                XtPointer client_data, 
+                XEvent *event, 
+                Boolean *cont) /* ARGSUSED */
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    BWStatus   *status = (BWStatus *)client_data;
+    if (DEBUG)
+       fprintf(stderr, "2PH ");
+    
+    switch (event->type) {
+       
+    case Expose:
+       if (QuerySet(status->from_x, status->from_y) && 
+           QuerySet(status->to_x, status->to_y)) {
+           BWClip(w, event->xexpose.x, event->xexpose.y,
+                  event->xexpose.width, event->xexpose.height);
+           if (status->draw)
+               (*(DrawTwoPointProc)status->draw)(w,
+                               status->from_x, status->from_y, 
+                               status->to_x, status->to_y, Highlight);
+           BWUnclip(w);
+       }
+       break;
+       
+    case ButtonPress:
+       if (event->xbutton.state != status->state) return;
+       if (!QuerySet(status->from_x, status->from_y)) {
+           status->value = Value(BW, event->xbutton.button);
+           status->btime = event->xbutton.time;
+           status->from_x = InBitmapX(BW, event->xbutton.x);
+           status->from_y = InBitmapY(BW, event->xbutton.y);
+           status->to_x = InBitmapX(BW, event->xbutton.x);
+           status->to_y = InBitmapY(BW, event->xbutton.y);
+           if (status->draw)
+               (*(DrawTwoPointProc)status->draw)(w,
+                               status->from_x, status->from_y, 
+                               status->to_x, status->to_y, Highlight);
+       }
+       break;
+       
+    case ButtonRelease:
+       if (QuerySet(status->from_x, status->from_y)) {
+           if (status->draw)
+               (*(DrawTwoPointProc)status->draw)(w,
+                               status->from_x, status->from_y, 
+                               status->to_x, status->to_y, Highlight);
+           status->value = Value(BW, event->xbutton.button);
+           status->btime = event->xbutton.time;            
+           status->to_x = InBitmapX(BW, event->xbutton.x);
+           status->to_y = InBitmapY(BW, event->xbutton.y);
+           status->success = True;
+           
+           BWTerminateRequest(w, TRUE);
+       }
+       break;
+       
+    case MotionNotify:
+       if (QuerySet(status->from_x, status->from_y)) {
+           if (QuerySet(status->to_x, status->to_y)) {
+               if (!QueryInSquare(BW, event->xmotion.x, event->xmotion.y,
+                                  status->to_x, status->to_y)) {
+                   if (status->draw)
+                       (*(DrawTwoPointProc)status->draw)(w,
+                                       status->from_x, status->from_y, 
+                                       status->to_x, status->to_y, Highlight);
+                   status->to_x = InBitmapX(BW, event->xmotion.x);
+                   status->to_y = InBitmapY(BW, event->xmotion.y);
+                   if (status->draw)
+                       (*(DrawTwoPointProc)status->draw)(w,
+                                       status->from_x, status->from_y, 
+                                       status->to_x, status->to_y, Highlight);
+               }
+           }
+           else {
+               status->to_x = InBitmapX(BW, event->xmotion.x);
+               status->to_y = InBitmapY(BW, event->xmotion.y);
+               if (status->draw)
+                   (*(DrawTwoPointProc)status->draw)(w,
+                                   status->from_x, status->from_y, 
+                                   status->to_x, status->to_y, Highlight);
+           }
+       }
+       break;
+    }
+}
+
+void 
+TwoPointsEngage(Widget w, 
+               BWStatus *status, 
+               XtPointer draw, 
+               int *state)
+{
+    
+    status->from_x = NotSet;
+    status->from_y = NotSet;
+    status->to_x = NotSet;
+    status->to_y = NotSet;
+    status->draw = draw;
+    status->success = False;
+    status->state = *state;
+
+    XtAddEventHandler(w,
+                     ButtonPressMask | ButtonReleaseMask | 
+                     ExposureMask | PointerMotionMask,
+                     FALSE, TwoPointsHandler, (XtPointer)status);
+}
+
+void 
+TwoPointsTerminate(Widget w, 
+                  BWStatus *status, 
+                  XtPointer draw)
+{
+    
+    if (status->success && draw) {
+       BWStoreToBuffer(w);
+       (*(DrawTwoPointProc)draw)(w,
+               status->from_x, status->from_y,
+               status->to_x, status->to_y,
+               status->value);
+       BWChangeNotify(w);
+       BWSetChanged(w);
+    }
+    else
+       if (QuerySet(status->from_x, status->from_y) && 
+           QuerySet(status->to_x, status->to_y))
+           if (status->draw)
+               (*(DrawTwoPointProc)status->draw)(w,
+                               status->from_x, status->from_y, 
+                               status->to_x, status->to_y, Highlight);
+    
+    XtRemoveEventHandler(w,
+                        ButtonPressMask | ButtonReleaseMask | 
+                        ExposureMask | PointerMotionMask,
+                        FALSE, TwoPointsHandler, (XtPointer)status);
+}
+
+void 
+TwoPointsTerminateTransparent(Widget w, 
+                             BWStatus *status, 
+                             XtPointer draw)
+{
+    
+    if (status->success && draw)
+       (*(DrawTwoPointProc)draw)(w,
+               status->from_x, status->from_y,
+               status->to_x, status->to_y,
+               status->value);
+    else
+       if (QuerySet(status->from_x, status->from_y) && 
+           QuerySet(status->to_x, status->to_y))
+           if (status->draw)
+               (*(DrawTwoPointProc)status->draw)(w,
+                               status->from_x, status->from_y, 
+                               status->to_x, status->to_y, Highlight);
+    
+    XtRemoveEventHandler(w,
+                        ButtonPressMask | ButtonReleaseMask | 
+                        ExposureMask | PointerMotionMask,
+                        FALSE, TwoPointsHandler, (XtPointer)status);
+}
+
+void 
+TwoPointsTerminateTimed(Widget w, 
+                       BWStatus *status, 
+                       XtPointer draw)
+{
+    
+    if (status->success && draw)
+       (*(DrawTwoPointProc)draw)(w,
+               status->from_x, status->from_y,
+               status->to_x, status->to_y,
+               status->btime);
+    else
+       if (QuerySet(status->from_x, status->from_y) && 
+           QuerySet(status->to_x, status->to_y))
+           if (status->draw)
+               (*(DrawTwoPointProc)status->draw)(w,
+                               status->from_x, status->from_y, 
+                               status->to_x, status->to_y, Highlight);
+    
+    XtRemoveEventHandler(w,
+                        ButtonPressMask | ButtonReleaseMask | 
+                        ExposureMask | PointerMotionMask,
+                        FALSE, TwoPointsHandler, (XtPointer)status);
+}
+
+/* ARGSUSED */
+void 
+Interface(Widget w, 
+         BWStatus *status, 
+         XtPointer action)
+{
+    (*(InterfaceProc)action)(w);
+}
+
+void 
+Paste(Widget w, 
+      Position at_x, 
+      Position at_y, 
+      int value)
+{
+    BitmapWidget    BW = (BitmapWidget) w;
+    BWStatus       *my_status;
+    BWRequest       request;
+
+    my_status = (BWStatus *) 
+       BW->bitmap.request_stack[BW->bitmap.current].status;
+
+    my_status->draw = NULL;
+
+   request = (BWRequest)
+   BW->bitmap.request_stack[BW->bitmap.current].request->terminate_client_data;
+       
+    BWTerminateRequest(w, FALSE);
+    
+    if ((at_x == max(BW->bitmap.mark.from_x, min(at_x, BW->bitmap.mark.to_x)))
+       &&
+      (at_y == max(BW->bitmap.mark.from_y, min(at_y, BW->bitmap.mark.to_y)))) {
+       
+       BWStatus *status;
+       
+       if (DEBUG)
+           fprintf(stderr, "Prepaste request: %s\n", request);
+       
+       BWEngageRequest(w, request, False, (char *)&(my_status->state), sizeof(int));
+       
+       status = (BWStatus *) 
+           BW->bitmap.request_stack[BW->bitmap.current].status;
+       
+       status->at_x = at_x;
+       status->at_y = at_y;
+       status->value = value;
+       (*(DrawOnePointProc)status->draw) (w, at_x, at_y, Highlight);   
+    }
+    else {
+
+       BWStatus *status;
+       
+      BWEngageRequest(w, MarkRequest, False, (char *)&(my_status->state), sizeof(int));
+       
+       status = (BWStatus *) 
+           BW->bitmap.request_stack[BW->bitmap.current].status;
+       
+       status->from_x = status->to_x = at_x;
+       status->from_y = status->to_y = at_y;
+       status->value = value;
+       (*(DrawTwoPointProc)status->draw) (w, at_x, at_y, at_x, at_y, Highlight);
+    }
+}
+
+
+void 
+DragTwoPointsHandler(Widget w, 
+                    XtPointer client_data, 
+                    XEvent *event, 
+                    Boolean *cont) /* ARGSUSED */
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    BWStatus   *status = (BWStatus *)client_data;
+
+    if (DEBUG)
+       fprintf(stderr, "D2PH ");
+
+    switch (event->type) {
+       
+    case ButtonPress:
+       if (event->xbutton.state != status->state) return;
+       if (!QuerySet(status->from_x, status->from_y)) {
+           BWStoreToBuffer(w);
+           status->value = Value(BW, event->xbutton.button);
+           status->btime = event->xbutton.time;
+           status->from_x = InBitmapX(BW, event->xbutton.x);
+           status->from_y = InBitmapY(BW, event->xbutton.y);
+           status->to_x = InBitmapX(BW, event->xbutton.x);
+           status->to_y = InBitmapY(BW, event->xbutton.y);
+           status->success = status->draw ? True : False;
+           if (status->draw)
+               (*(DrawTwoPointProc)status->draw)(w,
+                               status->from_x, status->from_y, 
+                               status->to_x, status->to_y, status->value);
+       }
+       break;
+       
+    case ButtonRelease:
+       if (QuerySet(status->from_x, status->from_y)) {
+           status->value = Value(BW, event->xbutton.button);
+           status->btime = event->xbutton.time;            
+           status->from_x = status->to_x;
+           status->from_y = status->to_y;
+           status->to_x = InBitmapX(BW, event->xbutton.x);
+           status->to_y = InBitmapY(BW, event->xbutton.y);
+           status->success = True;
+           
+           BWTerminateRequest(w, TRUE);
+       }
+       break;
+       
+    case MotionNotify:
+       if (QuerySet(status->from_x, status->from_y)) {
+           if (QuerySet(status->to_x, status->to_y)) {
+               if (!QueryInSquare(BW, event->xmotion.x, event->xmotion.y,
+                                  status->to_x, status->to_y)) {
+                   status->from_x = status->to_x;
+                   status->from_y = status->to_y;
+                   status->to_x = InBitmapX(BW, event->xmotion.x);
+                   status->to_y = InBitmapY(BW, event->xmotion.y);
+                   if (status->draw)
+                       (*(DrawTwoPointProc)status->draw)(w,
+                                       status->from_x, status->from_y, 
+                                       status->to_x, status->to_y, status->value);
+               }
+           }
+       }
+       break;
+    }
+}
+
+void 
+DragTwoPointsEngage(Widget w, 
+                   BWStatus *status, 
+                   XtPointer draw, 
+                   int *state)
+{
+    
+    status->from_x = NotSet;
+    status->from_y = NotSet;
+    status->to_x = NotSet;
+    status->to_y = NotSet;
+    status->draw = draw;
+    status->success = False;
+    status->state = *state;
+
+    XtAddEventHandler(w,
+                     ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
+                     FALSE, DragTwoPointsHandler, (XtPointer)status);
+}
+
+void 
+DragTwoPointsTerminate(Widget w, 
+                      BWStatus *status, 
+                      XtPointer draw)
+{
+    
+    if (status->success && draw) {
+       if ((status->from_x != status->to_x) 
+           || 
+           (status->from_y != status->to_y))
+           (*(DrawTwoPointProc)draw)(w,
+                   status->from_x, status->from_y,
+                   status->to_x, status->to_y,
+                   status->value);
+       BWChangeNotify(w);
+       BWSetChanged(w);
+    }
+    
+    XtRemoveEventHandler(w,
+                        ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
+                        FALSE, DragTwoPointsHandler, (XtPointer)status);
+}
+
+/*****************************************************************************/
diff --git a/bitmap/INSTALL b/bitmap/INSTALL
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/bitmap/Left b/bitmap/Left
new file mode 100644 (file)
index 0000000..5c7f141
--- /dev/null
@@ -0,0 +1,13 @@
+#define Left_width 30
+#define Left_height 30
+static char Left_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00,
+   0x00, 0x37, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00, 0xc0, 0x1d, 0x00, 0x00,
+   0xe0, 0x0e, 0x00, 0x00, 0x70, 0x07, 0x00, 0x00, 0xb8, 0xff, 0xff, 0x1f,
+   0x5c, 0xff, 0xff, 0x0f, 0xae, 0xaa, 0xaa, 0x06, 0x57, 0x55, 0x55, 0x03,
+   0xae, 0xaa, 0xaa, 0x06, 0x5c, 0xff, 0xff, 0x0f, 0xb8, 0xff, 0xff, 0x1f,
+   0x70, 0x07, 0x00, 0x00, 0xe0, 0x0e, 0x00, 0x00, 0xc0, 0x1d, 0x00, 0x00,
+   0x80, 0x3b, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00,
+   0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmap/Makefile.am b/bitmap/Makefile.am
new file mode 100644 (file)
index 0000000..13a392b
--- /dev/null
@@ -0,0 +1,145 @@
+# 
+#  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 = bitmap bmtoa atobm
+
+# bitmap
+
+bitmap_CFLAGS = $(CWARNFLAGS) $(BITMAP_CFLAGS)
+bitmap_LDADD = $(BITMAP_LIBS) -lm
+
+bitmap_SOURCES = \
+         BitEdit.c \
+         CutPaste.c \
+         Graphics.c \
+         ReqMach.c \
+         Bitmap.c \
+         Dialog.c \
+         Handlers.c \
+         Bitmap.h \
+         BitmapP.h \
+         Dialog.h \
+         Requests.h
+
+# bmtoa
+
+bmtoa_CFLAGS = $(CWARNFLAGS) $(BMTOA_CFLAGS)
+bmtoa_LDADD = $(BMTOA_LIBS)
+bmtoa_SOURCES = \
+         bmtoa.c
+
+# atobm
+
+atobm_CFLAGS = $(CWARNFLAGS) $(ATOBM_CFLAGS)
+atobm_LDADD = $(ATOBM_LDADD)
+atobm_SOURCES = \
+         atobm.c
+
+# mans
+
+appman_PRE = \
+             bitmap.man
+
+
+# App default files  (*.ad)
+
+DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
+
+appdefaultdir = @appdefaultdir@
+
+dist_appdefault_DATA = \
+       app-defaults/Bitmap-color \
+       app-defaults/Bitmap-nocase \
+       app-defaults/Bitmap
+
+
+EXTRA_DIST = bitmap.icon ChangeLog autogen.sh
+MAINTAINERCLEANFILES=ChangeLog
+
+.PHONY: ChangeLog
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog
+
+# bitmaps
+
+bitmapdir = $(includedir)/X11/bitmaps
+
+dist_bitmap_DATA =     \
+       Dashes          \
+       Down            \
+       Excl            \
+       FlipHoriz       \
+       FlipVert        \
+       Fold            \
+       Left            \
+       Right           \
+       RotateLeft      \
+       RotateRight     \
+       Stipple         \
+       Term            \
+       Up
+
+APP_MAN_DIR_SUFFIX = $(APP_MAN_DIR:@mandir@/man%=%)
+
+appmandir = $(APP_MAN_DIR)
+
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) \
+             $(man_shadows:=.@APP_MAN_SUFFIX@)
+
+BUILT_SOURCES = shadows.DONE
+
+EXTRA_DIST += $(appman_PRE)
+CLEANFILES = $(appman_DATA) $(BUILT_SOURCES)
+
+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) < $< > $@
+
+man_shadows = atobm bmtoa
+
+shadows.DONE:
+       -rm -f $(man_shadows:=.@APP_MAN_SUFFIX@)
+       (for i in $(man_shadows:=.@APP_MAN_SUFFIX@) ; do \
+        echo .so man$(APP_MAN_DIR_SUFFIX)/bitmap.$(APP_MAN_SUFFIX) > $$i; \
+        done)
diff --git a/bitmap/Makefile.in b/bitmap/Makefile.in
new file mode 100644 (file)
index 0000000..1742b0f
--- /dev/null
@@ -0,0 +1,1067 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = bitmap$(EXEEXT) bmtoa$(EXEEXT) atobm$(EXEEXT)
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(dist_appdefault_DATA) \
+       $(dist_bitmap_DATA) $(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
+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 config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" \
+       "$(DESTDIR)$(appdefaultdir)" "$(DESTDIR)$(bitmapdir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_atobm_OBJECTS = atobm-atobm.$(OBJEXT)
+atobm_OBJECTS = $(am_atobm_OBJECTS)
+atobm_DEPENDENCIES =
+atobm_LINK = $(CCLD) $(atobm_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
+am_bitmap_OBJECTS = bitmap-BitEdit.$(OBJEXT) bitmap-CutPaste.$(OBJEXT) \
+       bitmap-Graphics.$(OBJEXT) bitmap-ReqMach.$(OBJEXT) \
+       bitmap-Bitmap.$(OBJEXT) bitmap-Dialog.$(OBJEXT) \
+       bitmap-Handlers.$(OBJEXT)
+bitmap_OBJECTS = $(am_bitmap_OBJECTS)
+am__DEPENDENCIES_1 =
+bitmap_DEPENDENCIES = $(am__DEPENDENCIES_1)
+bitmap_LINK = $(CCLD) $(bitmap_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
+am_bmtoa_OBJECTS = bmtoa-bmtoa.$(OBJEXT)
+bmtoa_OBJECTS = $(am_bmtoa_OBJECTS)
+bmtoa_DEPENDENCIES = $(am__DEPENDENCIES_1)
+bmtoa_LINK = $(CCLD) $(bmtoa_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(atobm_SOURCES) $(bitmap_SOURCES) $(bmtoa_SOURCES)
+DIST_SOURCES = $(atobm_SOURCES) $(bitmap_SOURCES) $(bmtoa_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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+DATA = $(appman_DATA) $(dist_appdefault_DATA) $(dist_bitmap_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@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPDEFS_CFLAGS = @APPDEFS_CFLAGS@
+APPDEFS_LIBS = @APPDEFS_LIBS@
+APP_MAN_DIR = @APP_MAN_DIR@
+APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
+ATOBM_CFLAGS = @ATOBM_CFLAGS@
+ATOBM_LIBS = @ATOBM_LIBS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BITMAP_CFLAGS = @BITMAP_CFLAGS@
+BITMAP_LIBS = @BITMAP_LIBS@
+BMTOA_CFLAGS = @BMTOA_CFLAGS@
+BMTOA_LIBS = @BMTOA_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHANGELOG_CMD = @CHANGELOG_CMD@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
+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@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_CMD = @INSTALL_CMD@
+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@
+MAKEINFO = @MAKEINFO@
+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'
+
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+SED = sed
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XBITMAP_CFLAGS = @XBITMAP_CFLAGS@
+XBITMAP_LIBS = @XBITMAP_LIBS@
+XORG_MAN_PAGE = @XORG_MAN_PAGE@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+appdefaultdir = @appdefaultdir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# bitmap
+bitmap_CFLAGS = $(CWARNFLAGS) $(BITMAP_CFLAGS)
+bitmap_LDADD = $(BITMAP_LIBS) -lm
+bitmap_SOURCES = \
+         BitEdit.c \
+         CutPaste.c \
+         Graphics.c \
+         ReqMach.c \
+         Bitmap.c \
+         Dialog.c \
+         Handlers.c \
+         Bitmap.h \
+         BitmapP.h \
+         Dialog.h \
+         Requests.h
+
+
+# bmtoa
+bmtoa_CFLAGS = $(CWARNFLAGS) $(BMTOA_CFLAGS)
+bmtoa_LDADD = $(BMTOA_LIBS)
+bmtoa_SOURCES = \
+         bmtoa.c
+
+
+# atobm
+atobm_CFLAGS = $(CWARNFLAGS) $(ATOBM_CFLAGS)
+atobm_LDADD = $(ATOBM_LDADD)
+atobm_SOURCES = \
+         atobm.c
+
+
+# mans
+appman_PRE = \
+             bitmap.man
+
+
+# App default files  (*.ad)
+DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
+dist_appdefault_DATA = \
+       app-defaults/Bitmap-color \
+       app-defaults/Bitmap-nocase \
+       app-defaults/Bitmap
+
+EXTRA_DIST = bitmap.icon ChangeLog autogen.sh $(appman_PRE)
+MAINTAINERCLEANFILES = ChangeLog
+
+# bitmaps
+bitmapdir = $(includedir)/X11/bitmaps
+dist_bitmap_DATA = \
+       Dashes          \
+       Down            \
+       Excl            \
+       FlipHoriz       \
+       FlipVert        \
+       Fold            \
+       Left            \
+       Right           \
+       RotateLeft      \
+       RotateRight     \
+       Stipple         \
+       Term            \
+       Up
+
+APP_MAN_DIR_SUFFIX = $(APP_MAN_DIR:@mandir@/man%=%)
+appmandir = $(APP_MAN_DIR)
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) \
+             $(man_shadows:=.@APP_MAN_SUFFIX@)
+
+BUILT_SOURCES = shadows.DONE
+CLEANFILES = $(appman_DATA) $(BUILT_SOURCES)
+
+# Strings to replace in man pages
+XORGRELSTRING = @PACKAGE_STRING@
+XORGMANNAME = X Version 11
+SUFFIXES = .$(APP_MAN_SUFFIX) .man
+man_shadows = atobm bmtoa
+all: $(BUILT_SOURCES) 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'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+       $(am__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)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+       @if test ! -f $@; then \
+         rm -f stamp-h1; \
+         $(MAKE) $(AM_MAKEFLAGS) 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) 
+       ($(am__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)'; test -n "$(bindir)" || list=; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p; \
+         then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+atobm$(EXEEXT): $(atobm_OBJECTS) $(atobm_DEPENDENCIES) 
+       @rm -f atobm$(EXEEXT)
+       $(AM_V_CCLD)$(atobm_LINK) $(atobm_OBJECTS) $(atobm_LDADD) $(LIBS)
+bitmap$(EXEEXT): $(bitmap_OBJECTS) $(bitmap_DEPENDENCIES) 
+       @rm -f bitmap$(EXEEXT)
+       $(AM_V_CCLD)$(bitmap_LINK) $(bitmap_OBJECTS) $(bitmap_LDADD) $(LIBS)
+bmtoa$(EXEEXT): $(bmtoa_OBJECTS) $(bmtoa_DEPENDENCIES) 
+       @rm -f bmtoa$(EXEEXT)
+       $(AM_V_CCLD)$(bmtoa_LINK) $(bmtoa_OBJECTS) $(bmtoa_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atobm-atobm.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitmap-BitEdit.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitmap-Bitmap.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitmap-CutPaste.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitmap-Dialog.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitmap-Graphics.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitmap-Handlers.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitmap-ReqMach.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bmtoa-bmtoa.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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) '$<'`
+
+atobm-atobm.o: atobm.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(atobm_CFLAGS) $(CFLAGS) -MT atobm-atobm.o -MD -MP -MF $(DEPDIR)/atobm-atobm.Tpo -c -o atobm-atobm.o `test -f 'atobm.c' || echo '$(srcdir)/'`atobm.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/atobm-atobm.Tpo $(DEPDIR)/atobm-atobm.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='atobm.c' object='atobm-atobm.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) $(atobm_CFLAGS) $(CFLAGS) -c -o atobm-atobm.o `test -f 'atobm.c' || echo '$(srcdir)/'`atobm.c
+
+atobm-atobm.obj: atobm.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(atobm_CFLAGS) $(CFLAGS) -MT atobm-atobm.obj -MD -MP -MF $(DEPDIR)/atobm-atobm.Tpo -c -o atobm-atobm.obj `if test -f 'atobm.c'; then $(CYGPATH_W) 'atobm.c'; else $(CYGPATH_W) '$(srcdir)/atobm.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/atobm-atobm.Tpo $(DEPDIR)/atobm-atobm.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='atobm.c' object='atobm-atobm.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) $(atobm_CFLAGS) $(CFLAGS) -c -o atobm-atobm.obj `if test -f 'atobm.c'; then $(CYGPATH_W) 'atobm.c'; else $(CYGPATH_W) '$(srcdir)/atobm.c'; fi`
+
+bitmap-BitEdit.o: BitEdit.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bitmap_CFLAGS) $(CFLAGS) -MT bitmap-BitEdit.o -MD -MP -MF $(DEPDIR)/bitmap-BitEdit.Tpo -c -o bitmap-BitEdit.o `test -f 'BitEdit.c' || echo '$(srcdir)/'`BitEdit.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/bitmap-BitEdit.Tpo $(DEPDIR)/bitmap-BitEdit.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='BitEdit.c' object='bitmap-BitEdit.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) $(bitmap_CFLAGS) $(CFLAGS) -c -o bitmap-BitEdit.o `test -f 'BitEdit.c' || echo '$(srcdir)/'`BitEdit.c
+
+bitmap-BitEdit.obj: BitEdit.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bitmap_CFLAGS) $(CFLAGS) -MT bitmap-BitEdit.obj -MD -MP -MF $(DEPDIR)/bitmap-BitEdit.Tpo -c -o bitmap-BitEdit.obj `if test -f 'BitEdit.c'; then $(CYGPATH_W) 'BitEdit.c'; else $(CYGPATH_W) '$(srcdir)/BitEdit.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/bitmap-BitEdit.Tpo $(DEPDIR)/bitmap-BitEdit.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='BitEdit.c' object='bitmap-BitEdit.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) $(bitmap_CFLAGS) $(CFLAGS) -c -o bitmap-BitEdit.obj `if test -f 'BitEdit.c'; then $(CYGPATH_W) 'BitEdit.c'; else $(CYGPATH_W) '$(srcdir)/BitEdit.c'; fi`
+
+bitmap-CutPaste.o: CutPaste.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bitmap_CFLAGS) $(CFLAGS) -MT bitmap-CutPaste.o -MD -MP -MF $(DEPDIR)/bitmap-CutPaste.Tpo -c -o bitmap-CutPaste.o `test -f 'CutPaste.c' || echo '$(srcdir)/'`CutPaste.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/bitmap-CutPaste.Tpo $(DEPDIR)/bitmap-CutPaste.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='CutPaste.c' object='bitmap-CutPaste.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) $(bitmap_CFLAGS) $(CFLAGS) -c -o bitmap-CutPaste.o `test -f 'CutPaste.c' || echo '$(srcdir)/'`CutPaste.c
+
+bitmap-CutPaste.obj: CutPaste.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bitmap_CFLAGS) $(CFLAGS) -MT bitmap-CutPaste.obj -MD -MP -MF $(DEPDIR)/bitmap-CutPaste.Tpo -c -o bitmap-CutPaste.obj `if test -f 'CutPaste.c'; then $(CYGPATH_W) 'CutPaste.c'; else $(CYGPATH_W) '$(srcdir)/CutPaste.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/bitmap-CutPaste.Tpo $(DEPDIR)/bitmap-CutPaste.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='CutPaste.c' object='bitmap-CutPaste.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) $(bitmap_CFLAGS) $(CFLAGS) -c -o bitmap-CutPaste.obj `if test -f 'CutPaste.c'; then $(CYGPATH_W) 'CutPaste.c'; else $(CYGPATH_W) '$(srcdir)/CutPaste.c'; fi`
+
+bitmap-Graphics.o: Graphics.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bitmap_CFLAGS) $(CFLAGS) -MT bitmap-Graphics.o -MD -MP -MF $(DEPDIR)/bitmap-Graphics.Tpo -c -o bitmap-Graphics.o `test -f 'Graphics.c' || echo '$(srcdir)/'`Graphics.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/bitmap-Graphics.Tpo $(DEPDIR)/bitmap-Graphics.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Graphics.c' object='bitmap-Graphics.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) $(bitmap_CFLAGS) $(CFLAGS) -c -o bitmap-Graphics.o `test -f 'Graphics.c' || echo '$(srcdir)/'`Graphics.c
+
+bitmap-Graphics.obj: Graphics.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bitmap_CFLAGS) $(CFLAGS) -MT bitmap-Graphics.obj -MD -MP -MF $(DEPDIR)/bitmap-Graphics.Tpo -c -o bitmap-Graphics.obj `if test -f 'Graphics.c'; then $(CYGPATH_W) 'Graphics.c'; else $(CYGPATH_W) '$(srcdir)/Graphics.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/bitmap-Graphics.Tpo $(DEPDIR)/bitmap-Graphics.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Graphics.c' object='bitmap-Graphics.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) $(bitmap_CFLAGS) $(CFLAGS) -c -o bitmap-Graphics.obj `if test -f 'Graphics.c'; then $(CYGPATH_W) 'Graphics.c'; else $(CYGPATH_W) '$(srcdir)/Graphics.c'; fi`
+
+bitmap-ReqMach.o: ReqMach.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bitmap_CFLAGS) $(CFLAGS) -MT bitmap-ReqMach.o -MD -MP -MF $(DEPDIR)/bitmap-ReqMach.Tpo -c -o bitmap-ReqMach.o `test -f 'ReqMach.c' || echo '$(srcdir)/'`ReqMach.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/bitmap-ReqMach.Tpo $(DEPDIR)/bitmap-ReqMach.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ReqMach.c' object='bitmap-ReqMach.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) $(bitmap_CFLAGS) $(CFLAGS) -c -o bitmap-ReqMach.o `test -f 'ReqMach.c' || echo '$(srcdir)/'`ReqMach.c
+
+bitmap-ReqMach.obj: ReqMach.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bitmap_CFLAGS) $(CFLAGS) -MT bitmap-ReqMach.obj -MD -MP -MF $(DEPDIR)/bitmap-ReqMach.Tpo -c -o bitmap-ReqMach.obj `if test -f 'ReqMach.c'; then $(CYGPATH_W) 'ReqMach.c'; else $(CYGPATH_W) '$(srcdir)/ReqMach.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/bitmap-ReqMach.Tpo $(DEPDIR)/bitmap-ReqMach.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ReqMach.c' object='bitmap-ReqMach.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) $(bitmap_CFLAGS) $(CFLAGS) -c -o bitmap-ReqMach.obj `if test -f 'ReqMach.c'; then $(CYGPATH_W) 'ReqMach.c'; else $(CYGPATH_W) '$(srcdir)/ReqMach.c'; fi`
+
+bitmap-Bitmap.o: Bitmap.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bitmap_CFLAGS) $(CFLAGS) -MT bitmap-Bitmap.o -MD -MP -MF $(DEPDIR)/bitmap-Bitmap.Tpo -c -o bitmap-Bitmap.o `test -f 'Bitmap.c' || echo '$(srcdir)/'`Bitmap.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/bitmap-Bitmap.Tpo $(DEPDIR)/bitmap-Bitmap.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Bitmap.c' object='bitmap-Bitmap.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) $(bitmap_CFLAGS) $(CFLAGS) -c -o bitmap-Bitmap.o `test -f 'Bitmap.c' || echo '$(srcdir)/'`Bitmap.c
+
+bitmap-Bitmap.obj: Bitmap.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bitmap_CFLAGS) $(CFLAGS) -MT bitmap-Bitmap.obj -MD -MP -MF $(DEPDIR)/bitmap-Bitmap.Tpo -c -o bitmap-Bitmap.obj `if test -f 'Bitmap.c'; then $(CYGPATH_W) 'Bitmap.c'; else $(CYGPATH_W) '$(srcdir)/Bitmap.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/bitmap-Bitmap.Tpo $(DEPDIR)/bitmap-Bitmap.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Bitmap.c' object='bitmap-Bitmap.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) $(bitmap_CFLAGS) $(CFLAGS) -c -o bitmap-Bitmap.obj `if test -f 'Bitmap.c'; then $(CYGPATH_W) 'Bitmap.c'; else $(CYGPATH_W) '$(srcdir)/Bitmap.c'; fi`
+
+bitmap-Dialog.o: Dialog.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bitmap_CFLAGS) $(CFLAGS) -MT bitmap-Dialog.o -MD -MP -MF $(DEPDIR)/bitmap-Dialog.Tpo -c -o bitmap-Dialog.o `test -f 'Dialog.c' || echo '$(srcdir)/'`Dialog.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/bitmap-Dialog.Tpo $(DEPDIR)/bitmap-Dialog.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Dialog.c' object='bitmap-Dialog.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) $(bitmap_CFLAGS) $(CFLAGS) -c -o bitmap-Dialog.o `test -f 'Dialog.c' || echo '$(srcdir)/'`Dialog.c
+
+bitmap-Dialog.obj: Dialog.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bitmap_CFLAGS) $(CFLAGS) -MT bitmap-Dialog.obj -MD -MP -MF $(DEPDIR)/bitmap-Dialog.Tpo -c -o bitmap-Dialog.obj `if test -f 'Dialog.c'; then $(CYGPATH_W) 'Dialog.c'; else $(CYGPATH_W) '$(srcdir)/Dialog.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/bitmap-Dialog.Tpo $(DEPDIR)/bitmap-Dialog.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Dialog.c' object='bitmap-Dialog.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) $(bitmap_CFLAGS) $(CFLAGS) -c -o bitmap-Dialog.obj `if test -f 'Dialog.c'; then $(CYGPATH_W) 'Dialog.c'; else $(CYGPATH_W) '$(srcdir)/Dialog.c'; fi`
+
+bitmap-Handlers.o: Handlers.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bitmap_CFLAGS) $(CFLAGS) -MT bitmap-Handlers.o -MD -MP -MF $(DEPDIR)/bitmap-Handlers.Tpo -c -o bitmap-Handlers.o `test -f 'Handlers.c' || echo '$(srcdir)/'`Handlers.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/bitmap-Handlers.Tpo $(DEPDIR)/bitmap-Handlers.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Handlers.c' object='bitmap-Handlers.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) $(bitmap_CFLAGS) $(CFLAGS) -c -o bitmap-Handlers.o `test -f 'Handlers.c' || echo '$(srcdir)/'`Handlers.c
+
+bitmap-Handlers.obj: Handlers.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bitmap_CFLAGS) $(CFLAGS) -MT bitmap-Handlers.obj -MD -MP -MF $(DEPDIR)/bitmap-Handlers.Tpo -c -o bitmap-Handlers.obj `if test -f 'Handlers.c'; then $(CYGPATH_W) 'Handlers.c'; else $(CYGPATH_W) '$(srcdir)/Handlers.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/bitmap-Handlers.Tpo $(DEPDIR)/bitmap-Handlers.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Handlers.c' object='bitmap-Handlers.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) $(bitmap_CFLAGS) $(CFLAGS) -c -o bitmap-Handlers.obj `if test -f 'Handlers.c'; then $(CYGPATH_W) 'Handlers.c'; else $(CYGPATH_W) '$(srcdir)/Handlers.c'; fi`
+
+bmtoa-bmtoa.o: bmtoa.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bmtoa_CFLAGS) $(CFLAGS) -MT bmtoa-bmtoa.o -MD -MP -MF $(DEPDIR)/bmtoa-bmtoa.Tpo -c -o bmtoa-bmtoa.o `test -f 'bmtoa.c' || echo '$(srcdir)/'`bmtoa.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/bmtoa-bmtoa.Tpo $(DEPDIR)/bmtoa-bmtoa.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='bmtoa.c' object='bmtoa-bmtoa.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) $(bmtoa_CFLAGS) $(CFLAGS) -c -o bmtoa-bmtoa.o `test -f 'bmtoa.c' || echo '$(srcdir)/'`bmtoa.c
+
+bmtoa-bmtoa.obj: bmtoa.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bmtoa_CFLAGS) $(CFLAGS) -MT bmtoa-bmtoa.obj -MD -MP -MF $(DEPDIR)/bmtoa-bmtoa.Tpo -c -o bmtoa-bmtoa.obj `if test -f 'bmtoa.c'; then $(CYGPATH_W) 'bmtoa.c'; else $(CYGPATH_W) '$(srcdir)/bmtoa.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/bmtoa-bmtoa.Tpo $(DEPDIR)/bmtoa-bmtoa.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='bmtoa.c' object='bmtoa-bmtoa.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) $(bmtoa_CFLAGS) $(CFLAGS) -c -o bmtoa-bmtoa.obj `if test -f 'bmtoa.c'; then $(CYGPATH_W) 'bmtoa.c'; else $(CYGPATH_W) '$(srcdir)/bmtoa.c'; fi`
+install-appmanDATA: $(appman_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)"
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \
+       done
+
+uninstall-appmanDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appmandir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appmandir)" && rm -f $$files
+install-dist_appdefaultDATA: $(dist_appdefault_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appdefaultdir)" || $(MKDIR_P) "$(DESTDIR)$(appdefaultdir)"
+       @list='$(dist_appdefault_DATA)'; test -n "$(appdefaultdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appdefaultdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appdefaultdir)" || exit $$?; \
+       done
+
+uninstall-dist_appdefaultDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_appdefault_DATA)'; test -n "$(appdefaultdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appdefaultdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appdefaultdir)" && rm -f $$files
+install-dist_bitmapDATA: $(dist_bitmap_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(bitmapdir)" || $(MKDIR_P) "$(DESTDIR)$(bitmapdir)"
+       @list='$(dist_bitmap_DATA)'; test -n "$(bitmapdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bitmapdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(bitmapdir)" || exit $$?; \
+       done
+
+uninstall-dist_bitmapDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_bitmap_DATA)'; test -n "$(bitmapdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bitmapdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bitmapdir)" && rm -f $$files
+
+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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       set x; \
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       $(am__remove_distdir)
+       test -d "$(distdir)" || mkdir "$(distdir)"
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$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
+       -test -n "$(am__skip_mode_fix)" \
+       || find "$(distdir)" -type d ! -perm -755 \
+               -exec chmod u+rwx,go+rx {} \; -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 $(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-lzma: distdir
+       tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+       $(am__remove_distdir)
+
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+       $(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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+       *.tar.bz2*) \
+         bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.lzma*) \
+         lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+       *.tar.Z*) \
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+       *.shar.gz*) \
+         GZIP=$(GZIP_ENV) gzip -dc $(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)
+       test -d $(distdir)/_build || exit 0; \
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && am__cwd=`pwd` \
+         && $(am__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 \
+         && cd "$$am__cwd" \
+         || exit 1
+       $(am__remove_distdir)
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+       @$(am__cd) '$(distuninstallcheck_dir)' \
+       && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+          || { echo "ERROR: files left after uninstall:" ; \
+               if test -n "$(DESTDIR)"; then \
+                 echo "  (check DESTDIR support)"; \
+               fi ; \
+               $(distuninstallcheck_listfiles) ; \
+               exit 1; } >&2
+distcleancheck: distclean
+       @if test '$(srcdir)' = . ; then \
+         echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+         exit 1 ; \
+       fi
+       @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+         || { echo "ERROR: files left in build directory after distclean:" ; \
+              $(distcleancheck_listfiles) ; \
+              exit 1; } >&2
+check-am: all-am
+check: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(PROGRAMS) $(DATA) config.h
+installdirs:
+       for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(appdefaultdir)" "$(DESTDIR)$(bitmapdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-appmanDATA install-dist_appdefaultDATA \
+       install-dist_bitmapDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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_appdefaultDATA uninstall-dist_bitmapDATA
+
+.MAKE: all check install install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+       clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
+       dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \
+       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-dist_appdefaultDATA install-dist_bitmapDATA \
+       install-dvi install-dvi-am install-exec install-exec-am \
+       install-html install-html-am install-info install-info-am \
+       install-man install-pdf install-pdf-am install-ps \
+       install-ps-am install-strip installcheck installcheck-am \
+       installdirs maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+       ps ps-am tags uninstall uninstall-am uninstall-appmanDATA \
+       uninstall-binPROGRAMS uninstall-dist_appdefaultDATA \
+       uninstall-dist_bitmapDATA
+
+
+.PHONY: ChangeLog
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog
+
+.man.$(APP_MAN_SUFFIX):
+       sed $(MAN_SUBSTS) < $< > $@
+
+shadows.DONE:
+       -rm -f $(man_shadows:=.@APP_MAN_SUFFIX@)
+       (for i in $(man_shadows:=.@APP_MAN_SUFFIX@) ; do \
+        echo .so man$(APP_MAN_DIR_SUFFIX)/bitmap.$(APP_MAN_SUFFIX) > $$i; \
+        done)
+
+# 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/bitmap/NEWS b/bitmap/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/bitmap/README b/bitmap/README
new file mode 100644 (file)
index 0000000..4a06c80
--- /dev/null
@@ -0,0 +1,25 @@
+bitmap, bmtoa, atobm - X bitmap (XBM) editor and converter utilities
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+        http://lists.freedesktop.org/mailman/listinfo/xorg
+
+Please submit bug reports to the Xorg bugzilla:
+
+        https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+The master development code repository can be found at:
+
+        git://anongit.freedesktop.org/git/xorg/app/bitmap
+
+        http://cgit.freedesktop.org/xorg/app/bitmap
+
+For patch submission instructions, see:
+
+       http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
+For more information on the git code manager, see:
+
+        http://wiki.x.org/wiki/GitPage
+
diff --git a/bitmap/ReqMach.c b/bitmap/ReqMach.c
new file mode 100644 (file)
index 0000000..d781b74
--- /dev/null
@@ -0,0 +1,260 @@
+/*
+
+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.
+
+*/
+
+/*
+ * Author:  Davor Matic, MIT X Consortium
+ */
+
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <X11/Xfuncs.h>
+#include <X11/Xos.h>
+#include "BitmapP.h"
+    
+#include <stdio.h>
+#include <math.h>
+
+
+/*****************************************************************************\
+ * Request Machine: stacks up and handles requests from application calls.   * 
+\*****************************************************************************/
+
+/*
+ * Searches for a request record of a request specified by its name.
+ * Returns a pointer to the record or NULL if the request was not found.
+ */
+static BWRequestRec *
+FindRequest(BWRequest name)
+{
+    int i;
+
+    for (i = 0; i < bitmapClassRec.bitmap_class.num_requests; i++)
+       if (!strcmp(name, bitmapClassRec.bitmap_class.requests[i].name))
+           return &bitmapClassRec.bitmap_class.requests[i];
+    
+    return NULL;
+}
+
+/*
+ * Adds a request to the request stack and does proper initializations.
+ * Returns TRUE if the request was found and FALSE otherwise.
+ */
+Boolean 
+BWAddRequest(Widget w, BWRequest name, Boolean trap, 
+            XtPointer call_data, Cardinal call_data_size)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    BWRequestRec *request;
+    
+    request = FindRequest(name);
+    if(request) {
+       if (DEBUG)
+         fprintf(stderr, "Adding... Cardinal: %d\n", BW->bitmap.cardinal + 1);
+
+       BW->bitmap.request_stack = (BWRequestStack *)
+           XtRealloc((char *)BW->bitmap.request_stack,
+                     (++BW->bitmap.cardinal + 1) * sizeof(BWRequestStack));
+       
+       BW->bitmap.request_stack[BW->bitmap.cardinal].request = request;
+       BW->bitmap.request_stack[BW->bitmap.cardinal].status = 
+           XtMalloc(request->status_size);
+       BW->bitmap.request_stack[BW->bitmap.cardinal].trap = trap;
+       BW->bitmap.request_stack[BW->bitmap.cardinal].call_data = 
+           XtMalloc(call_data_size);
+       memmove( BW->bitmap.request_stack[BW->bitmap.cardinal].call_data,
+             call_data, 
+             call_data_size);
+
+       return True;
+    }
+    else {
+       XtWarning("bad request name.  BitmapWidget");
+       return False;
+    }
+}
+
+/*
+ * Engages the request designated by the current parameter.
+ * Returnes TRUE if the request has an engage function and FALSE otherwise.
+ */
+static Boolean 
+Engage(BitmapWidget BW, Cardinal current)
+{
+    BW->bitmap.current = current;
+    
+    if (DEBUG)
+       fprintf(stderr, "Request: %s\n", 
+               BW->bitmap.request_stack[current].request->name);
+  
+    if (BW->bitmap.request_stack[current].request->engage) {
+       (*BW->bitmap.request_stack[current].request->engage)
+           ((Widget) BW,
+            BW->bitmap.request_stack[current].status,
+            BW->bitmap.request_stack[current].request->engage_client_data,
+            BW->bitmap.request_stack[current].call_data);
+       return True;
+    }
+    else
+       return False;
+}
+
+/* Boolean BWTerminateRequest();
+   Boolean BWRemoveRequest(); */
+
+/*
+ * Scans down the request stack removing all requests untill it finds 
+ * one to be trapped.
+ */
+static void 
+TrappingLoop(BitmapWidget BW)
+{
+
+    if (DEBUG)
+       fprintf(stderr, "Scanning... Current: %d\n", BW->bitmap.current);
+    if ((BW->bitmap.current > 0) 
+       && 
+       (!BW->bitmap.request_stack[BW->bitmap.current--].trap)) {
+       BWRemoveRequest((Widget) BW);
+       TrappingLoop(BW);
+    }
+    else
+       if (BW->bitmap.cardinal > 0) {
+           if (DEBUG)
+               fprintf(stderr, "Trapping... Current: %d\n", BW->bitmap.current+1);
+           if(!Engage(BW, ++BW->bitmap.current))
+               BWTerminateRequest((Widget) BW, True);
+       }
+}
+/*
+ * Terimantes the current request and continues with next request if con = TRUE
+ * Returnes TRUE if there is any number of requests left on the stack.
+ */
+Boolean 
+BWTerminateRequest(Widget w, Boolean cont)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    if (BW->bitmap.current > 0) {
+       if (DEBUG)
+           fprintf(stderr, "Terminating... Current: %d\n", BW->bitmap.current);
+       if (BW->bitmap.request_stack[BW->bitmap.current].request->terminate)
+           (*BW->bitmap.request_stack[BW->bitmap.current].request->terminate)
+               (w,
+                BW->bitmap.request_stack[BW->bitmap.current].status,
+                BW->bitmap.request_stack[BW->bitmap.current].request->terminate_client_data);
+       
+       if (cont) {
+           if (BW->bitmap.current == BW->bitmap.cardinal)
+               TrappingLoop(BW);
+           else {
+               if (DEBUG)
+                   fprintf(stderr, "Continuing... Current: %d\n", BW->bitmap.current+1);
+               if (!Engage(BW, ++BW->bitmap.current))
+                   BWTerminateRequest(w, True);
+           }
+       }
+       else
+           BW->bitmap.current = 0;
+    }
+    
+    return BW->bitmap.current;
+}
+
+/*
+ * Simple interface to BWTerminateRequest that takes only a widget.
+ */
+void 
+BWAbort(Widget w)
+{
+    BWTerminateRequest(w, True);
+}
+
+/*
+ * Removes the top request from the request stack. If the request is active
+ * it will terminate it.
+ * Returns TRUE if the number of requests left on the stack != 0.
+ */
+Boolean 
+BWRemoveRequest(Widget w)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    if (BW->bitmap.cardinal > 0) {
+       if (DEBUG)
+           fprintf(stderr, "Removing... Cardinal: %d\n", BW->bitmap.cardinal);
+       if (BW->bitmap.current == BW->bitmap.cardinal)
+           BWTerminateRequest(w, False);
+       
+       if (BW->bitmap.request_stack[BW->bitmap.cardinal].request->remove)
+           (*BW->bitmap.request_stack[BW->bitmap.cardinal].request->remove)
+               (w,
+                BW->bitmap.request_stack[BW->bitmap.cardinal].status,
+                BW->bitmap.request_stack[BW->bitmap.cardinal].request->remove_client_data);
+       
+       XtFree(BW->bitmap.request_stack[BW->bitmap.cardinal].status);
+       XtFree(BW->bitmap.request_stack[BW->bitmap.cardinal].call_data);
+       BW->bitmap.request_stack = (BWRequestStack *)
+           XtRealloc((char *)BW->bitmap.request_stack,
+                     (--BW->bitmap.cardinal + 1) * sizeof(BWRequestStack));
+       
+       return True;
+    }
+    else 
+       return False;
+}
+
+void 
+BWRemoveAllRequests(Widget w)
+{
+    while (BWRemoveRequest(w)) {/* removes all requests from the stack */}
+}
+
+/*
+ * Adds the request to the stack and performs engaging ritual.
+ * Returns TRUE if the request was found, FALSE otherwise.
+ */
+Boolean 
+BWEngageRequest(Widget w, BWRequest name, Boolean trap, 
+               XtPointer call_data, Cardinal call_data_size)
+{
+    BitmapWidget BW = (BitmapWidget) w;
+    
+    if (BWAddRequest(w, name, trap, call_data, call_data_size)) {
+       BWTerminateRequest(w, False);
+       if (DEBUG)
+           fprintf(stderr, "Engaging... Cardinal: %d\n", BW->bitmap.cardinal);
+       if (!Engage(BW, BW->bitmap.cardinal))
+           BWTerminateRequest(w, True);
+       
+       return True;
+    }
+    else
+       return False;
+}
+
+/************************* End of the Request Machine ************************/
diff --git a/bitmap/Requests.h b/bitmap/Requests.h
new file mode 100644 (file)
index 0000000..c4457e2
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+
+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.
+
+*/
+
+/*
+ * Author:  Davor Matic, MIT X Consortium
+ */
+
+#ifndef _Requests_h
+#define _Requests_h
+
+typedef int (*DrawOnePointProc)(Widget, Position, Position, int);
+typedef int (*DrawTwoPointProc)(Widget, Position, Position,
+                               Position, Position, int);
+typedef int (*InterfaceProc)(Widget);
+
+typedef struct {
+    Boolean  success;
+    Position at_x, at_y;
+    Position from_x, from_y,
+             to_x, to_y;
+    XtPointer draw;
+    int      value;
+    Time     btime;
+    int      state;
+} BWStatus;
+
+extern void OnePointEngage ( Widget w, BWStatus *status, XtPointer draw, int *state );
+extern void OnePointTerminate ( Widget w, BWStatus *status, XtPointer draw );
+extern void OnePointTerminateTransparent ( Widget w, BWStatus *status, XtPointer draw );
+extern void DragOnePointEngage ( Widget w, BWStatus *status, XtPointer draw, int *state );
+extern void DragOnePointTerminate ( Widget w, BWStatus *status, XtPointer client_data );
+extern void TwoPointsEngage ( Widget w, BWStatus *status, XtPointer draw, int *state );
+extern void TwoPointsTerminate ( Widget w, BWStatus *status, XtPointer draw );
+extern void TwoPointsTerminateTransparent ( Widget w, BWStatus *status, XtPointer draw );
+extern void TwoPointsTerminateTimed ( Widget w, BWStatus *status, XtPointer draw );
+extern void DragTwoPointsEngage ( Widget w, BWStatus *status, XtPointer draw, int *state );
+extern void DragTwoPointsTerminate ( Widget w, BWStatus *status, XtPointer draw );
+extern void Interface ( Widget w, BWStatus *status, XtPointer action );
+extern void Paste ( Widget w, Position at_x, Position at_y, int value );
+
+extern void BWDragMarked(Widget w, Position at_x, Position at_y);
+extern void BWDragStored(Widget w, Position at_x, Position at_y);
+extern void BWCopy(Widget w, Position at_x, Position at_y, int value);
+extern void BWMove(Widget w, Position at_x, Position at_y, int value);
+extern void BWRestore(Widget w, Position at_x, Position at_y, int value);
+extern void BWDrawPoint(Widget w, Position x, Position y, bit value);
+extern void BWBlindLine(Widget w, Position from_x, Position from_y, 
+                       Position to_x, Position to_y, int value);
+extern void BWDrawHotSpot(Widget w, Position x, Position y, int value);
+extern void BWZoomIn(Widget w, Position from_x, Position from_y, 
+                    Position to_x, Position to_y);
+
+extern void OnePointHandler(Widget w, XtPointer client_data, 
+                           XEvent *event, Boolean *cont);
+extern void TwoPointsHandler(Widget w, XtPointer client_data, 
+                            XEvent *event, Boolean *cont);
+extern void DragTwoPointsHandler(Widget w, XtPointer client_data, 
+                                XEvent *event, Boolean *cont);
+
+#endif /* _Requests_h */
diff --git a/bitmap/Right b/bitmap/Right
new file mode 100644 (file)
index 0000000..d751a5f
--- /dev/null
@@ -0,0 +1,13 @@
+#define Right_width 30
+#define Right_height 30
+static char Right_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00,
+   0x00, 0x80, 0x0f, 0x00, 0x00, 0x80, 0x1d, 0x00, 0x00, 0x80, 0x3b, 0x00,
+   0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0xdc, 0x01,
+   0xff, 0xff, 0xbf, 0x03, 0xfe, 0xff, 0x5f, 0x07, 0xac, 0xaa, 0xaa, 0x0e,
+   0x58, 0x55, 0x55, 0x1d, 0xac, 0xaa, 0xaa, 0x0e, 0xfe, 0xff, 0x5f, 0x07,
+   0xff, 0xff, 0xbf, 0x03, 0x00, 0x00, 0xdc, 0x01, 0x00, 0x00, 0xee, 0x00,
+   0x00, 0x00, 0x77, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00, 0x80, 0x1d, 0x00,
+   0x00, 0x80, 0x0f, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmap/RotateLeft b/bitmap/RotateLeft
new file mode 100644 (file)
index 0000000..c4d4b14
--- /dev/null
@@ -0,0 +1,13 @@
+#define RotateLeft_width 30
+#define RotateLeft_height 30
+static char RotateLeft_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00,
+   0x00, 0x6e, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00,
+   0xc0, 0x1d, 0x00, 0x00, 0xe0, 0x0e, 0x00, 0x00, 0x70, 0xff, 0x0f, 0x00,
+   0xb8, 0xfe, 0x1f, 0x00, 0x5c, 0x55, 0x35, 0x00, 0xae, 0xaa, 0x6a, 0x00,
+   0x5c, 0x55, 0xd5, 0x00, 0xb8, 0xfe, 0xff, 0x01, 0x70, 0xff, 0xff, 0x03,
+   0xe0, 0x0e, 0x58, 0x03, 0xc0, 0x1d, 0xb8, 0x03, 0x80, 0x3b, 0x58, 0x03,
+   0x00, 0x77, 0xb8, 0x03, 0x00, 0x6e, 0x58, 0x03, 0x00, 0x7c, 0xb8, 0x03,
+   0x00, 0x78, 0x58, 0x03, 0x00, 0x00, 0xb8, 0x03, 0x00, 0x00, 0x58, 0x03,
+   0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0xb8, 0x03, 0x00, 0x00, 0x18, 0x03,
+   0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmap/RotateRight b/bitmap/RotateRight
new file mode 100644 (file)
index 0000000..d54f3c7
--- /dev/null
@@ -0,0 +1,13 @@
+#define RotateRight_width 30
+#define RotateRight_height 30
+static char RotateRight_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x80, 0x0f, 0x00,
+   0x00, 0x80, 0x1d, 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00, 0x00, 0x77, 0x00,
+   0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0xdc, 0x01, 0x00, 0xfc, 0xbf, 0x03,
+   0x00, 0xfe, 0x5f, 0x07, 0x00, 0xab, 0xaa, 0x0e, 0x80, 0x55, 0x55, 0x1d,
+   0xc0, 0xaa, 0xaa, 0x0e, 0xe0, 0xff, 0x5f, 0x07, 0xf0, 0xff, 0xbf, 0x03,
+   0xb0, 0x06, 0xdc, 0x01, 0x70, 0x07, 0xee, 0x00, 0xb0, 0x06, 0x77, 0x00,
+   0x70, 0x87, 0x3b, 0x00, 0xb0, 0x86, 0x1d, 0x00, 0x70, 0x87, 0x0f, 0x00,
+   0xb0, 0x86, 0x07, 0x00, 0x70, 0x07, 0x00, 0x00, 0xb0, 0x06, 0x00, 0x00,
+   0xf0, 0x07, 0x00, 0x00, 0x70, 0x07, 0x00, 0x00, 0x30, 0x06, 0x00, 0x00,
+   0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmap/Stipple b/bitmap/Stipple
new file mode 100644 (file)
index 0000000..d412e65
--- /dev/null
@@ -0,0 +1,4 @@
+#define Stipple_width 2
+#define Stipple_height 2
+static char Stipple_bits[] = {
+   0x01, 0x00};
diff --git a/bitmap/Term b/bitmap/Term
new file mode 100644 (file)
index 0000000..19ec399
--- /dev/null
@@ -0,0 +1,14 @@
+#define Term_width 32
+#define Term_height 32
+static char Term_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x1f, 0x04, 0x00, 0x00, 0x20,
+   0xe4, 0xff, 0xff, 0x27, 0x14, 0x00, 0x00, 0x28, 0x14, 0x80, 0x01, 0x28,
+   0x14, 0x80, 0x01, 0x28, 0x14, 0x80, 0x01, 0x28, 0x14, 0x80, 0x01, 0x28,
+   0x14, 0x80, 0x01, 0x28, 0x14, 0x80, 0x01, 0x28, 0x14, 0x80, 0x00, 0x28,
+   0x14, 0x80, 0x00, 0x28, 0x14, 0x80, 0x00, 0x28, 0x14, 0x80, 0x00, 0x28,
+   0x14, 0x00, 0x00, 0x28, 0x14, 0x80, 0x00, 0x28, 0x14, 0x00, 0x00, 0x28,
+   0xe4, 0xff, 0xff, 0x27, 0x04, 0x00, 0x00, 0x20, 0xf8, 0xff, 0xff, 0x1f,
+   0xfe, 0xff, 0xff, 0x7f, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40,
+   0x02, 0x00, 0xc0, 0x5f, 0x02, 0x00, 0x00, 0x40, 0xfa, 0xff, 0xff, 0x5f,
+   0xae, 0xaa, 0xaa, 0x6a, 0x56, 0x55, 0x55, 0x55, 0xab, 0xaa, 0xaa, 0xea,
+   0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmap/Up b/bitmap/Up
new file mode 100644 (file)
index 0000000..423103f
--- /dev/null
+++ b/bitmap/Up
@@ -0,0 +1,13 @@
+#define Up_width 30
+#define Up_height 30
+static char Up_bits[] = {
+   0x00, 0x40, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00,
+   0x00, 0xb8, 0x03, 0x00, 0x00, 0x5c, 0x07, 0x00, 0x00, 0xae, 0x0e, 0x00,
+   0x00, 0x57, 0x1d, 0x00, 0x80, 0xab, 0x3a, 0x00, 0xc0, 0x5d, 0x77, 0x00,
+   0xe0, 0xbe, 0xef, 0x00, 0x70, 0x5f, 0xdf, 0x01, 0xb0, 0xbb, 0xbb, 0x01,
+   0xf0, 0x59, 0xf3, 0x01, 0xf0, 0xb8, 0xe3, 0x01, 0x00, 0x58, 0x03, 0x00,
+   0x00, 0xb8, 0x03, 0x00, 0x00, 0x58, 0x03, 0x00, 0x00, 0xb8, 0x03, 0x00,
+   0x00, 0x58, 0x03, 0x00, 0x00, 0xb8, 0x03, 0x00, 0x00, 0x58, 0x03, 0x00,
+   0x00, 0xb8, 0x03, 0x00, 0x00, 0x58, 0x03, 0x00, 0x00, 0xb8, 0x03, 0x00,
+   0x00, 0x58, 0x03, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0xb8, 0x03, 0x00,
+   0x00, 0x18, 0x03, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/bitmap/aclocal.m4 b/bitmap/aclocal.m4
new file mode 100644 (file)
index 0000000..b713a40
--- /dev/null
@@ -0,0 +1,2420 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009  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.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
+[m4_warning([this file was generated for autoconf 2.67.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# serial 1 (pkg-config-0.24)
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# 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])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+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.
+#
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+# only at the first occurence in configure.ac, so if the first place
+# it's called might be skipped (such as if it is within an "if", you
+# have 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_default([$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _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
+       AC_MSG_RESULT([no])
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       m4_default([$4], [AC_MSG_ERROR(
+[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])[]dnl
+        ])
+elif test $pkg_failed = untried; then
+       AC_MSG_RESULT([no])
+       m4_default([$4], [AC_MSG_FAILURE(
+[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 <http://pkg-config.freedesktop.org/>.])[]dnl
+        ])
+else
+       $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+       $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+       $3
+fi[]dnl
+])# PKG_CHECK_MODULES
+
+dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
+dnl
+dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. 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 "Software"),
+dnl to deal in the Software without restriction, including without limitation
+dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
+dnl and/or sell copies of the Software, and to permit persons to whom the
+dnl Software is furnished to do so, subject to the following conditions:
+dnl
+dnl The above copyright notice and this permission notice (including the next
+dnl paragraph) shall be included in all copies or substantial portions of the
+dnl Software.
+dnl
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+dnl DEALINGS IN THE SOFTWARE.
+
+# 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 ensure that this macro is defined, also add:
+# m4_ifndef([XORG_MACROS_VERSION],
+#     [m4_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.
+m4_defun([XORG_MACROS_VERSION],[
+m4_define([vers_have], [1.11.0])
+m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
+m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
+m4_if(m4_cmp(maj_have, maj_needed), 0,,
+    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
+m4_if(m4_version_compare(vers_have, [$1]), -1,
+    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
+m4_undefine([vers_have])
+m4_undefine([maj_have])
+m4_undefine([maj_needed])
+]) # 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])
+       # under Cygwin unix is still defined even with -undef
+       elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+               RAWCPPFLAGS="-undef -ansi"
+               AC_MSG_RESULT([yes, with -ansi])
+       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
+# Added MAN_SUBSTS in version 1.8
+# Added AC_PROG_SED in version 1.8
+
+AC_DEFUN([XORG_MANPAGE_SECTIONS],[
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_SED])
+
+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_MAN_PAGE="X Version 11"
+AC_SUBST([XORG_MAN_PAGE])
+MAN_SUBSTS="\
+       -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xservername__|Xorg|g' \
+       -e 's|__xconfigfile__|xorg.conf|g' \
+       -e 's|__projectroot__|\$(prefix)|g' \
+       -e 's|__apploaddir__|\$(appdefaultdir)|g' \
+       -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
+       -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
+       -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
+       -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
+       -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
+       -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
+AC_SUBST([MAN_SUBSTS])
+
+]) # XORG_MANPAGE_SECTIONS
+
+# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
+# ------------------------
+# Minimum version: 1.7.0
+#
+# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
+# provided by xorg-sgml-doctools, if installed.
+AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
+AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
+XORG_SGML_PATH=
+PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
+    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
+    [m4_ifval([$1],[:],
+        [if test x"$cross_compiling" != x"yes" ; then
+            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
+                          [XORG_SGML_PATH=$prefix/share/sgml])
+         fi])
+    ])
+
+# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
+# the path and the name of the doc stylesheet
+if test "x$XORG_SGML_PATH" != "x" ; then
+   AC_MSG_RESULT([$XORG_SGML_PATH])
+   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
+   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
+else
+   AC_MSG_RESULT([no])
+fi
+
+AC_SUBST(XORG_SGML_PATH)
+AC_SUBST(STYLESHEET_SRCDIR)
+AC_SUBST(XSL_STYLESHEET)
+AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
+]) # XORG_CHECK_SGML_DOCTOOLS
+
+# 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_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
+AC_REQUIRE([XORG_WITH_PS2PDF])
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+
+AC_MSG_CHECKING([whether to build documentation])
+
+if test x$XORG_SGML_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$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
+
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([whether to build text documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([whether to build PDF documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([whether to build PostScript documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([whether to build HTML documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
+# ----------------
+# Minimum version: 1.5.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-xmlto option, it allows maximum flexibilty in making decisions
+# as whether or not to use the xmlto package. When DEFAULT is not specified,
+# --with-xmlto assumes 'auto'.
+#
+# Interface to module:
+# HAVE_XMLTO:  used in makefiles to conditionally generate documentation
+# XMLTO:       returns the path of the xmlto program found
+#              returns the path set by the user in the environment
+# --with-xmlto:        'yes' user instructs the module to use xmlto
+#              'no' user instructs the module not to use xmlto
+#
+# Added in version 1.10.0
+# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
+#                  xmlto for text output requires either lynx, links, or w3m browsers
+#
+# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_XMLTO],[
+AC_ARG_VAR([XMLTO], [Path to xmlto command])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(xmlto,
+       AS_HELP_STRING([--with-xmlto],
+          [Use xmlto to regenerate documentation (default: ]_defopt[)]),
+          [use_xmlto=$withval], [use_xmlto=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_xmlto" = x"auto"; then
+   AC_PATH_PROG([XMLTO], [xmlto])
+   if test "x$XMLTO" = "x"; then
+        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
+       have_xmlto=no
+   else
+        have_xmlto=yes
+   fi
+elif test "x$use_xmlto" = x"yes" ; then
+   AC_PATH_PROG([XMLTO], [xmlto])
+   if test "x$XMLTO" = "x"; then
+        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
+   fi
+   have_xmlto=yes
+elif test "x$use_xmlto" = x"no" ; then
+   if test "x$XMLTO" != "x"; then
+      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
+   fi
+   have_xmlto=no
+else
+   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
+fi
+
+# Test for a minimum version of xmlto, if provided.
+m4_ifval([$1],
+[if test "$have_xmlto" = yes; then
+    # scrape the xmlto version
+    AC_MSG_CHECKING([the xmlto version])
+    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
+    AC_MSG_RESULT([$xmlto_version])
+    AS_VERSION_COMPARE([$xmlto_version], [$1],
+        [if test "x$use_xmlto" = xauto; then
+            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
+            have_xmlto=no
+        else
+            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
+        fi])
+fi])
+
+# Test for the ability of xmlto to generate a text target
+have_xmlto_text=no
+cat > conftest.xml << "EOF"
+EOF
+AS_IF([test "$have_xmlto" = yes],
+      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
+             [have_xmlto_text=yes],
+             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
+rm -f conftest.xml
+AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
+AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
+]) # XORG_WITH_XMLTO
+
+# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
+# ----------------
+# Minimum version: 1.5.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-asciidoc option, it allows maximum flexibilty in making decisions
+# as whether or not to use the asciidoc package. When DEFAULT is not specified,
+# --with-asciidoc assumes 'auto'.
+#
+# Interface to module:
+# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
+# ASCIIDOC:     returns the path of the asciidoc program found
+#               returns the path set by the user in the environment
+# --with-asciidoc: 'yes' user instructs the module to use asciidoc
+#                'no' user instructs the module not to use asciidoc
+#
+# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_ASCIIDOC],[
+AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(asciidoc,
+       AS_HELP_STRING([--with-asciidoc],
+          [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
+          [use_asciidoc=$withval], [use_asciidoc=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_asciidoc" = x"auto"; then
+   AC_PATH_PROG([ASCIIDOC], [asciidoc])
+   if test "x$ASCIIDOC" = "x"; then
+        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
+       have_asciidoc=no
+   else
+        have_asciidoc=yes
+   fi
+elif test "x$use_asciidoc" = x"yes" ; then
+   AC_PATH_PROG([ASCIIDOC], [asciidoc])
+   if test "x$ASCIIDOC" = "x"; then
+        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
+   fi
+   have_asciidoc=yes
+elif test "x$use_asciidoc" = x"no" ; then
+   if test "x$ASCIIDOC" != "x"; then
+      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
+   fi
+   have_asciidoc=no
+else
+   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
+fi
+m4_ifval([$1],
+[if test "$have_asciidoc" = yes; then
+    # scrape the asciidoc version
+    AC_MSG_CHECKING([the asciidoc version])
+    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
+    AC_MSG_RESULT([$asciidoc_version])
+    AS_VERSION_COMPARE([$asciidoc_version], [$1],
+        [if test "x$use_asciidoc" = xauto; then
+            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
+            have_asciidoc=no
+        else
+            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
+        fi])
+fi])
+AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
+]) # XORG_WITH_ASCIIDOC
+
+# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
+# --------------------------------
+# Minimum version: 1.5.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-doxygen option, it allows maximum flexibilty in making decisions
+# as whether or not to use the doxygen package. When DEFAULT is not specified,
+# --with-doxygen assumes 'auto'.
+#
+# Interface to module:
+# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
+# DOXYGEN:      returns the path of the doxygen program found
+#               returns the path set by the user in the environment
+# --with-doxygen: 'yes' user instructs the module to use doxygen
+#                'no' user instructs the module not to use doxygen
+#
+# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_DOXYGEN],[
+AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(doxygen,
+       AS_HELP_STRING([--with-doxygen],
+          [Use doxygen to regenerate documentation (default: ]_defopt[)]),
+          [use_doxygen=$withval], [use_doxygen=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_doxygen" = x"auto"; then
+   AC_PATH_PROG([DOXYGEN], [doxygen])
+   if test "x$DOXYGEN" = "x"; then
+        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
+       have_doxygen=no
+   else
+        have_doxygen=yes
+   fi
+elif test "x$use_doxygen" = x"yes" ; then
+   AC_PATH_PROG([DOXYGEN], [doxygen])
+   if test "x$DOXYGEN" = "x"; then
+        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
+   fi
+   have_doxygen=yes
+elif test "x$use_doxygen" = x"no" ; then
+   if test "x$DOXYGEN" != "x"; then
+      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
+   fi
+   have_doxygen=no
+else
+   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
+fi
+m4_ifval([$1],
+[if test "$have_doxygen" = yes; then
+    # scrape the doxygen version
+    AC_MSG_CHECKING([the doxygen version])
+    doxygen_version=`$DOXYGEN --version 2>/dev/null`
+    AC_MSG_RESULT([$doxygen_version])
+    AS_VERSION_COMPARE([$doxygen_version], [$1],
+        [if test "x$use_doxygen" = xauto; then
+            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
+            have_doxygen=no
+        else
+            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
+        fi])
+fi])
+AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
+]) # XORG_WITH_DOXYGEN
+
+# XORG_WITH_GROFF([DEFAULT])
+# ----------------
+# Minimum version: 1.6.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-groff option, it allows maximum flexibilty in making decisions
+# as whether or not to use the groff package. When DEFAULT is not specified,
+# --with-groff assumes 'auto'.
+#
+# Interface to module:
+# HAVE_GROFF:   used in makefiles to conditionally generate documentation
+# HAVE_GROFF_MM: the memorandum macros (-mm) package
+# HAVE_GROFF_MS: the -ms macros package
+# GROFF:        returns the path of the groff program found
+#               returns the path set by the user in the environment
+# --with-groff:         'yes' user instructs the module to use groff
+#               'no' user instructs the module not to use groff
+#
+# Added in version 1.9.0:
+# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
+#                 pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
+#                 psselect from the psutils package.
+#                 the ghostcript package. Refer to the grohtml man pages
+#
+# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
+#
+# OS and distros often splits groff in a basic and full package, the former
+# having the groff program and the later having devices, fonts and macros
+# Checking for the groff executable is not enough.
+#
+# If macros are missing, we cannot assume that groff is useless, so we don't
+# unset HAVE_GROFF or GROFF env variables.
+# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
+#
+AC_DEFUN([XORG_WITH_GROFF],[
+AC_ARG_VAR([GROFF], [Path to groff command])
+m4_define([_defopt], m4_default([$1], [auto]))
+AC_ARG_WITH(groff,
+       AS_HELP_STRING([--with-groff],
+          [Use groff to regenerate documentation (default: ]_defopt[)]),
+          [use_groff=$withval], [use_groff=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_groff" = x"auto"; then
+   AC_PATH_PROG([GROFF], [groff])
+   if test "x$GROFF" = "x"; then
+        AC_MSG_WARN([groff not found - documentation targets will be skipped])
+       have_groff=no
+   else
+        have_groff=yes
+   fi
+elif test "x$use_groff" = x"yes" ; then
+   AC_PATH_PROG([GROFF], [groff])
+   if test "x$GROFF" = "x"; then
+        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
+   fi
+   have_groff=yes
+elif test "x$use_groff" = x"no" ; then
+   if test "x$GROFF" != "x"; then
+      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
+   fi
+   have_groff=no
+else
+   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
+fi
+
+# We have groff, test for the presence of the macro packages
+if test "x$have_groff" = x"yes"; then
+    AC_MSG_CHECKING([for ${GROFF} -ms macros])
+    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
+        groff_ms_works=yes
+    else
+        groff_ms_works=no
+    fi
+    AC_MSG_RESULT([$groff_ms_works])
+    AC_MSG_CHECKING([for ${GROFF} -mm macros])
+    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
+        groff_mm_works=yes
+    else
+        groff_mm_works=no
+    fi
+    AC_MSG_RESULT([$groff_mm_works])
+fi
+
+# We have groff, test for HTML dependencies, one command per package
+if test "x$have_groff" = x"yes"; then
+   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
+   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
+   AC_PATH_PROG(PSSELECT_PATH, [psselect])
+   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
+      have_groff_html=yes
+   else
+      have_groff_html=no
+      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
+   fi
+fi
+
+# Set Automake conditionals for Makefiles
+AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
+AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
+AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
+AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
+]) # XORG_WITH_GROFF
+
+# XORG_WITH_FOP([DEFAULT])
+# ----------------
+# Minimum version: 1.6.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-fop option, it allows maximum flexibilty in making decisions
+# as whether or not to use the fop package. When DEFAULT is not specified,
+# --with-fop assumes 'auto'.
+#
+# Interface to module:
+# HAVE_FOP:    used in makefiles to conditionally generate documentation
+# FOP:         returns the path of the fop program found
+#              returns the path set by the user in the environment
+# --with-fop:  'yes' user instructs the module to use fop
+#              'no' user instructs the module not to use fop
+#
+# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_FOP],[
+AC_ARG_VAR([FOP], [Path to fop command])
+m4_define([_defopt], m4_default([$1], [auto]))
+AC_ARG_WITH(fop,
+       AS_HELP_STRING([--with-fop],
+          [Use fop to regenerate documentation (default: ]_defopt[)]),
+          [use_fop=$withval], [use_fop=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_fop" = x"auto"; then
+   AC_PATH_PROG([FOP], [fop])
+   if test "x$FOP" = "x"; then
+        AC_MSG_WARN([fop not found - documentation targets will be skipped])
+       have_fop=no
+   else
+        have_fop=yes
+   fi
+elif test "x$use_fop" = x"yes" ; then
+   AC_PATH_PROG([FOP], [fop])
+   if test "x$FOP" = "x"; then
+        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
+   fi
+   have_fop=yes
+elif test "x$use_fop" = x"no" ; then
+   if test "x$FOP" != "x"; then
+      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
+   fi
+   have_fop=no
+else
+   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
+fi
+AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
+]) # XORG_WITH_FOP
+
+# XORG_WITH_PS2PDF([DEFAULT])
+# ----------------
+# Minimum version: 1.6.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
+# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
+# --with-ps2pdf assumes 'auto'.
+#
+# Interface to module:
+# HAVE_PS2PDF:         used in makefiles to conditionally generate documentation
+# PS2PDF:      returns the path of the ps2pdf program found
+#              returns the path set by the user in the environment
+# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
+#               'no' user instructs the module not to use ps2pdf
+#
+# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_PS2PDF],[
+AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
+m4_define([_defopt], m4_default([$1], [auto]))
+AC_ARG_WITH(ps2pdf,
+       AS_HELP_STRING([--with-ps2pdf],
+          [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
+          [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_ps2pdf" = x"auto"; then
+   AC_PATH_PROG([PS2PDF], [ps2pdf])
+   if test "x$PS2PDF" = "x"; then
+        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
+       have_ps2pdf=no
+   else
+        have_ps2pdf=yes
+   fi
+elif test "x$use_ps2pdf" = x"yes" ; then
+   AC_PATH_PROG([PS2PDF], [ps2pdf])
+   if test "x$PS2PDF" = "x"; then
+        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
+   fi
+   have_ps2pdf=yes
+elif test "x$use_ps2pdf" = x"no" ; then
+   if test "x$PS2PDF" != "x"; then
+      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
+   fi
+   have_ps2pdf=no
+else
+   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
+fi
+AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
+]) # XORG_WITH_PS2PDF
+
+# XORG_ENABLE_DOCS (enable_docs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a builder to skip all
+# documentation targets except traditional man pages.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO         --with-xmlto
+# XORG_WITH_ASCIIDOC      --with-asciidoc
+# XORG_WITH_DOXYGEN       --with-doxygen
+# XORG_WITH_FOP           --with-fop
+# XORG_WITH_GROFF         --with-groff
+# XORG_WITH_PS2PDF        --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_DOCS:           used in makefiles to conditionally generate documentation
+# --enable-docs: 'yes' user instructs the module to generate docs
+#               'no' user instructs the module not to generate docs
+# parm1:       specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_DOCS],[
+m4_define([default], m4_default([$1], [yes]))
+AC_ARG_ENABLE(docs,
+       AS_HELP_STRING([--enable-docs],
+          [Enable building the documentation (default: ]default[)]),
+          [build_docs=$enableval], [build_docs=]default)
+m4_undefine([default])
+AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
+AC_MSG_CHECKING([whether to build documentation])
+AC_MSG_RESULT([$build_docs])
+]) # XORG_ENABLE_DOCS
+
+# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# This macro enables a builder to skip all developer documentation.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO         --with-xmlto
+# XORG_WITH_ASCIIDOC      --with-asciidoc
+# XORG_WITH_DOXYGEN       --with-doxygen
+# XORG_WITH_FOP           --with-fop
+# XORG_WITH_GROFF         --with-groff
+# XORG_WITH_PS2PDF        --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_DEVEL_DOCS:   used in makefiles to conditionally generate developer docs
+# --enable-devel-docs: 'yes' user instructs the module to generate developer docs
+#                      'no' user instructs the module not to generate developer docs
+# parm1:               specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
+m4_define([devel_default], m4_default([$1], [yes]))
+AC_ARG_ENABLE(devel-docs,
+       AS_HELP_STRING([--enable-devel-docs],
+          [Enable building the developer documentation (default: ]devel_default[)]),
+          [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
+m4_undefine([devel_default])
+AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
+AC_MSG_CHECKING([whether to build developer documentation])
+AC_MSG_RESULT([$build_devel_docs])
+]) # XORG_ENABLE_DEVEL_DOCS
+
+# XORG_ENABLE_SPECS (enable_specs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# This macro enables a builder to skip all functional specification targets.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO         --with-xmlto
+# XORG_WITH_ASCIIDOC      --with-asciidoc
+# XORG_WITH_DOXYGEN       --with-doxygen
+# XORG_WITH_FOP           --with-fop
+# XORG_WITH_GROFF         --with-groff
+# XORG_WITH_PS2PDF        --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_SPECS:                used in makefiles to conditionally generate specs
+# --enable-specs:      'yes' user instructs the module to generate specs
+#                      'no' user instructs the module not to generate specs
+# parm1:               specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_SPECS],[
+m4_define([spec_default], m4_default([$1], [yes]))
+AC_ARG_ENABLE(specs,
+       AS_HELP_STRING([--enable-specs],
+          [Enable building the specs (default: ]spec_default[)]),
+          [build_specs=$enableval], [build_specs=]spec_default)
+m4_undefine([spec_default])
+AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
+AC_MSG_CHECKING([whether to build functional specifications])
+AC_MSG_RESULT([$build_specs])
+]) # XORG_ENABLE_SPECS
+
+# 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,
+       AS_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],
+               [MALLOC_ZERO_RETURNS_NULL=yes])
+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
+#
+# This macro enables the use of a tool that flags some suspicious and
+# non-portable constructs (likely to be bugs) in C language source code.
+# It will attempt to locate the tool and use appropriate options.
+# There are various lint type tools on different platforms.
+#
+# Interface to module:
+# LINT:                returns the path to the tool found on the platform
+#              or the value set to LINT on the configure cmd line
+#              also an Automake conditional
+# LINT_FLAGS:  an Automake variable with appropriate flags
+#
+# --with-lint: 'yes' user instructs the module to use lint
+#              'no' user instructs the module not to use lint (default)
+#
+# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
+# If the user sets the value of LINT_FLAGS, they are used verbatim.
+#
+AC_DEFUN([XORG_WITH_LINT],[
+
+AC_ARG_VAR([LINT], [Path to a lint-style command])
+AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
+AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
+               [Use a lint-style source code checker (default: disabled)])],
+               [use_lint=$withval], [use_lint=no])
+
+# Obtain platform specific info like program name and options
+# The lint program on FreeBSD and NetBSD is different from the one on Solaris
+case $host_os in
+  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
+       lint_name=splint
+       lint_options="-badflag"
+       ;;
+  *freebsd* | *netbsd*)
+       lint_name=lint
+       lint_options="-u -b"
+       ;;
+  *solaris*)
+       lint_name=lint
+       lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
+       ;;
+esac
+
+# Test for the presence of the program (either guessed by the code or spelled out by the user)
+if test "x$use_lint" = x"yes" ; then
+   AC_PATH_PROG([LINT], [$lint_name])
+   if test "x$LINT" = "x"; then
+        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
+   fi
+elif test "x$use_lint" = x"no" ; then
+   if test "x$LINT" != "x"; then
+      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
+   fi
+else
+   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
+fi
+
+# User supplied flags override default flags
+if test "x$LINT_FLAGS" != "x"; then
+   lint_options=$LINT_FLAGS
+fi
+
+AC_SUBST([LINT_FLAGS],[$lint_options])
+AM_CONDITIONAL(LINT, [test "x$LINT" != x])
+
+]) # 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.
+#
+# Interface to module:
+# LINTLIB              - Automake variable with the name of lint library file to make
+# MAKE_LINT_LIB                - Automake conditional
+#
+# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
+#                        - 'no' user instructs the module not to create a lint library (default)
+
+AC_DEFUN([XORG_LINT_LIBRARY],[
+AC_REQUIRE([XORG_WITH_LINT])
+AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
+       [Create lint library (default: disabled)])],
+       [make_lint_lib=$enableval], [make_lint_lib=no])
+
+if test "x$make_lint_lib" = x"yes" ; then
+   LINTLIB=llib-l$1.ln
+   if test "x$LINT" = "x"; then
+        AC_MSG_ERROR([Cannot make lint library without --with-lint])
+   fi
+elif test "x$make_lint_lib" != x"no" ; then
+   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
+fi
+
+AC_SUBST(LINTLIB)
+AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
+
+]) # XORG_LINT_LIBRARY
+
+# XORG_CWARNFLAGS
+# ---------------
+# Minimum version: 1.2.0
+#
+# Defines CWARNFLAGS to enable C compiler warnings.
+#
+AC_DEFUN([XORG_CWARNFLAGS], [
+AC_REQUIRE([AC_PROG_CC_C99])
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast -Wformat=2"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+AC_SUBST(CWARNFLAGS)
+]) # XORG_CWARNFLAGS
+
+# XORG_STRICT_OPTION
+# -----------------------
+# Minimum version: 1.3.0
+#
+# Add configure option to enable strict compilation
+AC_DEFUN([XORG_STRICT_OPTION], [
+# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
+AC_REQUIRE([AC_PROG_CC_C99])
+AC_REQUIRE([XORG_CWARNFLAGS])
+
+AC_ARG_ENABLE(strict-compilation,
+                         AS_HELP_STRING([--enable-strict-compilation],
+                         [Enable all warnings from compiler and make them errors (default: disabled)]),
+                         [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
+if test "x$STRICT_COMPILE" = "xyes"; then
+       AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+       AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+AC_SUBST([CWARNFLAGS])
+]) # XORG_STRICT_OPTION
+
+# XORG_DEFAULT_OPTIONS
+# --------------------
+# Minimum version: 1.3.0
+#
+# Defines default options for X.Org modules.
+#
+AC_DEFUN([XORG_DEFAULT_OPTIONS], [
+AC_REQUIRE([AC_PROG_INSTALL])
+XORG_CWARNFLAGS
+XORG_STRICT_OPTION
+XORG_RELEASE_VERSION
+XORG_CHANGELOG
+XORG_INSTALL
+XORG_MANPAGE_SECTIONS
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
+    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
+]) # XORG_DEFAULT_OPTIONS
+
+# XORG_INSTALL()
+# ----------------
+# Minimum version: 1.4.0
+#
+# Defines the variable INSTALL_CMD as the command to copy
+# INSTALL from $prefix/share/util-macros.
+#
+AC_DEFUN([XORG_INSTALL], [
+AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
+INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+AC_SUBST([INSTALL_CMD])
+]) # XORG_INSTALL
+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
+# --------------------
+# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+AC_DEFUN([XORG_RELEASE_VERSION],[
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+               [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+               [Major version of this package])
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+               [$PVM],
+               [Minor version of this package])
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+               [$PVP],
+               [Patch version of this package])
+])
+
+# XORG_CHANGELOG()
+# ----------------
+# Minimum version: 1.2.0
+#
+# Defines the variable CHANGELOG_CMD as the command to generate
+# ChangeLog from git.
+#
+#
+AC_DEFUN([XORG_CHANGELOG], [
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+AC_SUBST([CHANGELOG_CMD])
+]) # XORG_CHANGELOG
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11.1], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# 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, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# 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])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+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, 2006, 2009
+# 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 10
+
+# 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], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$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
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    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, 2006, 2008, 2009 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 16
+
+# 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.62])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
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+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
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_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)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+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
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_AM_DEPENDENCIES(OBJC)],
+                 [define([AC_PROG_OBJC],
+                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# 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_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
+                         (and sometimes confusing) to the casual installer],
+      [USE_MAINTAINER_MODE=$enableval],
+      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  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, 2009  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_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.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
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_PROG_CC_C_O
+# --------------
+# Like AC_PROG_CC_C_O, but changed for automake.
+AC_DEFUN([AM_PROG_CC_C_O],
+[AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+dnl Make sure AC_PROG_CC is never called again, or it will override our
+dnl setting of CC.
+m4_define([AC_PROG_CC],
+          [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# 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
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# 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, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _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],
+[m4_foreach_w([_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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# 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
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# 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) 2009  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 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# 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="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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/bitmap/app-defaults/Bitmap b/bitmap/app-defaults/Bitmap
new file mode 100644 (file)
index 0000000..f9cc220
--- /dev/null
@@ -0,0 +1,228 @@
+! The App-defaults file for Bitmap.
+
+*TransientShell.allowShellResize:      True
+*shapeStyle:                           oval
+*cursor:                               left_ptr
+*pane.orientation:                     horizontal
+
+*Form*top:                             ChainTop
+*Form*bottom:                          ChainTop
+*Form*left:                            ChainLeft
+*Form*right:                           ChainLeft
+
+*MenuButton.leftBitmap:                        menu12
+*form*width:                           120
+*form*height:                          15
+
+*baseTranslations:#override\
+                       Ctrl<Key>c:     do-quit()\n\
+                       <Key>q:         do-quit()\n\
+                       Ctrl<Key>n:     do-new()\n\
+                       Ctrl<Key>f:     do-load()\n\
+                       Ctrl<Key>i:     do-insert()\n\
+                       Ctrl<Key>s:     do-save()\n\
+                       Ctrl<Key>w:     do-save-as()\n\
+                       Ctrl<Key>r:     do-resize()\n\
+                       Ctrl<Key>x:     do-rescale()\n\
+                       Ctrl<Key>e:     do-filename()\n\
+                       Ctrl<Key>b:     do-basename()\n\
+                       Meta<Key>i:     switch-image()\n\
+                       Meta<Key>g:     switch-grid()\n\
+                       Meta<Key>d:     switch-dashed()\n\
+                       Meta<Key>a:     switch-axes()\n\
+                       Meta<Key>s:     switch-stippled()\n\
+                       Meta<Key>p:     switch-proportional()\n\
+                       Meta<Key>z:     switch-zoom()\n\
+                       Meta<Key>c:     do-cut()\n\
+                       Meta<Key>w:     do-copy()\n\
+                       Meta<Key>y:     do-paste()
+
+
+*Toggle.translations:  <EnterWindow>:          highlight(WhenUnset)\n\
+                       <LeaveWindow>:          unhighlight()\n\
+                       <Btn1Down>,<Btn1Up>:    set() notify()
+
+*MenuButton.translations:<EnterWindow>:                highlight()\n\
+                       <LeaveWindow>:          reset()\n\
+                       Any<BtnDown>:           reset() fix-menu() PopupMenu()
+
+*Dialog*baseTranslations:#override\
+                       <Key>Return:    set-dialog-button(okay, yes, retry)\n\
+                       Ctrl<Key>g:     set-dialog-button(cancel, abort)
+*image*baseTranslations:#override\
+                       <Btn1Down>,<Btn1Up>:    switch-image()
+*image*width: 0
+*image*height: 0
+*image*Label.internalWidth: 0
+*image*Label.internalHeight: 0
+*image*normalImage.foreground: white
+*image*normalImage.background: black
+*image*invertedImage.foreground: black
+*image*invertedImage.background: white
+
+*bitmap.cursor:                        tcross
+*bitmap.dashes:                                Dashes
+*bitmap.stipple:                       Stipple
+*bitmap.stippled:                      on
+
+*TransientShell.width:                 300
+
+*input*icon:                           Term
+*qsave*icon:                           Term
+*error*icon:                           Excl
+*Dialog.yes.label:                     Yes
+*Dialog.no.label:                      No
+*Dialog.okay.label:                    OK
+*Dialog.abort.label:                   Abort
+*Dialog.cancel.label:                  Cancel
+*Dialog.retry.label:                   Retry
+
+*MenuButton.width:                     58
+
+*SimpleMenu.width:                     0
+*SimpleMenu.height:                    0
+*SimpleMenu.cursor:                    hand2
+*SimpleMenu.line.height:               0
+
+*fileButton.label:                     File
+*fileButton.menuName:                  fileMenu
+
+*editButton.label:                     Edit
+*editButton.fromHoriz:                         fileButton
+*editButton.menuName:                  editMenu
+
+*formy.status*top:                     ChainTop
+*formy.status*bottom:                  ChainTop
+*formy.status*left:                    ChainLeft
+*formy.status*right:                   ChainRight
+*status.fromHoriz:                     editButton
+*status.borderWidth:                   0
+
+*SmeBSB.HorizontalMargins:             32
+
+*fileMenu.new.label:                   New (Ctrl-N)...
+*fileMenu.load.label:                  Load (Ctrl-F)...   
+*fileMenu.insert.label:                        Insert (Ctrl-I)... 
+*fileMenu.save.label:                  Save (Ctrl-S)
+*fileMenu.saveAs.label:                        Save As (Ctrl-W)...
+*fileMenu.resize.label:                        Resize (Ctrl-R)... 
+*fileMenu.rescale.label:               Rescale (Ctrl-X)...
+*fileMenu.filename.label:              Filename (Ctrl-E)...
+*fileMenu.basename.label:              Basename (Ctrl-B)...
+*fileMenu.quit.label:                  Quit (Ctrl-C, Q)
+
+*editMenu.image.label:                 Image (Meta-I)
+*editMenu.grid.label:                  Grid (Meta-G)
+*editMenu.dashed.label:                        Dashed (Meta-D)
+*editMenu.axes.label:                  Axes (Meta-A)
+*editMenu.stippled.label:              Stippled (Meta-S)
+*editMenu.proportional.label:          Proportional (Meta-P)
+*editMenu.zoom.label:                  Zoom (Meta-Z)
+*editMenu.cut.label:                   Cut (Meta-C)
+*editMenu.copy.label:                  Copy (Meta-W)
+*editMenu.paste.label:                 Paste (Meta-Y, Ctrl-mb)
+
+*form.clear.label:                     Clear
+*form.set.fromVert:                    clear
+*form.set.label:                       Set
+*form.invert.fromVert:                         set
+*form.invert.label:                    Invert
+
+*form.mark.vertDistance:               10
+*form.mark.fromVert:                   invert
+*form.mark.label:                      Mark
+*form.unmark.fromVert:                 mark
+*form.unmark.label:                    Unmark
+
+*form.copy.vertDistance:               10
+*form.copy.fromVert:                   unmark
+*form.copy.radioGroup:                 mark
+*form.copy.label:                      Copy
+*form.move.fromVert:                   copy
+*form.move.radioGroup:                 copy
+*form.move.label:                      Move
+
+*form.flipHoriz.vertDistance:          10
+*form.flipHoriz.width:                 36
+*form.flipHoriz.height:                        36
+*form.flipHoriz.fromVert:              move
+*form.flipHoriz.bitmap:                        FlipHoriz
+*form.up.vertDistance:                 10
+*form.up.width:                                36
+*form.up.height:                       36
+*form.up.fromVert:                     move
+*form.up.fromHoriz:                    flipHoriz
+*form.up.bitmap:                       Up
+*form.flipVert.vertDistance:           10
+*form.flipVert.width:                  36
+*form.flipVert.height:                 36
+*form.flipVert.fromVert:               move
+*form.flipVert.fromHoriz:              up
+*form.flipVert.bitmap:                 FlipVert
+*form.left.width:                      36
+*form.left.height:                     36
+*form.left.fromVert:                   flipHoriz
+*form.left.bitmap:                     Left
+*form.fold.width:                      36
+*form.fold.height:                     36
+*form.fold.fromVert:                   up
+*form.fold.fromHoriz:                  left
+*form.fold.bitmap:                     Fold
+*form.right.width:                     36
+*form.right.height:                    36
+*form.right.fromVert:                  flipVert
+*form.right.fromHoriz:                         fold
+*form.right.bitmap:                    Right
+*form.rotateLeft.width:                        36
+*form.rotateLeft.height:               36
+*form.rotateLeft.fromVert:             left
+*form.rotateLeft.bitmap:               RotateLeft
+*form.down.width:                      36
+*form.down.height:                     36
+*form.down.fromVert:                   fold
+*form.down.fromHoriz:                  rotateLeft
+*form.down.bitmap:                     Down
+*form.rotateRight.width:               36
+*form.rotateRight.height:              36
+*form.rotateRight.fromVert:            right
+*form.rotateRight.fromHoriz:           down
+*form.rotateRight.bitmap:              RotateRight
+
+*form.point.vertDistance:              10
+*form.point.fromVert:                  rotateLeft
+*form.point.radioGroup:                move
+*form.point.label:                     Point
+*form.curve.fromVert:                  point
+*form.curve.radioGroup:                point
+*form.curve.label:                     Curve
+*form.line.fromVert:                   curve
+*form.line.radioGroup:                         curve
+*form.line.label:                      Line
+*form.rectangle.fromVert:              line
+*form.rectangle.radioGroup:            line
+*form.rectangle.label:                 Rectangle
+*form.filledRectangle.fromVert:        rectangle
+*form.filledRectangle.radioGroup:      rectangle
+*form.filledRectangle.label:           Filled Rectangle
+*form.circle.fromVert:                         filledRectangle
+*form.circle.radioGroup:               filledRectangle
+*form.circle.label:                    Circle
+*form.filledCircle.fromVert:           circle
+*form.filledCircle.radioGroup:         circle
+*form.filledCircle.label:              Filled Circle
+*form.floodFill.fromVert:              filledCircle
+*form.floodFill.radioGroup:            filledCircle
+*form.floodFill.label:                 Flood Fill
+
+*form.setHotSpot.vertDistance:         10
+*form.setHotSpot.fromVert:             floodFill
+*form.setHotSpot.radioGroup:           floodFill
+*form.setHotSpot.label:                        Set Hot Spot
+*form.clearHotSpot.fromVert:           setHotSpot
+*form.clearHotSpot.label:              Clear Hot Spot
+
+*form.undo.vertDistance:               10
+*form.undo.fromVert:                   clearHotSpot
+*form.undo.label:                      Undo
+
+
diff --git a/bitmap/app-defaults/Bitmap-color b/bitmap/app-defaults/Bitmap-color
new file mode 100644 (file)
index 0000000..7a7a025
--- /dev/null
@@ -0,0 +1,18 @@
+! The App-defaults file for Bitmap on a color screen.
+
+#include "Bitmap"
+
+*background: medium blue
+*foreground: cyan
+*borderColor: plum
+*frame: deep sky blue
+*highlight: magenta
+*Command.background: purple
+*Toggle.background: purple
+*MenuButton.background: purple
+*Command.foreground: white
+*Toggle.foreground: white
+*MenuButton.foreground: white
+*status.foreground: green
+*Dialog.icon.foreground: pale green
+*bitmap.stippled: off
diff --git a/bitmap/app-defaults/Bitmap-nocase b/bitmap/app-defaults/Bitmap-nocase
new file mode 100644 (file)
index 0000000..4b35387
--- /dev/null
@@ -0,0 +1,231 @@
+!
+!
+! The App-defaults file for Bitmap for use on file systems
+! that are not case sensitive.
+
+*TransientShell.allowShellResize:      True
+*shapeStyle:                           oval
+*cursor:                               left_ptr
+*pane.orientation:                     horizontal
+
+*Form*top:                             ChainTop
+*Form*bottom:                          ChainTop
+*Form*left:                            ChainLeft
+*Form*right:                           ChainLeft
+
+*MenuButton.leftBitmap:                        menu12
+*form*width:                           120
+*form*height:                          15
+
+*baseTranslations:#override\
+                       Ctrl<Key>c:     do-quit()\n\
+                       <Key>q:         do-quit()\n\
+                       Ctrl<Key>n:     do-new()\n\
+                       Ctrl<Key>f:     do-load()\n\
+                       Ctrl<Key>i:     do-insert()\n\
+                       Ctrl<Key>s:     do-save()\n\
+                       Ctrl<Key>w:     do-save-as()\n\
+                       Ctrl<Key>r:     do-resize()\n\
+                       Ctrl<Key>x:     do-rescale()\n\
+                       Ctrl<Key>e:     do-filename()\n\
+                       Ctrl<Key>b:     do-basename()\n\
+                       Meta<Key>i:     switch-image()\n\
+                       Meta<Key>g:     switch-grid()\n\
+                       Meta<Key>d:     switch-dashed()\n\
+                       Meta<Key>a:     switch-axes()\n\
+                       Meta<Key>s:     switch-stippled()\n\
+                       Meta<Key>p:     switch-proportional()\n\
+                       Meta<Key>z:     switch-zoom()\n\
+                       Meta<Key>c:     do-cut()\n\
+                       Meta<Key>w:     do-copy()\n\
+                       Meta<Key>y:     do-paste()
+
+
+*Toggle.translations:  <EnterWindow>:          highlight(WhenUnset)\n\
+                       <LeaveWindow>:          unhighlight()\n\
+                       <Btn1Down>,<Btn1Up>:    set() notify()
+
+*MenuButton.translations:<EnterWindow>:                highlight()\n\
+                       <LeaveWindow>:          reset()\n\
+                       Any<BtnDown>:           reset() fix-menu() PopupMenu()
+
+*Dialog*baseTranslations:#override\
+                       <Key>Return:    set-dialog-button(okay, yes, retry)\n\
+                       Ctrl<Key>g:     set-dialog-button(cancel, abort)
+*image*baseTranslations:#override\
+                       <Btn1Down>,<Btn1Up>:    switch-image()
+*image*width: 0
+*image*height: 0
+*image*Label.internalWidth: 0
+*image*Label.internalHeight: 0
+*image*normalImage.foreground: white
+*image*normalImage.background: black
+*image*invertedImage.foreground: black
+*image*invertedImage.background: white
+
+*bitmap.cursor:                        tcross
+*bitmap.dashes:                                Dashes
+*bitmap.stipple:                       Stippler
+*bitmap.stippled:                      on
+
+*TransientShell.width:                 300
+
+*input*icon:                           Term
+*qsave*icon:                           Term
+*error*icon:                           Excl
+*Dialog.yes.label:                     Yes
+*Dialog.no.label:                      No
+*Dialog.okay.label:                    OK
+*Dialog.abort.label:                   Abort
+*Dialog.cancel.label:                  Cancel
+*Dialog.retry.label:                   Retry
+
+*MenuButton.width:                     58
+
+*SimpleMenu.width:                     0
+*SimpleMenu.height:                    0
+*SimpleMenu.cursor:                    hand2
+*SimpleMenu.line.height:               0
+
+*fileButton.label:                     File
+*fileButton.menuName:                  fileMenu
+
+*editButton.label:                     Edit
+*editButton.fromHoriz:                         fileButton
+*editButton.menuName:                  editMenu
+
+*formy.status*top:                     ChainTop
+*formy.status*bottom:                  ChainTop
+*formy.status*left:                    ChainLeft
+*formy.status*right:                   ChainRight
+*status.fromHoriz:                     editButton
+*status.borderWidth:                   0
+
+*SmeBSB.HorizontalMargins:             32
+
+*fileMenu.new.label:                   New (Ctrl-N)...
+*fileMenu.load.label:                  Load (Ctrl-F)...   
+*fileMenu.insert.label:                        Insert (Ctrl-I)... 
+*fileMenu.save.label:                  Save (Ctrl-S)
+*fileMenu.saveAs.label:                        Save As (Ctrl-W)...
+*fileMenu.resize.label:                        Resize (Ctrl-R)... 
+*fileMenu.rescale.label:               Rescale (Ctrl-X)...
+*fileMenu.filename.label:              Filename (Ctrl-E)...
+*fileMenu.basename.label:              Basename (Ctrl-B)...
+*fileMenu.quit.label:                  Quit (Ctrl-C, Q)
+
+*editMenu.image.label:                 Image (Meta-I)
+*editMenu.grid.label:                  Grid (Meta-G)
+*editMenu.dashed.label:                        Dashed (Meta-D)
+*editMenu.axes.label:                  Axes (Meta-A)
+*editMenu.stippled.label:              Stippled (Meta-S)
+*editMenu.proportional.label:          Proportional (Meta-P)
+*editMenu.zoom.label:                  Zoom (Meta-Z)
+*editMenu.cut.label:                   Cut (Meta-C)
+*editMenu.copy.label:                  Copy (Meta-W)
+*editMenu.paste.label:                 Paste (Meta-Y, Ctrl-mb)
+
+*form.clear.label:                     Clear
+*form.set.fromVert:                    clear
+*form.set.label:                       Set
+*form.invert.fromVert:                         set
+*form.invert.label:                    Invert
+
+*form.mark.vertDistance:               10
+*form.mark.fromVert:                   invert
+*form.mark.label:                      Mark
+*form.unmark.fromVert:                 mark
+*form.unmark.label:                    Unmark
+
+*form.copy.vertDistance:               10
+*form.copy.fromVert:                   unmark
+*form.copy.radioGroup:                 mark
+*form.copy.label:                      Copy
+*form.move.fromVert:                   copy
+*form.move.radioGroup:                 copy
+*form.move.label:                      Move
+
+*form.flipHoriz.vertDistance:          10
+*form.flipHoriz.width:                 36
+*form.flipHoriz.height:                        36
+*form.flipHoriz.fromVert:              move
+*form.flipHoriz.bitmap:                        FlipHoriz
+*form.up.vertDistance:                 10
+*form.up.width:                                36
+*form.up.height:                       36
+*form.up.fromVert:                     move
+*form.up.fromHoriz:                    flipHoriz
+*form.up.bitmap:                       Up
+*form.flipVert.vertDistance:           10
+*form.flipVert.width:                  36
+*form.flipVert.height:                 36
+*form.flipVert.fromVert:               move
+*form.flipVert.fromHoriz:              up
+*form.flipVert.bitmap:                 FlipVert
+*form.left.width:                      36
+*form.left.height:                     36
+*form.left.fromVert:                   flipHoriz
+*form.left.bitmap:                     Left
+*form.fold.width:                      36
+*form.fold.height:                     36
+*form.fold.fromVert:                   up
+*form.fold.fromHoriz:                  left
+*form.fold.bitmap:                     Fold
+*form.right.width:                     36
+*form.right.height:                    36
+*form.right.fromVert:                  flipVert
+*form.right.fromHoriz:                         fold
+*form.right.bitmap:                    Right
+*form.rotateLeft.width:                        36
+*form.rotateLeft.height:               36
+*form.rotateLeft.fromVert:             left
+*form.rotateLeft.bitmap:               RotateLeft
+*form.down.width:                      36
+*form.down.height:                     36
+*form.down.fromVert:                   fold
+*form.down.fromHoriz:                  rotateLeft
+*form.down.bitmap:                     Down
+*form.rotateRight.width:               36
+*form.rotateRight.height:              36
+*form.rotateRight.fromVert:            right
+*form.rotateRight.fromHoriz:           down
+*form.rotateRight.bitmap:              RotateRight
+
+*form.point.vertDistance:              10
+*form.point.fromVert:                  rotateLeft
+*form.point.radioGroup:                move
+*form.point.label:                     Point
+*form.curve.fromVert:                  point
+*form.curve.radioGroup:                point
+*form.curve.label:                     Curve
+*form.line.fromVert:                   curve
+*form.line.radioGroup:                         curve
+*form.line.label:                      Line
+*form.rectangle.fromVert:              line
+*form.rectangle.radioGroup:            line
+*form.rectangle.label:                 Rectangle
+*form.filledRectangle.fromVert:        rectangle
+*form.filledRectangle.radioGroup:      rectangle
+*form.filledRectangle.label:           Filled Rectangle
+*form.circle.fromVert:                         filledRectangle
+*form.circle.radioGroup:               filledRectangle
+*form.circle.label:                    Circle
+*form.filledCircle.fromVert:           circle
+*form.filledCircle.radioGroup:         circle
+*form.filledCircle.label:              Filled Circle
+*form.floodFill.fromVert:              filledCircle
+*form.floodFill.radioGroup:            filledCircle
+*form.floodFill.label:                 Flood Fill
+
+*form.setHotSpot.vertDistance:         10
+*form.setHotSpot.fromVert:             floodFill
+*form.setHotSpot.radioGroup:           floodFill
+*form.setHotSpot.label:                        Set Hot Spot
+*form.clearHotSpot.fromVert:           setHotSpot
+*form.clearHotSpot.label:              Clear Hot Spot
+
+*form.undo.vertDistance:               10
+*form.undo.fromVert:                   clearHotSpot
+*form.undo.label:                      Undo
+
+
diff --git a/bitmap/atobm.c b/bitmap/atobm.c
new file mode 100644 (file)
index 0000000..ec41944
--- /dev/null
@@ -0,0 +1,294 @@
+/*
+
+Copyright 1988, 1993, 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.
+
+*/
+
+/*
+ * atobm - ascii to bitmap filter
+ * Author:  Jim Fulton, MIT X Consortium
+ */
+
+#include <stdio.h>
+#include <ctype.h>
+#include <X11/Xos.h>
+#include <stdlib.h>
+
+static char *ProgramName;
+
+static void doit(FILE *fp, char *filename, char *chars, 
+                int xhot, int yhot, char *name);
+
+static void 
+usage (void)
+{
+    fprintf (stderr, "usage:  %s [-options ...] [filename]\n\n",
+            ProgramName);
+    fprintf (stderr, 
+       "where options include:\n");
+    fprintf (stderr, 
+       "    -chars cc        chars to use for 0 and 1 bits, respectively\n");
+    fprintf (stderr, 
+       "    -name variable   name to use in bitmap file\n");
+    fprintf (stderr, 
+       "    -xhot number     x position of hotspot\n");
+    fprintf (stderr,
+       "    -yhot number     y position of hotspot\n");
+    fprintf (stderr, "\n");
+    exit (1);
+}
+
+
+static char *
+cify_name (char *name)
+{
+    int length = name ? strlen (name) : 0;
+    int i;
+
+    for (i = 0; i < length; i++) {     /* strncpy (result, begin, length); */
+       char c = name[i];
+       if (!((isascii(c) && isalnum(c)) || c == '_')) name[i] = '_';
+    }
+    return name;
+}
+
+static char *
+StripName(char *name)
+{
+  char *begin = strrchr(name, '/');
+  char *end, *result;
+  int length;
+
+  begin = (begin ? begin+1 : name);
+  end = strchr(begin, '.');    /* change to strrchr to allow longer names */
+  length = (end ? (end - begin) : strlen (begin));
+  result = (char *) malloc (length + 1);
+  strncpy (result, begin, length);
+  result [length] = '\0';
+  return (result);
+}
+
+int
+main (int argc, char *argv[])
+{
+    int i;
+    int xhot = -1, yhot = -1;
+    char *filename = NULL;
+    char *chars = "-#";
+    char *name = NULL;
+    FILE *fp;
+
+    ProgramName = argv[0];
+
+    for (i = 1; i < argc; i++) {
+       char *arg = argv[i];
+
+       if (arg[0] == '-') {
+           switch (arg[1]) {
+             case '\0':
+               filename = NULL;
+               continue;
+             case 'c':
+               if (++i >= argc) usage ();
+               chars = argv[i];
+               continue;
+             case 'n':
+               if (++i >= argc) usage ();
+               name = argv[i];
+               continue;
+             case 'x':
+               if (++i >= argc) usage ();
+               xhot = atoi (argv[i]);
+               continue;
+             case 'y':
+               if (++i >= argc) usage ();
+               yhot = atoi (argv[i]);
+               continue;
+             default:
+               usage ();
+           }
+       } else {
+           filename = arg;
+       }
+    }
+
+    if (strlen (chars) != 2) {
+       fprintf (stderr,
+        "%s:  bad character list \"%s\", must have exactly 2 characters\n",
+                ProgramName, chars);
+       exit (1);
+    }
+
+    if (filename) {
+       fp = fopen (filename, "r");
+       if (!fp) {
+           fprintf (stderr, "%s:  unable to open file \"%s\".\n",
+                    ProgramName, filename);
+           exit (1);
+       }
+    } else {
+       fp = stdin;
+    }
+
+    if (!name) name = filename ? StripName (filename) : "";
+    cify_name (name);
+    doit (fp, filename, chars, xhot, yhot, name);
+
+    if (filename) (void) fclose (fp);
+    exit (0);
+}
+
+
+static void
+doit (FILE *fp, 
+      char *filename, 
+      char *chars, 
+      int xhot, int yhot, 
+      char *name)
+{
+    int i, j;
+    int last_character;
+    char buf[BUFSIZ];
+    char *cp, *newline;
+    int width = 0, height = 0;
+    int len;
+    int removespace = (((isascii(chars[0]) && isspace(chars[0])) ||
+                       (isascii(chars[1]) && isspace(chars[1]))) ? 0 : 1);
+    int lineno = 0;
+    int bytes_per_scanline = 0;
+    struct _scan_list {
+       int allocated;
+       int used;
+       unsigned char *scanlines;
+       struct _scan_list *next;
+    } *head = NULL, *slist = NULL;
+    static unsigned char masktable[] = {
+       0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
+    int padded = 0;
+       
+#define NTOALLOC 16
+#define NewSList() \
+           slist = (struct _scan_list *) calloc (1, sizeof *slist); \
+           if (!slist) { \
+               fprintf (stderr, "%s:  unable to allocate scan list\n", \
+                        ProgramName); \
+               return; \
+           } \
+           slist->allocated = NTOALLOC * bytes_per_scanline; \
+           slist->scanlines = (unsigned char *) calloc(slist->allocated, 1); \
+           if (!slist->scanlines) { \
+               fprintf (stderr, "%s:  unable to allocate char array\n", \
+                        ProgramName); \
+               return; \
+           } \
+           slist->used = 0; \
+           slist->next = NULL; 
+
+    while (1) {
+       buf[0] = '\0';
+       lineno++;
+       if (fgets (buf, sizeof buf, fp) == NULL) break;
+
+       cp = buf;
+       if (removespace) {
+           for (cp = buf; *cp && isascii(*cp) && isspace(*cp); cp++) ;
+       }
+       if (*cp == '\n' || !*cp) continue;  /* empty line */
+
+       newline = strchr(cp, '\n');
+       if (!newline) {
+           fprintf (stderr, "%s:  line %d too long.\n",
+                    ProgramName, lineno);
+           return;
+       }
+
+       if (removespace) {
+           for (; --newline > cp && isascii(*newline) && isspace(*newline); );
+           newline++;
+       }
+
+       if (newline == cp + 1) continue;
+
+       *newline = '\0';
+       len = strlen (cp);
+
+       if (width == 0) {
+           width = len;
+           padded = ((width & 7) != 0);
+           bytes_per_scanline = (len + 7) / 8;
+           NewSList ();
+           head = slist;
+       } else if (width != len) {
+           fprintf (stderr,
+                    "%s:  line %d is %d characters wide instead of %d\n",
+                    ProgramName, lineno, len, width);
+           return;
+       }
+
+       if (slist->used + 1 >= slist->allocated) {
+           struct _scan_list *old = slist;
+           NewSList ();
+           old->next = slist;
+       }
+
+       /* okay, parse the line and stick values into the scanline array */
+       for (i = 0; i < width; i++) {
+           int ind = (i & 7);
+           int on = 0;
+
+           if (cp[i] == chars[1]) {
+               on = 1;
+           } else if (cp[i] != chars[0]) {
+               fprintf (stderr, "%s:  bad character '%c' on line %d\n",
+                        ProgramName, cp[i], lineno);
+           }
+
+           if (on) slist->scanlines[slist->used] |= masktable[ind];
+           if (ind == 7) slist->used++;
+       }
+       if (padded) slist->used++;
+       height++;
+    }
+
+    printf ("#define %s_width %d\n", name, width);
+    printf ("#define %s_height %d\n", name, height);
+    if (xhot >= 0) printf ("#define %s_x_hot %d\n", name, xhot);
+    if (yhot >= 0) printf ("#define %s_y_hot %d\n", name, yhot);
+    printf ("\n");
+    printf ("static unsigned char %s_bits[] = {\n", name);
+
+    j = 0;
+    last_character = height * bytes_per_scanline - 1;
+    for (slist = head; slist; slist = slist->next) {
+       for (i = 0; i < slist->used; i++) {
+           printf (" 0x%02x", slist->scanlines[i]);
+           if (j != last_character) putchar (',');
+           if ((j % 12) == 11) putchar ('\n');
+           j++;
+       }
+    }
+    printf (" };\n");
+    return;
+}
diff --git a/bitmap/autogen.sh b/bitmap/autogen.sh
new file mode 100755 (executable)
index 0000000..e81f989
--- /dev/null
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
+
diff --git a/bitmap/bitmap.icon b/bitmap/bitmap.icon
new file mode 100644 (file)
index 0000000..53105c7
--- /dev/null
@@ -0,0 +1,14 @@
+#define bitmap_width 32
+#define bitmap_height 32
+static char bitmap_bits[] = {
+   0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xf8, 0xfd, 0xff, 0xff, 0xfb,
+   0x85, 0x08, 0x23, 0xfa, 0x95, 0x28, 0x23, 0xfa, 0x95, 0x29, 0x67, 0xfa,
+   0xb5, 0x69, 0x67, 0xfa, 0xb5, 0x69, 0x67, 0xfa, 0xb5, 0x69, 0x67, 0xfa,
+   0x85, 0x09, 0x67, 0xfa, 0xfd, 0xff, 0xff, 0xfb, 0x85, 0x18, 0x21, 0xfa,
+   0x95, 0x18, 0x25, 0xfa, 0x95, 0x39, 0x65, 0xfa, 0xb5, 0x39, 0x6d, 0xfa,
+   0xb5, 0x39, 0x6d, 0xfa, 0xb5, 0x39, 0x6d, 0xfa, 0x85, 0x39, 0x61, 0xfa,
+   0xfd, 0xff, 0xff, 0xfb, 0x45, 0x18, 0xf9, 0xfb, 0x45, 0x19, 0xe1, 0xfb,
+   0x4d, 0x39, 0xd3, 0xfb, 0x4d, 0x3b, 0xab, 0xfb, 0x4d, 0x3b, 0x57, 0xfb,
+   0x4d, 0x3b, 0xaf, 0xfa, 0x4d, 0x38, 0x5f, 0xfd, 0xfd, 0xff, 0xbf, 0xfa,
+   0x01, 0x00, 0x40, 0xf5, 0xff, 0xff, 0xff, 0xea, 0xff, 0xff, 0xff, 0xe5,
+   0xff, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff};
diff --git a/bitmap/bitmap.man b/bitmap/bitmap.man
new file mode 100644 (file)
index 0000000..14a248e
--- /dev/null
@@ -0,0 +1,654 @@
+.\" Copyright 1993, 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.
+.\"
+.\"
+.TH BITMAP 1 __xorgversion__
+.SH NAME
+bitmap, bmtoa, atobm \- bitmap editor and converter utilities for the X Window System
+.SH SYNOPSIS
+.B bitmap
+[
+.I \-options
+\&.\|.\|. ] [
+.I filename
+] [
+.I basename
+]
+.sp
+.B bmtoa
+[
+.B \-chars
+\&.\|.\|. ] [
+.I filename
+]
+.sp
+.B atobm
+[
+.B \-chars
+.I cc
+] [
+.B \-name
+.I variable
+] [
+.B \-xhot
+.I number
+] [
+.B \-yhot
+.I number
+] [
+.I filename
+]
+.SH DESCRIPTION
+The \fIbitmap\fP program is a rudimentary tool for creating or editing
+rectangular images made up of 1's and 0's.  Bitmaps are used in X for
+defining clipping regions, cursor shapes, icon shapes, and tile and
+stipple patterns.
+.PP
+The \fIbmtoa\fP and \fIatobm\fP filters convert \fIbitmap\fP files (FILE
+FORMAT) to and from ASCII strings.  They are most commonly used to 
+quickly print out bitmaps and to generate versions for including in text.
+.SH COMMAND LINE OPTIONS
+\fIBitmap\fP supports the standard X Toolkit command line arguments
+(see \fIX\fP(1)).  The following additional arguments are supported as well.
+.TP 4
+.B \-size\fI WIDTHxHEIGHT\fP
+Specifies size of the grid in squares.
+.TP 4
+.B \-sw\fI dimension\fP
+Specifies the width of squares in pixels.
+.TP 4
+.B \-sh\fI dimension\fP
+Specifies the height of squares in pixels.
+.TP 4
+.B \-gt\fI dimension\fP
+Grid tolerance.  If the square dimensions fall below the specified 
+value, grid will be automatically turned off.
+.TP 4
+.B \-grid, +grid
+Turns on or off the grid lines.
+.TP 4
+.B \-axes, +axes
+Turns on or off the major axes.
+.TP 4
+.B \-dashed, +dashed
+Turns on or off dashing for the frame and grid lines.
+.TP 4
+.B \-stippled, +stippled
+Turns on or off stippling of highlighted squares.
+.TP 4
+.B \-proportional, +proportional
+Turns proportional mode on or off.  If proportional mode is on, 
+square width is equal to square height.  If proportional mode is
+off,\fI bitmap\fP will use the smaller square dimension, if they 
+were initially different.
+.TP 4
+.B \-dashes\fI filename\fP
+Specifies the bitmap to be used as a stipple for dashing.
+.TP 4
+.B \-stipple\fI filename\fP
+Specifies the bitmap to be used as a stipple for highlighting.
+.TP 4
+.B \-hl\fI color\fP
+Specifies the color used for highlighting.
+.TP 4
+.B \-fr\fI color\fP
+Specifies the color used for the frame and grid lines.
+.TP 4
+.B filename
+Specifies the bitmap to be initially loaded into the program.  
+If the file does not exist,\fI bitmap\fP will assume it is a new file.
+.TP 4
+.B basename
+Specifies the basename to be used in the C code output file.  
+If it is different than the basename in the working file,\fI bitmap\fP 
+will change it when saving the file.
+.PP
+\fIBmtoa\fP accepts the following option:
+.TP 4
+.B \-chars \fIcc\fP
+This option specifies the pair of characters to use in the string version
+of the bitmap.  The first character is used for 0 bits and the second character
+is used for 1 bits.  The default is to use dashes (\-) for 0's and sharp signs
+(#) for 1's.
+.PP
+\fIAtobm\fP accepts the following options:
+.TP 4
+.B \-chars \fIcc\fP
+This option specifies the pair of characters to use when converting string
+bitmaps into arrays of numbers.  The first character represents a 0 bit and
+the second character represents a 1 bit.  The default is to use dashes (\-)
+for 0's and sharp signs (#) for 1's.
+.TP 4
+.B \-name \fIvariable\fP
+This option specifies the variable name to be used when writing out the
+bitmap file.  The default is to use the basename of the \fIfilename\fP command
+line argument or leave it blank if the standard input is read.
+.TP 4
+.B \-xhot \fInumber\fP
+This option specifies the X coordinate of the hotspot.  Only positive values
+are allowed.  By default, no hotspot information is included.
+.TP 4
+.B \-yhot \fInumber\fP
+This option specifies the Y coordinate of the hotspot.  Only positive values
+are allowed.  By default, no hotspot information is included.
+.SH USAGE 
+\fIBitmap\fP displays grid in which each square represents a single
+bit in the picture being edited.  Actual size of the bitmap image, as
+it would appear normally and inverted, can be obtained by pressing\fB
+Meta-I\fP key.  You are free to move the image popup out of the way to
+continue editing.  Pressing the left mouse button in the popup window
+or\fB Meta-I\fP again will remove the real size bitmap image.
+.PP
+If the bitmap is to be used for defining a cursor, one of the squares
+in the images may be designated as the hot spot.  This determines
+where the cursor is actually pointing.  For cursors with sharp tips
+(such as arrows or fingers), this is usually at the end of the tip;
+for symmetric cursors (such as crosses or bullseyes), this is usually
+at the center.
+.PP
+Bitmaps are stored as small C code fragments suitable for including in
+applications.  They provide an array of bits as well as symbolic
+constants giving the width, height, and hot spot (if specified) that
+may be used in creating cursors, icons, and tiles.
+.SH EDITING
+To edit a bitmap image simply click on one of the buttons with drawing
+commands (\fBPoint, Curve, Line, Rectangle,\fP etc.) and move the
+pointer into the bitmap grid  window.  Press one of the buttons on your
+mouse and the appropriate action will take place.  You can either set,
+clear or invert the gird squares.  Setting a grid square corresponds
+to setting a bit in the bitmap image to 1.  Clearing a grid square
+corresponds to setting a bit in the bitmap image to 0.  Inverting a
+grid square corresponds to changing a bit in the bitmap image from 0 to
+1 or 1 to 0, depending what its previous state was. The
+default behavior of mouse buttons is as specified below.
+.sp
+.nf
+               MouseButton1            Set
+               MouseButton2            Invert
+               MouseButton3            Clear
+               MouseButton4            Clear
+               MouseButton5            Clear
+.fi
+.sp
+This default behavior can be changed by setting the button function
+resources.  An example is provided below.
+.sp
+.nf
+               bitmap*button1Function: Set
+               bitmap*button2Function: Clear
+               bitmap*button3Function: Invert
+               etc.
+.fi
+.sp
+The button function applies to all drawing commands, including copying,
+moving and pasting, flood filling and setting the hot spot.
+.SH DRAWING COMMANDS
+Here is the list of drawing commands accessible through the
+buttons at the left side of the application's window.  Some commands
+can be aborted by pressing A inside the bitmap window, allowing the
+user to select different guiding points where applicable.
+.TP 4
+.B Clear
+This command clears all bits in the bitmap image.  The grid squares
+will be set to the background color.  Pressing C inside the bitmap
+window has the same effect.
+.TP 4
+.B Set
+This command sets all bits in the bitmap image.  The grid squares 
+will be set to the foreground color.  Pressing S inside the bitmap
+window has the same effect.
+.TP 4
+.B Invert
+This command inverts all bits in the bitmap image.  The grid squares 
+will be inverted appropriately.  Pressing I inside the bitmap window
+has the same effect.
+.TP 4
+.B Mark
+This command is used to mark an area of the grid by dragging out a
+rectangular shape in the highlighting color.  Once the area is marked,
+it can be operated on by a number of commands (see \fBUp, Down, Left,
+Right, Rotate, Flip, Cut,\fP etc.)  Only one marked area can be present
+at any time.  If you attempt to mark another area, the old mark will
+vanish.  The same effect can be achieved by pressing\fB
+Shift-MouseButton1\fP and dragging out a rectangle in the grid window.
+Pressing\fB Shift-MouseButton2\fP will mark the entire grid area.
+.TP 4
+.B Unmark
+This command will cause the marked area to vanish.  The same effect can 
+be achieved by pressing\fB Shift-MouseButton3\fP.
+.TP 4
+.B Copy
+This command is used to copy an area of the grid from one location to
+another.  If there is no marked grid area displayed,\fB Copy\fP
+behaves just like\fB Mark\fP described above.  Once there is a marked
+grid area displayed in the highlighting color, this command has two
+alternative behaviors.  If you click a mouse button inside the marked
+area, you will be able to drag the rectangle that represents the
+marked area to the desired location.  After you release the mouse
+button, the area will be copied.  If you click outside the marked
+area,\fB Copy\fP will assume that you wish to mark a different region of
+the bitmap image, thus it will behave like\fB Mark\fP again.
+.TP 4
+.B Move
+This command is used to move an area of the grid from one location to
+another.  Its behavior resembles the behavior of\fB Copy\fP command,
+except that the marked area will be moved instead of copied.
+.TP 4
+.B Flip Horizontally
+This command will flip the bitmap image with respect to the horizontal axes.
+If a marked area of the grid is highlighted, it will operate only 
+inside the marked area.  Pressing H inside the bitmap window has the
+same effect.
+.TP 4
+.B Up
+This command moves the bitmap image one pixel up.
+If a marked area of the grid is highlighted, it will operate only 
+inside the marked area.  Pressing UpArrow inside the bitmap window has the
+same effect.
+.TP 4
+.B Flip Vertically
+This command will flip the bitmap image with respect to the vertical axes.
+If a marked area of the grid is highlighted, it will operate only 
+inside the marked area.  Pressing V inside the bitmap window has the
+same effect.
+.TP 4
+.B Left
+This command moves the bitmap image one pixel to the left.
+If a marked area of the grid is highlighted, it will operate only 
+inside the marked area.  Pressing LeftArrow inside the bitmap window has
+the same effect.
+.TP 4
+.B Fold
+This command will fold the bitmap image so that the opposite corners 
+become adjacent.  This is useful when creating bitmap images for
+tiling.  Pressing F inside the bitmap window has the same effect.
+.TP 4
+.B Right
+This command moves the bitmap image one pixel to the right.
+If a marked area of the grid is highlighted, it will operate only 
+inside the marked area.  Pressing RightArrow inside the bitmap window
+has the same effect.
+.TP 4
+.B Rotate Left
+This command rotates the bitmap image 90 degrees to the left (counter 
+clockwise.)
+If a marked area of the grid is highlighted, it will operate only 
+inside the marked area.  Pressing L inside the bitmap window has the
+same effect.
+.TP 4
+.B Down
+This command moves the bitmap image one pixel down.
+If a marked area of the grid is highlighted, it will operate only 
+inside the marked area.  Pressing DownArrow inside the bitmap window
+has the same effect.
+.TP 4
+.B Rotate Right
+This command rotates the bitmap image 90 degrees to the right (clockwise.)
+If a marked area of the grid is highlighted, it will operate only 
+inside the marked area.  Pressing R inside the bitmap window has the
+same effect.
+.TP 4
+.B Point
+This command will change the grid squares underneath the mouse pointer if
+a mouse button is being pressed down.  If you drag the mouse button 
+continuously, the line may not be continuous, depending on the speed of your
+system and frequency of mouse motion events.
+.TP 4
+.B Curve
+This command will change the grid squares underneath the mouse pointer if
+a mouse button is being pressed down.  If you drag the mouse button 
+continuously, it will make sure that the line is continuous.  If your system
+is slow or\fI bitmap\fP receives very few mouse motion events, it might
+behave quite strangely.
+.TP 4
+.B Line
+This command will change the gird squares in a line between two squares.
+Once you press a mouse button in the grid window,\fI bitmap\fP will 
+highlight the line from the square where the mouse button was initially
+pressed to the square where the mouse pointer is located.  By releasing the
+mouse button you will cause the change to take effect, and the highlighted
+line will disappear.
+.TP 4
+.B Rectangle
+This command will change the gird squares in a rectangle between two squares.
+Once you press a mouse button in the grid window,\fI bitmap\fP will 
+highlight the rectangle from the square where the mouse button was initially
+pressed to the square where the mouse pointer is located.  By releasing the
+mouse button you will cause the change to take effect, and the highlighted
+rectangle will disappear.
+.TP 4
+.B Filled Rectangle
+This command is identical to\fB Rectangle\fP, except at the end the
+rectangle will be filled rather than outlined.
+.TP 4
+.B Circle
+This command will change the gird squares in a circle between two squares.
+Once you press a mouse button in the grid window,\fI bitmap\fP will 
+highlight the circle from the square where the mouse button was initially
+pressed to the square where the mouse pointer is located.  By releasing the
+mouse button you will cause the change to take effect, and the highlighted
+circle will disappear.
+.TP 4
+.B Filled Circle
+This command is identical to\fB Circle\fP, except at the end the
+circle will be filled rather than outlined.
+.TP 4
+.B Flood Fill
+This command will flood fill the connected area underneath the mouse 
+pointer when you click on the desired square.  Diagonally adjacent 
+squares are not considered to be connected.
+.TP 4
+.B Set Hot Spot
+This command designates one square in the grid as the hot spot if this 
+bitmap image is to be used for defining a cursor.  Pressing a mouse button 
+in the desired square will cause a diamond shape to be displayed.
+.TP 4
+.B Clear Hot Spot
+This command removes any designated hot spot from the bitmap image.
+.TP 4
+.B Undo
+This command will undo the last executed command.  It has depth one, 
+that is, pressing\fB Undo\fP after\fB Undo\fP will undo itself.  
+.SH FILE MENU
+The File menu commands can be accessed by pressing the File button and
+selecting the appropriate menu entry, or by pressing Ctrl key with
+another key.  These commands deal with files and global bitmap
+parameters, such as size, basename, filename etc.
+.TP 4
+.B New
+This command will clear the editing area and prompt for the name of
+the new file to be edited.  It will not load in the new file.
+.TP 4
+.B Load
+This command is used to load a new bitmap file into the bitmap editor.
+If the current image has not been saved, user will be asked whether to
+save or ignore the changes.  The editor can edit only one file at a
+time.  If you need interactive editing, run a number of editors and
+use cut and paste mechanism as described below.
+.TP 4
+.B Insert
+This command is used to insert a bitmap file into the image
+being currently edited.  After being prompted for the filename,
+click inside the grid window and drag the outlined rectangle to the
+location where you want to insert the new file.
+.TP 4
+.B Save
+This command will save the bitmap image.  It will not prompt for the
+filename unless it is said to be <none>.  If you leave the filename
+undesignated or \-, the output will be piped to stdout.
+.TP 4
+.B Save As
+This command will save the bitmap image after prompting for a new
+filename.  It should be used if you want to change the filename.
+.TP 4
+.B Resize
+This command is used to resize the editing area to the new number of
+pixels.  The size should be entered in the WIDTHxHEIGHT format.  The
+information in the image being edited will not be lost unless the new
+size is smaller that the current image size. The editor was not
+designed to edit huge files.  
+.TP 4
+.B Rescale
+This command is used to rescale the editing area to the new width and
+height.  The size should be entered in the WIDTHxHEIGHT format.  It will 
+not do antialiasing and information will be lost if you rescale to the
+smaller sizes.  Feel free to add you own algorithms for better rescaling.
+.TP 4
+.B Filename
+This command is used to change the filename without changing the basename
+nor saving the file.  If you specify \- for a filename, the output will 
+be piped to stdout.
+.TP 4
+.B Basename
+This command is used to change the basename, if a different one from
+the specified filename is desired.
+.TP 4
+.B Quit
+\This command will terminate the bitmap application.  If the file was
+not saved, user will be prompted and asked whether to save the image
+or not.  This command is preferred over killing the process.
+.SH EDIT MENU
+The Edit menu commands can be accessed by pressing the Edit button and
+selecting the appropriate menu entry, or by pressing Meta key with
+another key.  These commands deal with editing facilities such as
+grid, axes, zooming, cut and paste, etc.
+.TP 4
+.B Image
+This command will display the image being edited and its inverse in its 
+actual size in a separate window.  The window can be moved away to continue
+with editing.  Pressing the left mouse button in the image window will
+cause it to disappear from the screen.
+.TP 4
+.B Grid
+This command controls the grid in the editing area.  If the grid spacing
+is below the value specified by gridTolerance resource (8 by default), 
+the grid will be automatically turned off.  It can be enforced by explicitly
+activating this command.
+.TP 4
+.B Dashed
+This command controls the stipple for drawing the grid lines.  The stipple
+specified by dashes resource can be turned on or off by activating this 
+command.
+.TP 4
+.B Axes
+This command controls the highlighting of the main axes of the image
+being edited.  The actual lines are not part of the image.  They are
+provided to aid user when constructing symmetrical images, or whenever
+having the main axes highlighted helps your editing.
+.TP 4
+.B Stippled
+This command controls the stippling of the highlighted areas of the
+bitmap image.  The stipple specified by stipple resource can be turned on
+or off by activating this command.
+.TP 4
+.B Proportional
+This command controls the proportional mode.  If the proportional mode 
+is on, width and height of all image squares are forced to be equal,
+regardless of the proportions of the bitmap window.
+.TP 4
+.B Zoom
+This command controls the zoom mode.  If there is a marked area of the 
+image already displayed, bitmap will automatically zoom into it.  Otherwise,
+user will have to highlight an area to be edited in the zoom mode and 
+bitmap will automatically switch into it.  One can use all the editing
+commands and other utilities in the zoom mode.  When you zoom out, undo
+command will undo the whole zoom session.
+.TP 4
+.B Cut
+This commands cuts the contents of the highlighted image area into the
+internal cut and paste buffer.  
+.TP 4
+.B Copy
+This command copies the contents of the highlighted image area into the
+internal cut and paste buffer. 
+.TP 4
+.B Paste
+This command will check if there are any other bitmap applications with
+a highlighted image area, or if there is something in the internal cut
+and paste buffer and copy it to the image.  To place the copied image,
+click in the editing window and drag the outlined image to the position
+where you want to place i, and then release the button.
+.SH CUT AND PASTE
+Bitmap supports two cut and paste mechanisms; the internal cut and
+paste and the global X selection cut and paste.  The internal cut and
+paste is used when executing copy and move drawing commands and also
+cut and copy commands from the edit menu.  The global X selection cut
+and paste is used whenever there is a highlighted area of a bitmap
+image displayed anywhere on the screen.  To copy a part of image from
+another bitmap editor simply highlight the desired area by using the
+Mark command or pressing the shift key and dragging the area with the
+left mouse button.  When the selected area becomes highlighted, any
+other applications (such as xterm, etc.) that use primary selection
+will discard their selection values and unhighlight the appropriate
+information.  Now, use the Paste command for the Edit menu or control
+mouse button to copy the selected part of image into another (or the
+same) bitmap application.  If you attempt to do this without a visible
+highlighted image area, the bitmap will fall back to the internal cut
+and paste buffer and paste whatever was there stored at the moment.
+.SH WIDGETS
+Below is the widget structure of the \fIbitmap\fP
+application.  Indentation indicates hierarchical structure.  The
+widget class name is given first, followed by the widget instance
+name.  All widgets except the bitmap widget are from the standard
+Athena widget set.  
+.sp 
+.nf
+       Bitmap bitmap
+               TransientShell image
+                       Box box
+                               Label normalImage
+                               Label invertedImage
+               TransientShell input
+                       Dialog dialog
+                               Command okay
+                               Command cancel
+               TransientShell error
+                       Dialog dialog
+                               Command abort
+                               Command retry
+               TransientShell qsave
+                       Dialog dialog
+                               Command yes
+                               Command no
+                               Command cancel
+               Paned parent
+                       Form formy
+                               MenuButton fileButton
+                               SimpleMenu fileMenu
+                                       SmeBSB  new
+                                       SmeBSB  load
+                                       SmeBSB  insert
+                                       SmeBSB  save
+                                       SmeBSB  saveAs
+                                       SmeBSB  resize
+                                       SmeBSB  rescale
+                                       SmeBSB  filename
+                                       SmeBSB  basename
+                                       SmeLine line
+                                       SmeBSB  quit
+                               MenuButton editButton
+                               SimpleMenu editMenu
+                                       SmeBSB  image
+                                       SmeBSB  grid
+                                       SmeBSB  dashed
+                                       SmeBSB  axes
+                                       SmeBSB  stippled
+                                       SmeBSB  proportional
+                                       SmeBSB  zoom
+                                       SmeLine line
+                                       SmeBSB  cut
+                                       SmeBSB  copy
+                                       SmeBSB  paste
+                               Label status
+                       Pane pane
+                               Bitmap bitmap
+                               Form form
+                                       Command clear
+                                       Command set
+                                       Command invert
+                                       Toggle  mark
+                                       Command unmark
+                                       Toggle  copy
+                                       Toggle  move
+                                       Command flipHoriz
+                                       Command up
+                                       Command flipVert
+                                       Command left
+                                       Command fold
+                                       Command right
+                                       Command rotateLeft
+                                       Command down
+                                       Command rotateRight
+                                       Toggle  point
+                                       Toggle  curve
+                                       Toggle  line
+                                       Toggle  rectangle
+                                       Toggle  filledRectangle
+                                       Toggle  circle
+                                       Toggle  filledCircle
+                                       Toggle  floodFill
+                                       Toggle  setHotSpot
+                                       Command clearHotSpot
+                                       Command undo
+.fi
+.SH COLORS
+If you would like bitmap to be viewable in color, include the following 
+in the #ifdef COLOR section of the file you read with xrdb:
+.sp 1
+*customization:                 \-color
+.sp 1
+.br
+This will cause bitmap to pick up the colors in the app-defaults color
+customization file:
+.sp 1
+    __apploaddir__/Bitmap-color
+.sp 1
+.fi
+.SH BITMAP WIDGET
+Bitmap widget is a stand-alone widget for editing raster images.  It
+is not designed to edit large images, although it may be used in that
+purpose as well.  It can be freely incorporated with other
+applications and used as a standard editing tool.  The following are
+the resources provided by the bitmap widget.
+.sp 
+.nf
+Bitmap Widget
+
+Header file            Bitmap.h
+Class                  bitmapWidgetClass
+Class Name             Bitmap
+Superclass             Bitmap
+
+
+All the Simple Widget resources plus .\|.\|.
+.ta 1.6i 3.2i 4.8i
+
+Name   Class   Type    Default Value
+
+foreground     Foreground      Pixel   XtDefaultForeground
+highlight      Highlight       Pixel   XtDefaultForeground
+framing        Framing Pixel   XtDefaultForeground
+gridTolerance  GridTolerance   Dimension       8
+size   Size    String  32x32
+dashed Dashed  Boolean True
+grid   Grid    Boolean True
+stippled       Stippled        Boolean True
+proportional   Proportional    Boolean True
+axes   Axes    Boolean False
+squareWidth    SquareWidth     Dimension       16
+squareHeight   SquareHeight    Dimension       16
+margin Margin  Dimension       16
+xHot   XHot    Position        NotSet (\-1)
+yHot   YHot    Position        NotSet (\-1)
+button1Function        Button1Function DrawingFunction Set
+button2Function        Button2Function DrawingFunction Invert
+button3Function        Button3Function DrawingFunction Clear
+button4Function        Button4Function DrawingFunction Invert
+button5Function        Button5Function DrawingFunction Invert
+filename       Filename        String  None ("")
+basename       Basename        String  None ("")
+.fi
+
+.SH AUTHOR
+Davor Matic, MIT X Consortium
diff --git a/bitmap/bmtoa.c b/bitmap/bmtoa.c
new file mode 100644 (file)
index 0000000..bdd2078
--- /dev/null
@@ -0,0 +1,213 @@
+/*
+
+Copyright 1988, 1993, 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.
+
+*/
+
+/*
+ * bmtoa - bitmap to ascii filter
+ * Author:  Jim Fulton, MIT X Consortium
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Xos.h>
+
+#include <X11/Xmu/Drawing.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+#ifndef HAS_MKSTEMP
+extern char *mktemp();
+#endif
+
+static char *ProgramName;
+
+static void print_scanline (unsigned int width, unsigned int height, 
+                           unsigned char *data, char *chars);
+
+static void 
+usage (void)
+{
+    fprintf (stderr, "usage:  %s [-options ...] [filename]\n\n",
+            ProgramName);
+    fprintf (stderr, 
+       "where options include:\n");
+    fprintf (stderr,
+       "    -chars cc        chars to use for 0 and 1 bits, respectively\n");
+    fprintf (stderr, "\n");
+    exit (1);
+}
+
+static char *
+copy_stdin (void)
+{
+#ifdef WIN32
+    static char tmpfilename[] = "/temp/bmtoa.XXXXXX";
+#else
+    static char tmpfilename[] = "/tmp/bmtoa.XXXXXX";
+#endif
+    char buf[BUFSIZ];
+    FILE *fp;
+    int nread, nwritten;
+
+#ifndef HAS_MKSTEMP
+    if (mktemp (tmpfilename) == NULL) {
+       fprintf (stderr,
+                "%s:  unable to genererate temporary file name for stdin.\n",
+                ProgramName);
+       exit (1);
+    }
+    fp = fopen (tmpfilename, "w");
+#else
+    int fd;
+
+    if ((fd = mkstemp(tmpfilename)) < 0) {
+       fprintf (stderr,
+                "%s:  unable to genererate temporary file name for stdin.\n",
+                ProgramName);
+       exit (1);
+    }
+    fp = fdopen(fd, "w");
+#endif
+    while (1) {
+       buf[0] = '\0';
+       nread = fread (buf, 1, sizeof buf, stdin);
+       if (nread <= 0) break;
+       nwritten = fwrite (buf, 1, nread, fp);
+       if (nwritten != nread) {
+           fprintf (stderr,
+                    "%s:  error copying stdin to file (%d of %d chars)\n",
+                    ProgramName, nwritten, nread);
+           (void) fclose (fp);
+           (void) unlink (tmpfilename);
+           exit (1);
+       }
+    }
+    (void) fclose (fp);
+    return tmpfilename;
+}
+
+int
+main (int argc, char *argv[]) 
+{
+    char *filename = NULL;
+    int isstdin = 0;
+    char *chars = "-#";
+    int i;
+    unsigned int width, height;
+    unsigned char *data;
+    int x_hot, y_hot;
+    int status;
+
+    ProgramName = argv[0];
+
+    for (i = 1; i < argc; i++) {
+       char *arg = argv[i];
+
+       if (arg[0] == '-') {
+           switch (arg[1]) {
+             case '\0':
+               filename = NULL;
+               continue;
+             case 'c':
+               if (++i >= argc) usage ();
+               chars = argv[i];
+               continue;
+             default:
+               usage ();
+           }
+       } else {
+           filename = arg;
+       }
+    }
+
+    if (strlen (chars) != 2) {
+       fprintf (stderr,
+        "%s:  bad character list \"%s\", must have exactly 2 characters\n",
+                ProgramName, chars);
+       exit (1);
+    }
+
+    if (!filename) {
+       filename = copy_stdin ();
+       isstdin = 1;
+    }
+
+    status = XmuReadBitmapDataFromFile (filename, &width, &height, &data,
+                                       &x_hot, &y_hot);
+    if (isstdin) (void) unlink (filename);  /* don't need it anymore */
+    if (status != BitmapSuccess) {
+       fprintf (stderr, "%s:  unable to read bitmap from file \"%s\"\n",
+                ProgramName, isstdin ? "(stdin)" : filename);
+       exit (1);
+    }
+
+    print_scanline (width, height, data, chars);
+    exit (0);
+}
+
+static void
+print_scanline (unsigned int width, 
+               unsigned int height, 
+               unsigned char *data, 
+               char *chars)
+{
+    char *scanline = (char *) malloc (width + 1);
+    unsigned char *dp = data;
+    int row, column;
+    static unsigned char masktable[] = {
+       0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
+    int padded = ((width & 7) != 0);
+
+    if (!scanline) {
+       fprintf (stderr, "%s:  unable to allocate %d bytes for scanline\n",
+                ProgramName, width + 1);
+       exit (1);
+    }
+
+    for (row = 0; row < height; row++) {
+       for (column = 0; column < width; column++) {
+           int i = (column & 7);
+
+           if (*dp & masktable[i]) {
+               putchar (chars[1]);
+           } else {
+               putchar (chars[0]);
+           }
+
+           if (i == 7) dp++;
+       }
+       putchar ('\n');
+       if (padded) dp++;
+    }
+    return;
+}
+
diff --git a/bitmap/compile b/bitmap/compile
new file mode 100755 (executable)
index 0000000..ec64c62
--- /dev/null
@@ -0,0 +1,143 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand `-c -o'.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009  Free Software
+# Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# 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, see <http://www.gnu.org/licenses/>.
+
+# 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 <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+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 <bug-automake@gnu.org>.
+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 's|^.*[\\/]||; s|^[a-zA-Z]:||; 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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/bitmap/config.guess b/bitmap/config.guess
new file mode 100755 (executable)
index 0000000..da83314
--- /dev/null
@@ -0,0 +1,1561 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
+
+timestamp='2009-04-27'
+
+# 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 <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+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, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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 "$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 ;;
+           sh5el) machine=sh5le-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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    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.*:* | i86xen:SunOS:5.*:*)
+       eval $set_cc_for_build
+       SUN_ARCH="i386"
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       echo ${SUN_ARCH}-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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:*:[456])
+       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+               IBM_ARCH=rs6000
+       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 <stdlib.h>
+              #include <unistd.h>
+
+              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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       exit ;;
+    i*:CYGWIN*:*)
+       echo ${UNAME_MACHINE}-pc-cygwin
+       exit ;;
+    *: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 ;;
+    *:Interix*:[3456]*)
+       case ${UNAME_MACHINE} in
+           x86)
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           EM64T | authenticamd | genuineintel)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+           IA64)
+               echo ia64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+       esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       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*:*:* | x86_64: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:*:*)
+       eval $set_cc_for_build
+       if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_EABI__
+       then
+           echo ${UNAME_MACHINE}-unknown-linux-gnu
+       else
+           echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+       fi
+       exit ;;
+    avr32*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-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 ;;
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-gnu
+       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 ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-gnu
+       exit ;;
+    x86_64:Linux:*:*)
+       echo x86_64-unknown-linux-gnu
+       exit ;;
+    xtensa*:Linux:*:*)
+       echo ${UNAME_MACHINE}-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 ;;
+         "")
+               # 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 <features.h>
+       #ifdef __ELF__
+       # ifdef __GLIBC__
+       #  if __GLIBC__ >= 2
+       LIBC=gnu
+       #  else
+       LIBC=gnulibc1
+       #  endif
+       # else
+       LIBC=gnulibc1
+       # endif
+       #else
+       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+       LIBC=gnu
+       #else
+       LIBC=gnuaout
+       #endif
+       #endif
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^LIBC/{
+               s: ::g
+               p
+           }'`"
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-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; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       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; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; 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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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 ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       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 ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-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
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/bitmap/config.h.in b/bitmap/config.h.in
new file mode 100644 (file)
index 0000000..e522402
--- /dev/null
@@ -0,0 +1,70 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the "mkstemp" function. */
+#undef HAS_MKSTEMP
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
+/* 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 home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
diff --git a/bitmap/config.sub b/bitmap/config.sub
new file mode 100755 (executable)
index 0000000..a39437d
--- /dev/null
@@ -0,0 +1,1686 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
+
+timestamp='2009-04-17'
+
+# 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 <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | bfin \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fido | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | lm32 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore | mep | metag \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64octeon | mips64octeonel \
+       | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | moxie \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | z8k | z80)
+               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)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64octeon-* | mips64octeonel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | 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[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+       | tron-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa*-* \
+       | ymp-* \
+       | z8k-* | z80-*)
+               ;;
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               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
+               ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+        cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
+       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
+               ;;
+       cr16)
+               basic_machine=cr16-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
+               ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
+       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
+               ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       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
+               ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
+       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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       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
+               ;;
+       tile*)
+               basic_machine=tile-unknown
+               os=-linux-gnu
+               ;;
+       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
+               ;;
+       z80-*-coff)
+               basic_machine=z80-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[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+               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* \
+             | -kopensolaris* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* | -aros* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
+             | -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* | -cegcc* \
+             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -linux-newlib* | -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* | -rdos* | -toppers* | -drops*)
+       # 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
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+       -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
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
+       *-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
+               ;;
+        mep-*)
+               os=-elf
+               ;;
+       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/bitmap/configure b/bitmap/configure
new file mode 100755 (executable)
index 0000000..04e7640
--- /dev/null
@@ -0,0 +1,6792 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.67 for bitmap 1.0.4.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+        /*)
+          for as_base in sh bash ksh sh5; do
+            # Try only shells that exist, to save several forks.
+            as_shell=$as_dir/$as_base
+            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+          done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+       # neutralization value for shells without unset; and this also
+       # works around shells that cannot unset nonexistent variables.
+       BASH_ENV=/dev/null
+       ENV=/dev/null
+       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+       export CONFIG_SHELL
+       exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='bitmap'
+PACKAGE_TARNAME='bitmap'
+PACKAGE_VERSION='1.0.4'
+PACKAGE_STRING='bitmap 1.0.4'
+PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+appdefaultdir
+APPDEFS_LIBS
+APPDEFS_CFLAGS
+XBITMAP_LIBS
+XBITMAP_CFLAGS
+BITMAP_LIBS
+BITMAP_CFLAGS
+ATOBM_LIBS
+ATOBM_CFLAGS
+BMTOA_LIBS
+BMTOA_CFLAGS
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+MAN_SUBSTS
+XORG_MAN_PAGE
+ADMIN_MAN_DIR
+DRIVER_MAN_DIR
+MISC_MAN_DIR
+FILE_MAN_DIR
+LIB_MAN_DIR
+APP_MAN_DIR
+ADMIN_MAN_SUFFIX
+DRIVER_MAN_SUFFIX
+MISC_MAN_SUFFIX
+FILE_MAN_SUFFIX
+LIB_MAN_SUFFIX
+APP_MAN_SUFFIX
+SED
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+INSTALL_CMD
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
+PKG_CONFIG
+CHANGELOG_CMD
+CWARNFLAGS
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_strict_compilation
+enable_silent_rules
+with_appdefaultdir
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR
+BMTOA_CFLAGS
+BMTOA_LIBS
+ATOBM_CFLAGS
+ATOBM_LIBS
+BITMAP_CFLAGS
+BITMAP_LIBS
+XBITMAP_CFLAGS
+XBITMAP_LIBS
+APPDEFS_CFLAGS
+APPDEFS_LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=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 ;;
+
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_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'`
+  as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+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
+    $as_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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 bitmap 1.0.4 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/bitmap]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_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 bitmap 1.0.4:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --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
+  --enable-strict-compilation
+                          Enable all warnings from compiler and make them
+                          errors (default: disabled)
+  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-appdefaultdir=<pathname>
+                          specify directory for app-defaults files (default is
+                          autodetected)
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  PKG_CONFIG  path to pkg-config utility
+  PKG_CONFIG_PATH
+              directories to add to pkg-config's search path
+  PKG_CONFIG_LIBDIR
+              path overriding pkg-config's built-in search path
+  BMTOA_CFLAGS
+              C compiler flags for BMTOA, overriding pkg-config
+  BMTOA_LIBS  linker flags for BMTOA, overriding pkg-config
+  ATOBM_CFLAGS
+              C compiler flags for ATOBM, overriding pkg-config
+  ATOBM_LIBS  linker flags for ATOBM, overriding pkg-config
+  BITMAP_CFLAGS
+              C compiler flags for BITMAP, overriding pkg-config
+  BITMAP_LIBS linker flags for BITMAP, overriding pkg-config
+  XBITMAP_CFLAGS
+              C compiler flags for XBITMAP, overriding pkg-config
+  XBITMAP_LIBS
+              linker flags for XBITMAP, overriding pkg-config
+  APPDEFS_CFLAGS
+              C compiler flags for APPDEFS, overriding pkg-config
+  APPDEFS_LIBS
+              linker flags for APPDEFS, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+bitmap configure 1.0.4
+generated by GNU Autoconf 2.67
+
+Copyright (C) 2010 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
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_decl
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* 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_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_func
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by bitmap $as_me 1.0.4, which was
+generated by GNU Autoconf 2.67.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append 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
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > 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
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5 ; }
+  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.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_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 $ac_precious_vars; 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,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_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
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_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.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+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.11'
+
+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
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$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'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;;
+esac
+
+# 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".
+      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "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 $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+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='bitmap'
+ VERSION='1.0.4'
+
+
+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"}
+
+# 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 -'
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-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
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$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
+
+
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+
+
+
+
+
+
+
+
+
+
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+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
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5 ; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM 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.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5 ; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5 ; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5 ; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5 ; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+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
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-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=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+  $as_echo_n "(cached) " >&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
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$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
+
+
+if test "x$CC" != xcc; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
+fi
+set dummy $CC; ac_cc=`$as_echo "$2" |
+                     sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } &&
+   test -f conftest2.$ac_objext && { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; };
+then
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  if test "x$CC" != xcc; then
+    # Test first that cc exists at all.
+    if { ac_try='cc -c conftest.$ac_ext >&5'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+      rm -f conftest2.*
+      if { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } &&
+        test -f conftest2.$ac_objext && { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; };
+      then
+       # cc works too.
+       :
+      else
+       # cc exists but doesn't like -o.
+       eval ac_cv_prog_cc_${ac_cc}_c_o=no
+      fi
+    fi
+  fi
+else
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
+
+fi
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+
+
+
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if test "${ac_cv_prog_cc_c99+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+       {
+       case 's': // string
+         str = va_arg (args_copy, const char *);
+         break;
+       case 'd': // int
+         number = va_arg (args_copy, int);
+         break;
+       case 'f': // float
+         fnumber = va_arg (args_copy, double);
+         break;
+       default:
+         break;
+       }
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+         || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5 ; }
+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
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+fi
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${ac_cv_path_SED+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  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_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+
+
+
+
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast -Wformat=2"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default"
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then :
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+
+
+
+# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
+
+
+
+# Check whether --enable-strict-compilation was given.
+if test "${enable_strict_compilation+set}" = set; then :
+  enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval
+else
+  STRICT_COMPILE=no
+fi
+
+if test "x$STRICT_COMPILE" = "xyes"; then
+       ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default"
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then :
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+       ac_fn_c_check_decl "$LINENO" "__INTEL_COMPILER" "ac_cv_have_decl___INTEL_COMPILER" "$ac_includes_default"
+if test "x$ac_cv_have_decl___INTEL_COMPILER" = x""yes; then :
+  INTELCC="yes"
+else
+  INTELCC="no"
+fi
+
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+
+
+
+
+macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
+INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+XORG_MAN_PAGE="X Version 11"
+
+MAN_SUBSTS="\
+       -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xservername__|Xorg|g' \
+       -e 's|__xconfigfile__|xorg.conf|g' \
+       -e 's|__projectroot__|\$(prefix)|g' \
+       -e 's|__apploaddir__|\$(appdefaultdir)|g' \
+       -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
+       -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
+       -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
+       -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
+       -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
+       -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
+
+
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=0;;
+esac
+AM_BACKSLASH='\'
+
+
+
+ac_fn_c_check_func "$LINENO" "mkstemp" "ac_cv_func_mkstemp"
+if test "x$ac_cv_func_mkstemp" = x""yes; then :
+
+$as_echo "#define HAS_MKSTEMP 1" >>confdefs.h
+
+fi
+
+
+# bmtoa checks for packages
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BMTOA" >&5
+$as_echo_n "checking for BMTOA... " >&6; }
+
+if test -n "$BMTOA_CFLAGS"; then
+    pkg_cv_BMTOA_CFLAGS="$BMTOA_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xmu\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "x11 xmu") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_BMTOA_CFLAGS=`$PKG_CONFIG --cflags "x11 xmu" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$BMTOA_LIBS"; then
+    pkg_cv_BMTOA_LIBS="$BMTOA_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xmu\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "x11 xmu") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_BMTOA_LIBS=`$PKG_CONFIG --libs "x11 xmu" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+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
+               BMTOA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "x11 xmu" 2>&1`
+        else
+               BMTOA_PKG_ERRORS=`$PKG_CONFIG --print-errors "x11 xmu" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$BMTOA_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (x11 xmu) were not met:
+
+$BMTOA_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 BMTOA_CFLAGS
+and BMTOA_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 BMTOA_CFLAGS
+and BMTOA_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5 ; }
+else
+       BMTOA_CFLAGS=$pkg_cv_BMTOA_CFLAGS
+       BMTOA_LIBS=$pkg_cv_BMTOA_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+
+
+# atobm checks for packages
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ATOBM" >&5
+$as_echo_n "checking for ATOBM... " >&6; }
+
+if test -n "$ATOBM_CFLAGS"; then
+    pkg_cv_ATOBM_CFLAGS="$ATOBM_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "x11") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_ATOBM_CFLAGS=`$PKG_CONFIG --cflags "x11" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$ATOBM_LIBS"; then
+    pkg_cv_ATOBM_LIBS="$ATOBM_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "x11") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_ATOBM_LIBS=`$PKG_CONFIG --libs "x11" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+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
+               ATOBM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "x11" 2>&1`
+        else
+               ATOBM_PKG_ERRORS=`$PKG_CONFIG --print-errors "x11" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$ATOBM_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (x11) were not met:
+
+$ATOBM_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 ATOBM_CFLAGS
+and ATOBM_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 ATOBM_CFLAGS
+and ATOBM_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5 ; }
+else
+       ATOBM_CFLAGS=$pkg_cv_ATOBM_CFLAGS
+       ATOBM_LIBS=$pkg_cv_ATOBM_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+
+
+# bitmap checks for packages
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BITMAP" >&5
+$as_echo_n "checking for BITMAP... " >&6; }
+
+if test -n "$BITMAP_CFLAGS"; then
+    pkg_cv_BITMAP_CFLAGS="$BITMAP_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xmu xaw7 xbitmaps\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xmu xaw7 xbitmaps") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_BITMAP_CFLAGS=`$PKG_CONFIG --cflags "xmu xaw7 xbitmaps" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$BITMAP_LIBS"; then
+    pkg_cv_BITMAP_LIBS="$BITMAP_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xmu xaw7 xbitmaps\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xmu xaw7 xbitmaps") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_BITMAP_LIBS=`$PKG_CONFIG --libs "xmu xaw7 xbitmaps" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+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
+               BITMAP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xmu xaw7 xbitmaps" 2>&1`
+        else
+               BITMAP_PKG_ERRORS=`$PKG_CONFIG --print-errors "xmu xaw7 xbitmaps" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$BITMAP_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (xmu xaw7 xbitmaps) were not met:
+
+$BITMAP_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 BITMAP_CFLAGS
+and BITMAP_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 BITMAP_CFLAGS
+and BITMAP_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5 ; }
+else
+       BITMAP_CFLAGS=$pkg_cv_BITMAP_CFLAGS
+       BITMAP_LIBS=$pkg_cv_BITMAP_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XBITMAP" >&5
+$as_echo_n "checking for XBITMAP... " >&6; }
+
+if test -n "$XBITMAP_CFLAGS"; then
+    pkg_cv_XBITMAP_CFLAGS="$XBITMAP_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xmu xaw7 xbitmaps\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xmu xaw7 xbitmaps") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XBITMAP_CFLAGS=`$PKG_CONFIG --cflags "xmu xaw7 xbitmaps" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XBITMAP_LIBS"; then
+    pkg_cv_XBITMAP_LIBS="$XBITMAP_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xmu xaw7 xbitmaps\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xmu xaw7 xbitmaps") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XBITMAP_LIBS=`$PKG_CONFIG --libs "xmu xaw7 xbitmaps" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+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
+               XBITMAP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xmu xaw7 xbitmaps" 2>&1`
+        else
+               XBITMAP_PKG_ERRORS=`$PKG_CONFIG --print-errors "xmu xaw7 xbitmaps" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XBITMAP_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (xmu xaw7 xbitmaps) were not met:
+
+$XBITMAP_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 XBITMAP_CFLAGS
+and XBITMAP_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 XBITMAP_CFLAGS
+and XBITMAP_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5 ; }
+else
+       XBITMAP_CFLAGS=$pkg_cv_XBITMAP_CFLAGS
+       XBITMAP_LIBS=$pkg_cv_XBITMAP_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+BITMAP_CFLAGS="$BITMAP_CFLAGS $XBITMAPS_CFLAGS"
+BITMAP_LIBS="$BITMAP_LIBS $XBITMAPS_LIBS"
+
+
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for APPDEFS" >&5
+$as_echo_n "checking for APPDEFS... " >&6; }
+
+if test -n "$APPDEFS_CFLAGS"; then
+    pkg_cv_APPDEFS_CFLAGS="$APPDEFS_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xt\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_APPDEFS_CFLAGS=`$PKG_CONFIG --cflags "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$APPDEFS_LIBS"; then
+    pkg_cv_APPDEFS_LIBS="$APPDEFS_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xt\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_APPDEFS_LIBS=`$PKG_CONFIG --libs "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+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
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xt" 2>&1`
+        else
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --print-errors "xt" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$APPDEFS_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (xt) were not met:
+
+$APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5 ; }
+else
+       APPDEFS_CFLAGS=$pkg_cv_APPDEFS_CFLAGS
+       APPDEFS_LIBS=$pkg_cv_APPDEFS_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+
+# Check whether --with-appdefaultdir was given.
+if test "${with_appdefaultdir+set}" = set; then :
+  withval=$with_appdefaultdir; appdefaultdir="$withval"
+else
+  appdefaultdir="${xt_appdefaultdir}"
+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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     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" &&
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $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}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by bitmap $as_me 1.0.4, which was
+generated by GNU Autoconf 2.67.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+bitmap config.status 1.0.4
+configured by $0, generated by GNU Autoconf 2.67,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+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=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  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 || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
+  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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries 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[        ]*=[    ]*/{
+h
+s///
+s/^/:/
+s/[     ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[  ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[      ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #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.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # 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.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5  ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$_am_arg" : 'X\(//\)[^/]' \| \
+        X"$_am_arg" : 'X\(//\)$' \| \
+        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_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=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# 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 || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/bitmap/configure.ac b/bitmap/configure.ac
new file mode 100644 (file)
index 0000000..d2421b8
--- /dev/null
@@ -0,0 +1,72 @@
+
+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(bitmap,[1.0.4], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],bitmap)
+AM_INIT_AUTOMAKE([dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+
+AM_CONFIG_HEADER(config.h)
+
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_INSTALL
+
+XORG_DEFAULT_OPTIONS
+
+AC_CHECK_FUNC([mkstemp], 
+   AC_DEFINE(HAS_MKSTEMP,1,[Define to 1 if you have the "mkstemp" function.]))
+
+# bmtoa checks for packages
+PKG_CHECK_MODULES(BMTOA, x11 xmu)
+AC_SUBST(BMTOA_CFLAGS)
+AC_SUBST(BMTOA_LIBS)
+
+# atobm checks for packages
+PKG_CHECK_MODULES(ATOBM, x11)
+AC_SUBST(ATOBM_CFLAGS)
+AC_SUBST(ATOBM_LIBS)
+
+# bitmap checks for packages
+PKG_CHECK_MODULES(BITMAP, xmu xaw7 xbitmaps)
+PKG_CHECK_MODULES(XBITMAP, xmu xaw7 xbitmaps)
+
+BITMAP_CFLAGS="$BITMAP_CFLAGS $XBITMAPS_CFLAGS"
+BITMAP_LIBS="$BITMAP_LIBS $XBITMAPS_LIBS"
+
+AC_SUBST(BITMAP_CFLAGS)
+AC_SUBST(BITMAP_LIBS)
+
+PKG_CHECK_MODULES(APPDEFS, xt)
+xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+AC_ARG_WITH(appdefaultdir,
+       AC_HELP_STRING([--with-appdefaultdir=<pathname>],
+         [specify directory for app-defaults files (default is autodetected)]),
+       [appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"])
+AC_SUBST(appdefaultdir)
+
+AC_OUTPUT([Makefile])
diff --git a/bitmap/depcomp b/bitmap/depcomp
new file mode 100755 (executable)
index 0000000..df8eea7
--- /dev/null
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s,\\\\\\\\,/,g"
+   depmode=msvisualcpp
+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.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    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.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[     ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "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"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${
+              s/^ *//
+              s/ \\*$//
+              s/$/:/
+              p
+            }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # 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 mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $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 "X$1" != 'X--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 "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    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.
+    -arch)
+      eat=yes ;;
+    -*|$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 "X$1" != 'X--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.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::     \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # 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
+  ;;
+
+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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/bitmap/install-sh b/bitmap/install-sh
new file mode 100755 (executable)
index 0000000..6781b98
--- /dev/null
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# 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.
+
+nl='
+'
+IFS=" ""       $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+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:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+       shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+       case $mode in
+         *' '* | *'    '* | *'
+'*       | *'*'* | *'?'* | *'['*)
+           echo "$0: invalid mode: $mode" >&2
+           exit 1;;
+       esac
+       shift;;
+
+    -o) chowncmd="$chownprog $2"
+       shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+       shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)        shift
+       break;;
+
+    -*)        echo "$0: invalid option: $1" >&2
+       exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # 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: $dst_arg: Is a directory" >&2
+       exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+       (dirname "$dst") 2>/dev/null ||
+       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+            X"$dst" : 'X\(//\)[^/]' \| \
+            X"$dst" : 'X\(//\)$' \| \
+            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+       echo X"$dst" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+       # Create intermediate dirs using mode 755 as modified by the umask.
+       # This is like FreeBSD 'install' as of 1997-10-28.
+       umask=`umask`
+       case $stripcmd.$umask in
+         # Optimize common cases.
+         *[2367][2367]) mkdir_umask=$umask;;
+         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+         *[0-7])
+           mkdir_umask=`expr $umask + 22 \
+             - $umask % 100 % 40 + $umask % 20 \
+             - $umask % 10 % 4 + $umask % 2
+           `;;
+         *) mkdir_umask=$umask,go-w;;
+       esac
+
+       # With -d, create the new directory with the user-specified mode.
+       # Otherwise, rely on $mkdir_umask.
+       if test -n "$dir_arg"; then
+         mkdir_mode=-m$mode
+       else
+         mkdir_mode=
+       fi
+
+       posix_mkdir=false
+       case $umask in
+         *[123567][0-7][0-7])
+           # POSIX mkdir -p sets u+wx bits regardless of umask, which
+           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+           ;;
+         *)
+           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+           if (umask $mkdir_umask &&
+               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+           then
+             if test -z "$dir_arg" || {
+                  # Check for POSIX incompatibilities with -m.
+                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                  # other-writeable bit of parent directory when it shouldn't.
+                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                  case $ls_ld_tmpdir in
+                    d????-?r-*) different_mode=700;;
+                    d????-?--*) different_mode=755;;
+                    *) false;;
+                  esac &&
+                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                  }
+                }
+             then posix_mkdir=:
+             fi
+             rmdir "$tmpdir/d" "$tmpdir"
+           else
+             # Remove any dirs left behind by ancient mkdir implementations.
+             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+           fi
+           trap '' 0;;
+       esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+       umask $mkdir_umask &&
+       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+       /*) prefix='/';;
+       -*) prefix='./';;
+       *)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+       test -z "$d" && continue
+
+       prefix=$prefix$d
+       if test -d "$prefix"; then
+         prefixes=
+       else
+         if $posix_mkdir; then
+           (umask=$mkdir_umask &&
+            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+           # Don't fail if two instances are running concurrently.
+           test -d "$prefix" || exit 1
+         else
+           case $prefix in
+             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+             *) qprefix=$prefix;;
+           esac
+           prefixes="$prefixes '$qprefix'"
+         fi
+       fi
+       prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+       # Don't fail if two instances are running concurrently.
+       (umask $mkdir_umask &&
+        eval "\$doit_exec \$mkdirprog $prefixes") ||
+         test -d "$dstdir" || exit 1
+       obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # 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
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"    2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+       # Now remove or move aside any old file at destination location.
+       # We try this two ways since rm can't unlink itself on some
+       # systems and the destination file might be busy for other
+       # reasons.  In this case, the final cleanup might fail but the new
+       # file should still install successfully.
+       {
+         test ! -f "$dst" ||
+         $doit $rmcmd -f "$dst" 2>/dev/null ||
+         { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+           { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+         } ||
+         { echo "$0: cannot unlink or rename $dst" >&2
+           (exit 1); exit 1
+         }
+       } &&
+
+       # Now rename the file to the real destination.
+       $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/bitmap/missing b/bitmap/missing
new file mode 100755 (executable)
index 0000000..28055d2
--- /dev/null
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# 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=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+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'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  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]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
+# 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).  This is about non-GNU programs, so use $1 not
+# $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 $program 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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if test ! -f y.tab.h; then
+       echo >y.tab.h
+    fi
+    if test ! -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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if test ! -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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit $?
+    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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+       /^@setfilename/{
+         s/.* \([^ ]*\) *$/\1/
+         p
+         q
+       }' $infile`
+      # ... 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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/debian/README.source b/debian/README.source
new file mode 100644 (file)
index 0000000..34ab4bf
--- /dev/null
@@ -0,0 +1,73 @@
+------------------------------------------------------
+Quick Guide To Patching This Package For The Impatient
+------------------------------------------------------
+
+1. Make sure you have quilt installed
+2. Unpack the package as usual with "dpkg-source -x"
+3. Run the "patch" target in debian/rules
+4. Create a new patch with "quilt new" (see quilt(1))
+5. Edit all the files you want to include in the patch with "quilt edit" 
+   (see quilt(1)).
+6. Write the patch with "quilt refresh" (see quilt(1))
+7. Run the "clean" target in debian/rules
+
+Alternatively, instead of using quilt directly, you can drop the patch in to 
+debian/patches and add the name of the patch to debian/patches/series.
+
+------------------------------------
+Guide To The X Strike Force Packages
+------------------------------------
+
+The X Strike Force team maintains X packages in git repositories on
+git.debian.org in the pkg-xorg subdirectory. Most upstream packages
+are actually maintained in git repositories as well, so they often
+just need to be pulled into git.debian.org in a "upstream-*" branch.
+Otherwise, the upstream sources are manually installed in the Debian
+git repository.
+
+The .orig.tar.gz upstream source file could be generated this
+"upstream-*" branch in the Debian git repository but it is actually
+copied from upstream tarballs directly.
+
+Due to X.org being highly modular, packaging all X.org applications
+as their own independent packages would have created too many Debian
+packages. For this reason, some X.org applications have been grouped
+into larger packages: xutils, xutils-dev, x11-apps, x11-session-utils,
+x11-utils, x11-xfs-utils, x11-xkb-utils, x11-xserver-utils.
+Most packages, including the X.org server itself and all libraries
+and drivers are, however maintained independently.
+
+The Debian packaging is added by creating the "debian-*" git branch
+which contains the aforementioned "upstream-*" branch plus the debian/
+repository files.
+When a patch has to be applied to the Debian package, two solutions
+are involved:
+* If the patch is available in one of the upstream branches, it
+  may be git'cherry-picked into the Debian repository. In this
+  case, it appears directly in the .diff.gz.
+* Otherwise, the patch is added to debian/patches/ which is managed
+  with quilt as documented in /usr/share/doc/quilt/README.source.
+
+quilt is actually invoked by the Debian X packaging through a larger
+set of scripts called XSFBS. XSFBS brings some other X specific
+features such as managing dependencies and conflicts due to the video
+and input driver ABIs.
+XSFBS itself is maintained in a separate repository at
+  git://git.debian.org/pkg-xorg/xsfbs.git
+and it is pulled inside the other Debian X repositories when needed.
+
+The XSFBS patching system requires a build dependency on quilt. Also
+a dependency on $(STAMP_DIR)/patch has to be added to debian/rules
+so that the XSFBS patching occurs before the actual build. So the
+very first target of the build (likely the one running autoreconf)
+should depend on $(STAMP_DIR)/patch. It should also not depend on
+anything so that parallel builds are correctly supported (nothing
+should probably run while patching is being done). And finally, the
+clean target should depend on the xsfclean target so that patches
+are unapplied on clean.
+
+When the upstream sources contain some DFSG-nonfree files, they are
+listed in text files in debian/prune/ in the "debian-*" branch of
+the Debian repository. XSFBS' scripts then take care of removing
+these listed files during the build so as to generate a modified
+DFSG-free .orig.tar.gz tarball.
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..fb23e7c
--- /dev/null
@@ -0,0 +1,524 @@
+x11-apps (7.5-2slp2+6) unstable; urgency=low
+
+  * [x11-apps] Fix xbitmap, xcalc and xclock for gcc 4.5
+  * Git: 165.213.180.234:slp/pkgs/xorg/app/x11-apps
+  * Tag: x11-apps_7.5-2slp2+6
+
+ -- Sung-Jin Park <sj76.park@samsung.com>  Tue, 29 Mar 2011 15:28:20 +0900
+
+x11-apps (7.5-2slp2+5) unstable; urgency=low
+
+  * [xwd] block the check of multivis
+  * Git: 165.213.180.234:slp/pkgs/xorg/app/x11-apps
+  * Tag: x11-apps_7.5-2slp2+5
+
+ -- SooChan Lim <sc1.lim@samsung.com>  Mon, 07 Mar 2011 15:10:39 +0900
+
+x11-apps (7.5-1slp2+5) unstable; urgency=low
+
+  * [X11R7.6] upgrade package 
+  * Git: 165.213.180.234:slp/pkgs/xorg/app/x11-apps
+  * Tag: x11-apps_7.5-1slp2+5
+
+ -- SooChan Lim <sc1.lim@samsung.com>  Tue, 11 Jan 2011 14:44:46 +0900
+
+x11-apps (7.5+5) unstable; urgency=low
+
+  [ Julien Cristau ]
+  * Autoreconf xedit with the patch from 7.5+3 applied.
+    Really closes: #569430.
+
+  [ Brice Goglin ]
+  * Add missing file renames to 01_xedit_mkdir_races.diff.
+  * Bump Standards-Version to 3.8.4, no changes.
+
+ -- Brice Goglin <bgoglin@debian.org>  Sun, 21 Mar 2010 10:18:52 +0100
+
+x11-apps (7.5+4) unstable; urgency=low
+
+  [ Steve Langasek ]
+  * Since we have xedit again, drop the conffile removal handling from the
+    maintainer scripts.  LP: #518045.
+
+ -- Julien Cristau <jcristau@debian.org>  Sat, 13 Mar 2010 00:25:15 +0100
+
+x11-apps (7.5+3) unstable; urgency=low
+
+  * Add 01_xedit_mkdir_races.diff to fix FTBFS, closes: #569430.
+
+ -- Brice Goglin <bgoglin@debian.org>  Tue, 23 Feb 2010 21:51:06 +0100
+
+x11-apps (7.5+2) unstable; urgency=low
+
+  [ Brice Goglin ]
+  * Update debian/copyright and package description according
+    to ico and xedit additions.
+  * x11pref 1.5.1.
+  * xbiff 1.0.2.
+  * xcalc 1.0.3.
+  * xeyes 1.1.0.
+  * xlogo 1.0.2.
+
+  [ Julien Cristau ]
+  * Rename the build directory to not include DEB_BUILD_GNU_TYPE for no
+    good reason.  Thanks, Colin Watson!
+  * Remove myself from Uploaders
+
+ -- Brice Goglin <bgoglin@debian.org>  Sun, 07 Feb 2010 11:22:59 +0100
+
+x11-apps (7.5+1) unstable; urgency=low
+
+  [ Julien Cristau ]
+  * Update xload config.{guess,sub}, adding avr32 support (closes: #536410)
+  * Improve the long description using patch from Justin B Rye (closes:
+    #549457).  Thanks!
+
+  [ Brice Goglin ]
+  * Add ico 1.0.2, closes: #518383.
+  * bitmap 1.0.4.
+  * xclipboard 1.1.0.
+    + Add UTF8 support, closes: #489998.
+  * xclock 1.0.4.
+    + Drop 06_xclock_geometry.diff, applied upstream.
+  * xcursorgen 1.0.3.
+  * xeyes 1.0.991.
+  * xgc 1.0.2.
+  * xmag 1.0.3.
+  * xman 1.1.0.
+  * xwd 1.0.3.
+    + Drop 01_xwd_do_not_spew_usage_on_connection_error.diff, applied upstream.
+  * xwud 1.0.2.
+  * Refresh patches.
+
+ -- Brice Goglin <bgoglin@debian.org>  Sun, 06 Dec 2009 12:23:46 +0100
+
+x11-apps (7.4-2slp2+2) unstable; urgency=low
+
+  * Fix Git information and modify maintainer infomation
+  * Git: 165.213.180.234:/git/slp/pkgs/xorg/app/x11-apps
+  * Tag: x11-apps_7.4-2slp2+2
+
+ -- Sung-Jin Park <sj76.park@samsung.com>  Thu, 02 Dec 2010 10:35:26 +0900
+
+x11-apps (7.4-2slp2+1) unstable; urgency=low
+
+  * Fix xwd.c (Do not get multivisual) by request from soolim
+  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11
+  * Tag: x11-apps_7.4-2slp2+1
+
+ -- Sung-Jin Park <sj76.park@samsung.com>  Fri, 14 May 2010 11:08:32 +0900
+
+x11-apps (7.4-2slp2) unstable; urgency=low
+
+  * Update maintainer
+  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/X11
+  * Tag: x11-apps_7.4-2slp2
+
+ -- Sung-Jin Park <sj76.park@samsung.com>  Wed, 21 Apr 2010 10:16:58 +0900
+
+x11-apps (7.4-1slp2) unstable; urgency=low
+
+  * Change revision
+
+ -- Sung-Jin Park <sj76.park@samsung.com>  Thu, 25 Mar 2010 17:30:00 +0900
+
+x11-apps (7.4+4) unstable; urgency=low
+
+  * Fix debian/control to replace xmodmap and xsetroot
+
+ -- Sung-Jin Park <sj76.park@samsung.com>  Tue, 08 Dec 2009 19:58:50 +0900
+
+x11-apps (7.4+3) unstable; urgency=low
+
+  * Import debian package
+
+ -- Sung-Jin Park <sj76.park@samsung.com>  Tue, 08 Dec 2009 18:51:07 +0900
+
+x11-apps (7.4+2) unstable; urgency=low
+
+  * Add xedit 1.1.2, closes: #499085, #505064.
+  * Bump Standards-Version to 3.8.2, no changes.
+
+ -- Brice Goglin <bgoglin@debian.org>  Mon, 27 Jul 2009 18:55:03 +0200
+
+x11-apps (7.4+1) unstable; urgency=low
+
+  [ Brice Goglin ]
+  * xwd 1.0.2.
+
+  [ Julien Cristau ]
+  * Add support for parallel=n in DEB_BUILD_OPTIONS, and for actually building
+    the apps in parallel.  Install is still sequential, at least for now.
+  * xload 1.0.2
+    + drop patch 04_SECURITY_setuid.diff, included upstream.
+  * Add README.source, bump Standards-Version to 3.8.1.
+  * Fix patches to apply with -p1; silences lintian.
+
+ -- Julien Cristau <jcristau@debian.org>  Wed, 10 Jun 2009 15:30:56 +0200
+
+x11-apps (7.3+4) unstable; urgency=low
+
+  * Remove xedit from the package, it's unmaintained and broken
+    (closes: #321434).
+  * Remove xedit's conffiles on upgrade.
+
+ -- Julien Cristau <jcristau@debian.org>  Tue, 23 Sep 2008 00:24:45 +0200
+
+x11-apps (7.3+3) unstable; urgency=low
+
+  * xclock: Fix geometry computation (closes: #443227).
+  * debian/rules, xsfbs: fix rules dependencies.
+
+ -- Julien Cristau <jcristau@debian.org>  Sat, 02 Aug 2008 18:45:33 +0200
+
+x11-apps (7.3+2) unstable; urgency=low
+
+  [ Julien Cristau ]
+  * Re-add bitmap (closes: #445097).
+  * x11perf 1.5
+  * drop -1 debian revisions from build-deps
+  * bump Standards-Version to 3.7.3
+  * don't call dh_makeshlibs
+  * drop XS- prefix from Vcs-* control fields
+
+  [ Brice Goglin ]
+  * Re-add xgc (closes: #460453).
+
+ -- Julien Cristau <jcristau@debian.org>  Tue, 10 Jun 2008 16:35:24 +0200
+
+x11-apps (7.3+1) unstable; urgency=low
+
+  [ Julien Cristau ]
+  * xclock 1.0.3.
+    + adds documentation for the -face command-line option (closes: #224402)
+  * xman 1.0.3.
+  * xmag 1.0.2.
+    + manpage fixed (closes: #180712).
+  * Pass --with-sysmanpath option to configure so xman looks for manpages in
+    the right place (closes: #156497).
+
+  [ Brice Goglin ]
+  * Add upstream URL to debian/copyright.
+  * Add menu entries for oclock, xbiff, xcalc, xclipboard, xclock, xconsole,
+    xditview, xeyes, xedit, xload, xlogo, xmag, xman and xwd.
+  * xcalc 1.0.2.
+  * xconsole 1.0.3.
+  * xcursorgen 1.0.2.
+  * Add myself to Uploaders, and remove Branden with his permission.
+
+ -- Brice Goglin <bgoglin@debian.org>  Fri, 14 Sep 2007 23:14:57 +0200
+
+x11-apps (0.1) experimental; urgency=low
+
+  [ Timo Aaltonen ]
+  * Split xbase-clients, new versioning.
+  * Included packages:
+    - oclock 1.0.1
+    - x11perf 1.4.1
+    - xbiff 1.0.1
+    - xcalc 1.0.1
+    - xclipboard 1.0.1
+    - xclock 1.0.2
+    - xconsole 1.0.2
+    - xcursorgen 1.0.1
+    - xditview 1.0.1
+    - xedit 1.0.2
+    - xeyes 1.0.1
+    - xload 1.0.1
+    - xlogo 1.0.1
+    - xmag 1.0.1
+    - xman 1.0.2
+    - xmore 1.0.1
+    - xwd 1.0.1
+    - xwud 1.0.1
+  * debian/control:
+    - Rename Package and Source.
+    - Remove unnecessary Build-Deps.
+    - Split the Build-Dep line into multiple lines
+    - Clean up the description.
+    - Replaces: xbase-clients (<= 1:7.2.ds2-3) to make upgrades smoother.
+    - C/R: <all the included packages> to work around old Ubuntu
+      packaging.
+  * debian/copyright: Leave only copyright notices that affect this package.
+  * debian/x11-apps.dirs: Remove.
+  * debian/x11-apps.install, rules: Edit to reflect new packaging.
+  * debian/local/: Remove.
+  * debian/patches:
+    - Delete patches which do not concern this package.
+    - Edit 01_xwd_do_not_spew_usage_on_connection_error.diff to patch only
+      xwd.
+
+ -- Julien Cristau <jcristau@debian.org>  Sun, 27 May 2007 19:30:49 +0200
+
+xbase-clients (1:7.2.ds2-3) unstable; urgency=low
+
+  * Add patch to xsm's configure.ac to not override the user-provided RSH
+    variable, so we can drop the openssh build-dep (closes: #362787).
+
+ -- Julien Cristau <jcristau@debian.org>  Wed, 09 May 2007 16:26:06 +0200
+
+xbase-clients (1:7.2.ds2-2) unstable; urgency=low
+
+  [ Julien Cristau ]
+  * Autoreconf with patches applied.
+  * Add build-dep on libxinerama-dev, so xdpyinfo is built with support for
+    the xinerama extension.
+  * Add patch 17_xmodmap_manpage.diff to make xmodmap(1) refer to
+    /usr/share/X11/XKeysymDB instead of /usr/lib/X11/XKeysymDB
+    (closes: #394077).  Thanks, Joachim Breitner!
+  * Document each app's build-dependencies in debian/control for reference.
+  * Update long description: XKB configuration data is in xkb-data, bitmap
+    images in xbitmaps.
+  * Add XS-Vcs-* in debian/control.
+  * Upload to unstable.
+
+  [ Brice Goglin ]
+  * Restore Depends: on cpp (got lost during modularization)
+    since xrdb needs it to process .Xdefaults.
+    Thanks Marcus C. Gottwald (closes: #413298).
+  * Remove mention of xf86cfg in package description.
+    Thanks Daniel Leidert (really closes: #362066).
+
+ -- Julien Cristau <jcristau@debian.org>  Fri, 20 Apr 2007 22:00:14 +0200
+
+xbase-clients (1:7.2.ds2-1) experimental; urgency=low
+
+  * Update to xrandr 1.2.0.
+  * Build-dep on libxrandr 1.2.0.
+  * New patch to install beforelight's app-defaults file correctly.
+
+ -- Julien Cristau <jcristau@debian.org>  Mon, 19 Feb 2007 10:46:11 +0100
+
+xbase-clients (1:7.2.ds1-2) experimental; urgency=low
+
+  * Build-dep on libpng12-dev instead of libpng-dev.  xcursorgen requires
+    libpng12.pc, which is not available in libpng14-dev, despite it providing
+    libpng-dev and libpng12-dev, *sigh*.
+
+ -- Julien Cristau <jcristau@debian.org>  Mon, 12 Feb 2007 05:35:18 +0100
+
+xbase-clients (1:7.2.ds1-1) experimental; urgency=low
+
+  * Patch setxkbmap(1) to refer to the correct location for xkb files, thanks
+    to Celejar <celejar@gmail.com> for noticing.
+  * Update to appres 1.0.1.
+  * Update to beforelight 1.0.2.
+  * Update to bitmap 1.0.3.
+  * Update to editres 1.0.3.
+  * Update to setxkbmap 1.0.3.
+  * Update to xauth 1.0.2.
+  * Update to xdbedizzy 1.0.2.
+    + patch 16_xdbedizzy_fix_crash.diff dropped, included upstream.
+    + patch pkgconfig_naughtiness dropped, now unnecessary.
+  * Update to xedit 1.0.2.
+  * Update to xev 1.0.2.
+  * Update to xf86dga 1.0.2.
+    + relevant part dropped from 14_SECURITY_setuid.diff.
+  * Update to xfontsel 1.0.2.
+  * Update to xinit 1.0.3.
+    + relevant part dropped from 14_SECURITY_setuid.diff.
+  * Update to xkbcomp 1.0.3.
+  * Update to xlsfonts 1.0.2.
+  * Update to xmodmap 1.0.2.
+  * Update to xprop 1.0.2.
+  * Update to xrdb 1.0.3.
+  * Update to xsetpointer 1.0.1.
+    + Add build-dep on x11proto-input-dev >= 1.4.
+  * Update to xtrap 1.0.2.
+  * Modify patch 08_xlsfonts_do_not_spew_usage_on_connection_error.diff to
+    apply to xprop, xwd and xwininfo as well, since they all use a copy of
+    dsimple.c.
+  * Change my email address in debian/control.
+
+ -- Julien Cristau <jcristau@debian.org>  Sun, 11 Feb 2007 15:42:54 +0100
+
+xbase-clients (1:7.1.ds1-2) unstable; urgency=low
+
+  * Add patch by Eugene Konev to fix xdbedizzy crash (closes: #365291).
+
+ -- Julien Cristau <julien.cristau@ens-lyon.org>  Fri, 12 Jan 2007 17:54:07 +0100
+
+xbase-clients (1:7.1.ds1-1) unstable; urgency=low
+
+  * Add patch by Eugene Konev to fix xmore crash (closes: #365292).
+  * Remove version string from subdirectory names, thus new tarball, and
+    update patches to match.
+  * Define MANCONF when configuring xman, to make it look for man pages in the
+    right path instead of in /usr/man (closes: 404757).
+  * Remove Fabio from Uploaders with his permission, and add myself.
+
+ -- Julien Cristau <julien.cristau@ens-lyon.org>  Mon,  8 Jan 2007 00:50:31 +0100
+
+xbase-clients (1:7.1.ds-3) unstable; urgency=low
+
+  [ Branden Robinson ]
+  * Patch xprop to stop segfaulting when deleted atoms are requested.
+    Committed upstream as git 47514347db811d002e7f3ca05d390565bc3ee5e5.
+    (Closes: #197526)
+
+  [ Denis Barbier ]
+  * Acknowledge NMU, thanks dann frazier. (closes: #363198)
+  * The rsh program is required to build xsm.  Replace Build-Depends: ssh | rsh
+    by Build-Depends: openssh-client | ssh
+  * Fix debian/rules so that xkbcomp look for XKB files in /usr/share/X11/xkb.
+    Thanks Steinar H. Gunderson  (closes: #381884)
+    All XKB related programs share now the same build system, so factor
+    commands in debian/rules.
+
+ -- Denis Barbier <barbier@debian.org>  Sat, 12 Aug 2006 15:08:47 +0200
+
+xbase-clients (1:7.1.ds-2.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix implicit pointer conversion in xconsole.c (closes: #363198)
+    (Was fixed in 1:7.1.ds-1.1 NMU, but silently dropped in 1:7.1.ds-2 MU)
+
+ -- dann frazier <dannf@debian.org>  Sat, 29 Jul 2006 13:59:40 -0600
+
+xbase-clients (1:7.1.ds-2) unstable; urgency=high
+
+  * Security update. Fix for setuid privledge escalation vulernabilities in
+    xinit, xf86dga, and xload. See
+    http://lists.freedesktop.org/archives/xorg/2006-June/016146.html for the
+    full advisory. This package applies the patches for the 7.0 release of
+    those apps.
+
+ -- David Nusinow <dnusinow@debian.org>  Fri, 30 Jun 2006 01:10:17 -0400
+
+xbase-clients (1:7.1.ds-1) unstable; urgency=low
+
+  [ Steve Langasek ]
+  * Drop broken build-dependency on xprint-utils, no thanks to anonymous
+    someone.
+  * Pass --disable-xprint to invocations of configure instead, which is
+    the real fix for the symptoms described:  we want the xbase-clients
+    package to consistently build *without* xprint support, instead of
+    autodetecting (and possibly failing) based on whether libxp-dev is
+    installed.  Properly closes: #366275.
+  * Also call PKG_PROG_PKG_CONFIG explicitly from xdbebizzy's
+    configure.ac, since otherwise --disable-xprint leaves us without
+    PKG_CONFIG defined.
+
+  [ David Nusinow ]
+  * This update should include all the apps released with X11R7.1. Version the
+    package to match this.
+  * Update bitmap to 1.0.2
+  * Update xcursorgen to 1.0.1
+  * Autoreconf everything in order to ensure that manpages have the proper
+    section
+  * Update 11_xkb_documentation_updates.diff to not use __manpagesuffix__
+    imakeism
+  * Bump standards version to 3.7.2.0
+  * Bump debhelper compat to 5
+
+ -- David Nusinow <dnusinow@debian.org>  Sun, 11 Jun 2006 21:51:54 -0400
+
+xbase-clients (1:7.0.1-2) unstable; urgency=low
+
+  * Add xprint-utils to build-depends. Thanks anonymous someone.
+    (closes: #366275)
+
+ -- David Nusinow <dnusinow@debian.org>  Sun, 14 May 2006 22:57:13 -0400
+
+xbase-clients (1:7.0.1-1) unstable; urgency=low
+
+  * Move xserverrc back to this package from xserver-xorg-core. Thanks
+    Benjamin Mesing. (closes: #365022)
+  * Update smproxy to version 1.0.2
+  * Update xhost to version 1.0.1
+  * Update fstobdf to version 1.0.2
+  * Update xdriinfo to version 1.0.1
+  * Update xinit to version 1.0.2
+    * Remove obsolete patch 03_startx_dummy.diff
+  * Update xkbevd to version 1.0.2
+  * Update xman to version 1.0.2
+  * Update xrefresh to version 1.0.2
+  * Update xwininfo to version 1.0.2
+  * Update xclock to version 1.0.2
+  * Update xconsole to version 1.0.2
+  * Update xkbcomp to version 1.0.2
+  * Update xmodmap to version 1.0.1
+  * Update xrandr to version 1.0.2
+  * Update xrdb to version 1.0.2
+  * Update xset to version 1.0.2
+
+ -- David Nusinow <dnusinow@debian.org>  Tue,  2 May 2006 22:58:57 -0400
+
+xbase-clients (1:7.0.0-5) unstable; urgency=low
+
+  * Patch startx so that it points to /etc/X11/xinit for xserverrc and
+    xinitrc. Thanks Vasilis Vasaitis and Bastian Kleineidam.
+  * Move xserverrc back to /etc/X11/xinit
+  * Use --list-missing with dh_install
+
+ -- David Nusinow <dnusinow@debian.org>  Tue, 25 Apr 2006 21:37:22 -0400
+
+xbase-clients (1:7.0.0-4) unstable; urgency=low
+
+  * Add quilt to build-depends.
+
+ -- David Nusinow <dnusinow@debian.org>  Sat, 15 Apr 2006 19:49:02 -0400
+
+xbase-clients (1:7.0.0-3) unstable; urgency=low
+
+  * Remove mention of xorgconfig and xorgcfg in package description. Thanks
+    Daniel Leidert. (closes: #362066)
+  * Add 12_startx_paths.diff to use X11R7 paths for startx and xinit. Thanks
+    Arjan Opmeer. (closes: #357713)
+  * Add libxi-dev to build-depends
+  * Make xbase-clients explicitly pre-depend on x11-common >= 1:7.0.0, rather
+    than implicitly. Thanks Vasilis Vasaitis. (closes: #357713)
+
+ -- David Nusinow <dnusinow@debian.org>  Thu, 13 Apr 2006 22:39:46 -0400
+
+xbase-clients (1:7.0.0-2) unstable; urgency=low
+
+  * Upload to unstable
+  * Add build-depends on libgl1-mesa-dev, versioned build-depneds on
+    libdrender-dev, and re-version build-depend on libxft-dev. Thanks Frank
+    Lichtenheld. (closes: #361821)
+
+ -- David Nusinow <dnusinow@debian.org>  Mon, 10 Apr 2006 19:49:23 -0400
+
+xbase-clients (1:7.0.0-1) experimental; urgency=low
+
+  [ Denis Barbier ]
+  * Set XKB base path to /usr/share/X11/xkb.
+
+  [ David Nusinow ]
+  * Update to x11perf 1.4.1 and setxkbmap 1.0.2 upstream releases
+  * Bump version number to match upstream's current katamari release
+
+ -- David Nusinow <dnusinow@debian.org>  Thu, 16 Mar 2006 23:06:15 -0500
+
+xbase-clients (1:1.0.1-2) experimental; urgency=low
+
+  * Add an empty /var/lib/xkb directory so that the server loads the correct
+    keymaps. Thanks Silvestre Zabala, Eugene Konev, and Daniel Stone.
+    (closes: #354130)
+  * Port patches from trunk
+    + general/014_startx_hostname_fix.diff
+    + general/015_startx_dummy_fix.diff
+    + general/073_xev_flush_standard_output.diff
+    + general/025c_bitmap_manpage_typo.diff
+    + general/025d_xedit_manpage_typos.diff
+    + general/025e_xvinfo_manpage_typo.diff
+    + general/099r_xlsfonts_do_not_spew_usage_on_connection_error.diff
+    + debian/902_debian_startx_manpage.diff
+    + debian/916_add_XKBPATH_env_variable.diff
+    + general/051_xkb_documentation_updates.diff
+  * Suggest mesa-utils, where glxinfo and glxgears have been moved.
+    Thanks Mike Hommey. (closes: #354246)
+
+ -- David Nusinow <dnusinow@debian.org>  Sat,  4 Mar 2006 18:59:20 -0500
+
+xbase-clients (1:1.0.1-1) experimental; urgency=low
+
+  [ David Nusinow ]
+  * First modular upload to Debian
+
+  [ Eugene Konev ]
+  * Divide packages that we process in debian/rules by category so we can pass
+    the xkb packages the proper configure flags
+
+ -- David Nusinow <dnusinow@debian.org>  Sun, 19 Feb 2006 19:46:46 -0500
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..c9f2074
--- /dev/null
@@ -0,0 +1,69 @@
+Source: x11-apps
+Section: x11
+Priority: optional
+Maintainer: Sung-Jin Park <sj76.park@samsung.com>, Sangjin Lee <lsj119@samsung.com>, Debian X Strike Force <debian-x@lists.debian.org>
+Uploaders: SooChan Lim <sc1.lim@samsung.com>, Sung-Jin Park <sj76.park@samsung.com>, David Nusinow <dnusinow@debian.org>, Brice Goglin <bgoglin@debian.org>
+Build-Depends: debhelper (>= 5.0.0), pkg-config, libpng12-dev, libx11-dev (>= 2:1.0.0), libxaw7-dev (>= 1:1.0.1), libxcursor-dev (>= 1.1.5.2), libxext-dev (>= 1:1.0.0), libxft-dev (>= 2.1.8.2-6), libxkbfile-dev (>= 1:1.0.1), libxmuu-dev (>= 1:1.0.1), libxrender-dev (>= 1:0.9.0.2-2), libxt-dev (>= 1:1.0.0), xbitmaps, quilt, libxmu-dev
+# Reasons for build-depends:
+# debhelper for the packaging, pkg-config needed by configure scripts
+# Individual apps:
+# bitmap: libx11-dev, libxmu-dev, xbitmaps, libxt-dev
+# ico: libx11-dev
+# oclock: libx11-dev, libxmu-dev, libxext-dev
+# x11perf: libx11-dev, libxmuu-dev, libxrender-dev, libxft-dev, libxext-dev
+# xbiff: xbitmaps, libxext-dev
+# xcalc: libxt-dev, libxaw7-dev
+# xclipboard: libxt-dev
+# xclock: libx11-dev, libxaw7-dev, libxft-dev, libxkbfile-dev, libxt-dev
+# xconsole: libxt-dev, libxaw7-dev
+# xcursorgen: libx11-dev, libxcursor-dev, libpng12-dev
+# xditview: libxaw7-dev, libxt-dev
+# xedit: libxaw7-dev, libxt-dev
+# xeyes: libx11-dev, libxt-dev, libxext-dev, libxmu-dev
+# xgc: libxt-dev, libxmu-dev
+# xload: libxaw7-dev, libxt-dev
+# xlogo: libxaw7-dev, libxrender-dev, libxft-dev, libxext-dev, libxt-dev
+# xmag: libxaw7-dev, libxt-dev
+# xman: libxaw7-dev, libxt-dev
+# xmore: libxaw7-dev, libxt-dev
+# xwd: libx11-dev
+# xwud: libx11-dev
+Standards-Version: 3.8.4
+Vcs-Git: git://git.debian.org/git/pkg-xorg/app/x11-apps
+Vcs-Browser: http://git.debian.org/?p=pkg-xorg/app/x11-apps.git
+
+Package: x11-apps
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+#Depends: ${shlibs:Depends}, ${misc:Depends}, cpp
+Pre-Depends: x11-common (>= 1:7.0.0)
+Suggests: mesa-utils
+Conflicts: bitmap, oclock, x11perf, xbiff, xcalc, xclipboard, xclock, xconsole, xcursorgen, xditview, xeyes, xgc, xload, xlogo, xmag, xman, xmore, xwd, xwud
+Replaces: xbase-clients (<= 1:7.2.ds2-3), bitmap, oclock, x11perf, xbiff, xcalc, xclipboard, xclock, xconsole, xcursorgen, xditview, xeyes, xgc, xload, xlogo, xmag, xman, xmore, xwd, xwud
+Description: X applications
+ This package provides a miscellaneous assortment of X applications
+ that ship with the X Window System, including:
+  - atobm, bitmap, and bmtoa, tools for manipulating bitmap images;
+  - ico, a demo program animating polyhedrons;
+  - oclock and xclock, graphical clocks;
+  - xbiff, a tool which tells you when you have new email;
+  - xcalc, a scientific calculator desktop accessory;
+  - xclipboard, a tool to manage cut-and-pasted text selections;
+  - xconsole, which monitors system console messages;
+  - xcursorgen, a tool for creating X cursor files from PNGs;
+  - xditview, a viewer for ditroff output;
+  - xedit, a simple text editor for X;
+  - xeyes, a demo program in which a pair of eyes track the pointer;
+  - xgc, a graphics demo;
+  - xload, a monitor for the system load average;
+  - xlogo, a demo program that displays the X logo;
+  - xmag, which magnifies parts of the X screen;
+  - xman, a manual page browser;
+  - xmore, a text pager;
+  - xwd, a utility for taking window dumps ("screenshots") of the X session;
+  - xwud, a viewer for window dumps created by xwd;
+  - Xmark, x11perf, and x11perfcomp, tools for benchmarking graphical
+    operations under the X Window System;
+ .
+ The xbiff, xcalc, xconsole and xman programs use bitmap images provided
+ by the xbitmaps package.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..909ee70
--- /dev/null
@@ -0,0 +1,729 @@
+The contents of this package were downloaded from
+http://xorg.freedesktop.org/releases/individual/app/
+It contains the bitmap, ico, oclock, x11perf, xbiff, xcalc, xclipboard,
+xclock, xcursorgen, xconsole, xditview, xedit, xeyes, xgc, xload, xlogo,
+xmag, xman, xmore, xmd and xwd applications.
+
+bitmap:
+  Copyright 1988, 1993, 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.
+
+ico:
+  Copyright (c) 1987, 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
+  CONNECTION 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 dealings
+  in this Software without prior written authorization from the X Consortium.
+  
+  
+  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.
+  
+  ------------------------------------------------------------------------------
+  
+  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.
+
+oclock:
+  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.
+
+x11perf:
+  Copyright 1988, 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.
+
+xbiff:
+  Copyright (c) 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+  from the X Consortium.
+
+xcalc:
+  Copyright (c) 1989  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 CONNECTION 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 dealings in this Software without prior written authorization
+  from the X Consortium.
+  
+  */
+  /* $XFree86$ */
+  
+  /*
+   * xcalc.c  -  a hand calculator for the X Window system
+   *
+   *  Original Author:  John H. Bradley, University of Pennsylvania
+   *                   (bradley@cis.upenn.edu)  March, 1987
+   *  RPN mode added and port to X11 by Mark Rosenstein, MIT Project Athena
+   *  Rewritten to be an Xaw and Xt client by Donna Converse, MIT X Consortium
+   */
+
+xclipboard:
+  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.
+   * *
+   * Author:  Ralph Swick, DEC/Project Athena
+   * Updated for R4:  Chris D. Peterson,  MIT X Consortium.
+   * Reauthored by: Keith Packard, MIT X Consortium.
+
+xclock:
+   * xclock --  Hacked from Tony Della Fera's much hacked clock program.
+   *
+   * "-strftime" option added by George Belotsky, Open Light Software Inc.
+   */
+  
+  /*
+  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.
+
+xconsole:
+  Copyright 1990, 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:  Keith Packard, MIT X Consortium
+   */
+
+xcursorgen:
+  Copyright (C) 2002 Manish Singh
+  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 Manish Singh not be used in
+  advertising or publicity pertaining to distribution of the software without
+  specific, written prior permission.  Manish Singh makes no
+  representations about the suitability of this software for any purpose.  It
+  is provided "as is" without express or implied warranty.
+  MANISH SINGH DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+  EVENT SHALL MANISH SINGH 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.
+
+xditview:
+  Copyright (c) 1991  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 CONNECTION 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 dealings in this Software without prior written authorization
+  from the X Consortium.
+
+xedit:
+  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.
+  
+  
+  Copyright (c) 1994
+       The Regents of the University of California.  All rights reserved.
+  
+  This code is derived from software contributed to Berkeley by
+  Jan-Simon Pendry.
+  
+  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.
+  
+  
+                         COPYRIGHT 1987
+                  DIGITAL EQUIPMENT CORPORATION
+                      MAYNARD, MASSACHUSETTS
+                       ALL RIGHTS RESERVED.
+  
+  THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
+  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
+  DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR
+  ANY PURPOSE.  IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
+  
+  IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT RIGHTS,
+  APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN ADDITION TO THAT
+  SET FORTH ABOVE.
+  
+  
+  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 Equipment Corporation not be
+  used in advertising or publicity pertaining to distribution of the software
+  without specific, written prior permission.
+  
+  
+  Copyright 2004 Roland Mainz <roland.mainz@nrubsig.org>
+  
+  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 (c) 1999-2002 by The XFree86 Project, Inc.
+  
+  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.
+  
+  
+  Copyright (c) 2007 Paulo Cesar Pereira de Andrade
+  
+  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 (including the next
+  paragraph) 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.
+
+xeyes:
+  Copyright (c) 1991  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 CONNECTION 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 dealings in this Software without prior written authorization
+  from the X Consortium.
+
+xgc:
+  Copyright (c) 1991  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 CONNECTION 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 dealings in this Software without prior written authorization
+  from the X Consortium.
+
+xload:
+  Copyright (c) 1989  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 CONNECTION 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 dealings in this Software without prior written authorization
+  from the X Consortium.
+
+xlogo:
+  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.
+
+xmag:
+  Copyright 1991, 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.
+
+xman:
+  Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+  from the X Consortium.
+  
+   Author:    Chris D. Peterson, MIT Project Athena
+   Created:   October 22, 1987
+
+xmore:
+  Copyright 2004 Roland Mainz <roland.mainz@nrubsig.org>
+  
+  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.
+
+xwd:
+  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.
+
+xwud:
+  Copyright 1985, 1986, 1988, 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.
diff --git a/debian/patches/01_xedit_mkdir_races.diff b/debian/patches/01_xedit_mkdir_races.diff
new file mode 100644 (file)
index 0000000..4a012ca
--- /dev/null
@@ -0,0 +1,2588 @@
+Combination of two upstream patches (post 1.1.2) to fix #569430
+
+From 0ab2815743d89b1cd283abaf4d2cb77fed4a2df4 Mon Sep 17 00:00:00 2001
+From: Peter Breitenlohner <peb@mppmu.mpg.de>
+Date: Sun, 09 Nov 2008 13:24:10 +0000
+Subject: avoid race condition for parallel jobs
+
+From cfc78a1c2452362a5e7c88ed239c9d7ef0240a4d Mon Sep 17 00:00:00 2001
+From: Peter Breitenlohner <peb@mppmu.mpg.de>
+Date: Tue, 11 Nov 2008 09:52:18 +0000
+Subject: reorganize app default files
+
+
+Index: x11-apps/xedit/Makefile.am
+===================================================================
+--- x11-apps.orig/xedit/Makefile.am    2010-03-21 10:04:31.000000000 +0100
++++ x11-apps/xedit/Makefile.am 2010-03-21 10:04:42.000000000 +0100
+@@ -161,33 +161,13 @@
+ lisp_re_tests_SOURCES = lisp/re/tests.c
+-# App default files  (*.ad)
++# App default files
+-APPDEFAULTFILES = \
++appdefaultdir = @appdefaultdir@
++appdefault_DATA = \
+         app-defaults/Xedit-color \
+       app-defaults/Xedit
+-if USE_XPRINT
+-app-defaults/Xedit.ad: 
+-      test -d app-defaults || mkdir app-defaults
+-      cp $(top_srcdir)/app-defaults/Xedit-xprint.ad app-defaults/Xedit.ad
+-else
+-app-defaults/Xedit.ad:
+-      test -d app-defaults || mkdir app-defaults
+-      cp $(top_srcdir)/app-defaults/Xedit-noxprint.ad app-defaults/Xedit.ad
+-endif
+-
+-SUFFIXES = .ad 
+-
+-.ad:
+-      test -d app-defaults || mkdir app-defaults
+-      cp $< $@
+-
+-appdefaultdir = @appdefaultdir@
+-appdefault_DATA = $(APPDEFAULTFILES)
+-
+-CLEANFILES = $(APPDEFAULTFILES) app-defaults/Xedit.ad
+-
+ lispdir = $(LISPDIR)
+ dist_lisp_DATA = ${srcdir}/lisp/modules/lisp.lsp \
+       ${srcdir}/lisp/modules/xedit.lsp \
+@@ -216,9 +196,9 @@
+ appman_PRE = xedit.man
+ EXTRA_DIST = \
+-      app-defaults/Xedit-color.ad \
+-      app-defaults/Xedit-xprint.ad \
+-      app-defaults/Xedit-noxprint.ad \
++      app-defaults/Xedit-color \
++      app-defaults/Xedit-xprint \
++      app-defaults/Xedit-noxprint \
+       app-defaults/Xedit-sample \
+       lisp/README \
+       lisp/TODO \
+@@ -246,7 +226,7 @@
+ appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+ EXTRA_DIST += $(appman_PRE)
+-CLEANFILES += $(appman_DATA)
++CLEANFILES = $(appman_DATA)
+ SED = sed
+@@ -267,7 +247,7 @@
+       -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
+       -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
+-SUFFIXES += .$(APP_MAN_SUFFIX) .man
++SUFFIXES = .$(APP_MAN_SUFFIX) .man
+ .man.$(APP_MAN_SUFFIX):
+       sed $(MAN_SUBSTS) < $< > $@
+Index: x11-apps/xedit/configure.ac
+===================================================================
+--- x11-apps.orig/xedit/configure.ac   2010-03-21 10:04:31.000000000 +0100
++++ x11-apps/xedit/configure.ac        2010-03-21 10:04:42.000000000 +0100
+@@ -41,9 +41,12 @@
+ AM_CONDITIONAL(USE_XPRINT, test x$enable_xprint = xyes)
+ if test x$enable_xprint = xyes; then
+    PKG_CHECK_MODULES(PKGDEPS, xprintutil xp xaw8)
++   print_noprint=xprint
+ else
+    PKG_CHECK_MODULES(PKGDEPS, xaw7)
++   print_noprint=noxprint
+ fi
++AC_CONFIG_LINKS([app-defaults/Xedit:app-defaults/Xedit-$print_noprint])
+ AC_ARG_WITH(lispdir, AS_HELP_STRING([--with-lispdir=PATH],
+           [Directory to install lisp files (default: $libdir/X11/xedit/lisp)]),
+Index: x11-apps/xedit/app-defaults/Xedit-color
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ x11-apps/xedit/app-defaults/Xedit-color    2010-03-21 10:04:31.000000000 +0100
+@@ -0,0 +1,195 @@
++! $XFree86: xc/programs/xedit/Xedit-color.ad,v 1.14 2002/11/10 23:21:56 paulo Exp $
++
++#include "Xedit"
++
++*background:                  gray70
++*foreground:                  gray15
++*borderColor:                 gray40
++*Command.highlightThickness:  1
++*Command.backgroundPixmap:    gradient:vertical?dimension=18&start=gray90&end=gray65
++*Command.foreground:          gray20
++*Command.displayList:\
++foreground    gray92;\
++line          1,0,-2,0;\
++foreground    gray95;\
++line          2,1,-3,1;\
++foreground    gray74;\
++segments      3,-3,-4,-3, 2,-4,-3,-4, 1,-6,-2,-6;\
++point         -1,-1;\
++foreground    gray80;\
++line          0,0,0,-1;\
++point         -1,0
++
++*Command.translations:        #override \
++<Btn1Down>:   set-values(1, foreground, gray20, background, rgb:d/5/5) set()\n\
++Button1<Leave>: reset() set-values(1, foreground, gray20, background, gray70)\n\
++<Btn1Up>:     notify() unset()
++
++*Toggle.foreground:           gray30
++*Toggle.background:           gray82
++*Toggle.borderColor:          gray90
++*Toggle.displayList:\
++foreground    gray75;\
++segments      0,1,0,-2,-1,1,-1,-2;\
++foreground    gray80;\
++segments      0,0,-1,0,0,-1,-1,-1;\
++points                1,1,1,-2,-2,1, -2,-2
++
++*bc_label.backgroundPixmap:   gradient:vertical?dimension=18&start=gray90&end=gray65
++*bc_label.displayList:\
++foreground    gray92;\
++line          1,0,-2,0;\
++foreground    gray95;\
++line          2,1,-3,1;\
++foreground    gray74;\
++segments      3,-2,-4,-2, 2,-3,-3,-3, 1,-5,-2,-5
++*bc_label.foreground:         gray20
++
++*formWindow.backgroundPixmap: gradient:vertical?dimension=18&start=gray90&end=gray65
++*formWindow.displayList:\
++foreground    gray92;\
++line          1,0,-2,0;\
++foreground    gray95;\
++line          2,1,-3,1;\
++foreground    gray74;\
++segments      3,-2,-4,-2, 2,-3,-3,-3, 1,-5,-2,-5
++*formWindow*backgroundPixmap: ParentRelative
++*formWindow*foreground:               gray20
++*formWindow*background:               gray74
++*formWindow.labelWindow.background:   gray80
++*formWindow.labelWindow.displayList:\
++line-style    onoffdash;\
++foreground    gray30;\
++background    gray96;\
++draw-rect     3,2,15,14;\
++foreground    gray78;\
++fill-rect     4,3,15,14
++
++*dirlabel.foreground:         gray20
++*dirlabel.backgroundPixmap:   gradient:vertical?dimension=18&start=gray90&end=gray65
++*dirlabel.displayList:\
++foreground    gray92;\
++line          1,0,-2,0;\
++foreground    gray95;\
++line          2,1,-3,1;\
++foreground    gray74;\
++segments      3,-2,-4,-2, 2,-3,-3,-3, 1,-5,-2,-5
++*dirwindow.background:                gray96
++
++*internalBorderColor:         gray40
++
++*Text*Text.background:                gray96
++*Text.background:             gray96
++*Text.?.background:           gray96
++*Text*cursorColor:            rgb:d/5/5
++*Text.displayList:\
++foreground    white;\
++line          1,-1,-2,-1;\
++foreground    gray88;\
++line          1,0,-2,0
++
++*Scrollbar.foreground:                rgb:a/5/5
++*Scrollbar.background:                gray60
++*Text.Scrollbar.background:   gray60
++*Scrollbar.backgroundPixmap:  gradient:horizontal?dimension=14&start=gray70&end=gray85
++*hScrollbar.backgroundPixmap: gradient:vertical?dimension=14&start=gray85&end=gray70
++*hScrollbar.displayList:\
++foreground    gray85;\
++segments      1,-1,-2,-1,1,0,-2,0
++*vScrollbar.displayList:\
++foreground    gray85;\
++segments      0,1,0,-2,-1,1,-1,-2
++*Scrollbar.thumb:             vlines2
++*hScrollbar.thumb:            hlines2
++
++*SimpleMenu*borderWidth:              0
++*SimpleMenu*backgroundPixmap: xlogo11?foreground=gray90&background=gray88
++*SimpleMenu*background:               gray90
++*SimpleMenu*foreground:               gray20
++*SimpleMenu.VerticalMargins:  3
++*SimpleMenu.HorizontalMargins:        3
++*SimpleMenu.SimpleMenu.VerticalMargins:       3
++*SimpleMenu.SimpleMenu.HorizontalMargins:     3
++*SimpleMenu.menuLabel.foreground:     rgb:d/5/5
++*SimpleMenu*displayList:\
++foreground    gray70;\
++lines         +2,-2,-2,-2,-2,+2;\
++foreground    gray95;\
++lines         -2,+1,+1,+1,+1,-2;\
++foreground    gray30;\
++lines         +1,-1,-1,-1,-1,+1;\
++foreground    gray80;\
++lines         -1,+0,+0,+0,+0,-1
++
++*TransientShell.backgroundPixmap:     xlogo11?foreground=gray90&background=gray87
++*TransientShell.Form.backgroundPixmap:                ParentRelative
++*TransientShell.Form.Label.backgroundPixmap:  ParentRelative
++
++*ispell*Scrollbar.borderColor:        gray50
++*ispell*Scrollbar.displayList:
++*ispell*List.background:      gray96
++*ispell*word.background:      gray96
++*ispell*word.backgroundPixmap:        XtUnspecifiedPixmap
++*ispell*word.translations:\
++<Enter>:      highlight()\n\
++<Leave>:      reset()\n\
++<Btn1Down>:   set()\n\
++<Btn1Up>:     notify() unset()\n
++*ispell*word.displayList:
++*ispell.Form.Form.borderColor:        gray80
++*ispell.Form.Form.displayList: \
++foreground    gray90;\
++lines         +1,-1,-1,-1,-1,+1;\
++foreground    gray30;\
++lines         -1,+0,+0,+0,+0,-1;\
++foreground    gray60;\
++lines         +2,-2,-2,-2,-2,+2
++*ispell*status.backgroundPixmap:      XtUnspecifiedPixmap
++*ispell*status.background:    gray96
++*ispell*terse.justify:                right
++*ispell*terse.internalWidth:  10
++*ispell*terse.background:     gray75
++*ispell*terse.foreground:     gray20
++*ispell*terse.highlightThickness:     0
++*ispell*terse.displayList:\
++line-style    solid;\
++foreground    gray70;\
++fill-arc      6,4,14,12;\
++foreground    gray90;\
++draw-arc      6,4,14,12,45,180;\
++draw-lines    +0,-1,-1,-1,-1,+0;\
++foreground    gray50;\
++draw-arc      6,4,14,12,225,180;\
++draw-lines    -2,+0,+0,+0,+0,-2;\
++foreground    gray45;\
++dashes                2,1;\
++line-style    onoffdash;\
++draw-rect     +1,+1,-2,-2
++*ispell*options.MenuButton.borderColor:       gray70
++*ispell*options.MenuButton.background:        gray78
++*ispell*options.MenuButton.backgroundPixmap:  gradient:vertical?dimension=18&start=gray90&end=gray65
++*ispell*options.MenuButton.displayList:\
++foreground    gray60;\
++lines         +2,-2,-2,-2,-2,+2;\
++foreground    gray95;\
++lines         -3,+1,+1,+1,+1,-3;\
++foreground    gray78;\
++points                -2,+1,+1,-2
++
++*tip.foreground:      rgb:48/48/00
++*tip.backgroundPixmap:        None
++*tip.borderWidth:     0
++*tip.rightMargin:     7
++*tip.bottomMargin:    3
++*tip.displayList:\
++foreground    rgb:f/e/8;\
++fill-rect     1,1,-2,-2;\
++foreground    rgb:d/c/6;\
++draw-segments 0,1,0,-3,1,-2,-3,-2,-2,-3,-2,1,-3,0,1,0;\
++foreground    rgb:a/8/4;\
++draw-lines    2,-1, -2,-1, -1,-2, -1,2
++
++*grip.foreground:     gray10
++*grip.displayList:\
++foreground    gray80;\
++points                0,0,0,-1,-1,-1,-1,0
+Index: x11-apps/xedit/app-defaults/Xedit-color.ad
+===================================================================
+--- x11-apps.orig/xedit/app-defaults/Xedit-color.ad    2010-03-21 10:07:03.000000000 +0100
++++ /dev/null  1970-01-01 00:00:00.000000000 +0000
+@@ -1,195 +0,0 @@
+-! $XFree86: xc/programs/xedit/Xedit-color.ad,v 1.14 2002/11/10 23:21:56 paulo Exp $
+-
+-#include "Xedit"
+-
+-*background:                  gray70
+-*foreground:                  gray15
+-*borderColor:                 gray40
+-*Command.highlightThickness:  1
+-*Command.backgroundPixmap:    gradient:vertical?dimension=18&start=gray90&end=gray65
+-*Command.foreground:          gray20
+-*Command.displayList:\
+-foreground    gray92;\
+-line          1,0,-2,0;\
+-foreground    gray95;\
+-line          2,1,-3,1;\
+-foreground    gray74;\
+-segments      3,-3,-4,-3, 2,-4,-3,-4, 1,-6,-2,-6;\
+-point         -1,-1;\
+-foreground    gray80;\
+-line          0,0,0,-1;\
+-point         -1,0
+-
+-*Command.translations:        #override \
+-<Btn1Down>:   set-values(1, foreground, gray20, background, rgb:d/5/5) set()\n\
+-Button1<Leave>: reset() set-values(1, foreground, gray20, background, gray70)\n\
+-<Btn1Up>:     notify() unset()
+-
+-*Toggle.foreground:           gray30
+-*Toggle.background:           gray82
+-*Toggle.borderColor:          gray90
+-*Toggle.displayList:\
+-foreground    gray75;\
+-segments      0,1,0,-2,-1,1,-1,-2;\
+-foreground    gray80;\
+-segments      0,0,-1,0,0,-1,-1,-1;\
+-points                1,1,1,-2,-2,1, -2,-2
+-
+-*bc_label.backgroundPixmap:   gradient:vertical?dimension=18&start=gray90&end=gray65
+-*bc_label.displayList:\
+-foreground    gray92;\
+-line          1,0,-2,0;\
+-foreground    gray95;\
+-line          2,1,-3,1;\
+-foreground    gray74;\
+-segments      3,-2,-4,-2, 2,-3,-3,-3, 1,-5,-2,-5
+-*bc_label.foreground:         gray20
+-
+-*formWindow.backgroundPixmap: gradient:vertical?dimension=18&start=gray90&end=gray65
+-*formWindow.displayList:\
+-foreground    gray92;\
+-line          1,0,-2,0;\
+-foreground    gray95;\
+-line          2,1,-3,1;\
+-foreground    gray74;\
+-segments      3,-2,-4,-2, 2,-3,-3,-3, 1,-5,-2,-5
+-*formWindow*backgroundPixmap: ParentRelative
+-*formWindow*foreground:               gray20
+-*formWindow*background:               gray74
+-*formWindow.labelWindow.background:   gray80
+-*formWindow.labelWindow.displayList:\
+-line-style    onoffdash;\
+-foreground    gray30;\
+-background    gray96;\
+-draw-rect     3,2,15,14;\
+-foreground    gray78;\
+-fill-rect     4,3,15,14
+-
+-*dirlabel.foreground:         gray20
+-*dirlabel.backgroundPixmap:   gradient:vertical?dimension=18&start=gray90&end=gray65
+-*dirlabel.displayList:\
+-foreground    gray92;\
+-line          1,0,-2,0;\
+-foreground    gray95;\
+-line          2,1,-3,1;\
+-foreground    gray74;\
+-segments      3,-2,-4,-2, 2,-3,-3,-3, 1,-5,-2,-5
+-*dirwindow.background:                gray96
+-
+-*internalBorderColor:         gray40
+-
+-*Text*Text.background:                gray96
+-*Text.background:             gray96
+-*Text.?.background:           gray96
+-*Text*cursorColor:            rgb:d/5/5
+-*Text.displayList:\
+-foreground    white;\
+-line          1,-1,-2,-1;\
+-foreground    gray88;\
+-line          1,0,-2,0
+-
+-*Scrollbar.foreground:                rgb:a/5/5
+-*Scrollbar.background:                gray60
+-*Text.Scrollbar.background:   gray60
+-*Scrollbar.backgroundPixmap:  gradient:horizontal?dimension=14&start=gray70&end=gray85
+-*hScrollbar.backgroundPixmap: gradient:vertical?dimension=14&start=gray85&end=gray70
+-*hScrollbar.displayList:\
+-foreground    gray85;\
+-segments      1,-1,-2,-1,1,0,-2,0
+-*vScrollbar.displayList:\
+-foreground    gray85;\
+-segments      0,1,0,-2,-1,1,-1,-2
+-*Scrollbar.thumb:             vlines2
+-*hScrollbar.thumb:            hlines2
+-
+-*SimpleMenu*borderWidth:              0
+-*SimpleMenu*backgroundPixmap: xlogo11?foreground=gray90&background=gray88
+-*SimpleMenu*background:               gray90
+-*SimpleMenu*foreground:               gray20
+-*SimpleMenu.VerticalMargins:  3
+-*SimpleMenu.HorizontalMargins:        3
+-*SimpleMenu.SimpleMenu.VerticalMargins:       3
+-*SimpleMenu.SimpleMenu.HorizontalMargins:     3
+-*SimpleMenu.menuLabel.foreground:     rgb:d/5/5
+-*SimpleMenu*displayList:\
+-foreground    gray70;\
+-lines         +2,-2,-2,-2,-2,+2;\
+-foreground    gray95;\
+-lines         -2,+1,+1,+1,+1,-2;\
+-foreground    gray30;\
+-lines         +1,-1,-1,-1,-1,+1;\
+-foreground    gray80;\
+-lines         -1,+0,+0,+0,+0,-1
+-
+-*TransientShell.backgroundPixmap:     xlogo11?foreground=gray90&background=gray87
+-*TransientShell.Form.backgroundPixmap:                ParentRelative
+-*TransientShell.Form.Label.backgroundPixmap:  ParentRelative
+-
+-*ispell*Scrollbar.borderColor:        gray50
+-*ispell*Scrollbar.displayList:
+-*ispell*List.background:      gray96
+-*ispell*word.background:      gray96
+-*ispell*word.backgroundPixmap:        XtUnspecifiedPixmap
+-*ispell*word.translations:\
+-<Enter>:      highlight()\n\
+-<Leave>:      reset()\n\
+-<Btn1Down>:   set()\n\
+-<Btn1Up>:     notify() unset()\n
+-*ispell*word.displayList:
+-*ispell.Form.Form.borderColor:        gray80
+-*ispell.Form.Form.displayList: \
+-foreground    gray90;\
+-lines         +1,-1,-1,-1,-1,+1;\
+-foreground    gray30;\
+-lines         -1,+0,+0,+0,+0,-1;\
+-foreground    gray60;\
+-lines         +2,-2,-2,-2,-2,+2
+-*ispell*status.backgroundPixmap:      XtUnspecifiedPixmap
+-*ispell*status.background:    gray96
+-*ispell*terse.justify:                right
+-*ispell*terse.internalWidth:  10
+-*ispell*terse.background:     gray75
+-*ispell*terse.foreground:     gray20
+-*ispell*terse.highlightThickness:     0
+-*ispell*terse.displayList:\
+-line-style    solid;\
+-foreground    gray70;\
+-fill-arc      6,4,14,12;\
+-foreground    gray90;\
+-draw-arc      6,4,14,12,45,180;\
+-draw-lines    +0,-1,-1,-1,-1,+0;\
+-foreground    gray50;\
+-draw-arc      6,4,14,12,225,180;\
+-draw-lines    -2,+0,+0,+0,+0,-2;\
+-foreground    gray45;\
+-dashes                2,1;\
+-line-style    onoffdash;\
+-draw-rect     +1,+1,-2,-2
+-*ispell*options.MenuButton.borderColor:       gray70
+-*ispell*options.MenuButton.background:        gray78
+-*ispell*options.MenuButton.backgroundPixmap:  gradient:vertical?dimension=18&start=gray90&end=gray65
+-*ispell*options.MenuButton.displayList:\
+-foreground    gray60;\
+-lines         +2,-2,-2,-2,-2,+2;\
+-foreground    gray95;\
+-lines         -3,+1,+1,+1,+1,-3;\
+-foreground    gray78;\
+-points                -2,+1,+1,-2
+-
+-*tip.foreground:      rgb:48/48/00
+-*tip.backgroundPixmap:        None
+-*tip.borderWidth:     0
+-*tip.rightMargin:     7
+-*tip.bottomMargin:    3
+-*tip.displayList:\
+-foreground    rgb:f/e/8;\
+-fill-rect     1,1,-2,-2;\
+-foreground    rgb:d/c/6;\
+-draw-segments 0,1,0,-3,1,-2,-3,-2,-2,-3,-2,1,-3,0,1,0;\
+-foreground    rgb:a/8/4;\
+-draw-lines    2,-1, -2,-1, -1,-2, -1,2
+-
+-*grip.foreground:     gray10
+-*grip.displayList:\
+-foreground    gray80;\
+-points                0,0,0,-1,-1,-1,-1,0
+Index: x11-apps/xedit/app-defaults/Xedit-noxprint
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ x11-apps/xedit/app-defaults/Xedit-noxprint 2010-03-21 10:04:31.000000000 +0100
+@@ -0,0 +1,468 @@
++! $XFree86: xc/programs/xedit/Xedit.ad,v 1.23 2002/09/22 07:09:05 paulo Exp $
++
++*geometry:                            590x440
++*input:                                       TRUE
++*enableBackups:                               True
++*backupNameSuffix:                    ~
++*changedBitmap:                               xlogo11
++*international:                               False
++
++*hints:\
++Use Control-S and Control-R to Search.\n\
++Use Control-Shift-_ to Undo. Control-G to switch between Undo and Redo.\n\
++Use Control-A to jump to the beginning of the line.\n\
++Use Control-E to jump to the end of the line.\n\
++Use Control-T to transpose characters.\n\
++Use Control-K to cut to the end of the line. Control-Y to paste.\n\
++Use Control-Q to escape control characters.\n\
++Use Control-U[,<number>] to multiply actions. Control-G to cancel.\n\
++Use Control-Z to scroll one line up. Meta-Z to scroll one line down.\n\
++Use Meta-Q to format a paragraph.\n\
++Use Right-Button to extend selections.\n\
++Use Meta-I to insert a file.\n\
++Use Control-W to delete a selection, and/or jump to the selection mark.\n\
++Use Control-X,Control-F to find a file. Tab for filename completion.\n\
++Use Control-X,Control-S to save.\n\
++Use Control-X,Control-C to exit.\n\
++Use Control-C to paste the selection at CUT_BUFFER0.\n\
++Use Control Left-Button to popup the File Menu.\n\
++Use Control Middle-Button to popup the Edit Menu.\n\
++Use Control Right-Button to popup the Option Menu.\n\
++Use Control-X,Tab to Indent.\n\
++Use Control-X,0 to delete current splitted window.\n\
++Use Control-X,1 to delete other splitted window.\n\
++Use Control-X,2 to split the window vertically.\n\
++Use Control-X,3 to split the window horizontally.\n\
++Use Control-X,b to switch to another file.\n\
++Use Control-X,d to list directory. Control-G to Cancel.\n\
++Use Control-X,k to close file being edited.\n\
++Use Control-X,o to switch to another splitted window.\n\
++Use Control-X,u to undo. Control-G to switch between Undo and Redo.\n\
++Use Insert to toggle Overwrite mode.\n\
++Use Control-G to interrupt the lisp subprocess.\n\
++Use Escape to enter or leave regex search and replace mode.\n\
++Use Alt-. to search tags for the selected symbol or find the next match.
++
++*formWindow*defaultDistance:          2
++*formWindow.?.borderWidth:            0
++*formWindow.min:                      18
++*formWindow.max:                      18
++*formWindow.showGrip:                 False
++*positionWindow.fromHoriz:            labelWindow
++*positionWindow.horizDistance:                0
++*positionWindow.left:                 chainRight
++*positionWindow.right:                        chainRight
++*positionWindow.width:                        90
++*positionWindow.label:                        error
++*positionWindow.justify:              left
++*labelWindow*justify:                 center
++*labelWindow*label:                   no file yet
++*labelWindow.left:                    chainLeft
++*labelWindow.right:                   chainRight
++
++*quit.label:                          Quit
++*quit.tip:                            Close xedit window
++*save.label:                          Save
++*save.tip:                            Save current file
++*load.label:                          Load
++*load.tip:                            Load a new file
++
++*buttons*orientation:                 horizontal
++*buttons*showGrip:                    False
++*buttons.min:                         18
++
++*messageWindow.height:                        50
++*messageWindow.min:                   18
++*Paned*Text*allowResize:              True
++
++*messageWindow.autoFill:              False
++*messageWindow.scrollVertical:                Never
++
++*editWindow.autoFill:                 False
++*editWindow.scrollVertical:           Always
++*editWindow.showGrip:                 True
++xedit.textSource*enableUndo:          True
++
++*bc_label*label:                      Use Control-S and Control-R to Search.
++*bc_label*showGrip:                   False
++*bc_label.min:                                18
++
++*dirlabel.showGrip:                   False
++*dirlabel.min:                                18
++*dirlabel.max:                                18
++
++*dirwindow.defaultColumns:            0
++*dirwindow.verticalList:              True
++
++*viewport.forceBars:                  True
++*viewport.allowVert:                  1
++
++*insertFile*text.width:                       141
++*insertFile*text.?.pieceSize:         256
++*search*searchText.width:             157
++*search*replaceText.width:            157
++*search*case.horizDistance:           25
++*search*Text.?.pieceSize:             256
++
++*SimpleMenu.BackingStore:             NotUseful
++*SimpleMenu.menuLabel.vertSpace:      80
++*SimpleMenu.SmeBSB.HorizontalMargins: 16
++*SimpleMenu.justify:                  center
++*SimpleMenu.menuLabel.height:         250
++*SimpleMenu*cursor:                   left_ptr
++
++*fileMenu.label:                      File Menu
++*optionsMenu.label:                   Option Menu
++*optionsMenu.ispell.label:            ispell...
++*editMenu.label:                      Edit Menu
++*editMenu.wrapMenuItem.label:         Wrapping
++*editMenu.wrapMenuItem.leftBitmap:    menu12
++*wrapMenu.never.label:                        Never
++*wrapMenu.line.label:                 Line
++*wrapMenu.word.label:                 Word
++*editMenu.autoFill.label:             Auto Fill
++*editMenu.justifyMenuItem.label:      Justification
++*editMenu.justifyMenuItem.leftBitmap: menu12
++*justifyMenu.left.label:              Left
++*justifyMenu.right.label:             Right
++*justifyMenu.center.label:            Center
++*justifyMenu.full.label:              Full
++*editMenu.breakColumns.label:         Break Columns...
++*editMenu.scrollMenuItem.label:               Scrollbars
++*editMenu.scrollMenuItem.leftBitmap:  menu12
++*scrollMenu.vertical.label:           Vertical
++*scrollMenu.horizontal.label:         Horizontal
++*editMenu.modeMenuItem.leftBitmap:    menu12
++*editMenu.modeMenuItem.label:         Edit Mode
++*editModes.none.label:                        Plain/None
++
++*TransientShell*Text.translations: #override \
++c<Key>S:      no-op(r)\n\
++c<Key>R:      no-op(r)\n\
++m<Key>I:      no-op(r)
++
++*search.translations: #override \
++<Create>:get-values(my, $w, width, $h, height)\
++      set-values(1, minWidth, $w, minHeight, $h, maxHeight, $h, allowShellResize, False)
++
++*insertFile.title:                    Insert File
++*insertFile.translations: #override \
++<Create>:get-values(my, $w, width, $h, height)\
++      set-values(1, minWidth, $w, minHeight, $h, maxHeight, $h, allowShellResize, False)
++
++*baseTranslations: #override \
++<Ctrl>X,<Ctrl>C:quit()\n\
++<Ctrl>X,<Ctrl>S:save-file()\n\
++<Ctrl>X,<Ctrl>F:find-file()\n\
++<Key>Escape:  line-edit()
++
++*messageWindow.Translations: #override \
++<Ctrl>X,<Ctrl>C:quit()\n\
++<Ctrl>X,<Ctrl>S:save-file()\n\
++<Ctrl>X,<Ctrl>F:find-file()\n\
++<Enter>:      no-op()\n\
++<Leave>:      no-op()\n\
++<Btn1Down>:   set-keyboard-focus() select-start()
++
++*searchText.Translations: #override \
++<Enter>:      no-op()\n\
++<Leave>:      no-op()\n\
++<Btn1Down>:   set-keyboard-focus() select-start()
++
++*replaceText.Translations: #override \
++<Enter>:      no-op()\n\
++<Leave>:      no-op()\n\
++<Btn1Down>:   set-keyboard-focus() select-start()
++
++*editWindow.translations: #override \
++<Ctrl>X,<Ctrl>E:lisp-eval()\n\
++<Ctrl>X,<Key>Tab:indent()\n\
++<Ctrl>X,:<Key>0:delete-window(current)\n\
++<Ctrl>X,:<Key>1:delete-window(other)\n\
++<Ctrl>X,:<Key>2:split-window(vertical)\n\
++<Ctrl>X,:<Key>3:split-window(horizontal)\n\
++<Ctrl>X,!l @Num_Lock<Key>b:switch-source()\n\
++<Ctrl>X,!l <Key>b:switch-source()\n\
++<Ctrl>X,!@Num_Lock<Key>b:switch-source()\n\
++<Ctrl>X,!<Key>b:switch-source()\n\
++<Ctrl>X,!l @Num_Lock<Key>d:dir-window()\n\
++<Ctrl>X,!l <Key>d:dir-window()\n\
++<Ctrl>X,!@Num_Lock<Key>d:dir-window()\n\
++<Ctrl>X,!<Key>d:dir-window()\n\
++<Ctrl>X,!l @Num_Lock<Key>k:kill-file()\n\
++<Ctrl>X,!l <Key>k:kill-file()\n\
++<Ctrl>X,!@Num_Lock<Key>k:kill-file()\n\
++<Ctrl>X,!<Key>k:kill-file()\n\
++<Ctrl>X,!l @Num_Lock<Key>o:other-window()\n\
++<Ctrl>X,!l <Key>o:other-window()\n\
++<Ctrl>X,!@Num_Lock<Key>o:other-window()\n\
++<Ctrl>X,!<Key>o:other-window()\n\
++<Ctrl>X,!l @Num_Lock<Key>u:undo()\n\
++<Ctrl>X,!l <Key>u:undo()\n\
++<Ctrl>X,!@Num_Lock<Key>u:undo()\n\
++<Ctrl>X,!<Key>u:undo()\n\
++<Ctrl>G:      xedit-keyboard-reset()\n\
++<Ctrl>J:      xedit-print-lisp-eval()\n\
++:m<Key>.:     tags()\n\
++<Key>Tab:     insert-char()\n\
++!l @Num_Lock<Key>b:insert-char()\n\
++!l <Key>b:    insert-char()\n\
++!@Num_Lock<Key>b:insert-char()\n\
++!<Key>b:      insert-char()\n\
++!l @Num_Lock<Key>d:insert-char()\n\
++!l <Key>d:    insert-char()\n\
++!@Num_Lock<Key>d:insert-char()\n\
++!<Key>d:      insert-char()\n\
++!l <Key>k:    insert-char()\n\
++!l @Num_Lock<Key>k:insert-char()\n\
++!@Num_Lock<Key>k:insert-char()\n\
++!<Key>k:      insert-char()\n\
++!l @Num_Lock<Key>o:insert-char()\n\
++!l <Key>o:    insert-char()\n\
++!@Num_Lock<Key>o:insert-char()\n\
++!<Key>o:      insert-char()\n\
++!l @Num_Lock<Key>u:insert-char()\n\
++!l <Key>u:    insert-char()\n\
++!@Num_Lock<Key>u:insert-char()\n\
++!<Key>u:      insert-char()\n\
++~s <Key>Insert:       toggle-overwrite()\n\
++c l @Num_Lock<Btn1Down>:xedit-focus() popup-menu(fileMenu)\n\
++c @Num_Lock<Btn1Down>:xedit-focus() popup-menu(fileMenu)\n\
++c l<Btn1Down>:        xedit-focus() popup-menu(fileMenu)\n\
++c<Btn1Down>:  xedit-focus() popup-menu(fileMenu)\n\
++c l @Num_Lock<Btn2Down>:xedit-focus() popup-menu(editMenu)\n\
++c @Num_Lock<Btn2Down>:xedit-focus() popup-menu(editMenu)\n\
++c l<Btn2Down>:        xedit-focus() popup-menu(editMenu)\n\
++c<Btn2Down>:  xedit-focus() popup-menu(editMenu)\n\
++c l @Num_Lock<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\
++c @Num_Lock<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\
++c l<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\
++c<Btn3Down>:  xedit-focus() popup-menu(optionsMenu)\n\
++<Btn1Down>:   xedit-focus() select-start()\n\
++<Btn4Down>:   scroll-one-line-down()\n\
++<Btn5Down>:   scroll-one-line-up()
++
++*filename.?.pieceSize:                        256
++*filename.translations: #override \
++c<Key>S:      no-op(r)\n\
++c<Key>R:      no-op(r)\n\
++m<Key>I:      no-op(r)\n\
++c<Key>G:      cancel-find-file()\n\
++<Key>Return:  load-file()\n\
++<Key>Tab:     file-completion(h)\n\
++<Key>Escape:  cancel-find-file()\n\
++<Enter>:      no-op()\n\
++<Leave>:      no-op()\n\
++<Btn1Down>:   set-keyboard-focus() select-start()
++
++*ispell.translations: #override \
++<Message>WM_PROTOCOLS:        ispell(end)
++
++! Sample dictionary, word chars and text mode resources setup
++!*ispell.dictionary:                  br
++!*ispell.dictionaries:                        br american americanmed+ english
++!*ispell*br.wordChars:                        áéíóúçÁÉÍÓÚÇàÀâêôÂÊÔüÜãõÃÕ-
++*ispell.ispellCommand:                        /usr/bin/aspell -B -m
++*ispell.lookCommand:                  /bin/egrep
++!*ispell*text.skipLines:              .#
++
++*ispell.geometry:                     0x0
++*ispell.minWidth:                     320
++*ispell.minHeight:                    245
++*ispell*Label.borderWidth:            0
++*ispell*Label.internalHeight:         4
++*ispell*Label.justify:                        right
++*ispell*Label.width:                  112
++*ispell*Label.left:                   chainLeft
++*ispell*Label.right:                  chainLeft
++*ispell*Label.top:                    chainTop
++*ispell*Label.bottom:                 chainTop
++*ispell*mispelled.label:              Misspelled word:
++*ispell*mispelled.top:                        chainTop
++*ispell*mispelled.bottom:             chainTop
++*ispell*mispelled.internalWidth:      0
++*ispell*repeated.label:                       Repeated words:
++*ispell*repeated.internalWidth:               0
++*ispell*replacement.label:            Replace with:
++*ispell*word.fromHoriz:                       mispelled
++*ispell*word.justify:                 left
++*ispell*word.borderWidth:             1
++*ispell*word.internalWidth:           4
++*ispell*word.internalHeight:          3
++*ispell*word.width:                   194
++*ispell*word.left:                    chainLeft
++*ispell*word.right:                   chainRight
++*ispell*word.top:                     chainTop
++*ispell*word.bottom:                  chainTop
++*ispell*word.label:
++*ispell*word.tip:                     Press here to select this text
++*ispell*word.highlightThickness:      0
++*ispell*text.fromHoriz:                       replacement
++*ispell*replacement.fromVert:         mispelled
++*ispell*replacement.internalWidth:    0
++*ispell*form.text.fromVert:           word
++*ispell*form.text.width:              194
++*ispell*form.text.top:                        chainTop
++*ispell*form.text.bottom:             chainTop
++*ispell*form.text.left:                       chainLeft
++*ispell*form.text.right:              chainRight
++*ispell*form.text.leftMargin:         4
++*ispell*form.text.?.pieceSize:                256
++*ispell*suggestions.label:            Suggestions:
++*ispell*suggestions.fromVert:         replacement
++*ispell*suggestions.internalWidth:    0
++*ispell*viewport.fromHoriz:           suggestions
++*ispell*viewport.fromVert:            text
++*ispell*viewport.width:                       194
++*ispell*viewport.height:              143
++*ispell*viewport.top:                 chainTop
++*ispell*viewport.bottom:              chainBottom
++*ispell*viewport.left:                        chainLeft
++*ispell*viewport.right:                       chainRight
++*ispell*viewport.forceBars:           1
++*ispell*viewport.allowVert:           1
++*ispell*list.defaultColumns:          1
++*ispell*list.longest:                 16384
++*ispell*commands.vertDistance:                5
++*ispell*commands.fromVert:            suggestions
++*ispell*commands.top:                 chainBottom
++*ispell*commands.bottom:              chainBottom
++*ispell*commands.right:                       chainLeft
++*ispell*commands.left:                        chainLeft
++*ispell*check.label:                  Check
++*ispell*check.width:                  54
++*ispell*check.tip:                    Ask ispell about the word in the text field
++*ispell*look.label:                   Look
++*ispell*look.fromHoriz:                       check
++*ispell*look.horizDistance:           0
++*ispell*look.width:                   46
++*ispell*look.tip:                     Runs the look command
++*ispell*undo.fromVert:                        check
++*ispell*undo.label:                   Undo
++*ispell*undo.width:                   102
++*ispell*undo.tip:                     Undo last action
++*ispell*replace.fromVert:             undo
++*ispell*replace.label:                        Replace
++*ispell*replace.tip:                  Replace occurence of the word
++*ispell*replaceAll.fromVert:          undo
++*ispell*replaceAll.fromHoriz:         replace
++*ispell*replaceAll.label:             All
++*ispell*replaceAll.tip:                       Replace all occurences of the word
++*ispell*ignore.fromVert:              replace
++*ispell*ignore.label:                 Ignore
++*ispell*ignore.tip:                   Ignore this word
++*ispell*ignoreAll.fromVert:           replaceAll
++*ispell*ignoreAll.fromHoriz:          ignore
++*ispell*ignoreAll.label:              All
++*ispell*ignoreAll.tip:                        Ignore all ocurrences of the word
++*ispell*add.fromVert:                 ignore
++*ispell*add.label:                    Add
++*ispell*add.width:                    50
++*ispell*add.tip:                      Add word to your private dictionary
++*ispell*addUncap.fromVert:            ignoreAll
++*ispell*addUncap.fromHoriz:           add
++*ispell*addUncap.label:                       Uncap
++*ispell*addUncap.horizDistance:               0
++*ispell*addUncap.width:                       50
++*ispell*addUncap.tip:                 Add word uncapitalized, to your private dictionary
++*ispell*suspend.fromVert:             add
++*ispell*suspend.label:                        Suspend
++*ispell*suspend.width:                        57
++*ispell*suspend.tip:                  Suspend ispell execution
++*ispell*cancel.fromHoriz:             suspend
++*ispell*cancel.fromVert:              addUncap
++*ispell*cancel.label:                 Close
++*ispell*cancel.width:                 43
++*ispell*cancel.horizDistance:         0
++*ispell*cancel.tip:                   Terminates ispell process
++*ispell*replace.width:                        65
++*ispell*ignore.width:                 65
++*ispell*replaceAll.width:             35
++*ispell*replaceAll.horizDistance:     0
++*ispell*ignoreAll.width:              35
++*ispell*ignoreAll.horizDistance:      0
++*ispell*terse.fromVert:                       cancel
++*ispell*terse.Label:                  Terse Mode
++*ispell*terse.width:                  104
++*ispell*terse.borderWidth:            0
++*ispell*terse.tip:                    Switch terse mode
++*ispell*status.fromVert:              viewport
++*ispell*status.fromHoriz:             suggestions
++*ispell*status.top:                   chainBottom
++*ispell*status.bottom:                        chainBottom
++*ispell*status.left:                  chainLeft
++*ispell*status.right:                 chainRight
++*ispell*status.width:                 194
++*ispell*status.borderWidth:           1
++*ispell*status.justify:                       left
++*ispell*status.internalHeight:                2
++*ispell*status.vertDistance:          2
++*ispell*options.fromVert:             status
++*ispell*options.fromHoriz:            commands
++*ispell*options.bottom:                       chainBottom
++*ispell*options.top:                  chainBottom
++*ispell*options.left:                 chainLeft
++*ispell*options.right:                        chainRight
++*ispell*options.dict.width:           121
++*ispell*options.horizDistance:                2
++*ispell*options.vertDistance:         2
++*ispell*options.defaultDistance:      2
++*ispell*dict.highlightThickness:      0
++*ispell*dict.justify:                 left
++*ispell*dict.resizable:                       False
++*ispell*dict.leftBitmap:              menu12
++*ispell*dict.label:                   Dictionary
++*ispell*dict.tip:                     Change dictionary
++*ispell*options.format.width:         65
++*ispell*format.highlightThickness:    0
++*ispell*format.justify:                       left
++*ispell*format.resizable:             False
++*ispell*format.leftBitmap:            menu12
++*ispell*format.fromHoriz:             dict
++*ispell*format.horizDistance:         0
++*ispell*format.tip:                   Select text type
++
++*columns.minWidth:                    140
++*columns.minHeight:                   76
++*columns.maxWidth:                    140
++*columns.maxHeight:                   76
++*columns.form*defaultDistance:                4
++*columns*left:                                chainLeft
++*columns*right:                               chainLeft
++*columns*top:                         chainTop
++*columns*bottom:                      chainTop
++*columns*Label.width:                 96
++*columns*Label.borderWidth:           0
++*columns*Label.internalHeight:                4
++*columns*Label.internalWidth:         2
++*columns*Label.justify:                       right
++*columns*Text.width:                  30
++*columns*Command.width:                       58
++*columns*leftLabel.label:             Left Column:
++*columns*left.fromHoriz:              leftLabel
++*columns*rightLabel.label:            Right Column:
++*columns*rightLabel.fromVert:         leftLabel
++*columns*right.fromHoriz:             rightLabel
++*columns*right.fromVert:              left
++*columns*ok.fromVert:                 rightLabel
++*columns*cancel.fromHoriz:            ok
++*columns*cancel.fromVert:             rightLabel
++*columns*cancel.horizDistance:                12
++*columns*Text.?.pieceSize:            8
++
++*columns*Text.translations: #override \
++c<Key>S:      no-op(r)\n\
++c<Key>R:      no-op(r)\n\
++m<Key>I:      no-op(r)\n\
++<Key>Return:  set-columns(ok)\n\
++<Key>Tab:     change-field()\n\
++c<Key>G:      set-columns(cancel)\n\
++<Key>Escape:  set-columns(cancel)\n\
++<Enter>:      no-op()\n\
++<Leave>:      no-op()\n\
++<Btn1Down>:   set-keyboard-focus() select-start()
++
++*columns.translations:        #override \
++<Message>WM_PROTOCOLS:        set-columns(cancel)
++
++! EOF.
+Index: x11-apps/xedit/app-defaults/Xedit-noxprint.ad
+===================================================================
+--- x11-apps.orig/xedit/app-defaults/Xedit-noxprint.ad 2010-03-21 10:06:53.000000000 +0100
++++ /dev/null  1970-01-01 00:00:00.000000000 +0000
+@@ -1,468 +0,0 @@
+-! $XFree86: xc/programs/xedit/Xedit.ad,v 1.23 2002/09/22 07:09:05 paulo Exp $
+-
+-*geometry:                            590x440
+-*input:                                       TRUE
+-*enableBackups:                               True
+-*backupNameSuffix:                    ~
+-*changedBitmap:                               xlogo11
+-*international:                               False
+-
+-*hints:\
+-Use Control-S and Control-R to Search.\n\
+-Use Control-Shift-_ to Undo. Control-G to switch between Undo and Redo.\n\
+-Use Control-A to jump to the beginning of the line.\n\
+-Use Control-E to jump to the end of the line.\n\
+-Use Control-T to transpose characters.\n\
+-Use Control-K to cut to the end of the line. Control-Y to paste.\n\
+-Use Control-Q to escape control characters.\n\
+-Use Control-U[,<number>] to multiply actions. Control-G to cancel.\n\
+-Use Control-Z to scroll one line up. Meta-Z to scroll one line down.\n\
+-Use Meta-Q to format a paragraph.\n\
+-Use Right-Button to extend selections.\n\
+-Use Meta-I to insert a file.\n\
+-Use Control-W to delete a selection, and/or jump to the selection mark.\n\
+-Use Control-X,Control-F to find a file. Tab for filename completion.\n\
+-Use Control-X,Control-S to save.\n\
+-Use Control-X,Control-C to exit.\n\
+-Use Control-C to paste the selection at CUT_BUFFER0.\n\
+-Use Control Left-Button to popup the File Menu.\n\
+-Use Control Middle-Button to popup the Edit Menu.\n\
+-Use Control Right-Button to popup the Option Menu.\n\
+-Use Control-X,Tab to Indent.\n\
+-Use Control-X,0 to delete current splitted window.\n\
+-Use Control-X,1 to delete other splitted window.\n\
+-Use Control-X,2 to split the window vertically.\n\
+-Use Control-X,3 to split the window horizontally.\n\
+-Use Control-X,b to switch to another file.\n\
+-Use Control-X,d to list directory. Control-G to Cancel.\n\
+-Use Control-X,k to close file being edited.\n\
+-Use Control-X,o to switch to another splitted window.\n\
+-Use Control-X,u to undo. Control-G to switch between Undo and Redo.\n\
+-Use Insert to toggle Overwrite mode.\n\
+-Use Control-G to interrupt the lisp subprocess.\n\
+-Use Escape to enter or leave regex search and replace mode.\n\
+-Use Alt-. to search tags for the selected symbol or find the next match.
+-
+-*formWindow*defaultDistance:          2
+-*formWindow.?.borderWidth:            0
+-*formWindow.min:                      18
+-*formWindow.max:                      18
+-*formWindow.showGrip:                 False
+-*positionWindow.fromHoriz:            labelWindow
+-*positionWindow.horizDistance:                0
+-*positionWindow.left:                 chainRight
+-*positionWindow.right:                        chainRight
+-*positionWindow.width:                        90
+-*positionWindow.label:                        error
+-*positionWindow.justify:              left
+-*labelWindow*justify:                 center
+-*labelWindow*label:                   no file yet
+-*labelWindow.left:                    chainLeft
+-*labelWindow.right:                   chainRight
+-
+-*quit.label:                          Quit
+-*quit.tip:                            Close xedit window
+-*save.label:                          Save
+-*save.tip:                            Save current file
+-*load.label:                          Load
+-*load.tip:                            Load a new file
+-
+-*buttons*orientation:                 horizontal
+-*buttons*showGrip:                    False
+-*buttons.min:                         18
+-
+-*messageWindow.height:                        50
+-*messageWindow.min:                   18
+-*Paned*Text*allowResize:              True
+-
+-*messageWindow.autoFill:              False
+-*messageWindow.scrollVertical:                Never
+-
+-*editWindow.autoFill:                 False
+-*editWindow.scrollVertical:           Always
+-*editWindow.showGrip:                 True
+-xedit.textSource*enableUndo:          True
+-
+-*bc_label*label:                      Use Control-S and Control-R to Search.
+-*bc_label*showGrip:                   False
+-*bc_label.min:                                18
+-
+-*dirlabel.showGrip:                   False
+-*dirlabel.min:                                18
+-*dirlabel.max:                                18
+-
+-*dirwindow.defaultColumns:            0
+-*dirwindow.verticalList:              True
+-
+-*viewport.forceBars:                  True
+-*viewport.allowVert:                  1
+-
+-*insertFile*text.width:                       141
+-*insertFile*text.?.pieceSize:         256
+-*search*searchText.width:             157
+-*search*replaceText.width:            157
+-*search*case.horizDistance:           25
+-*search*Text.?.pieceSize:             256
+-
+-*SimpleMenu.BackingStore:             NotUseful
+-*SimpleMenu.menuLabel.vertSpace:      80
+-*SimpleMenu.SmeBSB.HorizontalMargins: 16
+-*SimpleMenu.justify:                  center
+-*SimpleMenu.menuLabel.height:         250
+-*SimpleMenu*cursor:                   left_ptr
+-
+-*fileMenu.label:                      File Menu
+-*optionsMenu.label:                   Option Menu
+-*optionsMenu.ispell.label:            ispell...
+-*editMenu.label:                      Edit Menu
+-*editMenu.wrapMenuItem.label:         Wrapping
+-*editMenu.wrapMenuItem.leftBitmap:    menu12
+-*wrapMenu.never.label:                        Never
+-*wrapMenu.line.label:                 Line
+-*wrapMenu.word.label:                 Word
+-*editMenu.autoFill.label:             Auto Fill
+-*editMenu.justifyMenuItem.label:      Justification
+-*editMenu.justifyMenuItem.leftBitmap: menu12
+-*justifyMenu.left.label:              Left
+-*justifyMenu.right.label:             Right
+-*justifyMenu.center.label:            Center
+-*justifyMenu.full.label:              Full
+-*editMenu.breakColumns.label:         Break Columns...
+-*editMenu.scrollMenuItem.label:               Scrollbars
+-*editMenu.scrollMenuItem.leftBitmap:  menu12
+-*scrollMenu.vertical.label:           Vertical
+-*scrollMenu.horizontal.label:         Horizontal
+-*editMenu.modeMenuItem.leftBitmap:    menu12
+-*editMenu.modeMenuItem.label:         Edit Mode
+-*editModes.none.label:                        Plain/None
+-
+-*TransientShell*Text.translations: #override \
+-c<Key>S:      no-op(r)\n\
+-c<Key>R:      no-op(r)\n\
+-m<Key>I:      no-op(r)
+-
+-*search.translations: #override \
+-<Create>:get-values(my, $w, width, $h, height)\
+-      set-values(1, minWidth, $w, minHeight, $h, maxHeight, $h, allowShellResize, False)
+-
+-*insertFile.title:                    Insert File
+-*insertFile.translations: #override \
+-<Create>:get-values(my, $w, width, $h, height)\
+-      set-values(1, minWidth, $w, minHeight, $h, maxHeight, $h, allowShellResize, False)
+-
+-*baseTranslations: #override \
+-<Ctrl>X,<Ctrl>C:quit()\n\
+-<Ctrl>X,<Ctrl>S:save-file()\n\
+-<Ctrl>X,<Ctrl>F:find-file()\n\
+-<Key>Escape:  line-edit()
+-
+-*messageWindow.Translations: #override \
+-<Ctrl>X,<Ctrl>C:quit()\n\
+-<Ctrl>X,<Ctrl>S:save-file()\n\
+-<Ctrl>X,<Ctrl>F:find-file()\n\
+-<Enter>:      no-op()\n\
+-<Leave>:      no-op()\n\
+-<Btn1Down>:   set-keyboard-focus() select-start()
+-
+-*searchText.Translations: #override \
+-<Enter>:      no-op()\n\
+-<Leave>:      no-op()\n\
+-<Btn1Down>:   set-keyboard-focus() select-start()
+-
+-*replaceText.Translations: #override \
+-<Enter>:      no-op()\n\
+-<Leave>:      no-op()\n\
+-<Btn1Down>:   set-keyboard-focus() select-start()
+-
+-*editWindow.translations: #override \
+-<Ctrl>X,<Ctrl>E:lisp-eval()\n\
+-<Ctrl>X,<Key>Tab:indent()\n\
+-<Ctrl>X,:<Key>0:delete-window(current)\n\
+-<Ctrl>X,:<Key>1:delete-window(other)\n\
+-<Ctrl>X,:<Key>2:split-window(vertical)\n\
+-<Ctrl>X,:<Key>3:split-window(horizontal)\n\
+-<Ctrl>X,!l @Num_Lock<Key>b:switch-source()\n\
+-<Ctrl>X,!l <Key>b:switch-source()\n\
+-<Ctrl>X,!@Num_Lock<Key>b:switch-source()\n\
+-<Ctrl>X,!<Key>b:switch-source()\n\
+-<Ctrl>X,!l @Num_Lock<Key>d:dir-window()\n\
+-<Ctrl>X,!l <Key>d:dir-window()\n\
+-<Ctrl>X,!@Num_Lock<Key>d:dir-window()\n\
+-<Ctrl>X,!<Key>d:dir-window()\n\
+-<Ctrl>X,!l @Num_Lock<Key>k:kill-file()\n\
+-<Ctrl>X,!l <Key>k:kill-file()\n\
+-<Ctrl>X,!@Num_Lock<Key>k:kill-file()\n\
+-<Ctrl>X,!<Key>k:kill-file()\n\
+-<Ctrl>X,!l @Num_Lock<Key>o:other-window()\n\
+-<Ctrl>X,!l <Key>o:other-window()\n\
+-<Ctrl>X,!@Num_Lock<Key>o:other-window()\n\
+-<Ctrl>X,!<Key>o:other-window()\n\
+-<Ctrl>X,!l @Num_Lock<Key>u:undo()\n\
+-<Ctrl>X,!l <Key>u:undo()\n\
+-<Ctrl>X,!@Num_Lock<Key>u:undo()\n\
+-<Ctrl>X,!<Key>u:undo()\n\
+-<Ctrl>G:      xedit-keyboard-reset()\n\
+-<Ctrl>J:      xedit-print-lisp-eval()\n\
+-:m<Key>.:     tags()\n\
+-<Key>Tab:     insert-char()\n\
+-!l @Num_Lock<Key>b:insert-char()\n\
+-!l <Key>b:    insert-char()\n\
+-!@Num_Lock<Key>b:insert-char()\n\
+-!<Key>b:      insert-char()\n\
+-!l @Num_Lock<Key>d:insert-char()\n\
+-!l <Key>d:    insert-char()\n\
+-!@Num_Lock<Key>d:insert-char()\n\
+-!<Key>d:      insert-char()\n\
+-!l <Key>k:    insert-char()\n\
+-!l @Num_Lock<Key>k:insert-char()\n\
+-!@Num_Lock<Key>k:insert-char()\n\
+-!<Key>k:      insert-char()\n\
+-!l @Num_Lock<Key>o:insert-char()\n\
+-!l <Key>o:    insert-char()\n\
+-!@Num_Lock<Key>o:insert-char()\n\
+-!<Key>o:      insert-char()\n\
+-!l @Num_Lock<Key>u:insert-char()\n\
+-!l <Key>u:    insert-char()\n\
+-!@Num_Lock<Key>u:insert-char()\n\
+-!<Key>u:      insert-char()\n\
+-~s <Key>Insert:       toggle-overwrite()\n\
+-c l @Num_Lock<Btn1Down>:xedit-focus() popup-menu(fileMenu)\n\
+-c @Num_Lock<Btn1Down>:xedit-focus() popup-menu(fileMenu)\n\
+-c l<Btn1Down>:        xedit-focus() popup-menu(fileMenu)\n\
+-c<Btn1Down>:  xedit-focus() popup-menu(fileMenu)\n\
+-c l @Num_Lock<Btn2Down>:xedit-focus() popup-menu(editMenu)\n\
+-c @Num_Lock<Btn2Down>:xedit-focus() popup-menu(editMenu)\n\
+-c l<Btn2Down>:        xedit-focus() popup-menu(editMenu)\n\
+-c<Btn2Down>:  xedit-focus() popup-menu(editMenu)\n\
+-c l @Num_Lock<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\
+-c @Num_Lock<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\
+-c l<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\
+-c<Btn3Down>:  xedit-focus() popup-menu(optionsMenu)\n\
+-<Btn1Down>:   xedit-focus() select-start()\n\
+-<Btn4Down>:   scroll-one-line-down()\n\
+-<Btn5Down>:   scroll-one-line-up()
+-
+-*filename.?.pieceSize:                        256
+-*filename.translations: #override \
+-c<Key>S:      no-op(r)\n\
+-c<Key>R:      no-op(r)\n\
+-m<Key>I:      no-op(r)\n\
+-c<Key>G:      cancel-find-file()\n\
+-<Key>Return:  load-file()\n\
+-<Key>Tab:     file-completion(h)\n\
+-<Key>Escape:  cancel-find-file()\n\
+-<Enter>:      no-op()\n\
+-<Leave>:      no-op()\n\
+-<Btn1Down>:   set-keyboard-focus() select-start()
+-
+-*ispell.translations: #override \
+-<Message>WM_PROTOCOLS:        ispell(end)
+-
+-! Sample dictionary, word chars and text mode resources setup
+-!*ispell.dictionary:                  br
+-!*ispell.dictionaries:                        br american americanmed+ english
+-!*ispell*br.wordChars:                        áéíóúçÁÉÍÓÚÇàÀâêôÂÊÔüÜãõÃÕ-
+-*ispell.ispellCommand:                        /usr/bin/aspell -B -m
+-*ispell.lookCommand:                  /bin/egrep
+-!*ispell*text.skipLines:              .#
+-
+-*ispell.geometry:                     0x0
+-*ispell.minWidth:                     320
+-*ispell.minHeight:                    245
+-*ispell*Label.borderWidth:            0
+-*ispell*Label.internalHeight:         4
+-*ispell*Label.justify:                        right
+-*ispell*Label.width:                  112
+-*ispell*Label.left:                   chainLeft
+-*ispell*Label.right:                  chainLeft
+-*ispell*Label.top:                    chainTop
+-*ispell*Label.bottom:                 chainTop
+-*ispell*mispelled.label:              Misspelled word:
+-*ispell*mispelled.top:                        chainTop
+-*ispell*mispelled.bottom:             chainTop
+-*ispell*mispelled.internalWidth:      0
+-*ispell*repeated.label:                       Repeated words:
+-*ispell*repeated.internalWidth:               0
+-*ispell*replacement.label:            Replace with:
+-*ispell*word.fromHoriz:                       mispelled
+-*ispell*word.justify:                 left
+-*ispell*word.borderWidth:             1
+-*ispell*word.internalWidth:           4
+-*ispell*word.internalHeight:          3
+-*ispell*word.width:                   194
+-*ispell*word.left:                    chainLeft
+-*ispell*word.right:                   chainRight
+-*ispell*word.top:                     chainTop
+-*ispell*word.bottom:                  chainTop
+-*ispell*word.label:
+-*ispell*word.tip:                     Press here to select this text
+-*ispell*word.highlightThickness:      0
+-*ispell*text.fromHoriz:                       replacement
+-*ispell*replacement.fromVert:         mispelled
+-*ispell*replacement.internalWidth:    0
+-*ispell*form.text.fromVert:           word
+-*ispell*form.text.width:              194
+-*ispell*form.text.top:                        chainTop
+-*ispell*form.text.bottom:             chainTop
+-*ispell*form.text.left:                       chainLeft
+-*ispell*form.text.right:              chainRight
+-*ispell*form.text.leftMargin:         4
+-*ispell*form.text.?.pieceSize:                256
+-*ispell*suggestions.label:            Suggestions:
+-*ispell*suggestions.fromVert:         replacement
+-*ispell*suggestions.internalWidth:    0
+-*ispell*viewport.fromHoriz:           suggestions
+-*ispell*viewport.fromVert:            text
+-*ispell*viewport.width:                       194
+-*ispell*viewport.height:              143
+-*ispell*viewport.top:                 chainTop
+-*ispell*viewport.bottom:              chainBottom
+-*ispell*viewport.left:                        chainLeft
+-*ispell*viewport.right:                       chainRight
+-*ispell*viewport.forceBars:           1
+-*ispell*viewport.allowVert:           1
+-*ispell*list.defaultColumns:          1
+-*ispell*list.longest:                 16384
+-*ispell*commands.vertDistance:                5
+-*ispell*commands.fromVert:            suggestions
+-*ispell*commands.top:                 chainBottom
+-*ispell*commands.bottom:              chainBottom
+-*ispell*commands.right:                       chainLeft
+-*ispell*commands.left:                        chainLeft
+-*ispell*check.label:                  Check
+-*ispell*check.width:                  54
+-*ispell*check.tip:                    Ask ispell about the word in the text field
+-*ispell*look.label:                   Look
+-*ispell*look.fromHoriz:                       check
+-*ispell*look.horizDistance:           0
+-*ispell*look.width:                   46
+-*ispell*look.tip:                     Runs the look command
+-*ispell*undo.fromVert:                        check
+-*ispell*undo.label:                   Undo
+-*ispell*undo.width:                   102
+-*ispell*undo.tip:                     Undo last action
+-*ispell*replace.fromVert:             undo
+-*ispell*replace.label:                        Replace
+-*ispell*replace.tip:                  Replace occurence of the word
+-*ispell*replaceAll.fromVert:          undo
+-*ispell*replaceAll.fromHoriz:         replace
+-*ispell*replaceAll.label:             All
+-*ispell*replaceAll.tip:                       Replace all occurences of the word
+-*ispell*ignore.fromVert:              replace
+-*ispell*ignore.label:                 Ignore
+-*ispell*ignore.tip:                   Ignore this word
+-*ispell*ignoreAll.fromVert:           replaceAll
+-*ispell*ignoreAll.fromHoriz:          ignore
+-*ispell*ignoreAll.label:              All
+-*ispell*ignoreAll.tip:                        Ignore all ocurrences of the word
+-*ispell*add.fromVert:                 ignore
+-*ispell*add.label:                    Add
+-*ispell*add.width:                    50
+-*ispell*add.tip:                      Add word to your private dictionary
+-*ispell*addUncap.fromVert:            ignoreAll
+-*ispell*addUncap.fromHoriz:           add
+-*ispell*addUncap.label:                       Uncap
+-*ispell*addUncap.horizDistance:               0
+-*ispell*addUncap.width:                       50
+-*ispell*addUncap.tip:                 Add word uncapitalized, to your private dictionary
+-*ispell*suspend.fromVert:             add
+-*ispell*suspend.label:                        Suspend
+-*ispell*suspend.width:                        57
+-*ispell*suspend.tip:                  Suspend ispell execution
+-*ispell*cancel.fromHoriz:             suspend
+-*ispell*cancel.fromVert:              addUncap
+-*ispell*cancel.label:                 Close
+-*ispell*cancel.width:                 43
+-*ispell*cancel.horizDistance:         0
+-*ispell*cancel.tip:                   Terminates ispell process
+-*ispell*replace.width:                        65
+-*ispell*ignore.width:                 65
+-*ispell*replaceAll.width:             35
+-*ispell*replaceAll.horizDistance:     0
+-*ispell*ignoreAll.width:              35
+-*ispell*ignoreAll.horizDistance:      0
+-*ispell*terse.fromVert:                       cancel
+-*ispell*terse.Label:                  Terse Mode
+-*ispell*terse.width:                  104
+-*ispell*terse.borderWidth:            0
+-*ispell*terse.tip:                    Switch terse mode
+-*ispell*status.fromVert:              viewport
+-*ispell*status.fromHoriz:             suggestions
+-*ispell*status.top:                   chainBottom
+-*ispell*status.bottom:                        chainBottom
+-*ispell*status.left:                  chainLeft
+-*ispell*status.right:                 chainRight
+-*ispell*status.width:                 194
+-*ispell*status.borderWidth:           1
+-*ispell*status.justify:                       left
+-*ispell*status.internalHeight:                2
+-*ispell*status.vertDistance:          2
+-*ispell*options.fromVert:             status
+-*ispell*options.fromHoriz:            commands
+-*ispell*options.bottom:                       chainBottom
+-*ispell*options.top:                  chainBottom
+-*ispell*options.left:                 chainLeft
+-*ispell*options.right:                        chainRight
+-*ispell*options.dict.width:           121
+-*ispell*options.horizDistance:                2
+-*ispell*options.vertDistance:         2
+-*ispell*options.defaultDistance:      2
+-*ispell*dict.highlightThickness:      0
+-*ispell*dict.justify:                 left
+-*ispell*dict.resizable:                       False
+-*ispell*dict.leftBitmap:              menu12
+-*ispell*dict.label:                   Dictionary
+-*ispell*dict.tip:                     Change dictionary
+-*ispell*options.format.width:         65
+-*ispell*format.highlightThickness:    0
+-*ispell*format.justify:                       left
+-*ispell*format.resizable:             False
+-*ispell*format.leftBitmap:            menu12
+-*ispell*format.fromHoriz:             dict
+-*ispell*format.horizDistance:         0
+-*ispell*format.tip:                   Select text type
+-
+-*columns.minWidth:                    140
+-*columns.minHeight:                   76
+-*columns.maxWidth:                    140
+-*columns.maxHeight:                   76
+-*columns.form*defaultDistance:                4
+-*columns*left:                                chainLeft
+-*columns*right:                               chainLeft
+-*columns*top:                         chainTop
+-*columns*bottom:                      chainTop
+-*columns*Label.width:                 96
+-*columns*Label.borderWidth:           0
+-*columns*Label.internalHeight:                4
+-*columns*Label.internalWidth:         2
+-*columns*Label.justify:                       right
+-*columns*Text.width:                  30
+-*columns*Command.width:                       58
+-*columns*leftLabel.label:             Left Column:
+-*columns*left.fromHoriz:              leftLabel
+-*columns*rightLabel.label:            Right Column:
+-*columns*rightLabel.fromVert:         leftLabel
+-*columns*right.fromHoriz:             rightLabel
+-*columns*right.fromVert:              left
+-*columns*ok.fromVert:                 rightLabel
+-*columns*cancel.fromHoriz:            ok
+-*columns*cancel.fromVert:             rightLabel
+-*columns*cancel.horizDistance:                12
+-*columns*Text.?.pieceSize:            8
+-
+-*columns*Text.translations: #override \
+-c<Key>S:      no-op(r)\n\
+-c<Key>R:      no-op(r)\n\
+-m<Key>I:      no-op(r)\n\
+-<Key>Return:  set-columns(ok)\n\
+-<Key>Tab:     change-field()\n\
+-c<Key>G:      set-columns(cancel)\n\
+-<Key>Escape:  set-columns(cancel)\n\
+-<Enter>:      no-op()\n\
+-<Leave>:      no-op()\n\
+-<Btn1Down>:   set-keyboard-focus() select-start()
+-
+-*columns.translations:        #override \
+-<Message>WM_PROTOCOLS:        set-columns(cancel)
+-
+-! EOF.
+Index: x11-apps/xedit/app-defaults/Xedit-xprint
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ x11-apps/xedit/app-defaults/Xedit-xprint   2010-03-21 10:04:31.000000000 +0100
+@@ -0,0 +1,565 @@
++! $XFree86: xc/programs/xedit/Xedit.ad,v 1.23 2002/09/22 07:09:05 paulo Exp $
++
++*geometry:                            590x440
++*input:                                       TRUE
++*enableBackups:                               True
++*backupNameSuffix:                    ~
++*changedBitmap:                               xlogo11
++*international:                         True
++
++*hints:\
++Use Control-S and Control-R to Search.\n\
++Use Control-Shift-_ to Undo. Control-G to switch between Undo and Redo.\n\
++Use Control-A to jump to the beginning of the line.\n\
++Use Control-E to jump to the end of the line.\n\
++Use Control-T to transpose characters.\n\
++Use Control-K to cut to the end of the line. Control-Y to paste.\n\
++Use Control-Q to escape control characters.\n\
++Use Control-U[,<number>] to multiply actions. Control-G to cancel.\n\
++Use Control-Z to scroll one line up. Meta-Z to scroll one line down.\n\
++Use Meta-Q to format a paragraph.\n\
++Use Right-Button to extend selections.\n\
++Use Meta-I to insert a file.\n\
++Use Control-W to delete a selection, and/or jump to the selection mark.\n\
++Use Control-X,Control-F to find a file. Tab for filename completion.\n\
++Use Control-X,Control-S to save.\n\
++Use Control-X,Control-C to exit.\n\
++Use Control-C to paste the selection at CUT_BUFFER0.\n\
++Use Control Left-Button to popup the File Menu.\n\
++Use Control Middle-Button to popup the Edit Menu.\n\
++Use Control Right-Button to popup the Option Menu.\n\
++Use Control-X,Tab to Indent.\n\
++Use Control-X,0 to delete current splitted window.\n\
++Use Control-X,1 to delete other splitted window.\n\
++Use Control-X,2 to split the window vertically.\n\
++Use Control-X,3 to split the window horizontally.\n\
++Use Control-X,b to switch to another file.\n\
++Use Control-X,d to list directory. Control-G to Cancel.\n\
++Use Control-X,k to close file being edited.\n\
++Use Control-X,o to switch to another splitted window.\n\
++Use Control-X,u to undo. Control-G to switch between Undo and Redo.\n\
++Use Insert to toggle Overwrite mode.\n\
++Use Control-G to interrupt the lisp subprocess
++
++*formWindow*defaultDistance:          2
++*formWindow.?.borderWidth:            0
++*formWindow.min:                      18
++*formWindow.max:                      18
++*formWindow.showGrip:                 False
++*positionWindow.fromHoriz:            labelWindow
++*positionWindow.horizDistance:                0
++*positionWindow.left:                 chainRight
++*positionWindow.right:                        chainRight
++*positionWindow.width:                        90
++*positionWindow.label:                        error
++*positionWindow.justify:              left
++*labelWindow*justify:                 center
++*labelWindow*label:                   no file yet
++*labelWindow.left:                    chainLeft
++*labelWindow.right:                   chainRight
++
++*quit.label:                          Quit
++*quit.tip:                            Close xedit window
++*save.label:                          Save
++*save.tip:                            Save current file
++*load.label:                          Load
++*load.tip:                            Load a new file
++*print.label:                         Print
++*print.tip:                           Print current file
++
++*buttons*orientation:                 horizontal
++*buttons*showGrip:                    False
++*buttons.min:                         18
++
++*messageWindow.height:                        70
++*messageWindow.min:                   18
++*Paned*Text*allowResize:              True
++
++*messageWindow.autoFill:              False
++*messageWindow.scrollVertical:                Never
++
++*editWindow.autoFill:                 False
++*editWindow.scrollVertical:           Always
++*editWindow.showGrip:                 True
++xedit.textSource*enableUndo:          True
++
++*bc_label*label:                      Use Control-S and Control-R to Search.
++*bc_label*showGrip:                   False
++*bc_label.min:                                18
++
++*dirlabel.showGrip:                   False
++*dirlabel.min:                                18
++*dirlabel.max:                                18
++
++*dirwindow.defaultColumns:            0
++*dirwindow.verticalList:              True
++
++*viewport.forceBars:                  True
++*viewport.allowVert:                  1
++
++*insertFile*text.width:                       141
++*insertFile*text.?.pieceSize:         256
++*search*searchText.width:             157
++*search*replaceText.width:            157
++*search*case.horizDistance:           25
++*search*Text.?.pieceSize:             256
++
++*SimpleMenu.BackingStore:             NotUseful
++*SimpleMenu.menuLabel.vertSpace:      80
++*SimpleMenu.SmeBSB.HorizontalMargins: 16
++*SimpleMenu.justify:                  center
++*SimpleMenu.menuLabel.height:         250
++*SimpleMenu*cursor:                   left_ptr
++
++*fileMenu.label:                      File Menu
++*optionsMenu.label:                   Option Menu
++*optionsMenu.ispell.label:            ispell...
++*editMenu.label:                      Edit Menu
++*editMenu.wrapMenuItem.label:         Wrapping
++*editMenu.wrapMenuItem.leftBitmap:    menu12
++*wrapMenu.never.label:                        Never
++*wrapMenu.line.label:                 Line
++*wrapMenu.word.label:                 Word
++*editMenu.autoFill.label:             Auto Fill
++*editMenu.justifyMenuItem.label:      Justification
++*editMenu.justifyMenuItem.leftBitmap: menu12
++*justifyMenu.left.label:              Left
++*justifyMenu.right.label:             Right
++*justifyMenu.center.label:            Center
++*justifyMenu.full.label:              Full
++*editMenu.breakColumns.label:         Break Columns...
++*editMenu.scrollMenuItem.label:               Scrollbars
++*editMenu.scrollMenuItem.leftBitmap:  menu12
++*scrollMenu.vertical.label:           Vertical
++*scrollMenu.horizontal.label:         Horizontal
++*editMenu.modeMenuItem.leftBitmap:    menu12
++*editMenu.modeMenuItem.label:         Edit Mode
++*editModes.none.label:                        Plain/None
++
++*TransientShell*Text.translations: #override \
++c<Key>S:      no-op(r)\n\
++c<Key>R:      no-op(r)\n\
++m<Key>I:      no-op(r)
++
++*search.translations: #override \
++<Create>:get-values(my, $w, width, $h, height)\
++      set-values(1, minWidth, $w, minHeight, $h, maxHeight, $h, allowShellResize, False)
++
++*insertFile.title:                    Insert File
++*insertFile.translations: #override \
++<Create>:get-values(my, $w, width, $h, height)\
++      set-values(1, minWidth, $w, minHeight, $h, maxHeight, $h, allowShellResize, False)
++
++*baseTranslations: #override \
++<Ctrl>X,<Ctrl>C:quit()\n\
++<Ctrl>X,<Ctrl>S:save-file()\n\
++<Ctrl>X,<Ctrl>P:print-file()\n\
++<Ctrl>X,<Ctrl>F:find-file()\n\
++<Key>Escape:  line-edit()
++
++*messageWindow.Translations: #override \
++<Ctrl>X,<Ctrl>C:quit()\n\
++<Ctrl>X,<Ctrl>S:save-file()\n\
++<Ctrl>X,<Ctrl>P:print-file()\n\
++<Ctrl>X,<Ctrl>F:find-file()\n\
++<Enter>:      no-op()\n\
++<Leave>:      no-op()\n\
++<Btn1Down>:   set-keyboard-focus() select-start()
++
++*searchText.Translations: #override \
++<Enter>:      no-op()\n\
++<Leave>:      no-op()\n\
++<Btn1Down>:   set-keyboard-focus() select-start()
++
++*replaceText.Translations: #override \
++<Enter>:      no-op()\n\
++<Leave>:      no-op()\n\
++<Btn1Down>:   set-keyboard-focus() select-start()
++
++*editWindow.translations: #override \
++<Ctrl>X,<Ctrl>E:lisp-eval()\n\
++<Ctrl>X,<Key>Tab:indent()\n\
++<Ctrl>X,:<Key>0:delete-window(current)\n\
++<Ctrl>X,:<Key>1:delete-window(other)\n\
++<Ctrl>X,:<Key>2:split-window(vertical)\n\
++<Ctrl>X,:<Key>3:split-window(horizontal)\n\
++<Ctrl>X,!l @Num_Lock<Key>b:switch-source()\n\
++<Ctrl>X,!l <Key>b:switch-source()\n\
++<Ctrl>X,!@Num_Lock<Key>b:switch-source()\n\
++<Ctrl>X,!<Key>b:switch-source()\n\
++<Ctrl>X,!l @Num_Lock<Key>d:dir-window()\n\
++<Ctrl>X,!l <Key>d:dir-window()\n\
++<Ctrl>X,!@Num_Lock<Key>d:dir-window()\n\
++<Ctrl>X,!<Key>d:dir-window()\n\
++<Ctrl>X,!l @Num_Lock<Key>k:kill-file()\n\
++<Ctrl>X,!l <Key>k:kill-file()\n\
++<Ctrl>X,!@Num_Lock<Key>k:kill-file()\n\
++<Ctrl>X,!<Key>k:kill-file()\n\
++<Ctrl>X,!l @Num_Lock<Key>o:other-window()\n\
++<Ctrl>X,!l <Key>o:other-window()\n\
++<Ctrl>X,!@Num_Lock<Key>o:other-window()\n\
++<Ctrl>X,!<Key>o:other-window()\n\
++<Ctrl>X,!l @Num_Lock<Key>u:undo()\n\
++<Ctrl>X,!l <Key>u:undo()\n\
++<Ctrl>X,!@Num_Lock<Key>u:undo()\n\
++<Ctrl>X,!<Key>u:undo()\n\
++<Ctrl>G:      xedit-keyboard-reset()\n\
++<Ctrl>J:      xedit-print-lisp-eval()\n\
++<Key>Tab:     insert-char()\n\
++!l @Num_Lock<Key>b:insert-char()\n\
++!l <Key>b:    insert-char()\n\
++!@Num_Lock<Key>b:insert-char()\n\
++!<Key>b:      insert-char()\n\
++!l @Num_Lock<Key>d:insert-char()\n\
++!l <Key>d:    insert-char()\n\
++!@Num_Lock<Key>d:insert-char()\n\
++!<Key>d:      insert-char()\n\
++!l <Key>k:    insert-char()\n\
++!l @Num_Lock<Key>k:insert-char()\n\
++!@Num_Lock<Key>k:insert-char()\n\
++!<Key>k:      insert-char()\n\
++!l @Num_Lock<Key>o:insert-char()\n\
++!l <Key>o:    insert-char()\n\
++!@Num_Lock<Key>o:insert-char()\n\
++!<Key>o:      insert-char()\n\
++!l @Num_Lock<Key>u:insert-char()\n\
++!l <Key>u:    insert-char()\n\
++!@Num_Lock<Key>u:insert-char()\n\
++!<Key>u:      insert-char()\n\
++~s <Key>Insert:       toggle-overwrite()\n\
++c l @Num_Lock<Btn1Down>:xedit-focus() popup-menu(fileMenu)\n\
++c @Num_Lock<Btn1Down>:xedit-focus() popup-menu(fileMenu)\n\
++c l<Btn1Down>:        xedit-focus() popup-menu(fileMenu)\n\
++c<Btn1Down>:  xedit-focus() popup-menu(fileMenu)\n\
++c l @Num_Lock<Btn2Down>:xedit-focus() popup-menu(editMenu)\n\
++c @Num_Lock<Btn2Down>:xedit-focus() popup-menu(editMenu)\n\
++c l<Btn2Down>:        xedit-focus() popup-menu(editMenu)\n\
++c<Btn2Down>:  xedit-focus() popup-menu(editMenu)\n\
++c l @Num_Lock<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\
++c @Num_Lock<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\
++c l<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\
++c<Btn3Down>:  xedit-focus() popup-menu(optionsMenu)\n\
++<Btn1Down>:   xedit-focus() select-start()\n\
++<Btn4Down>:   scroll-one-line-down()\n\
++<Btn5Down>:   scroll-one-line-up()
++
++*filename.?.pieceSize:                        256
++*filename.translations: #override \
++c<Key>S:      no-op(r)\n\
++c<Key>R:      no-op(r)\n\
++m<Key>I:      no-op(r)\n\
++c<Key>G:      cancel-find-file()\n\
++<Key>Return:  load-file()\n\
++<Key>Tab:     file-completion(h)\n\
++<Key>Escape:  cancel-find-file()\n\
++<Enter>:      no-op()\n\
++<Leave>:      no-op()\n\
++<Btn1Down>:   set-keyboard-focus() select-start()
++
++*ispell.translations: #override \
++<Message>WM_PROTOCOLS:        ispell(end)
++
++! Sample dictionary, word chars and text mode resources setup
++!*ispell.dictionary:                  br
++!*ispell.dictionaries:                        br american americanmed+ english
++!*ispell*br.wordChars:                        áéíóúçÁÉÍÓÚÇàÀâêôÂÊÔüÜãõÃÕ-
++*ispell.ispellCommand:                        /usr/bin/aspell -B -m
++*ispell.lookCommand:                  /bin/egrep
++!*ispell*text.skipLines:              .#
++
++*ispell.geometry:                     0x0
++*ispell.minWidth:                     320
++*ispell.minHeight:                    245
++*ispell*Label.borderWidth:            0
++*ispell*Label.internalHeight:         4
++*ispell*Label.justify:                        right
++*ispell*Label.width:                  112
++*ispell*Label.left:                   chainLeft
++*ispell*Label.right:                  chainLeft
++*ispell*Label.top:                    chainTop
++*ispell*Label.bottom:                 chainTop
++*ispell*mispelled.label:              Misspelled word:
++*ispell*mispelled.top:                        chainTop
++*ispell*mispelled.bottom:             chainTop
++*ispell*mispelled.internalWidth:      0
++*ispell*repeated.label:                       Repeated words:
++*ispell*repeated.internalWidth:               0
++*ispell*replacement.label:            Replace with:
++*ispell*word.fromHoriz:                       mispelled
++*ispell*word.justify:                 left
++*ispell*word.borderWidth:             1
++*ispell*word.internalWidth:           4
++*ispell*word.internalHeight:          3
++*ispell*word.width:                   194
++*ispell*word.left:                    chainLeft
++*ispell*word.right:                   chainRight
++*ispell*word.top:                     chainTop
++*ispell*word.bottom:                  chainTop
++*ispell*word.label:
++*ispell*word.tip:                     Press here to select this text
++*ispell*word.highlightThickness:      0
++*ispell*text.fromHoriz:                       replacement
++*ispell*replacement.fromVert:         mispelled
++*ispell*replacement.internalWidth:    0
++*ispell*form.text.fromVert:           word
++*ispell*form.text.width:              194
++*ispell*form.text.top:                        chainTop
++*ispell*form.text.bottom:             chainTop
++*ispell*form.text.left:                       chainLeft
++*ispell*form.text.right:              chainRight
++*ispell*form.text.leftMargin:         4
++*ispell*form.text.?.pieceSize:                256
++*ispell*suggestions.label:            Suggestions:
++*ispell*suggestions.fromVert:         replacement
++*ispell*suggestions.internalWidth:    0
++*ispell*viewport.fromHoriz:           suggestions
++*ispell*viewport.fromVert:            text
++*ispell*viewport.width:                       194
++*ispell*viewport.height:              143
++*ispell*viewport.top:                 chainTop
++*ispell*viewport.bottom:              chainBottom
++*ispell*viewport.left:                        chainLeft
++*ispell*viewport.right:                       chainRight
++*ispell*viewport.forceBars:           1
++*ispell*viewport.allowVert:           1
++*ispell*list.defaultColumns:          1
++*ispell*list.longest:                 16384
++*ispell*commands.vertDistance:                5
++*ispell*commands.fromVert:            suggestions
++*ispell*commands.top:                 chainBottom
++*ispell*commands.bottom:              chainBottom
++*ispell*commands.right:                       chainLeft
++*ispell*commands.left:                        chainLeft
++*ispell*check.label:                  Check
++*ispell*check.width:                  54
++*ispell*check.tip:                    Ask ispell about the word in the text field
++*ispell*look.label:                   Look
++*ispell*look.fromHoriz:                       check
++*ispell*look.horizDistance:           0
++*ispell*look.width:                   46
++*ispell*look.tip:                     Runs the look command
++*ispell*undo.fromVert:                        check
++*ispell*undo.label:                   Undo
++*ispell*undo.width:                   102
++*ispell*undo.tip:                     Undo last action
++*ispell*replace.fromVert:             undo
++*ispell*replace.label:                        Replace
++*ispell*replace.tip:                  Replace occurence of the word
++*ispell*replaceAll.fromVert:          undo
++*ispell*replaceAll.fromHoriz:         replace
++*ispell*replaceAll.label:             All
++*ispell*replaceAll.tip:                       Replace all occurences of the word
++*ispell*ignore.fromVert:              replace
++*ispell*ignore.label:                 Ignore
++*ispell*ignore.tip:                   Ignore this word
++*ispell*ignoreAll.fromVert:           replaceAll
++*ispell*ignoreAll.fromHoriz:          ignore
++*ispell*ignoreAll.label:              All
++*ispell*ignoreAll.tip:                        Ignore all ocurrences of the word
++*ispell*add.fromVert:                 ignore
++*ispell*add.label:                    Add
++*ispell*add.width:                    50
++*ispell*add.tip:                      Add word to your private dictionary
++*ispell*addUncap.fromVert:            ignoreAll
++*ispell*addUncap.fromHoriz:           add
++*ispell*addUncap.label:                       Uncap
++*ispell*addUncap.horizDistance:               0
++*ispell*addUncap.width:                       50
++*ispell*addUncap.tip:                 Add word uncapitalized, to your private dictionary
++*ispell*suspend.fromVert:             add
++*ispell*suspend.label:                        Suspend
++*ispell*suspend.width:                        57
++*ispell*suspend.tip:                  Suspend ispell execution
++*ispell*cancel.fromHoriz:             suspend
++*ispell*cancel.fromVert:              addUncap
++*ispell*cancel.label:                 Close
++*ispell*cancel.width:                 43
++*ispell*cancel.horizDistance:         0
++*ispell*cancel.tip:                   Terminates ispell process
++*ispell*replace.width:                        65
++*ispell*ignore.width:                 65
++*ispell*replaceAll.width:             35
++*ispell*replaceAll.horizDistance:     0
++*ispell*ignoreAll.width:              35
++*ispell*ignoreAll.horizDistance:      0
++*ispell*terse.fromVert:                       cancel
++*ispell*terse.Label:                  Terse Mode
++*ispell*terse.width:                  104
++*ispell*terse.borderWidth:            0
++*ispell*terse.tip:                    Switch terse mode
++*ispell*status.fromVert:              viewport
++*ispell*status.fromHoriz:             suggestions
++*ispell*status.top:                   chainBottom
++*ispell*status.bottom:                        chainBottom
++*ispell*status.left:                  chainLeft
++*ispell*status.right:                 chainRight
++*ispell*status.width:                 194
++*ispell*status.borderWidth:           1
++*ispell*status.justify:                       left
++*ispell*status.internalHeight:                2
++*ispell*status.vertDistance:          2
++*ispell*options.fromVert:             status
++*ispell*options.fromHoriz:            commands
++*ispell*options.bottom:                       chainBottom
++*ispell*options.top:                  chainBottom
++*ispell*options.left:                 chainLeft
++*ispell*options.right:                        chainRight
++*ispell*options.dict.width:           121
++*ispell*options.horizDistance:                2
++*ispell*options.vertDistance:         2
++*ispell*options.defaultDistance:      2
++*ispell*dict.highlightThickness:      0
++*ispell*dict.justify:                 left
++*ispell*dict.resizable:                       False
++*ispell*dict.leftBitmap:              menu12
++*ispell*dict.label:                   Dictionary
++*ispell*dict.tip:                     Change dictionary
++*ispell*options.format.width:         65
++*ispell*format.highlightThickness:    0
++*ispell*format.justify:                       left
++*ispell*format.resizable:             False
++*ispell*format.leftBitmap:            menu12
++*ispell*format.fromHoriz:             dict
++*ispell*format.horizDistance:         0
++*ispell*format.tip:                   Select text type
++
++*columns.minWidth:                    140
++*columns.minHeight:                   76
++*columns.maxWidth:                    140
++*columns.maxHeight:                   76
++*columns.form*defaultDistance:                4
++*columns*left:                                chainLeft
++*columns*right:                               chainLeft
++*columns*top:                         chainTop
++*columns*bottom:                      chainTop
++*columns*Label.width:                 96
++*columns*Label.borderWidth:           0
++*columns*Label.internalHeight:                4
++*columns*Label.internalWidth:         2
++*columns*Label.justify:                       right
++*columns*Text.width:                  30
++*columns*Command.width:                       58
++*columns*leftLabel.label:             Left Column:
++*columns*left.fromHoriz:              leftLabel
++*columns*rightLabel.label:            Right Column:
++*columns*rightLabel.fromVert:         leftLabel
++*columns*right.fromHoriz:             rightLabel
++*columns*right.fromVert:              left
++*columns*ok.fromVert:                 rightLabel
++*columns*cancel.fromHoriz:            ok
++*columns*cancel.fromVert:             rightLabel
++*columns*cancel.horizDistance:                12
++*columns*Text.?.pieceSize:            8
++
++*columns*Text.translations: #override \
++c<Key>S:      no-op(r)\n\
++c<Key>R:      no-op(r)\n\
++m<Key>I:      no-op(r)\n\
++<Key>Return:  set-columns(ok)\n\
++<Key>Tab:     change-field()\n\
++c<Key>G:      set-columns(cancel)\n\
++<Key>Escape:  set-columns(cancel)\n\
++<Enter>:      no-op()\n\
++<Leave>:      no-op()\n\
++<Btn1Down>:   set-keyboard-focus() select-start()
++
++*columns.translations:        #override \
++<Message>WM_PROTOCOLS:        set-columns(cancel)
++
++! Use "white" as background for printing
++*printshell*background:   white
++
++! Print dialog
++*printdialogshell*geometry:                       600x120
++*printdialogshell*title:                          Print
++*printdialogshell*main*ok.fromVert:               innerform
++*printdialogshell*main*ok.label:                  Print
++*printdialogshell*main*ok.tip:                    Print
++*printdialogshell*main*setup.fromHoriz:           ok
++*printdialogshell*main*setup.fromVert:            innerform
++*printdialogshell*main*setup.label:               Setup...
++*printdialogshell*main*setup.tip:                 Configure print job options (page size, orientation, etc.)
++*printdialogshell*main*cancel.fromHoriz:          setup
++*printdialogshell*main*cancel.fromVert:           innerform
++*printdialogshell*main*cancel.label:              Cancel
++*printdialogshell*main*cancel.tip:                Cancel printing
++*printdialogshell*main*desclabel.label:           Printer Description:
++*printdialogshell*main*desclabel.tip:             Short description of printer
++*printdialogshell*main*desc.fromHoriz:            desclabel
++*printdialogshell*main*desc.tip:                  Short description of printer
++*printdialogshell*main*info.fromHoriz:            desc
++*printdialogshell*main*info.label:                Printer info...
++*printdialogshell*main*info.tip:                  Display additional information about this printer
++*printdialogshell*main*namelabel.fromVert:        desclabel
++*printdialogshell*main*namelabel.label:           Printer Name:
++*printdialogshell*main*namelabel.tip:             Name of selected printer
++*printdialogshell*main*name.fromHoriz:            namelabel
++*printdialogshell*main*name.fromVert:             desclabel
++*printdialogshell*main*name.tip:                  Name of selected printer
++*printdialogshell*main*selectprinter.fromHoriz:   name
++*printdialogshell*main*selectprinter.fromVert:    desclabel
++*printdialogshell*main*selectprinter.label:       Select Printer...
++*printdialogshell*main*selectprinter.label:       Select Printer...
++*printdialogshell*main*selectprinter.tip:         Select a different printer
++*printdialogshell*main*filenamelabel.fromVert:    namelabel
++*printdialogshell*main*filenamelabel.label:       File Name:
++*printdialogshell*main*filenamelabel.tip:         File where the output should be stored
++*printdialogshell*main*filename.fromHoriz:        filenamelabel
++*printdialogshell*main*filename.fromVert:         namelabel
++*printdialogshell*main*filename.tip:              File where the output should be stored
++*printdialogshell*main*selectfile.fromHoriz:      filename
++*printdialogshell*main*selectfile.fromVert:       namelabel
++*printdialogshell*main*selectfile.label:          Select File...
++*printdialogshell*main*selectfile.tip:            Select file where the output should be stored
++*printdialogshell*main*printtoprinter.fromVert:   filenamelabel
++*printdialogshell*main*printtoprinter.label:      Print to Printer
++*printdialogshell*main*printtoprinter.tip:        Send print job to printer
++*printdialogshell*main*printtofile.fromVert:      filenamelabel
++*printdialogshell*main*printtofile.fromHoriz:     printtoprinter
++*printdialogshell*main*printtofile.label:         Print to File
++*printdialogshell*main*printtofile.tip:           Save print job in a file
++
++! Print job options dialog
++*printdialogshell*setup*geometry:                     600x400
++*printdialogshell*setup*title:                        Print: Print job options
++*printdialogshell*setup*ok.fromVert:                  list
++*printdialogshell*setup*ok.label:                     OK
++*printdialogshell*setup*ok.tip:                       Commit changes
++*printdialogshell*setup*cancel.fromHoriz:             ok
++*printdialogshell*setup*cancel.fromVert:              list
++*printdialogshell*setup*cancel.label:                 Cancel
++*printdialogshell*setup*cancel.tip:                   Cancel and reset to defaults
++*printdialogshell*setup*paperlist.tip:                Select paper size
++*printdialogshell*setup*resolutionlist.fromHoriz:     paperlist
++*printdialogshell*setup*resolutionlist.tip:           Select page resolution
++*printdialogshell*setup*orientationlist.fromHoriz:    resolutionlist
++*printdialogshell*setup*orientationlist.tip:          Select page orientation
++*printdialogshell*setup*plexlist.fromHoriz:           orientationlist
++*printdialogshell*setup*plexlist.tip:                 Select page plex mode (simplex, duplex, etc.)
++*printdialogshell*setup*colorspacelist.fromHoriz:     plexlist
++*printdialogshell*setup*colorspacelist.tip:           Select color space (color, grayscale, CYMK, etc.)
++*printdialogshell*setup*jobcopieslabel.fromVert:      paperlist
++*printdialogshell*setup*jobcopieslabel.tip:           Set number of job copies
++*printdialogshell*setup*jobcopieslabel.label:         Job Copies:
++*printdialogshell*setup*jobcopies.fromHoriz:          jobcopieslabel
++*printdialogshell*setup*jobcopies.fromVert:           paperlist
++*printdialogshell*setup*jobcopies.tip:                Set number of job copies
++
++! Printer selection
++*printdialogshell*printerselection*geometry:          400x150
++*printdialogshell*printerselection*title:             Print: Select printer
++*printdialogshell*printerselection*ok.fromVert:       list
++*printdialogshell*printerselection*ok.label:          OK
++*printdialogshell*printerselection*ok.tip:            Switch printer
++*printdialogshell*printerselection*cancel.fromHoriz:  ok
++*printdialogshell*printerselection*cancel.fromVert:   list
++*printdialogshell*printerselection*cancel.label:      Cancel
++*printdialogshell*printerselection*cancel.tip:        Cancel printer selection
++*printdialogshell*printerselection*list.tip:          Select printer name from list
++
++! Select job file
++*printdialogshell*selectfile*geometry:          400x80
++*printdialogshell*selectfile*title:             Print: Select job file
++*printdialogshell*selectfile*dialog.label:      Select Filename:
++
++! EOF.
+Index: x11-apps/xedit/app-defaults/Xedit-xprint.ad
+===================================================================
+--- x11-apps.orig/xedit/app-defaults/Xedit-xprint.ad   2010-03-21 10:07:00.000000000 +0100
++++ /dev/null  1970-01-01 00:00:00.000000000 +0000
+@@ -1,565 +0,0 @@
+-! $XFree86: xc/programs/xedit/Xedit.ad,v 1.23 2002/09/22 07:09:05 paulo Exp $
+-
+-*geometry:                            590x440
+-*input:                                       TRUE
+-*enableBackups:                               True
+-*backupNameSuffix:                    ~
+-*changedBitmap:                               xlogo11
+-*international:                         True
+-
+-*hints:\
+-Use Control-S and Control-R to Search.\n\
+-Use Control-Shift-_ to Undo. Control-G to switch between Undo and Redo.\n\
+-Use Control-A to jump to the beginning of the line.\n\
+-Use Control-E to jump to the end of the line.\n\
+-Use Control-T to transpose characters.\n\
+-Use Control-K to cut to the end of the line. Control-Y to paste.\n\
+-Use Control-Q to escape control characters.\n\
+-Use Control-U[,<number>] to multiply actions. Control-G to cancel.\n\
+-Use Control-Z to scroll one line up. Meta-Z to scroll one line down.\n\
+-Use Meta-Q to format a paragraph.\n\
+-Use Right-Button to extend selections.\n\
+-Use Meta-I to insert a file.\n\
+-Use Control-W to delete a selection, and/or jump to the selection mark.\n\
+-Use Control-X,Control-F to find a file. Tab for filename completion.\n\
+-Use Control-X,Control-S to save.\n\
+-Use Control-X,Control-C to exit.\n\
+-Use Control-C to paste the selection at CUT_BUFFER0.\n\
+-Use Control Left-Button to popup the File Menu.\n\
+-Use Control Middle-Button to popup the Edit Menu.\n\
+-Use Control Right-Button to popup the Option Menu.\n\
+-Use Control-X,Tab to Indent.\n\
+-Use Control-X,0 to delete current splitted window.\n\
+-Use Control-X,1 to delete other splitted window.\n\
+-Use Control-X,2 to split the window vertically.\n\
+-Use Control-X,3 to split the window horizontally.\n\
+-Use Control-X,b to switch to another file.\n\
+-Use Control-X,d to list directory. Control-G to Cancel.\n\
+-Use Control-X,k to close file being edited.\n\
+-Use Control-X,o to switch to another splitted window.\n\
+-Use Control-X,u to undo. Control-G to switch between Undo and Redo.\n\
+-Use Insert to toggle Overwrite mode.\n\
+-Use Control-G to interrupt the lisp subprocess
+-
+-*formWindow*defaultDistance:          2
+-*formWindow.?.borderWidth:            0
+-*formWindow.min:                      18
+-*formWindow.max:                      18
+-*formWindow.showGrip:                 False
+-*positionWindow.fromHoriz:            labelWindow
+-*positionWindow.horizDistance:                0
+-*positionWindow.left:                 chainRight
+-*positionWindow.right:                        chainRight
+-*positionWindow.width:                        90
+-*positionWindow.label:                        error
+-*positionWindow.justify:              left
+-*labelWindow*justify:                 center
+-*labelWindow*label:                   no file yet
+-*labelWindow.left:                    chainLeft
+-*labelWindow.right:                   chainRight
+-
+-*quit.label:                          Quit
+-*quit.tip:                            Close xedit window
+-*save.label:                          Save
+-*save.tip:                            Save current file
+-*load.label:                          Load
+-*load.tip:                            Load a new file
+-*print.label:                         Print
+-*print.tip:                           Print current file
+-
+-*buttons*orientation:                 horizontal
+-*buttons*showGrip:                    False
+-*buttons.min:                         18
+-
+-*messageWindow.height:                        70
+-*messageWindow.min:                   18
+-*Paned*Text*allowResize:              True
+-
+-*messageWindow.autoFill:              False
+-*messageWindow.scrollVertical:                Never
+-
+-*editWindow.autoFill:                 False
+-*editWindow.scrollVertical:           Always
+-*editWindow.showGrip:                 True
+-xedit.textSource*enableUndo:          True
+-
+-*bc_label*label:                      Use Control-S and Control-R to Search.
+-*bc_label*showGrip:                   False
+-*bc_label.min:                                18
+-
+-*dirlabel.showGrip:                   False
+-*dirlabel.min:                                18
+-*dirlabel.max:                                18
+-
+-*dirwindow.defaultColumns:            0
+-*dirwindow.verticalList:              True
+-
+-*viewport.forceBars:                  True
+-*viewport.allowVert:                  1
+-
+-*insertFile*text.width:                       141
+-*insertFile*text.?.pieceSize:         256
+-*search*searchText.width:             157
+-*search*replaceText.width:            157
+-*search*case.horizDistance:           25
+-*search*Text.?.pieceSize:             256
+-
+-*SimpleMenu.BackingStore:             NotUseful
+-*SimpleMenu.menuLabel.vertSpace:      80
+-*SimpleMenu.SmeBSB.HorizontalMargins: 16
+-*SimpleMenu.justify:                  center
+-*SimpleMenu.menuLabel.height:         250
+-*SimpleMenu*cursor:                   left_ptr
+-
+-*fileMenu.label:                      File Menu
+-*optionsMenu.label:                   Option Menu
+-*optionsMenu.ispell.label:            ispell...
+-*editMenu.label:                      Edit Menu
+-*editMenu.wrapMenuItem.label:         Wrapping
+-*editMenu.wrapMenuItem.leftBitmap:    menu12
+-*wrapMenu.never.label:                        Never
+-*wrapMenu.line.label:                 Line
+-*wrapMenu.word.label:                 Word
+-*editMenu.autoFill.label:             Auto Fill
+-*editMenu.justifyMenuItem.label:      Justification
+-*editMenu.justifyMenuItem.leftBitmap: menu12
+-*justifyMenu.left.label:              Left
+-*justifyMenu.right.label:             Right
+-*justifyMenu.center.label:            Center
+-*justifyMenu.full.label:              Full
+-*editMenu.breakColumns.label:         Break Columns...
+-*editMenu.scrollMenuItem.label:               Scrollbars
+-*editMenu.scrollMenuItem.leftBitmap:  menu12
+-*scrollMenu.vertical.label:           Vertical
+-*scrollMenu.horizontal.label:         Horizontal
+-*editMenu.modeMenuItem.leftBitmap:    menu12
+-*editMenu.modeMenuItem.label:         Edit Mode
+-*editModes.none.label:                        Plain/None
+-
+-*TransientShell*Text.translations: #override \
+-c<Key>S:      no-op(r)\n\
+-c<Key>R:      no-op(r)\n\
+-m<Key>I:      no-op(r)
+-
+-*search.translations: #override \
+-<Create>:get-values(my, $w, width, $h, height)\
+-      set-values(1, minWidth, $w, minHeight, $h, maxHeight, $h, allowShellResize, False)
+-
+-*insertFile.title:                    Insert File
+-*insertFile.translations: #override \
+-<Create>:get-values(my, $w, width, $h, height)\
+-      set-values(1, minWidth, $w, minHeight, $h, maxHeight, $h, allowShellResize, False)
+-
+-*baseTranslations: #override \
+-<Ctrl>X,<Ctrl>C:quit()\n\
+-<Ctrl>X,<Ctrl>S:save-file()\n\
+-<Ctrl>X,<Ctrl>P:print-file()\n\
+-<Ctrl>X,<Ctrl>F:find-file()\n\
+-<Key>Escape:  line-edit()
+-
+-*messageWindow.Translations: #override \
+-<Ctrl>X,<Ctrl>C:quit()\n\
+-<Ctrl>X,<Ctrl>S:save-file()\n\
+-<Ctrl>X,<Ctrl>P:print-file()\n\
+-<Ctrl>X,<Ctrl>F:find-file()\n\
+-<Enter>:      no-op()\n\
+-<Leave>:      no-op()\n\
+-<Btn1Down>:   set-keyboard-focus() select-start()
+-
+-*searchText.Translations: #override \
+-<Enter>:      no-op()\n\
+-<Leave>:      no-op()\n\
+-<Btn1Down>:   set-keyboard-focus() select-start()
+-
+-*replaceText.Translations: #override \
+-<Enter>:      no-op()\n\
+-<Leave>:      no-op()\n\
+-<Btn1Down>:   set-keyboard-focus() select-start()
+-
+-*editWindow.translations: #override \
+-<Ctrl>X,<Ctrl>E:lisp-eval()\n\
+-<Ctrl>X,<Key>Tab:indent()\n\
+-<Ctrl>X,:<Key>0:delete-window(current)\n\
+-<Ctrl>X,:<Key>1:delete-window(other)\n\
+-<Ctrl>X,:<Key>2:split-window(vertical)\n\
+-<Ctrl>X,:<Key>3:split-window(horizontal)\n\
+-<Ctrl>X,!l @Num_Lock<Key>b:switch-source()\n\
+-<Ctrl>X,!l <Key>b:switch-source()\n\
+-<Ctrl>X,!@Num_Lock<Key>b:switch-source()\n\
+-<Ctrl>X,!<Key>b:switch-source()\n\
+-<Ctrl>X,!l @Num_Lock<Key>d:dir-window()\n\
+-<Ctrl>X,!l <Key>d:dir-window()\n\
+-<Ctrl>X,!@Num_Lock<Key>d:dir-window()\n\
+-<Ctrl>X,!<Key>d:dir-window()\n\
+-<Ctrl>X,!l @Num_Lock<Key>k:kill-file()\n\
+-<Ctrl>X,!l <Key>k:kill-file()\n\
+-<Ctrl>X,!@Num_Lock<Key>k:kill-file()\n\
+-<Ctrl>X,!<Key>k:kill-file()\n\
+-<Ctrl>X,!l @Num_Lock<Key>o:other-window()\n\
+-<Ctrl>X,!l <Key>o:other-window()\n\
+-<Ctrl>X,!@Num_Lock<Key>o:other-window()\n\
+-<Ctrl>X,!<Key>o:other-window()\n\
+-<Ctrl>X,!l @Num_Lock<Key>u:undo()\n\
+-<Ctrl>X,!l <Key>u:undo()\n\
+-<Ctrl>X,!@Num_Lock<Key>u:undo()\n\
+-<Ctrl>X,!<Key>u:undo()\n\
+-<Ctrl>G:      xedit-keyboard-reset()\n\
+-<Ctrl>J:      xedit-print-lisp-eval()\n\
+-<Key>Tab:     insert-char()\n\
+-!l @Num_Lock<Key>b:insert-char()\n\
+-!l <Key>b:    insert-char()\n\
+-!@Num_Lock<Key>b:insert-char()\n\
+-!<Key>b:      insert-char()\n\
+-!l @Num_Lock<Key>d:insert-char()\n\
+-!l <Key>d:    insert-char()\n\
+-!@Num_Lock<Key>d:insert-char()\n\
+-!<Key>d:      insert-char()\n\
+-!l <Key>k:    insert-char()\n\
+-!l @Num_Lock<Key>k:insert-char()\n\
+-!@Num_Lock<Key>k:insert-char()\n\
+-!<Key>k:      insert-char()\n\
+-!l @Num_Lock<Key>o:insert-char()\n\
+-!l <Key>o:    insert-char()\n\
+-!@Num_Lock<Key>o:insert-char()\n\
+-!<Key>o:      insert-char()\n\
+-!l @Num_Lock<Key>u:insert-char()\n\
+-!l <Key>u:    insert-char()\n\
+-!@Num_Lock<Key>u:insert-char()\n\
+-!<Key>u:      insert-char()\n\
+-~s <Key>Insert:       toggle-overwrite()\n\
+-c l @Num_Lock<Btn1Down>:xedit-focus() popup-menu(fileMenu)\n\
+-c @Num_Lock<Btn1Down>:xedit-focus() popup-menu(fileMenu)\n\
+-c l<Btn1Down>:        xedit-focus() popup-menu(fileMenu)\n\
+-c<Btn1Down>:  xedit-focus() popup-menu(fileMenu)\n\
+-c l @Num_Lock<Btn2Down>:xedit-focus() popup-menu(editMenu)\n\
+-c @Num_Lock<Btn2Down>:xedit-focus() popup-menu(editMenu)\n\
+-c l<Btn2Down>:        xedit-focus() popup-menu(editMenu)\n\
+-c<Btn2Down>:  xedit-focus() popup-menu(editMenu)\n\
+-c l @Num_Lock<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\
+-c @Num_Lock<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\
+-c l<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\
+-c<Btn3Down>:  xedit-focus() popup-menu(optionsMenu)\n\
+-<Btn1Down>:   xedit-focus() select-start()\n\
+-<Btn4Down>:   scroll-one-line-down()\n\
+-<Btn5Down>:   scroll-one-line-up()
+-
+-*filename.?.pieceSize:                        256
+-*filename.translations: #override \
+-c<Key>S:      no-op(r)\n\
+-c<Key>R:      no-op(r)\n\
+-m<Key>I:      no-op(r)\n\
+-c<Key>G:      cancel-find-file()\n\
+-<Key>Return:  load-file()\n\
+-<Key>Tab:     file-completion(h)\n\
+-<Key>Escape:  cancel-find-file()\n\
+-<Enter>:      no-op()\n\
+-<Leave>:      no-op()\n\
+-<Btn1Down>:   set-keyboard-focus() select-start()
+-
+-*ispell.translations: #override \
+-<Message>WM_PROTOCOLS:        ispell(end)
+-
+-! Sample dictionary, word chars and text mode resources setup
+-!*ispell.dictionary:                  br
+-!*ispell.dictionaries:                        br american americanmed+ english
+-!*ispell*br.wordChars:                        áéíóúçÁÉÍÓÚÇàÀâêôÂÊÔüÜãõÃÕ-
+-*ispell.ispellCommand:                        /usr/bin/aspell -B -m
+-*ispell.lookCommand:                  /bin/egrep
+-!*ispell*text.skipLines:              .#
+-
+-*ispell.geometry:                     0x0
+-*ispell.minWidth:                     320
+-*ispell.minHeight:                    245
+-*ispell*Label.borderWidth:            0
+-*ispell*Label.internalHeight:         4
+-*ispell*Label.justify:                        right
+-*ispell*Label.width:                  112
+-*ispell*Label.left:                   chainLeft
+-*ispell*Label.right:                  chainLeft
+-*ispell*Label.top:                    chainTop
+-*ispell*Label.bottom:                 chainTop
+-*ispell*mispelled.label:              Misspelled word:
+-*ispell*mispelled.top:                        chainTop
+-*ispell*mispelled.bottom:             chainTop
+-*ispell*mispelled.internalWidth:      0
+-*ispell*repeated.label:                       Repeated words:
+-*ispell*repeated.internalWidth:               0
+-*ispell*replacement.label:            Replace with:
+-*ispell*word.fromHoriz:                       mispelled
+-*ispell*word.justify:                 left
+-*ispell*word.borderWidth:             1
+-*ispell*word.internalWidth:           4
+-*ispell*word.internalHeight:          3
+-*ispell*word.width:                   194
+-*ispell*word.left:                    chainLeft
+-*ispell*word.right:                   chainRight
+-*ispell*word.top:                     chainTop
+-*ispell*word.bottom:                  chainTop
+-*ispell*word.label:
+-*ispell*word.tip:                     Press here to select this text
+-*ispell*word.highlightThickness:      0
+-*ispell*text.fromHoriz:                       replacement
+-*ispell*replacement.fromVert:         mispelled
+-*ispell*replacement.internalWidth:    0
+-*ispell*form.text.fromVert:           word
+-*ispell*form.text.width:              194
+-*ispell*form.text.top:                        chainTop
+-*ispell*form.text.bottom:             chainTop
+-*ispell*form.text.left:                       chainLeft
+-*ispell*form.text.right:              chainRight
+-*ispell*form.text.leftMargin:         4
+-*ispell*form.text.?.pieceSize:                256
+-*ispell*suggestions.label:            Suggestions:
+-*ispell*suggestions.fromVert:         replacement
+-*ispell*suggestions.internalWidth:    0
+-*ispell*viewport.fromHoriz:           suggestions
+-*ispell*viewport.fromVert:            text
+-*ispell*viewport.width:                       194
+-*ispell*viewport.height:              143
+-*ispell*viewport.top:                 chainTop
+-*ispell*viewport.bottom:              chainBottom
+-*ispell*viewport.left:                        chainLeft
+-*ispell*viewport.right:                       chainRight
+-*ispell*viewport.forceBars:           1
+-*ispell*viewport.allowVert:           1
+-*ispell*list.defaultColumns:          1
+-*ispell*list.longest:                 16384
+-*ispell*commands.vertDistance:                5
+-*ispell*commands.fromVert:            suggestions
+-*ispell*commands.top:                 chainBottom
+-*ispell*commands.bottom:              chainBottom
+-*ispell*commands.right:                       chainLeft
+-*ispell*commands.left:                        chainLeft
+-*ispell*check.label:                  Check
+-*ispell*check.width:                  54
+-*ispell*check.tip:                    Ask ispell about the word in the text field
+-*ispell*look.label:                   Look
+-*ispell*look.fromHoriz:                       check
+-*ispell*look.horizDistance:           0
+-*ispell*look.width:                   46
+-*ispell*look.tip:                     Runs the look command
+-*ispell*undo.fromVert:                        check
+-*ispell*undo.label:                   Undo
+-*ispell*undo.width:                   102
+-*ispell*undo.tip:                     Undo last action
+-*ispell*replace.fromVert:             undo
+-*ispell*replace.label:                        Replace
+-*ispell*replace.tip:                  Replace occurence of the word
+-*ispell*replaceAll.fromVert:          undo
+-*ispell*replaceAll.fromHoriz:         replace
+-*ispell*replaceAll.label:             All
+-*ispell*replaceAll.tip:                       Replace all occurences of the word
+-*ispell*ignore.fromVert:              replace
+-*ispell*ignore.label:                 Ignore
+-*ispell*ignore.tip:                   Ignore this word
+-*ispell*ignoreAll.fromVert:           replaceAll
+-*ispell*ignoreAll.fromHoriz:          ignore
+-*ispell*ignoreAll.label:              All
+-*ispell*ignoreAll.tip:                        Ignore all ocurrences of the word
+-*ispell*add.fromVert:                 ignore
+-*ispell*add.label:                    Add
+-*ispell*add.width:                    50
+-*ispell*add.tip:                      Add word to your private dictionary
+-*ispell*addUncap.fromVert:            ignoreAll
+-*ispell*addUncap.fromHoriz:           add
+-*ispell*addUncap.label:                       Uncap
+-*ispell*addUncap.horizDistance:               0
+-*ispell*addUncap.width:                       50
+-*ispell*addUncap.tip:                 Add word uncapitalized, to your private dictionary
+-*ispell*suspend.fromVert:             add
+-*ispell*suspend.label:                        Suspend
+-*ispell*suspend.width:                        57
+-*ispell*suspend.tip:                  Suspend ispell execution
+-*ispell*cancel.fromHoriz:             suspend
+-*ispell*cancel.fromVert:              addUncap
+-*ispell*cancel.label:                 Close
+-*ispell*cancel.width:                 43
+-*ispell*cancel.horizDistance:         0
+-*ispell*cancel.tip:                   Terminates ispell process
+-*ispell*replace.width:                        65
+-*ispell*ignore.width:                 65
+-*ispell*replaceAll.width:             35
+-*ispell*replaceAll.horizDistance:     0
+-*ispell*ignoreAll.width:              35
+-*ispell*ignoreAll.horizDistance:      0
+-*ispell*terse.fromVert:                       cancel
+-*ispell*terse.Label:                  Terse Mode
+-*ispell*terse.width:                  104
+-*ispell*terse.borderWidth:            0
+-*ispell*terse.tip:                    Switch terse mode
+-*ispell*status.fromVert:              viewport
+-*ispell*status.fromHoriz:             suggestions
+-*ispell*status.top:                   chainBottom
+-*ispell*status.bottom:                        chainBottom
+-*ispell*status.left:                  chainLeft
+-*ispell*status.right:                 chainRight
+-*ispell*status.width:                 194
+-*ispell*status.borderWidth:           1
+-*ispell*status.justify:                       left
+-*ispell*status.internalHeight:                2
+-*ispell*status.vertDistance:          2
+-*ispell*options.fromVert:             status
+-*ispell*options.fromHoriz:            commands
+-*ispell*options.bottom:                       chainBottom
+-*ispell*options.top:                  chainBottom
+-*ispell*options.left:                 chainLeft
+-*ispell*options.right:                        chainRight
+-*ispell*options.dict.width:           121
+-*ispell*options.horizDistance:                2
+-*ispell*options.vertDistance:         2
+-*ispell*options.defaultDistance:      2
+-*ispell*dict.highlightThickness:      0
+-*ispell*dict.justify:                 left
+-*ispell*dict.resizable:                       False
+-*ispell*dict.leftBitmap:              menu12
+-*ispell*dict.label:                   Dictionary
+-*ispell*dict.tip:                     Change dictionary
+-*ispell*options.format.width:         65
+-*ispell*format.highlightThickness:    0
+-*ispell*format.justify:                       left
+-*ispell*format.resizable:             False
+-*ispell*format.leftBitmap:            menu12
+-*ispell*format.fromHoriz:             dict
+-*ispell*format.horizDistance:         0
+-*ispell*format.tip:                   Select text type
+-
+-*columns.minWidth:                    140
+-*columns.minHeight:                   76
+-*columns.maxWidth:                    140
+-*columns.maxHeight:                   76
+-*columns.form*defaultDistance:                4
+-*columns*left:                                chainLeft
+-*columns*right:                               chainLeft
+-*columns*top:                         chainTop
+-*columns*bottom:                      chainTop
+-*columns*Label.width:                 96
+-*columns*Label.borderWidth:           0
+-*columns*Label.internalHeight:                4
+-*columns*Label.internalWidth:         2
+-*columns*Label.justify:                       right
+-*columns*Text.width:                  30
+-*columns*Command.width:                       58
+-*columns*leftLabel.label:             Left Column:
+-*columns*left.fromHoriz:              leftLabel
+-*columns*rightLabel.label:            Right Column:
+-*columns*rightLabel.fromVert:         leftLabel
+-*columns*right.fromHoriz:             rightLabel
+-*columns*right.fromVert:              left
+-*columns*ok.fromVert:                 rightLabel
+-*columns*cancel.fromHoriz:            ok
+-*columns*cancel.fromVert:             rightLabel
+-*columns*cancel.horizDistance:                12
+-*columns*Text.?.pieceSize:            8
+-
+-*columns*Text.translations: #override \
+-c<Key>S:      no-op(r)\n\
+-c<Key>R:      no-op(r)\n\
+-m<Key>I:      no-op(r)\n\
+-<Key>Return:  set-columns(ok)\n\
+-<Key>Tab:     change-field()\n\
+-c<Key>G:      set-columns(cancel)\n\
+-<Key>Escape:  set-columns(cancel)\n\
+-<Enter>:      no-op()\n\
+-<Leave>:      no-op()\n\
+-<Btn1Down>:   set-keyboard-focus() select-start()
+-
+-*columns.translations:        #override \
+-<Message>WM_PROTOCOLS:        set-columns(cancel)
+-
+-! Use "white" as background for printing
+-*printshell*background:   white
+-
+-! Print dialog
+-*printdialogshell*geometry:                       600x120
+-*printdialogshell*title:                          Print
+-*printdialogshell*main*ok.fromVert:               innerform
+-*printdialogshell*main*ok.label:                  Print
+-*printdialogshell*main*ok.tip:                    Print
+-*printdialogshell*main*setup.fromHoriz:           ok
+-*printdialogshell*main*setup.fromVert:            innerform
+-*printdialogshell*main*setup.label:               Setup...
+-*printdialogshell*main*setup.tip:                 Configure print job options (page size, orientation, etc.)
+-*printdialogshell*main*cancel.fromHoriz:          setup
+-*printdialogshell*main*cancel.fromVert:           innerform
+-*printdialogshell*main*cancel.label:              Cancel
+-*printdialogshell*main*cancel.tip:                Cancel printing
+-*printdialogshell*main*desclabel.label:           Printer Description:
+-*printdialogshell*main*desclabel.tip:             Short description of printer
+-*printdialogshell*main*desc.fromHoriz:            desclabel
+-*printdialogshell*main*desc.tip:                  Short description of printer
+-*printdialogshell*main*info.fromHoriz:            desc
+-*printdialogshell*main*info.label:                Printer info...
+-*printdialogshell*main*info.tip:                  Display additional information about this printer
+-*printdialogshell*main*namelabel.fromVert:        desclabel
+-*printdialogshell*main*namelabel.label:           Printer Name:
+-*printdialogshell*main*namelabel.tip:             Name of selected printer
+-*printdialogshell*main*name.fromHoriz:            namelabel
+-*printdialogshell*main*name.fromVert:             desclabel
+-*printdialogshell*main*name.tip:                  Name of selected printer
+-*printdialogshell*main*selectprinter.fromHoriz:   name
+-*printdialogshell*main*selectprinter.fromVert:    desclabel
+-*printdialogshell*main*selectprinter.label:       Select Printer...
+-*printdialogshell*main*selectprinter.label:       Select Printer...
+-*printdialogshell*main*selectprinter.tip:         Select a different printer
+-*printdialogshell*main*filenamelabel.fromVert:    namelabel
+-*printdialogshell*main*filenamelabel.label:       File Name:
+-*printdialogshell*main*filenamelabel.tip:         File where the output should be stored
+-*printdialogshell*main*filename.fromHoriz:        filenamelabel
+-*printdialogshell*main*filename.fromVert:         namelabel
+-*printdialogshell*main*filename.tip:              File where the output should be stored
+-*printdialogshell*main*selectfile.fromHoriz:      filename
+-*printdialogshell*main*selectfile.fromVert:       namelabel
+-*printdialogshell*main*selectfile.label:          Select File...
+-*printdialogshell*main*selectfile.tip:            Select file where the output should be stored
+-*printdialogshell*main*printtoprinter.fromVert:   filenamelabel
+-*printdialogshell*main*printtoprinter.label:      Print to Printer
+-*printdialogshell*main*printtoprinter.tip:        Send print job to printer
+-*printdialogshell*main*printtofile.fromVert:      filenamelabel
+-*printdialogshell*main*printtofile.fromHoriz:     printtoprinter
+-*printdialogshell*main*printtofile.label:         Print to File
+-*printdialogshell*main*printtofile.tip:           Save print job in a file
+-
+-! Print job options dialog
+-*printdialogshell*setup*geometry:                     600x400
+-*printdialogshell*setup*title:                        Print: Print job options
+-*printdialogshell*setup*ok.fromVert:                  list
+-*printdialogshell*setup*ok.label:                     OK
+-*printdialogshell*setup*ok.tip:                       Commit changes
+-*printdialogshell*setup*cancel.fromHoriz:             ok
+-*printdialogshell*setup*cancel.fromVert:              list
+-*printdialogshell*setup*cancel.label:                 Cancel
+-*printdialogshell*setup*cancel.tip:                   Cancel and reset to defaults
+-*printdialogshell*setup*paperlist.tip:                Select paper size
+-*printdialogshell*setup*resolutionlist.fromHoriz:     paperlist
+-*printdialogshell*setup*resolutionlist.tip:           Select page resolution
+-*printdialogshell*setup*orientationlist.fromHoriz:    resolutionlist
+-*printdialogshell*setup*orientationlist.tip:          Select page orientation
+-*printdialogshell*setup*plexlist.fromHoriz:           orientationlist
+-*printdialogshell*setup*plexlist.tip:                 Select page plex mode (simplex, duplex, etc.)
+-*printdialogshell*setup*colorspacelist.fromHoriz:     plexlist
+-*printdialogshell*setup*colorspacelist.tip:           Select color space (color, grayscale, CYMK, etc.)
+-*printdialogshell*setup*jobcopieslabel.fromVert:      paperlist
+-*printdialogshell*setup*jobcopieslabel.tip:           Set number of job copies
+-*printdialogshell*setup*jobcopieslabel.label:         Job Copies:
+-*printdialogshell*setup*jobcopies.fromHoriz:          jobcopieslabel
+-*printdialogshell*setup*jobcopies.fromVert:           paperlist
+-*printdialogshell*setup*jobcopies.tip:                Set number of job copies
+-
+-! Printer selection
+-*printdialogshell*printerselection*geometry:          400x150
+-*printdialogshell*printerselection*title:             Print: Select printer
+-*printdialogshell*printerselection*ok.fromVert:       list
+-*printdialogshell*printerselection*ok.label:          OK
+-*printdialogshell*printerselection*ok.tip:            Switch printer
+-*printdialogshell*printerselection*cancel.fromHoriz:  ok
+-*printdialogshell*printerselection*cancel.fromVert:   list
+-*printdialogshell*printerselection*cancel.label:      Cancel
+-*printdialogshell*printerselection*cancel.tip:        Cancel printer selection
+-*printdialogshell*printerselection*list.tip:          Select printer name from list
+-
+-! Select job file
+-*printdialogshell*selectfile*geometry:          400x80
+-*printdialogshell*selectfile*title:             Print: Select job file
+-*printdialogshell*selectfile*dialog.label:      Select Filename:
+-
+-! EOF.
diff --git a/debian/patches/02_xedit_manpage_typos.diff b/debian/patches/02_xedit_manpage_typos.diff
new file mode 100644 (file)
index 0000000..f20b400
--- /dev/null
@@ -0,0 +1,22 @@
+Index: xbase-clients/xedit/xedit.man
+===================================================================
+--- xbase-clients.orig/xedit/xedit.man 2006-02-18 14:56:14.000000000 -0500
++++ xbase-clients/xedit/xedit.man      2006-02-26 20:37:32.000000000 -0500
+@@ -291,7 +291,7 @@
+ .B autoReplace (\fPClass \fBReplace)
+ This resource is useful to automatically correct common misspelling errors, but
+ can also be used to create simple macros. The format is
+-\fI{non-blanks}{blanks}[{string}]\fP. Fields are separeted by newlines.
++\fI{non-blanks}{blanks}[{string}]\fP. Fields are separated by newlines.
+ Example of use:
+ \"
+ .br
+@@ -308,7 +308,7 @@
+ when you type that words.
+ .TP 8
+ .B ispell.dictionaries (\fPClass \fBispell.Dictionary)
+-Specifies a list of dictionary names, separeted by spaces, available to the
++Specifies a list of dictionary names, separated by spaces, available to the
+ ispell program. The default value is \fI"american americamed+ english"\fP.
+ .TP 8
+ .B ispell.dictionary (\fPClass \fBispell.Dictionary)
diff --git a/debian/patches/03_xconsole_implicit_pointer_conversion.diff b/debian/patches/03_xconsole_implicit_pointer_conversion.diff
new file mode 100644 (file)
index 0000000..2cc8903
--- /dev/null
@@ -0,0 +1,16 @@
+---
+ xconsole/xconsole.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+Index: x11-apps/xconsole/xconsole.c
+===================================================================
+--- x11-apps.orig/xconsole/xconsole.c  2009-07-27 18:42:39.000000000 +0200
++++ x11-apps/xconsole/xconsole.c       2009-12-06 11:57:56.000000000 +0100
+@@ -32,6 +32,7 @@
+ #include "config.h"
+ #endif
++#define _XOPEN_SOURCE
+ #include <X11/Intrinsic.h>
+ #include <X11/StringDefs.h>
+ #include <X11/Xatom.h>
diff --git a/debian/patches/05_xmore_fix_segv_without_xprint.diff b/debian/patches/05_xmore_fix_segv_without_xprint.diff
new file mode 100644 (file)
index 0000000..cbcc3d5
--- /dev/null
@@ -0,0 +1,34 @@
+This patch by Eugene Konev.
+
+---
+ xmore/xmore.c |    9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+Index: x11-apps/xmore/xmore.c
+===================================================================
+--- x11-apps.orig/xmore/xmore.c        2009-12-06 11:58:01.000000000 +0100
++++ x11-apps/xmore/xmore.c     2009-12-06 11:58:14.000000000 +0100
+@@ -150,7 +150,9 @@
+ static void
+ printshellDestroyXtProc(Widget w, XtPointer client_data, XtPointer callData)
+ {
++#ifdef USE_XPRINT
+     XawPrintDialogClosePrinterConnection(printdialog, False);
++#endif
+ }
+ #ifdef USE_XPRINT
+@@ -302,7 +304,12 @@
+ #endif
+   
+   n = 0;
+-  XtSetArg(args[n], XtNfromHoriz,       printbutton);            n++;
++#ifdef USE_XPRINT
++  XtSetArg(args[n], XtNfromHoriz,       printbutton);
++#else
++  XtSetArg(args[n], XtNfromHoriz,       NULL);
++#endif
++  n++;
+   XtSetArg(args[n], XtNfromVert,        text);                   n++;
+   XtSetArg(args[n], XtNlabel,           "Quit");      n++;
+   quitbutton = XtCreateManagedWidget("quit", commandWidgetClass, form, args, n);
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644 (file)
index 0000000..e94bd24
--- /dev/null
@@ -0,0 +1,4 @@
+01_xedit_mkdir_races.diff
+#02_xedit_manpage_typos.diff
+03_xconsole_implicit_pointer_conversion.diff
+05_xmore_fix_segv_without_xprint.diff
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..abb6313
--- /dev/null
@@ -0,0 +1,114 @@
+#!/usr/bin/make -f
+# debian/rules for the Debian xutils package.
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>
+# Copyright © 2005 Daniel Stone <daniel@fooishbar.org>
+# Copyright © 2005 David Nusinow <dnusinow@debian.org>
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# set this to the name of the main shlib's binary package
+PACKAGE = x11-apps
+
+include debian/xsfbs/xsfbs.mk
+
+# This package contains multiple modules as shipped by upstream. Each module is # contained in a subdirectory in the root dir of the package. You must list each
+# subdirectory explicitly so that the build system knows what to build
+# [soolim:20110111] : do not generate binaries not te be needed
+DEF_SUBDIRS=bitmap ico oclock xcalc xclock xeyes xwd xwud
+#DEF_SUBDIRS=bitmap ico oclock x11perf xbiff xcalc xclipboard xclock xconsole xcursorgen xditview xedit xeyes xgc xload xlogo xmag xman xmore xwd xwud
+SUBDIRS=$(DEF_SUBDIRS)
+BUILD_STAMPS = $(addprefix $(STAMP_DIR)/build-,$(SUBDIRS))
+
+CFLAGS = -Wall -g
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -O0
+else
+       CFLAGS += -O2
+endif
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+       NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+       MAKEFLAGS += -j$(NUMJOBS)
+endif
+
+#############################################################################
+# [soolim]: for xwd, do not check the multi vis. we cannot dump the window.
+CFLAGS += -D_F_BLOCK_MULTI_VIS_
+#############################################################################
+
+DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
+       confflags += --build=$(DEB_HOST_GNU_TYPE)
+else
+       confflags += --build=$(DEB_HOST_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
+endif
+
+build: build-stamp
+build-stamp: $(BUILD_STAMPS)
+       >$@
+
+$(STAMP_DIR)/build-%: $(STAMP_DIR)/genscripts $(STAMP_DIR)/patch
+       mkdir -p $*-obj-$(DEB_BUILD_GNU_TYPE)
+
+       cd $*-obj-$(DEB_BUILD_GNU_TYPE) && \
+       ../$*/configure --prefix=/usr --mandir=\$${prefix}/share/man \
+         --infodir=\$${prefix}/share/info $(confflags) \
+         --disable-xprint \
+         --with-sysmanpath=/usr/man:/usr/share/man:/usr/local/man:/usr/local/share/man:/usr/X11R6/man:/opt/man \
+         CFLAGS="$(CFLAGS)" \
+         RSH=rsh \
+         MANCONF="/etc/manpath.config"
+       cd $*-obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
+       >$@
+
+clean: xsfclean
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp
+
+       rm -f config.cache config.log config.status
+       rm -f */config.cache */config.log */config.status
+       rm -f conftest* */conftest*
+       rm -rf autom4te.cache */autom4te.cache
+       rm -rf *-obj-*
+
+       dh_clean
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k
+       dh_installdirs
+
+       for FILE in $(SUBDIRS); do \
+               cd "$$FILE"-obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install ; \
+               cd ..; \
+       done
+
+# Build architecture-dependent files here.
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+
+#      dh_installdocs
+       dh_install --sourcedir=debian/tmp --list-missing
+#      dh_installmenu
+#      dh_installchangelogs
+       dh_link
+       dh_strip
+       dh_compress
+       dh_fixperms
+       dh_installdeb
+       dh_shlibdeps
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+# Build architecture-independent files here.
+binary-indep: build install
+# Nothing to do
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
diff --git a/debian/watch.bitmap b/debian/watch.bitmap
new file mode 100644 (file)
index 0000000..c1ae0f1
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ bitmap-(.*)\.tar\.gz
diff --git a/debian/watch.ico b/debian/watch.ico
new file mode 100644 (file)
index 0000000..78dbdd3
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ ico-(.*)\.tar\.gz
diff --git a/debian/watch.oclock b/debian/watch.oclock
new file mode 100644 (file)
index 0000000..1650bce
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ oclock-(.*)\.tar\.gz
diff --git a/debian/watch.x11perf b/debian/watch.x11perf
new file mode 100644 (file)
index 0000000..5d1af0d
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ x11perf-(.*)\.tar\.gz
diff --git a/debian/watch.xbiff b/debian/watch.xbiff
new file mode 100644 (file)
index 0000000..cf308fc
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ xbiff-(.*)\.tar\.gz
diff --git a/debian/watch.xcalc b/debian/watch.xcalc
new file mode 100644 (file)
index 0000000..c201a3c
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ xcalc-(.*)\.tar\.gz
diff --git a/debian/watch.xclipboard b/debian/watch.xclipboard
new file mode 100644 (file)
index 0000000..8e2a393
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ xclipboard-(.*)\.tar\.gz
diff --git a/debian/watch.xclock b/debian/watch.xclock
new file mode 100644 (file)
index 0000000..19c04c6
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ xclock-(.*)\.tar\.gz
diff --git a/debian/watch.xconsole b/debian/watch.xconsole
new file mode 100644 (file)
index 0000000..5f3dec2
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ xconsole-(.*)\.tar\.gz
diff --git a/debian/watch.xcursorgen b/debian/watch.xcursorgen
new file mode 100644 (file)
index 0000000..e0924df
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ xcursorgen-(.*)\.tar\.gz
diff --git a/debian/watch.xditview b/debian/watch.xditview
new file mode 100644 (file)
index 0000000..d8a1548
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ xditview-(.*)\.tar\.gz
diff --git a/debian/watch.xedit b/debian/watch.xedit
new file mode 100644 (file)
index 0000000..2586adc
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ xedit-(.*)\.tar\.gz
diff --git a/debian/watch.xeyes b/debian/watch.xeyes
new file mode 100644 (file)
index 0000000..dbf235d
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ xeyes-(.*)\.tar\.gz
diff --git a/debian/watch.xgc b/debian/watch.xgc
new file mode 100644 (file)
index 0000000..3df6bc8
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ xgc-(.*)\.tar\.gz
diff --git a/debian/watch.xload b/debian/watch.xload
new file mode 100644 (file)
index 0000000..d87337e
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ xload-(.*)\.tar\.gz
diff --git a/debian/watch.xlogo b/debian/watch.xlogo
new file mode 100644 (file)
index 0000000..cb50a3e
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ xlogo-(.*)\.tar\.gz
diff --git a/debian/watch.xmag b/debian/watch.xmag
new file mode 100644 (file)
index 0000000..faa17c7
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ xmag-(.*)\.tar\.gz
diff --git a/debian/watch.xman b/debian/watch.xman
new file mode 100644 (file)
index 0000000..228becb
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ xman-(.*)\.tar\.gz
diff --git a/debian/watch.xmore b/debian/watch.xmore
new file mode 100644 (file)
index 0000000..b445dae
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ xmore-(.*)\.tar\.gz
diff --git a/debian/watch.xwd b/debian/watch.xwd
new file mode 100644 (file)
index 0000000..5221a50
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ xwd-(.*)\.tar\.gz
diff --git a/debian/watch.xwud b/debian/watch.xwud
new file mode 100644 (file)
index 0000000..fe8ee18
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://xorg.freedesktop.org/releases/individual/app/ xwud-(.*)\.tar\.gz
diff --git a/debian/x11-apps.install b/debian/x11-apps.install
new file mode 100644 (file)
index 0000000..faa5799
--- /dev/null
@@ -0,0 +1,3 @@
+usr/bin/*
+usr/include/X11/bitmaps/*
+etc/X11/app-defaults/*
diff --git a/debian/x11-apps.menu b/debian/x11-apps.menu
new file mode 100644 (file)
index 0000000..c19eac5
--- /dev/null
@@ -0,0 +1,97 @@
+?package(x11-apps):\
+ needs="x11"\
+ section="Games/Toys"\
+ hints="Clocks"\
+ longtitle="Oclock: analog clock for X"\
+ title="Oclock"\
+ command="oclock"
+?package(x11-apps):\
+ needs="x11"\
+ section="Applications/Network/Communication"\
+ hints="Mail"\
+ longtitle="Xbiff: mailbox flag for X"\
+ title="Xbiff"\
+ command="xbiff"
+?package(x11-apps):\
+ needs="x11"\
+ section="Applications/Science/Mathematics"\
+ hints="Calculators"\
+ longtitle="Xcalc: scientific calculator for X"\
+ title="Xcalc"\
+ command="xcalc"
+?package(x11-apps):\
+ needs="x11"\
+ section="Applications/System/Administration"\
+ longtitle="Xclipboard: clipboard for text cut and paste operations in X"\
+ title="Xclipboard"\
+ command="xclipboard"
+?package(x11-apps):\
+ needs="x11"\
+ section="Games/Toys"\
+ hints="Clocks"\
+ longtitle="Xclock (analog): analog clock for X"\
+ title="Xclock (analog)"\
+ command="xclock -analog"
+?package(x11-apps):\
+ needs="x11"\
+ section="Games/Toys"\
+ hints="Clocks"\
+ longtitle="Xclock (digital): digital clock for X"\
+ title="Xclock (digital)"\
+ command="xclock -digital -update 1"
+?package(x11-apps):\
+ needs="x11"\
+ section="Applications/System/Monitoring"\
+ longtitle="Xconsole: monitor system console messages with X"\
+ title="Xconsole"\
+ command="xconsole -file /dev/xconsole"
+?package(x11-apps):\
+ needs="x11"\
+ section="Applications/Viewers"\
+ hints="Troff"\
+ longtitle="Xditview: a ditroff file viewer for X"\
+ title="Xditview"\
+ command="xditview"
+?package(x11-apps):\
+ needs="x11"\
+ section="Applications/Editors"\
+ longtitle="Xedit: a simple text editor for X"\
+ title="Xedit"\
+ command="xedit"
+?package(x11-apps):\
+ needs="x11"\
+ section="Games/Toys"\
+ longtitle="Xeyes: demo in which a pair of eyes follow the mouse pointer in X"\
+ title="Xeyes"\
+ command="xeyes"
+?package(x11-apps):\
+ needs="x11"\
+ section="Applications/System/Monitoring"\
+ longtitle="Xload: system load average display for X"\
+ title="Xload"\
+ command="xload"
+?package(x11-apps):\
+ needs="x11"\
+ section="Games/Toys"\
+ longtitle="Xlogo: demo which displays the X logo"\
+ title="Xlogo"\
+ command="xlogo"
+?package(x11-apps):\
+ needs="x11"\
+ section="Applications/Accessibility"\
+ longtitle="Xmag: magnify parts of the X screen"\
+ title="Xmag"\
+ command="xmag"
+?package(x11-apps):\
+ needs="x11"\
+ section="Help"\
+ longtitle="Xman: manual page browser for X"\
+ title="Xman"\
+ command="xman"
+?package(x11-apps):\
+ needs="x11"\
+ section="Applications/Graphics"\
+ hints="Screenshot"\
+ longtitle="X Window Snapshot: take snapshot of any X window (xwd|xwud)"\
+ title="X Window Snapshot"\
+ command="xwd | xwud"
diff --git a/debian/xsfbs/repack.sh b/debian/xsfbs/repack.sh
new file mode 100755 (executable)
index 0000000..5935cc9
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+set -e
+
+if ! [ -d debian/prune ]; then
+       exit 0
+fi
+
+if [ "x$1" != x--upstream-version ]; then
+       exit 1
+fi
+
+version="$2"
+filename="$3"
+
+if [ -z "$version" ] || ! [ -f "$filename" ]; then
+       exit 1
+fi
+
+dir="$(pwd)"
+tempdir="$(mktemp -d)"
+
+cd "$tempdir"
+tar xf "$dir/$filename"
+cat "$dir"/debian/prune/* | while read file; do rm -f */$file; done
+
+tar czf "$dir/$filename" *
+cd "$dir"
+rm -rf "$tempdir"
+echo "Done pruning upstream tarball"
+
+exit 0
diff --git a/debian/xsfbs/xsfbs.mk b/debian/xsfbs/xsfbs.mk
new file mode 100755 (executable)
index 0000000..f0f8953
--- /dev/null
@@ -0,0 +1,293 @@
+#!/usr/bin/make -f
+
+# Debian X Strike Force Build System (XSFBS): Make portion
+
+# Copyright 1996 Stephen Early
+# Copyright 1997 Mark Eichin
+# Copyright 1998-2005, 2007 Branden Robinson
+# Copyright 2005 David Nusinow
+#
+# Licensed under the GNU General Public License, version 2.  See the file
+# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
+
+# Originally by Stephen Early <sde1000@debian.org>
+# Modified by Mark W. Eichin <eichin@kitten.gen.ma.us>
+# Modified by Adam Heath <doogie@debian.org>
+# Modified by Branden Robinson <branden@debian.org>
+# Modified by Fabio Massimo Di Nitto <fabbione@fabbione.net>
+# Modified by David Nusinow <dnusinow@debian.org>
+# Acknowledgements to Manoj Srivastava.
+
+# Pass $(DH_OPTIONS) into the environment for debhelper's benefit.
+export DH_OPTIONS
+
+# force quilt to not use ~/.quiltrc and to use debian/patches
+QUILT = QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null
+
+# Set up parameters for the upstream build environment.
+
+# Determine (source) package name from Debian changelog.
+SOURCE_NAME:=$(shell dpkg-parsechangelog -ldebian/changelog \
+                        | grep '^Source:' | awk '{print $$2}')
+
+# Determine package version from Debian changelog.
+SOURCE_VERSION:=$(shell dpkg-parsechangelog -ldebian/changelog \
+                        | grep '^Version:' | awk '{print $$2}')
+
+# Determine upstream version number.
+UPSTREAM_VERSION:=$(shell echo $(SOURCE_VERSION) | sed 's/-.*//')
+
+# Determine the source version without the epoch for make-orig-tar-gz
+NO_EPOCH_VER:=$(shell echo $(UPSTREAM_VERSION) | sed 's/^.://')
+
+# Figure out who's building this package.
+BUILDER:=$(shell echo $${DEBEMAIL:-$${EMAIL:-$$(echo $$LOGNAME@$$(cat /etc/mailname 2>/dev/null))}})
+
+# Find out if this is an official build; an official build has nothing but
+# digits, dots, and/or the codename of a release in the Debian part of the
+# version number.  Anything else indicates an unofficial build.
+OFFICIAL_BUILD:=$(shell VERSION=$(SOURCE_VERSION); if ! expr "$$(echo $${VERSION\#\#*-} | sed 's/\(woody\|sarge\|etch\|lenny\)//g')" : ".*[^0-9.].*" >/dev/null 2>&1; then echo yes; fi)
+
+# Set up parameters for the Debian build environment.
+
+# Determine our architecture.
+BUILD_ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
+# Work around some old-time dpkg braindamage.
+BUILD_ARCH:=$(subst i486,i386,$(BUILD_ARCH))
+# The DEB_HOST_ARCH variable may be set per the Debian cross-compilation policy.
+ifdef DEB_HOST_ARCH
+ ARCH:=$(DEB_HOST_ARCH)
+else
+ # dpkg-cross sets the ARCH environment variable; if set, use it.
+ ifdef ARCH
+  ARCH:=$(ARCH)
+ else
+  ARCH:=$(BUILD_ARCH)
+ endif
+endif
+
+# $(STAMP_DIR) houses stamp files for complex targets.
+STAMP_DIR:=stampdir
+
+# $(DEBTREEDIR) is where all install rules are told (via $(DESTDIR)) to place
+# their files.
+DEBTREEDIR:=$(CURDIR)/debian/tmp
+
+# All "important" targets have four lines:
+#   1) A target name that is invoked by a package-building tool or the user.
+#      This consists of a dependency on a "$(STAMP_DIR)/"-prefixed counterpart.
+#   2) A line delcaring 1) as a phony target (".PHONY:").
+#   3) A "$(STAMP_DIR)/"-prefixed target which does the actual work, and may
+#   depend on other targets.
+#   4) A line declaring 3) as a member of the $(stampdir_targets) variable; the
+#   "$(STAMP_DIR)/" prefix is omitted.
+#
+# This indirection is needed so that the "stamp" files that signify when a rule
+# is done can be located in a separate "stampdir".  Recall that make has no way
+# to know when a goal has been met for a phony target (like "build" or
+# "install").
+#
+# At the end of each "$(STAMP_DIR)/" target, be sure to run the command ">$@"
+# so that the target will not be run again.  Removing the file will make Make
+# run the target over.
+
+# All phony targets should be declared as dependencies of .PHONY, even if they
+# do not have "($STAMP_DIR)/"-prefixed counterparts.
+
+# Define a harmless default rule to keep things from going nuts by accident.
+.PHONY: default
+default:
+
+# Set up the $(STAMP_DIR) directory.
+.PHONY: stampdir
+stampdir_targets+=stampdir
+stampdir: $(STAMP_DIR)/stampdir
+$(STAMP_DIR)/stampdir:
+       mkdir $(STAMP_DIR)
+       >$@
+
+# Set up the package build directory as quilt expects to find it.
+.PHONY: prepare
+stampdir_targets+=prepare
+prepare: $(STAMP_DIR)/prepare
+$(STAMP_DIR)/prepare: $(STAMP_DIR)/log $(STAMP_DIR)/genscripts
+       >$@
+
+.PHONY: log
+stampdir_targets+=log
+log: $(STAMP_DIR)/log
+$(STAMP_DIR)/log: $(STAMP_DIR)/stampdir
+       mkdir -p $(STAMP_DIR)/log
+
+# Apply all patches to the upstream source.
+.PHONY: patch
+stampdir_targets+=patch
+patch: $(STAMP_DIR)/patch
+$(STAMP_DIR)/patch: $(STAMP_DIR)/prepare
+       if ! [ `which quilt` ]; then \
+               echo "Couldn't find quilt. Please install it or add it to the build-depends for this package."; \
+               exit 1; \
+       fi; \
+       if $(QUILT) next >/dev/null 2>&1; then \
+         echo -n "Applying patches..."; \
+         if $(QUILT) push -a -v >$(STAMP_DIR)/log/patch 2>&1; then \
+           cat $(STAMP_DIR)/log/patch; \
+           echo "successful."; \
+         else \
+           cat $(STAMP_DIR)/log/patch; \
+           echo "failed! (check $(STAMP_DIR)/log/patch for details)"; \
+           exit 1; \
+         fi; \
+       else \
+         echo "No patches to apply"; \
+       fi; \
+       >$@
+
+# Revert all patches to the upstream source.
+.PHONY: unpatch
+unpatch: $(STAMP_DIR)/log
+       rm -f $(STAMP_DIR)/patch
+       @echo -n "Unapplying patches..."; \
+       if $(QUILT) applied >/dev/null 2>/dev/null; then \
+         if $(QUILT) pop -a -v >$(STAMP_DIR)/log/unpatch 2>&1; then \
+           cat $(STAMP_DIR)/log/unpatch; \
+           echo "successful."; \
+         else \
+           cat $(STAMP_DIR)/log/unpatch; \
+           echo "failed! (check $(STAMP_DIR)/log/unpatch for details)"; \
+           exit 1; \
+         fi; \
+       else \
+         echo "nothing to do."; \
+       fi
+
+# Clean the generated maintainer scripts.
+.PHONY: cleanscripts
+cleanscripts:
+       rm -f $(STAMP_DIR)/genscripts
+       rm -f debian/*.config \
+             debian/*.postinst \
+             debian/*.postrm \
+             debian/*.preinst \
+             debian/*.prerm
+
+# Clean the package build tree.
+.PHONY: xsfclean
+xsfclean: cleanscripts unpatch
+       dh_testdir
+       rm -rf .pc
+       rm -rf $(STAMP_DIR) $(SOURCE_DIR)
+       rm -rf imports
+       dh_clean debian/shlibs.local \
+                debian/po/pothead
+
+# Generate the debconf templates POT file header.
+debian/po/pothead: debian/po/pothead.in
+       sed -e 's/SOURCE_VERSION/$(SOURCE_VERSION)/' \
+         -e 's/DATE/$(shell date "+%F %X%z"/)' <$< >$@
+
+# Update POT and PO files.
+.PHONY: updatepo
+updatepo: debian/po/pothead
+       debian/scripts/debconf-updatepo --pot-header=pothead --verbose
+
+# Remove files from the upstream source tree that we don't need, or which have
+# licensing problems.  It must be run before creating the .orig.tar.gz.
+#
+# Note: This rule is for Debian package maintainers' convenience, and is not
+# needed for conventional build scenarios.
+.PHONY: prune-upstream-tree
+prune-upstream-tree:
+       # Ensure we're in the correct directory.
+       dh_testdir
+       grep -rvh '^#' debian/prune/ | xargs --no-run-if-empty rm -rf
+
+# Verify that there are no offsets or fuzz in the patches we apply.
+#
+# Note: This rule is for Debian package maintainers' convenience, and is not
+# needed for conventional build scenarios.
+.PHONY: patch-audit
+patch-audit: prepare unpatch
+       @echo -n "Auditing patches..."; \
+       >$(STAMP_DIR)/log/patch; \
+       FUZZY=; \
+       while [ -n "$$($(QUILT) next)" ]; do \
+         RESULT=$$($(QUILT) push -v | tee -a $(STAMP_DIR)/log/patch | grep ^Hunk | sed 's/^Hunk.*\(succeeded\|FAILED\).*/\1/');\
+         case "$$RESULT" in \
+           succeeded) \
+             echo "fuzzy patch: $$($(QUILT) top)" \
+               | tee -a $(STAMP_DIR)/log/$$($(QUILT) top); \
+             FUZZY=yes; \
+             ;; \
+           FAILED) \
+             echo "broken patch: $$($(QUILT) next)" \
+               | tee -a $(STAMP_DIR)/log/$$($(QUILT) next); \
+             exit 1; \
+             ;; \
+         esac; \
+       done; \
+       if [ -n "$$FUZZY" ]; then \
+         echo "there were fuzzy patches; please fix."; \
+         exit 1; \
+       else \
+         echo "done."; \
+       fi
+
+# Generate the maintainer scripts.
+.PHONY: genscripts
+stampdir_targets+=genscripts
+genscripts: $(STAMP_DIR)/genscripts
+$(STAMP_DIR)/genscripts: $(STAMP_DIR)/stampdir
+       for FILE in debian/*.config.in \
+                   debian/*.postinst.in \
+                   debian/*.postrm.in \
+                   debian/*.preinst.in \
+                   debian/*.prerm.in; do \
+         if [ -e "$$FILE" ]; then \
+           MAINTSCRIPT=$$(echo $$FILE | sed 's/.in$$//'); \
+           sed -n '1,/^#INCLUDE_SHELL_LIB#$$/p' <$$FILE \
+             | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >$$MAINTSCRIPT.tmp; \
+           cat debian/xsfbs/xsfbs.sh >>$$MAINTSCRIPT.tmp; \
+           sed -n '/^#INCLUDE_SHELL_LIB#$$/,$$p' <$$FILE \
+             | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >>$$MAINTSCRIPT.tmp; \
+           sed -e 's/@SOURCE_VERSION@/$(SOURCE_VERSION)/' \
+               -e 's/@OFFICIAL_BUILD@/$(OFFICIAL_BUILD)/' \
+               -e 's/@DEFAULT_DCRESOLUTIONS@/$(DEFAULT_DCRESOLUTIONS)/' \
+             <$$MAINTSCRIPT.tmp >$$MAINTSCRIPT; \
+           rm $$MAINTSCRIPT.tmp; \
+         fi; \
+       done
+       # Validate syntax of generated shell scripts.
+       #sh debian/scripts/validate-posix-sh debian/*.config \
+       #                                    debian/*.postinst \
+       #                                    debian/*.postrm \
+       #                                    debian/*.preinst \
+       #                                    debian/*.prerm
+       >$@
+
+# Generate the shlibs.local file.
+debian/shlibs.local:
+       cat debian/*.shlibs >$@
+
+SERVERMINVERS = $(shell cat /usr/share/xserver-xorg/serverminver 2>/dev/null)
+VIDEOABI = $(shell cat /usr/share/xserver-xorg/videoabiver 2>/dev/null)
+INPUTABI = $(shell cat /usr/share/xserver-xorg/inputabiver 2>/dev/null)
+SERVER_DEPENDS = xserver-xorg-core (>= $(SERVERMINVERS))
+VIDDRIVER_PROVIDES = xserver-xorg-video-$(VIDEOABI)
+INPDRIVER_PROVIDES = xserver-xorg-input-$(INPUTABI)
+ifeq ($(PACKAGE),)
+PACKAGE=$(shell awk '/^Package:/ { print $$2; exit }' < debian/control)
+endif
+
+.PHONY: serverabi
+serverabi: install
+ifeq ($(SERVERMINVERS),)
+       @echo error: xserver-xorg-dev needs to be installed
+       @exit 1
+else
+       echo "xserver:Depends=$(SERVER_DEPENDS)" >> debian/$(PACKAGE).substvars
+       echo "xviddriver:Provides=$(VIDDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
+       echo "xinpdriver:Provides=$(INPDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
+endif
+
+# vim:set noet ai sts=8 sw=8 tw=0:
diff --git a/debian/xsfbs/xsfbs.sh b/debian/xsfbs/xsfbs.sh
new file mode 100644 (file)
index 0000000..781826f
--- /dev/null
@@ -0,0 +1,853 @@
+# $Id$
+
+# This is the X Strike Force shell library for X Window System package
+# maintainer scripts.  It serves to define shell functions commonly used by
+# such packages, and performs some error checking necessary for proper operation
+# of those functions.  By itself, it does not "do" much; the maintainer scripts
+# invoke the functions defined here to accomplish package installation and
+# removal tasks.
+
+# If you are reading this within a Debian package maintainer script (e.g.,
+# /var/lib/dpkg)info/PACKAGE.{config,preinst,postinst,prerm,postrm}), you can
+# skip past this library by scanning forward in this file to the string
+# "GOBSTOPPER".
+
+SOURCE_VERSION=@SOURCE_VERSION@
+OFFICIAL_BUILD=@OFFICIAL_BUILD@
+
+# Use special abnormal exit codes so that problems with this library are more
+# easily tracked down.
+SHELL_LIB_INTERNAL_ERROR=86
+SHELL_LIB_THROWN_ERROR=74
+SHELL_LIB_USAGE_ERROR=99
+
+# old -> new variable names
+if [ -z "$DEBUG_XORG_PACKAGE" ] && [ -n "$DEBUG_XFREE86_PACKAGE" ]; then
+  DEBUG_XORG_PACKAGE="$DEBUG_XFREE86_PACKAGE"
+fi
+if [ -z "$DEBUG_XORG_DEBCONF" ] && [ -n "$DEBUG_XFREE86_DEBCONF" ]; then
+  DEBUG_XORG_DEBCONF="$DEBUG_XFREE86_DEBCONF"
+fi
+
+# initial sanity checks
+if [ -z "$THIS_PACKAGE" ]; then
+  cat >&2 <<EOF
+Error: package maintainer script attempted to use shell library without
+definining \$THIS_PACKAGE shell variable.  Please report the package name,
+version, and the text of this error message to the Debian Bug Tracking System.
+Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
+instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
+"doc-debian" package, or install the "reportbug" package and use the command of
+the same name to file a report against version $SOURCE_VERSION of this package.
+EOF
+  exit $SHELL_LIB_USAGE_ERROR
+fi
+
+if [ -z "$THIS_SCRIPT" ]; then
+  cat >&2 <<EOF
+Error: package maintainer script attempted to use shell library without
+definining \$THIS_SCRIPT shell variable.  Please report the package name,
+version, and the text of this error message to the Debian Bug Tracking System.
+Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
+instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
+"doc-debian" package, or install the "reportbug" package and use the command of
+the same name to file a report against version $SOURCE_VERSION of the
+"$THIS_PACKAGE" package.
+EOF
+  exit $SHELL_LIB_USAGE_ERROR
+fi
+
+if [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
+  RECONFIGURE="true"
+else
+  RECONFIGURE=
+fi
+
+if ([ "$1" = "install" ] || [ "$1" = "configure" ]) && [ -z "$2" ]; then
+  FIRSTINST="yes"
+fi
+
+if [ -z "$RECONFIGURE" ] && [ -z "$FIRSTINST" ]; then
+  UPGRADE="yes"
+fi
+
+trap "message;\
+      message \"Received signal.  Aborting $THIS_PACKAGE package $THIS_SCRIPT script.\";\
+      message;\
+      exit 1" HUP INT QUIT TERM
+
+reject_nondigits () {
+  # syntax: reject_nondigits [ operand ... ]
+  #
+  # scan operands (typically shell variables whose values cannot be trusted) for
+  # characters other than decimal digits and barf if any are found
+  while [ -n "$1" ]; do
+    # does the operand contain anything but digits?
+    if ! expr "$1" : "[[:digit:]]\+$" > /dev/null 2>&1; then
+      # can't use die(), because it wraps message() which wraps this function
+      echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_nondigits() encountered" \
+           "possibly malicious garbage \"$1\"" >&2
+      exit $SHELL_LIB_THROWN_ERROR
+    fi
+    shift
+  done
+}
+
+reject_whitespace () {
+  # syntax: reject_whitespace [ operand ]
+  #
+  # scan operand (typically a shell variable whose value cannot be trusted) for
+  # whitespace characters and barf if any are found
+  if [ -n "$1" ]; then
+    # does the operand contain any whitespace?
+    if expr "$1" : "[[:space:]]" > /dev/null 2>&1; then
+      # can't use die(), because I want to avoid forward references
+      echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_whitespace() encountered" \
+           "possibly malicious garbage \"$1\"" >&2
+      exit $SHELL_LIB_THROWN_ERROR
+    fi
+  fi
+}
+
+reject_unlikely_path_chars () {
+  # syntax: reject_unlikely_path_chars [ operand ... ]
+  #
+  # scan operands (typically shell variables whose values cannot be trusted) for
+  # characters unlikely to be seen in a path and which the shell might
+  # interpret and barf if any are found
+  while [ -n "$1" ]; do
+    # does the operand contain any funny characters?
+    if expr "$1" : '.*[!$&()*;<>?|].*' > /dev/null 2>&1; then
+      # can't use die(), because I want to avoid forward references
+      echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_unlikely_path_chars()" \
+           "encountered possibly malicious garbage \"$1\"" >&2
+      exit $SHELL_LIB_THROWN_ERROR
+    fi
+    shift
+  done
+}
+
+# Query the terminal to establish a default number of columns to use for
+# displaying messages to the user.  This is used only as a fallback in the
+# event the COLUMNS variable is not set.  ($COLUMNS can react to SIGWINCH while
+# the script is running, and this cannot, only being calculated once.)
+DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true
+if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then
+  DEFCOLUMNS=80
+fi
+
+message () {
+  # pretty-print messages of arbitrary length
+  reject_nondigits "$COLUMNS"
+  echo "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} >&2
+}
+
+observe () {
+  # syntax: observe message ...
+  #
+  # issue observational message suitable for logging someday when support for
+  # it exists in dpkg
+  if [ -n "$DEBUG_XORG_PACKAGE" ]; then
+    message "$THIS_PACKAGE $THIS_SCRIPT note: $*"
+  fi
+}
+
+warn () {
+  # syntax: warn message ...
+  #
+  # issue warning message suitable for logging someday when support for
+  # it exists in dpkg; also send to standard error
+  message "$THIS_PACKAGE $THIS_SCRIPT warning: $*"
+}
+
+die () {
+  # syntax: die message ...
+  #
+  # exit script with error message
+  message "$THIS_PACKAGE $THIS_SCRIPT error: $*"
+  exit $SHELL_LIB_THROWN_ERROR
+}
+
+internal_error () {
+  # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
+  message "internal error: $*"
+  if [ -n "$OFFICIAL_BUILD" ]; then
+    message "Please report a bug in the $THIS_SCRIPT script of the" \
+            "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
+            "Tracking System.  Include all messages above that mention the" \
+            "$THIS_PACKAGE package.  Visit " \
+            "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
+            "instructions, read the file" \
+            "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
+            "package, or install the reportbug package and use the command of" \
+            "the same name to file a report."
+  fi
+  exit $SHELL_LIB_INTERNAL_ERROR
+}
+
+usage_error () {
+  message "usage error: $*"
+  message "Please report a bug in the $THIS_SCRIPT script of the" \
+          "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
+          "Tracking System.  Include all messages above that mention the" \
+          "$THIS_PACKAGE package.  Visit " \
+          "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
+          "instructions, read the file" \
+          "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
+          "package, or install the reportbug package and use the command of" \
+          "the same name to file a report."
+  exit $SHELL_LIB_USAGE_ERROR
+}
+
+
+maplink () {
+  # returns what symlink should point to; i.e., what the "sane" answer is
+  # Keep this in sync with the debian/*.links files.
+  # This is only needed for symlinks to directories.
+  #
+  # XXX: Most of these look wrong in the X11R7 world and need to be fixed.
+  # If we've stopped using this function, fixing it might enable us to re-enable
+  # it again and catch more errors.
+  case "$1" in
+    /etc/X11/xkb/compiled) echo /var/lib/xkb ;;
+    /etc/X11/xkb/xkbcomp) echo /usr/X11R6/bin/xkbcomp ;;
+    /usr/X11R6/lib/X11/app-defaults) echo /etc/X11/app-defaults ;;
+    /usr/X11R6/lib/X11/fs) echo /etc/X11/fs ;;
+    /usr/X11R6/lib/X11/lbxproxy) echo /etc/X11/lbxproxy ;;
+    /usr/X11R6/lib/X11/proxymngr) echo /etc/X11/proxymngr ;;
+    /usr/X11R6/lib/X11/rstart) echo /etc/X11/rstart ;;
+    /usr/X11R6/lib/X11/twm) echo /etc/X11/twm ;;
+    /usr/X11R6/lib/X11/xdm) echo /etc/X11/xdm ;;
+    /usr/X11R6/lib/X11/xinit) echo /etc/X11/xinit ;;
+    /usr/X11R6/lib/X11/xkb) echo /etc/X11/xkb ;;
+    /usr/X11R6/lib/X11/xserver) echo /etc/X11/xserver ;;
+    /usr/X11R6/lib/X11/xsm) echo /etc/X11/xsm ;;
+    /usr/bin/X11) echo ../X11R6/bin ;;
+    /usr/bin/rstartd) echo ../X11R6/bin/rstartd ;;
+    /usr/include/X11) echo ../X11R6/include/X11 ;;
+    /usr/lib/X11) echo ../X11R6/lib/X11 ;;
+    *) internal_error "maplink() called with unknown path \"$1\"" ;;
+  esac
+}
+
+analyze_path () {
+  # given a supplied set of pathnames, break each one up by directory and do an
+  # ls -dl on each component, cumulatively; i.e.
+  # analyze_path /usr/X11R6/bin -> ls -dl /usr /usr/X11R6 /usr/X11R6/bin
+  # Thanks to Randolph Chung for this clever hack.
+
+  local f g
+
+  while [ -n "$1" ]; do
+    reject_whitespace "$1"
+    g=
+    message "Analyzing $1:"
+    for f in $(echo "$1" | tr / \  ); do
+      if [ -e /$g$f ]; then
+        ls -dl /$g$f /$g$f.dpkg-* 2> /dev/null || true
+        g=$g$f/
+      else
+        message "/$g$f: nonexistent; directory contents of /$g:"
+        ls -l /$g
+        break
+      fi
+    done
+    shift
+  done
+}
+
+find_culprits () {
+  local f p dpkg_info_dir possible_culprits smoking_guns bad_packages package \
+    msg
+
+  reject_whitespace "$1"
+  message "Searching for overlapping packages..."
+  dpkg_info_dir=/var/lib/dpkg/info
+  if [ -d $dpkg_info_dir ]; then
+    if [ "$(echo $dpkg_info_dir/*.list)" != "$dpkg_info_dir/*.list" ]; then
+      possible_culprits=$(ls -1 $dpkg_info_dir/*.list | egrep -v \
+        "(xbase-clients|x11-common|xfs|xlibs)")
+      if [ -n "$possible_culprits" ]; then
+        smoking_guns=$(grep -l "$1" $possible_culprits || true)
+        if [ -n "$smoking_guns" ]; then
+          bad_packages=$(printf "\\n")
+          for f in $smoking_guns; do
+            # too bad you can't nest parameter expansion voodoo
+            p=${f%*.list}      # strip off the trailing ".list"
+            package=${p##*/}   # strip off the directories
+            bad_packages=$(printf "%s\n%s" "$bad_packages" "$package")
+          done
+          msg=$(cat <<EOF
+The following packages appear to have file overlaps with the X.Org packages;
+these packages are either very old, or in violation of Debian Policy.  Try
+upgrading each of these packages to the latest available version if possible:
+for example, with the command "apt-get install".  If no newer version of a
+package is available, you will have to remove it; for example, with the command
+"apt-get remove".  If even the latest available version of the package has
+this file overlap, please file a bug against that package with the Debian Bug
+Tracking System.  You may want to refer the package maintainer to section 12.8
+of the Debian Policy manual.
+EOF
+)
+          message "$msg"
+          message "The overlapping packages are: $bad_packages"
+        else
+          message "no overlaps found."
+        fi
+      fi
+    else
+      message "cannot search; no matches for $dpkg_info_dir/*.list."
+    fi
+  else
+    message "cannot search; $dpkg_info_dir does not exist."
+  fi
+}
+
+check_symlink () {
+  # syntax: check_symlink symlink
+  #
+  # See if specified symlink points where it is supposed to.  Return 0 if it
+  # does, and 1 if it does not.
+  #
+  # Primarily used by check_symlinks_and_warn() and check_symlinks_and_bomb().
+
+  local symlink
+
+  # validate arguments
+  if [ $# -ne 1 ]; then
+    usage_error "check_symlink() called with wrong number of arguments;" \
+                "expected 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  symlink="$1"
+
+  if [ "$(maplink "$symlink")" = "$(readlink "$symlink")" ]; then
+    return 0
+  else
+    return 1
+  fi
+}
+
+check_symlinks_and_warn () {
+  # syntax: check_symlinks_and_warn symlink ...
+  #
+  # For each argument, check for symlink sanity, and warn if it isn't sane.
+  #
+  # Call this function from a preinst script in the event $1 is "upgrade" or
+  # "install".
+
+  local errmsg symlink
+
+  # validate arguments
+  if [ $# -lt 1 ]; then
+    usage_error "check_symlinks_and_warn() called with wrong number of" \
+                "arguments; expected at least 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  while [ -n "$1" ]; do
+    symlink="$1"
+    if [ -L "$symlink" ]; then
+      if ! check_symlink "$symlink"; then
+        observe "$symlink symbolic link points to wrong location" \
+                "$(readlink "$symlink"); removing"
+        rm "$symlink"
+      fi
+    elif [ -e "$symlink" ]; then
+      errmsg="$symlink exists and is not a symbolic link; this package cannot"
+      errmsg="$errmsg be installed until this"
+      if [ -f "$symlink" ]; then
+        errmsg="$errmsg file"
+      elif [ -d "$symlink" ]; then
+        errmsg="$errmsg directory"
+      else
+        errmsg="$errmsg thing"
+      fi
+      errmsg="$errmsg is removed"
+      die "$errmsg"
+    fi
+    shift
+  done
+}
+
+check_symlinks_and_bomb () {
+  # syntax: check_symlinks_and_bomb symlink ...
+  #
+  # For each argument, check for symlink sanity, and bomb if it isn't sane.
+  #
+  # Call this function from a postinst script.
+
+  local problem symlink
+
+  # validate arguments
+  if [ $# -lt 1 ]; then
+    usage_error "check_symlinks_and_bomb() called with wrong number of"
+                "arguments; expected at least 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  while [ -n "$1" ]; do
+    problem=
+    symlink="$1"
+    if [ -L "$symlink" ]; then
+      if ! check_symlink "$symlink"; then
+        problem=yes
+        warn "$symlink symbolic link points to wrong location" \
+             "$(readlink "$symlink")"
+      fi
+    elif [ -e "$symlink" ]; then
+      problem=yes
+      warn "$symlink is not a symbolic link"
+    else
+      problem=yes
+      warn "$symlink symbolic link does not exist"
+    fi
+    if [ -n "$problem" ]; then
+      analyze_path "$symlink" "$(readlink "$symlink")"
+      find_culprits "$symlink"
+      die "bad symbolic links on system"
+    fi
+    shift
+  done
+}
+
+font_update () {
+  # run $UPDATECMDS in $FONTDIRS
+
+  local dir cmd shortcmd x_font_dir_prefix
+
+  x_font_dir_prefix="/usr/share/fonts/X11"
+
+  if [ -z "$UPDATECMDS" ]; then
+    usage_error "font_update() called but \$UPDATECMDS not set"
+  fi
+  if [ -z "$FONTDIRS" ]; then
+    usage_error "font_update() called but \$FONTDIRS not set"
+  fi
+
+  reject_unlikely_path_chars "$UPDATECMDS"
+  reject_unlikely_path_chars "$FONTDIRS"
+
+  for dir in $FONTDIRS; do
+    if [ -d "$x_font_dir_prefix/$dir" ]; then
+      for cmd in $UPDATECMDS; do
+        if which "$cmd" > /dev/null 2>&1; then
+          shortcmd=${cmd##*/}
+          observe "running $shortcmd in $dir font directory"
+         cmd_opts=
+          if [ "$shortcmd" = "update-fonts-alias" ]; then
+            cmd_opts=--x11r7-layout
+          fi
+          if [ "$shortcmd" = "update-fonts-dir" ]; then
+            cmd_opts=--x11r7-layout
+          fi
+          if [ "$shortcmd" = "update-fonts-scale" ]; then
+            cmd_opts=--x11r7-layout
+          fi
+          $cmd $cmd_opts $dir || warn "$cmd $cmd_opts $dir" \
+                              "failed; font directory data may not" \
+                              "be up to date"
+        else
+          warn "$cmd not found; not updating corresponding $dir font" \
+               "directory data"
+        fi
+      done
+    else
+      warn "$dir is not a directory; not updating font directory data"
+    fi
+  done
+}
+
+remove_conffile_prepare () {
+  # syntax: remove_conffile_prepare filename official_md5sum ...
+  #
+  # Check a conffile "filename" against a list of canonical MD5 checksums.
+  # If the file's current MD5 checksum matches one of the "official_md5sum"
+  # operands provided, then prepare the conffile for removal from the system.
+  # We defer actual deletion until the package is configured so that we can
+  # roll this operation back if package installation fails.
+  #
+  # Call this function from a preinst script in the event $1 is "upgrade" or
+  # "install" and verify $2 to ensure the package is being upgraded from a
+  # version (or installed over a version removed-but-not-purged) prior to the
+  # one in which the conffile was obsoleted.
+
+  local conffile current_checksum
+
+  # validate arguments
+  if [ $# -lt 2 ]; then
+    usage_error "remove_conffile_prepare() called with wrong number of" \
+                "arguments; expected at least 2, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  conffile="$1"
+  shift
+
+  # does the conffile even exist?
+  if [ -e "$conffile" ]; then
+    # calculate its checksum
+    current_checksum=$(md5sum < "$conffile" | sed 's/[[:space:]].*//')
+    # compare it to each supplied checksum
+    while [ -n "$1" ]; do
+      if [ "$current_checksum" = "$1" ]; then
+        # we found a match; move the confffile and stop looking
+        observe "preparing obsolete conffile $conffile for removal"
+        mv "$conffile" "$conffile.$THIS_PACKAGE-tmp"
+        break
+      fi
+      shift
+    done
+  fi
+}
+
+remove_conffile_lookup () {
+  # syntax: remove_conffile_lookup package filename
+  #
+  # Lookup the md5sum of a conffile in dpkg's database, and prepare for removal
+  # if it matches the actual file's md5sum.
+  #
+  # Call this function when you would call remove_conffile_prepare but only
+  # want to check against dpkg's status database instead of known checksums.
+
+  local package conffile old_md5sum
+
+  # validate arguments
+  if [ $# -ne 2 ]; then
+    usage_error "remove_conffile_lookup() called with wrong number of" \
+                "arguments; expected 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  package="$1"
+  conffile="$2"
+
+  if ! [ -e "$conffile" ]; then
+    return
+  fi
+  old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$package" | \
+    awk '{ if (match($0, "^ '"$conffile"' ")) print $2}')"
+  if [ -n "$old_md5sum" ]; then
+    remove_conffile_prepare "$conffile" "$old_md5sum"
+  fi
+}
+
+remove_conffile_commit () {
+  # syntax: remove_conffile_commit filename
+  #
+  # Complete the removal of a conffile "filename" that has become obsolete.
+  #
+  # Call this function from a postinst script after having used
+  # remove_conffile_prepare() in the preinst.
+
+  local conffile
+
+  # validate arguments
+  if [ $# -ne 1 ]; then
+    usage_error "remove_conffile_commit() called with wrong number of" \
+                "arguments; expected 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  conffile="$1"
+
+  # if the temporary file created by remove_conffile_prepare() exists, remove it
+  if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
+    observe "committing removal of obsolete conffile $conffile"
+    rm "$conffile.$THIS_PACKAGE-tmp"
+  fi
+}
+
+remove_conffile_rollback () {
+  # syntax: remove_conffile_rollback filename
+  #
+  # Roll back the removal of a conffile "filename".
+  #
+  # Call this function from a postrm script in the event $1 is "abort-upgrade"
+  # or "abort-install" is  after having used remove_conffile_prepare() in the
+  # preinst.
+
+  local conffile
+
+  # validate arguments
+  if [ $# -ne 1 ]; then
+    usage_error "remove_conffile_rollback() called with wrong number of" \
+                "arguments; expected 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  conffile="$1"
+
+  # if the temporary file created by remove_conffile_prepare() exists, move it
+  # back
+  if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
+    observe "rolling back removal of obsolete conffile $conffile"
+    mv "$conffile.$THIS_PACKAGE-tmp" "$conffile"
+  fi
+}
+
+replace_conffile_with_symlink_prepare () {
+  # syntax: replace_conffile_with_symlink_prepare oldfilename newfilename \
+  # official_md5sum ...
+  #
+  # Check a conffile "oldfilename" against a list of canonical MD5 checksums.
+  # If the file's current MD5 checksum matches one of the "official_md5sum"
+  # operands provided, then prepare the conffile for removal from the system.
+  # We defer actual deletion until the package is configured so that we can
+  # roll this operation back if package installation fails. Otherwise copy it
+  # to newfilename and let dpkg handle it through conffiles mechanism.
+  #
+  # Call this function from a preinst script in the event $1 is "upgrade" or
+  # "install" and verify $2 to ensure the package is being upgraded from a
+  # version (or installed over a version removed-but-not-purged) prior to the
+  # one in which the conffile was obsoleted.
+
+  local conffile current_checksum
+
+  # validate arguments
+  if [ $# -lt 3 ]; then
+    usage_error "replace_conffile_with_symlink_prepare() called with wrong" \
+                " number of arguments; expected at least 3, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  oldconffile="$1"
+  shift
+  newconffile="$1"
+  shift
+
+  remove_conffile_prepare "$_oldconffile" "$@"
+  # If $oldconffile still exists, then md5sums didn't match.
+  # Copy it to new one.
+  if [ -f "$oldconffile" ]; then
+    cp "$oldconffile" "$newconffile"
+  fi
+
+}
+
+replace_conffile_with_symlink_commit () {
+  # syntax: replace_conffile_with_symlink_commit oldfilename
+  #
+  # Complete the removal of a conffile "oldfilename" that has been
+  # replaced by a symlink.
+  #
+  # Call this function from a postinst script after having used
+  # replace_conffile_with_symlink_prepare() in the preinst.
+
+  local conffile
+
+  # validate arguments
+  if [ $# -ne 1 ]; then
+    usage_error "replace_conffile_with_symlink_commit() called with wrong" \
+                "number of arguments; expected 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  conffile="$1"
+
+  remove_conffile_commit "$conffile"
+}
+
+replace_conffile_with_symlink_rollback () {
+  # syntax: replace_conffile_with_symlink_rollback oldfilename newfilename
+  #
+  # Roll back the replacing of a conffile "oldfilename" with symlink to
+  # "newfilename".
+  #
+  # Call this function from a postrm script in the event $1 is "abort-upgrade"
+  # or "abort-install" and verify $2 to ensure the package failed to upgrade
+  # from a version (or install over a version removed-but-not-purged) prior
+  # to the one in which the conffile was obsoleted.
+  # You should have  used replace_conffile_with_symlink_prepare() in the
+  # preinst.
+
+  local conffile
+
+  # validate arguments
+  if [ $# -ne 2 ]; then
+    usage_error "replace_conffile_with_symlink_rollback() called with wrong" \
+                "number of arguments; expected 2, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  oldconffile="$1"
+  newconffile="$2"
+
+  remove_conffile_rollback "$_oldconffile"
+  if [ -f "$newconffile" ]; then
+    rm "$newconffile"
+  fi
+}
+
+run () {
+  # syntax: run command [ argument ... ]
+  #
+  # Run specified command with optional arguments and report its exit status.
+  # Useful for commands whose exit status may be nonzero, but still acceptable,
+  # or commands whose failure is not fatal to us.
+  #
+  # NOTE: Do *not* use this function with db_get or db_metaget commands; in
+  # those cases the return value of the debconf command *must* be checked
+  # before the string returned by debconf is used for anything.
+
+  local retval
+
+  # validate arguments
+  if [ $# -lt 1 ]; then
+    usage_error "run() called with wrong number of arguments; expected at" \
+                "least 1, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  "$@" || retval=$?
+
+  if [ ${retval:-0} -ne 0 ]; then
+    observe "command \"$*\" exited with status $retval"
+  fi
+}
+
+make_symlink_sane () {
+  # syntax: make_symlink_sane symlink target
+  #
+  # Ensure that the symbolic link symlink exists, and points to target.
+  #
+  # If symlink does not exist, create it and point it at target.
+  #
+  # If symlink exists but is not a symbolic link, back it up.
+  #
+  # If symlink exists, is a symbolic link, but points to the wrong location, fix
+  # it.
+  #
+  # If symlink exists, is a symbolic link, and already points to target, do
+  # nothing.
+  #
+  # This function wouldn't be needed if ln had an -I, --idempotent option.
+
+  # Validate arguments.
+  if [ $# -ne 2 ]; then
+    usage_error "make_symlink_sane() called with wrong number of arguments;" \
+      "expected 2, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  # We could just use the positional parameters as-is, but that makes things
+  # harder to follow.
+  local symlink target
+
+  symlink="$1"
+  target="$2"
+
+  if [ -L "$symlink" ] && [ "$(readlink "$symlink")" = "$target" ]; then
+      observe "link from $symlink to $target already exists"
+  else
+    observe "creating symbolic link from $symlink to $target"
+    mkdir -p "${target%/*}" "${symlink%/*}"
+    ln -s -b -S ".dpkg-old" "$target" "$symlink"
+  fi
+}
+
+migrate_dir_to_symlink () {
+  # syntax: migrate_dir_to_symlink old_location new_location
+  #
+  # Per Debian Policy section 6.5.4, "A directory will never be replaced by a
+  # symbolic link to a directory or vice versa; instead, the existing state
+  # (symlink or not) will be left alone and dpkg will follow the symlink if
+  # there is one."
+  #
+  # We have to do it ourselves.
+  #
+  # This function moves the contents of old_location, a directory, into
+  # new_location, a directory, then makes old_location a symbolic link to
+  # new_location.
+  #
+  # old_location need not exist, but if it does, it must be a directory (or a
+  # symlink to a directory).  If it is not, it is backed up.  If new_location
+  # exists already and is not a directory, it is backed up.
+  #
+  # This function should be called from a package's preinst so that other
+  # packages unpacked after this one --- but before this package's postinst runs
+  # --- are unpacked into new_location even if their payloads contain
+  # old_location filespecs.
+
+  # Validate arguments.
+  if [ $# -ne 2 ]; then
+    usage_error "migrate_dir_to_symlink() called with wrong number of"
+                "arguments; expected 2, got $#"
+    exit $SHELL_LIB_USAGE_ERROR
+  fi
+
+  # We could just use the positional parameters as-is, but that makes things
+  # harder to follow.
+  local new old
+
+  old="$1"
+  new="$2"
+
+  # Is old location a symlink?
+  if [ -L "$old" ]; then
+    # Does it already point to new location?
+    if [ "$(readlink "$old")" = "$new" ]; then
+      # Nothing to do; migration has already been done.
+      observe "migration of $old to $new already done"
+      return 0
+    else
+      # Back it up.
+      warn "backing up symbolic link $old as $old.dpkg-old"
+      mv -b "$old" "$old.dpkg-old"
+    fi
+  fi
+
+  # Does old location exist, but is not a directory?
+  if [ -e "$old" ] && ! [ -d "$old" ]; then
+      # Back it up.
+      warn "backing up non-directory $old as $old.dpkg-old"
+      mv -b "$old" "$old.dpkg-old"
+  fi
+
+  observe "migrating $old to $new"
+
+  # Is new location a symlink?
+  if [ -L "$new" ]; then
+    # Does it point the wrong way, i.e., back to where we're migrating from?
+    if [ "$(readlink "$new")" = "$old" ]; then
+      # Get rid of it.
+      observe "removing symbolic link $new which points to $old"
+      rm "$new"
+    else
+      # Back it up.
+      warn "backing up symbolic link $new as $new.dpkg-old"
+      mv -b "$new" "$new.dpkg-old"
+    fi
+  fi
+
+  # Does new location exist, but is not a directory?
+  if [ -e "$new" ] && ! [ -d "$new" ]; then
+    warn "backing up non-directory $new as $new.dpkg-old"
+    mv -b "$new" "$new.dpkg-old"
+  fi
+
+  # Create new directory if it does not yet exist.
+  if ! [ -e "$new" ]; then
+    observe "creating $new"
+    mkdir -p "$new"
+  fi
+
+  # Copy files in old location to new location.  Back up any filenames that
+  # already exist in the new location with the extension ".dpkg-old".
+  observe "copying files from $old to $new"
+  if ! (cd "$old" && cp -a -b -S ".dpkg-old" . "$new"); then
+    die "error(s) encountered while copying files from $old to $new"
+  fi
+
+  # Remove files at old location.
+  observe "removing $old"
+  rm -r "$old"
+
+  # Create symlink from old location to new location.
+  make_symlink_sane "$old" "$new"
+}
+
+# vim:set ai et sw=2 ts=2 tw=80:
+
+# GOBSTOPPER: The X Strike Force shell library ends here.
diff --git a/ico/AUTHORS b/ico/AUTHORS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ico/COPYING b/ico/COPYING
new file mode 100644 (file)
index 0000000..15697a8
--- /dev/null
@@ -0,0 +1,65 @@
+Copyright (c) 1987, 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
+CONNECTION 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 dealings
+in this Software without prior written authorization from the X Consortium.
+
+
+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.
+
+------------------------------------------------------------------------------
+
+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.
diff --git a/ico/ChangeLog b/ico/ChangeLog
new file mode 100644 (file)
index 0000000..afc745f
--- /dev/null
@@ -0,0 +1,217 @@
+commit 11308c41fe4c1bf99a6654fca294f3e098075a33
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Jul 20 16:28:38 2007 -0700
+
+    Version bump: 1.0.2
+
+commit 255c8078a0edfc289e434ba769fd50e05ab72ad2
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Jul 20 16:17:31 2007 -0700
+
+    Fill in COPYING stub with copyright & licenses from source files
+
+commit 5a51d7e1db3694e41d55bc02208f3fa1b736e951
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Jul 20 16:14:34 2007 -0700
+
+    Replace static changelog with dist-hook to generate from git log
+
+commit e7a16eb488b591af57561799525891be5030bf25
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Jul 20 16:10:58 2007 -0700
+
+    Change ico_CFLAGS to AM_CFLAGS to stop automake-1.10 warning
+    
+    Makefile.am:27: compiling `ico.c' with per-target flags requires `AM_PROG_CC_C_O' in `configure.ac'
+
+commit e3146e963d7bf333d0e01d9d556d6c8be722898d
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Wed Apr 11 15:37:10 2007 -0700
+
+    renamed: .cvsignore -> .gitignore
+
+commit db38b36c535baeda5bdc8a873b32f678e7df8e36
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Wed Apr 11 15:36:16 2007 -0700
+
+    Bug #10616: Man page typo: s/TREMINATION/TERMINATION/
+    
+    X.Org Bugzilla #10616 <https://bugs.freedesktop.org/show_bug.cgi?id=10616>
+    Reported upstream from
+    Debian Bug #395445 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=395445>
+
+commit 366924f71f6e5db3641bc350a07d37f64fe6ea08
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 21 02:29:42 2005 +0000
+
+    Update package version for X11R7 release.
+
+commit 82481ae9b8335ae924b4341d194c4f0ed51f1f03
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Dec 19 16:22:40 2005 +0000
+
+    Stub COPYING files
+
+commit 52ad0990a0f63ef8601c56b3937afba0a511b376
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:24:02 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+commit 22bef66811d55607c096b0e015fb91e31c3043c6
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 6 22:48:16 2005 +0000
+
+    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit f8a8eb25e339b5ae58c0bd6b9068338488d3be22
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Dec 3 05:49:16 2005 +0000
+
+    Update package version number for X11R7 RC3 release.
+
+commit 8e79cdd0c53ab420fa3b69003762d2d1ebfa0273
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Nov 28 22:01:37 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 3c4e96626a4fcc4df45bced95c44c5e99e605537
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Mon Nov 21 10:34:55 2005 +0000
+
+    Another pass at .cvsignores for apps.
+
+commit 3cb8504ab547357b6b538e1ffbb3000b5cc0b8e7
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Sun Nov 20 22:08:48 2005 +0000
+
+    Add/improve .cvsignore files for apps.
+
+commit 02b2de700f25d3be621d560b3042f7a7a89369e6
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Nov 9 21:09:19 2005 +0000
+
+    Update package version number for X11R7 RC2 release.
+
+commit 703edae088fb7bb409dbdb58d111ed9e4c31cf78
+Author: Kean Johnson <kean@armory.com>
+Date:   Tue Nov 8 06:33:31 2005 +0000
+
+    See ChangeLog entry 2005-11-07 for details.
+
+commit fe9efd5cd0703005da9ceb55f59d376ba0b01226
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:47:48 2005 +0000
+
+    Update package version number for RC1 release.
+
+commit 7ad280349d00bb52201dc43c21ac097ec97132dc
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+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 cd8ac3431f4b2c6a8fad1031bf34d894fb6398ae
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Fri Oct 14 00:25:41 2005 +0000
+
+    Use sed to fill in variables in man page
+
+commit a0f44d19aa84965a31303fd39f05631665fd7e37
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed Aug 17 19:49:17 2005 +0000
+
+    Get xthreadlib variable from Xlib. Bump to 0.99.1.
+
+commit 19fd5758771d31d13cc483cf80adafa3bf530132
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sat Aug 13 02:13:30 2005 +0000
+
+    Update for modularization: include <config.h> & <X11/XlibConf.h>, use
+        XTHREADS define from XlibConf.h to enable multithreading Also ansify
+        icoFatal prototype to clear Sun cc warnings.
+
+commit 979aa90d7b94494ce365b9dc3cf724a3f91f8598
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Aug 1 20:25:27 2005 +0000
+
+    Install man pages to section 1 instead of section m (Patch from Donnie
+        Berkholz)
+
+commit 25ac536b836c2772784bd13b543d538a2673fb4c
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Jul 29 21:22:29 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 5c31a07dbcb735445951f7f7cae8579ee16262d5
+Author: Adam Jackson <ajax@nwnk.net>
+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 9e0555e9d980217dd20d1f7385ff47514675629c
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Tue Jun 28 15:00:13 2005 +0000
+
+    Check in build system for ico
+
+commit 6a904d00db84e235ea2b0073fbcd078f8a96c9c2
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 19:54:33 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+commit caf6767501c8176c02702e441ab422ced4ea5033
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:34:51 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit 81bd81a192d3e6cc4e8ac744d6f9dd844013c3de
+Author: Egbert Eich <eich@suse.de>
+Date:   Wed Mar 3 12:12:52 2004 +0000
+
+    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit 0fe04de86a907b549e143b27ff5c16887ec7de2a
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:36:15 2004 +0000
+
+    readding XFree86's cvs IDs
+
+commit dcd8f0f0b566a45609145651ae0c6d2cbed6bfc7
+Author: Egbert Eich <eich@suse.de>
+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 996d4a49a21986ae0a8d3f4f047aa71422727925
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+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 c3b5b1a77685345b857f858fa3c226ec4a826414
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:57 2003 +0000
+
+    XFree86 4.3.0.1
+
+commit 352df17fc71405e7bc36559ee8a72e21d7a5694a
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:57 2003 +0000
+
+    Initial revision
diff --git a/ico/INSTALL b/ico/INSTALL
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ico/Makefile.am b/ico/Makefile.am
new file mode 100644 (file)
index 0000000..a03cffd
--- /dev/null
@@ -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.
+
+bin_PROGRAMS = ico
+
+AM_CFLAGS = $(ICO_CFLAGS)
+ico_LDADD = $(ICO_LIBS) $(XTHREADLIB) -lm
+
+ico_SOURCES =  \
+        allobjs.h \
+        ico.c \
+        objcube.h \
+        objico.h \
+        objocta.h \
+        objplane.h \
+        objpyr.h \
+        polyinfo.h
+
+appman_PRE = \
+        ico.man
+
+
+
+appmandir = $(APP_MAN_DIR)
+
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+
+EXTRA_DIST = $(appman_PRE) ChangeLog
+CLEANFILES = $(appman_DATA)
+MAINTAINERCLEANFILES = ChangeLog
+
+.PHONY: ChangeLog
+
+ChangeLog:
+       (GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
+
+dist-hook: 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) < $< > $@
diff --git a/ico/Makefile.in b/ico/Makefile.in
new file mode 100644 (file)
index 0000000..d6badca
--- /dev/null
@@ -0,0 +1,674 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006  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.
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = ico$(EXEEXT)
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+       $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
+       config.guess config.sub depcomp install-sh missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.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_ico_OBJECTS = ico.$(OBJEXT)
+ico_OBJECTS = $(am_ico_OBJECTS)
+am__DEPENDENCIES_1 =
+ico_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I.@am__isrc@
+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 = $(ico_SOURCES)
+DIST_SOURCES = $(ico_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@
+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@
+ICO_CFLAGS = @ICO_CFLAGS@
+ICO_LIBS = @ICO_LIBS@
+INSTALL = @INSTALL@
+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@
+MAKEINFO = @MAKEINFO@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+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@
+XTHREADLIB = @XTHREADLIB@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__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@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CFLAGS = $(ICO_CFLAGS)
+ico_LDADD = $(ICO_LIBS) $(XTHREADLIB) -lm
+ico_SOURCES = \
+        allobjs.h \
+        ico.c \
+        objcube.h \
+        objico.h \
+        objocta.h \
+        objplane.h \
+        objpyr.h \
+        polyinfo.h
+
+appman_PRE = \
+        ico.man
+
+appmandir = $(APP_MAN_DIR)
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+EXTRA_DIST = $(appman_PRE) ChangeLog
+CLEANFILES = $(appman_DATA)
+MAINTAINERCLEANFILES = 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) $(AM_MAKEFLAGS) 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)
+ico$(EXEEXT): $(ico_OBJECTS) $(ico_DEPENDENCIES) 
+       @rm -f ico$(EXEEXT)
+       $(LINK) $(ico_OBJECTS) $(ico_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ico.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+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)
+       test -d $(distdir) || mkdir $(distdir)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           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 $(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 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$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."
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-appmanDATA
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -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
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+       clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
+       dist-gzip dist-hook dist-shar dist-tarZ dist-zip distcheck \
+       distclean distclean-compile distclean-generic distclean-hdr \
+       distclean-tags distcleancheck distdir distuninstallcheck dvi \
+       dvi-am html html-am info info-am install install-am \
+       install-appmanDATA install-binPROGRAMS install-data \
+       install-data-am install-dvi install-dvi-am install-exec \
+       install-exec-am install-html install-html-am install-info \
+       install-info-am install-man install-pdf install-pdf-am \
+       install-ps install-ps-am install-strip installcheck \
+       installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+       uninstall-am uninstall-appmanDATA uninstall-binPROGRAMS
+
+
+.PHONY: ChangeLog
+
+ChangeLog:
+       (GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
+
+dist-hook: ChangeLog
+
+.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/ico/NEWS b/ico/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ico/README b/ico/README
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ico/aclocal.m4 b/ico/aclocal.m4
new file mode 100644 (file)
index 0000000..3b51a56
--- /dev/null
@@ -0,0 +1,1519 @@
+# generated automatically by aclocal 1.10 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006  Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+
+m4_if(m4_PACKAGE_VERSION, [2.61],,
+[m4_fatal([this file was generated for autoconf 2.61.
+You have another version of autoconf.  If you want to use that,
+you should regenerate the build system entirely.], [63])])
+
+# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.10'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.10], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.10])dnl
+_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
+
+# 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, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# 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])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+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, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# 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], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$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/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # 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])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# 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.
+  # Grep'ing the whole file is not good either: AIX grep has a line
+  # limit of 2048, but all sed's we know have understand at least 4000.
+  if sed 10q "$mf" | grep '^#.*generated by automake' > /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, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 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.60])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+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
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_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
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                  [_AM_DEPENDENCIES(OBJC)],
+                  [define([AC_PROG_OBJC],
+                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])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-"\$(SHELL) $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, 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 5
+
+# 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
+AC_REQUIRE_AUX_FILE([missing])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  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, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# 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="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+#
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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
+
+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.5
+       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],[
+XORG_SGML_PATH=$prefix/share/sgml
+HAVE_DEFS_ENT=
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+AC_PATH_PROG(PS2PDF, ps2pdf)
+
+AC_MSG_CHECKING([Whether to build documentation])
+
+if test x$HAVE_DEFS_ENT != 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 && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+XORG_SGML_PATH=$prefix/share/sgml
+HAVE_DEFS_ENT=
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([Whether to build text documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([Whether to build PDF documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([Whether to build PostScript documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([Whether to build HTML documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# 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.  Also
+# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+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
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+               [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+               [Major version of this package])
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+               [$PVM],
+               [Minor version of this package])
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+               [$PVP],
+               [Patch version of this package])
+])
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# 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_ifval([$1], [$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
+        PKG_CHECK_EXISTS([$3],
+                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                        [pkg_failed=yes])
+else
+       pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# 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])
+
+if test $pkg_failed = yes; then
+       $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
+
+       ifelse([$4], , [AC_MSG_ERROR(dnl
+[Package requirements ($2) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.])],
+               [$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.
+
+Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
+               [$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
+
diff --git a/ico/allobjs.h b/ico/allobjs.h
new file mode 100644 (file)
index 0000000..fec24fb
--- /dev/null
@@ -0,0 +1,5 @@
+#include "objcube.h"
+#include "objico.h"
+#include "objocta.h"
+#include "objpyr.h"
+#include "objplane.h"
diff --git a/ico/config.guess b/ico/config.guess
new file mode 100755 (executable)
index 0000000..396482d
--- /dev/null
@@ -0,0 +1,1500 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
+
+timestamp='2006-07-02'
+
+# 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 <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+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 "$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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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 <stdlib.h>
+              #include <unistd.h>
+
+              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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       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*:[3456]*)
+       echo i586-pc-interix${UNAME_RELEASE}
+       exit ;;
+    EM64T:Interix*:[3456]*)
+       echo x86_64-unknown-interix${UNAME_RELEASE}
+       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*:*:* | x86_64: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 ;;
+    avr32*: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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-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 ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-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 <features.h>
+       #ifdef __ELF__
+       # ifdef __GLIBC__
+       #  if __GLIBC__ >= 2
+       LIBC=gnu
+       #  else
+       LIBC=gnulibc1
+       #  endif
+       # else
+       LIBC=gnulibc1
+       # endif
+       #else
+       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+       LIBC=gnu
+       #else
+       LIBC=gnuaout
+       #endif
+       #endif
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^LIBC/{
+               s: ::g
+               p
+           }'`"
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/ico/config.h.in b/ico/config.h.in
new file mode 100644 (file)
index 0000000..1ca4092
--- /dev/null
@@ -0,0 +1,31 @@
+/* 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
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Version number of package */
+#undef VERSION
diff --git a/ico/config.sub b/ico/config.sub
new file mode 100755 (executable)
index 0000000..fab0aa3
--- /dev/null
@@ -0,0 +1,1616 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
+
+timestamp='2006-09-20'
+
+# 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 <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+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-newlib* | 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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | 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 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | 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 \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xc16x | xscale | xscalee[bl] | 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)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | 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-* \
+       | m32c-* | 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-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | 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-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tron-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | 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
+               ;;
+       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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       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 | sparcv9v)
+               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* | -solidbsd* \
+             | -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-newlib* | -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* | -rdos* | -toppers*)
+       # 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
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
+       *-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/ico/configure b/ico/configure
new file mode 100755 (executable)
index 0000000..8d0fc84
--- /dev/null
@@ -0,0 +1,5207 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.61 for ico 1.0.2.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+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) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&    (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    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=.
+  case $as_dir in
+        /*)
+          for as_base in sh bash ksh sh5; do
+            as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+          done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+        # Try only shells that exist, to save several forks.
+        if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+               { ("$as_shell") 2> /dev/null <<\_ASEOF
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+              as_have_required=yes
+              if { "$as_shell" 2> /dev/null <<\_ASEOF
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf@gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+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$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+       case $1 in
+        -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# 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`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='ico'
+PACKAGE_TARNAME='ico'
+PACKAGE_VERSION='1.0.2'
+PACKAGE_STRING='ico 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
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+am__isrc
+CYGPATH_W
+PACKAGE
+VERSION
+ACLOCAL
+AUTOCONF
+AUTOMAKE
+AUTOHEADER
+MAKEINFO
+install_sh
+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
+ICO_CFLAGS
+ICO_LIBS
+XTHREADLIB
+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=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+PKG_CONFIG
+ICO_CFLAGS
+ICO_LIBS'
+
+
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)   ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$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 ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -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'`
+    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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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'`
+    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; }; }
+    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 directory names.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { echo "$as_me: error: Working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$0" ||
+$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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 ico 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR          info documentation [DATAROOTDIR/info]
+  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR           man documentation [DATAROOTDIR/man]
+  --docdir=DIR           documentation root [DATAROOTDIR/doc/ico]
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
+_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 ico 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<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  PKG_CONFIG  path to pkg-config utility
+  ICO_CFLAGS  C compiler flags for ICO, overriding pkg-config
+  ICO_LIBS    linker flags for ICO, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" || continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+ico configure 1.0.2
+generated by GNU Autoconf 2.61
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 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
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by ico $as_me 1.0.2, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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
+IFS=$as_save_IFS
+
+} >&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_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_arg'"
+      ;;
+    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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+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,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r 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 -f -r conftest* 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 -n "$CONFIG_SITE"; then
+  set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+  set x "$ac_default_prefix/share/config.site" \
+       "$ac_default_prefix/etc/config.site"
+fi
+shift
+for ac_site_file
+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 $ac_precious_vars; 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.10'
+
+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
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    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 -f 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
+
+{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+done
+IFS=$as_save_IFS
+
+fi
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+echo "${ECHO_T}$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$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
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+# test whether we have cygpath
+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='ico'
+ 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-"\$(SHELL) $am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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.exe
+  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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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.exe
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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[^ ]*//'`
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
+  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
+
+# Check that 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'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 that 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 { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 | *.map | *.inf | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+    *) 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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; 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 core 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
+{ 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
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       CFLAGS=""
+      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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+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 ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_c89=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 <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+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 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/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+  ;;
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+  ;;
+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
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+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 ICO" >&5
+echo $ECHO_N "checking for ICO... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"x11 >= 0.99.1\"") >&5
+  ($PKG_CONFIG --exists --print-errors "x11 >= 0.99.1") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_ICO_CFLAGS=`$PKG_CONFIG --cflags "x11 >= 0.99.1" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"x11 >= 0.99.1\"") >&5
+  ($PKG_CONFIG --exists --print-errors "x11 >= 0.99.1") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_ICO_LIBS=`$PKG_CONFIG --libs "x11 >= 0.99.1" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+else
+       pkg_failed=untried
+fi
+
+if test $pkg_failed = yes; then
+       ICO_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "x11 >= 0.99.1"`
+       # Put the nasty error message in config.log where it belongs
+       echo "$ICO_PKG_ERRORS" 1>&5
+
+       { { echo "$as_me:$LINENO: error: Package requirements (x11 >= 0.99.1) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the ICO_CFLAGS and ICO_LIBS environment variables
+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 >= 0.99.1) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the ICO_CFLAGS and ICO_LIBS environment variables
+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 ICO_CFLAGS and ICO_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+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 ICO_CFLAGS and ICO_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+       ICO_CFLAGS=$pkg_cv_ICO_CFLAGS
+       ICO_LIBS=$pkg_cv_ICO_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       :
+fi
+
+
+XTHREADLIB=`$PKG_CONFIG --variable=xthreadlib x11`
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/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_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { 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=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_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; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ 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
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+
+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 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
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     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 "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+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_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+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) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+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$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+       case $1 in
+        -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by ico $as_me 1.0.2, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+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 and configuration settings, 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 <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+ico config.status 1.0.2
+configured by $0, generated by GNU Autoconf 2.61,
+  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2006 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# 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
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --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;;
+  --he | --h)
+    # Conflict between --help and --header
+    { 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 ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { 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"
+     ac_need_defaults=false ;;
+
+  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 CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  CONFIG_SHELL=$SHELL
+  export CONFIG_SHELL
+  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) { { 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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+#
+# Set up the sed scripts for 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
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+am__isrc!$am__isrc$ac_delim
+CYGPATH_W!$CYGPATH_W$ac_delim
+PACKAGE!$PACKAGE$ac_delim
+VERSION!$VERSION$ac_delim
+ACLOCAL!$ACLOCAL$ac_delim
+AUTOCONF!$AUTOCONF$ac_delim
+AUTOMAKE!$AUTOMAKE$ac_delim
+AUTOHEADER!$AUTOHEADER$ac_delim
+MAKEINFO!$MAKEINFO$ac_delim
+install_sh!$install_sh$ac_delim
+STRIP!$STRIP$ac_delim
+INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
+mkdir_p!$mkdir_p$ac_delim
+AWK!$AWK$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+am__leading_dot!$am__leading_dot$ac_delim
+AMTAR!$AMTAR$ac_delim
+am__tar!$am__tar$ac_delim
+am__untar!$am__untar$ac_delim
+MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
+MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
+MAINT!$MAINT$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+DEPDIR!$DEPDIR$ac_delim
+am__include!$am__include$ac_delim
+am__quote!$am__quote$ac_delim
+AMDEP_TRUE!$AMDEP_TRUE$ac_delim
+AMDEP_FALSE!$AMDEP_FALSE$ac_delim
+AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
+CCDEPMODE!$CCDEPMODE$ac_delim
+am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
+am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
+PKG_CONFIG!$PKG_CONFIG$ac_delim
+ICO_CFLAGS!$ICO_CFLAGS$ac_delim
+ICO_LIBS!$ICO_LIBS$ac_delim
+XTHREADLIB!$XTHREADLIB$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+host_os!$host_os$ac_delim
+APP_MAN_SUFFIX!$APP_MAN_SUFFIX$ac_delim
+LIB_MAN_SUFFIX!$LIB_MAN_SUFFIX$ac_delim
+FILE_MAN_SUFFIX!$FILE_MAN_SUFFIX$ac_delim
+MISC_MAN_SUFFIX!$MISC_MAN_SUFFIX$ac_delim
+DRIVER_MAN_SUFFIX!$DRIVER_MAN_SUFFIX$ac_delim
+ADMIN_MAN_SUFFIX!$ADMIN_MAN_SUFFIX$ac_delim
+APP_MAN_DIR!$APP_MAN_DIR$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+LIB_MAN_DIR!$LIB_MAN_DIR$ac_delim
+FILE_MAN_DIR!$FILE_MAN_DIR$ac_delim
+MISC_MAN_DIR!$MISC_MAN_DIR$ac_delim
+DRIVER_MAN_DIR!$DRIVER_MAN_DIR$ac_delim
+ADMIN_MAN_DIR!$ADMIN_MAN_DIR$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 7; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_ACEOF
+
+
+# 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
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      ac_file_inputs="$ac_file_inputs $ac_f"
+    done
+
+    # 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.  */
+    configure_input="Generated from "`IFS=:
+         echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    fi
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin";;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$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'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+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&@top_builddir@&$ac_top_builddir_sub&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out"; rm -f "$tmp/out";;
+  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
+  esac
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+_ACEOF
+
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status.  If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless.  But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([  #]*\\)[^        ]*\\([  ]*'
+ac_dB='\\)[     (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
+
+uniq confdefs.h |
+  sed -n '
+       t rset
+       :rset
+       s/^[     ]*#[    ]*define[       ][      ]*//
+       t ok
+       d
+       :ok
+       s/[\\&,]/\\&/g
+       s/^\('"$ac_word_re"'\)\(([^()]*)\)[      ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+       s/^\('"$ac_word_re"'\)[  ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+  ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then replace #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.
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[    #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is:         sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is:        sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be:    sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
+do
+  # Write a here document:
+    cat >>$CONFIG_STATUS <<_ACEOF
+    # First, check the format of the line:
+    cat >"\$tmp/defines.sed" <<\\CEOF
+/^[     ]*#[    ]*undef[        ][      ]*$ac_word_re[  ]*\$/b def
+/^[     ]*#[    ]*define[       ][      ]*$ac_word_re[(         ]/b def
+b
+:def
+_ACEOF
+  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+  grep . conftest.tail >/dev/null || break
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines conftest.tail
+
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
+cat >>$CONFIG_STATUS <<\_ACEOF
+  if test x"$ac_file" != x-; then
+    echo "/* $configure_input  */" >"$tmp/config.h"
+    cat "$ac_result" >>"$tmp/config.h"
+    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
+      rm -f $ac_file
+      mv "$tmp/config.h" $ac_file
+    fi
+  else
+    echo "/* $configure_input  */"
+    cat "$ac_result"
+  fi
+  rm -f "$tmp/out12"
+# 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" >`$as_dirname -- $ac_file ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X$ac_file : 'X\(//\)[^/]' \| \
+        X$ac_file : 'X\(//\)$' \| \
+        X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
+echo X$ac_file |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) 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.
+  # Grep'ing the whole file is not good either: AIX grep has a line
+  # limit of 2048, but all sed's we know have understand at least 4000.
+  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
+    dirpart=`$as_dirname -- "$mf" ||
+$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=`$as_dirname -- "$file" ||
+$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'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$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'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (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/ico/configure.ac b/ico/configure.ac
new file mode 100644 (file)
index 0000000..e8a433f
--- /dev/null
@@ -0,0 +1,44 @@
+
+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(ico,[1.0.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],ico)
+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(ICO, x11 >= 0.99.1)
+AC_SUBST(ICO_CFLAGS)
+AC_SUBST(ICO_LIBS)
+XTHREADLIB=`$PKG_CONFIG --variable=xthreadlib x11`
+AC_SUBST(XTHREADLIB)
+
+XORG_MANPAGE_SECTIONS
+XORG_RELEASE_VERSION
+
+AC_OUTPUT([Makefile])
diff --git a/ico/depcomp b/ico/depcomp
new file mode 100755 (executable)
index 0000000..ca5ea4e
--- /dev/null
@@ -0,0 +1,584 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2006-10-15.18
+
+# Copyright (C) 1999, 2000, 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 to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    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"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # 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 mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $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/ico/ico.c b/ico/ico.c
new file mode 100644 (file)
index 0000000..8b93b10
--- /dev/null
+++ b/ico/ico.c
@@ -0,0 +1,1330 @@
+/* $XConsortium: ico.c,v 1.47 94/04/17 20:45:15 gildea Exp $ */
+/* $XdotOrg: $ */
+/***********************************************************
+
+Copyright (c) 1987  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
+CONNECTION 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 dealings
+in this Software without prior written authorization from the X Consortium.
+
+
+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/ico/ico.c,v 1.9tsi Exp $ */
+
+/******************************************************************************
+ * Description
+ *     Display a wire-frame rotating icosahedron, with hidden lines removed
+ *
+ * Arguments:
+ *     -r              display on root window instead of creating a new one
+ * (plus a host of others, try -help)
+ *****************************************************************************/
+/* Additions by jimmc@sci:
+ *  faces and colors
+ *  double buffering on the display
+ *  additional polyhedra
+ *  sleep switch
+ */
+
+/*
+ * multi-thread version by Stephen Gildea, January 1992
+ */
+
+/* Additions by Carlos A M dos Santos, XFree86 project, September 1999:
+ *  use of "q" to quit threads
+ *  support for ICCCM delete window message
+ *  better thread support - mutex and condition to control termination
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+
+#include <X11/XlibConf.h>
+#ifdef XTHREADS
+# define MULTITHREAD
+#endif
+#endif /* HAVE_CONFIG_H / autoconf */
+
+#include <math.h>
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+#include <X11/Xfuncs.h>
+#include <X11/keysym.h>
+#include <stdio.h>
+#ifdef MULTIBUFFER
+#include <X11/extensions/multibuf.h>
+#endif /* MULTIBUFFER */
+#ifdef MULTITHREAD
+#include <X11/Xthreads.h>
+#endif
+#include <X11/Xos.h>
+
+#define MIN_ICO_WIDTH 5
+#define MIN_ICO_HEIGHT 5
+#define DEFAULT_ICO_WIDTH 150
+#define DEFAULT_ICO_HEIGHT 150
+#define DEFAULT_DELTAX 13
+#define DEFAULT_DELTAY 9
+
+#include "polyinfo.h"  /* define format of one polyhedron */
+
+/* Now include all the files which define the actual polyhedra */
+Polyinfo polygons[] = {
+#include "allobjs.h"
+};
+#define NumberPolygons sizeof(polygons)/sizeof(polygons[0])
+
+#include <stdlib.h>
+#include <time.h>      /* for time_t */
+#include <sys/time.h>  /* for struct timeval */
+
+typedef double Transform3D[4][4];
+
+typedef struct {
+       int prevX, prevY;
+       unsigned long *plane_masks;     /* points into dbpair.plane_masks */
+       unsigned long enplanemask;      /* what we enable for drawing */
+       XColor *colors;         /* size = 2 ** totalplanes */
+       unsigned long *pixels;  /* size = 2 ** planesperbuf */
+} DBufInfo;
+
+/* variables that need to be per-thread */
+
+struct closure {
+    /* these elements were originally in DBufPair, a struct type */
+    int planesperbuf;
+    int pixelsperbuf;  /* = 1<<planesperbuf */
+    int totalplanes;   /* = 2*planesperbuf */
+    int totalpixels;   /* = 1<<totalplanes */
+    unsigned long *plane_masks;        /* size = totalplanes */
+    unsigned long pixels[1];
+    int dbufnum;
+    DBufInfo bufs[2];
+    DBufInfo *drawbuf, *dpybuf;
+    /* end of old DBufPair dbpair */
+    /* these elements were originally global variables */
+    Window win, draw_window;
+    int winW, winH;
+    Colormap cmap;
+    GC gcontext;
+#ifdef MULTIBUFFER
+    Multibuffer multibuffers[2];
+#endif /* MULTIBUFFER */
+    int nplanesets;
+    /* items needed by drawPoly */
+    char drawn[MAXNV][MAXNV];
+    Transform3D xform;
+    Point3D xv[2][MAXNV];
+    int xv_buffer;
+    double wo2, ho2;
+#ifdef MULTITHREAD           
+    int thread_num;
+#endif
+};
+
+
+/* The display is shared and writable, but Xlib locks it as necessary */
+
+Display *dpy;
+
+/* This atom will be used to catch the ICCCM "delete window" message. It will
+ * be allocated once and used in read-only mode by threads, so it can be a
+ * global variable */
+
+Atom wm_delete_window;
+
+/*
+ * variables that are not set except maybe in initialization before
+ * any additional threads are created
+ */
+
+char *Primaries[] = {
+    "red", "green", "blue", "yellow", "cyan", "magenta"
+};
+#define NumberPrimaries 6
+
+const char *help_message[] = {
+"where options include:",
+"-display host:dpy           X server to use",
+"    -geometry geom          geometry of window to use",
+"    -size WxH               size of object to rotate",
+"    -delta +X+Y             amount by which to move object",
+"    -r                      draw in the root window",
+"    -d number               dashed line pattern for wire frames",
+"    -bg color               background color",
+"    -colors color ...       codes to use on sides",
+"    -p#                     use # (1 through 8) primary colors",
+#ifdef MULTIBUFFER           
+"    -dbl                    use double buffering (extension if present)",
+#else                        
+"    -dbl                    use double buffering (software only)",
+#endif                       
+"    -softdbl                use software double buffering",
+"    -noedges                don't draw wire frame edges",
+"    -faces                  draw faces",
+"    -copy                   use multibuffer update action Copied",
+"    -untouched              use multibuffer update action Untouched",
+"    -undefined              use multibuffer update action Undefined",
+"    -lw number              line width to use",
+"    -i                      invert",
+"    -sleep number           seconds to sleep in between draws",
+"    -obj objname            type of polyhedral object to draw",
+"    -objhelp                list polyhedral objects available",
+#ifdef MULTITHREAD           
+"    -threads number         number of windows, each its own thread",
+#endif
+NULL};
+
+const char *ProgramName;       /* argv[0] */
+
+/*
+ * variables set by command-line options
+ */
+const char *geom = NULL;       /* -geometry: window geometry */
+int useRoot = 0;               /* -r */
+int dash = 0;                  /* -d: dashed line pattern */
+char **colornames;             /* -colors (points into argv) */
+#ifdef MULTIBUFFER
+int update_action = MultibufferUpdateActionBackground;
+#endif
+int linewidth = 0;             /* -lw */
+int multibufext = 0;           /* -dbl: use Multi-Buffering extension */
+int dblbuf = 0;                        /* -dbl or -softdbl: double buffering */
+int numcolors = 0;             /* -p: number of primary colors to use */
+const char *background_colorname = NULL; /* -bg */
+int doedges = 1;               /* -noedges turns this off */
+int dofaces = 0;               /* -faces */
+int invert = 0;                        /* -i */
+const char *ico_geom = NULL;   /* -size: size of object in window */
+const char *delta_geom = NULL; /* -delta: amount by which to move object */
+Polyinfo *poly;                        /* -obj: the poly to draw */
+int dsync = 0;                 /* -dsync */
+int xsync = 0;                 /* -sync */
+int msleepcount = 0;           /* -sleep value in milliseconds*/
+#ifdef MULTITHREAD
+int thread_count;
+#ifdef XMUTEX_INITIALIZER
+xmutex_rec count_mutex = XMUTEX_INITIALIZER;
+#else
+xmutex_rec count_mutex;
+#endif
+xcondition_rec count_cond;     /* Xthreads doesn't define an equivalent to
+                                * PTHREAD_COND_INITIALIZER, so we must call
+                                * xcondition_init later */
+#endif
+
+/******************************************************************************
+ * Description
+ *     Error handling
+ *****************************************************************************/
+
+#if defined(__GNUC__) && \
+    ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)))
+void icoFatal (const char *fmt, const char *a0) __attribute__((__noreturn__));
+#endif
+void
+icoFatal(const char *fmt, const char *a0)
+{
+       fprintf(stderr, "%s: ", ProgramName);
+       fprintf(stderr, fmt, a0);
+       fprintf(stderr, "\n");
+       exit(1);
+}
+
+
+/******************************************************************************
+ * Description
+ *     Memory allocation
+ *****************************************************************************/
+
+static char *
+xalloc(unsigned int nbytes)
+{
+        char *p;
+
+       p = malloc(nbytes);
+       if (p)
+               return p;
+
+       fprintf(stderr, "%s: no more memory\n", ProgramName);
+       exit(1);
+}
+
+
+/******************************************************************************
+ * Description
+ *     Sleep a certain number of milliseconds
+ *****************************************************************************/
+
+static void
+msleep(unsigned int msecs)
+{
+       struct timeval timeout;
+
+       timeout.tv_sec = msecs / 1000; timeout.tv_usec = (msecs % 1000) * 1000;
+       select(1,NULL,NULL,NULL,&timeout);
+}
+
+
+/******************************************************************************
+ * Description
+ *     Format a 4x4 identity matrix.
+ *
+ * Output
+ *     *m              Formatted identity matrix
+ *****************************************************************************/
+
+static void
+IdentMat(Transform3D m)
+{
+       int i;
+       int j;
+
+       for (i = 3; i >= 0; --i) {
+               for (j = 3; j >= 0; --j)
+                       m[i][j] = 0.0;
+               m[i][i] = 1.0;
+       }
+}
+
+
+/******************************************************************************
+ * Description
+ *     Concatenate two 4-by-4 transformation matrices.
+ *
+ * Input
+ *     l               multiplicand (left operand)
+ *     r               multiplier (right operand)
+ *
+ * Output
+ *     *m              Result matrix
+ *****************************************************************************/
+
+static void
+ConcatMat(Transform3D l, Transform3D r, Transform3D m)
+{
+       int i;
+       int j;
+
+       for (i = 0; i < 4; ++i)
+               for (j = 0; j < 4; ++j)
+                       m[i][j] = l[i][0] * r[0][j]
+                           + l[i][1] * r[1][j]
+                           + l[i][2] * r[2][j]
+                           + l[i][3] * r[3][j];
+}
+
+
+/******************************************************************************
+ * Description
+ *     Format a matrix that will perform a rotation transformation
+ *     about the specified axis.  The rotation angle is measured
+ *     counterclockwise about the specified axis when looking
+ *     at the origin from the positive axis.
+ *
+ * Input
+ *     axis            Axis ('x', 'y', 'z') about which to perform rotation
+ *     angle           Angle (in radians) of rotation
+ *     A               Pointer to rotation matrix
+ *
+ * Output
+ *     *m              Formatted rotation matrix
+ *****************************************************************************/
+
+static void
+FormatRotateMat(char axis, double angle, Transform3D m)
+{
+       double s, c;
+
+       IdentMat(m);
+
+       s = sin(angle);
+       c = cos(angle);
+
+       switch (axis)
+       {
+               case 'x':
+                       m[1][1] = m[2][2] = c;
+                       m[1][2] = s;
+                       m[2][1] = -s;
+                       break;
+               case 'y':
+                       m[0][0] = m[2][2] = c;
+                       m[2][0] = s;
+                       m[0][2] = -s;
+                       break;
+               case 'z':
+                       m[0][0] = m[1][1] = c;
+                       m[0][1] = s;
+                       m[1][0] = -s;
+                       break;
+       }
+}
+
+
+/******************************************************************************
+ * Description
+ *     Perform a partial transform on non-homogeneous points.
+ *     Given an array of non-homogeneous (3-coordinate) input points,
+ *     this routine multiplies them by the 3-by-3 upper left submatrix
+ *     of a standard 4-by-4 transform matrix.  The resulting non-homogeneous
+ *     points are returned.
+ *
+ * Input
+ *     n               number of points to transform
+ *     m               4-by-4 transform matrix
+ *     in              array of non-homogeneous input points
+ *
+ * Output
+ *     *out            array of transformed non-homogeneous output points
+ *****************************************************************************/
+
+static void
+PartialNonHomTransform(int n, Transform3D m, const Point3D *in, Point3D *out)
+{
+       for (; n > 0; --n, ++in, ++out) {
+               out->x = in->x * m[0][0] + in->y * m[1][0] + in->z * m[2][0];
+               out->y = in->x * m[0][1] + in->y * m[1][1] + in->z * m[2][1];
+               out->z = in->x * m[0][2] + in->y * m[1][2] + in->z * m[2][2];
+       }
+}
+
+
+/*
+ * Unfortunately we can not use XWindowEvent and XCheckWindowEvent to get
+ * ClientMessage events, because there is no corresponding event mask. We must
+ * use XIfEvent and XCheckIfEvent and this function as a predicate. Better if
+ * Xlib had some kind of XWindowAnyEvent and XCheckWindowEvent. -- Casantos.
+ */
+
+static Bool
+predicate(Display *display, XEvent *event, XPointer args)
+{
+    Window w = (Window) args;
+    return event->xany.window == w;
+}
+
+/******************************************************************************
+ * Description
+ *     Icosahedron animator.
+ *****************************************************************************/
+
+static void
+icoClearArea(struct closure *closure, int x, int y, int w, int h)
+{
+       if (multibufext && dblbuf)
+               return;
+
+       if (dblbuf || dofaces) {
+               XSetForeground(dpy,
+                       closure->gcontext,
+                       closure->drawbuf->pixels[0]);
+
+               /* use background as foreground color for fill */
+               XFillRectangle(dpy,closure->win,closure->gcontext,x,y,w,h);
+       } else {
+               XClearArea(dpy,closure->win,x,y,w,h,0);
+       }
+}
+
+/* Set up points, transforms, etc.  */
+
+static void
+initPoly(struct closure *closure, Polyinfo *poly, int icoW, int icoH)
+{
+    Point3D *vertices = poly->v;
+    int NV = poly->numverts;
+    Transform3D r1;
+    Transform3D r2;
+
+    FormatRotateMat('x', 5 * 3.1416 / 180.0, r1);
+    FormatRotateMat('y', 5 * 3.1416 / 180.0, r2);
+    ConcatMat(r1, r2, closure->xform);
+
+    memcpy((char *)closure->xv[0], (char *)vertices, NV * sizeof(Point3D));
+    closure->xv_buffer = 0;
+
+    closure->wo2 = icoW / 2.0;
+    closure->ho2 = icoH / 2.0;
+}
+
+static void
+setDrawBuf (struct closure *closure, int n)
+{
+    XGCValues xgcv;
+    unsigned long mask;
+
+#ifdef MULTIBUFFER
+    if (multibufext && dblbuf) {
+       closure->win = closure->multibuffers[n];
+       n = 0;
+    }
+#endif /* MULTIBUFFER */
+
+    closure->drawbuf = closure->bufs+n;
+    xgcv.foreground = closure->drawbuf->pixels[closure->pixelsperbuf-1];
+    xgcv.background = closure->drawbuf->pixels[0];
+    mask = GCForeground | GCBackground;
+    if (dblbuf && !multibufext) {
+       xgcv.plane_mask = closure->drawbuf->enplanemask;
+       mask |= GCPlaneMask;
+    }
+    XChangeGC(dpy, closure->gcontext, mask, &xgcv);
+}
+
+static void
+setDisplayBuf(struct closure *closure, int n, int firsttime)
+{
+#ifdef MULTIBUFFER
+       if (multibufext && dblbuf) {
+               XmbufDisplayBuffers (dpy, 1, &closure->multibuffers[n], msleepcount, 0);
+               if (!firsttime)
+                       return;
+               n = 0;
+       }
+#endif
+       closure->dpybuf = closure->bufs+n;
+       if (closure->totalpixels > 2)
+           XStoreColors(dpy,closure->cmap,closure->dpybuf->colors,closure->totalpixels);
+}
+
+static void
+setBufColor(struct closure *closure, int n, XColor *color)
+{
+       int i,j,cx;
+       DBufInfo *b;
+       unsigned long pix;
+
+       for (i=0; i<closure->nplanesets; i++) {
+               b = closure->bufs+i;
+               for (j=0; j<(dblbuf&&!multibufext?closure->pixelsperbuf:1); j++) {
+                       cx = n + j*closure->pixelsperbuf;
+                       pix = b->colors[cx].pixel;
+                       b->colors[cx] = *color;
+                       b->colors[cx].pixel = pix;
+                       b->colors[cx].flags = DoRed | DoGreen | DoBlue;
+               }
+       }
+}
+
+/******************************************************************************
+ * Description
+ *     Undraw previous polyhedron (by erasing its bounding box).
+ *     Rotate and draw the new polyhedron.
+ *
+ * Input
+ *     poly            the polyhedron to draw
+ *     gc              X11 graphics context to be used for drawing
+ *     icoX, icoY      position of upper left of bounding-box
+ *     icoW, icoH      size of bounding-box
+ *     prevX, prevY    position of previous bounding-box
+ *****************************************************************************/
+
+static void
+drawPoly(struct closure *closure, Polyinfo *poly, GC gc,
+        int icoX, int icoY, int icoW, int icoH, int prevX, int prevY)
+{
+       int *f = poly->f;
+       int NV = poly->numverts;
+       int NF = poly->numfaces;
+
+       int p0;
+       int p1;
+       XPoint *pv2;
+       XSegment *pe;
+       Point3D *pxv;
+       XPoint v2[MAXNV];
+       XSegment edges[MAXEDGES];
+       int i;
+       int j,k;
+       int *pf;
+       int facecolor;
+
+       int pcount;
+       double pxvz;
+       XPoint ppts[MAXEDGESPERPOLY];
+
+       /* Switch double-buffer and rotate vertices */
+
+       closure->xv_buffer = !closure->xv_buffer;
+       PartialNonHomTransform(NV, closure->xform,
+               closure->xv[!closure->xv_buffer],
+               closure->xv[closure->xv_buffer]);
+
+
+       /* Convert 3D coordinates to 2D window coordinates: */
+
+       pxv = closure->xv[closure->xv_buffer];
+       pv2 = v2;
+       for (i = NV - 1; i >= 0; --i) {
+               pv2->x = (int) ((pxv->x + 1.0) * closure->wo2) + icoX;
+               pv2->y = (int) ((pxv->y + 1.0) * closure->ho2) + icoY;
+               ++pxv;
+               ++pv2;
+       }
+
+
+       /* Accumulate edges to be drawn, eliminating duplicates for speed: */
+
+       pxv = closure->xv[closure->xv_buffer];
+       pv2 = v2;
+       pf = f;
+       pe = edges;
+       bzero(closure->drawn, sizeof(closure->drawn));
+
+       if (dblbuf)
+               setDrawBuf(closure, closure->dbufnum);
+                       /* switch drawing buffers if double buffered */
+       /* for faces, need to clear before FillPoly */
+       if (dofaces && !(multibufext && dblbuf)) {
+               /* multibuf uses update background */
+               if (dblbuf)
+                       icoClearArea(closure,
+                               closure->drawbuf->prevX - linewidth/2,
+                               closure->drawbuf->prevY - linewidth/2,
+                               icoW + linewidth + 1, icoH + linewidth + 1);
+               icoClearArea(closure,
+                       prevX - linewidth/2, prevY - linewidth/2,
+                       icoW + linewidth + 1, icoH + linewidth + 1);
+       }
+
+       if (dsync)
+               XSync(dpy, 0);
+
+       for (i = NF - 1; i >= 0; --i, pf += pcount) {
+
+               pcount = *pf++; /* number of edges for this face */
+               pxvz = 0.0;
+               for (j=0; j<pcount; j++) {
+                       p0 = pf[j];
+                       pxvz += pxv[p0].z;
+               }
+
+               /* If facet faces away from viewer, don't consider it: */
+               if (pxvz<0.0)
+                       continue;
+
+               if (dofaces) {
+                       if (numcolors)
+                               facecolor = i%numcolors + 1;
+                       else
+                               facecolor = 1;
+                       XSetForeground(dpy, gc,
+                               closure->drawbuf->pixels[facecolor]);
+                       for (j=0; j<pcount; j++) {
+                               p0 = pf[j];
+                               ppts[j].x = pv2[p0].x;
+                               ppts[j].y = pv2[p0].y;
+                       }
+                       XFillPolygon(dpy, closure->win, gc, ppts, pcount,
+                               Convex, CoordModeOrigin);
+               }
+
+               if (doedges) {
+                       for (j=0; j<pcount; j++) {
+                               if (j<pcount-1) k=j+1;
+                               else k=0;
+                               p0 = pf[j];
+                               p1 = pf[k];
+                               if (!closure->drawn[p0][p1]) {
+                                       closure->drawn[p0][p1] = 1;
+                                       closure->drawn[p1][p0] = 1;
+                                       pe->x1 = pv2[p0].x;
+                                       pe->y1 = pv2[p0].y;
+                                       pe->x2 = pv2[p1].x;
+                                       pe->y2 = pv2[p1].y;
+                                       ++pe;
+                               }
+                       }
+               }
+       }
+
+       /* Erase previous, draw current icosahedrons; sync for smoothness. */
+
+       if (doedges) {
+               if (dofaces) {
+                       XSetForeground(dpy, gc, closure->drawbuf->pixels[0]);
+                               /* use background as foreground color */
+               } else {
+                       if (dblbuf && !multibufext)
+                               icoClearArea(closure,
+                                       closure->drawbuf->prevX - linewidth/2,
+                                       closure->drawbuf->prevY - linewidth/2,
+                                       icoW + linewidth + 1,
+                                       icoH + linewidth + 1);
+                       if (!(multibufext && dblbuf))
+                               icoClearArea(closure,
+                                       prevX - linewidth/2,
+                                       prevY - linewidth/2,
+                                       icoW + linewidth + 1,
+                                       icoH + linewidth + 1);
+                       if (dblbuf || dofaces) {
+                               XSetForeground(dpy, gc, closure->drawbuf->pixels[
+                                       closure->pixelsperbuf-1]);
+                       }
+               }
+               XDrawSegments(dpy, closure->win, gc, edges, pe - edges);
+       }
+
+       if (dsync)
+               XSync(dpy, 0);
+
+       if (dblbuf) {
+               closure->drawbuf->prevX = icoX;
+               closure->drawbuf->prevY = icoY;
+               setDisplayBuf(closure, closure->dbufnum, 0);
+       }
+       if (dblbuf)
+               closure->dbufnum = 1 - closure->dbufnum;
+       if (!(multibufext && dblbuf) && msleepcount > 0)
+               msleep(msleepcount);
+}
+
+static void
+initDBufs(struct closure *closure, int fg, int bg, int planesperbuf)
+{
+       int i,j,jj,j0,j1,k,m,t;
+       DBufInfo *b;
+       XColor bgcolor, fgcolor;
+
+       closure->nplanesets = (dblbuf && !multibufext ? 2 : 1);
+
+       closure->planesperbuf = planesperbuf;
+       closure->pixelsperbuf = 1<<planesperbuf;
+       closure->totalplanes = closure->nplanesets * planesperbuf;
+       closure->totalpixels = 1<<closure->totalplanes;
+       closure->plane_masks = (unsigned long *)
+               xalloc(closure->totalplanes * sizeof(unsigned long));
+       closure->dbufnum = 0;
+       for (i=0; i < closure->nplanesets; i++) {
+               b = closure->bufs+i;
+               b->plane_masks = closure->plane_masks + (i*planesperbuf);
+               b->colors = (XColor *)
+                       xalloc(closure->totalpixels * sizeof(XColor));
+               b->pixels = (unsigned long *)
+                       xalloc(closure->pixelsperbuf * sizeof(unsigned long));
+       }
+
+       if (closure->totalplanes == 1) {
+           closure->pixels[0] = bg;
+           closure->plane_masks[0] = fg ^ bg;
+       } else {
+           t = XAllocColorCells(dpy,closure->cmap,0,
+                   closure->plane_masks,closure->totalplanes, closure->pixels,1);
+                           /* allocate color planes */
+           if (t==0) {
+                   icoFatal("can't allocate enough color planes", NULL);
+           }
+       }
+
+       fgcolor.pixel = fg;
+       bgcolor.pixel = bg;
+       XQueryColor(dpy,closure->cmap,&fgcolor);
+       XQueryColor(dpy,closure->cmap,&bgcolor);
+
+       setBufColor(closure, 0,&bgcolor);
+       setBufColor(closure, 1,&fgcolor);
+       for (i=0; i<closure->nplanesets; i++) {
+               b = closure->bufs+i;
+               for (j0=0; j0<(dblbuf&&!multibufext?closure->pixelsperbuf:1); j0++) {
+                   for (j1=0; j1<closure->pixelsperbuf; j1++) {
+                       j = (j0<<closure->planesperbuf)|j1;
+                       if (i==0) jj=j;
+                       else jj= (j1<<closure->planesperbuf)|j0;
+                       b->colors[jj].pixel = closure->pixels[0];
+                       for (k=0, m=j; m; k++, m=m>>1) {
+                               if (m&1)
+                                  b->colors[jj].pixel ^= closure->plane_masks[k];
+                       }
+                       b->colors[jj].flags = DoRed | DoGreen | DoBlue;
+                   }
+               }
+               b->prevX = b->prevY = 0;
+               b->enplanemask = 0;
+               for (j=0; j<planesperbuf; j++) {
+                       b->enplanemask |= b->plane_masks[j];
+               }
+               for (j=0; j<closure->pixelsperbuf; j++) {
+                       b->pixels[j] = closure->pixels[0];
+                       for (k=0, m=j; m; k++, m=m>>1) {
+                               if (m&1)
+                                  b->pixels[j] ^= b->plane_masks[k];
+                       }
+               }
+       }
+
+       if (!(multibufext && dblbuf)) {
+           setDrawBuf(closure, 0);
+           XSetBackground(dpy, closure->gcontext, closure->bufs[0].pixels[0]);
+           XSetWindowBackground(dpy, closure->draw_window, closure->bufs[0].pixels[0]);
+           XSetPlaneMask(dpy, closure->gcontext, AllPlanes);
+           icoClearArea(closure, 0, 0, closure->winW, closure->winH); /* clear entire window */
+       }
+}
+
+static void
+setBufColname(struct closure *closure, int n, char *colname)
+{
+       int t;
+       XColor dcolor, color;
+
+       t = XLookupColor(dpy,closure->cmap,colname,&dcolor,&color);
+       if (t==0) {     /* no such color */
+               icoFatal("no such color %s",colname);
+       }
+       setBufColor(closure, n,&color);
+}
+
+
+/* function to create and run an ico window */
+static void *
+do_ico_window(void *ptr)
+{
+       int fg, bg;
+       XSetWindowAttributes xswa;
+       XWindowAttributes xwa;
+       XEvent xev;
+       int icoX, icoY;
+       unsigned long vmask;
+       XGCValues xgcv;
+       int initcolors = 0;
+       int icoDeltaX = DEFAULT_DELTAX, icoDeltaY = DEFAULT_DELTAY;
+       int icodeltax2, icodeltay2;
+       Bool blocking = False;
+       int winX, winY;
+       int icoW = 0, icoH = 0;
+       KeySym ksym;
+       Bool do_it = True;
+       char buf[20];
+       struct closure *closure = ptr;
+#ifdef MULTITHREAD           
+       int len;
+#endif
+
+#ifdef DEBUG
+       printf("thread %x starting\n", xthread_self());
+#endif
+       closure->cmap = XDefaultColormap(dpy,DefaultScreen(dpy));
+       if (!closure->cmap) {
+               icoFatal("no default colormap!", NULL);
+       }
+
+       fg = WhitePixel(dpy, DefaultScreen(dpy));
+       bg = BlackPixel(dpy, DefaultScreen(dpy));
+       if (background_colorname) {
+           XColor cdef, igndef;
+
+           if (XAllocNamedColor (dpy, closure->cmap, background_colorname,
+                                 &cdef, &igndef))
+             bg = cdef.pixel;
+           else 
+             icoFatal("background: no such color \"%s\"",background_colorname);
+       }
+       if (numcolors && (!dofaces || numcolors == 1)) {
+           XColor cdef, igndef;
+
+           if (XAllocNamedColor (dpy, closure->cmap, colornames[0], &cdef, &igndef))
+             fg = cdef.pixel;
+           else 
+             icoFatal("face: no such color \"%s\"", colornames[0]);
+       }
+
+       if (invert) {
+           unsigned long tmp = fg;
+           fg = bg;
+           bg = tmp;
+       }
+
+       /* Set up window parameters, create and map window if necessary */
+
+       if (useRoot) {
+               closure->draw_window = DefaultRootWindow(dpy);
+               winX = 0;
+               winY = 0;
+               closure->winW = DisplayWidth(dpy, DefaultScreen(dpy));
+               closure->winH = DisplayHeight(dpy, DefaultScreen(dpy));
+       } else {
+               closure->winW = closure->winH = (multibufext&&dblbuf ? 300 : 600);
+               winX = (DisplayWidth(dpy, DefaultScreen(dpy)) - closure->winW) >> 1;
+               winY = (DisplayHeight(dpy, DefaultScreen(dpy)) - closure->winH) >> 1;
+               if (geom) 
+                       XParseGeometry(geom, &winX, &winY,
+                                      (unsigned int *)&closure->winW,
+                                      (unsigned int *)&closure->winH);
+
+               xswa.event_mask = ExposureMask |
+                                 StructureNotifyMask |
+                                 KeyPressMask;
+               xswa.background_pixel = bg;
+               xswa.border_pixel = fg;
+
+               closure->draw_window = XCreateWindow(dpy,
+                   DefaultRootWindow(dpy), 
+                   winX, winY, closure->winW, closure->winH, 0, 
+                   DefaultDepth(dpy, DefaultScreen(dpy)), 
+                   InputOutput, DefaultVisual(dpy, DefaultScreen(dpy)),
+                   CWEventMask | CWBackPixel | CWBorderPixel, &xswa);
+#ifdef MULTITHREAD           
+               len = sprintf(buf, "Ico: thread %d", closure->thread_num);
+               XChangeProperty(dpy, closure->draw_window,
+                               XA_WM_NAME, XA_STRING, 8, 
+                               PropModeReplace, (unsigned char *)buf, len);
+#else
+               XChangeProperty(dpy, closure->draw_window,
+                               XA_WM_NAME, XA_STRING, 8, 
+                               PropModeReplace, (unsigned char *)"Ico", 3);
+#endif
+               (void) XSetWMProtocols (dpy, closure->draw_window,
+                                       &wm_delete_window, 1);
+               XMapWindow(dpy, closure->draw_window);
+#ifdef DEBUG
+               printf("thread %x waiting for Expose\n", xthread_self());
+#endif
+               for (;;) {
+                   XNextEvent(dpy, &xev);
+                   if (xev.type == Expose)
+                       break;
+               }
+#ifdef DEBUG
+               printf("thread %x got Expose\n", xthread_self());
+#endif
+               if (XGetWindowAttributes(dpy,closure->draw_window,&xwa)==0) {
+                       icoFatal("cannot get window attributes (size)", NULL);
+               }
+               closure->winW = xwa.width;
+               closure->winH = xwa.height;
+       }
+
+       if (ico_geom) 
+         XParseGeometry (ico_geom, &icoX, &icoY,
+                         (unsigned int *)&icoW,
+                         (unsigned int *)&icoH);
+       if (icoW <= 0) icoW = DEFAULT_ICO_WIDTH;
+       if (icoH <= 0) icoH = DEFAULT_ICO_HEIGHT;
+       if (icoW < MIN_ICO_WIDTH) icoW = MIN_ICO_WIDTH;
+       if (icoH < MIN_ICO_HEIGHT) icoH = MIN_ICO_HEIGHT;
+
+       if (delta_geom) {
+           unsigned int junk;
+
+           XParseGeometry (delta_geom, &icoDeltaX, &icoDeltaY, &junk, &junk);
+           if (icoDeltaX == 0 && icoDeltaY == 0) {
+               icoDeltaX = DEFAULT_DELTAX;
+               icoDeltaY = DEFAULT_DELTAY;
+           }
+       }
+
+       closure->win = None;
+
+#ifdef MULTIBUFFER
+       if (multibufext && dblbuf) {
+           if (XmbufCreateBuffers (dpy, closure->draw_window, 2, update_action,
+                                   MultibufferUpdateHintFrequent,
+                                   closure->multibuffers) == 2) {
+               XCopyArea (dpy, closure->draw_window, closure->multibuffers[1],
+                          DefaultGC(dpy, DefaultScreen(dpy)),
+                          0, 0, closure->winW, closure->winH, 0, 0);
+               closure->win = closure->multibuffers[1];
+           } else 
+             icoFatal ("unable to obtain 2 buffers", NULL);
+       }
+#endif /* MULTIBUFFER */
+       if (closure->win == None) closure->win = closure->draw_window;
+
+       /* Set up a graphics context */
+
+       vmask = (GCBackground | GCForeground | GCLineWidth);
+       xgcv.background = bg;
+       xgcv.foreground = fg;
+       xgcv.line_width = linewidth;
+       if (dash) {
+           xgcv.line_style = LineDoubleDash;
+           xgcv.dashes = dash;
+           vmask |= (GCLineStyle | GCDashList);
+       }
+       closure->gcontext = XCreateGC (dpy, closure->draw_window, vmask, &xgcv);
+
+       if (dofaces && numcolors>1) {
+           int i,t,bits;
+               bits = 0;
+               for (t=numcolors; t; t=t>>1) bits++;
+               initDBufs(closure, fg,bg,bits);
+               /* don't set the background color */
+               for (i=0; i<numcolors; i++) {
+                       setBufColname(closure, i+1,colornames[i]);
+               }
+               initcolors = 1;
+       }
+       else if (dblbuf || dofaces) {
+               initDBufs(closure, fg,bg,1);
+               initcolors = 1;
+       }
+       if (initcolors) {
+           setDisplayBuf(closure, dblbuf?1:0, 1); /* insert new colors */
+       }
+
+       if (dsync)
+               XSync(dpy, 0);
+
+       /* Get the initial position, size, and speed of the bounding-box */
+
+       srand((int) time((time_t *)0) % 231);
+       icoX = ((closure->winW - icoW) * (rand() & 0xFF)) >> 8;
+       icoY = ((closure->winH - icoH) * (rand() & 0xFF)) >> 8;
+
+
+       /* Bounce the box in the window */
+
+       icodeltax2 = icoDeltaX * 2;
+       icodeltay2 = icoDeltaY * 2;
+       initPoly(closure, poly, icoW, icoH);
+
+       while (do_it) {
+               int prevX;
+               int prevY;
+               Bool do_event;
+
+               /*
+                * This is not a good example of how to do event reading
+                * in multi-threaded programs.  More commonly there would
+                * be one thread reading all events and dispatching them
+                * to the appropriate thread.  However, the threaded version
+                * of ico was developed to test the MT Xlib implementation,
+                * so it is useful to have it behave a little oddly.
+                * For a discussion of how to write multi-threaded X programs,
+                * see Gildea, S., "Multi-Threaded Xlib", The X Resource,
+                * Issue 5, January 1993, pp. 159-166.
+                */
+               if (blocking) {
+                   XIfEvent(dpy, &xev, predicate, (XPointer) closure->win);
+                   do_event = True;
+               } else
+                   do_event = XCheckIfEvent(dpy, &xev, predicate,
+                           (XPointer) closure->win);
+               if (do_event) {
+                   switch (xev.type) {
+                     case ConfigureNotify:
+#ifdef DEBUG
+                       printf("thread %x configure\n", xthread_self());
+#endif
+                       if (xev.xconfigure.width != closure->winW ||
+                           xev.xconfigure.height != closure->winH)
+                         icoX = icoY = 1;
+                       closure->winW = xev.xconfigure.width;
+                       closure->winH = xev.xconfigure.height;
+                       break;
+                     case KeyPress:
+#ifdef DEBUG
+                       printf("thread %x keypress\n", xthread_self());
+#endif
+                       XLookupString(&xev.xkey, buf, 10, &ksym, NULL);
+                       do_it = ((ksym != XK_Q) && ksym != XK_q);
+                       break;
+                     case MapNotify:
+                       blocking = False;
+#ifdef DEBUG
+                       printf("thread %x unblocking\n", xthread_self());
+#endif
+                       break;
+                     case UnmapNotify:
+                       blocking = True;
+#ifdef DEBUG
+                       printf("thread %x blocking\n", xthread_self());
+#endif
+                       break;
+                     case ClientMessage:
+#ifdef DEBUG
+                       printf("thread %x message\n", xthread_self());
+#endif
+                       if (xev.xclient.data.l[0] == wm_delete_window)
+                           do_it = False;
+                       else
+                           XBell (dpy, 0);
+                       continue;
+                   }
+               }
+
+               prevX = icoX;
+               prevY = icoY;
+
+               icoX += icoDeltaX;
+               if (icoX < 0 || icoX + icoW > closure->winW) {
+                       icoX -= icodeltax2;
+                       icoDeltaX = - icoDeltaX;
+                       icodeltax2 = icoDeltaX * 2;
+               }
+               icoY += icoDeltaY;
+               if (icoY < 0 || icoY + icoH > closure->winH) {
+                       icoY -= icodeltay2;
+                       icoDeltaY = - icoDeltaY;
+                       icodeltay2 = icoDeltaY * 2;
+               }
+
+               drawPoly(closure, poly, closure->gcontext,
+                        icoX, icoY, icoW, icoH, prevX, prevY);
+       }
+       XDestroyWindow(dpy, closure->win);
+#ifdef MULTITHREAD
+       xmutex_lock(&count_mutex);
+       thread_count--;
+       if (thread_count == 0) {
+           xcondition_broadcast(&count_cond);
+       }
+       xmutex_unlock(&count_mutex);
+#endif
+       return NULL;
+}
+
+/******************************************************************************
+ * Description
+ *     Main routine.  Process command-line arguments, then bounce a bounding
+ *     box inside the window.  Call DrawIco() to redraw the icosahedron.
+ *****************************************************************************/
+
+static void
+giveObjHelp(void)
+{
+       int i;
+       Polyinfo *poly;
+
+       printf("%-16s%-12s  #Vert.  #Edges  #Faces  %-16s\n",
+               "Name", "ShortName", "Dual");
+       for (i=0; i<NumberPolygons; i++) {
+               poly = polygons+i;
+               printf("%-16s%-12s%6d%8d%8d    %-16s\n",
+                       poly->longname, poly->shortname,
+                       poly->numverts, poly->numedges, poly->numfaces,
+                       poly->dual);
+       }
+}
+
+static Polyinfo *
+findpoly(const char *name)
+{
+       int i;
+        Polyinfo *poly;
+
+       for (i=0; i<NumberPolygons; i++) {
+               poly = polygons+i;
+               if (strcmp(name,poly->longname)==0 || strcmp(name,poly->shortname)==0)
+                       return poly;
+       }
+       icoFatal("can't find object %s", name);
+}
+
+int main(argc, argv)
+    int argc;
+    char **argv;
+{
+       const char *display = NULL;
+#ifdef MULTIBUFFER
+       int mbevbase, mberrbase;
+#endif
+#ifdef MULTITHREAD
+       int nthreads = 1;       /* -threads: number of windows */
+       int i;
+#endif
+       struct closure *closure;
+
+       ProgramName = argv[0];
+
+       /* Process arguments: */
+
+       poly = findpoly("icosahedron"); /* default */
+
+       for (argv++, argc--; argc > 0; argv++, argc--) {
+               if (!strcmp (*argv, "-display")) {
+                       if (argc < 2)
+                               icoFatal("missing argument for %s", *argv);
+                       display = *++argv; argc--;
+               } else if (!strncmp (*argv, "-g", 2)) {
+                       if (argc < 2)
+                               icoFatal("missing argument for %s", *argv);
+                       geom = *++argv; argc--;
+               } else if (!strcmp(*argv, "-r"))
+                       useRoot = 1;
+               else if (!strcmp (*argv, "-d")) {
+                       if (argc < 2)
+                               icoFatal("missing argument for %s", *argv);
+                       dash = atoi(*++argv); argc--;
+               }
+#ifdef MULTITHREAD
+               else if (!strcmp(*argv, "-threads")) {
+                       if (argc < 2)
+                               icoFatal("missing argument for %s", *argv);
+                       nthreads = atoi(*++argv); argc--;
+               }
+#endif
+               else if (!strcmp(*argv, "-colors")) {
+                       if (argc < 2)
+                               icoFatal("missing argument for %s", *argv);
+                       colornames = ++argv; argc--; numcolors = 0;
+                       for ( ; argc > 0 && argv[0][0]!='-'; argv++, argc--, numcolors++) ;
+                       argv--; argc++;
+               }
+               else if (!strcmp (*argv, "-copy")) {
+#ifdef MULTIBUFFER
+                       update_action = MultibufferUpdateActionCopied;
+#endif
+               }
+               else if (!strcmp (*argv, "-untouched")) {
+#ifdef MULTIBUFFER
+                       update_action = MultibufferUpdateActionUntouched;
+#endif
+               }
+               else if (!strcmp (*argv, "-undefined")) {
+#ifdef MULTIBUFFER
+                       update_action = MultibufferUpdateActionUndefined;
+#endif
+               } else if (!strcmp (*argv, "-lw")) {
+                       if (argc < 2)
+                               icoFatal("missing argument for %s", *argv);
+                       linewidth = atoi(*++argv); argc--;
+               } else if (!strcmp (*argv, "-dbl")) {
+                       dblbuf = 1;
+#ifdef MULTIBUFFER
+                       multibufext = 1;
+#endif
+               }
+               else if (!strcmp(*argv, "-softdbl")) {
+                       dblbuf = 1;
+                       multibufext = 0;
+               }
+               else if (!strncmp(*argv, "-p", 2)) {
+                       numcolors = atoi(argv[0]+2);
+                       if (numcolors < 1 || numcolors > NumberPrimaries)
+                               numcolors = NumberPrimaries;
+                       colornames = Primaries;
+                       dofaces = 1;
+               }
+               else if (!strcmp(*argv, "-bg")) {
+                       if (argc < 2)
+                               icoFatal("missing argument for %s", *argv);
+                       background_colorname = *++argv; argc--;
+               } else if (!strcmp(*argv, "-noedges"))
+                       doedges = 0;
+               else if (!strcmp(*argv, "-faces"))
+                       dofaces = 1;
+               else if (!strcmp(*argv, "-i"))
+                       invert = 1;
+               else if (!strcmp(*argv, "-size")) {
+                       if (argc < 2)
+                               icoFatal("missing argument for %s", *argv);
+                       ico_geom = *++argv; argc--;
+               } else if (!strcmp(*argv, "-delta")) {
+                       if (argc < 2)
+                               icoFatal("missing argument for %s", *argv);
+                       delta_geom = *++argv; argc--;
+               } else if (!strcmp (*argv, "-sleep")) {
+                       float f;
+                       if (argc < 2)
+                               icoFatal("missing argument for %s", *argv);
+                       if (sscanf (*++argv, "%f", &f) < 1)
+                               icoFatal("invalid argument for %s", argv[-1]);
+                       msleepcount = (int) (f * 1000.0);
+                       argc--;
+               } else if (!strcmp (*argv, "-obj")) {
+                       if (argc < 2)
+                               icoFatal("missing argument for %s", *argv);
+                       poly = findpoly(*++argv); argc--;
+               } else if (!strcmp(*argv, "-dsync"))
+                       dsync = 1;
+               else if (!strncmp(*argv, "-sync",  5)) 
+                       xsync = 1;
+               else if (!strcmp(*argv, "-objhelp")) {
+                       giveObjHelp();
+                       exit(1);
+               }
+               else {  /* unknown arg */
+                       const char **cpp;
+
+                       fprintf (stderr, "usage:  %s [options]\n\n",
+                                ProgramName);
+                       for (cpp = help_message; *cpp; cpp++)
+                               fprintf (stderr, "%s\n", *cpp);
+                       exit (1);
+               }
+       }
+
+       if (!dofaces && !doedges)
+               icoFatal("nothing to draw", NULL);
+
+#ifdef MULTITHREAD
+       XInitThreads();
+#endif
+       if (!(dpy = XOpenDisplay(display)))
+           icoFatal("cannot open display \"%s\"", XDisplayName(display));
+       wm_delete_window = XInternAtom (dpy, "WM_DELETE_WINDOW", False);
+       if (xsync)
+           XSynchronize(dpy, True);
+
+#ifdef MULTIBUFFER
+       if (multibufext && !XmbufQueryExtension (dpy, &mbevbase, &mberrbase)) {
+           multibufext = 0;
+       }
+#endif
+
+#ifdef MULTITHREAD
+#ifndef XMUTEX_INITIALIZER
+       xmutex_init(&count_mutex);
+#endif
+       xcondition_init(&count_cond);
+
+       /* start all threads here */
+       thread_count = nthreads;
+       for (i=1; i <= nthreads; i++) {
+           closure = (struct closure *) xalloc(sizeof(struct closure));
+           closure->thread_num = i;
+           xthread_fork(do_ico_window, closure);
+       }
+       /* wait until all theads terminate */
+       xmutex_lock(&count_mutex);
+       xcondition_wait(&count_cond, &count_mutex);
+       xmutex_unlock(&count_mutex);
+#else
+       /* start the animation */
+       closure = (struct closure *) xalloc(sizeof(struct closure));
+       do_ico_window(closure);
+#endif
+       XCloseDisplay(dpy);
+       return 0;
+}
diff --git a/ico/ico.man b/ico/ico.man
new file mode 100644 (file)
index 0000000..07fb576
--- /dev/null
@@ -0,0 +1,92 @@
+.\" $XConsortium: ico.man,v 1.14 94/04/17 20:45:16 gildea Exp $
+.\" $XFree86: xc/programs/ico/ico.man,v 1.4 2003/03/19 01:49:28 dawes Exp $
+.TH ICO 1 __xorgversion__
+.SH NAME
+ico \- animate an icosahedron or other polyhedron
+.SH SYNOPSIS
+.B ico
+[-display display] [-geometry geometry]
+[-r] [-d pattern] [-i] [-dbl] [-faces] [-noedges]
+[-sleep n] [-obj object] [-objhelp] [-colors color-list]
+.SH DESCRIPTION
+.I Ico
+displays a wire-frame rotating polyhedron, with hidden lines removed,
+or a solid-fill polyhedron with hidden faces removed.
+There are a number of different polyhedra available;
+adding a new polyhedron to the program is quite simple.
+.SH OPTIONS
+.TP
+.B -r
+Display on the root window instead of creating a new window.
+.TP
+.B -d pattern
+Specify a bit pattern for drawing dashed lines for wire frames.
+.TP
+.B -i
+Use inverted colors for wire frames.
+.TP
+.B -dbl
+Use double buffering on the display.
+This works for either wire frame or solid fill drawings.
+For solid fill drawings, using this switch results in substantially
+smoother movement.
+Note that this requires twice as many bit planes as without double buffering.
+Since some colors are typically allocated by other programs,
+most eight-bit-plane displays will probably be limited to eight colors
+when using double buffering.
+.TP
+.B -faces
+Draw filled faces instead of wire frames.
+.TP
+.B -noedges
+Don't draw the wire frames.
+Typically used only when -faces is used.
+.TP
+.B -sleep \fIn\fP
+Sleep n seconds between each move of the object.
+.TP
+.B -obj \fIobject\fP
+Specify what object to draw.
+If no object is specified, an icosahedron is drawn.
+.TP
+.B -objhelp
+Print out a list of the available objects, along with information
+about each object.
+.TP
+.B -colors \fIcolor color ...\fP
+Specify what colors should be used to draw the filled faces of the object.
+If less colors than faces are given, the colors are reused.
+.SH PROGRAM TERMINATION
+.LP
+Pressing "q" will close a window. If compiled with threads support, the
+program will stop only when all threads terminate. You can also close an
+animation window using the ICCCM \fIdelete\fP message (depending on your
+window manager, you will have a decoration button or menu to send such
+message).
+.SH ADDING POLYHEDRA
+.LP
+If you have the source to ico, it is very easy to add more polyhedra.
+Each polyhedron is defined in an include file by the name of objXXX.h,
+where XXX is something related to the name of the polyhedron.
+The format of the include file is defined in the file polyinfo.h.
+Look at the file objcube.h to see what the exact format of an objXXX.h
+file should be, then create your objXXX.h file in that format.
+.LP
+After making the new objXXX.h file (or copying in a new one from elsewhere),
+simply do a 'make depend'.
+This will recreate the file allobjs.h, which lists all of the objXXX.h
+files.
+Doing a 'make' after this will rebuild ico with the new object information.
+.SH "SEE ALSO"
+X(__miscmansuffix__)
+.SH BUGS
+.LP
+Pyramids and tetrahedrons with filled faces do not display correctly.
+.LP
+A separate color cell is allocated for each name in the -colors list, even
+when the same name may be specified twice.  Color allocation fails in
+TrueColor displays and option \fI-faces\fP does not work well.
+.SH COPYRIGHT
+Copyright 1994 X Consortium
+.br
+See \fIX(__miscmansuffix__)\fP for a full statement of rights and permissions.
diff --git a/ico/install-sh b/ico/install-sh
new file mode 100755 (executable)
index 0000000..4fbbae7
--- /dev/null
@@ -0,0 +1,507 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2006-10-14.15
+
+# 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.
+
+nl='
+'
+IFS=" ""       $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+posix_glob=
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chmodcmd=$chmodprog
+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 $# -ne 0; 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) mode=$2
+        shift
+        shift
+       case $mode in
+         *' '* | *'    '* | *'
+'*       | *'*'* | *'?'* | *'['*)
+           echo "$0: invalid mode: $mode" >&2
+           exit 1;;
+       esac
+        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 $?;;
+
+    --)        shift
+       break;;
+
+    -*)        echo "$0: invalid option: $1" >&2
+       exit 1;;
+
+    *)  break;;
+  esac
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dstarg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dstarg"
+      shift # fnord
+    fi
+    shift # arg
+    dstarg=$arg
+  done
+fi
+
+if test $# -eq 0; 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
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src ;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    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
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+       (dirname "$dst") 2>/dev/null ||
+       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+            X"$dst" : 'X\(//\)[^/]' \| \
+            X"$dst" : 'X\(//\)$' \| \
+            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+       echo X"$dst" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+       # Create intermediate dirs using mode 755 as modified by the umask.
+       # This is like FreeBSD 'install' as of 1997-10-28.
+       umask=`umask`
+       case $stripcmd.$umask in
+         # Optimize common cases.
+         *[2367][2367]) mkdir_umask=$umask;;
+         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+         *[0-7])
+           mkdir_umask=`expr $umask + 22 \
+             - $umask % 100 % 40 + $umask % 20 \
+             - $umask % 10 % 4 + $umask % 2
+           `;;
+         *) mkdir_umask=$umask,go-w;;
+       esac
+
+       # With -d, create the new directory with the user-specified mode.
+       # Otherwise, rely on $mkdir_umask.
+       if test -n "$dir_arg"; then
+         mkdir_mode=-m$mode
+       else
+         mkdir_mode=
+       fi
+
+       posix_mkdir=false
+       case $umask in
+         *[123567][0-7][0-7])
+           # POSIX mkdir -p sets u+wx bits regardless of umask, which
+           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+           ;;
+         *)
+           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+           if (umask $mkdir_umask &&
+               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+           then
+             if test -z "$dir_arg" || {
+                  # Check for POSIX incompatibilities with -m.
+                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                  # other-writeable bit of parent directory when it shouldn't.
+                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                  case $ls_ld_tmpdir in
+                    d????-?r-*) different_mode=700;;
+                    d????-?--*) different_mode=755;;
+                    *) false;;
+                  esac &&
+                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                  }
+                }
+             then posix_mkdir=:
+             fi
+             rmdir "$tmpdir/d" "$tmpdir"
+           else
+             # Remove any dirs left behind by ancient mkdir implementations.
+             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+           fi
+           trap '' 0;;
+       esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+       umask $mkdir_umask &&
+       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+       /*) prefix=/ ;;
+       -*) prefix=./ ;;
+       *)  prefix= ;;
+      esac
+
+      case $posix_glob in
+        '')
+         if (set -f) 2>/dev/null; then
+           posix_glob=true
+         else
+           posix_glob=false
+         fi ;;
+      esac
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob && set -f
+      set fnord $dstdir
+      shift
+      $posix_glob && set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+       test -z "$d" && continue
+
+       prefix=$prefix$d
+       if test -d "$prefix"; then
+         prefixes=
+       else
+         if $posix_mkdir; then
+           (umask=$mkdir_umask &&
+            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+           # Don't fail if two instances are running concurrently.
+           test -d "$prefix" || exit 1
+         else
+           case $prefix in
+             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+             *) qprefix=$prefix;;
+           esac
+           prefixes="$prefixes '$qprefix'"
+         fi
+       fi
+       prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+       # Don't fail if two instances are running concurrently.
+       (umask $mkdir_umask &&
+        eval "\$doit_exec \$mkdirprog $prefixes") ||
+         test -d "$dstdir" || exit 1
+       obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # 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
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } &&
+
+    # Now rename the file to the real destination.
+    { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
+      || {
+          # The rename failed, perhaps because mv can't rename something else
+          # to itself, or perhaps because mv is so ancient that it does not
+          # support -f.
+
+          # Now remove or move aside any old file at destination location.
+          # We try this two ways since rm can't unlink itself on some
+          # systems and the destination file might be busy for other
+          # reasons.  In this case, the final cleanup might fail but the new
+          # file should still install successfully.
+          {
+            if test -f "$dst"; then
+              $doit $rmcmd -f "$dst" 2>/dev/null \
+              || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
+                    && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
+              || {
+                echo "$0: cannot unlink or rename $dst" >&2
+                (exit 1); exit 1
+              }
+            else
+              :
+            fi
+          } &&
+
+          # Now rename the file to the real destination.
+          $doit $mvcmd "$dsttmp" "$dst"
+        }
+    } || exit 1
+
+    trap '' 0
+  fi
+done
+
+# 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/ico/missing b/ico/missing
new file mode 100755 (executable)
index 0000000..1c8ff70
--- /dev/null
@@ -0,0 +1,367 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2006-05-10.23
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
+#   Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try \`$0 --help' for more information"
+  exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+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'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Now exit if we have it, but it failed.  Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case $1 in
+  lex|yacc)
+    # Not GNU programs, they don't have --version.
+    ;;
+
+  tar)
+    if test -n "$run"; then
+       echo 1>&2 "ERROR: \`tar' requires --run"
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       exit 1
+    fi
+    ;;
+
+  *)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       # Could not run --version or --help.  This is probably someone
+       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # $TOOL exists and not knowing $TOOL uses missing.
+       exit 1
+    fi
+    ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $1 in
+  aclocal*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
+         to install the \`Automake' and \`Perl' packages.  Grab them from
+         any GNU archive site."
+    touch aclocal.m4
+    ;;
+
+  autoconf)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`${configure_ac}'.  You might want to install the
+         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+         archive site."
+    touch configure
+    ;;
+
+  autoheader)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site."
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z "$files" && files="config.h"
+    touch_files=
+    for f in $files; do
+      case $f in
+      *:*) touch_files="$touch_files "`echo "$f" |
+                                      sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files="$touch_files $f.in";;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site."
+    find . -type f -name Makefile.am -print |
+          sed 's/\.am$/.in/' |
+          while read f; do touch "$f"; done
+    ;;
+
+  autom4te)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1' as part of \`Autoconf' from any GNU
+         archive site."
+
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if test ! -f y.tab.h; then
+       echo >y.tab.h
+    fi
+    if test ! -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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if test ! -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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+       /^@setfilename/{
+         s/.* \([^ ]*\) *$/\1/
+         p
+         q
+       }' $infile`
+      # ... 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/ico/objcube.h b/ico/objcube.h
new file mode 100644 (file)
index 0000000..441145e
--- /dev/null
@@ -0,0 +1,29 @@
+/* objcube.h - structure values for cube */
+
+{      "cube", "cube", /* long and short names */
+       "octahedron",   /* long name of dual */
+       8, 12, 6,       /* number of vertices, edges, and faces */
+       {               /* vertices (x,y,z) */
+                       /* all points must be within radius 1 of the origin */
+#define T 0.577
+               {  T,  T,  T },
+               {  T,  T, -T },
+               {  T, -T, -T },
+               {  T, -T,  T },
+               { -T,  T,  T },
+               { -T,  T, -T },
+               { -T, -T, -T },
+               { -T, -T,  T },
+#undef T
+       },
+       {       /* faces (numfaces + indexes into vertices) */
+               /*  faces must be specified clockwise from the outside */
+               4,      0, 1, 2, 3,
+               4,      7, 6, 5, 4,
+               4,      1, 0, 4, 5,
+               4,      3, 2, 6, 7,
+               4,      2, 1, 5, 6,
+               4,      0, 3, 7, 4,
+       }
+},             /* leave a comma to separate from the next include file */
+/* end */
diff --git a/ico/objico.h b/ico/objico.h
new file mode 100644 (file)
index 0000000..7ca56ae
--- /dev/null
@@ -0,0 +1,45 @@
+/* objico.h - structure values for icosahedron */
+
+{      "icosahedron", "ico",   /* long and short names */
+       "dodecahedron",         /* long name of dual */
+       12, 30, 20,     /* number of vertices, edges, and faces */
+       {               /* vertices (x,y,z) */
+                       /* all points must be within radius 1 of the origin */
+               { 0.00000000,  0.00000000, -0.95105650},
+               { 0.00000000,  0.85065080, -0.42532537},
+               { 0.80901698,  0.26286556, -0.42532537},
+               { 0.50000000, -0.68819095, -0.42532537},
+               {-0.50000000, -0.68819095, -0.42532537},
+               {-0.80901698,  0.26286556, -0.42532537},
+               { 0.50000000,  0.68819095,  0.42532537},
+               { 0.80901698, -0.26286556,  0.42532537},
+               { 0.00000000, -0.85065080,  0.42532537},
+               {-0.80901698, -0.26286556,  0.42532537},
+               {-0.50000000,  0.68819095,  0.42532537},
+               { 0.00000000,  0.00000000,  0.95105650}
+       },
+       {       /* faces (numfaces + indexes into vertices) */
+               /*  faces must be specified clockwise from the outside */
+                3,     0,  2,  1,
+                3,     0,  3,  2,
+                3,     0,  4,  3,
+                3,     0,  5,  4,
+                3,     0,  1,  5,
+                3,     1,  6, 10,
+                3,     1,  2,  6,
+                3,     2,  7,  6,
+                3,     2,  3,  7,
+                3,     3,  8,  7,
+                3,     3,  4,  8,
+                3,     4,  9,  8,
+                3,     4,  5,  9,
+                3,     5, 10,  9,
+                3,     5,  1, 10,
+                3,     10,  6, 11,
+                3,     6,  7, 11,
+                3,     7,  8, 11,
+                3,     8,  9, 11,
+                3,     9, 10, 11
+       }
+},             /* leave a comma to separate from the next include file */
+/* end */
diff --git a/ico/objocta.h b/ico/objocta.h
new file mode 100644 (file)
index 0000000..80521d3
--- /dev/null
@@ -0,0 +1,29 @@
+/* objocta.h - structure values for octahedron */
+
+{      "octahedron", "octa",   /* long and short names */
+       "cube",         /* long name of dual */
+       6, 12, 8,       /* number of vertices, edges, and faces */
+       {               /* vertices (x,y,z) */
+                       /* all points must be within radius 1 of the origin */
+#define T 1.0
+               {  T,  0,  0 },
+               { -T,  0,  0 },
+               {  0,  T,  0 },
+               {  0, -T,  0 },
+               {  0,  0,  T },
+               {  0,  0, -T },
+#undef T
+       },
+       {       /* faces (numfaces + indexes into vertices) */
+               /*  faces must be specified clockwise from the outside */
+               3,      0, 4, 2,
+               3,      0, 2, 5,
+               3,      0, 5, 3,
+               3,      0, 3, 4,
+               3,      1, 2, 4,
+               3,      1, 5, 2,
+               3,      1, 3, 5,
+               3,      1, 4, 3,
+       }
+},             /* leave a comma to separate from the next include file */
+/* end */
diff --git a/ico/objplane.h b/ico/objplane.h
new file mode 100644 (file)
index 0000000..ce5b4e0
--- /dev/null
@@ -0,0 +1,20 @@
+/* objplane.h - structure values for plane */
+
+{       "plane", "plane",       /* long and short names */
+        "cube",         /* long name of dual */
+        4, 4, 1,        /* number of vertices, edges, and faces */
+        {               /* vertices (x,y,z) */
+                        /* all points must be within radius 1 of the origin */
+#define T 1.0
+                {  T,  0,  0 },
+                { -T,  0,  0 },
+                {  0,  T,  0 },
+                {  0, -T,  0 },
+#undef T
+        },
+        {       /* faces (numfaces + indexes into vertices) */
+                /*  faces must be specified clockwise from the outside */
+                4,      0, 2, 1, 3,
+        }
+},              /* leave a comma to separate from the next include file */
+/* end */
diff --git a/ico/objpyr.h b/ico/objpyr.h
new file mode 100644 (file)
index 0000000..5ea163e
--- /dev/null
@@ -0,0 +1,30 @@
+/* objpyr.h - structure values for pyramid */
+
+{       "pyramid", "pyramid",   /* long and short names */
+        "cube",         /* long name of dual */
+        5, 8, 5,        /* number of vertices, edges, and faces */
+        {               /* vertices (x,y,z) */
+                        /* all points must be within radius 1 of the origin */
+#define T 1.0
+                {  T,  0,  0 },
+                { -T,  0,  0 },
+                {  0,  T,  0 },
+                {  0, -T,  0 },
+                {  0,  0,  T },
+                /* {  0,  0, -T }, */
+#undef T
+        },
+        {       /* faces (numfaces + indexes into vertices) */
+                /*  faces must be specified clockwise from the outside */
+                3,      0, 4, 2,
+                /* 3,   0, 2, 5, */
+                /* 3,   0, 5, 3, */
+                3,      0, 3, 4,
+                3,      1, 2, 4,
+                /* 3,   1, 5, 2, */
+                /* 3,   1, 3, 5, */
+                3,      1, 4, 3,
+                4,      0, 2, 1, 3,
+        }
+},              /* leave a comma to separate from the next include file */
+/* end */
diff --git a/ico/polyinfo.h b/ico/polyinfo.h
new file mode 100644 (file)
index 0000000..e405623
--- /dev/null
@@ -0,0 +1,31 @@
+/* polyinfo.h
+ * This is the description of one polyhedron file
+ */
+/* $XFree86$ */
+
+#define MAXVERTS 120
+       /* great rhombicosidodecahedron has 120 vertices */
+#define MAXNV MAXVERTS
+#define MAXFACES 30
+       /* (hexakis icosahedron has 120 faces) */
+#define MAXEDGES 180
+       /* great rhombicosidodecahedron has 180 edges */
+#define MAXEDGESPERPOLY 20
+
+typedef struct {
+       double x, y, z;
+} Point3D;
+
+/* structure of the include files which define the polyhedra */
+typedef struct {
+       const char *longname;   /* long name of object */
+       const char *shortname;  /* short name of object */
+       const char *dual;       /* long name of dual */
+       int numverts;           /* number of vertices */
+       int numedges;           /* number of edges */
+       int numfaces;           /* number of faces */
+       Point3D v[MAXVERTS];    /* the vertices */
+       int f[MAXEDGES*2+MAXFACES];     /* the faces */
+} Polyinfo;
+
+/* end */
diff --git a/oclock/AUTHORS b/oclock/AUTHORS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/oclock/COPYING b/oclock/COPYING
new file mode 100644 (file)
index 0000000..7f33cbf
--- /dev/null
@@ -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/oclock/ChangeLog b/oclock/ChangeLog
new file mode 100644 (file)
index 0000000..f782e91
--- /dev/null
@@ -0,0 +1,31 @@
+2005-12-20  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * configure.ac:
+       Update package version for X11R7 release.
+
+2005-12-14  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * configure.ac:
+       Update package version number for final X11R7 release candidate.
+
+2005-12-07  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * Makefile.am:
+       * configure.ac:
+       Change to use the app-defaults default dir configured in libXt.
+
+2005-12-06  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * Makefile.am:
+       Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+2005-12-03  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * configure.ac:
+       Update package version number for X11R7 RC3 release.
+
+2005-10-18  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * configure.ac:
+       Update package version number for RC1 release.
+
diff --git a/oclock/Clock-color.ad b/oclock/Clock-color.ad
new file mode 100644 (file)
index 0000000..00e87f4
--- /dev/null
@@ -0,0 +1,6 @@
+! $Xorg: Clock-col.ad,v 1.3 2000/08/17 19:53:59 cpqbld Exp $
+Clock*Background:      grey
+Clock*BorderColor:     light blue
+Clock*hour:            yellow
+Clock*jewel:           yellow
+Clock*minute:  yellow
diff --git a/oclock/Clock.c b/oclock/Clock.c
new file mode 100644 (file)
index 0000000..66fea36
--- /dev/null
@@ -0,0 +1,596 @@
+/*
+ * $Xorg: Clock.c,v 1.4 2001/02/09 02:05:33 xorgcvs 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.
+ */
+/* $XFree86: xc/programs/oclock/Clock.c,v 1.6 2001/07/25 15:05:15 dawes Exp $ */
+
+/*
+ * Clock.c
+ *
+ * a NeWS clone clock
+ */
+
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <X11/Xmu/Converters.h>
+#include "ClockP.h"
+#include <X11/Xos.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <X11/extensions/shape.h>
+
+#include <time.h>
+#define Time_t time_t
+
+#define offset(field) XtOffsetOf(ClockRec, clock.field)
+#define goffset(field) XtOffsetOf(WidgetRec, core.field)
+
+static XtResource resources[] = {
+    {XtNwidth, XtCWidth, XtRDimension, sizeof(Dimension),
+        goffset(width), XtRImmediate, (XtPointer) 120},
+    {XtNheight, XtCHeight, XtRDimension, sizeof(Dimension),
+       goffset(height), XtRImmediate, (XtPointer) 120},
+    {XtNminute, XtCForeground, XtRPixel, sizeof (Pixel),
+       offset(minute), XtRString, XtDefaultForeground},
+    {XtNhour, XtCForeground, XtRPixel, sizeof (Pixel),
+       offset(hour), XtRString, XtDefaultForeground},
+    {XtNjewel, XtCForeground, XtRPixel, sizeof (Pixel),
+       offset(jewel), XtRString, XtDefaultForeground},
+    {XtNbackingStore, XtCBackingStore, XtRBackingStore, sizeof (int),
+       offset (backing_store), XtRString, "default"},
+    {XtNborderSize, XtCBorderSize, XtRFloat, sizeof (float),
+       offset (border_size), XtRString, "0.1"},
+    {XtNjewelSize, XtCBorderSize, XtRFloat, sizeof (float),
+       offset (jewel_size), XtRString, "0.075"},
+    {XtNshapeWindow, XtCShapeWindow, XtRBoolean, sizeof (Boolean),
+       offset (shape_window), XtRImmediate, (XtPointer) True},
+    {XtNtransparent, XtCTransparent, XtRBoolean, sizeof (Boolean),
+       offset (transparent), XtRImmediate, (XtPointer) False},
+};
+
+#undef offset
+#undef goffset
+
+static void ClassInitialize ( void );
+static void Initialize ( Widget greq, Widget gnew, ArgList args, 
+                        Cardinal *num_args );
+static void Resize ( Widget widget );
+static void Realize ( Widget gw, XtValueMask *valueMask, 
+                     XSetWindowAttributes *attrs );
+static void Destroy ( Widget gw );
+static void Redisplay ( Widget gw, XEvent *event, Region region );
+static double clock_to_angle ( double clock );
+static void new_time ( XtPointer client_data, XtIntervalId *id );
+
+# define BORDER_SIZE(w)    ((w)->clock.border_size)
+# define WINDOW_WIDTH(w)    (2.0 - BORDER_SIZE(w)*2)
+# define WINDOW_HEIGHT(w)   (2.0 - BORDER_SIZE(w)*2)
+# define MINUTE_WIDTH(w)    (0.05)
+# define HOUR_WIDTH(w)     (0.05)
+# define JEWEL_SIZE(w)     ((w)->clock.jewel_size)
+# define MINUTE_LENGTH(w)   (JEWEL_Y(w) - JEWEL_SIZE(w) / 2.0)
+# define HOUR_LENGTH(w)            (MINUTE_LENGTH(w) * 0.6)
+# define JEWEL_X(w)        (0.0)
+# define JEWEL_Y(w)        (1.0 - (BORDER_SIZE(w) + JEWEL_SIZE(w)))
+
+ClockClassRec clockClassRec = {
+    { /* core fields */
+    /* superclass              */      &widgetClassRec,
+    /* class_name              */      "Clock",
+    /* size                    */      sizeof(ClockRec),
+    /* class_initialize                */      ClassInitialize,
+    /* class_part_initialize   */      NULL,
+    /* class_inited            */      FALSE,
+    /* initialize              */      Initialize,
+    /* initialize_hook         */      NULL,
+    /* realize                 */      Realize,
+    /* actions                 */      NULL,
+    /* num_actions             */      0,
+    /* resources               */      resources,
+    /* num_resources           */      XtNumber(resources),
+    /* xrm_class               */      NULLQUARK,
+    /* compress_motion         */      TRUE,
+    /* compress_exposure       */      TRUE,
+    /* compress_enterleave     */      TRUE,
+    /* visible_interest                */      FALSE,
+    /* destroy                 */      Destroy,
+    /* resize                  */      Resize,
+    /* expose                  */      Redisplay,
+    /* set_values              */      NULL,
+    /* set_values_hook         */      NULL,
+    /* set_values_almost       */      NULL,
+    /* get_values_hook         */      NULL,
+    /* accept_focus            */      NULL,
+    /* version                 */      XtVersion,
+    /* callback_private                */      NULL,
+    /* tm_table                        */      NULL,
+    /* query_geometry          */      XtInheritQueryGeometry,
+    }
+};
+
+static void ClassInitialize()
+{
+    XtAddConverter( XtRString, XtRBackingStore, XmuCvtStringToBackingStore,
+                   NULL, 0 );
+}
+
+WidgetClass clockWidgetClass = (WidgetClass) &clockClassRec;
+
+/* ARGSUSED */
+static void Initialize (greq, gnew, args, num_args)
+    Widget greq, gnew;
+    ArgList args;
+    Cardinal *num_args;
+{
+    ClockWidget w = (ClockWidget)gnew;
+    XtGCMask   valuemask;
+    XGCValues  myXGCV;
+    int shape_event_base, shape_error_base;
+
+    valuemask = GCForeground;
+
+    if (w->clock.transparent)
+    {
+       ;
+    }
+    else
+    {
+       myXGCV.foreground = w->clock.minute;
+       w->clock.minuteGC = XtGetGC(gnew, valuemask, &myXGCV);
+
+       myXGCV.foreground = w->clock.hour;
+       w->clock.hourGC = XtGetGC(gnew, valuemask, &myXGCV);
+
+       myXGCV.foreground = w->clock.jewel;
+       w->clock.jewelGC = XtGetGC(gnew, valuemask, &myXGCV);
+    
+       myXGCV.foreground = w->core.background_pixel;
+       w->clock.eraseGC = XtGetGC(gnew, valuemask, &myXGCV);
+    }
+
+    /* wait for Realize to add the timeout */
+    w->clock.interval_id = 0;
+
+    if (w->clock.shape_window && !XShapeQueryExtension (XtDisplay (w), 
+                                                       &shape_event_base, 
+                                                       &shape_error_base))
+    w->clock.shape_window = False;
+    w->clock.shape_mask = 0;
+    w->clock.shapeGC = 0;
+    w->clock.shape_width = 0;
+    w->clock.shape_height = 0;
+    w->clock.polys_valid = 0;
+}
+
+static void Resize (widget)
+    Widget     widget;
+{
+    ClockWidget        w = (ClockWidget) widget;
+    XGCValues  xgcv;
+    Widget     parent;
+    XWindowChanges     xwc;
+    int                face_width, face_height;
+    int                x, y;
+    Pixmap     shape_mask;
+
+    if (!XtIsRealized((Widget) w))
+       return;
+
+    /*
+     * compute desired border size
+     */
+
+    SetTransform (&w->clock.maskt,
+                 0, w->core.width,
+                 w->core.height, 0,
+                 -1.0, 1.0,
+                 -1.0, 1.0);
+
+    face_width = abs (Xwidth (BORDER_SIZE(w), BORDER_SIZE(w), &w->clock.maskt));
+    face_height = abs (Xheight (BORDER_SIZE(w), BORDER_SIZE(w), &w->clock.maskt));
+
+    /*
+     *  shape the windows and borders
+     */
+
+    if (w->clock.shape_window) {
+
+       SetTransform (&w->clock.t,
+                       face_width, w->core.width - face_width,
+                       w->core.height - face_height, face_height,
+                       -WINDOW_WIDTH(w)/2, WINDOW_WIDTH(w)/2,
+                       -WINDOW_HEIGHT(w)/2, WINDOW_HEIGHT(w)/2);
+    
+       /*
+        * allocate a pixmap to draw shapes in
+        */
+
+       if (w->clock.shape_mask &&
+           (w->clock.shape_width != w->core.width ||
+            w->clock.shape_height != w->core.height))
+       {
+           XFreePixmap (XtDisplay (w), w->clock.shape_mask);
+           w->clock.shape_mask = None;
+       }
+       
+       if (!w->clock.shape_mask)
+       {
+           w->clock.shape_mask = XCreatePixmap (XtDisplay (w), XtWindow (w),
+                                   w->core.width, w->core.height, 1);
+       }
+       shape_mask = w->clock.shape_mask;
+       if (!w->clock.shapeGC)
+            w->clock.shapeGC = XCreateGC (XtDisplay (w), shape_mask, 0, &xgcv);
+
+       /* erase the pixmap */
+       XSetForeground (XtDisplay (w), w->clock.shapeGC, 0);
+       XFillRectangle (XtDisplay (w), shape_mask, w->clock.shapeGC,
+                       0, 0, w->core.width, w->core.height);
+       XSetForeground (XtDisplay (w), w->clock.shapeGC, 1);
+
+       /*
+        * draw the bounding shape.  Doing this first
+        * eliminates extra exposure events.
+        */
+
+       if (w->clock.border_size > 0.0 || !w->clock.transparent)
+       {
+           TFillArc (XtDisplay (w), shape_mask,
+                           w->clock.shapeGC, &w->clock.maskt,
+                           -1.0, -1.0,
+                           2.0, 2.0,
+                           0, 360 * 64);
+       }
+
+       if (w->clock.transparent)
+       {
+           if (w->clock.border_size > 0.0)
+           {
+               XSetForeground (XtDisplay (w), w->clock.shapeGC, 0);
+               TFillArc (XtDisplay (w), shape_mask,
+                               w->clock.shapeGC, &w->clock.t,
+                               -WINDOW_WIDTH(w)/2, -WINDOW_HEIGHT(w)/2,
+                               WINDOW_WIDTH(w), WINDOW_HEIGHT(w),
+                               0, 360 * 64);
+               XSetForeground (XtDisplay (w), w->clock.shapeGC, 1);
+           }
+           paint_jewel (w, shape_mask, w->clock.shapeGC);
+           paint_hands (w, shape_mask, w->clock.shapeGC, w->clock.shapeGC);
+       }
+       /*
+        * Find the highest enclosing widget and shape it
+        */
+
+       x = 0;
+       y = 0;
+       for (parent = (Widget) w; XtParent (parent); parent = XtParent (parent)) {
+           x = x + parent->core.x + parent->core.border_width;
+           y = y + parent->core.y + parent->core.border_width;
+       }
+
+       XShapeCombineMask (XtDisplay (parent), XtWindow (parent), ShapeBounding,
+                           x, y, shape_mask, ShapeSet);
+
+       /* erase the pixmap */
+       XSetForeground (XtDisplay (w), w->clock.shapeGC, 0);
+       XFillRectangle (XtDisplay (w), shape_mask, w->clock.shapeGC,
+                       0, 0, w->core.width, w->core.height);
+       XSetForeground (XtDisplay (w), w->clock.shapeGC, 1);
+
+       /*
+        * draw the clip shape
+        */
+
+       if (w->clock.transparent)
+       {
+           paint_jewel (w, shape_mask, w->clock.shapeGC);
+           paint_hands (w, shape_mask, w->clock.shapeGC, w->clock.shapeGC);
+       }
+       else
+       {
+           TFillArc (XtDisplay (w), shape_mask,
+                           w->clock.shapeGC, &w->clock.t,
+                           -WINDOW_WIDTH(w)/2, -WINDOW_HEIGHT(w)/2,
+                           WINDOW_WIDTH(w), WINDOW_HEIGHT(w),
+                           0, 360 * 64);
+       }
+
+       XShapeCombineMask (XtDisplay (w), XtWindow (w), ShapeClip, 
+                   0, 0, shape_mask, ShapeSet);
+
+    } else
+    {
+       /*
+        * reconfigure the widget to split the availible
+        * space between the window and the border
+        */
+
+       if (face_width > face_height)
+           xwc.border_width = face_height;
+       else
+           xwc.border_width = face_width;
+       xwc.width = w->core.width - xwc.border_width * 2;
+       xwc.height = w->core.height - xwc.border_width * 2;
+       XConfigureWindow (XtDisplay (w), XtWindow (w),
+                           CWWidth|CWHeight|CWBorderWidth,
+                           &xwc);
+    
+       SetTransform (&w->clock.t,
+           0, xwc.width,
+           xwc.height, 0,
+           -WINDOW_WIDTH(w)/2, WINDOW_WIDTH(w)/2,
+           -WINDOW_HEIGHT(w)/2, WINDOW_HEIGHT(w)/2);
+    }
+}
+static void Realize (gw, valueMask, attrs)
+     Widget gw;
+     XtValueMask *valueMask;
+     XSetWindowAttributes *attrs;
+{
+     ClockWidget       w = (ClockWidget)gw;
+
+    if (w->clock.backing_store != Always + WhenMapped + NotUseful) {
+       attrs->backing_store = w->clock.backing_store;
+       *valueMask |= CWBackingStore;
+    }
+    if (w->clock.transparent)
+    {
+       attrs->background_pixel = w->clock.minute;
+       *valueMask |= CWBackPixel;
+       *valueMask &= ~CWBackPixmap;
+    }
+    XtCreateWindow( gw, (unsigned)InputOutput, (Visual *)CopyFromParent,
+                    *valueMask, attrs );
+    if (!w->clock.transparent)
+       Resize (gw);
+    new_time ((XtPointer) gw, 0);
+}
+
+static void Destroy (gw)
+     Widget gw;
+{
+     ClockWidget w = (ClockWidget)gw;
+     if (w->clock.interval_id) XtRemoveTimeOut (w->clock.interval_id);
+     if (! w->clock.transparent) {
+        XtReleaseGC(gw, w->clock.minuteGC);
+        XtReleaseGC(gw, w->clock.hourGC);
+        XtReleaseGC(gw, w->clock.jewelGC);
+        XtReleaseGC(gw, w->clock.eraseGC);
+     }
+     if (w->clock.shapeGC)
+       XFreeGC(XtDisplay(gw), w->clock.shapeGC);
+    if (w->clock.shape_mask)
+       XFreePixmap (XtDisplay (w), w->clock.shape_mask);
+}
+
+/* ARGSUSED */
+static void Redisplay(gw, event, region)
+     Widget gw;
+     XEvent *event;
+     Region region;
+{
+    ClockWidget        w;
+
+    w = (ClockWidget) gw;
+    if (!w->clock.transparent)
+    {
+       paint_jewel (w, XtWindow (w), w->clock.jewelGC);
+       paint_hands (w, XtWindow (w), w->clock.minuteGC, w->clock.hourGC);
+    }
+}
+
+/*
+ * routines to draw the hands and jewel
+ */
+
+#ifndef PI     /* may be found in <math.h> */
+# define PI (3.14159265358979323846)
+#endif
+
+/*
+ * converts a number from 0..1 representing a clockwise radial distance
+ * from the 12 oclock position to a radian measure of the counter-clockwise
+ * distance from the 3 oclock position
+ */
+
+static double
+clock_to_angle (clock)
+double clock;
+{
+       if (clock >= .75)
+               clock -= 1.0;
+       return -2.0 * PI * clock + PI / 2.0;
+}
+
+/* ARGSUSED */
+static void new_time (client_data, id)
+     XtPointer client_data;
+     XtIntervalId *id;         /* unused */
+{
+        ClockWidget    w = (ClockWidget)client_data;
+       Time_t          now;
+       struct tm       *tm;
+       
+       if (!w->clock.transparent)
+       if (w->clock.polys_valid) {
+               paint_hands (w, XtWindow (w), w->clock.eraseGC, w->clock.eraseGC);
+               check_jewel (w, XtWindow (w), w->clock.jewelGC);
+       }
+       (void) time (&now);
+       tm = localtime (&now);
+       if (tm->tm_hour >= 12)
+               tm->tm_hour -= 12;
+       w->clock.hour_angle = clock_to_angle ((((double) tm->tm_hour) +
+                               ((double) tm->tm_min) / 60.0) / 12.0);
+       w->clock.minute_angle =
+               clock_to_angle (((double) tm->tm_min) / 60.0);
+       /*
+        * add the timeout before painting the hands, that may
+        * take a while and we'd like the clock to keep up
+        * with time changes.
+        */
+       w->clock.interval_id = 
+           XtAppAddTimeOut (XtWidgetToApplicationContext((Widget) w),
+                            (60 - tm->tm_sec) * 1000, new_time, client_data);
+       compute_hands (w);
+       if (w->clock.transparent)
+           Resize ((Widget)w);
+       else
+           paint_hands (w, XtWindow (w), w->clock.minuteGC, w->clock.hourGC);
+} /* new_time */
+
+void
+paint_jewel (w, d, gc)
+ClockWidget w;
+Drawable    d;
+GC         gc;
+{
+    if (JEWEL_SIZE(w) > 0.0)
+    {
+       TFillArc (XtDisplay (w), d, gc, &w->clock.t,
+                       JEWEL_X(w) - JEWEL_SIZE(w) / 2.0,
+                       JEWEL_Y(w) - JEWEL_SIZE(w) / 2.0,
+                       JEWEL_SIZE(w), JEWEL_SIZE(w), 0, 360 * 64);
+    }
+}
+
+#define sqr(x) ((x)*(x))
+
+/*
+ * check to see if the polygon intersects the circular jewel
+ */
+int
+check_jewel_poly (w, poly)
+ClockWidget    w;
+TPoint         poly[POLY_SIZE];
+{
+    double     a2, b2, c2, d2;
+    double     x, y, size;
+    int        i;
+
+    if (JEWEL_SIZE(w) > 0.0)
+    {
+       x = JEWEL_X(w);
+       y = JEWEL_Y(w);
+       size = JEWEL_SIZE(w);
+       /*
+        * check each side of the polygon to see if the
+        * distance from the line to the center of the
+        * circular jewel is less than the radius.
+        */
+       for (i = 0; i < POLY_SIZE-1; i++) {
+               a2 = sqr (poly[i].x - x) + sqr (poly[i].y - y);
+               b2 = sqr (poly[i+1].x - x) + sqr (poly[i+1].y - y);
+               c2 = sqr (poly[i].x - poly[i+1].x) + sqr (poly[i].y - poly[i+1].y);
+               d2 = a2 + b2 - c2;
+               if ((d2 <= sqr (size) &&
+                   a2 <= 2 * c2 && b2 <= 2 * c2) ||
+                   a2 <= sqr (size) ||
+                   b2 <= sqr (size))
+                       return 1;
+       }
+    }
+    return 0;
+}
+
+void
+check_jewel (w, d, gc)
+ClockWidget    w;
+Drawable       d;
+GC             gc;
+{
+       if (!w->clock.polys_valid || JEWEL_SIZE(w) <= 0.0)
+               return;
+       if ((MINUTE_LENGTH(w) >= (JEWEL_Y(w) - JEWEL_SIZE(w)/2.0) &&
+            check_jewel_poly (w, w->clock.minute_poly)) ||
+           (HOUR_LENGTH(w) >= (JEWEL_Y(w) - JEWEL_SIZE(w)/2.0) &&
+            check_jewel_poly (w, w->clock.minute_poly)))
+       {
+               paint_jewel (w, d, gc);
+       }
+}
+
+/*
+ * A hand is a rectangle with a triangular cap at the far end.
+ * This is represented with a five sided polygon.
+ */
+void
+compute_hand (w, a, l, width, poly)
+ClockWidget    w;
+double         a, l, width;
+TPoint         poly[POLY_SIZE];
+{
+       double  c, s;
+
+       c = cos(a);
+       s = sin(a);
+       poly[0].x = c * l;      
+       poly[0].y = s * l;
+       poly[1].x = (l - width) * c - s * width;
+       poly[1].y = (l - width) * s + c * width;
+       poly[2].x = (-width) * c - s * width;
+       poly[2].y = (-width) * s + c * width;
+       poly[3].x = (-width) * c + s * width;
+       poly[3].y = (-width) * s - c * width;
+       poly[4].x = (l - width) * c + s * width;
+       poly[4].y = (l - width) * s - c * width;
+       poly[5].x = poly[0].x;
+       poly[5].y = poly[0].y;
+}
+
+void
+compute_hands (w)
+ClockWidget    w;
+{
+       compute_hand (w, w->clock.minute_angle,
+               MINUTE_LENGTH(w), MINUTE_WIDTH(w), w->clock.minute_poly);
+       compute_hand (w, w->clock.hour_angle,
+               HOUR_LENGTH(w), HOUR_WIDTH(w), w->clock.hour_poly);
+       w->clock.polys_valid = 1;
+}
+
+void
+paint_hand (w, d, gc, poly)
+ClockWidget    w;
+Drawable       d;
+GC             gc;
+TPoint         poly[POLY_SIZE];
+{
+       TFillPolygon (XtDisplay (w), d, gc, &w->clock.t, poly, POLY_SIZE,
+                       Convex, CoordModeOrigin);
+}
+
+void
+paint_hands (w, d, minute_gc, hour_gc)
+ClockWidget    w;
+Drawable       d;
+GC             minute_gc, hour_gc;
+{
+    if (w->clock.polys_valid) {
+       paint_hand (w, d, hour_gc, w->clock.hour_poly);
+       paint_hand (w, d, minute_gc, w->clock.minute_poly);
+    }
+}
diff --git a/oclock/Clock.h b/oclock/Clock.h
new file mode 100644 (file)
index 0000000..48baf5e
--- /dev/null
@@ -0,0 +1,77 @@
+/* $Xorg: Clock.h,v 1.4 2001/02/09 02:05:33 xorgcvs Exp $ */
+/*
+
+Copyright 1993, 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/oclock/Clock.h,v 1.4 2001/01/17 23:45:01 dawes Exp $ */
+
+#ifndef _XtClock_h
+#define _XtClock_h
+
+/***********************************************************************
+ *
+ * Clock Widget
+ *
+ ***********************************************************************/
+
+/* Parameters:
+
+ Name               Class              RepType         Default Value
+ ----               -----              -------         -------------
+ background         Background         pixel           White
+ border                     BorderColor        pixel           Black
+ borderWidth        BorderWidth        int             1
+ minute                     Foreground         Pixel           Black
+ hour               Foreground         Pixel           Black
+ height                     Height             int             120
+ mappedWhenManaged   MappedWhenManaged Boolean         True
+ width              Width              int             120
+ x                  Position           int             0
+ y                  Position           int             0
+
+*/
+
+#define XtNminute      "minute"
+#define XtNhour                "hour"
+#define XtNjewel       "jewel"
+
+#define XtNshapeWindow "shapeWindow"
+#define XtCShapeWindow "ShapeWindow"
+#define XtNtransparent "transparent"
+#define XtCTransparent "Transparent"
+
+#define XtNjewelSize   "jewelSize"
+#define XtNborderSize  "borderSize"
+#define XtCBorderSize  "BorderSize"
+
+typedef struct _ClockRec *ClockWidget;  /* completely defined in ClockPrivate.h */
+typedef struct _ClockClassRec *ClockWidgetClass;    /* completely defined in ClockPrivate.h */
+
+extern WidgetClass clockWidgetClass;
+
+
+#endif /* _XtClock_h */
+/* DON'T ADD STUFF AFTER THIS #endif */
diff --git a/oclock/ClockP.h b/oclock/ClockP.h
new file mode 100644 (file)
index 0000000..cc075a8
--- /dev/null
@@ -0,0 +1,97 @@
+/* $Xorg: ClockP.h,v 1.4 2001/02/09 02:05:33 xorgcvs Exp $ */
+/*
+
+Copyright 1993, 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/oclock/ClockP.h,v 1.4 2001/01/17 23:45:01 dawes Exp $ */
+
+
+#ifndef _ClockP_h
+#define _ClockP_h
+
+#include "Clock.h"
+#include <X11/CoreP.h>
+#include "transform.h"
+
+#define POLY_SIZE      6
+
+/* New fields for the clock widget instance record */
+typedef struct {
+       Pixel           minute;
+       Pixel           hour;
+       Pixel           jewel;
+       GC              minuteGC;
+       GC              hourGC;
+       GC              jewelGC;
+       GC              eraseGC;
+       GC              shapeGC;        /* pointer to GraphicsContext */
+/* start of graph stuff */
+       int             backing_store;  /* backing store variety */
+       Boolean         shape_window;   /* use SetWindowShapeMask */
+       Boolean         transparent;    /* make window transparent */
+       float           border_size;
+       float           jewel_size;
+       XtIntervalId    interval_id;
+       Transform       t;
+       Transform       maskt;
+       Pixmap          shape_mask;     /* window shape */
+       int             shape_width;    /* window width when shape last made */
+       int             shape_height;   /* window height when shape last made */
+       double          hour_angle;     /* hour hand position */
+       double          minute_angle;   /* minute hand position */
+       int             polys_valid;    /* polygons contain good data */
+       TPoint          minute_poly[POLY_SIZE]; /* polygon for minute hand */
+       TPoint          hour_poly[POLY_SIZE];   /* polygon for hour hand */
+} ClockPart;
+
+/* Full instance record declaration */
+typedef struct _ClockRec {
+       CorePart core;
+       ClockPart clock;
+} ClockRec;
+
+/* New fields for the Clock widget class record */
+typedef struct {int dummy;} ClockClassPart;
+
+/* Full class record declaration. */
+typedef struct _ClockClassRec {
+       CoreClassPart core_class;
+       ClockClassPart clock_class;
+} ClockClassRec;
+
+/* Class pointer. */
+extern ClockClassRec clockClassRec;
+
+extern void paint_jewel ( ClockWidget w, Drawable d, GC gc );
+extern int check_jewel_poly ( ClockWidget w, TPoint poly[6] );
+extern void check_jewel ( ClockWidget w, Drawable d, GC gc );
+extern void compute_hand ( ClockWidget w, double a, double l, double width, 
+                         TPoint poly[6] );
+extern void compute_hands ( ClockWidget w );
+extern void paint_hand ( ClockWidget w, Drawable d, GC gc, TPoint poly[6] );
+extern void paint_hands ( ClockWidget w, Drawable d, GC minute_gc, GC hour_gc );
+
+#endif /* _ClockP_h */
diff --git a/oclock/INSTALL b/oclock/INSTALL
new file mode 100644 (file)
index 0000000..23e5f25
--- /dev/null
@@ -0,0 +1,236 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
+Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+These are generic installation instructions.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  (Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.)
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.  If you're
+     using `csh' on an old version of System V, you might need to type
+     `sh ./configure' instead to prevent `csh' from trying to execute
+     `configure' itself.
+
+     Running `configure' takes awhile.  While running, it prints some
+     messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+Compilers and Options
+=====================
+
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about.  Run `./configure --help' for
+details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory.  After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
+
+Installation Names
+==================
+
+By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+There may be some features `configure' cannot figure out automatically,
+but needs to determine by the type of machine the package will run on.
+Usually, assuming the package is built to be run on the _same_
+architectures, `configure' can figure that out, but if it prints a
+message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).  Here is a another example:
+
+     /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
+configuration-related scripts to be executed by `/bin/bash'.
+
+`configure' Invocation
+======================
+
+`configure' recognizes the following options to control how it operates.
+
+`--help'
+`-h'
+     Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/oclock/Makefile.am b/oclock/Makefile.am
new file mode 100644 (file)
index 0000000..957c344
--- /dev/null
@@ -0,0 +1,88 @@
+# $Id: Makefile.am,v 1.12 2005/12/07 16:17:58 kem Exp $
+# 
+#  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 = oclock
+
+oclock_CFLAGS = $(OCLOCK_CFLAGS)
+oclock_LDADD = $(OCLOCK_LIBS) -lm
+
+oclock_SOURCES =       \
+        Clock.c \
+        Clock.h \
+        ClockP.h \
+        oclock.c \
+        transform.c \
+        transform.h
+
+appman_PRE = \
+        oclock.man
+
+# App default files  (*.ad)
+
+appdefaultdir = @appdefaultdir@
+
+
+APPDEFAULTFILES = \
+        Clock-color
+
+SUFFIXES = .ad
+
+.ad:
+       cp $< $@
+
+appdefault_DATA = $(APPDEFAULTFILES)
+
+EXTRA_DIST = $(APPDEFAULTFILES:%=%.ad) oclock.bit oclmask.bit
+
+CLEANFILES = $(APPDEFAULTFILES)
+
+
+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/oclock/Makefile.in b/oclock/Makefile.in
new file mode 100644 (file)
index 0000000..cf7a18d
--- /dev/null
@@ -0,0 +1,730 @@
+# 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.am,v 1.12 2005/12/07 16:17:58 kem Exp $
+# 
+#  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 = oclock$(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 \
+       mkinstalldirs
+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 = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appdefaultdir)" \
+       "$(DESTDIR)$(appmandir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_oclock_OBJECTS = oclock-Clock.$(OBJEXT) oclock-oclock.$(OBJEXT) \
+       oclock-transform.$(OBJEXT)
+oclock_OBJECTS = $(am_oclock_OBJECTS)
+am__DEPENDENCIES_1 =
+oclock_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 = $(oclock_SOURCES)
+DIST_SOURCES = $(oclock_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|^.*/||'`;
+appdefaultDATA_INSTALL = $(INSTALL_DATA)
+appmanDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(appdefault_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@
+APPDEFS_CFLAGS = @APPDEFS_CFLAGS@
+APPDEFS_LIBS = @APPDEFS_LIBS@
+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@
+OCLOCK_CFLAGS = @OCLOCK_CFLAGS@
+OCLOCK_LIBS = @OCLOCK_LIBS@
+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@
+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@
+
+# App default files  (*.ad)
+appdefaultdir = @appdefaultdir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+oclock_CFLAGS = $(OCLOCK_CFLAGS)
+oclock_LDADD = $(OCLOCK_LIBS) -lm
+oclock_SOURCES = \
+        Clock.c \
+        Clock.h \
+        ClockP.h \
+        oclock.c \
+        transform.c \
+        transform.h
+
+appman_PRE = \
+        oclock.man
+
+APPDEFAULTFILES = \
+        Clock-color
+
+SUFFIXES = .ad .$(APP_MAN_SUFFIX) .man
+appdefault_DATA = $(APPDEFAULTFILES)
+EXTRA_DIST = $(APPDEFAULTFILES:%=%.ad) oclock.bit oclmask.bit \
+       $(appman_PRE)
+CLEANFILES = $(APPDEFAULTFILES) $(appman_DATA)
+appmandir = $(APP_MAN_DIR)
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+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'
+
+all: config.h
+       $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .ad .$(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)
+oclock$(EXEEXT): $(oclock_OBJECTS) $(oclock_DEPENDENCIES) 
+       @rm -f oclock$(EXEEXT)
+       $(LINK) $(oclock_LDFLAGS) $(oclock_OBJECTS) $(oclock_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oclock-Clock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oclock-oclock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oclock-transform.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) '$<'`
+
+oclock-Clock.o: Clock.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(oclock_CFLAGS) $(CFLAGS) -MT oclock-Clock.o -MD -MP -MF "$(DEPDIR)/oclock-Clock.Tpo" -c -o oclock-Clock.o `test -f 'Clock.c' || echo '$(srcdir)/'`Clock.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/oclock-Clock.Tpo" "$(DEPDIR)/oclock-Clock.Po"; else rm -f "$(DEPDIR)/oclock-Clock.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Clock.c' object='oclock-Clock.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) $(oclock_CFLAGS) $(CFLAGS) -c -o oclock-Clock.o `test -f 'Clock.c' || echo '$(srcdir)/'`Clock.c
+
+oclock-Clock.obj: Clock.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(oclock_CFLAGS) $(CFLAGS) -MT oclock-Clock.obj -MD -MP -MF "$(DEPDIR)/oclock-Clock.Tpo" -c -o oclock-Clock.obj `if test -f 'Clock.c'; then $(CYGPATH_W) 'Clock.c'; else $(CYGPATH_W) '$(srcdir)/Clock.c'; fi`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/oclock-Clock.Tpo" "$(DEPDIR)/oclock-Clock.Po"; else rm -f "$(DEPDIR)/oclock-Clock.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Clock.c' object='oclock-Clock.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) $(oclock_CFLAGS) $(CFLAGS) -c -o oclock-Clock.obj `if test -f 'Clock.c'; then $(CYGPATH_W) 'Clock.c'; else $(CYGPATH_W) '$(srcdir)/Clock.c'; fi`
+
+oclock-oclock.o: oclock.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(oclock_CFLAGS) $(CFLAGS) -MT oclock-oclock.o -MD -MP -MF "$(DEPDIR)/oclock-oclock.Tpo" -c -o oclock-oclock.o `test -f 'oclock.c' || echo '$(srcdir)/'`oclock.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/oclock-oclock.Tpo" "$(DEPDIR)/oclock-oclock.Po"; else rm -f "$(DEPDIR)/oclock-oclock.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='oclock.c' object='oclock-oclock.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) $(oclock_CFLAGS) $(CFLAGS) -c -o oclock-oclock.o `test -f 'oclock.c' || echo '$(srcdir)/'`oclock.c
+
+oclock-oclock.obj: oclock.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(oclock_CFLAGS) $(CFLAGS) -MT oclock-oclock.obj -MD -MP -MF "$(DEPDIR)/oclock-oclock.Tpo" -c -o oclock-oclock.obj `if test -f 'oclock.c'; then $(CYGPATH_W) 'oclock.c'; else $(CYGPATH_W) '$(srcdir)/oclock.c'; fi`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/oclock-oclock.Tpo" "$(DEPDIR)/oclock-oclock.Po"; else rm -f "$(DEPDIR)/oclock-oclock.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='oclock.c' object='oclock-oclock.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) $(oclock_CFLAGS) $(CFLAGS) -c -o oclock-oclock.obj `if test -f 'oclock.c'; then $(CYGPATH_W) 'oclock.c'; else $(CYGPATH_W) '$(srcdir)/oclock.c'; fi`
+
+oclock-transform.o: transform.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(oclock_CFLAGS) $(CFLAGS) -MT oclock-transform.o -MD -MP -MF "$(DEPDIR)/oclock-transform.Tpo" -c -o oclock-transform.o `test -f 'transform.c' || echo '$(srcdir)/'`transform.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/oclock-transform.Tpo" "$(DEPDIR)/oclock-transform.Po"; else rm -f "$(DEPDIR)/oclock-transform.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='transform.c' object='oclock-transform.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) $(oclock_CFLAGS) $(CFLAGS) -c -o oclock-transform.o `test -f 'transform.c' || echo '$(srcdir)/'`transform.c
+
+oclock-transform.obj: transform.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(oclock_CFLAGS) $(CFLAGS) -MT oclock-transform.obj -MD -MP -MF "$(DEPDIR)/oclock-transform.Tpo" -c -o oclock-transform.obj `if test -f 'transform.c'; then $(CYGPATH_W) 'transform.c'; else $(CYGPATH_W) '$(srcdir)/transform.c'; fi`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/oclock-transform.Tpo" "$(DEPDIR)/oclock-transform.Po"; else rm -f "$(DEPDIR)/oclock-transform.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='transform.c' object='oclock-transform.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) $(oclock_CFLAGS) $(CFLAGS) -c -o oclock-transform.obj `if test -f 'transform.c'; then $(CYGPATH_W) 'transform.c'; else $(CYGPATH_W) '$(srcdir)/transform.c'; fi`
+uninstall-info-am:
+install-appdefaultDATA: $(appdefault_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appdefaultdir)" || $(mkdir_p) "$(DESTDIR)$(appdefaultdir)"
+       @list='$(appdefault_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(appdefaultDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(appdefaultdir)/$$f'"; \
+         $(appdefaultDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(appdefaultdir)/$$f"; \
+       done
+
+uninstall-appdefaultDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appdefault_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(appdefaultdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(appdefaultdir)/$$f"; \
+       done
+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)$(appdefaultdir)" "$(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-appdefaultDATA 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-appdefaultDATA 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-appdefaultDATA 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-appdefaultDATA uninstall-appmanDATA \
+       uninstall-binPROGRAMS uninstall-info-am
+
+
+.ad:
+       cp $< $@
+
+.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/oclock/NEWS b/oclock/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/oclock/README b/oclock/README
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/oclock/aclocal.m4 b/oclock/aclocal.m4
new file mode 100644 (file)
index 0000000..398f56a
--- /dev/null
@@ -0,0 +1,1515 @@
+# 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 <scott@netsplit.com>.
+#
+# 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 <http://www.freedesktop.org/software/pkgconfig>.])],
+               [$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.2
+       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],[
+XORG_SGML_PATH=$prefix/share/sgml
+HAVE_DEFS_ENT=
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+AC_PATH_PROG(PS2PDF, ps2pdf)
+
+AC_MSG_CHECKING([Whether to build documentation])
+
+if test x$HAVE_DEFS_ENT != 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 && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+XORG_SGML_PATH=$prefix/share/sgml
+HAVE_DEFS_ENT=
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([Whether to build text documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([Whether to build PDF documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([Whether to build PostScript documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([Whether to build HTML documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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/oclock/compile b/oclock/compile
new file mode 100755 (executable)
index 0000000..1b1d232
--- /dev/null
@@ -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 <tromey@cygnus.com>.
+#
+# 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 <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+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 <bug-automake@gnu.org>.
+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/oclock/config.guess b/oclock/config.guess
new file mode 100755 (executable)
index 0000000..396482d
--- /dev/null
@@ -0,0 +1,1500 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
+
+timestamp='2006-07-02'
+
+# 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 <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+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 "$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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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 <stdlib.h>
+              #include <unistd.h>
+
+              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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       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*:[3456]*)
+       echo i586-pc-interix${UNAME_RELEASE}
+       exit ;;
+    EM64T:Interix*:[3456]*)
+       echo x86_64-unknown-interix${UNAME_RELEASE}
+       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*:*:* | x86_64: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 ;;
+    avr32*: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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-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 ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-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 <features.h>
+       #ifdef __ELF__
+       # ifdef __GLIBC__
+       #  if __GLIBC__ >= 2
+       LIBC=gnu
+       #  else
+       LIBC=gnulibc1
+       #  endif
+       # else
+       LIBC=gnulibc1
+       # endif
+       #else
+       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+       LIBC=gnu
+       #else
+       LIBC=gnuaout
+       #endif
+       #endif
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^LIBC/{
+               s: ::g
+               p
+           }'`"
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/oclock/config.h.in b/oclock/config.h.in
new file mode 100644 (file)
index 0000000..c364eda
--- /dev/null
@@ -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/oclock/config.sub b/oclock/config.sub
new file mode 100755 (executable)
index 0000000..387c18d
--- /dev/null
@@ -0,0 +1,1608 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
+
+timestamp='2006-07-02'
+
+# 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 <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+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-newlib* | 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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | 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 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | 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 \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | 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 | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xscale | xscalee[bl] | 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)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | 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-* \
+       | m32c-* | 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-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | 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-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | 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-*)
+               ;;
+       # 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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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 | sparcv9v)
+               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* | -solidbsd* \
+             | -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-newlib* | -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* | -rdos* | -toppers*)
+       # 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
+        spu-*)
+               os=-elf
+               ;;
+       *-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/oclock/configure b/oclock/configure
new file mode 100755 (executable)
index 0000000..9581ff3
--- /dev/null
@@ -0,0 +1,5311 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.61 for oclock 1.0.1.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+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) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&    (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    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=.
+  case $as_dir in
+        /*)
+          for as_base in sh bash ksh sh5; do
+            as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+          done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+        # Try only shells that exist, to save several forks.
+        if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+               { ("$as_shell") 2> /dev/null <<\_ASEOF
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+              as_have_required=yes
+              if { "$as_shell" 2> /dev/null <<\_ASEOF
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf@gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+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$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+       case $1 in
+        -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# 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`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='oclock'
+PACKAGE_TARNAME='oclock'
+PACKAGE_VERSION='1.0.1'
+PACKAGE_STRING='oclock 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
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+CYGPATH_W
+PACKAGE
+VERSION
+ACLOCAL
+AUTOCONF
+AUTOMAKE
+AUTOHEADER
+MAKEINFO
+install_sh
+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
+OCLOCK_CFLAGS
+OCLOCK_LIBS
+APPDEFS_CFLAGS
+APPDEFS_LIBS
+appdefaultdir
+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=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+PKG_CONFIG
+OCLOCK_CFLAGS
+OCLOCK_LIBS
+APPDEFS_CFLAGS
+APPDEFS_LIBS'
+
+
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)   ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$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 ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -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'`
+    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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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'`
+    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; }; }
+    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 directory names.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { echo "$as_me: error: Working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$0" ||
+$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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 oclock 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR          info documentation [DATAROOTDIR/info]
+  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR           man documentation [DATAROOTDIR/man]
+  --docdir=DIR           documentation root [DATAROOTDIR/doc/oclock]
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
+_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 oclock 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 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<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  PKG_CONFIG  path to pkg-config utility
+  OCLOCK_CFLAGS
+              C compiler flags for OCLOCK, overriding pkg-config
+  OCLOCK_LIBS linker flags for OCLOCK, overriding pkg-config
+  APPDEFS_CFLAGS
+              C compiler flags for APPDEFS, overriding pkg-config
+  APPDEFS_LIBS
+              linker flags for APPDEFS, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" || continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+oclock configure 1.0.1
+generated by GNU Autoconf 2.61
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 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
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by oclock $as_me 1.0.1, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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
+IFS=$as_save_IFS
+
+} >&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_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_arg'"
+      ;;
+    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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+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,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r 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 -f -r conftest* 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 -n "$CONFIG_SITE"; then
+  set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+  set x "$ac_default_prefix/share/config.site" \
+       "$ac_default_prefix/etc/config.site"
+fi
+shift
+for ac_site_file
+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 $ac_precious_vars; 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
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    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 -f 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$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='oclock'
+ 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"}
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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.exe
+  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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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.exe
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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[^ ]*//'`
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
+  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
+
+# Check that 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'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 that 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 { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 | *.map | *.inf | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+    *) 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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; 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 core 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
+{ 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
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       CFLAGS=""
+      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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+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 ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_c89=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 <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+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 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+  ;;
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+  ;;
+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
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+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 OCLOCK" >&5
+echo $ECHO_N "checking for OCLOCK... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$OCLOCK_CFLAGS"; then
+        pkg_cv_OCLOCK_CFLAGS="$OCLOCK_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"x11 xmu xext\"") >&5
+  ($PKG_CONFIG --exists --print-errors "x11 xmu xext") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_OCLOCK_CFLAGS=`$PKG_CONFIG --cflags "x11 xmu xext" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$OCLOCK_LIBS"; then
+        pkg_cv_OCLOCK_LIBS="$OCLOCK_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"x11 xmu xext\"") >&5
+  ($PKG_CONFIG --exists --print-errors "x11 xmu xext") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_OCLOCK_LIBS=`$PKG_CONFIG --libs "x11 xmu xext" 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
+               OCLOCK_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "x11 xmu xext"`
+        else
+               OCLOCK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "x11 xmu xext"`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$OCLOCK_PKG_ERRORS" >&5
+
+       { { echo "$as_me:$LINENO: error: Package requirements (x11 xmu xext) were not met:
+
+$OCLOCK_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 OCLOCK_CFLAGS
+and OCLOCK_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 xmu xext) were not met:
+
+$OCLOCK_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 OCLOCK_CFLAGS
+and OCLOCK_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 OCLOCK_CFLAGS
+and OCLOCK_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+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 OCLOCK_CFLAGS
+and OCLOCK_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+       OCLOCK_CFLAGS=$pkg_cv_OCLOCK_CFLAGS
+       OCLOCK_LIBS=$pkg_cv_OCLOCK_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       :
+fi
+
+
+
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for APPDEFS" >&5
+echo $ECHO_N "checking for APPDEFS... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$APPDEFS_CFLAGS"; then
+        pkg_cv_APPDEFS_CFLAGS="$APPDEFS_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_APPDEFS_CFLAGS=`$PKG_CONFIG --cflags "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$APPDEFS_LIBS"; then
+        pkg_cv_APPDEFS_LIBS="$APPDEFS_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_APPDEFS_LIBS=`$PKG_CONFIG --libs "xt" 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
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xt"`
+        else
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xt"`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$APPDEFS_PKG_ERRORS" >&5
+
+       { { echo "$as_me:$LINENO: error: Package requirements (xt) were not met:
+
+$APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_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 (xt) were not met:
+
+$APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+       APPDEFS_CFLAGS=$pkg_cv_APPDEFS_CFLAGS
+       APPDEFS_LIBS=$pkg_cv_APPDEFS_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       :
+fi
+appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/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_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { 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=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_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; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ 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
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+
+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 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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     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 "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+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_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+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) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+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$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+       case $1 in
+        -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by oclock $as_me 1.0.1, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+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 and configuration settings, 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 <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+oclock config.status 1.0.1
+configured by $0, generated by GNU Autoconf 2.61,
+  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2006 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+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
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --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;;
+  --he | --h)
+    # Conflict between --help and --header
+    { 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 ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { 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"
+     ac_need_defaults=false ;;
+
+  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 CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  CONFIG_SHELL=$SHELL
+  export CONFIG_SHELL
+  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) { { 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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+#
+# Set up the sed scripts for 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
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+CYGPATH_W!$CYGPATH_W$ac_delim
+PACKAGE!$PACKAGE$ac_delim
+VERSION!$VERSION$ac_delim
+ACLOCAL!$ACLOCAL$ac_delim
+AUTOCONF!$AUTOCONF$ac_delim
+AUTOMAKE!$AUTOMAKE$ac_delim
+AUTOHEADER!$AUTOHEADER$ac_delim
+MAKEINFO!$MAKEINFO$ac_delim
+install_sh!$install_sh$ac_delim
+STRIP!$STRIP$ac_delim
+INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
+mkdir_p!$mkdir_p$ac_delim
+AWK!$AWK$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+am__leading_dot!$am__leading_dot$ac_delim
+AMTAR!$AMTAR$ac_delim
+am__tar!$am__tar$ac_delim
+am__untar!$am__untar$ac_delim
+MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
+MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
+MAINT!$MAINT$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+DEPDIR!$DEPDIR$ac_delim
+am__include!$am__include$ac_delim
+am__quote!$am__quote$ac_delim
+AMDEP_TRUE!$AMDEP_TRUE$ac_delim
+AMDEP_FALSE!$AMDEP_FALSE$ac_delim
+AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
+CCDEPMODE!$CCDEPMODE$ac_delim
+am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
+am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
+PKG_CONFIG!$PKG_CONFIG$ac_delim
+OCLOCK_CFLAGS!$OCLOCK_CFLAGS$ac_delim
+OCLOCK_LIBS!$OCLOCK_LIBS$ac_delim
+APPDEFS_CFLAGS!$APPDEFS_CFLAGS$ac_delim
+APPDEFS_LIBS!$APPDEFS_LIBS$ac_delim
+appdefaultdir!$appdefaultdir$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+host_os!$host_os$ac_delim
+APP_MAN_SUFFIX!$APP_MAN_SUFFIX$ac_delim
+LIB_MAN_SUFFIX!$LIB_MAN_SUFFIX$ac_delim
+FILE_MAN_SUFFIX!$FILE_MAN_SUFFIX$ac_delim
+MISC_MAN_SUFFIX!$MISC_MAN_SUFFIX$ac_delim
+DRIVER_MAN_SUFFIX!$DRIVER_MAN_SUFFIX$ac_delim
+ADMIN_MAN_SUFFIX!$ADMIN_MAN_SUFFIX$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+APP_MAN_DIR!$APP_MAN_DIR$ac_delim
+LIB_MAN_DIR!$LIB_MAN_DIR$ac_delim
+FILE_MAN_DIR!$FILE_MAN_DIR$ac_delim
+MISC_MAN_DIR!$MISC_MAN_DIR$ac_delim
+DRIVER_MAN_DIR!$DRIVER_MAN_DIR$ac_delim
+ADMIN_MAN_DIR!$ADMIN_MAN_DIR$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 8; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_ACEOF
+
+
+# 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
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      ac_file_inputs="$ac_file_inputs $ac_f"
+    done
+
+    # 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.  */
+    configure_input="Generated from "`IFS=:
+         echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    fi
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin";;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$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'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+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&@top_builddir@&$ac_top_builddir_sub&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out"; rm -f "$tmp/out";;
+  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
+  esac
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+_ACEOF
+
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status.  If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless.  But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([  #]*\\)[^        ]*\\([  ]*'
+ac_dB='\\)[     (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
+
+uniq confdefs.h |
+  sed -n '
+       t rset
+       :rset
+       s/^[     ]*#[    ]*define[       ][      ]*//
+       t ok
+       d
+       :ok
+       s/[\\&,]/\\&/g
+       s/^\('"$ac_word_re"'\)\(([^()]*)\)[      ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+       s/^\('"$ac_word_re"'\)[  ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+  ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then replace #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.
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[    #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is:         sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is:        sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be:    sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
+do
+  # Write a here document:
+    cat >>$CONFIG_STATUS <<_ACEOF
+    # First, check the format of the line:
+    cat >"\$tmp/defines.sed" <<\\CEOF
+/^[     ]*#[    ]*undef[        ][      ]*$ac_word_re[  ]*\$/b def
+/^[     ]*#[    ]*define[       ][      ]*$ac_word_re[(         ]/b def
+b
+:def
+_ACEOF
+  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+  grep . conftest.tail >/dev/null || break
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines conftest.tail
+
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
+cat >>$CONFIG_STATUS <<\_ACEOF
+  if test x"$ac_file" != x-; then
+    echo "/* $configure_input  */" >"$tmp/config.h"
+    cat "$ac_result" >>"$tmp/config.h"
+    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
+      rm -f $ac_file
+      mv "$tmp/config.h" $ac_file
+    fi
+  else
+    echo "/* $configure_input  */"
+    cat "$ac_result"
+  fi
+  rm -f "$tmp/out12"
+# 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" >`$as_dirname -- $ac_file ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X$ac_file : 'X\(//\)[^/]' \| \
+        X$ac_file : 'X\(//\)$' \| \
+        X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
+echo X$ac_file |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) 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=`$as_dirname -- "$mf" ||
+$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=`$as_dirname -- "$file" ||
+$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'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$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'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (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/oclock/configure.ac b/oclock/configure.ac
new file mode 100644 (file)
index 0000000..1329057
--- /dev/null
@@ -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(oclock,[1.0.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],oclock)
+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(OCLOCK, x11 xmu xext)
+AC_SUBST(OCLOCK_CFLAGS)
+AC_SUBST(OCLOCK_LIBS)
+
+PKG_CHECK_MODULES(APPDEFS, xt)
+appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+AC_SUBST(appdefaultdir)
+
+XORG_MANPAGE_SECTIONS
+XORG_RELEASE_VERSION
+
+AC_OUTPUT([Makefile])
diff --git a/oclock/depcomp b/oclock/depcomp
new file mode 100755 (executable)
index 0000000..04701da
--- /dev/null
@@ -0,0 +1,530 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2005-07-09.11
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+gcc)
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+  sed -e 's/^[^:]*: / /' \
+      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+  tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'.  On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like `#:fec' to the end of the
+    # dependency line.
+    tr ' ' '
+' < "$tmpdepfile" \
+    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+    tr '
+' ' ' >> $depfile
+    echo >> $depfile
+
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' '
+' < "$tmpdepfile" \
+   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+   >> $depfile
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+aix)
+  # The C for AIX Compiler uses -M and outputs the dependencies
+  # in a .u file.  In older versions, this file always lives in the
+  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # start of each line; $object doesn't have directory information.
+  # Version 6 uses the directory in both cases.
+  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+  tmpdepfile="$stripped.u"
+  if test "$libtool" = yes; then
+    "$@" -Wc,-M
+  else
+    "$@" -M
+  fi
+  stat=$?
+
+  if test -f "$tmpdepfile"; then :
+  else
+    stripped=`echo "$stripped" | sed 's,^.*/,,'`
+    tmpdepfile="$stripped.u"
+  fi
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+
+  if test -f "$tmpdepfile"; then
+    outname="$stripped.o"
+    # Each line is of the form `foo.o: dependent.h'.
+    # Do two passes, one to just change these to
+    # `$object: dependent.h' and one to simply `dependent.h:'.
+    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+icc)
+  # Intel's C compiler understands `-MD -MF file'.  However on
+  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+  # ICC 7.0 will fill foo.d with something like
+  #    foo.o: sub/foo.c
+  #    foo.o: sub/foo.h
+  # which is wrong.  We want:
+  #    sub/foo.o: sub/foo.c
+  #    sub/foo.o: sub/foo.h
+  #    sub/foo.c:
+  #    sub/foo.h:
+  # ICC 7.1 will output
+  #    foo.o: sub/foo.c sub/foo.h
+  # and will wrap long lines using \ :
+  #    foo.o: sub/foo.c ... \
+  #     sub/foo.h ... \
+  #     ...
+
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Do two passes, one to just change these to
+  # `$object: dependent.h' and one to simply `dependent.h:'.
+  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+    sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+   # dependencies in `foo.d' instead, so we check for that too.
+   # Subdirectories are respected.
+   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+   test "x$dir" = "x$object" && dir=
+   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+   if test "$libtool" = yes; then
+      # With Tru64 cc, shared objects can also be used to make a
+      # static library.  This mecanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in in $dir.libs/$base.o.d and
+      # in $dir$base.o.d.  We have to check for both files, because
+      # one of the two compilations can be disabled.  We should prefer
+      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+      # automatically cleaned when .libs/ is deleted, while ignoring
+      # the former would cause a distcleancheck panic.
+      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
+      tmpdepfile2=$dir$base.o.d          # libtool 1.5
+      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
+      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
+      "$@" -Wc,-MD
+   else
+      tmpdepfile1=$dir$base.o.d
+      tmpdepfile2=$dir$base.d
+      tmpdepfile3=$dir$base.d
+      tmpdepfile4=$dir$base.d
+      "$@" -MD
+   fi
+
+   stat=$?
+   if test $stat -eq 0; then :
+   else
+      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+      exit $stat
+   fi
+
+   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+   do
+     test -f "$tmpdepfile" && break
+   done
+   if test -f "$tmpdepfile"; then
+      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+      # That's a tab and a space in the [].
+      sed -e 's,^.*\.[a-z]*:[   ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+   else
+      echo "#dummy" > "$depfile"
+   fi
+   rm -f "$tmpdepfile"
+   ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  # Require at least two characters before searching for `:'
+  # in the target name.  This is to cope with DOS-style filenames:
+  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  "$@" $dashmflag |
+    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # Remove any Libtool call
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no
+  for arg in "$@"; do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    # Strip any option that makedepend may not understand.  Remove
+    # the object too, otherwise makedepend will parse it as a source file.
+    -*|$object)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix="`echo $object | sed 's/^.*\././'`"
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  "$@" -E |
+    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+    sed '$ s: \\$::' > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o,
+  # because we must use -o when running libtool.
+  "$@" || exit $?
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::   \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/oclock/install-sh b/oclock/install-sh
new file mode 100755 (executable)
index 0000000..4d4a951
--- /dev/null
@@ -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/oclock/missing b/oclock/missing
new file mode 100755 (executable)
index 0000000..894e786
--- /dev/null
@@ -0,0 +1,360 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2005-06-08.21
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
+#   Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try \`$0 --help' for more information"
+  exit 1
+fi
+
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+  configure_ac=configure.ac
+else
+  configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case "$1" in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  # Exit code 63 means version mismatch.  This often happens
+  # when the user try to use an ancient version of a tool on
+  # a file that requires a minimum version.  In this case we
+  # we should proceed has if the program had been absent, or
+  # if --run hadn't been passed.
+  if test $? = 63; then
+    run=:
+    msg="probably too old"
+  fi
+  ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+  aclocal      touch file \`aclocal.m4'
+  autoconf     touch file \`configure'
+  autoheader   touch file \`config.h.in'
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Now exit if we have it, but it failed.  Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case "$1" in
+  lex|yacc)
+    # Not GNU programs, they don't have --version.
+    ;;
+
+  tar)
+    if test -n "$run"; then
+       echo 1>&2 "ERROR: \`tar' requires --run"
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       exit 1
+    fi
+    ;;
+
+  *)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       # Could not run --version or --help.  This is probably someone
+       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # $TOOL exists and not knowing $TOOL uses missing.
+       exit 1
+    fi
+    ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+  aclocal*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
+         to install the \`Automake' and \`Perl' packages.  Grab them from
+         any GNU archive site."
+    touch aclocal.m4
+    ;;
+
+  autoconf)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`${configure_ac}'.  You might want to install the
+         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+         archive site."
+    touch configure
+    ;;
+
+  autoheader)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site."
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z "$files" && files="config.h"
+    touch_files=
+    for f in $files; do
+      case "$f" in
+      *:*) touch_files="$touch_files "`echo "$f" |
+                                      sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files="$touch_files $f.in";;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site."
+    find . -type f -name Makefile.am -print |
+          sed 's/\.am$/.in/' |
+          while read f; do touch "$f"; done
+    ;;
+
+  autom4te)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1' as part of \`Autoconf' from any GNU
+         archive site."
+
+    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo "#! /bin/sh"
+       echo "# Created by GNU Automake missing as a replacement of"
+       echo "#  $ $@"
+       echo "exit 0"
+       chmod +x $file
+       exit 1
+    fi
+    ;;
+
+  bison|yacc)
+    echo 1>&2 "\
+WARNING: \`$1' $msg.  You should only need it if
+         you modified a \`.y' file.  You may need the \`Bison' package
+         in order for those modifications to take effect.  You can get
+         \`Bison' from any GNU archive site."
+    rm -f y.tab.c y.tab.h
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+       case "$LASTARG" in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if [ -f "$SRCFILE" ]; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if [ -f "$SRCFILE" ]; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if [ ! -f y.tab.h ]; then
+       echo >y.tab.h
+    fi
+    if [ ! -f y.tab.c ]; then
+       echo 'main() { return 0; }' >y.tab.c
+    fi
+    ;;
+
+  lex|flex)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.l' file.  You may need the \`Flex' package
+         in order for those modifications to take effect.  You can get
+         \`Flex' from any GNU archive site."
+    rm -f lex.yy.c
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+       case "$LASTARG" in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if [ -f "$SRCFILE" ]; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if [ ! -f lex.yy.c ]; then
+       echo 'main() { return 0; }' >lex.yy.c
+    fi
+    ;;
+
+  help2man)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+        you modified a dependency of a manual page.  You may need the
+        \`Help2man' package in order for those modifications to take
+        effect.  You can get \`Help2man' from any GNU archive site."
+
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+       file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+    fi
+    if [ -f "$file" ]; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit 1
+    fi
+    ;;
+
+  makeinfo)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.texi' or \`.texinfo' file, or any other file
+         indirectly affecting the aspect of the manual.  The spurious
+         call might also be the consequence of using a buggy \`make' (AIX,
+         DU, IRIX).  You might want to install the \`Texinfo' package or
+         the \`GNU make' package.  Grab either from any GNU archive site."
+    # The file to touch is that specified with -o ...
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+      # ... or it is derived from the source name (dir/f.texi becomes f.info)
+      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+    fi
+    # If the file does not exist, the user really needs makeinfo;
+    # let's fail without touching anything.
+    test -f $file || exit 1
+    touch $file
+    ;;
+
+  tar)
+    shift
+
+    # We have already tried tar in the generic part.
+    # Look for gnutar/gtar before invocation to avoid ugly error
+    # messages.
+    if (gnutar --version > /dev/null 2>&1); then
+       gnutar "$@" && exit 0
+    fi
+    if (gtar --version > /dev/null 2>&1); then
+       gtar "$@" && exit 0
+    fi
+    firstarg="$1"
+    if shift; then
+       case "$firstarg" in
+       *o*)
+           firstarg=`echo "$firstarg" | sed s/o//`
+           tar "$firstarg" "$@" && exit 0
+           ;;
+       esac
+       case "$firstarg" in
+       *h*)
+           firstarg=`echo "$firstarg" | sed s/h//`
+           tar "$firstarg" "$@" && exit 0
+           ;;
+       esac
+    fi
+
+    echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         You may want to install GNU tar or Free paxutils, or check the
+         command line arguments."
+    exit 1
+    ;;
+
+  *)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.  Check the \`README' file,
+         it often tells you about the needed prerequisites for installing
+         this package.  You may also peek at any GNU archive site, in case
+         some other package would contain this missing \`$1' program."
+    exit 1
+    ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/oclock/mkinstalldirs b/oclock/mkinstalldirs
new file mode 100755 (executable)
index 0000000..259dbfc
--- /dev/null
@@ -0,0 +1,158 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+
+scriptversion=2005-06-29.22
+
+# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+errstatus=0
+dirmode=
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <bug-automake@gnu.org>."
+
+# process command line arguments
+while test $# -gt 0 ; do
+  case $1 in
+    -h | --help | --h*)         # -h for help
+      echo "$usage"
+      exit $?
+      ;;
+    -m)                         # -m PERM arg
+      shift
+      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+      dirmode=$1
+      shift
+      ;;
+    --version)
+      echo "$0 $scriptversion"
+      exit $?
+      ;;
+    --)                         # stop option processing
+      shift
+      break
+      ;;
+    -*)                         # unknown option
+      echo "$usage" 1>&2
+      exit 1
+      ;;
+    *)                          # first non-opt arg
+      break
+      ;;
+  esac
+done
+
+for file
+do
+  if test -d "$file"; then
+    shift
+  else
+    break
+  fi
+done
+
+case $# in
+  0) exit 0 ;;
+esac
+
+# Solaris 8's mkdir -p isn't thread-safe.  If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error.  This is a problem when calling mkinstalldirs
+# from a parallel make.  We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
+case $dirmode in
+  '')
+    if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+      echo "mkdir -p -- $*"
+      exec mkdir -p -- "$@"
+    else
+      # On NextStep and OpenStep, the `mkdir' command does not
+      # recognize any option.  It will interpret all options as
+      # directories to create, and then abort because `.' already
+      # exists.
+      test -d ./-p && rmdir ./-p
+      test -d ./--version && rmdir ./--version
+    fi
+    ;;
+  *)
+    if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+       test ! -d ./--version; then
+      echo "mkdir -m $dirmode -p -- $*"
+      exec mkdir -m "$dirmode" -p -- "$@"
+    else
+      # Clean up after NextStep and OpenStep mkdir.
+      for d in ./-m ./-p ./--version "./$dirmode";
+      do
+        test -d $d && rmdir $d
+      done
+    fi
+    ;;
+esac
+
+for file
+do
+  case $file in
+    /*) pathcomp=/ ;;
+    *)  pathcomp= ;;
+  esac
+  oIFS=$IFS
+  IFS=/
+  set fnord $file
+  shift
+  IFS=$oIFS
+
+  for d
+  do
+    test "x$d" = x && continue
+
+    pathcomp=$pathcomp$d
+    case $pathcomp in
+      -*) pathcomp=./$pathcomp ;;
+    esac
+
+    if test ! -d "$pathcomp"; then
+      echo "mkdir $pathcomp"
+
+      mkdir "$pathcomp" || lasterr=$?
+
+      if test ! -d "$pathcomp"; then
+       errstatus=$lasterr
+      else
+       if test ! -z "$dirmode"; then
+         echo "chmod $dirmode $pathcomp"
+         lasterr=
+         chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+         if test ! -z "$lasterr"; then
+           errstatus=$lasterr
+         fi
+       fi
+      fi
+    fi
+
+    pathcomp=$pathcomp/
+  done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/oclock/oclmask.bit b/oclock/oclmask.bit
new file mode 100644 (file)
index 0000000..19fb3ca
--- /dev/null
@@ -0,0 +1,14 @@
+#define oclmask_width 32
+#define oclmask_height 32
+static unsigned char oclmask_bits[] = {
+   0x00, 0xf0, 0x07, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x80, 0xff, 0xff, 0x00,
+   0xc0, 0xff, 0xff, 0x01, 0xe0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x07,
+   0xf8, 0xff, 0xff, 0x0f, 0xfc, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x1f,
+   0xfe, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0x3f,
+   0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f,
+   0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f,
+   0xff, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0x3f,
+   0xfe, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x1f,
+   0xf8, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x03,
+   0xc0, 0xff, 0xff, 0x01, 0x80, 0xff, 0xff, 0x00, 0x00, 0xfe, 0x3f, 0x00,
+   0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/oclock/oclock.bit b/oclock/oclock.bit
new file mode 100644 (file)
index 0000000..c264fe7
--- /dev/null
@@ -0,0 +1,14 @@
+#define oclock_width 32
+#define oclock_height 32
+static unsigned char oclock_bits[] = {
+   0x00, 0xf0, 0x07, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x80, 0x8f, 0xf8, 0x00,
+   0xc0, 0xc1, 0xc1, 0x01, 0xe0, 0x80, 0x80, 0x03, 0x30, 0x00, 0x00, 0x06,
+   0x18, 0x00, 0x00, 0x0c, 0x1c, 0x00, 0x00, 0x1c, 0x0c, 0x00, 0x70, 0x18,
+   0x06, 0x00, 0x78, 0x30, 0x06, 0x00, 0x3c, 0x30, 0x06, 0x00, 0x1e, 0x30,
+   0x03, 0x00, 0x0f, 0x60, 0x03, 0x80, 0x07, 0x60, 0x03, 0xc0, 0x03, 0x60,
+   0x03, 0xc0, 0x01, 0x60, 0x03, 0xc0, 0x01, 0x60, 0x03, 0xc0, 0x01, 0x60,
+   0x03, 0xc0, 0x01, 0x60, 0x06, 0xc0, 0x01, 0x30, 0x06, 0xc0, 0x01, 0x30,
+   0x06, 0xc0, 0x01, 0x30, 0x0c, 0xc0, 0x01, 0x18, 0x1c, 0xc0, 0x01, 0x1c,
+   0x18, 0xc0, 0x01, 0x0c, 0x30, 0xc0, 0x01, 0x06, 0xe0, 0xc0, 0x81, 0x03,
+   0xc0, 0x81, 0xc0, 0x01, 0x80, 0x0f, 0xf8, 0x00, 0x00, 0xfe, 0x3f, 0x00,
+   0x00, 0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/oclock/oclock.c b/oclock/oclock.c
new file mode 100644 (file)
index 0000000..cb2fc8d
--- /dev/null
@@ -0,0 +1,176 @@
+/*
+ * $Xorg: oclock.c,v 1.4 2001/02/09 02:05:33 xorgcvs 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.
+ */
+/* $XFree86: xc/programs/oclock/oclock.c,v 1.7tsi Exp $ */
+
+#include <X11/Intrinsic.h>
+#include <X11/Xatom.h>
+#include <X11/StringDefs.h>
+#include <X11/Shell.h>
+#include <X11/Xmu/Editres.h>
+#include "Clock.h"
+#include <stdio.h> 
+#include <stdlib.h>
+
+#ifdef XKB
+#include <X11/extensions/XKBbells.h>
+#endif
+
+#include "oclock.bit"
+#include "oclmask.bit"
+
+static void die ( Widget w, XtPointer client_data, XtPointer call_data );
+static void save ( Widget w, XtPointer client_data, XtPointer call_data );
+static void usage ( void );
+static void quit ( Widget w, XEvent *event, String *params, 
+                  Cardinal *num_params );
+
+
+static XtActionsRec actions[] = {
+    {"quit",   quit}
+};
+
+static Atom wm_delete_window;
+
+static void die(w, client_data, call_data)
+    Widget     w;
+    XtPointer  client_data, call_data;
+{
+    XCloseDisplay(XtDisplay(w));
+    exit(0);
+}
+
+static void save(w, client_data, call_data)
+    Widget w;
+    XtPointer client_data, call_data;
+{
+    return;    /* stateless */
+}
+
+/* Exit with message describing command line format */
+
+static void usage()
+{
+    fprintf(stderr,
+"usage: oclock\n");
+    fprintf (stderr, 
+"       [-geometry [{width}][x{height}][{+-}{xoff}[{+-}{yoff}]]] [-display [{host}]:[{vs}]]\n");
+    fprintf(stderr,
+"       [-fg {color}] [-bg {color}] [-bd {color}] [-bw {pixels}]\n");
+    fprintf(stderr,
+"       [-minute {color}] [-hour {color}] [-jewel {color}]\n");
+    fprintf(stderr,
+"       [-backing {backing-store}] [-shape] [-noshape] [-transparent]\n");
+    exit(1);
+}
+
+/* Command line options table.  Only resources are entered here...there is a
+   pass over the remaining options after XtParseCommand is let loose. */
+
+static XrmOptionDescRec options[] = {
+{"-fg",                "*Foreground",          XrmoptionSepArg,        NULL},
+{"-bg",                "*Background",          XrmoptionSepArg,        NULL},
+{"-foreground",        "*Foreground",          XrmoptionSepArg,        NULL},
+{"-background",        "*Background",          XrmoptionSepArg,        NULL},
+{"-minute",    "*clock.minute",        XrmoptionSepArg,        NULL},
+{"-hour",      "*clock.hour",          XrmoptionSepArg,        NULL},
+{"-jewel",     "*clock.jewel",         XrmoptionSepArg,        NULL},
+{"-backing",   "*clock.backingStore",  XrmoptionSepArg,        NULL},
+{"-shape",     "*clock.shapeWindow",   XrmoptionNoArg,         "TRUE"},
+{"-noshape",   "*clock.shapeWindow",   XrmoptionNoArg,         "FALSE"},
+{"-transparent","*clock.transparent",  XrmoptionNoArg,         "TRUE"},
+};
+
+int 
+main(int argc, char *argv[])
+{
+    XtAppContext xtcontext;
+    Widget toplevel;
+    Arg arg[2];
+    int        i;
+    
+    toplevel = XtOpenApplication(&xtcontext, "Clock",
+                                options, XtNumber(options), &argc, argv, NULL,
+                                sessionShellWidgetClass, NULL, 0);
+    if (argc != 1) usage();
+    XtAddCallback(toplevel, XtNsaveCallback, save, NULL);
+    XtAddCallback(toplevel, XtNdieCallback, die, NULL);
+
+    XtAppAddActions
+       (xtcontext, actions, XtNumber(actions));
+    XtOverrideTranslations
+       (toplevel, XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()"));
+
+    i = 0;
+    XtSetArg (arg[i], XtNiconPixmap, 
+             XCreateBitmapFromData (XtDisplay(toplevel),
+                                    XtScreen(toplevel)->root,
+                                    (char *)oclock_bits,
+                                    oclock_width, oclock_height));
+    i++;
+    XtSetArg (arg[i], XtNiconMask,
+             XCreateBitmapFromData (XtDisplay(toplevel),
+                                    XtScreen(toplevel)->root,
+                                    (char *)oclmask_bits,
+                                    oclmask_width, oclmask_height));
+    i++;
+    XtSetValues (toplevel, arg, i);
+
+    (void) XtCreateManagedWidget("clock", clockWidgetClass, toplevel, NULL, 0);
+    XtRealizeWidget (toplevel);
+
+    wm_delete_window = XInternAtom(XtDisplay(toplevel), "WM_DELETE_WINDOW",
+                                  False);
+    (void) XSetWMProtocols (XtDisplay(toplevel), XtWindow(toplevel),
+                            &wm_delete_window, 1);
+
+    XtAddEventHandler(toplevel, (EventMask) 0, TRUE, 
+                     _XEditResCheckMessages, NULL);
+
+    XtAppMainLoop(xtcontext);
+    exit(0);
+}
+
+static void quit(w, event, params, num_params)
+    Widget w;
+    XEvent *event;
+    String *params;
+    Cardinal *num_params;
+{
+    Arg arg;
+
+    if (event->type == ClientMessage && 
+       event->xclient.data.l[0] != wm_delete_window) {
+#ifdef XKB
+       XkbStdBell(XtDisplay(w), XtWindow(w), 0, XkbBI_BadValue);
+#else
+       XBell(XtDisplay(w), 0);
+#endif
+    } else {
+       XtSetArg(arg, XtNjoinSession, False);
+       XtSetValues(w, &arg, (Cardinal)1);
+       die(w, NULL, NULL);
+    }
+}
diff --git a/oclock/oclock.man b/oclock/oclock.man
new file mode 100644 (file)
index 0000000..60b6096
--- /dev/null
@@ -0,0 +1,104 @@
+.\" $Xorg: oclock.man,v 1.4 2001/02/09 02:05:33 xorgcvs 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.
+.\"
+.\" $XFree86: xc/programs/oclock/oclock.man,v 1.8 2001/12/14 20:01:00 dawes Exp $
+.\"
+.TH OCLOCK 1 __xorgversion__
+.SH NAME
+oclock \- round X clock
+.SH SYNOPSIS
+.B oclock
+[\-option ... ]
+.SH DESCRIPTION
+.I Oclock
+simply displays the current time on an analog display.
+.SH OPTIONS
+.TP 8
+.B \-fg \fIcolor\fB
+choose a different color for the both hands and the jewel of the clock
+.TP 8
+.B \-bg \fIcolor\fB
+choose a different color for the background.
+.TP 8
+.B \-jewel \fIcolor\fB
+choose a different color for the jewel on the clock.
+.TP 8
+.B \-minute \fIcolor\fB
+choose a different color for the minute hand of the clock.
+.TP 8
+.B \-hour \fIcolor\fB
+choose a different color for the hour hand of the clock.
+.TP 8
+.B \-backing \fI{ WhenMapped Always NotUseful }\fB
+selects an appropriate level of backing store.
+.TP 8
+.B \-geometry \fIgeometry\fB
+define the initial window geometry; see \fIX(__miscmansuffix__)\fP.
+.TP 8
+.B \-display \fIdisplay\fB
+specify the display to use; see \fIX(__miscmansuffix__)\fP.
+.TP 8
+.B \-bd \fIcolor\fB
+choose a different color for the window border.
+.TP 8
+.B \-bw \fIwidth\fB
+choose a different width for the window border.  As the Clock widget changes
+its border around quite a bit, this is most usefully set to zero.
+.TP 8
+.B \-shape
+causes the clock to use the Shape extension to create an oval window.
+This is the default unless the shapeWindow resource is set to false.
+.TP 8
+.B \-noshape
+causes the clock to not reshape itself and ancestors to exactly
+fit the outline of the clock.
+.TP 8
+.B \-transparent
+causes the clock to consist only of the jewel, the hands, and the border.
+.SH COLORS
+If you would like your clock to be viewable in color, include the following 
+in the #ifdef COLOR section you read with xrdb:
+.sp 1
+*customization:                 -color
+.sp 1
+.br
+This will cause oclock to pick up the colors in the app-defaults color
+customization file:
+__projectroot__/lib/X11/app-defaults/Clock-color.
+Below are the default colors:
+.sp 1
+Clock*Background: grey
+.br
+Clock*BorderColor: light blue
+.br
+Clock*hour: yellow
+.br
+Clock*jewel: yellow
+.br
+Clock*minute: yellow
+.SH "SEE ALSO"
+X(__miscmansuffix__), X Toolkit documentation
+.SH AUTHOR
+Keith Packard, MIT X Consortium
diff --git a/oclock/transform.c b/oclock/transform.c
new file mode 100644 (file)
index 0000000..2b662d2
--- /dev/null
@@ -0,0 +1,145 @@
+/* $Xorg: transform.c,v 1.4 2001/02/09 02:05:33 xorgcvs Exp $ */
+/*
+
+Copyright 1993, 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/oclock/transform.c,v 3.4 2001/07/25 15:05:15 dawes Exp $ */
+
+
+/*
+ * transformed coordinate system objects for X
+ */
+
+#include       <X11/Xlib.h>
+#include       "transform.h"
+#include       <stdlib.h>
+
+static XPoint * 
+TranslatePoints(TPoint *points, int n_points, 
+               Transform *t, int mode)
+{
+       XPoint  *xpoints;
+       int     i;
+       double  xoff = 0.0, yoff = 0.0;
+
+       xpoints = (XPoint *) malloc ((unsigned)n_points * sizeof (*xpoints));
+       if (!xpoints)
+               return 0;
+       for (i = 0; i < n_points; i++) {
+               xpoints[i].x = Xx(points[i].x + xoff, points[i].y + yoff, t);
+               xpoints[i].y = Xy(points[i].x + xoff, points[i].y + yoff, t);
+               if (mode == CoordModePrevious) {
+                       xoff += points[i].x;
+                       yoff += points[i].y;
+               }
+       }
+       return xpoints;
+}
+
+void
+TFillPolygon (dpy, d, gc, t, points, n_points, shape, mode)
+register Display       *dpy;
+Drawable               d;
+GC                     gc;
+Transform              *t;
+TPoint                 *points;
+int                    n_points;
+int                    shape;
+int                    mode;
+{
+       XPoint  *xpoints;
+
+       xpoints = TranslatePoints (points, n_points, t, mode);
+       if (xpoints) {
+               XFillPolygon (dpy, d, gc, xpoints, n_points, shape,
+                               CoordModeOrigin);
+               free (xpoints);
+       }
+}
+
+void
+TDrawArc (dpy, d, gc, t, x, y, width, height, angle1, angle2)
+       register Display        *dpy;
+       Drawable                d;
+       GC                      gc;
+       Transform               *t;
+       double                  x, y, width, height;
+       int                     angle1, angle2;
+{
+       int     xx, xy, xw, xh;
+
+       xx = Xx(x,y,t);
+       xy = Xy(x,y,t);
+       xw = Xwidth (width, height, t);
+       xh = Xheight (width, height, t);
+       if (xw < 0) {
+               xx += xw;
+               xw = -xw;
+       }
+       if (xh < 0) {
+               xy += xh;
+               xh = -xh;
+       }
+       XDrawArc (dpy, d, gc, xx, xy, xw, xh, angle1, angle2);
+}
+
+void
+TFillArc (dpy, d, gc, t, x, y, width, height, angle1, angle2)
+       register Display        *dpy;
+       Drawable                d;
+       GC                      gc;
+       Transform               *t;
+       double                  x, y, width, height;
+       int                     angle1, angle2;
+{
+       int     xx, xy, xw, xh;
+
+       xx = Xx(x,y,t);
+       xy = Xy(x,y,t);
+       xw = Xwidth (width, height, t);
+       xh = Xheight (width, height, t);
+       if (xw < 0) {
+               xx += xw;
+               xw = -xw;
+       }
+       if (xh < 0) {
+               xy += xh;
+               xh = -xh;
+       }
+       XFillArc (dpy, d, gc, xx, xy, xw, xh, angle1, angle2);
+}
+
+void
+SetTransform (t, xx1, xx2, xy1, xy2, tx1, tx2, ty1, ty2)
+Transform      *t;
+int            xx1, xx2, xy1, xy2;
+double         tx1, tx2, ty1, ty2;
+{
+       t->mx = ((double) xx2 - xx1) / (tx2 - tx1);
+       t->bx = ((double) xx1) - t->mx * tx1;
+       t->my = ((double) xy2 - xy1) / (ty2 - ty1);
+       t->by = ((double) xy1) - t->my * ty1;
+}
diff --git a/oclock/transform.h b/oclock/transform.h
new file mode 100644 (file)
index 0000000..ae88200
--- /dev/null
@@ -0,0 +1,68 @@
+/* $Xorg: transform.h,v 1.4 2001/02/09 02:05:33 xorgcvs Exp $ */
+/*
+
+Copyright 1993, 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/oclock/transform.h,v 1.4 2001/01/17 23:45:01 dawes Exp $ */
+
+
+/*
+ * header file for transformed coordinate system.  No rotations
+ * supported, as elipses cannot be rotated in X.
+ */
+
+typedef struct _transform {
+       double  mx, bx;
+       double  my, by;
+} Transform;
+
+typedef struct _TPoint {
+       double  x, y;
+} TPoint;
+
+typedef struct _TRectangle {
+       double  x, y, width, height;
+} TRectangle;
+
+# define Xx(x,y,t)     ((int)((t)->mx * (x) + (t)->bx + 0.5))
+# define Xy(x,y,t)     ((int)((t)->my * (y) + (t)->by + 0.5))
+# define Xwidth(w,h,t) ((int)((t)->mx * (w) + 0.5))
+# define Xheight(w,h,t)        ((int)((t)->my * (h) + 0.5))
+# define Tx(x,y,t)     ((((double) (x)) - (t)->bx) / (t)->mx)
+# define Ty(x,y,t)     ((((double) (y)) - (t)->by) / (t)->my)
+# define Twidth(w,h,t) (((double) (w)) / (t)->mx)
+# define Theight(w,h,t)        (((double) (h)) / (t)->my)
+
+extern void TFillPolygon ( Display *dpy, Drawable d, GC gc, Transform *t, 
+                          TPoint *points, int n_points, int shape, int mode );
+extern void TDrawArc ( Display *dpy, Drawable d, GC gc, Transform *t, 
+                      double x, double y, double width, double height, 
+                      int angle1, int angle2 );
+extern void TFillArc ( Display *dpy, Drawable d, GC gc, Transform *t, 
+                      double x, double y, double width, double height, 
+                      int angle1, int angle2 );
+extern void SetTransform ( Transform *t, int xx1, int xx2, int xy1, int xy2, 
+                          double tx1, double tx2, double ty1, double ty2 );
diff --git a/packaging/xorg-x11-apps.spec b/packaging/xorg-x11-apps.spec
new file mode 100644 (file)
index 0000000..73f0ab1
--- /dev/null
@@ -0,0 +1,79 @@
+Summary: X.Org X11 applications
+Name: xorg-x11-apps
+Version: 7.5
+Release: 2
+License: MIT/X11
+Group: User Interface/X
+URL: http://www.x.org
+Source: %{name}-%{version}.tar.gz
+
+Patch0: 01_xedit_mkdir_races.diff
+Patch1: 03_xconsole_implicit_pointer_conversion.diff
+Patch2: 05_xmore_fix_segv_without_xprint.diff
+
+BuildRequires: pkgconfig(xorg-macros)
+BuildRequires: pkgconfig(libpng)
+BuildRequires: pkgconfig(x11)
+BuildRequires: pkgconfig(xaw7)
+BuildRequires: pkgconfig(xcursor)
+BuildRequires: pkgconfig(xext)
+BuildRequires: pkgconfig(xft)
+BuildRequires: pkgconfig(xkbfile)
+BuildRequires: pkgconfig(xmuu)
+BuildRequires: pkgconfig(xrender)
+BuildRequires: pkgconfig(xt)
+BuildRequires: pkgconfig(xmu)
+BuildRequires: pkgconfig(xbitmaps)
+
+%define DEF_SUBDIRS bitmap ico oclock xcalc xclock xeyes xwd xwud
+
+Provides: %{DEF_SUBDIRS}
+
+# NOTE: xwd, xwud, luit used to be in these.
+Obsoletes: XFree86, xorg-x11
+# NOTE: x11perf, xclipboard used to be in these.
+Obsoletes: XFree86-tools, xorg-x11-tools
+%description
+A collection of common X Window System applications.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+
+%build
+# Build all apps
+{
+    CFLAGS="${CFLAGS} -D_F_BLOCK_MULTI_VIS_"
+    for app in %{DEF_SUBDIRS}; do
+        pushd $app
+        %configure \
+            --disable-xprint \
+            --with-sysmanpath=/usr/man:/usr/share/man:/usr/local/man:/usr/local/share/man:/usr/X11R6/man:/opt/man \
+            RSH=rsh \
+            MANCONF="/etc/manpath.config"
+        popd
+    done
+}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+# Install all apps
+{
+   for app in %{DEF_SUBDIRS} ; do
+      pushd $app
+      make install DESTDIR=$RPM_BUILD_ROOT
+      popd
+   done
+}
+
+%remove_docs
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%{_bindir}/*
+%{_includedir}/X11/bitmaps/*
+/etc/X11/app-defaults/*
diff --git a/x11perf/AUTHORS b/x11perf/AUTHORS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/x11perf/COPYING b/x11perf/COPYING
new file mode 100755 (executable)
index 0000000..933d8aa
--- /dev/null
@@ -0,0 +1,31 @@
+Copyright 1988, 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.
+
+****************************************************************************
+
+Copyright (c) 1993 by Hewlett-Packard Company
+
+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  the  copyright  notice  and  this  permission   notice  appear  in
+supporting  documentation, and that the name of  Hewlett-Packard  not be
+used in  advertising  or publicity  pertaining  to  distribution  of the
+software without specific, written prior permission.
diff --git a/x11perf/ChangeLog b/x11perf/ChangeLog
new file mode 100755 (executable)
index 0000000..331c94e
--- /dev/null
@@ -0,0 +1,510 @@
+commit 3147d783925bb42c7af78c9f5508c0dc245b942b
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Tue Sep 21 20:48:33 2010 -0700
+
+    x11perf 1.5.2
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 172260eee2180448594def3fcf719ce501528e56
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Tue Sep 21 20:46:39 2010 -0700
+
+    config: update AC_PREREQ statement to 2.60
+    
+    Unrelated to the previous patches, the new value simply reflects
+    the reality that the minimum level for autoconf to configure
+    all x.org modules is 2.60 dated June 2006.
+    
+    ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit c4b59fd280aa0f647f7f889122adf8b92b9e5cf8
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Tue Sep 21 20:43:58 2010 -0700
+
+    config: use AC_PROG_CC & AC_PROG_INSTALL now supplied by XORG_DEFAULT_OPTIONS
+    
+    The existing statements can now be removed from the configuration file.
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 4ed4ff8d692293995910da29e4d05ad9191105ea
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Tue Sep 21 20:42:54 2010 -0700
+
+    config: upgrade to util-macros 1.8 for additional man page support
+    
+    Use MAN_SUBST now supplied in XORG_MANPAGE_SECTIONS
+    The value of MAN_SUBST is the same for all X.Org packages.
+    
+    Use AC_PROG_SED now supplied by XORG_DEFAULT_OPTIONS
+    The existing statement can now be removed from the configuration file.
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 1f990bc605d520f58e0c321a1338da76d76529fa
+Author: Timo Myyra <Timo.Myyra@gmail.com>
+Date:   Sun Sep 19 10:54:40 2010 -0700
+
+    Remove reference to xbench in x11perf.man (#29830)
+    
+    xbench isn't supported by fd.o, and searching for it shows the latest version released in 1995.
+    
+    Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 05759c8550bf994f4ae4e87a658aa7ffdd9dd517
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Fri Aug 6 08:34:31 2010 -0700
+
+    Add HP notice to COPYING for Xmark script
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 3b427a6c4cc1551ce445abd975f5a128ea53d9be
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Jan 7 21:25:09 2010 -0500
+
+    COPYING: replace stub with actual copyright notice
+    
+    Refer to x11perf.c
+    Copyright 1988, 1989 by Digital Equipment Corporation
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 374bee27ef4d45044f7562ffed162a5b6f095e40
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Sat Jan 2 17:36:17 2010 -0500
+
+    Add -falseprecision flag for ludicrously precise stats
+    
+    The normal round-to-three-significant-figures behaviour, while morally
+    correct from a benchmarking perspective, makes it impossible to measure
+    variances between runs of less than 1%.  Occasionally you really do need
+    to measure that finely - for example, if tweaking the server's main
+    dispatch loop.
+    
+    Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit af29c01b5d41f08053263dfe251d0a2a26c7eb1f
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Sat Jan 2 17:23:50 2010 -0500
+
+    Death to RCS tags.
+    
+    Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit f8193c3f472fb0b7357552d10a6033e8ac08b9fa
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Nov 26 09:19:52 2009 -0500
+
+    Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES
+    
+    Now that the INSTALL file is generated.
+    Allows running make maintainer-clean.
+
+commit e6d0de5d8f13ca73753cb70b12b2f9b98f82b39f
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Wed Oct 28 14:09:08 2009 -0400
+
+    INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206
+    
+    Add missing INSTALL file. Use standard GNU file on building tarball
+    README may have been updated
+    Remove AUTHORS file as it is empty and no content available yet.
+    Remove NEWS file as it is empty and no content available yet.
+
+commit 5d3fb3c68c681cce10d3625bab85bb39c18e5e3b
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Mon Oct 26 22:08:38 2009 -0400
+
+    Makefile.am: ChangeLog not required: EXTRA_DIST or *CLEANFILES #24432
+    
+    ChangeLog filename is known to Automake and requires no further
+    coding in the makefile.
+
+commit 6b8182c54689c67fa35ac471fcfc4e7ee73b7b91
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Oct 22 12:34:15 2009 -0400
+
+    .gitignore: use common defaults with custom section # 24239
+    
+    Using common defaults will reduce errors and maintenance.
+    Only the very small or inexistent custom section need periodic maintenance
+    when the structure of the component changes. Do not edit defaults.
+
+commit 1b811f2bf9c3cdef966b18ea802f1f79b5f34ef2
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Wed Oct 21 12:47:20 2009 -0700
+
+    This is not a GNU project, so declare it foreign.
+    
+    On Wed, 2009-10-21 at 13:36 +1000, Peter Hutterer wrote:
+    > On Tue, Oct 20, 2009 at 08:23:55PM -0700, Jeremy Huddleston wrote:
+    > > I noticed an INSTALL file in xlsclients and libXvMC today, and it
+    > > was quite annoying to work around since 'autoreconf -fvi' replaces
+    > > it and git wants to commit it.  Should these files even be in git?
+    > > Can I nuke them for the betterment of humanity and since they get
+    > > created by autoreconf anyways?
+    >
+    > See https://bugs.freedesktop.org/show_bug.cgi?id=24206
+    
+    As an interim measure, replace AM_INIT_AUTOMAKE([dist-bzip2]) with
+    AM_INIT_AUTOMAKE([foreign dist-bzip2]). This will prevent the generation
+    of the INSTALL file. It is also part of the 24206 solution.
+    
+    Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
+
+commit 98ca2c35b05a2d248063047c50770a018e35e810
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Oct 16 17:19:36 2009 -0700
+
+    x11perf 1.5.1
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 266da0b9c176cf0dc615005bb0ad4aa585892bd8
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Oct 16 17:17:41 2009 -0700
+
+    Migrate to xorg macros 1.3 & XORG_DEFAULT_OPTIONS
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 9851abff574fe041f4e3f45b39c61d943e3a7f86
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Oct 1 14:54:20 2009 -0700
+
+    Add README with pointers to mailing lists, bugzilla, & git
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit c7f3c6652e9507e4303fd9ed913c593afb7447f0
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Jan 13 18:55:51 2009 -0200
+
+    Ansification and compile warning fixes.
+    
+      This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, and corrects
+    make distcheck.
+
+commit 828c0323450eadaf040749c010918679f5e4fe53
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Fri Mar 7 16:51:53 2008 -0500
+
+    x11perf-1.5
+
+commit 1540dc21e1ef7bb473af7616294e5730e38f66ec
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Dec 6 16:37:08 2007 -0500
+
+    Replace static ChangeLog with dist-hook to generate from git log
+
+commit b1c5b72bb4bb5f3e116255f9d04b368137ff25f7
+Author: Michel Dänzer <michel@tungstengraphics.com>
+Date:   Thu Nov 1 09:13:43 2007 +0100
+
+    Fix typos in descriptions of -compwinwin{1,5}00.
+
+commit 569a5eaaef9a5c8bf50f1323fe39e81347976875
+Merge: 55aa9c2... e906fe5...
+Author: Keith Packard <keithp@koto.keithp.com>
+Date:   Mon Sep 10 16:56:06 2007 +0100
+
+    Merge branch 'origin'
+
+commit 55aa9c238c5d81c9dc0f679dfd2fea00f356247b
+Author: Keith Packard <keithp@koto.keithp.com>
+Date:   Mon Sep 10 16:12:29 2007 +0100
+
+    Add Compositing tests.
+    
+    -compwinwinXX, -comppixwinXX where XX is 10, 100 or 500.
+    
+    -pop <POP> <POP> ... where <POP> is one of Clear, Src, Dst, Over,
+    OverReverse, In, InReverse, Out, OutReverse, Atop, AtopReverse, Xor, Add or
+    Saturate.
+    
+    -format <FORMAT> <FORMAT> ... where <FORMAT> is one of RGB24, ARGB32, A8,
+    A4, A1 or NATIVE
+
+commit 8b3b9d1d1d3a255000fb43bd09c62ef1e0798023
+Author: Keith Packard <keithp@koto.keithp.com>
+Date:   Mon Sep 10 16:08:51 2007 +0100
+
+    Rename .cvsignore to .gitignore
+
+commit e906fe589a852e9b4af4aac6c72580494139a0b7
+Author: Eric S. Raymond <esr@thyrsus.com>
+Date:   Tue Jan 2 10:07:00 2007 -0800
+
+    Bug 9520: Markup problems in Xmark.1x
+    
+    X.Org Bugzilla #9520 <https://bugs.freedesktop.org/show_bug.cgi?id=9520>
+
+commit d36c3c0e7db2254dc1385fe7ffc187797e109e0e
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Wed Apr 11 15:45:48 2007 -0700
+
+    Another man page typo fix: s/aprox./approx./
+
+commit e9bb1f2d13cad8240cc95f1aae19316fe7568cbd
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Wed Apr 11 15:41:27 2007 -0700
+
+    renamed: .cvsignore -> .gitignore
+
+commit ad4686b388da891ca07fba41a748ea90a3bb15cb
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Wed Apr 11 15:39:23 2007 -0700
+
+    Bug #10616: Man page typo: s/peform/perform/
+    
+    X.Org Bugzilla #10616 <https://bugs.freedesktop.org/show_bug.cgi?id=10616>
+    Reported upstream from
+    Debian Bug #395445 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=395445>
+
+commit fabb885e8db6dd54d31b7223e9bb4f5d9e835d8c
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Thu Mar 2 23:36:27 2006 +0000
+
+    Bump to 1.4.1 (was 1.0.1 because we screwed up during modularising).
+
+commit 21ce0f2bab1743ed15474ba1468286d6782bf781
+Author: Keith Packard <keithp@keithp.com>
+Date:   Tue Feb 14 16:33:38 2006 +0000
+
+    Split detection of Xrender and Xft. Add detection of MIT-SHM. Clean up
+        CFLAGS in Makefile.am
+
+commit 32393ee83c8ad63dbb54aab709cdd4dc5802a74c
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Tue Feb 14 02:48:22 2006 +0000
+
+    Detect when Render is available and turn those tests on.
+
+commit d121367a04832aafb27800283bac5ce35365d84e
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 21 02:29:48 2005 +0000
+
+    Update package version for X11R7 release.
+
+commit 883de694b5dac055f0d7fd33cb84ee10c080ba8c
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Dec 19 16:22:42 2005 +0000
+
+    Stub COPYING files
+
+commit 2c3643dc1503b7e9136f678e0af238d507acf262
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:24:04 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+commit 8e9f6aa0f81fa57e8b08684a1110e945f6f0dacd
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 6 22:48:19 2005 +0000
+
+    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit e09f755a36b9848a7c76013d324713b1ee5cf0e3
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Dec 3 05:49:18 2005 +0000
+
+    Update package version number for X11R7 RC3 release.
+
+commit 9a94217191edf8e719ff9d4fbf485b5c33d0bde3
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Nov 28 22:01:39 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 95895b619909e2b9f2e144e972b83aee6595d5f3
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Mon Nov 21 10:34:58 2005 +0000
+
+    Another pass at .cvsignores for apps.
+
+commit 67eaa3cc45db8ab1a9aedb4675a09d5a3db31a7f
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Nov 21 03:14:15 2005 +0000
+
+    Change dependency from xmu to xmuu since the full xmu (with all its baggage
+        like Xt) is not needed here.
+
+commit 583d5d1c988ab24c61e2bbb21a5e5847328e86ec
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Sun Nov 20 22:08:50 2005 +0000
+
+    Add/improve .cvsignore files for apps.
+
+commit 2350482506abae44fcf656a3383c354ac2910d34
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:47:50 2005 +0000
+
+    Update package version number for RC1 release.
+
+commit a489b54c63515aa2be297ef340501b1b7ef09423
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Oct 17 23:56:21 2005 +0000
+
+    Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to
+        work better with BSD make
+
+commit 4ac6e7bffbd29ae179fbc053a8317db4fa2f3f75
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Fri Oct 14 00:25:42 2005 +0000
+
+    Use sed to fill in variables in man page
+
+commit 64a324c6ffd7ba8a9bce52d41db3e63d77b69eca
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Thu Oct 6 20:04:20 2005 +0000
+
+    Strip .sh from filenames of scripts to match the way they are installed by
+        the monolith
+
+commit eb51653deaa7a8cac0bac02f4a1fe4cd8291590b
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Thu Oct 6 03:47:12 2005 +0000
+
+    Fix file names of beforelight, x11perfcomp, and xlsclients man pages
+
+commit eb44ab57c5e989429f94bb67d01abaef70b9174d
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Aug 1 20:25:28 2005 +0000
+
+    Install man pages to section 1 instead of section m (Patch from Donnie
+        Berkholz)
+
+commit a1e27c9edcb4b99a0550e674dea66bd1d3111747
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Jul 29 21:22:30 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 9dc00b804b6283a6371cae136f0c4abc743e3462
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Jul 28 15:57:12 2005 +0000
+
+    Fix distcheck for remaining apps
+
+commit 8b5dc957345bbee8349340e345a6a06ec42a16e8
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Jul 26 18:58:15 2005 +0000
+
+    Use AC_TYPE_SIGNAL and AC_FUNC_VFORK to replace Imake's SIGNAL_DEFINES and
+    -DHAS_VFORK
+
+commit 74c819bed573af85aabd92f023c885e53fb0cf77
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Jul 26 18:55:42 2005 +0000
+
+    Add config.h includes for modularization Use RETSIGTYPE if defined by
+        autoconf in addition to Imake's SIGNALRETURNSINT. Use
+        HAVE_WORKING_VFORK if defined by autoconf in addition to Imake's
+        HAS_VFORK
+
+commit 81a51fb38778c54442657142cf5d57fae4ac3e0e
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed Jul 20 19:31:51 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 2975cf615c2e0b79c3392d6d95b393ce4b0fd312
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sat Jul 16 23:29:38 2005 +0000
+
+    x11perf/Makefile.am: xinit/Makefile.am: xvidtune/Makefile.am:
+    - Replace $< with portable macro xinit/Makefile.am: xinit/configure.ac:
+        xvidtune/Makefile.am: xvidtune/configure.ac:
+    - Use more portable cpp invocations for pre-processing files
+        xfs/configure.ac:
+    - Add XTRANS_CONNECTION_FLAGS so xtrans transport type defines are set
+        correctly
+
+commit 68ebb5b755791822c2f1d9f9659c2ee94bb63f1c
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Wed Jun 29 20:41:01 2005 +0000
+
+    Add x11perf build system Add some x11perf shell script to symlink.sh
+
+commit 21b7ff0b54fcf28e933738aaaedf5aef46880717
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Wed Aug 11 08:05:31 2004 +0000
+
+    - Fix the build with old libXrender headers installed by including
+        TOP_INCLUDES first in the INCLUDES line.
+    - Drive-by fix of unused variables warnings in do_traps.c.
+
+commit 9f86498395945e52accedc6bf3d938c2d21abd5d
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Aug 6 23:42:11 2004 +0000
+
+    Add RenderAddTraps. Rewrite trapezoid rendering code.
+
+commit cc61a0dd9da513e24a0c39793e4e70237a8d35b5
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 19:54:38 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+commit 3208453773436841fd97a5a841f75aea2a84ea07
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:34:59 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit c090b9c09ddb3f21983506a90418d6e5387cbd94
+Author: Egbert Eich <eich@suse.de>
+Date:   Wed Mar 3 12:12:54 2004 +0000
+
+    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit c501072fc6aae9867785226575d87b6a3d89ecaa
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:36:16 2004 +0000
+
+    readding XFree86's cvs IDs
+
+commit 767875979a99fba9d7c00fd9eb7da316d88596dc
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 09:23:58 2004 +0000
+
+    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit c3ee38aec0f064a3916ecef9a29ecf6538a794a1
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:29:03 2003 +0000
+
+    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit ee11b04c48b57b74beacd0a905fbc96a86c75931
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:58 2003 +0000
+
+    XFree86 4.3.0.1
+
+commit 76312369bde4267f6405a4e1d26697258cc06b32
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:58 2003 +0000
+
+    Initial revision
+
+commit d7d99c8433b3bd35c8bad352ebd1fc49cff45264
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 15:54:53 2003 +0000
+
+    R6.6 is the Xorg base-line
diff --git a/x11perf/INSTALL b/x11perf/INSTALL
new file mode 100755 (executable)
index 0000000..8b82ade
--- /dev/null
@@ -0,0 +1,291 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008 Free Software Foundation, Inc.
+
+   This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+   Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package.  The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.
+
+     Running `configure' might take a while.  While running, it prints
+     some messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+  6. Often, you can also type `make uninstall' to remove the installed
+     files again.
+
+Compilers and Options
+=====================
+
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+   You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you can use GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory.  After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+   On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor.  Like
+this:
+
+     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CPP="gcc -E" CXXCPP="g++ -E"
+
+   This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+   By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+   Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Particular systems
+==================
+
+   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+     ./configure CC="cc -Ae"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
+a workaround.  If GNU CC is not installed, it is therefore recommended
+to try
+
+     ./configure CC="cc"
+
+and if that doesn't work, try
+
+     ./configure CC="cc -nodtk"
+
+Specifying the System Type
+==========================
+
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+   Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug.  Until the bug is fixed you can use this workaround:
+
+     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+   `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+     Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+     Print a summary of the options unique to this package's
+     `configure', and exit.  The `short' variant lists options used
+     only in the top level, while the `recursive' variant lists options
+     also present in any nested packages.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+     Use DIR as the installation prefix.  *Note Installation Names::
+     for more details, including other options available for fine-tuning
+     the installation locations.
+
+`--no-create'
+`-n'
+     Run the configure checks, but stop before creating any output
+     files.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/x11perf/Makefile.am b/x11perf/Makefile.am
new file mode 100755 (executable)
index 0000000..c14391c
--- /dev/null
@@ -0,0 +1,92 @@
+# 
+#  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 = x11perf
+
+bin_SCRIPTS = x11perfcomp
+
+LIBPATH = $(libdir)/X11/x11perfcomp
+
+x11perfcompdir = $(LIBPATH)
+dist_x11perfcomp_SCRIPTS = fillblnk perfboth perfratio Xmark
+
+AM_CFLAGS = $(CWARNFLAGS) $(XEXT_CFLAGS) $(XFT_CFLAGS) $(XRENDER_CFLAGS) $(X11PERF_CFLAGS)
+x11perf_LDADD = $(XEXT_LIBS) $(XFT_LIBS) $(XRENDER_LIBS) $(X11PERF_LIBS) -lm
+
+x11perf_SOURCES =      \
+        bitmaps.c \
+        bitmaps.h \
+        do_arcs.c \
+        do_blt.c \
+        do_complex.c \
+        do_dots.c \
+        do_lines.c \
+        do_movewin.c \
+        do_rects.c \
+        do_segs.c \
+        do_simple.c \
+        do_tests.c \
+        do_text.c \
+        do_traps.c \
+        do_tris.c \
+        do_valgc.c \
+        do_windows.c \
+        x11perf.c \
+        x11perf.h
+
+appman_PRE = \
+        x11perfcomp.man \
+        x11perf.man \
+        Xmark.man
+
+x11perfcomp: x11pcomp.cpp
+       $(AM_V_GEN)$(SED) s/LIBPATH/`echo $(LIBPATH) | sed -e s/\\\\//\\\\\\\\\\\\\//g`/ < $(srcdir)/x11pcomp.cpp | \
+               $(SED) s/XCOMM/\#/ > $@
+
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+CLEANFILES = $(bin_SCRIPTS) x11perfcomp
+
+EXTRA_DIST = x11pcomp.cpp
+
+appmandir = $(APP_MAN_DIR)
+
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+
+EXTRA_DIST += $(appman_PRE)
+CLEANFILES += $(appman_DATA)
+
+SUFFIXES = .$(APP_MAN_SUFFIX) .man
+
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
+.man.$(APP_MAN_SUFFIX):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/x11perf/Makefile.in b/x11perf/Makefile.in
new file mode 100755 (executable)
index 0000000..27ced70
--- /dev/null
@@ -0,0 +1,885 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = x11perf$(EXEEXT)
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(dist_x11perfcomp_SCRIPTS) \
+       $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+       $(srcdir)/config.h.in $(top_srcdir)/configure COPYING \
+       ChangeLog INSTALL config.guess config.sub depcomp install-sh \
+       missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \
+       "$(DESTDIR)$(x11perfcompdir)" "$(DESTDIR)$(appmandir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_x11perf_OBJECTS = bitmaps.$(OBJEXT) do_arcs.$(OBJEXT) \
+       do_blt.$(OBJEXT) do_complex.$(OBJEXT) do_dots.$(OBJEXT) \
+       do_lines.$(OBJEXT) do_movewin.$(OBJEXT) do_rects.$(OBJEXT) \
+       do_segs.$(OBJEXT) do_simple.$(OBJEXT) do_tests.$(OBJEXT) \
+       do_text.$(OBJEXT) do_traps.$(OBJEXT) do_tris.$(OBJEXT) \
+       do_valgc.$(OBJEXT) do_windows.$(OBJEXT) x11perf.$(OBJEXT)
+x11perf_OBJECTS = $(am_x11perf_OBJECTS)
+am__DEPENDENCIES_1 =
+x11perf_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+SCRIPTS = $(bin_SCRIPTS) $(dist_x11perfcomp_SCRIPTS)
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(x11perf_SOURCES)
+DIST_SOURCES = $(x11perf_SOURCES)
+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@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+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@
+CHANGELOG_CMD = @CHANGELOG_CMD@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
+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@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_CMD = @INSTALL_CMD@
+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@
+MAKEINFO = @MAKEINFO@
+MAN_SUBSTS = @MAN_SUBSTS@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X11PERF_CFLAGS = @X11PERF_CFLAGS@
+X11PERF_LIBS = @X11PERF_LIBS@
+XEXT_CFLAGS = @XEXT_CFLAGS@
+XEXT_LIBS = @XEXT_LIBS@
+XFT_CFLAGS = @XFT_CFLAGS@
+XFT_LIBS = @XFT_LIBS@
+XORG_MAN_PAGE = @XORG_MAN_PAGE@
+XRENDER_CFLAGS = @XRENDER_CFLAGS@
+XRENDER_LIBS = @XRENDER_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__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@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+bin_SCRIPTS = x11perfcomp
+LIBPATH = $(libdir)/X11/x11perfcomp
+x11perfcompdir = $(LIBPATH)
+dist_x11perfcomp_SCRIPTS = fillblnk perfboth perfratio Xmark
+AM_CFLAGS = $(CWARNFLAGS) $(XEXT_CFLAGS) $(XFT_CFLAGS) $(XRENDER_CFLAGS) $(X11PERF_CFLAGS)
+x11perf_LDADD = $(XEXT_LIBS) $(XFT_LIBS) $(XRENDER_LIBS) $(X11PERF_LIBS) -lm
+x11perf_SOURCES = \
+        bitmaps.c \
+        bitmaps.h \
+        do_arcs.c \
+        do_blt.c \
+        do_complex.c \
+        do_dots.c \
+        do_lines.c \
+        do_movewin.c \
+        do_rects.c \
+        do_segs.c \
+        do_simple.c \
+        do_tests.c \
+        do_text.c \
+        do_traps.c \
+        do_tris.c \
+        do_valgc.c \
+        do_windows.c \
+        x11perf.c \
+        x11perf.h
+
+appman_PRE = \
+        x11perfcomp.man \
+        x11perf.man \
+        Xmark.man
+
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+CLEANFILES = $(bin_SCRIPTS) x11perfcomp $(appman_DATA)
+EXTRA_DIST = x11pcomp.cpp $(appman_PRE)
+appmandir = $(APP_MAN_DIR)
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+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) --foreign'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign 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)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+       @if test ! -f $@; then \
+         rm -f stamp-h1; \
+         $(MAKE) $(AM_MAKEFLAGS) 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) 
+       ($(am__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)'; test -n "$(bindir)" || list=; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p; \
+         then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+x11perf$(EXEEXT): $(x11perf_OBJECTS) $(x11perf_DEPENDENCIES) 
+       @rm -f x11perf$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(x11perf_OBJECTS) $(x11perf_LDADD) $(LIBS)
+install-binSCRIPTS: $(bin_SCRIPTS)
+       @$(NORMAL_INSTALL)
+       test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+       @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n' \
+           -e 'h;s|.*|.|' \
+           -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+             if (++n[d] == $(am__install_max)) { \
+               print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+           else { print "f", d "/" $$4, $$1 } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+            test -z "$$files" || { \
+              echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+              $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+            } \
+       ; done
+
+uninstall-binSCRIPTS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+       files=`for p in $$list; do echo "$$p"; done | \
+              sed -e 's,.*/,,;$(transform)'`; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+install-dist_x11perfcompSCRIPTS: $(dist_x11perfcomp_SCRIPTS)
+       @$(NORMAL_INSTALL)
+       test -z "$(x11perfcompdir)" || $(MKDIR_P) "$(DESTDIR)$(x11perfcompdir)"
+       @list='$(dist_x11perfcomp_SCRIPTS)'; test -n "$(x11perfcompdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n' \
+           -e 'h;s|.*|.|' \
+           -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+             if (++n[d] == $(am__install_max)) { \
+               print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+           else { print "f", d "/" $$4, $$1 } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+            test -z "$$files" || { \
+              echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(x11perfcompdir)$$dir'"; \
+              $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(x11perfcompdir)$$dir" || exit $$?; \
+            } \
+       ; done
+
+uninstall-dist_x11perfcompSCRIPTS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_x11perfcomp_SCRIPTS)'; test -n "$(x11perfcompdir)" || exit 0; \
+       files=`for p in $$list; do echo "$$p"; done | \
+              sed -e 's,.*/,,;$(transform)'`; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(x11perfcompdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(x11perfcompdir)" && rm -f $$files
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitmaps.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/do_arcs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/do_blt.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/do_complex.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/do_dots.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/do_lines.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/do_movewin.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/do_rects.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/do_segs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/do_simple.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/do_tests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/do_text.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/do_traps.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/do_tris.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/do_valgc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/do_windows.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x11perf.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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) '$<'`
+install-appmanDATA: $(appman_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)"
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \
+       done
+
+uninstall-appmanDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appmandir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appmandir)" && rm -f $$files
+
+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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       set x; \
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       $(am__remove_distdir)
+       test -d "$(distdir)" || mkdir "$(distdir)"
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$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
+       -test -n "$(am__skip_mode_fix)" \
+       || find "$(distdir)" -type d ! -perm -755 \
+               -exec chmod u+rwx,go+rx {} \; -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 $(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-lzma: distdir
+       tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+       $(am__remove_distdir)
+
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+       $(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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+       *.tar.bz2*) \
+         bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.lzma*) \
+         lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+       *.tar.Z*) \
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+       *.shar.gz*) \
+         GZIP=$(GZIP_ENV) gzip -dc $(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)
+       test -d $(distdir)/_build || exit 0; \
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && am__cwd=`pwd` \
+         && $(am__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 \
+         && cd "$$am__cwd" \
+         || exit 1
+       $(am__remove_distdir)
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+       @$(am__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) $(SCRIPTS) $(DATA) config.h
+installdirs:
+       for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(x11perfcompdir)" "$(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)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-appmanDATA install-dist_x11perfcompSCRIPTS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS install-binSCRIPTS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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-binSCRIPTS uninstall-dist_x11perfcompSCRIPTS
+
+.MAKE: all install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+       clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
+       dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \
+       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-binSCRIPTS install-data \
+       install-data-am install-dist_x11perfcompSCRIPTS install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+       tags uninstall uninstall-am uninstall-appmanDATA \
+       uninstall-binPROGRAMS uninstall-binSCRIPTS \
+       uninstall-dist_x11perfcompSCRIPTS
+
+
+x11perfcomp: x11pcomp.cpp
+       $(AM_V_GEN)$(SED) s/LIBPATH/`echo $(LIBPATH) | sed -e s/\\\\//\\\\\\\\\\\\\//g`/ < $(srcdir)/x11pcomp.cpp | \
+               $(SED) s/XCOMM/\#/ > $@
+
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
+.man.$(APP_MAN_SUFFIX):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
+
+# 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/x11perf/NEWS b/x11perf/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/x11perf/README b/x11perf/README
new file mode 100755 (executable)
index 0000000..8929e74
--- /dev/null
@@ -0,0 +1,24 @@
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+        http://lists.freedesktop.org/mailman/listinfo/xorg
+
+Please submit bug reports to the Xorg bugzilla:
+
+        https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+The master development code repository can be found at:
+
+        git://anongit.freedesktop.org/git/xorg/app/x11perf
+
+        http://cgit.freedesktop.org/xorg/app/x11perf
+
+For patch submission instructions, see:
+
+       http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
+For more information on the git code manager, see:
+
+        http://wiki.x.org/wiki/GitPage
+
diff --git a/x11perf/Xmark b/x11perf/Xmark
new file mode 100755 (executable)
index 0000000..691f705
--- /dev/null
@@ -0,0 +1,634 @@
+#! /bin/sh
+#
+############################################################
+#
+# Usage: Xmark datafile
+#
+############################################################
+#
+#
+# CHANGE HISTORY:
+#
+# X11perfcompDR  --  Creates a Digital Review compatible breakdown of 
+# x11perf v1.2 results as described in "Take Your Pick Of Graphics"
+# by John Montgomery, Digital Review, May 7th, 1990, Page 44. 
+# 8/30/90  v1.0 program created by Lonnie Mandigo 
+# 1/18/91  Modification by  Lonnie Mandigo
+#         Fixed a bug to include UCIRC in data.
+# 2/5/91   Modification by  Lonnie Mandigo
+#          Now removes sum.tmp file when finished.
+# 3/18/91  v1.01 Increased resolution to handle zero ratios.
+#          Minor aesethic cleanups and better error handling.
+#          Lonnie Mandigo and Jason Levitt (jason@cs.utexas.edu)
+# 3/4/93   Converted to Xmark by Bob Kuseski
+#          to produce a single number representing the ratio between 
+#         the xpc weighted averages of the output from x11perf Rev 1.3
+#         for the server under test and a SparcStation 1
+# 3/10/93  Changed to produce THREE output numbers and added bounds
+#         checking of input data.
+# 3/15/93  Removed usage of '-F' in grep for compatibility reasons
+# 3/16/93  Corrected usage of substr() and used two greps versus fgrep
+# 4/12/93  Eliminated use of functions and \n in echo
+#
+############################################################
+# Copyright (c) 1993 by Hewlett-Packard Company
+#
+# 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  the  copyright  notice  and  this  permission   notice  appear  in
+# supporting  documentation, and that the name of  Hewlett-Packard  not be
+# used in  advertising  or publicity  pertaining  to  distribution  of the
+# software without specific, written prior permission.
+#
+############################################################
+# Instructions:
+# 
+# Usage: Xmark datafile
+#
+# where: 'datafile' is created by running x11perf Rev 1.3
+# with the flags below:
+#
+#      x11perf -display mysystem:0.0 -v1.3 -rop GXcopy GXxor -all > datafile
+#   or
+#      x11perf -display mysystem:0.0 -v1.3 -rop GXcopy -all > datafile
+#      x11perf -display mysystem:0.0 -v1.3 -rop GXxor -all >> datafile
+#   or
+#      x11perf -display mysystem:0.0 -v1.3 -rop GXxor -all > datafile
+#      x11perf -display mysystem:0.0 -v1.3 -rop GXcopy -all >> datafile
+#
+# Xmark summarizes the results relative to the data contained in
+# the datafile.  Xmark writes to standard out, so if you want to
+# capture the output in a file, use:
+# 
+#   Xmark datafile > output.comp
+#
+# The 'output.comp' contains THREE numbers:
+#          - Weighted x11perf number of the server under test
+#          - Weighted x11perf number of the SparcStation 1
+#          - Xmark = the ratio of the above two numbers
+#
+# Note the SparcStation 1 number comes from a:
+#   X11R5 Xsun
+#   Standard with SunOS 4.1.2
+#   SunOs 4.1.2
+#   CG3 dumb Color Frame Buffer
+#
+############################################################
+############################################################
+
+# Cleanup on interrupt
+trap \
+"echo Interrupt: removing temporary files. >& 2 ;rm -f temp.$$ rates.$$ awkfile.$$; exit 1" 1 2 3 9 15
+
+# Must have only one file specified
+if [ "$#" -ne 1 ]
+then
+    echo "Usage: $0 datafile" >& 2
+    exit 1
+fi
+
+# Must be an ordinary file
+if [ ! -f "$1" ]
+then
+    echo "Error: data file does not exist or is not ordinary." >& 2
+    exit 1
+fi
+
+# See if the date file has the correct number of results.
+LC1=`grep trep "$1" | wc -l`
+LC2=441                # Number of test without Shared Memory Transport
+LC3=447                # Number of test with Shared Memory Transport
+
+if [ "$LC1" -ne "$LC2" ] && [ "$LC1" -ne "$LC3" ]
+then
+    echo "WARNING: datafile contains $LC1, not "$LC2" or "$LC3" 'trep' results;" >& 2
+    if [ "$LC1" -gt "$LC2" ]
+    then
+       echo "extra results are probably OK." >& 2
+       echo ""
+    fi
+fi
+DATA=$1
+
+grep trep $DATA                > temp.$$
+grep server $DATA      >> temp.$$
+
+# convert the averages to standard form.
+
+cat > awkfile.$$ <<'EOS'
+    BEGIN {
+       weight["10x10 rectangle"] = 37;
+       weight["Scroll 500x500 pixels"] = 33;
+       weight["100x100 rectangle"] = 32;
+       weight["10-pixel line segment"] = 31;
+       weight["10-pixel line"] = 30;
+       weight["PutImage 100x100 square"] = 30;
+       weight["Scroll 100x100 pixels"] = 29;
+       weight["PutImage 500x500 square"] = 29;
+       weight["500x500 rectangle"] = 29;
+       weight["100-pixel line"] = 28;
+       weight["Char in 60-char line (9x15)"] = 28;
+       weight["Char in 80-char image line (6x13)"] = 28;
+       weight["Char in 80-char line (6x13)"] = 27;
+       weight["Char in 80-char image line (TR 10)"] = 27;
+       weight["100-pixel line segment"] = 27;
+       weight["Char in 80-char line (TR 10)"] = 27;
+       weight["Char in 60-char image line (9x15)"] = 26;
+       weight["Copy 100x100 from pixmap to window"] = 26;
+       weight["Copy 500x500 from pixmap to window"] = 26;
+       weight["Char in 70-char line (8x13)"] = 24;
+       weight["500-pixel line"] = 24;
+       weight["Char in 20/40/20 line (6x13, TR 10)"] = 23;
+       weight["Char in 70-char image line (8x13)"] = 23;
+       weight["Change graphics context"] = 23;
+       weight["Copy 100x100 from window to window"] = 23;
+       weight["10-pixel horizontal line segment"] = 23;
+       weight["10-pixel vertical line segment"] = 23;
+       weight["Copy 500x500 from window to window"] = 22;
+       weight["Char in 30-char line (TR 24)"] = 22;
+       weight["Char16 in 40-char line (k14)"] = 22;
+       weight["500-pixel line segment"] = 22;
+       weight["Char in 30-char image line (TR 24)"] = 22;
+       weight["100-pixel horizontal line segment"] = 22;
+       weight["100-pixel vertical line segment"] = 22;
+       weight["Scroll 10x10 pixels"] = 21;
+       weight["Char16 in 40-char image line (k14)"] = 21;
+       weight["GetImage 500x500 square"] = 21;
+       weight["PutImage 10x10 square"] = 20;
+       weight["GetImage 100x100 square"] = 20;
+       weight["Move window (4 kids)"] = 20;
+       weight["Copy 10x10 from pixmap to window"] = 20;
+       weight["100x100 4x4 tiled rectangle"] = 20;
+       weight["Copy 100x100 from window to pixmap"] = 19;
+       weight["Hide/expose window via popup (4 kids)"] = 19;
+       weight["Copy 500x500 from window to pixmap"] = 19;
+       weight["500-pixel horizontal line segment"] = 19;
+       weight["500-pixel vertical line segment"] = 19;
+       weight["Fill 10x10 equivalent triangle"] = 19;
+       weight["Char16 in 23-char line (k24)"] = 19;
+       weight["1x1 rectangle"] = 19;
+       weight["Char16 in 7/14/7 line (k14, k24)"] = 18;
+       weight["10x10 4x4 tiled rectangle"] = 18;
+       weight["100-pixel line segment (1 kid)"] = 18;
+       weight["100x100 rectangle outline"] = 18;
+       weight["Move window via parent (4 kids)"] = 18;
+       weight["GetAtomName"] = 18;
+       weight["GetProperty"] = 18;
+       weight["Char16 in 23-char image line (k24)"] = 18;
+       weight["100-pixel line segment (3 kids)"] = 17;
+       weight["Resize window (4 kids)"] = 17;
+       weight["Map window via parent (4 kids)"] = 17;
+       weight["Copy 100x100 from pixmap to pixmap"] = 17;
+       weight["Unmap window via parent (4 kids)"] = 17;
+       weight["100-pixel line segment (2 kids)"] = 17;
+       weight["10-pixel solid circle"] = 17;
+       weight["1-pixel line"] = 17;
+       weight["Move window (16 kids)"] = 16;
+       weight["Fill 100x100 equivalent triangle"] = 16;
+       weight["Hide/expose window via popup (16 kids)"] = 16;
+       weight["Move window via parent (16 kids)"] = 16;
+       weight["10x10 rectangle outline"] = 16;
+       weight["Destroy window via parent (4 kids)"] = 16;
+       weight["Create unmapped window (4 kids)"] = 16;
+       weight["Copy 10x10 from window to window"] = 16;
+       weight["Copy 100x100 1-bit deep plane"] = 16;
+       weight["10-pixel circle"] = 16;
+       weight["100x100 opaque stippled rectangle"] = 16;
+       weight["500x500 4x4 tiled rectangle"] = 16;
+       weight["100x100 stippled rectangle"] = 16;
+       weight["Copy 500x500 from pixmap to pixmap"] = 16;
+       weight["Create and map subwindows (16 kids)"] = 16;
+       weight["10x10 stippled rectangle"] = 16;
+       weight["Resize window (16 kids)"] = 16;
+       weight["Map window via parent (16 kids)"] = 15;
+       weight["100-pixel solid circle"] = 15;
+       weight["Copy 500x500 1-bit deep plane"] = 15;
+       weight["500x500 rectangle outline"] = 15;
+       weight["Create and map subwindows (4 kids)"] = 15;
+       weight["Destroy window via parent (16 kids)"] = 15;
+       weight["10x1 wide horizontal line segment"] = 15;
+       weight["10x1 wide vertical line segment"] = 15;
+       weight["100x100 161x145 tiled rectangle"] = 15;
+       weight["1-pixel line segment"] = 15;
+       weight["Unmap window via parent (16 kids)"] = 15;
+       weight["Fill 100x100 trapezoid"] = 14;
+       weight["100-pixel circle"] = 14;
+       weight["10x10 opaque stippled rectangle"] = 14;
+       weight["100-pixel dashed line"] = 14;
+       weight["500x500 161x145 tiled rectangle"] = 14;
+       weight["Copy 10x10 from window to pixmap"] = 14;
+       weight["100x10 wide horizontal line segment"] = 14;
+       weight["100x10 wide vertical line segment"] = 14;
+       weight["100x100 wide rectangle outline"] = 14;
+       weight["100x100 216x208 tiled rectangle"] = 14;
+       weight["Dot"] = 14;
+       weight["10x10 161x145 tiled rectangle"] = 14;
+       weight["Fill 100x100 equivalent complex polygons"] = 14;
+       weight["Move window (50 kids)"] = 13;
+       weight["Move window via parent (50 kids)"] = 13;
+       weight["Circulate window (16 kids)"] = 13;
+       weight["100-pixel dashed segment"] = 13;
+       weight["Create and map subwindows (50 kids)"] = 13;
+       weight["Create and map subwindows (25 kids)"] = 13;
+       weight["10x10 wide rectangle outline"] = 13;
+       weight["500x500 216x208 tiled rectangle"] = 13;
+       weight["Hide/expose window via popup (25 kids)"] = 13;
+       weight["Create and map subwindows (100 kids)"] = 13;
+       weight["Map window via parent (50 kids)"] = 13;
+       weight["Fill 10x10 trapezoid"] = 13;
+       weight["100x10 wide line"] = 13;
+       weight["10x10 216x208 tiled rectangle"] = 13;
+       weight["10-pixel dashed line"] = 13;
+       weight["Map window via parent (100 kids)"] = 13;
+       weight["Copy 10x10 from pixmap to pixmap"] = 13;
+       weight["Map window via parent (25 kids)"] = 13;
+       weight["Create unmapped window (25 kids)"] = 13;
+       weight["Move window (25 kids)"] = 13;
+       weight["Circulate window (4 kids)"] = 12;
+       weight["Move window via parent (25 kids)"] = 12;
+       weight["Create unmapped window (16 kids)"] = 12;
+       weight["Create and map subwindows (75 kids)"] = 12;
+       weight["500x500 opaque stippled rectangle"] = 12;
+       weight["Hide/expose window via popup (100 kids)"] = 12;
+       weight["Create and map subwindows (200 kids)"] = 12;
+       weight["Hide/expose window via popup (50 kids)"] = 12;
+       weight["500x50 wide horizontal line segment"] = 12;
+       weight["500x50 wide vertical line segment"] = 12;
+       weight["100x100 161x145 opaque stippled rectangle"] = 12;
+       weight["Resize window (25 kids)"] = 12;
+       weight["Map window via parent (200 kids)"] = 12;
+       weight["10x10 161x145 opaque stippled rectangle"] = 12;
+       weight["X protocol NoOperation"] = 12;
+       weight["10-pixel dashed segment"] = 12;
+       weight["Resize unmapped window (16 kids)"] = 12;
+       weight["Create unmapped window (100 kids)"] = 12;
+       weight["Fill 10x10 equivalent complex polygon"] = 12;
+       weight["Map window via parent (75 kids)"] = 12;
+       weight["100x100 161x145 stippled rectangle"] = 12;
+       weight["Moved unmapped window (16 kids)"] = 12;
+       weight["Copy 10x10 1-bit deep plane"] = 12;
+       weight["Unmap window via parent (50 kids)"] = 12;
+       weight["GetImage 10x10 square"] = 12;
+       weight["Fill 100x100 tiled trapezoid"] = 12;
+       weight["500x500 wide rectangle outline"] = 12;
+       weight["Fill 100x100 stippled trapezoid"] = 12;
+       weight["500x500 stippled rectangle"] = 12;
+       weight["Moved unmapped window (4 kids)"] = 12;
+       weight["10x10 161x145 stippled rectangle"] = 12;
+       weight["Unmap window via parent (25 kids)"] = 12;
+       weight["500-pixel solid circle"] = 12;
+       weight["Create unmapped window (50 kids)"] = 12;
+       weight["Destroy window via parent (25 kids)"] = 11;
+       weight["Resize window (200 kids)"] = 11;
+       weight["100-pixel filled ellipse"] = 11;
+       weight["Hide/expose window via popup (200 kids)"] = 11;
+       weight["Unmap window via parent (100 kids)"] = 11;
+       weight["Circulate window (25 kids)"] = 11;
+       weight["Resize window (50 kids)"] = 11;
+       weight["Hide/expose window via popup (75 kids)"] = 11;
+       weight["Destroy window via parent (100 kids)"] = 11;
+       weight["Destroy window via parent (50 kids)"] = 11;
+       weight["Create unmapped window (200 kids)"] = 11;
+       weight["Fill 100x100 opaque stippled trapezoid"] = 11;
+       weight["Move window via parent (75 kids)"] = 11;
+       weight["500-pixel filled ellipse"] = 11;
+       weight["Resize unmapped window (4 kids)"] = 11;
+       weight["Move window via parent (200 kids)"] = 11;
+       weight["Move window (75 kids)"] = 11;
+       weight["Fill 10x10 tiled trapezoid"] = 11;
+       weight["Fill 100x100 161x145 stippled trapezoid"] = 11;
+       weight["Move window (200 kids)"] = 11;
+       weight["Fill 10x10 stippled trapezoid"] = 11;
+       weight["Create unmapped window (75 kids)"] = 11;
+       weight["100-pixel fill chord partial circle"] = 10;
+       weight["Circulate Unmapped window (16 kids)"] = 10;
+       weight["Circulate window (50 kids)"] = 10;
+       weight["Move window (100 kids)"] = 10;
+       weight["Circulate window (100 kids)"] = 10;
+       weight["Move window via parent (100 kids)"] = 10;
+       weight["500x50 wide line"] = 10;
+       weight["500-pixel circle"] = 10;
+       weight["100-pixel double-dashed line"] = 10;
+       weight["Unmap window via parent (200 kids)"] = 10;
+       weight["Moved unmapped window (50 kids)"] = 10;
+       weight["10-pixel filled ellipse"] = 10;
+       weight["Resize window (75 kids)"] = 10;
+       weight["Fill 100x100 161x145 tiled trapezoid"] = 10;
+       weight["500x500 161x145 opaque stippled rectangle"] = 10;
+       weight["Fill 100x100 161x145 opaque stippled trapezoid"] = 10;
+       weight["Unmap window via parent (75 kids)"] = 10;
+       weight["Resize unmapped window (25 kids)"] = 10;
+       weight["100-pixel ellipse"] = 10;
+       weight["Destroy window via parent (75 kids)"] = 10;
+       weight["Fill 1x1 equivalent triangle"] = 10;
+       weight["500-pixel ellipse"] = 10;
+       weight["Fill 10x10 opaque stippled trapezoid"] = 10;
+       weight["Resize window (100 kids)"] = 10;
+       weight["500x500 161x145 stippled rectangle"] = 10;
+       weight["Destroy window via parent (200 kids)"] = 10;
+       weight["100-pixel fill slice partial circle"] = 10;
+       weight["Fill 100x100 216x208 tiled trapezoid"] = 9;
+       weight["100-pixel wide circle"] = 9;
+       weight["Moved unmapped window (25 kids)"] = 9;
+       weight["10x1 wide line"] = 9;
+       weight["Resize unmapped window (100 kids)"] = 9;
+       weight["100-pixel double-dashed segment"] = 9;
+       weight["10-pixel fill chord partial circle"] = 9;
+       weight["Circulate window (75 kids)"] = 9;
+       weight["100-pixel partial circle"] = 9;
+       weight["Circulate window (200 kids)"] = 9;
+       weight["Fill 10x10 161x145 stippled trapezoid"] = 9;
+       weight["Circulate Unmapped window (4 kids)"] = 9;
+       weight["100-pixel dashed circle"] = 9;
+       weight["Circulate Unmapped window (25 kids)"] = 9;
+       weight["10-pixel ellipse"] = 9;
+       weight["Resize unmapped window (50 kids)"] = 9;
+       weight["100-pixel partial ellipse"] = 9;
+       weight["Fill 10x10 161x145 tiled trapezoid"] = 8;
+       weight["100x10 wide dashed line"] = 8;
+       weight["10-pixel partial circle"] = 8;
+       weight["100-pixel wide ellipse"] = 8;
+       weight["Fill 10x10 161x145 opaque stippled trapezoid"] = 8;
+       weight["100-pixel wide partial circle"] = 8;
+       weight["Moved unmapped window (75 kids)"] = 8;
+       weight["Resize unmapped window (75 kids)"] = 8;
+       weight["Circulate Unmapped window (100 kids)"] = 8;
+       weight["100-pixel fill slice partial ellipse"] = 8;
+       weight["100x10 wide double-dashed line"] = 8;
+       weight["10-pixel fill slice partial circle"] = 8;
+       weight["100-pixel dashed ellipse"] = 8;
+       weight["100-pixel fill chord partial ellipse"] = 8;
+       weight["100-pixel wide dashed circle"] = 8;
+       weight["100-pixel double-dashed circle"] = 8;
+       weight["Fill 10x10 216x208 tiled trapezoid"] = 7;
+       weight["Moved unmapped window (100 kids)"] = 7;
+       weight["10-pixel wide circle"] = 7;
+       weight["Moved unmapped window (200 kids)"] = 7;
+       weight["Resize unmapped window (200 kids)"] = 7;
+       weight["Circulate Unmapped window (50 kids)"] = 7;
+       weight["1-pixel circle"] = 7;
+       weight["10-pixel partial ellipse"] = 7;
+       weight["500-pixel wide circle"] = 7;
+       weight["500-pixel wide ellipse"] = 7;
+       weight["100-pixel wide partial ellipse"] = 7;
+       weight["Circulate Unmapped window (75 kids)"] = 7;
+       weight["100-pixel wide dashed ellipse"] = 7;
+       weight["100-pixel double-dashed ellipse"] = 7;
+       weight["10-pixel wide ellipse"] = 6;
+       weight["10-pixel wide partial circle"] = 6;
+       weight["1-pixel solid circle"] = 6;
+       weight["100-pixel wide double-dashed circle"] = 6;
+       weight["Circulate Unmapped window (200 kids)"] = 6;
+       weight["1x1 4x4 tiled rectangle"] = 6;
+       weight["10-pixel wide partial ellipse"] = 6;
+       weight["10-pixel fill chord partial ellipse"] = 6;
+       weight["10-pixel fill slice partial ellipse"] = 6;
+       weight["100-pixel wide double-dashed ellipse"] = 5;
+       weight["1x1 161x145 tiled rectangle"] = 5;
+       weight["1x1 216x208 tiled rectangle"] = 5;
+       weight["1x1 stippled rectangle"] = 5;
+       weight["1x1 opaque stippled rectangle"] = 4;
+       weight["1x1 161x145 opaque stippled rectangle"] = 4;
+       weight["1x1 161x145 stippled rectangle"] = 4;
+       weight["ShmPutImage 10x10 square"] = 0;
+       weight["ShmPutImage 100x100 square"] = 0;
+       weight["ShmPutImage 500x500 square"] = 0;
+       weight["(xor) 100-pixel line"] = 16;
+       weight["(xor) 10-pixel line segment"] = 14;
+       weight["(xor) 10-pixel line"] = 13;
+       weight["(xor) 100-pixel line segment"] = 13;
+       weight["(xor) 500-pixel line segment"] = 13;
+       weight["(xor) 500-pixel line"] = 12;
+       weight["(xor) 10x10 rectangle"] = 12;
+       weight["(xor) 100x100 rectangle"] = 12;
+       weight["(xor) 100-pixel vertical line segment"] = 10;
+       weight["(xor) 100x100 rectangle outline"] = 10;
+       weight["(xor) 100-pixel horizontal line segment"] = 10;
+       weight["(xor) 10-pixel vertical line segment"] = 10;
+       weight["(xor) 100-pixel line segment (2 kids)"] = 10;
+       weight["(xor) 10-pixel horizontal line segment"] = 10;
+       weight["(xor) 100-pixel line segment (1 kid)"] = 9;
+       weight["(xor) Char in 80-char line (6x13)"] = 9;
+       weight["(xor) 500-pixel vertical line segment"] = 9;
+       weight["(xor) Copy 100x100 from pixmap to window"] = 9;
+       weight["(xor) 10x10 rectangle outline"] = 9;
+       weight["(xor) 500-pixel horizontal line segment"] = 9;
+       weight["(xor) 100-pixel line segment (3 kids)"] = 9;
+       weight["(xor) PutImage 100x100 square"] = 9;
+       weight["(xor) 500x500 rectangle outline"] = 9;
+       weight["(xor) Char in 80-char line (TR 10)"] = 9;
+       weight["(xor) 500x500 rectangle"] = 9;
+       weight["(xor) Copy 500x500 from pixmap to window"] = 8;
+       weight["(xor) Char in 20/40/20 line (6x13, TR 10)"] = 8;
+       weight["(xor) 100-pixel dashed line"] = 8;
+       weight["(xor) Copy 100x100 1-bit deep plane"] = 8;
+       weight["(xor) Char in 60-char line (9x15)"] = 8;
+       weight["(xor) Char16 in 40-char line (k14)"] = 7;
+       weight["(xor) Fill 10x10 equivalent triangle"] = 7;
+       weight["(xor) PutImage 500x500 square"] = 7;
+       weight["(xor) Copy 100x100 from window to window"] = 7;
+       weight["(xor) 100-pixel dashed segment"] = 7;
+       weight["(xor) 100x100 wide rectangle outline"] = 6;
+       weight["(xor) Char16 in 7/14/7 line (k14, k24)"] = 6;
+       weight["(xor) Fill 100x100 trapezoid"] = 6;
+       weight["(xor) 100-pixel solid circle"] = 6;
+       weight["(xor) 10-pixel solid circle"] = 6;
+       weight["(xor) 1-pixel line segment"] = 6;
+       weight["(xor) 1-pixel line"] = 6;
+       weight["(xor) 10x1 wide horizontal line segment"] = 6;
+       weight["(xor) 10x1 wide vertical line segment"] = 6;
+       weight["(xor) Copy 100x100 from pixmap to pixmap"] = 6;
+       weight["(xor) 10-pixel dashed line"] = 6;
+       weight["(xor) Char in 30-char line (TR 24)"] = 6;
+       weight["(xor) Fill 100x100 equivalent triangle"] = 6;
+       weight["(xor) Copy 10x10 from pixmap to window"] = 6;
+       weight["(xor) Fill 10x10 trapezoid"] = 6;
+       weight["(xor) Char in 70-char line (8x13)"] = 6;
+       weight["(xor) 100-pixel circle"] = 6;
+       weight["(xor) Copy 100x100 from window to pixmap"] = 6;
+       weight["(xor) 10-pixel dashed segment"] = 5;
+       weight["(xor) 10-pixel circle"] = 5;
+       weight["(xor) 10x10 wide rectangle outline"] = 5;
+       weight["(xor) 100x100 stippled rectangle"] = 5;
+       weight["(xor) 100-pixel filled ellipse"] = 5;
+       weight["(xor) 10x10 4x4 tiled rectangle"] = 5;
+       weight["(xor) PutImage 10x10 square"] = 5;
+       weight["(xor) Copy 500x500 from window to window"] = 5;
+       weight["(xor) 500x500 wide rectangle outline"] = 5;
+       weight["(xor) 10x10 stippled rectangle"] = 5;
+       weight["(xor) 100x10 wide line"] = 5;
+       weight["(xor) 100x10 wide horizontal line segment"] = 5;
+       weight["(xor) 100x10 wide vertical line segment"] = 5;
+       weight["(xor) Scroll 100x100 pixels"] = 5;
+       weight["(xor) Char16 in 23-char line (k24)"] = 5;
+       weight["(xor) Dot"] = 5;
+       weight["(xor) Copy 500x500 1-bit deep plane"] = 5;
+       weight["(xor) 100-pixel ellipse"] = 5;
+       weight["(xor) 100x100 4x4 tiled rectangle"] = 5;
+       weight["(xor) Copy 10x10 1-bit deep plane"] = 5;
+       weight["(xor) 1x1 rectangle"] = 5;
+       weight["(xor) 500-pixel solid circle"] = 4;
+       weight["(xor) 500-pixel filled ellipse"] = 4;
+       weight["(xor) 10-pixel filled ellipse"] = 4;
+       weight["(xor) Fill 100x100 stippled trapezoid"] = 4;
+       weight["(xor) 500x50 wide line"] = 4;
+       weight["(xor) 500-pixel circle"] = 4;
+       weight["(xor) 100-pixel double-dashed line"] = 4;
+       weight["(xor) 500x50 wide horizontal line segment"] = 4;
+       weight["(xor) 500x50 wide vertical line segment"] = 4;
+       weight["(xor) 100-pixel dashed circle"] = 4;
+       weight["(xor) 10x10 opaque stippled rectangle"] = 4;
+       weight["(xor) 10-pixel ellipse"] = 4;
+       weight["(xor) Copy 500x500 from pixmap to pixmap"] = 4;
+       weight["(xor) 100x100 161x145 stippled rectangle"] = 4;
+       weight["(xor) 10x10 161x145 tiled rectangle"] = 4;
+       weight["(xor) Copy 10x10 from window to window"] = 4;
+       weight["(xor) Copy 10x10 from pixmap to pixmap"] = 4;
+       weight["(xor) 10x10 161x145 stippled rectangle"] = 4;
+       weight["(xor) 100-pixel wide circle"] = 4;
+       weight["(xor) 500x500 stippled rectangle"] = 4;
+       weight["(xor) 500-pixel ellipse"] = 4;
+       weight["(xor) 10x10 216x208 tiled rectangle"] = 4;
+       weight["(xor) Fill 100x100 equivalent complex polygons"] = 4;
+       weight["(xor) 100-pixel double-dashed segment"] = 3;
+       weight["(xor) 10x10 161x145 opaque stippled rectangle"] = 3;
+       weight["(xor) Fill 10x10 opaque stippled trapezoid"] = 3;
+       weight["(xor) 100-pixel partial circle"] = 3;
+       weight["(xor) Fill 10x10 161x145 stippled trapezoid"] = 3;
+       weight["(xor) Fill 10x10 161x145 opaque stippled trapezoid"] = 3;
+       weight["(xor) Scroll 500x500 pixels"] = 3;
+       weight["(xor) 100x100 opaque stippled rectangle"] = 3;
+       weight["(xor) Fill 10x10 stippled trapezoid"] = 3;
+       weight["(xor) 100x10 wide dashed line"] = 3;
+       weight["(xor) Copy 10x10 from window to pixmap"] = 3;
+       weight["(xor) Copy 500x500 from window to pixmap"] = 3;
+       weight["(xor) 500x500 opaque stippled rectangle"] = 3;
+       weight["(xor) Fill 10x10 tiled trapezoid"] = 3;
+       weight["(xor) 100x100 161x145 tiled rectangle"] = 3;
+       weight["(xor) 100-pixel partial ellipse"] = 3;
+       weight["(xor) 100-pixel fill slice partial circle"] = 3;
+       weight["(xor) Fill 1x1 equivalent triangle"] = 3;
+       weight["(xor) 100-pixel double-dashed circle"] = 3;
+       weight["(xor) 500x500 4x4 tiled rectangle"] = 3;
+       weight["(xor) 100-pixel wide ellipse"] = 3;
+       weight["(xor) 100-pixel fill chord partial circle"] = 3;
+       weight["(xor) 100x100 216x208 tiled rectangle"] = 3;
+       weight["(xor) Fill 10x10 161x145 tiled trapezoid"] = 3;
+       weight["(xor) Fill 100x100 216x208 tiled trapezoid"] = 3;
+       weight["(xor) 500x500 161x145 stippled rectangle"] = 3;
+       weight["(xor) 500x500 161x145 tiled rectangle"] = 3;
+       weight["(xor) 100x100 161x145 opaque stippled rectangle"] = 3;
+       weight["(xor) 500x500 161x145 opaque stippled rectangle"] = 3;
+       weight["(xor) 10x1 wide line"] = 3;
+       weight["(xor) 500x500 216x208 tiled rectangle"] = 3;
+       weight["(xor) 100-pixel dashed ellipse"] = 3;
+       weight["(xor) Fill 100x100 opaque stippled trapezoid"] = 3;
+       weight["(xor) 10-pixel partial circle"] = 3;
+       weight["(xor) 100x10 wide double-dashed line"] = 3;
+       weight["(xor) Fill 100x100 161x145 stippled trapezoid"] = 3;
+       weight["(xor) Fill 100x100 161x145 opaque stippled trapezoid"] = 3;
+       weight["(xor) 100-pixel fill slice partial ellipse"] = 3;
+       weight["(xor) 1-pixel circle"] = 3;
+       weight["(xor) Fill 10x10 equivalent complex polygon"] = 3;
+       weight["(xor) 100-pixel wide dashed circle"] = 2;
+       weight["(xor) 100-pixel wide double-dashed circle"] = 2;
+       weight["(xor) Scroll 10x10 pixels"] = 2;
+       weight["(xor) 10-pixel wide circle"] = 2;
+       weight["(xor) 100-pixel fill chord partial ellipse"] = 2;
+       weight["(xor) Fill 100x100 tiled trapezoid"] = 2;
+       weight["(xor) 100-pixel double-dashed ellipse"] = 2;
+       weight["(xor) 100-pixel wide dashed ellipse"] = 2;
+       weight["(xor) 100-pixel wide double-dashed ellipse"] = 2;
+       weight["(xor) 10-pixel partial ellipse"] = 2;
+       weight["(xor) 100-pixel wide partial circle"] = 2;
+       weight["(xor) 100-pixel wide partial ellipse"] = 2;
+       weight["(xor) 10-pixel fill slice partial circle"] = 2;
+       weight["(xor) 10-pixel wide ellipse"] = 2;
+       weight["(xor) Fill 100x100 161x145 tiled trapezoid"] = 2;
+       weight["(xor) Fill 10x10 216x208 tiled trapezoid"] = 2;
+       weight["(xor) 10-pixel fill chord partial circle"] = 2;
+       weight["(xor) 500-pixel wide circle"] = 2;
+       weight["(xor) 500-pixel wide ellipse"] = 2;
+       weight["(xor) 1-pixel solid circle"] = 2;
+       weight["(xor) 10-pixel fill chord partial ellipse"] = 2;
+       weight["(xor) 10-pixel fill slice partial ellipse"] = 2;
+       weight["(xor) 10-pixel wide partial circle"] = 1;
+       weight["(xor) 10-pixel wide partial ellipse"] = 1;
+       weight["(xor) 1x1 stippled rectangle"] = 1;
+       weight["(xor) 1x1 161x145 stippled rectangle"] = 1;
+       weight["(xor) 1x1 opaque stippled rectangle"] = 1;
+       weight["(xor) 1x1 161x145 opaque stippled rectangle"] = 1;
+       weight["(xor) 1x1 4x4 tiled rectangle"] = 1;
+       weight["(xor) 1x1 161x145 tiled rectangle"] = 1;
+       weight["(xor) 1x1 216x208 tiled rectangle"] = 1;
+       weight["(xor) ShmPutImage 10x10 square"] = 0;
+       weight["(xor) ShmPutImage 100x100 square"] = 0;
+       weight["(xor) ShmPutImage 500x500 square"] = 0;
+       sumofweights = 0;
+    }
+    $0 ~ /server/ {
+       printf("name:%s\n",substr($0,1,index($0,"server")-2));
+    }
+    {
+       split($0,parts,":");                    # get rate and name
+       start = index(parts[1],"(") + 1;        # find left parentheses
+       end = index(parts[1],"/");              # find terminating '/'
+       rate = substr(parts[1],start,end-start);# get ops/sec
+
+       name = parts[2];
+       while (substr(name,1,1) == " ") {       # remove leading spaces
+           name = substr(name,2,length(name));
+       }
+
+       thisweight = weight[name];
+       weight[name] = 0;                       # clear to avoid double counting
+       sumofweights += thisweight;
+       printf("%d:",thisweight);               # output in new format
+       printf("%.1f\n",rate);
+    }
+    END{
+       printf("sumof:%.1f\n",sumofweights);
+    }
+EOS
+
+awk -f awkfile.$$ temp.$$ > rates.$$
+rm -f awkfile.$$                               # cleanup
+
+# calculate the weighted average 
+
+sumofweights=`grep sumof rates.$$ | awk -F: ' { print($2) }' - `
+if [ "$sumofweights" != "4566.0" ]
+then
+    echo "ERROR: sum of weights =$sumofweights, not equal to 4566.0;"
+    echo "ABORTING!"
+    rm -f rates.$$ temp.$$
+    exit 1
+fi
+
+awk -F: '
+    BEGIN {
+       logsum = 0;
+       name = "tested"
+    }
+    $1 == "name" { name = $2;next }
+    {
+       weight = $1;
+       rate = $2;
+       if (rate > 0.0) {
+           # generate weighted log sum
+           logsum += ( log( rate ) * weight );
+       }
+    }
+    END {
+       SparcStation1 = 2118.51;
+       WeightedAverage = exp(logsum/4566.0);
+       printf("Weighted x11perf of %s server =%6.0f\n", name,WeightedAverage);
+       printf("Weighted x11perf of SparcStation 1 server =%5.0f\n", SparcStation1);
+       printf("Xmark =%8.4f\n", WeightedAverage/SparcStation1);
+    }' rates.$$        
+
+rm -f temp.$$ rates.$$ awkfile.$$                      # cleanup
+
+exit 0
diff --git a/x11perf/Xmark.man b/x11perf/Xmark.man
new file mode 100755 (executable)
index 0000000..a5c30d5
--- /dev/null
@@ -0,0 +1,66 @@
+.\" This manpage was written by Richard Braakman and is licensed under the
+.\" XFree86 license.
+.TH Xmark 1 __xorgversion__
+.SH NAME
+Xmark \- summarize x11perf results
+.SH SYNTAX
+.B Xmark
+datafile
+.SH DESCRIPTION
+.B Xmark
+is a shell script that reads the indicated datafile and compiles a
+benchmark which it writes to standard output.  It writes three
+numbers:
+.PP
+.RS
+A weighted performance number for the
+.I x11perf
+results.
+.PP
+A weighted performance number for a standard SparcStation 1, with
+SunOS 4.1.2, X11R5 Xsun, and a CG3 dumb Color Frame Buffer.
+.\" I assume the latter is a graphics card.
+.PP
+The Xmark, which is the ratio of the two numbers above.
+.RE
+.PP
+The datafile must be an ordinary file, produced by x11perf in the
+following way:
+.PP
+.BI "x11perf -display " display " -v1.3 -rop GXcopy GXxor -all > " datafile
+.PP
+It is possible to run the GXcopy and GXxor tests separately, as long as they
+are concatenated to the same output file:
+.nf
+.BI "x11perf -display " display " -v1.3 -rop GXcopy -all > " datafile 
+.BI "x11perf -display " display " -v1.3 -rop GXxor -all >> " datafile 
+.fi
+or
+.nf
+.BI "x11perf -display " display " -v1.3 -rop GXxor -all > " datafile 
+.BI "x11perf -display " display " -v1.3 -rop GXcopy -all >> " datafile 
+.fi
+.SH FILES
+.TP
+.B temp.$$
+Temporary file created in the current directory, deleted after use.
+.SH DIAGNOSTICS
+.TP
+.B Usage: Xmark datafile
+.I Xmark
+was invoked without arguments or with more than one argument, or 
+with options.  Xmark takes no options.
+.TP
+.B "Error: data file does not exist or is not ordinary."
+.I Xmark
+cannot find the datafile named on its command line, or the datafile
+is a special file such as a directory.
+.TP
+.BR "WARNING: datafile contains " nnn ", not 441 or 447 'trep' results;"
+The file named on the command line does not seem to be a file generated
+by x11perf in the expected way.
+.TP
+.BR "Diagnostic: ERROR: sum of weights =" nnn ", not equal to 4566.0;"
+There is an internal error in Xmark.
+.SH "SEE ALSO"
+X(__miscmansuffix__), x11perf(1), x11perfcomp(1)
diff --git a/x11perf/aclocal.m4 b/x11perf/aclocal.m4
new file mode 100644 (file)
index 0000000..684599f
--- /dev/null
@@ -0,0 +1,1766 @@
+# generated automatically by aclocal 1.11 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009  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.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
+[m4_warning([this file was generated for autoconf 2.63.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# 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, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# 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])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+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, 2006, 2009
+# 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 10
+
+# 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], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$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
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    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, 2006, 2008, 2009 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 16
+
+# 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.62])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
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+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
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_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)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+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
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_AM_DEPENDENCIES(OBJC)],
+                 [define([AC_PROG_OBJC],
+                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# 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_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
+                         (and sometimes confusing) to the casual installer],
+      [USE_MAINTAINER_MODE=$enableval],
+      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  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, 2009  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_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.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
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+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, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# 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
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# 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, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _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],
+[m4_foreach_w([_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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# 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
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# 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) 2009  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 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# 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="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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
+
+dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
+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 ensure that this macro is defined, also add:
+# m4_ifndef([XORG_MACROS_VERSION],
+#     [m4_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.
+m4_defun([XORG_MACROS_VERSION],[
+m4_define([vers_have], [1.3.0])
+m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
+m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
+m4_if(m4_cmp(maj_have, maj_needed), 0,,
+    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
+m4_if(m4_version_compare(vers_have, [$1]), -1,
+    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
+m4_undefine([vers_have])
+m4_undefine([maj_have])
+m4_undefine([maj_needed])
+]) # 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])
+       # under Cygwin unix is still defined even with -undef
+       elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+               RAWCPPFLAGS="-undef -ansi"
+               AC_MSG_RESULT([yes, with -ansi])
+       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],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+
+if test x"$cross_compiling" = x"yes" ; then
+  HAVE_DEFS_ENT=no
+else
+  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+fi
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+AC_PATH_PROG(PS2PDF, ps2pdf)
+
+AC_MSG_CHECKING([Whether to build documentation])
+
+if test x$HAVE_DEFS_ENT != 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 && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([Whether to build text documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([Whether to build PDF documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([Whether to build PostScript documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([Whether to build HTML documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# 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,
+       AS_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, [AS_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, [AS_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
+
+# XORG_CWARNFLAGS
+# ---------------
+# Minimum version: 1.2.0
+#
+# Defines CWARNFLAGS to enable C compiler warnings.
+#
+AC_DEFUN([XORG_CWARNFLAGS], [
+AC_REQUIRE([AC_PROG_CC])
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+AC_SUBST(CWARNFLAGS)
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+]) # XORG_CWARNFLAGS
+
+# XORG_STRICT_OPTION
+# -----------------------
+# Minimum version: 1.3.0
+#
+# Add configure option to enable strict compilation
+AC_DEFUN([XORG_STRICT_OPTION], [
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CC_C99])
+AC_REQUIRE([XORG_CWARNFLAGS])
+
+AC_ARG_ENABLE(strict-compilation,
+                         AS_HELP_STRING([--enable-strict-compilation],
+                         [Enable all warnings from compiler and make them errors (default: disabled)]),
+                         [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
+if test "x$STRICT_COMPILE" = "xyes"; then
+       AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+       AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+AC_SUBST([CWARNFLAGS])
+]) # XORG_STRICT_OPTION
+
+# XORG_DEFAULT_OPTIONS
+# --------------------
+# Minimum version: 1.3.0
+#
+# Defines default options for X.Org modules.
+#
+AC_DEFUN([XORG_DEFAULT_OPTIONS], [
+XORG_CWARNFLAGS
+XORG_STRICT_OPTION
+XORG_RELEASE_VERSION
+XORG_CHANGELOG
+XORG_MANPAGE_SECTIONS
+]) # XORG_DEFAULT_OPTIONS
+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.  Also
+# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+AC_DEFUN([XORG_RELEASE_VERSION],[
+       AC_ARG_WITH(release-version,
+                       AS_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
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+               [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+               [Major version of this package])
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+               [$PVM],
+               [Minor version of this package])
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+               [$PVP],
+               [Patch version of this package])
+])
+
+# XORG_CHANGELOG()
+# ----------------
+# Minimum version: 1.2.0
+#
+# Defines the variable CHANGELOG_CMD as the command to generate
+# ChangeLog from git.
+#
+# Arrange that distcleancheck ignores ChangeLog left over by distclean.
+#
+AC_DEFUN([XORG_CHANGELOG], [
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
+mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+AC_SUBST([CHANGELOG_CMD])
+AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
+]) # XORG_CHANGELOG
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# 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 "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _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 --print-errors "$2" 2>&1`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       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 <http://pkg-config.freedesktop.org/>.])],
+               [$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
+
diff --git a/x11perf/bitmaps.c b/x11perf/bitmaps.c
new file mode 100755 (executable)
index 0000000..3dced5b
--- /dev/null
@@ -0,0 +1,875 @@
+/*****************************************************************************
+Copyright 1988, 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.
+
+******************************************************************************/
+
+#include "x11perf.h"
+#include "bitmaps.h"
+
+static unsigned char bitmap8x8[] = {
+    0xCC, 0x66, 0x33, 0x99, 0xCC, 0x66, 0x33, 0x99
+/* Alternate maps for testing out your stipple code.  Only the above should
+   be used for timing, though.
+    0x00, 0xfe, 0x92, 0x92, 0xfe, 0x92, 0x92, 0xfe
+    0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA
+*/
+};
+
+static unsigned char bitmap4x4[] = {
+   0x03, 0x06, 0x0c, 0x09
+};
+
+#define oddbit_width 17
+#define oddbit_height 15
+static unsigned char oddbit_bits[] = {
+   0x01, 0x00, 0x01, 0xc2, 0x87, 0x00, 0x34, 0x58, 0x00, 0x08, 0x20, 0x00,
+   0x38, 0x38, 0x00, 0x44, 0x44, 0x00, 0x84, 0x42, 0x00, 0x04, 0x41, 0x00,
+   0x84, 0x42, 0x00, 0x44, 0x44, 0x00, 0x28, 0x28, 0x00, 0x18, 0x30, 0x00,
+   0x34, 0x58, 0x00, 0xc2, 0x87, 0x00, 0x01, 0x00, 0x01};
+
+/* A big bitmap */
+#define mensetmanus_width 161
+#define mensetmanus_height 145
+
+static unsigned char mensetmanus_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00, 0x00,
+ 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x3f, 0xdb, 0x0f, 0x00, 0x00, 0x00, 0x80, 0x07,
+ 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf7, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x80, 0x61, 0x00, 0x00, 0xc6,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc3, 0xff,
+ 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xe1, 0xff, 0xff, 0x87, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc3, 0xf6, 0x1f, 0x00, 0x00,
+ 0x00, 0xc0, 0xc0, 0xff, 0xff, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x80, 0x9f, 0x65, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0x00,
+ 0x07, 0x80, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x9f, 0x6d, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xff, 0xff, 0xc7,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x89, 0x6d,
+ 0x1b, 0x00, 0x00, 0x00, 0xc0, 0xe0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x81, 0x6d, 0x1b, 0x00, 0x00,
+ 0x00, 0xc0, 0xe1, 0x5b, 0xdb, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xc0, 0x81, 0x6d, 0x1b, 0x00, 0x00, 0x00, 0x80, 0x83,
+ 0x5b, 0xdb, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xc0, 0x81, 0x6d, 0x1b, 0x00, 0x00, 0x00, 0x00, 0xcf, 0x5b, 0x1b, 0x0c,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x80, 0x6d,
+ 0x1b, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5b, 0x1b, 0x0c, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x80, 0x6d, 0x1b, 0x00, 0x00,
+ 0x00, 0x00, 0xf8, 0x5b, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xe0, 0x83, 0x6d, 0x19, 0x00, 0x00, 0x00, 0x00, 0x80,
+ 0x5b, 0x0b, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xe0, 0x83, 0x6d, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x80, 0x5b, 0x0f, 0x0e,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x6d,
+ 0x1b, 0x00, 0x00, 0x00, 0x00, 0x80, 0x4b, 0x0f, 0x07, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x79, 0x1b, 0x00, 0x00,
+ 0x00, 0x00, 0x80, 0x6b, 0xbf, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x03, 0xfb, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x80,
+ 0x6d, 0xb7, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x03, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xed, 0xf7, 0x07,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0xfe,
+ 0x7f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xed, 0xd7, 0x07, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x7f, 0xf8, 0xff, 0x07, 0x00,
+ 0x00, 0x00, 0xe0, 0xfe, 0xd7, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x80, 0xff, 0x7f, 0xe0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf0,
+ 0xff, 0xd6, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
+ 0xbf, 0x73, 0x80, 0x3b, 0x7c, 0x00, 0x00, 0x00, 0xf8, 0xe7, 0xd6, 0xef,
+ 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xb9, 0x73, 0xc0,
+ 0x3b, 0xf0, 0x01, 0x00, 0x00, 0xff, 0xc3, 0xbf, 0xe7, 0x3f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xb8, 0x7f, 0xe0, 0x3b, 0xc0, 0x03,
+ 0x00, 0xc0, 0xbf, 0xc7, 0xbf, 0xe7, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x1c, 0xb8, 0xff, 0xf8, 0x3b, 0x80, 0x07, 0x00, 0xe0, 0x61,
+ 0x87, 0xfd, 0xe7, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e,
+ 0xb8, 0xf3, 0xff, 0x3b, 0x00, 0x0f, 0x00, 0x78, 0x60, 0x8e, 0xf1, 0x67,
+ 0xc7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xb8, 0xc3, 0x8f,
+ 0x7b, 0x00, 0x0e, 0x00, 0x38, 0xe0, 0x8c, 0x03, 0x66, 0x87, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0xb8, 0x03, 0x83, 0x7b, 0x00, 0x1e,
+ 0x00, 0x1c, 0xe0, 0x1d, 0x03, 0x76, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xc0, 0x07, 0xb8, 0xe3, 0x8f, 0xbb, 0x01, 0x39, 0x00, 0x1e, 0xe0,
+ 0x3b, 0x03, 0xf6, 0x87, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f,
+ 0xb8, 0xe3, 0x8f, 0x3b, 0xc6, 0x38, 0x00, 0x17, 0xe0, 0x73, 0x07, 0xfe,
+ 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0b, 0xb8, 0xe7, 0x8e,
+ 0x3b, 0x38, 0x78, 0x00, 0x13, 0xe0, 0x77, 0x06, 0xfe, 0xff, 0xff, 0xff,
+ 0x0f, 0x00, 0x00, 0x00, 0xe0, 0x12, 0x3c, 0xff, 0xce, 0x3b, 0x00, 0x78,
+ 0x80, 0x13, 0x60, 0xef, 0x0e, 0xfe, 0x00, 0x00, 0x60, 0x08, 0x00, 0x00,
+ 0x00, 0x70, 0x22, 0x3e, 0xfc, 0xfe, 0x39, 0x00, 0xe8, 0x80, 0x61, 0x60,
+ 0xce, 0x0f, 0xfe, 0x00, 0x00, 0x60, 0xf8, 0x00, 0x00, 0x00, 0x70, 0xc2,
+ 0x39, 0xf8, 0x7e, 0x38, 0x00, 0xc8, 0xc0, 0x81, 0x71, 0xde, 0x0f, 0xfe,
+ 0x00, 0x00, 0x60, 0x88, 0x00, 0x00, 0x00, 0x70, 0x04, 0x38, 0xe0, 0x0e,
+ 0x38, 0x00, 0xc4, 0xc0, 0x01, 0x7e, 0xbc, 0x1f, 0xfe, 0x00, 0x00, 0x60,
+ 0x88, 0x00, 0x00, 0x00, 0x78, 0x04, 0x38, 0xe0, 0x0e, 0x38, 0x00, 0xc4,
+ 0xc1, 0x01, 0x60, 0x3c, 0x1f, 0xfe, 0x00, 0x00, 0x60, 0x84, 0x0f, 0x00,
+ 0x00, 0x78, 0x08, 0x38, 0xe0, 0x0f, 0x38, 0x00, 0x82, 0xe1, 0x01, 0x60,
+ 0x74, 0x3e, 0xfe, 0x00, 0x00, 0x60, 0x44, 0x08, 0x00, 0x00, 0xb8, 0x10,
+ 0x38, 0xe0, 0x0f, 0x38, 0x00, 0x81, 0xe1, 0x00, 0x60, 0xe4, 0x3e, 0xfe,
+ 0x00, 0x00, 0x60, 0x44, 0x08, 0x00, 0x00, 0x98, 0x20, 0x38, 0xf8, 0x3f,
+ 0x38, 0x80, 0x80, 0xe1, 0x01, 0x60, 0xc4, 0x3c, 0xfe, 0x00, 0x00, 0x60,
+ 0x24, 0x0c, 0x00, 0x00, 0x1c, 0xc1, 0x39, 0x3c, 0x78, 0x38, 0x40, 0x80,
+ 0x61, 0x01, 0x60, 0xc4, 0x79, 0xfe, 0x00, 0x00, 0x60, 0x22, 0x32, 0x00,
+ 0x00, 0x1c, 0x01, 0x3e, 0x1c, 0xf0, 0x38, 0xf0, 0x9f, 0x61, 0x01, 0x60,
+ 0x84, 0x7b, 0xee, 0x00, 0x00, 0x60, 0x12, 0x21, 0x00, 0x00, 0x1c, 0x02,
+ 0x38, 0x0e, 0xe7, 0xf8, 0x3f, 0xe0, 0x61, 0x00, 0x60, 0x04, 0xf7, 0xce,
+ 0x00, 0x00, 0x60, 0x92, 0x10, 0x00, 0x00, 0x1c, 0x04, 0x38, 0x06, 0xff,
+ 0x38, 0x40, 0x80, 0x61, 0x02, 0x60, 0x04, 0xe7, 0xcf, 0x00, 0x00, 0x60,
+ 0x8a, 0x18, 0x00, 0x00, 0x1c, 0x18, 0x38, 0x07, 0xf0, 0x38, 0x00, 0x81,
+ 0x61, 0x02, 0x60, 0x04, 0xee, 0xcf, 0xff, 0x03, 0x60, 0x49, 0xe4, 0x00,
+ 0x00, 0x1c, 0x70, 0x38, 0x07, 0xe7, 0x38, 0x00, 0x82, 0x61, 0x04, 0x60,
+ 0x04, 0xdc, 0xcf, 0x01, 0x04, 0x60, 0x25, 0x42, 0x00, 0x00, 0x1c, 0xfe,
+ 0x3f, 0x03, 0xff, 0x38, 0x00, 0x84, 0x61, 0x08, 0x60, 0x04, 0xfc, 0xcf,
+ 0xf8, 0xff, 0x60, 0x95, 0x31, 0x00, 0x00, 0xfc, 0x01, 0xff, 0x03, 0xf0,
+ 0xf8, 0x1f, 0x88, 0x61, 0x10, 0xe0, 0xff, 0xff, 0xff, 0x00, 0x00, 0xe1,
+ 0x53, 0x0c, 0x00, 0x00, 0x38, 0xf0, 0xff, 0x03, 0xef, 0xf8, 0x7f, 0x90,
+ 0x61, 0x40, 0xe0, 0xff, 0xff, 0xff, 0x00, 0xff, 0xe3, 0x2b, 0xfe, 0x00,
+ 0x00, 0x18, 0xf8, 0xff, 0x03, 0xff, 0x7c, 0xf0, 0x90, 0x61, 0x00, 0x3e,
+ 0x36, 0xe3, 0xe1, 0x00, 0x00, 0xe3, 0x9f, 0x60, 0x00, 0x00, 0x38, 0x3c,
+ 0x00, 0x03, 0xf0, 0x1f, 0xe0, 0xa0, 0xe1, 0x00, 0x30, 0x22, 0xe2, 0xc0,
+ 0x00, 0xff, 0xe3, 0x7f, 0x18, 0x00, 0x00, 0x38, 0x0e, 0x00, 0x07, 0xe7,
+ 0x07, 0xc0, 0xe1, 0xc1, 0x00, 0x18, 0x22, 0xe2, 0xc0, 0x00, 0x00, 0xe1,
+ 0x1f, 0x07, 0x00, 0x00, 0x38, 0x06, 0x00, 0x07, 0xef, 0x01, 0xc0, 0xc1,
+ 0xc1, 0x01, 0x16, 0x24, 0xe2, 0xc0, 0x01, 0xff, 0xe1, 0xff, 0x00, 0x00,
+ 0x00, 0x70, 0x07, 0x00, 0x0e, 0xf8, 0x00, 0x80, 0xc3, 0xc0, 0xf1, 0x11,
+ 0x24, 0xe4, 0xc0, 0x03, 0xe0, 0xe1, 0x7f, 0x00, 0x00, 0x00, 0x70, 0x07,
+ 0x00, 0x1e, 0x3c, 0x00, 0x80, 0xe3, 0x80, 0x0f, 0x10, 0x24, 0xe4, 0xc0,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xe0, 0x03, 0x00, 0xfc, 0x0f,
+ 0x00, 0x00, 0x63, 0x80, 0x01, 0x08, 0x44, 0xe4, 0xc0, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0x01, 0x00, 0xe0, 0x03, 0x00, 0xf8, 0x07, 0x00, 0x00, 0x73,
+ 0x80, 0x03, 0x08, 0x44, 0xe4, 0xc0, 0xfc, 0x00, 0x07, 0x0e, 0x00, 0x00,
+ 0x00, 0xc0, 0x03, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x33, 0x00, 0x03, 0x08,
+ 0x44, 0xe4, 0xe0, 0xcc, 0x00, 0x07, 0x0e, 0x00, 0x00, 0x00, 0xc0, 0x03,
+ 0x00, 0x78, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x07, 0x04, 0x44, 0xe8, 0x70,
+ 0xcc, 0x01, 0x87, 0x0f, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x3e, 0x00,
+ 0x00, 0x80, 0x1f, 0x00, 0x0e, 0x04, 0x44, 0xe8, 0x38, 0xcc, 0x81, 0xe7,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x00, 0x80, 0x0f,
+ 0x00, 0x1c, 0x02, 0x44, 0xf8, 0x1e, 0xcc, 0xe1, 0xff, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0f, 0xc0, 0x23, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x38, 0x01,
+ 0x42, 0xfc, 0x0f, 0xcc, 0xf1, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e,
+ 0xf0, 0x39, 0x00, 0x00, 0xe0, 0x03, 0x00, 0xf0, 0x00, 0xc2, 0xff, 0x07,
+ 0xcc, 0x7f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x7c, 0x0e, 0x00,
+ 0x00, 0xf0, 0x01, 0x00, 0xe0, 0x03, 0xe2, 0xe7, 0x07, 0xcc, 0x1f, 0x07,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xbf, 0x23, 0xe0, 0xff, 0xff, 0x00,
+ 0x00, 0xc0, 0x1f, 0xff, 0x64, 0x06, 0xcc, 0x07, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xf0, 0xff, 0x3c, 0xf0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xff,
+ 0x7f, 0x64, 0x06, 0xcc, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70,
+ 0xf8, 0x1f, 0x78, 0x7c, 0x7f, 0x00, 0x00, 0x00, 0xfc, 0x20, 0x64, 0x06,
+ 0xcc, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xf8, 0x33, 0x1c,
+ 0x38, 0x66, 0x00, 0x00, 0x00, 0x0c, 0x20, 0x6c, 0x06, 0xcc, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x78, 0x3e, 0x0e, 0x38, 0x76, 0x00,
+ 0x00, 0x00, 0x0c, 0x20, 0x68, 0x06, 0xcc, 0x03, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x38, 0xf8, 0x87, 0x0f, 0x38, 0x76, 0x00, 0x00, 0x00, 0x0c,
+ 0x20, 0x68, 0x06, 0xcc, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
+ 0x78, 0xf8, 0x0f, 0x38, 0x76, 0x00, 0x00, 0x00, 0x0c, 0x10, 0x68, 0x06,
+ 0xcc, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xf8, 0xff, 0x0f,
+ 0x38, 0x76, 0x00, 0x00, 0x00, 0x0c, 0x10, 0x68, 0x06, 0xcc, 0x07, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0xf8, 0xff, 0x0e, 0x38, 0x76, 0x00,
+ 0x00, 0x00, 0x0c, 0x10, 0x68, 0x06, 0xcc, 0x07, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x1c, 0xf8, 0xe1, 0x0e, 0x38, 0x3e, 0x00, 0x00, 0x00, 0x0c,
+ 0x08, 0x68, 0x06, 0xcc, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,
+ 0x38, 0xe0, 0x0e, 0x38, 0x3e, 0x00, 0x00, 0x00, 0x0c, 0x08, 0x68, 0x06,
+ 0xcc, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x38, 0xe0, 0x0e,
+ 0x38, 0x3e, 0x00, 0x00, 0x00, 0x0c, 0x04, 0x68, 0x06, 0xcc, 0x0e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x38, 0xe0, 0x0e, 0x38, 0x3e, 0x00,
+ 0x00, 0x00, 0x1c, 0x04, 0x68, 0x06, 0xcc, 0x0e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x06, 0x38, 0xe0, 0x0e, 0x38, 0x3e, 0x00, 0x00, 0x00, 0x1c,
+ 0x02, 0x68, 0x06, 0xcc, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06,
+ 0x38, 0xe0, 0x0e, 0x38, 0x3e, 0x00, 0x00, 0x00, 0x1c, 0x02, 0x68, 0x06,
+ 0xcc, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x38, 0xe0, 0x0e,
+ 0x38, 0x3e, 0x00, 0x00, 0x00, 0x1c, 0x01, 0x68, 0x06, 0xcc, 0x1c, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x38, 0xe0, 0x0e, 0x38, 0x3e, 0x00,
+ 0x00, 0x00, 0x18, 0x01, 0x68, 0x06, 0xcc, 0x1c, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x03, 0x38, 0xe0, 0x0e, 0x38, 0x3e, 0x00, 0x00, 0x00, 0x98,
+ 0x00, 0x68, 0x06, 0xcc, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
+ 0x38, 0xe0, 0x0e, 0x38, 0x3e, 0x00, 0x00, 0x00, 0x98, 0x00, 0x68, 0x06,
+ 0xcc, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x38, 0xe0, 0x0e,
+ 0x38, 0x1e, 0x00, 0x00, 0x00, 0x58, 0x00, 0x6c, 0x0e, 0xcc, 0x18, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x30, 0xe0, 0x0e, 0x38, 0x1e, 0x00,
+ 0x00, 0x00, 0x38, 0x00, 0x64, 0x0e, 0xcc, 0x18, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xc0, 0x01, 0x70, 0xe0, 0x0e, 0x1c, 0x1e, 0x00, 0x00, 0x00, 0x18,
+ 0x00, 0x64, 0x1e, 0xcc, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01,
+ 0xe0, 0xe1, 0x0e, 0x0f, 0x1e, 0x00, 0x00, 0x00, 0x18, 0x00, 0x64, 0x3e,
+ 0xcc, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xc0, 0xef, 0xce,
+ 0x07, 0x1e, 0x00, 0x00, 0x00, 0x18, 0x00, 0x64, 0x3e, 0xcc, 0x30, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0xff, 0xfe, 0x03, 0x1e, 0x00,
+ 0x00, 0x00, 0x18, 0x00, 0x64, 0x7e, 0xcc, 0x30, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0x00, 0x00, 0xfc, 0xfe, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x18,
+ 0x00, 0x64, 0x66, 0xcc, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
+ 0x00, 0xe0, 0x1e, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x18, 0x00, 0x66, 0xe6,
+ 0xcc, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xe0, 0x0e,
+ 0x00, 0x1e, 0x00, 0x00, 0x00, 0x18, 0x00, 0x62, 0xc6, 0xcd, 0x70, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x1e, 0x00,
+ 0x00, 0x00, 0x18, 0x00, 0x62, 0xc6, 0xcd, 0x70, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x70, 0x00, 0xc0, 0xff, 0xff, 0x0f, 0x0e, 0x00, 0x00, 0x00, 0x38,
+ 0x00, 0x62, 0x86, 0xcf, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00,
+ 0xf0, 0xff, 0xff, 0x0f, 0x0e, 0x00, 0x00, 0x00, 0x38, 0x00, 0x61, 0x86,
+ 0xcf, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0xfc, 0x00, 0x00,
+ 0x0e, 0x0e, 0x00, 0x00, 0x00, 0x38, 0x00, 0x61, 0x8e, 0xcf, 0xe0, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x78, 0x00, 0x00, 0x0e, 0x0e, 0x00,
+ 0x00, 0x00, 0xf8, 0xff, 0x7f, 0xfe, 0xdf, 0xff, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x18, 0x00, 0xf0, 0x00, 0x00, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0xf0,
+ 0xff, 0x3f, 0xff, 0xdf, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00,
+ 0xe0, 0x01, 0x00, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x8f, 0x07,
+ 0x9e, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0xe0, 0x07, 0x00,
+ 0x0e, 0x0f, 0x00, 0x00, 0x00, 0x30, 0x00, 0xc0, 0xff, 0x3f, 0xc0, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x0f, 0x00,
+ 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x1c, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xf0,
+ 0xff, 0xff, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff,
+ 0x3f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x38, 0x00,
+ 0x38, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x7f, 0x00, 0x00,
+ 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x06, 0x38, 0x00, 0x38, 0xe0, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x06, 0x00,
+ 0x00, 0x00, 0x00, 0x06, 0x18, 0x00, 0x38, 0xe0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x18, 0x00, 0x38, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
+ 0xdc, 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x06, 0x1c, 0x00,
+ 0x38, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x9c, 0x03, 0x00,
+ 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x06, 0x1c, 0x00, 0x18, 0x70, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1c, 0x07, 0x00, 0x00, 0x06, 0x00,
+ 0x00, 0x00, 0x00, 0x07, 0x0c, 0x00, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0x00, 0x1c, 0xfe, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00,
+ 0x07, 0x0c, 0x00, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
+ 0x1c, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0c, 0x00,
+ 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1c, 0x1c, 0x00,
+ 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0e, 0x00, 0x18, 0x70, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1c, 0x1c, 0x00, 0x80, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0x07, 0x0e, 0x00, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0x00, 0x1c, 0x1c, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00,
+ 0x07, 0x0e, 0x00, 0x18, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
+ 0x1c, 0x1c, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0e, 0x00,
+ 0x18, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1c, 0x1c, 0x00,
+ 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x07, 0x06, 0x00, 0x18, 0x38, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x07, 0x00,
+ 0x00, 0x00, 0x00, 0x07, 0x06, 0x00, 0x18, 0x38, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00,
+ 0x07, 0x0e, 0x00, 0x18, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
+ 0x1c, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0e, 0x00,
+ 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1c, 0x00, 0x00,
+ 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0e, 0x00, 0x18, 0x30, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x06, 0x00,
+ 0x00, 0x00, 0x00, 0x07, 0x0e, 0x00, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+ 0x07, 0x0e, 0x00, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
+ 0x1e, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x06, 0x0c, 0x00,
+ 0x38, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1e, 0x00, 0x00,
+ 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x06, 0x1c, 0x00, 0x38, 0x70, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x06, 0x00,
+ 0x00, 0x00, 0x00, 0x06, 0x1c, 0x00, 0x38, 0xe0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x18, 0x00, 0x38, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00,
+ 0x1e, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x18, 0x00,
+ 0x30, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x1e, 0x00, 0x00,
+ 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x38, 0x00, 0x30, 0xe0, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x1f, 0x00, 0x00, 0x00, 0x06, 0x00,
+ 0x00, 0x00, 0x00, 0x0c, 0x3c, 0x00, 0x30, 0xf0, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0xf8, 0x03, 0x1f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+ 0x0c, 0x7e, 0x00, 0x70, 0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x0f,
+ 0x1f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xe7, 0x00,
+ 0x70, 0xbc, 0x03, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x1f, 0x00, 0x00,
+ 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0xdc, 0xe3, 0x00, 0x60, 0x1e, 0x07,
+ 0x00, 0x00, 0x00, 0x00, 0x0f, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0x06, 0x00,
+ 0x00, 0x00, 0x00, 0xfc, 0xc1, 0x01, 0xe0, 0x0f, 0x0f, 0x00, 0x00, 0x00,
+ 0x80, 0x07, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+ 0xf8, 0x80, 0x03, 0xe0, 0x03, 0x1e, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xe0,
+ 0x1b, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x78, 0x80, 0x07,
+ 0xe0, 0x01, 0x1c, 0x00, 0x00, 0x00, 0xe0, 0x01, 0xc0, 0x1b, 0x00, 0x00,
+ 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x0f, 0xe0, 0x01, 0x38,
+ 0x00, 0x00, 0x00, 0xf0, 0x00, 0xc0, 0x19, 0x00, 0x00, 0x00, 0x06, 0x00,
+ 0x00, 0x00, 0x00, 0x30, 0x0e, 0x1e, 0xc0, 0x71, 0xf8, 0x00, 0x00, 0x00,
+ 0x78, 0x00, 0xdc, 0x19, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
+ 0x30, 0x1f, 0x1e, 0xc0, 0xf9, 0xf8, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+
+#define escherknot_width 216
+#define escherknot_height 208
+
+static unsigned char escherknot_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x5f,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xf0, 0x6f, 0xf6, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xc0, 0xff, 0x3a, 0x13, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0d, 0x02, 0x51, 0x71, 0x0e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x2f, 0x20, 0xd9, 0x88,
+ 0x9b, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x82,
+ 0xac, 0x44, 0x4e, 0x1c, 0xf3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x1e, 0x40, 0x02, 0x44, 0x60, 0xe2, 0xfc, 0x06, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x80, 0x25, 0x09, 0x90, 0x22, 0x13, 0xb7, 0x9a, 0x1e,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x40, 0x10, 0x89,
+ 0x18, 0xe3, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x04, 0x08,
+ 0x01, 0x10, 0xc8, 0xa8, 0xd5, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x83, 0x80, 0x20, 0x40, 0x82, 0x00, 0x66, 0x9c, 0xec, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x08, 0x08, 0x24, 0x12, 0x93, 0x5b,
+ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x12, 0x80, 0x04, 0x01, 0x00, 0x80,
+ 0x19, 0x33, 0xfa, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x80, 0x80, 0x00,
+ 0x20, 0x08, 0x12, 0xc4, 0x68, 0x26, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
+ 0x02, 0x04, 0x24, 0x00, 0x01, 0x40, 0x24, 0x8c, 0xcd, 0x3f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
+ 0x00, 0x80, 0x49, 0x10, 0x90, 0x00, 0x21, 0x20, 0x08, 0x11, 0x43, 0xd9,
+ 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8,
+ 0xff, 0xff, 0x0b, 0x00, 0x60, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x30, 0xb9, 0xf2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xc0, 0x97, 0x04, 0x08, 0xfe, 0x05, 0x30, 0x10, 0x12, 0x20, 0x20,
+ 0x04, 0x00, 0x80, 0x48, 0x0c, 0xa3, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x3e, 0x92, 0x20, 0x49, 0x40, 0x3e, 0x0e, 0x82,
+ 0x00, 0x84, 0x25, 0x01, 0x80, 0x00, 0x80, 0xc8, 0x34, 0xed, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x25, 0x01, 0x04, 0x01, 0x08,
+ 0xd0, 0x17, 0x00, 0x80, 0x25, 0x01, 0xad, 0x04, 0x12, 0x20, 0x23, 0x4c,
+ 0x6a, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x02, 0x48,
+ 0x92, 0x20, 0x41, 0x92, 0x9e, 0x80, 0x24, 0x24, 0x29, 0x00, 0x04, 0x00,
+ 0x10, 0x98, 0xcc, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+ 0x4f, 0x10, 0x01, 0x90, 0x24, 0x40, 0x12, 0xf0, 0x00, 0x24, 0x41, 0x0b,
+ 0xa9, 0x10, 0x00, 0x00, 0x04, 0xd9, 0x96, 0x0e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xe0, 0x00, 0x92, 0x48, 0x02, 0x04, 0x09, 0xc0, 0x84, 0x8f,
+ 0x29, 0x2d, 0xf8, 0xa9, 0x02, 0x00, 0x00, 0x20, 0x90, 0xf4, 0x1e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x24, 0x91, 0x04, 0x50, 0x22, 0x24,
+ 0x1b, 0x12, 0x7a, 0x48, 0xca, 0x03, 0x21, 0x10, 0x00, 0x00, 0x48, 0x93,
+ 0xff, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x24, 0x92, 0x20,
+ 0x81, 0xda, 0x24, 0xc8, 0x16, 0xd0, 0xe7, 0x50, 0xd2, 0xbf, 0x03, 0x00,
+ 0x80, 0x00, 0x30, 0x29, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
+ 0x20, 0x80, 0x24, 0x41, 0x12, 0x2a, 0x41, 0xb2, 0x80, 0x33, 0x0e, 0x7e,
+ 0x88, 0x1c, 0x01, 0x00, 0xa0, 0x24, 0x69, 0x75, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0x82, 0x44, 0x11, 0x24, 0x09, 0x90, 0xa4, 0x4d, 0xd2, 0x92,
+ 0x9e, 0xd3, 0x83, 0x6b, 0x62, 0x00, 0x00, 0x10, 0x22, 0xff, 0x7f, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x30, 0x42, 0x04, 0x92, 0x24, 0x6b, 0x53, 0x32,
+ 0x59, 0x90, 0x16, 0xfa, 0xb4, 0xf4, 0xff, 0x0f, 0x01, 0x00, 0x90, 0x68,
+ 0x4a, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x90, 0x24, 0x11, 0x24,
+ 0x49, 0xda, 0x82, 0xc5, 0x92, 0xd2, 0xd0, 0x9e, 0x1e, 0x00, 0x78, 0x0a,
+ 0x00, 0x00, 0x05, 0xd2, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x02,
+ 0x44, 0xb2, 0x65, 0xea, 0x49, 0x9e, 0x2c, 0x4b, 0x1a, 0xd2, 0xeb, 0xe3,
+ 0xff, 0xc7, 0x09, 0x00, 0x20, 0x68, 0xff, 0xd6, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x0b, 0x90, 0x40, 0x92, 0x24, 0x09, 0x5f, 0xd2, 0x64, 0x59, 0x72,
+ 0x56, 0x7f, 0xfd, 0xdf, 0x1f, 0x12, 0x00, 0x20, 0x49, 0x92, 0xde, 0x01,
+ 0x00, 0x00, 0x00, 0x80, 0x41, 0x92, 0x4c, 0x92, 0x24, 0x25, 0xc9, 0x8b,
+ 0x2e, 0xcb, 0x92, 0x4b, 0x5a, 0x2f, 0x75, 0xf4, 0x04, 0x00, 0x00, 0x41,
+ 0xf6, 0x74, 0x01, 0x00, 0x00, 0x00, 0x40, 0x49, 0x02, 0x00, 0xba, 0xb6,
+ 0xfd, 0x49, 0xf8, 0x74, 0x6d, 0x4b, 0x72, 0xed, 0xdb, 0xff, 0xcf, 0x53,
+ 0x00, 0x00, 0x48, 0xb6, 0xd7, 0x03, 0x00, 0x00, 0x00, 0x60, 0x48, 0x10,
+ 0xc9, 0x93, 0x24, 0x00, 0x7b, 0xc3, 0xa6, 0x69, 0x58, 0x5a, 0xfb, 0xfa,
+ 0xa5, 0xbe, 0x16, 0x00, 0x00, 0x92, 0xa4, 0xfd, 0x03, 0x00, 0x00, 0x00,
+ 0x30, 0x01, 0x20, 0x5d, 0xa2, 0xfe, 0x7f, 0x01, 0x4f, 0x1a, 0xcd, 0x6b,
+ 0x6a, 0xa9, 0x5f, 0xff, 0xf3, 0x24, 0x01, 0x40, 0xc0, 0xb4, 0xf4, 0x03,
+ 0x00, 0x00, 0x00, 0x2c, 0x88, 0x84, 0x89, 0xb6, 0x00, 0x24, 0x7d, 0x69,
+ 0xf2, 0x34, 0xad, 0x99, 0x2d, 0xf7, 0xff, 0x9f, 0x4b, 0x00, 0x00, 0x92,
+ 0xa6, 0xad, 0x07, 0x00, 0x00, 0x00, 0x06, 0x91, 0x24, 0xe9, 0xa4, 0xfd,
+ 0xa5, 0xa9, 0x4b, 0x93, 0xe7, 0x34, 0x63, 0xf9, 0xfc, 0xd5, 0xef, 0x16,
+ 0x00, 0x40, 0x90, 0xb4, 0xbd, 0x07, 0x00, 0x00, 0x00, 0x6a, 0x80, 0x4c,
+ 0x96, 0xbe, 0x2d, 0xfd, 0x2f, 0x7c, 0x5e, 0x9c, 0x67, 0xad, 0xa5, 0xfd,
+ 0xff, 0xbf, 0x29, 0x00, 0x00, 0x92, 0x76, 0xed, 0x06, 0x00, 0x00, 0x00,
+ 0x05, 0x12, 0x48, 0x53, 0x25, 0x65, 0x25, 0xf4, 0xe5, 0xd3, 0x72, 0x9c,
+ 0x35, 0xdf, 0xf6, 0x7f, 0xf5, 0x56, 0x00, 0x00, 0x92, 0xa4, 0xed, 0x0f,
+ 0x00, 0x00, 0x80, 0x49, 0x20, 0x59, 0x38, 0xec, 0xff, 0xff, 0xad, 0x2f,
+ 0x5d, 0xd3, 0x33, 0xe6, 0x24, 0xed, 0xff, 0xdf, 0x2d, 0x01, 0x40, 0x80,
+ 0x24, 0xbd, 0x07, 0x00, 0x00, 0xc0, 0x48, 0x24, 0x49, 0x87, 0x37, 0x21,
+ 0xa0, 0xbd, 0xf4, 0x79, 0x4f, 0xc7, 0x9c, 0xde, 0xf6, 0xff, 0xff, 0x5b,
+ 0x08, 0x00, 0x92, 0xfc, 0xe9, 0x0e, 0x00, 0x00, 0x20, 0x89, 0x40, 0xd3,
+ 0xf4, 0x49, 0xff, 0xff, 0xe7, 0x2f, 0xcf, 0x79, 0x9c, 0x53, 0xb2, 0x35,
+ 0xff, 0xff, 0x37, 0x00, 0x40, 0x90, 0x24, 0xef, 0x0e, 0x00, 0x00, 0x30,
+ 0x91, 0x49, 0x32, 0x2d, 0xff, 0x6b, 0xb7, 0xbd, 0xbc, 0x3c, 0xef, 0x79,
+ 0xce, 0xde, 0xd6, 0xfd, 0xff, 0x9f, 0x00, 0x00, 0x92, 0xa6, 0xad, 0x0b,
+ 0x00, 0x00, 0x30, 0x11, 0x89, 0x8c, 0xcb, 0x5b, 0xba, 0xaf, 0xf6, 0xd7,
+ 0xe7, 0x35, 0xe7, 0x59, 0xb3, 0xfb, 0xff, 0xff, 0x7f, 0x04, 0x40, 0x80,
+ 0xe4, 0xb9, 0x1f, 0x00, 0x00, 0x48, 0x22, 0x91, 0x66, 0x79, 0xeb, 0xff,
+ 0xff, 0xdf, 0xbe, 0xbe, 0xe7, 0x8c, 0x75, 0x6b, 0x4a, 0xfa, 0xbf, 0x7f,
+ 0x00, 0x00, 0x82, 0x24, 0xef, 0x0e, 0x00, 0x00, 0x4c, 0x22, 0xb2, 0x79,
+ 0x5e, 0xfa, 0x5b, 0xa9, 0xfd, 0xeb, 0xf5, 0x9c, 0x3d, 0xc6, 0xcc, 0xee,
+ 0xed, 0x01, 0xf8, 0x00, 0x40, 0x82, 0xb6, 0xa9, 0x1b, 0x00, 0x00, 0x94,
+ 0x64, 0x66, 0x8e, 0xd3, 0x97, 0xfe, 0xff, 0xd7, 0xdf, 0x9f, 0x7b, 0xf3,
+ 0x3c, 0x35, 0x59, 0x6b, 0x00, 0x70, 0x00, 0x00, 0x40, 0xe4, 0xed, 0x1e,
+ 0x00, 0x00, 0x92, 0xc4, 0x34, 0xf3, 0xfc, 0xfd, 0x5f, 0xad, 0x7d, 0xfa,
+ 0x7a, 0xce, 0x8e, 0xb3, 0x76, 0x2f, 0xfd, 0x00, 0xe0, 0x04, 0x00, 0x9a,
+ 0x26, 0xaf, 0x1e, 0x00, 0x00, 0x13, 0x88, 0xcc, 0xb5, 0x3f, 0xbf, 0xff,
+ 0xff, 0xd7, 0xef, 0xef, 0xbd, 0x79, 0x6a, 0xde, 0xec, 0xab, 0x01, 0xc0,
+ 0x00, 0x00, 0x40, 0xb6, 0xbd, 0x1b, 0x00, 0x00, 0x05, 0x91, 0xeb, 0x5c,
+ 0xeb, 0xeb, 0xff, 0xff, 0xff, 0x7e, 0xef, 0x6b, 0xef, 0xcd, 0x99, 0xb3,
+ 0xe4, 0x07, 0x80, 0x00, 0x40, 0x49, 0xb2, 0xe5, 0x1a, 0x00, 0x80, 0x20,
+ 0x32, 0xb1, 0xe7, 0x79, 0x7f, 0xf7, 0xff, 0xfd, 0xeb, 0xbd, 0xfe, 0x2c,
+ 0x3d, 0x6b, 0xb6, 0xaf, 0x06, 0x80, 0x00, 0x00, 0x41, 0x96, 0xfe, 0x1e,
+ 0x00, 0x80, 0x44, 0xb2, 0x9b, 0xf9, 0xde, 0xff, 0xff, 0xff, 0x7f, 0xbf,
+ 0xf7, 0xbb, 0xb3, 0x77, 0xce, 0xce, 0xb6, 0x0d, 0x80, 0x01, 0x00, 0x49,
+ 0xf2, 0x94, 0x1f, 0x00, 0x40, 0x49, 0x44, 0xe6, 0x9e, 0x77, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xbf, 0xf7, 0x7e, 0xd6, 0xbc, 0xd9, 0xba, 0x3b, 0x80,
+ 0x00, 0x00, 0x64, 0x93, 0xf7, 0x1b, 0x00, 0x40, 0x89, 0xec, 0x7e, 0x67,
+ 0xbd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xce, 0xdb, 0x99, 0x33, 0x37,
+ 0xd3, 0x36, 0x80, 0x01, 0x80, 0x24, 0xda, 0xd6, 0x1e, 0x00, 0x20, 0x90,
+ 0x99, 0x99, 0x7b, 0xef, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xef, 0xbd, 0x37,
+ 0x63, 0xf3, 0x66, 0xdb, 0x7a, 0x80, 0x00, 0x00, 0x24, 0x59, 0xde, 0x1f,
+ 0x00, 0x60, 0x12, 0xb3, 0xf7, 0xdd, 0xfb, 0xfe, 0xff, 0xff, 0xff, 0xff,
+ 0xbf, 0xf7, 0xfe, 0x6e, 0xce, 0xdd, 0x6d, 0xd7, 0x80, 0x00, 0x80, 0x20,
+ 0xcb, 0xfb, 0x1f, 0x00, 0x10, 0x20, 0x6e, 0x66, 0x76, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xef, 0xde, 0xdb, 0x9b, 0x99, 0xb3, 0x5d, 0x6b, 0x81,
+ 0x00, 0x40, 0x96, 0x59, 0x6a, 0x1f, 0x00, 0x98, 0xc4, 0xe4, 0xdf, 0xff,
+ 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7b, 0x6f, 0x7b, 0x37, 0x7f,
+ 0xb3, 0xdd, 0x83, 0x00, 0x00, 0xb0, 0xed, 0xef, 0x1d, 0x00, 0x10, 0x88,
+ 0x9e, 0xdd, 0xcd, 0xbd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xed,
+ 0x6c, 0xe6, 0xcc, 0x76, 0x6d, 0xc1, 0x00, 0x40, 0x91, 0x24, 0x7b, 0x1f,
+ 0x00, 0x08, 0xd1, 0xf1, 0x66, 0x76, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xdf, 0xbd, 0xbf, 0xd9, 0xdd, 0xdd, 0xb6, 0x47, 0x00, 0x00, 0xd8,
+ 0xb4, 0xad, 0x1f, 0x00, 0x24, 0x24, 0x6f, 0xf6, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0x7f, 0x7f, 0xb7, 0x9d, 0x33, 0xd9, 0x96, 0x4e,
+ 0x00, 0x20, 0x49, 0xf7, 0xfd, 0x1e, 0x00, 0x48, 0xe4, 0xac, 0xb9, 0xdd,
+ 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xdd, 0x76, 0xb6,
+ 0xb7, 0xfd, 0x7a, 0x00, 0x00, 0x44, 0x96, 0xb7, 0x1f, 0x00, 0x02, 0x9a,
+ 0xbe, 0x6f, 0x77, 0xff, 0xff, 0x7f, 0x61, 0xd9, 0xff, 0xff, 0xff, 0xfd,
+ 0xdd, 0x66, 0xed, 0x66, 0x5b, 0x37, 0x00, 0x90, 0x64, 0xb9, 0xf6, 0x1f,
+ 0x00, 0x02, 0xc9, 0xf3, 0xee, 0xfd, 0xff, 0xff, 0x2f, 0x24, 0x4f, 0xfe,
+ 0xff, 0xff, 0x7f, 0x37, 0xdb, 0xcd, 0x7c, 0xff, 0x3a, 0x00, 0x88, 0x24,
+ 0xdb, 0xde, 0x1a, 0x00, 0x13, 0x31, 0x6f, 0xbb, 0xdf, 0xff, 0xff, 0x21,
+ 0xa0, 0x64, 0xf3, 0xff, 0xff, 0xe7, 0xff, 0x96, 0xbb, 0x9b, 0xa5, 0x1d,
+ 0x00, 0x60, 0x32, 0xe9, 0xdb, 0x0f, 0x00, 0x65, 0xe6, 0x3c, 0xfb, 0xf6,
+ 0xff, 0x7f, 0x10, 0xa4, 0xb5, 0x9d, 0xfe, 0xdf, 0xdf, 0xdd, 0x6d, 0x32,
+ 0xb3, 0x7d, 0x0d, 0x00, 0x0b, 0x93, 0x7c, 0x7b, 0x0f, 0x00, 0x89, 0xdc,
+ 0xb3, 0xed, 0xfb, 0xff, 0x1f, 0x10, 0x90, 0x92, 0xd9, 0xfe, 0x7f, 0xff,
+ 0x77, 0xdb, 0xee, 0x6e, 0xdb, 0x0e, 0x00, 0x20, 0xdd, 0x66, 0x6f, 0x0f,
+ 0x80, 0x91, 0x5a, 0xfb, 0xbe, 0xef, 0xff, 0x0f, 0x10, 0xda, 0x92, 0xee,
+ 0xff, 0xff, 0xff, 0xf7, 0xb7, 0xcd, 0xee, 0xde, 0x07, 0x00, 0x24, 0x49,
+ 0xb6, 0xed, 0x0f, 0x00, 0x12, 0x6b, 0xcd, 0xf3, 0xbe, 0xff, 0x07, 0x08,
+ 0x48, 0xda, 0x76, 0xb7, 0xff, 0xff, 0xdd, 0x6e, 0xba, 0x99, 0x65, 0x03,
+ 0x40, 0x92, 0xe4, 0xba, 0xbd, 0x0e, 0x80, 0x62, 0xed, 0x7d, 0x5f, 0xf7,
+ 0xff, 0x01, 0x08, 0x28, 0xc9, 0x26, 0xbb, 0xff, 0xff, 0xff, 0x99, 0xb7,
+ 0xbb, 0x7d, 0x03, 0x00, 0x89, 0x64, 0xdb, 0xf6, 0x07, 0x40, 0x0c, 0x35,
+ 0xe7, 0x79, 0xdd, 0xff, 0x01, 0x84, 0xa5, 0x7d, 0xba, 0xdd, 0xfe, 0x7f,
+ 0xbf, 0xbf, 0x6d, 0x76, 0xdb, 0x01, 0x00, 0x48, 0x36, 0xdb, 0xd6, 0x07,
+ 0xc0, 0x88, 0xb4, 0xb6, 0xbf, 0xff, 0x7f, 0x00, 0x0c, 0x24, 0x44, 0xdb,
+ 0xed, 0xff, 0xdf, 0xef, 0x6e, 0xdb, 0x6e, 0xb7, 0x00, 0x80, 0x44, 0x93,
+ 0xed, 0x5b, 0x07, 0x40, 0x91, 0xd2, 0xfa, 0xfc, 0xf6, 0x7f, 0x00, 0x02,
+ 0xb4, 0x35, 0xd9, 0xef, 0xff, 0xff, 0xfb, 0xef, 0xb6, 0xc9, 0xe4, 0x00,
+ 0x10, 0x24, 0xd9, 0x6d, 0xfb, 0x03, 0x00, 0x27, 0xfe, 0xd3, 0xd6, 0xdb,
+ 0x3f, 0x00, 0xa2, 0x94, 0xb4, 0xdb, 0x7c, 0xff, 0xff, 0xbf, 0xd9, 0xad,
+ 0xdb, 0x7d, 0x00, 0x40, 0x32, 0xd9, 0xb6, 0xef, 0x03, 0x60, 0xe4, 0x5a,
+ 0x5f, 0x5f, 0xff, 0x1f, 0x00, 0x02, 0x52, 0x92, 0xec, 0xb6, 0xff, 0xff,
+ 0xef, 0xff, 0x6d, 0xb6, 0x3b, 0x00, 0x28, 0x90, 0xcc, 0xbe, 0xfd, 0x03,
+ 0xa0, 0x88, 0xeb, 0xf9, 0xfd, 0xf5, 0x1f, 0x00, 0x82, 0x53, 0xbb, 0x6d,
+ 0xf7, 0xff, 0xf9, 0xff, 0x6f, 0xdb, 0x6d, 0x1b, 0x00, 0x04, 0xc9, 0x66,
+ 0xdb, 0x57, 0x03, 0xa0, 0x52, 0xaf, 0xa7, 0x97, 0xff, 0x0f, 0x00, 0x51,
+ 0x48, 0xda, 0x66, 0xdb, 0xff, 0xf8, 0xdf, 0xed, 0xbe, 0xed, 0x0e, 0x00,
+ 0x92, 0x64, 0x32, 0xeb, 0xf6, 0x01, 0x20, 0x63, 0xbd, 0xbc, 0xfc, 0xfa,
+ 0x0f, 0x00, 0x09, 0x20, 0x89, 0x3e, 0xff, 0xff, 0xe0, 0x7f, 0xdf, 0x6f,
+ 0xdb, 0x07, 0x00, 0x01, 0x24, 0xbb, 0xed, 0xfe, 0x01, 0xa0, 0xce, 0xf5,
+ 0xf6, 0xdb, 0xdf, 0x07, 0x00, 0x41, 0xad, 0x5f, 0xf2, 0xed, 0xff, 0xc0,
+ 0xff, 0xbf, 0xdd, 0x92, 0x03, 0x00, 0x44, 0xb2, 0xd9, 0x7d, 0xfb, 0x01,
+ 0xe0, 0xaa, 0xdf, 0x9b, 0x7f, 0xfb, 0x07, 0x80, 0x28, 0x21, 0x64, 0xbb,
+ 0x7f, 0x7f, 0x80, 0xff, 0xf6, 0xbb, 0xee, 0x03, 0x80, 0x22, 0x99, 0xed,
+ 0xb6, 0xff, 0x00, 0x90, 0xb8, 0x5e, 0x5b, 0x6b, 0xed, 0x03, 0x00, 0x01,
+ 0xa6, 0x6d, 0xdb, 0xf6, 0x7f, 0x00, 0xff, 0xff, 0xf6, 0xcd, 0x00, 0x40,
+ 0x10, 0xc9, 0x6c, 0xff, 0xf7, 0x00, 0xa0, 0xe3, 0x72, 0xeb, 0xef, 0xff,
+ 0x03, 0x80, 0xe0, 0x90, 0x24, 0xdb, 0xbd, 0x3f, 0x00, 0xfe, 0xdb, 0x6f,
+ 0xfb, 0x00, 0x00, 0x89, 0x4c, 0xb6, 0xd9, 0x7e, 0x00, 0x70, 0xaf, 0xaf,
+ 0x6f, 0xb5, 0xde, 0x03, 0x80, 0x94, 0x92, 0xb6, 0xf9, 0xf6, 0x3f, 0x00,
+ 0xfc, 0xbf, 0xdd, 0x7b, 0x00, 0x10, 0x48, 0x26, 0xb3, 0xdf, 0x7f, 0x00,
+ 0x70, 0xd8, 0xae, 0xfd, 0xff, 0xf7, 0x03, 0x80, 0x00, 0xd2, 0x36, 0xcf,
+ 0xdf, 0x3f, 0x00, 0xb8, 0x6d, 0xdf, 0x16, 0x00, 0x48, 0x44, 0xb2, 0xfb,
+ 0x6c, 0x3f, 0x00, 0x50, 0x75, 0xfd, 0xa5, 0xd5, 0xfe, 0x01, 0x40, 0xd1,
+ 0x12, 0xa2, 0x7d, 0xfb, 0x1f, 0x00, 0xf0, 0xff, 0xbf, 0x0d, 0x00, 0x20,
+ 0x12, 0x9b, 0xcd, 0xf6, 0x3f, 0x00, 0x90, 0xd5, 0xa7, 0xfd, 0x77, 0xab,
+ 0x03, 0x40, 0x1c, 0xc8, 0xbe, 0x6d, 0xfb, 0x1f, 0x00, 0xe0, 0xff, 0xee,
+ 0x07, 0x00, 0x04, 0x91, 0xc9, 0x7e, 0xbf, 0x1f, 0x00, 0x30, 0x57, 0xbf,
+ 0xa6, 0xde, 0xfd, 0x01, 0x40, 0x40, 0x6b, 0xd3, 0x6e, 0xef, 0x0f, 0x00,
+ 0xc0, 0xeb, 0x7d, 0x03, 0x00, 0x90, 0xc8, 0x6c, 0x76, 0xfb, 0x0f, 0x00,
+ 0x70, 0x5c, 0xe5, 0xf7, 0xfa, 0xeb, 0x01, 0x40, 0x50, 0x49, 0x92, 0xf4,
+ 0xfd, 0x0f, 0x00, 0xc0, 0xff, 0xdb, 0x01, 0x80, 0x44, 0x44, 0x66, 0xbb,
+ 0x6f, 0x0f, 0x00, 0xd0, 0xf1, 0x95, 0xf6, 0x6f, 0xad, 0x01, 0x40, 0x08,
+ 0x78, 0xdb, 0xb6, 0xef, 0x0f, 0x00, 0x00, 0xdf, 0xd6, 0x00, 0x00, 0x20,
+ 0x32, 0xb3, 0xdb, 0xfd, 0x0f, 0x00, 0x10, 0xd7, 0xf7, 0xb6, 0xd8, 0xeb,
+ 0x03, 0x20, 0x43, 0x27, 0xd9, 0xb6, 0xfd, 0x0f, 0x00, 0x00, 0xff, 0x7e,
+ 0x00, 0x40, 0x12, 0x93, 0xd9, 0xec, 0xb6, 0x07, 0x00, 0x70, 0x55, 0xdd,
+ 0xf6, 0x6f, 0xbb, 0x01, 0x40, 0x28, 0xa1, 0x6f, 0xb6, 0xb7, 0x0f, 0x00,
+ 0x00, 0xde, 0x1f, 0x00, 0x80, 0x88, 0xd8, 0xcc, 0x66, 0xff, 0x03, 0x00,
+ 0x70, 0xf4, 0xf5, 0xdb, 0xaa, 0xee, 0x01, 0x60, 0x28, 0x2d, 0x49, 0xf7,
+ 0xf6, 0x07, 0x00, 0x00, 0x7c, 0x0f, 0x00, 0x08, 0x48, 0x66, 0x6e, 0xfb,
+ 0xef, 0x03, 0x00, 0xd0, 0xd5, 0xdf, 0x52, 0xff, 0xda, 0x03, 0x20, 0xa3,
+ 0xa5, 0xd9, 0xb2, 0xff, 0x07, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x20, 0x22,
+ 0x33, 0x37, 0xbf, 0xfd, 0x01, 0x00, 0x70, 0x5f, 0xf7, 0xfe, 0xab, 0x6b,
+ 0x02, 0xa0, 0xa8, 0xb4, 0x6d, 0xdf, 0xf6, 0x07, 0x00, 0x00, 0xf8, 0x01,
+ 0x00, 0x12, 0x33, 0x11, 0xd9, 0xdd, 0xff, 0x01, 0x00, 0x70, 0x75, 0xd5,
+ 0x52, 0xea, 0x8a, 0x03, 0x20, 0x84, 0x36, 0x69, 0xba, 0xdb, 0x07, 0x00,
+ 0x00, 0xf0, 0x01, 0x00, 0x81, 0xc8, 0xcc, 0xdd, 0xed, 0xff, 0x00, 0x00,
+ 0x60, 0xd5, 0xdf, 0xf6, 0xae, 0x6b, 0x03, 0x00, 0xa1, 0xa4, 0x6d, 0xdf,
+ 0xfe, 0x07, 0x00, 0x00, 0x60, 0x00, 0x40, 0x44, 0xc6, 0xcc, 0x64, 0xb7,
+ 0xfd, 0x00, 0x00, 0xe0, 0x55, 0xf7, 0xd6, 0xea, 0xba, 0x07, 0x20, 0x94,
+ 0x94, 0x6d, 0xfb, 0xdb, 0x07, 0x00, 0x00, 0x20, 0x00, 0x20, 0x20, 0x32,
+ 0x76, 0x77, 0xff, 0x7f, 0x00, 0x00, 0x60, 0x7d, 0xd5, 0xb6, 0x3f, 0xaf,
+ 0x06, 0xa0, 0xa4, 0x95, 0x6c, 0x9b, 0xee, 0x07, 0x00, 0x00, 0x18, 0x00,
+ 0x10, 0x92, 0x15, 0x73, 0xbb, 0xd9, 0x3f, 0x00, 0x00, 0xe0, 0xf5, 0xff,
+ 0xf7, 0x6a, 0xa9, 0x06, 0x80, 0xa2, 0xb4, 0x6d, 0xfb, 0xfb, 0x07, 0x00,
+ 0x00, 0x04, 0x00, 0x84, 0x88, 0xc8, 0x99, 0xdd, 0xff, 0x3f, 0x00, 0x00,
+ 0xe0, 0x8b, 0xff, 0x96, 0x6a, 0xb6, 0x0a, 0xa0, 0x94, 0x96, 0x64, 0xdb,
+ 0xee, 0x07, 0x00, 0x00, 0x03, 0x08, 0x20, 0x60, 0x66, 0xec, 0xee, 0xb6,
+ 0x1d, 0x00, 0x00, 0xc0, 0x7e, 0xa5, 0xf4, 0xab, 0x55, 0x0d, 0x20, 0xe7,
+ 0xd4, 0x6d, 0xdb, 0xfb, 0x07, 0x00, 0x80, 0x00, 0x00, 0x09, 0x12, 0x33,
+ 0x67, 0x77, 0xff, 0x0f, 0x00, 0x00, 0xc0, 0xfa, 0xff, 0xb7, 0x7a, 0x55,
+ 0x19, 0x90, 0x91, 0xd4, 0x64, 0xdb, 0xee, 0x07, 0x00, 0x40, 0x00, 0x81,
+ 0x04, 0x88, 0x91, 0x3b, 0xbb, 0xfd, 0x0f, 0x00, 0x00, 0xc0, 0xab, 0xbf,
+ 0xed, 0x4e, 0xbb, 0x32, 0x20, 0x94, 0x96, 0x6c, 0xff, 0xfa, 0x03, 0x00,
+ 0x30, 0x40, 0x20, 0x20, 0x64, 0xcc, 0xdc, 0xdd, 0xff, 0x07, 0x00, 0x00,
+ 0xc0, 0xeb, 0xea, 0xfd, 0xd5, 0xaa, 0x2a, 0x20, 0xd7, 0xb0, 0x6d, 0x93,
+ 0xef, 0x07, 0x00, 0x08, 0x00, 0x08, 0x01, 0x23, 0xee, 0xee, 0xee, 0xfb,
+ 0x03, 0x00, 0x00, 0xc0, 0xfe, 0xff, 0x2d, 0xdd, 0x6a, 0x49, 0xd0, 0x90,
+ 0x9a, 0x64, 0xdf, 0xea, 0x07, 0x00, 0x03, 0x80, 0x40, 0x8c, 0x98, 0x33,
+ 0xb3, 0xbb, 0xff, 0x01, 0x00, 0x00, 0xc0, 0xa5, 0x7b, 0x6d, 0xa7, 0x56,
+ 0xc5, 0xa0, 0x94, 0x94, 0x6f, 0xd3, 0xbb, 0x07, 0x80, 0x10, 0x0c, 0x12,
+ 0x40, 0xc6, 0xb9, 0xdb, 0xfb, 0xfd, 0x01, 0x00, 0x00, 0x80, 0x97, 0xee,
+ 0xdf, 0xba, 0x54, 0x1a, 0xa1, 0xe5, 0xd2, 0x64, 0x7e, 0xee, 0x07, 0x60,
+ 0x02, 0x80, 0x00, 0x31, 0x62, 0xcc, 0xdc, 0xee, 0x7f, 0x00, 0x00, 0x00,
+ 0x80, 0xff, 0xff, 0xdb, 0xaa, 0xb5, 0x8a, 0x86, 0x98, 0x96, 0x6d, 0x9b,
+ 0xea, 0x07, 0x98, 0x00, 0x22, 0x44, 0x88, 0x39, 0x77, 0x77, 0xff, 0x7f,
+ 0x00, 0x00, 0x00, 0x80, 0x7d, 0x77, 0xba, 0x7b, 0x2d, 0x55, 0x3c, 0xa6,
+ 0xb4, 0x6c, 0xf6, 0xaf, 0x07, 0x07, 0x90, 0x88, 0x20, 0x42, 0x9c, 0xbb,
+ 0xbb, 0xbb, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x4b, 0xbd, 0xbf, 0x55, 0x53,
+ 0xa5, 0xb2, 0xa1, 0xb4, 0xc9, 0x9f, 0xda, 0xcf, 0x28, 0x24, 0x42, 0x08,
+ 0x31, 0xe6, 0xcc, 0xdd, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xef,
+ 0xb7, 0xbd, 0xde, 0x12, 0xd1, 0xac, 0x95, 0x4d, 0xf2, 0x56, 0x9f, 0x88,
+ 0x80, 0x10, 0xc2, 0x9c, 0x73, 0x77, 0xef, 0xfe, 0x7f, 0x00, 0x00, 0x00,
+ 0x00, 0xbf, 0xfb, 0xed, 0xeb, 0x35, 0x95, 0x72, 0xa2, 0x35, 0xcd, 0xb6,
+ 0xd6, 0x2f, 0x21, 0x24, 0x04, 0x31, 0xc6, 0x98, 0x33, 0xf7, 0xff, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0xd6, 0x6a, 0x7f, 0x5b, 0xab, 0x2d, 0x28, 0x23,
+ 0x65, 0xd9, 0xb6, 0x55, 0x5f, 0x88, 0x08, 0x43, 0x0c, 0x61, 0xde, 0xdd,
+ 0xfb, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x76, 0xff, 0x4d, 0xd7, 0x4d,
+ 0x4a, 0xa5, 0x29, 0x2d, 0xdb, 0xbe, 0x55, 0x1f, 0x22, 0x42, 0x28, 0xc2,
+ 0x39, 0xe7, 0xee, 0xee, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x7f,
+ 0xfb, 0xb6, 0xb6, 0x95, 0x70, 0x2e, 0xa5, 0xd9, 0x24, 0x5d, 0x5f, 0x8a,
+ 0x28, 0x88, 0x31, 0x9e, 0x39, 0x73, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
+ 0x00, 0xec, 0xb7, 0xdf, 0x6c, 0xb5, 0x65, 0x26, 0xa3, 0x39, 0x9b, 0xfc,
+ 0x85, 0x5d, 0x21, 0x04, 0x63, 0x1c, 0xe6, 0xdd, 0xbd, 0xfb, 0xff, 0xff,
+ 0x01, 0x00, 0x00, 0x00, 0xb8, 0xfa, 0xb6, 0x6f, 0x4d, 0x9a, 0x28, 0x59,
+ 0x4d, 0xd3, 0x2f, 0xf5, 0x3f, 0x8c, 0xd1, 0x18, 0xc6, 0x31, 0xf6, 0xdd,
+ 0xfe, 0xff, 0xfe, 0x01, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xef, 0xb9, 0xb6,
+ 0x25, 0xe1, 0x4d, 0x69, 0xba, 0x6c, 0xad, 0x3c, 0x41, 0x14, 0x84, 0xe9,
+ 0x9e, 0x37, 0xf7, 0xff, 0xff, 0xfb, 0x03, 0x00, 0x00, 0x00, 0x70, 0x5d,
+ 0x3d, 0x9f, 0x3d, 0x6d, 0x26, 0x52, 0x59, 0xb6, 0x6d, 0xab, 0x7f, 0x14,
+ 0x82, 0xe1, 0x39, 0xe6, 0xdd, 0xfb, 0xff, 0xbf, 0xff, 0x01, 0x00, 0x00,
+ 0x00, 0xf0, 0xf6, 0x6f, 0x77, 0xcd, 0x92, 0xd0, 0x52, 0x4b, 0xb3, 0x49,
+ 0x0b, 0x3a, 0x41, 0x61, 0x38, 0x9e, 0x73, 0xee, 0xdc, 0xff, 0xff, 0xfd,
+ 0x03, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xd7, 0x65, 0xda, 0x66, 0x63, 0x9d,
+ 0xf2, 0x36, 0x7b, 0x6a, 0x7f, 0x14, 0x18, 0x8e, 0xe7, 0xd9, 0x7b, 0xff,
+ 0xff, 0xef, 0xff, 0x03, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xdd, 0xb6,
+ 0xc9, 0x4c, 0x46, 0x9a, 0x64, 0xcb, 0x5b, 0xed, 0x06, 0xc6, 0xe3, 0x71,
+ 0xde, 0xbd, 0xff, 0xff, 0x7f, 0xff, 0x07, 0x00, 0x00, 0x00, 0xc0, 0x7f,
+ 0x7f, 0xff, 0x59, 0x37, 0x75, 0xbb, 0x96, 0x66, 0xdb, 0x56, 0xf7, 0xe0,
+ 0xf2, 0x74, 0x9e, 0x77, 0xef, 0xfd, 0xff, 0xeb, 0xed, 0x03, 0x00, 0x00,
+ 0x00, 0xc0, 0xea, 0xdf, 0xb3, 0xdb, 0xde, 0xc6, 0x81, 0xb0, 0x6c, 0xba,
+ 0xb4, 0xf6, 0x38, 0x18, 0x3c, 0xe7, 0x9c, 0xfb, 0xff, 0x7f, 0xff, 0xff,
+ 0x07, 0x00, 0x00, 0x00, 0x80, 0xff, 0xf7, 0x6e, 0x66, 0xd9, 0x99, 0xac,
+ 0xa4, 0xcd, 0x96, 0xa5, 0xea, 0x03, 0xa7, 0xcf, 0x79, 0xef, 0xfd, 0xff,
+ 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xff, 0xfd, 0xef, 0xdf,
+ 0x6f, 0xef, 0x72, 0x65, 0xd9, 0xb6, 0xad, 0xe8, 0xc1, 0xe1, 0xf1, 0xbe,
+ 0x7b, 0xef, 0xff, 0xdf, 0x7a, 0xfb, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfe,
+ 0x5f, 0xdd, 0x9d, 0xac, 0x99, 0x84, 0x29, 0xcd, 0x3c, 0x4f, 0x9d, 0x7d,
+ 0x3c, 0x9e, 0xe7, 0xbe, 0xff, 0xff, 0xff, 0xff, 0xef, 0x0f, 0x00, 0x00,
+ 0x00, 0x00, 0xfe, 0xff, 0x77, 0x7b, 0x33, 0xe7, 0x5a, 0x49, 0x9b, 0x65,
+ 0x59, 0x75, 0x07, 0x97, 0xf7, 0xbb, 0xef, 0xff, 0xff, 0xdb, 0xfe, 0xff,
+ 0x07, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xf7, 0x3f, 0xe7, 0xcf, 0x9c, 0x51,
+ 0x4d, 0xb0, 0x6d, 0x4b, 0xc9, 0xd3, 0xf5, 0x79, 0xfe, 0xfb, 0xff, 0xff,
+ 0xdb, 0xda, 0xfe, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xef, 0xde,
+ 0xdd, 0xf3, 0x4d, 0x52, 0x36, 0xcb, 0xd2, 0x3a, 0x7e, 0x3c, 0xde, 0xe7,
+ 0xbe, 0xff, 0x7f, 0xda, 0xff, 0xdf, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf8,
+ 0xff, 0xfb, 0xdd, 0x73, 0x8f, 0xa5, 0x9a, 0xe6, 0xd9, 0xb6, 0xe2, 0x4e,
+ 0xc7, 0xf7, 0xfd, 0xff, 0xff, 0xff, 0xf7, 0xf6, 0xff, 0x0f, 0x00, 0x00,
+ 0x00, 0x00, 0xe0, 0xff, 0xff, 0x7f, 0xee, 0x79, 0xb2, 0xb2, 0x2c, 0x9f,
+ 0xb6, 0x54, 0xfe, 0xfb, 0x79, 0xbf, 0xff, 0xff, 0x5f, 0xda, 0xff, 0xfa,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xf7, 0xbf, 0xe7, 0x4b,
+ 0xb4, 0x69, 0xd3, 0x2c, 0x25, 0xbd, 0xbc, 0xcf, 0xf7, 0xfd, 0xff, 0xd7,
+ 0xf6, 0xfe, 0xdf, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xbf, 0x9d,
+ 0xf1, 0x3e, 0x57, 0x25, 0xcb, 0xb6, 0x6d, 0xa9, 0xb5, 0xef, 0xfb, 0xff,
+ 0xff, 0xff, 0xd5, 0xda, 0xd6, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x80,
+ 0xff, 0xff, 0xfb, 0xcf, 0xf5, 0x25, 0x65, 0xd9, 0x66, 0x5b, 0x4a, 0xfa,
+ 0xf9, 0x7e, 0xff, 0xff, 0xff, 0xf6, 0xd6, 0xdf, 0xfa, 0x0f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xfe, 0xff, 0xef, 0x3e, 0xf7, 0x9f, 0x5b, 0x92, 0x6c,
+ 0xdb, 0x52, 0xe5, 0xbe, 0xdf, 0xff, 0xff, 0xbf, 0x51, 0xda, 0xfa, 0x7f,
+ 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x7b, 0x9f, 0xe7,
+ 0x4c, 0xb3, 0x4d, 0xd3, 0x54, 0xd9, 0xe7, 0xfb, 0xff, 0xff, 0x5f, 0xdc,
+ 0xfa, 0xdf, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x7f,
+ 0xe7, 0xf9, 0x3a, 0xd3, 0xa6, 0xe9, 0xb6, 0xa5, 0xca, 0xf9, 0xfd, 0xff,
+ 0xff, 0x83, 0x42, 0xd2, 0xff, 0xfb, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xf0, 0xff, 0xfd, 0xbf, 0xef, 0x4f, 0xd5, 0x64, 0xdb, 0x26, 0x4d, 0x30,
+ 0x7f, 0xff, 0xff, 0xff, 0x91, 0xda, 0xdb, 0xda, 0xdf, 0x1f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xe0, 0xff, 0xbf, 0xff, 0x7d, 0xbe, 0xb5, 0x6d, 0x97,
+ 0x6d, 0x93, 0x56, 0xdf, 0xff, 0xff, 0x7f, 0x81, 0x4a, 0xda, 0x7f, 0xff,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xef, 0xeb, 0xbb,
+ 0xa6, 0x4d, 0x73, 0xcd, 0x92, 0xaa, 0xfe, 0xff, 0xff, 0x1f, 0x01, 0x6a,
+ 0x5b, 0xfb, 0xfb, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
+ 0xfd, 0xbf, 0x5f, 0x3b, 0xdb, 0x36, 0xbb, 0x26, 0x4c, 0xf9, 0xff, 0xff,
+ 0x0f, 0xa3, 0x2a, 0xe9, 0x7f, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xee, 0xff, 0xff, 0xfe, 0xfe, 0xcc, 0x91, 0xec, 0x93, 0x6d, 0x93,
+ 0xf2, 0xff, 0xff, 0x03, 0x00, 0x6a, 0x6d, 0x6f, 0xff, 0x1f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xf7, 0x6f, 0x76, 0xb6, 0xcd,
+ 0x76, 0xc9, 0x2a, 0xe9, 0xff, 0xff, 0x00, 0x02, 0x24, 0xed, 0xf9, 0xed,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xdf, 0xff,
+ 0xd9, 0x66, 0x9b, 0x6c, 0x93, 0x54, 0xc5, 0xff, 0x3f, 0x00, 0x01, 0x95,
+ 0xb5, 0xaf, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff,
+ 0xff, 0xff, 0xfd, 0xae, 0x7d, 0xde, 0x6d, 0xf6, 0xa1, 0x8a, 0xff, 0x0f,
+ 0x00, 0x81, 0x90, 0xb4, 0xfd, 0xfd, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xcd, 0xb2, 0xdb, 0x2c, 0xcb,
+ 0x54, 0xfe, 0x01, 0x00, 0x01, 0xd2, 0xb6, 0xb7, 0xff, 0x0f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x39, 0xdb, 0x76,
+ 0xb3, 0x4b, 0xb6, 0x0a, 0xfe, 0x00, 0x00, 0x01, 0x48, 0xda, 0xfe, 0xff,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff,
+ 0xcf, 0xb9, 0x6d, 0xb6, 0xd9, 0xa5, 0x75, 0x1c, 0x00, 0x80, 0x80, 0x20,
+ 0xdb, 0xda, 0xbe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
+ 0xff, 0xff, 0xff, 0x77, 0x96, 0xd9, 0x26, 0xb3, 0x4d, 0x82, 0x11, 0x00,
+ 0x80, 0x80, 0x24, 0x6d, 0xff, 0xf7, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xbb, 0x67, 0xdb, 0xdd, 0x36, 0xd9,
+ 0x54, 0x60, 0x00, 0xc0, 0x00, 0x92, 0x65, 0x6b, 0xff, 0x0f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x4f, 0x7d, 0x96,
+ 0xd9, 0x6c, 0x36, 0xad, 0xc2, 0x00, 0x60, 0x00, 0xc8, 0xb6, 0x6d, 0xff,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff,
+ 0xff, 0xc8, 0x76, 0xbb, 0xcb, 0x64, 0x52, 0x02, 0x03, 0x10, 0x00, 0x64,
+ 0xda, 0xff, 0xfb, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0xff, 0xff, 0x5f, 0xd7, 0x4d, 0x33, 0x99, 0xdd, 0x96, 0x04, 0x2c,
+ 0x1c, 0x40, 0x22, 0xdb, 0xb6, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xdf, 0xb5, 0xed, 0xe6, 0x36, 0x9b,
+ 0x6c, 0x29, 0xf0, 0x03, 0x00, 0x99, 0x6c, 0xfb, 0xfd, 0x07, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x35, 0xbb,
+ 0xec, 0x76, 0x33, 0x91, 0x02, 0x00, 0x00, 0x00, 0x64, 0x67, 0xdf, 0xff,
+ 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
+ 0xbf, 0x6f, 0x9b, 0x9d, 0xc9, 0xce, 0x36, 0x49, 0x00, 0x00, 0x00, 0x93,
+ 0xb1, 0xdd, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x40, 0xff, 0x6a, 0x76, 0xbb, 0xdd, 0xd9, 0x64, 0x12, 0x01,
+ 0x00, 0x40, 0x98, 0xdd, 0x6d, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xdf, 0x66, 0x73, 0x33, 0xbb,
+ 0x9d, 0x4d, 0x00, 0x00, 0x00, 0x63, 0xe6, 0xf6, 0xff, 0x07, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xed, 0xfd,
+ 0xee, 0xee, 0x36, 0x73, 0x2b, 0x04, 0x00, 0xa0, 0x38, 0x75, 0xbf, 0xff,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x7f, 0xd9, 0xec, 0xce, 0x66, 0x66, 0x66, 0x22, 0x04, 0x00, 0xc6,
+ 0x99, 0xbb, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x5e, 0xb3, 0xdb, 0xb9, 0xcd, 0xc9, 0x88, 0x89,
+ 0x00, 0x68, 0x31, 0xee, 0xdd, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xbe, 0xbb, 0x9b, 0x3f,
+ 0xbb, 0x33, 0x23, 0x04, 0x00, 0x8c, 0xf3, 0xee, 0xff, 0x03, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x67,
+ 0x76, 0x77, 0xb2, 0x66, 0xce, 0x0c, 0xd1, 0xd6, 0xe3, 0x79, 0xf7, 0xff,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf8, 0xfd, 0xef, 0xe6, 0xee, 0xce, 0x9c, 0x31, 0x16, 0x00, 0x3c,
+ 0x9e, 0xfb, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x78, 0x9f, 0xdb, 0xdc, 0x9d, 0x99, 0x33, 0xc6,
+ 0xc1, 0xff, 0x8f, 0xe7, 0xbb, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf7, 0xbd, 0xbb, 0x33,
+ 0x7b, 0xee, 0x18, 0x1e, 0x50, 0xf0, 0xf9, 0xfe, 0xff, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7b,
+ 0xf7, 0x77, 0xf7, 0xe6, 0x9c, 0xe3, 0xf0, 0x4d, 0xff, 0x7c, 0xef, 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xc0, 0xdf, 0x76, 0x7f, 0xcf, 0x9e, 0x73, 0x8f, 0x07, 0xff, 0x0b,
+ 0xdf, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0xee, 0xcd, 0xdd, 0x9d, 0x7b, 0xf7, 0x7c,
+ 0x7a, 0x00, 0xf0, 0xe7, 0xfd, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7f, 0xbf, 0xdd, 0x7b,
+ 0x6b, 0x9e, 0xf3, 0xe1, 0xff, 0xff, 0x7d, 0xff, 0x7f, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee,
+ 0xb7, 0xbb, 0x7b, 0xee, 0x79, 0x8f, 0x0f, 0xfa, 0x2f, 0xff, 0xf7, 0x3f,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x7e, 0xff, 0x77, 0xef, 0xdd, 0x77, 0x7c, 0xfe, 0x02, 0xe8,
+ 0xcf, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xef, 0xee, 0xdd, 0xb3, 0xcf, 0xf3,
+ 0xf1, 0xff, 0xff, 0xf9, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfb, 0xff, 0xbf,
+ 0xef, 0xbe, 0xcf, 0x8f, 0xfe, 0x5f, 0xfe, 0xff, 0x0f, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
+ 0xbf, 0xbb, 0xf7, 0xde, 0x79, 0x3e, 0xff, 0x52, 0xd2, 0xdf, 0xff, 0x0f,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xe0, 0xef, 0xef, 0xef, 0x3c, 0xef, 0xf9, 0xf8, 0xff, 0xff,
+ 0xf7, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xee, 0xdc, 0xf7, 0xfe, 0xe7,
+ 0x97, 0xfe, 0xff, 0xfe, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbf,
+ 0xef, 0xbf, 0x3e, 0xff, 0xda, 0xf6, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xfe, 0xbf, 0xf7, 0xfe, 0xf7, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xfe, 0xff, 0xde, 0xbd, 0xef, 0xfb, 0xd7, 0xff, 0xbf,
+ 0xfd, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xf7, 0x7d, 0xbf,
+ 0xff, 0xd2, 0xf6, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xbf,
+ 0xef, 0xfb, 0xfd, 0xfd, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xc0, 0xff, 0xef, 0xbe, 0xf7, 0xef, 0xef, 0xff, 0xff, 0xff, 0x3f, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfb, 0xdf, 0xbf, 0xff, 0xff, 0xff,
+ 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x7f, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff,
+ 0xfe, 0xff, 0xfb, 0xf7, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xf0, 0xff, 0xff, 0xff, 0xdf, 0xff, 0xfd, 0xff, 0xff, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x07,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
+ 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ };
+
+# define GCBits        (GCFillStyle|GCTileStipXOrigin|GCTileStipYOrigin)
+
+void SetFillStyle(XParms xp, Parms p)
+{
+    int            xorg = 0, yorg = 0;
+
+    if (p->fillStyle == FillStippled || p->fillStyle == FillOpaqueStippled) {
+       Pixmap      stipple;
+       XGCValues   gcv;
+
+       if (!p->font) {
+           /* Little 8x8 stipple */
+           stipple = XCreateBitmapFromData(xp->d, xp->w, (char *)bitmap8x8, 8, 8);
+       } else if (!strcmp (p->font, "escherknot")) {
+           /* Enormous stipple which is x4 bits wide */
+           stipple = XCreateBitmapFromData(xp->d, xp->w,
+                       (char *)escherknot_bits, escherknot_width, escherknot_height);
+           xorg = -3;
+       } else if (!strcmp (p->font, "OddTile")) {
+           /* Odd sized tile */
+           stipple = XCreateBitmapFromData(xp->d, xp->w,
+                       (char *)oddbit_bits, oddbit_width, oddbit_height);
+       } else {
+           /* Enormous stipple.  Well, pretty big. */
+           stipple = XCreateBitmapFromData(xp->d, xp->w,
+                      (char *)mensetmanus_bits, mensetmanus_width, mensetmanus_height);
+       }
+
+       gcv.stipple = stipple;
+       gcv.fill_style = p->fillStyle;
+       gcv.ts_x_origin = xorg;
+       gcv.ts_y_origin = yorg;
+       XChangeGC(xp->d, xp->fggc, GCBits | GCStipple, &gcv);
+       XChangeGC(xp->d, xp->bggc, GCBits | GCStipple, &gcv);
+       XFreePixmap(xp->d, stipple);
+
+    } else if (p->fillStyle == FillTiled) {
+       Pixmap      tile;
+       XGCValues   gcv;
+
+       gcv.fill_style = FillTiled;
+       if (!p->font) {
+           /* Little 4x4 tile */
+           tile = XCreatePixmapFromBitmapData(xp->d, xp->w, (char *)bitmap4x4, 4, 4,
+                   xp->foreground, xp->background, xp->vinfo.depth);
+       } else if (!strcmp (p->font, "escherknot")) {
+           /* Enormous stipple which is x4 bits wide */
+           tile = XCreatePixmapFromBitmapData(xp->d, xp->w,
+                   (char *)escherknot_bits, escherknot_width, escherknot_height,
+                   xp->foreground, xp->background, xp->vinfo.depth);
+           /* align tile with screen */
+           xorg = -3;
+       } else if (!strcmp (p->font, "OddTile")) {
+           /* Odd sized tile */
+           tile = XCreatePixmapFromBitmapData(xp->d, xp->w,
+                   (char *)oddbit_bits, oddbit_width, oddbit_height,
+                   xp->foreground, xp->background, xp->vinfo.depth);
+           /* align tile with screen */
+       } else {
+           /* Enormous tile.  Well, pretty big. */
+           tile = XCreatePixmapFromBitmapData(xp->d, xp->w,
+                   (char *)mensetmanus_bits, mensetmanus_width, mensetmanus_height,
+                   xp->foreground, xp->background, xp->vinfo.depth);
+       }
+       gcv.tile = tile;
+       gcv.ts_x_origin = xorg;
+       gcv.ts_y_origin = yorg;
+       XChangeGC(xp->d, xp->fggc, GCBits | GCTile, &gcv);
+       XFreePixmap(xp->d, tile);
+       if (!p->font) {
+           /* Little 4x4 tile */
+           tile = XCreatePixmapFromBitmapData(xp->d, xp->w, (char *)bitmap4x4, 4, 4,
+                   xp->background, xp->foreground, xp->vinfo.depth);
+       } else if (!strcmp (p->font, "escherknot")) {
+           /* Enormous stipple which is x4 bits wide */
+           tile = XCreatePixmapFromBitmapData(xp->d, xp->w,
+                   (char *)escherknot_bits, escherknot_width, escherknot_height,
+                   xp->background, xp->foreground, xp->vinfo.depth);
+       } else if (!strcmp (p->font, "OddTile")) {
+           /* Odd sized tile */
+           tile = XCreatePixmapFromBitmapData(xp->d, xp->w,
+                   (char *)oddbit_bits, oddbit_width, oddbit_height,
+                   xp->background, xp->foreground, xp->vinfo.depth);
+       } else {
+           /* Enormous tile.  Well, pretty big. */
+           tile = XCreatePixmapFromBitmapData(xp->d, xp->w,
+                   (char *)mensetmanus_bits, mensetmanus_width, mensetmanus_height,
+                   xp->background, xp->foreground, xp->vinfo.depth);
+       }
+       gcv.tile = tile;
+       XChangeGC(xp->d, xp->bggc, GCFillStyle | GCTile, &gcv);
+       XFreePixmap(xp->d, tile);
+    }
+}
diff --git a/x11perf/bitmaps.h b/x11perf/bitmaps.h
new file mode 100755 (executable)
index 0000000..2971bea
--- /dev/null
@@ -0,0 +1,26 @@
+/*****************************************************************************
+Copyright 1988, 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.
+
+******************************************************************************/
+
+/* Set fill style (if any) to a bitmap or tile */
+
+extern void SetFillStyle(XParms xp, Parms p);
diff --git a/x11perf/config.guess b/x11perf/config.guess
new file mode 100755 (executable)
index 0000000..dc84c68
--- /dev/null
@@ -0,0 +1,1501 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+#   Free Software Foundation, Inc.
+
+timestamp='2009-11-20'
+
+# 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 (context
+# diff format) to <config-patches@gnu.org> and include a 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.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+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 <config-patches@gnu.org>."
+
+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, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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 "$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 ;;
+           sh5el) machine=sh5le-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 -q __ELF__
+               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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+       echo i386-pc-auroraux${UNAME_RELEASE}
+       exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+       eval $set_cc_for_build
+       SUN_ARCH="i386"
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       echo ${SUN_ARCH}-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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:*:[456])
+       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+               IBM_ARCH=rs6000
+       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 <stdlib.h>
+              #include <unistd.h>
+
+              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 -q __LP64__
+           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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       exit ;;
+    i*:CYGWIN*:*)
+       echo ${UNAME_MACHINE}-pc-cygwin
+       exit ;;
+    *: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 ;;
+    *:Interix*:*)
+       case ${UNAME_MACHINE} in
+           x86)
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           authenticamd | genuineintel | EM64T)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+           IA64)
+               echo ia64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+       esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       exit ;;
+    8664:Windows_NT:*)
+       echo x86_64-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*:*:* | x86_64: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 ;;
+    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 -q ld.so.1
+       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+       exit ;;
+    arm*:Linux:*:*)
+       eval $set_cc_for_build
+       if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_EABI__
+       then
+           echo ${UNAME_MACHINE}-unknown-linux-gnu
+       else
+           echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+       fi
+       exit ;;
+    avr32*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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 ;;
+    i*86:Linux:*:*)
+       LIBC=gnu
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+       echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+       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:*:* | mips64:Linux:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #undef CPU
+       #undef ${UNAME_MACHINE}
+       #undef ${UNAME_MACHINE}el
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=${UNAME_MACHINE}el
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       CPU=${UNAME_MACHINE}
+       #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; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-unknown-linux-gnu
+       exit ;;
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-gnu
+       exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+       echo hppa64-unknown-linux-gnu
+       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 ;;
+    ppc64:Linux:*:*)
+       echo powerpc64-unknown-linux-gnu
+       exit ;;
+    ppc:Linux:*:*)
+       echo powerpc-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 ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-gnu
+       exit ;;
+    x86_64:Linux:*:*)
+       echo x86_64-unknown-linux-gnu
+       exit ;;
+    xtensa*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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.[02]*:*)
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-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; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       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; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; 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.[02]*:*)
+       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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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 ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       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 ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-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
+           i386)
+               eval $set_cc_for_build
+               if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+                 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+                     (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+                     grep IS_64BIT_ARCH >/dev/null
+                 then
+                     UNAME_PROCESSOR="x86_64"
+                 fi
+               fi ;;
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/x11perf/config.h.in b/x11perf/config.h.in
new file mode 100755 (executable)
index 0000000..e6479ca
--- /dev/null
@@ -0,0 +1,79 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `XShmQueryExtension' function. */
+#undef HAVE_XSHMQUERYEXTENSION
+
+/* MIT-SHM extension available */
+#undef MITSHM
+
+/* 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 home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Xft library available */
+#undef XFT
+
+/* Xrender library available */
+#undef XRENDER
diff --git a/x11perf/config.sub b/x11perf/config.sub
new file mode 100755 (executable)
index 0000000..2a55a50
--- /dev/null
@@ -0,0 +1,1705 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+#   Free Software Foundation, Inc.
+
+timestamp='2009-11-20'
+
+# 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 <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted GNU 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.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# 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 <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-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 | -microblaze)
+               os=
+               basic_machine=$1
+               ;;
+        -bluegene*)
+               os=-cnk
+               ;;
+       -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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | bfin \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fido | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | lm32 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore | mep | metag \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64octeon | mips64octeonel \
+       | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | moxie \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | rx \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | ubicom32 \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | z8k | z80)
+               basic_machine=$basic_machine-unknown
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12 | picochip)
+               # Motorola 68HC11/12.
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64octeon-* | mips64octeonel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | none-* | np1-* | ns16k-* | ns32k-* \
+       | orion-* \
+       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+       | pyramid-* \
+       | romp-* | rs6000-* | rx-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+       | tron-* \
+       | ubicom32-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa*-* \
+       | ymp-* \
+       | z8k-* | z80-*)
+               ;;
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               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
+               ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       bluegene*)
+               basic_machine=powerpc-ibm
+               os=-cnk
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+        cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
+       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
+               ;;
+       cr16)
+               basic_machine=cr16-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
+               ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
+       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
+               ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       m88k-omron*)
+               basic_machine=m88k-omron
+               ;;
+       magnum | m3230)
+               basic_machine=mips-mips
+               os=-sysv
+               ;;
+       merlin)
+               basic_machine=ns32k-utek
+               os=-sysv
+               ;;
+        microblaze)
+               basic_machine=microblaze-xilinx
+               ;;
+       mingw32)
+               basic_machine=i386-pc
+               os=-mingw32
+               ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
+       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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       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
+               ;;
+       tile*)
+               basic_machine=tile-unknown
+               os=-linux-gnu
+               ;;
+       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
+               ;;
+       z80-*-coff)
+               basic_machine=z80-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[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+               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.
+        -auroraux)
+               os=-auroraux
+               ;;
+       -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* | -cnk* | -sunos | -sunos[34]*\
+             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+             | -sym* | -kopensolaris* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* | -aros* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
+             | -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* | -cegcc* \
+             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -linux-newlib* | -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* | -rdos* | -toppers* | -drops* | -es*)
+       # 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
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+       -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
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
+       *-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
+               ;;
+        mep-*)
+               os=-elf
+               ;;
+       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
+                               ;;
+                       -cnk*|-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/x11perf/configure b/x11perf/configure
new file mode 100755 (executable)
index 0000000..557b26c
--- /dev/null
@@ -0,0 +1,6526 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.67 for x11perf 1.5.2.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+        /*)
+          for as_base in sh bash ksh sh5; do
+            # Try only shells that exist, to save several forks.
+            as_shell=$as_dir/$as_base
+            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+          done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+       # neutralization value for shells without unset; and this also
+       # works around shells that cannot unset nonexistent variables.
+       BASH_ENV=/dev/null
+       ENV=/dev/null
+       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+       export CONFIG_SHELL
+       exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='x11perf'
+PACKAGE_TARNAME='x11perf'
+PACKAGE_VERSION='1.5.2'
+PACKAGE_STRING='x11perf 1.5.2'
+PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+XEXT_LIBS
+XEXT_CFLAGS
+XFT_LIBS
+XFT_CFLAGS
+XRENDER_LIBS
+XRENDER_CFLAGS
+X11PERF_LIBS
+X11PERF_CFLAGS
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+MAN_SUBSTS
+XORG_MAN_PAGE
+ADMIN_MAN_DIR
+DRIVER_MAN_DIR
+MISC_MAN_DIR
+FILE_MAN_DIR
+LIB_MAN_DIR
+APP_MAN_DIR
+ADMIN_MAN_SUFFIX
+DRIVER_MAN_SUFFIX
+MISC_MAN_SUFFIX
+FILE_MAN_SUFFIX
+LIB_MAN_SUFFIX
+APP_MAN_SUFFIX
+SED
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+INSTALL_CMD
+PKG_CONFIG
+CHANGELOG_CMD
+CWARNFLAGS
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_strict_compilation
+enable_silent_rules
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+PKG_CONFIG
+X11PERF_CFLAGS
+X11PERF_LIBS
+XRENDER_CFLAGS
+XRENDER_LIBS
+XFT_CFLAGS
+XFT_LIBS
+XEXT_CFLAGS
+XEXT_LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=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 ;;
+
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_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'`
+  as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+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
+    $as_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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 x11perf 1.5.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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/x11perf]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_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 x11perf 1.5.2:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --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
+  --enable-strict-compilation
+                          Enable all warnings from compiler and make them
+                          errors (default: disabled)
+  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  PKG_CONFIG  path to pkg-config utility
+  X11PERF_CFLAGS
+              C compiler flags for X11PERF, overriding pkg-config
+  X11PERF_LIBS
+              linker flags for X11PERF, overriding pkg-config
+  XRENDER_CFLAGS
+              C compiler flags for XRENDER, overriding pkg-config
+  XRENDER_LIBS
+              linker flags for XRENDER, overriding pkg-config
+  XFT_CFLAGS  C compiler flags for XFT, overriding pkg-config
+  XFT_LIBS    linker flags for XFT, overriding pkg-config
+  XEXT_CFLAGS C compiler flags for XEXT, overriding pkg-config
+  XEXT_LIBS   linker flags for XEXT, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+x11perf configure 1.5.2
+generated by GNU Autoconf 2.67
+
+Copyright (C) 2010 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
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_decl
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* 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_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_func
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by x11perf $as_me 1.5.2, which was
+generated by GNU Autoconf 2.67.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append 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
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > 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
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+  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.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_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 $ac_precious_vars; 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,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_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
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_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.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+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.11'
+
+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
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$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'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# 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".
+      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "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 $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+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='x11perf'
+ VERSION='1.5.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"}
+
+# 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 -'
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-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
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$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
+
+
+
+# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
+
+
+
+
+
+
+
+
+
+
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-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
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+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
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM 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.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+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
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+  $as_echo_n "(cached) " >&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
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$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
+
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if test "${ac_cv_prog_cc_c99+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+       {
+       case 's': // string
+         str = va_arg (args_copy, const char *);
+         break;
+       case 'd': // int
+         number = va_arg (args_copy, int);
+         break;
+       case 'f': // float
+         fnumber = va_arg (args_copy, double);
+         break;
+       default:
+         break;
+       }
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+         || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+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
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${ac_cv_path_SED+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  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_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+
+
+
+
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast -Wformat=2"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default"
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then :
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+
+
+
+# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
+
+
+
+# Check whether --enable-strict-compilation was given.
+if test "${enable_strict_compilation+set}" = set; then :
+  enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval
+else
+  STRICT_COMPILE=no
+fi
+
+if test "x$STRICT_COMPILE" = "xyes"; then
+       ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default"
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then :
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+       ac_fn_c_check_decl "$LINENO" "__INTEL_COMPILER" "ac_cv_have_decl___INTEL_COMPILER" "$ac_includes_default"
+if test "x$ac_cv_have_decl___INTEL_COMPILER" = x""yes; then :
+  INTELCC="yes"
+else
+  INTELCC="no"
+fi
+
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+
+
+
+
+macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
+INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+XORG_MAN_PAGE="X Version 11"
+
+MAN_SUBSTS="\
+       -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xservername__|Xorg|g' \
+       -e 's|__xconfigfile__|xorg.conf|g' \
+       -e 's|__projectroot__|\$(prefix)|g' \
+       -e 's|__apploaddir__|\$(appdefaultdir)|g' \
+       -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
+       -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
+       -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
+       -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
+       -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
+       -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
+
+
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=0;;
+esac
+AM_BACKSLASH='\'
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
+$as_echo_n "checking return type of signal handlers... " >&6; }
+if test "${ac_cv_type_signal+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <signal.h>
+
+int
+main ()
+{
+return *(signal (0, 0)) (0) == 1;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_type_signal=int
+else
+  ac_cv_type_signal=void
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
+$as_echo "$ac_cv_type_signal" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define RETSIGTYPE $ac_cv_type_signal
+_ACEOF
+
+
+
+# Checks for pkg-config packages
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11PERF" >&5
+$as_echo_n "checking for X11PERF... " >&6; }
+
+if test -n "$X11PERF_CFLAGS"; then
+    pkg_cv_X11PERF_CFLAGS="$X11PERF_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xmuu\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "x11 xmuu") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_X11PERF_CFLAGS=`$PKG_CONFIG --cflags "x11 xmuu" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$X11PERF_LIBS"; then
+    pkg_cv_X11PERF_LIBS="$X11PERF_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xmuu\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "x11 xmuu") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_X11PERF_LIBS=`$PKG_CONFIG --libs "x11 xmuu" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               X11PERF_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "x11 xmuu" 2>&1`
+        else
+               X11PERF_PKG_ERRORS=`$PKG_CONFIG --print-errors "x11 xmuu" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$X11PERF_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (x11 xmuu) were not met:
+
+$X11PERF_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 X11PERF_CFLAGS
+and X11PERF_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 X11PERF_CFLAGS
+and X11PERF_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+       X11PERF_CFLAGS=$pkg_cv_X11PERF_CFLAGS
+       X11PERF_LIBS=$pkg_cv_X11PERF_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       :
+fi
+
+
+
+# Check for Xrender library
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRENDER" >&5
+$as_echo_n "checking for XRENDER... " >&6; }
+
+if test -n "$XRENDER_CFLAGS"; then
+    pkg_cv_XRENDER_CFLAGS="$XRENDER_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xrender\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xrender") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XRENDER_CFLAGS=`$PKG_CONFIG --cflags "xrender" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XRENDER_LIBS"; then
+    pkg_cv_XRENDER_LIBS="$XRENDER_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xrender\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xrender") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XRENDER_LIBS=`$PKG_CONFIG --libs "xrender" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               XRENDER_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xrender" 2>&1`
+        else
+               XRENDER_PKG_ERRORS=`$PKG_CONFIG --print-errors "xrender" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XRENDER_PKG_ERRORS" >&5
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                xrender_found=no
+elif test $pkg_failed = untried; then
+       xrender_found=no
+else
+       XRENDER_CFLAGS=$pkg_cv_XRENDER_CFLAGS
+       XRENDER_LIBS=$pkg_cv_XRENDER_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       xrender_found=yes
+fi
+
+
+case "$xrender_found" in
+yes)
+
+$as_echo "#define XRENDER 1" >>confdefs.h
+
+       ;;
+esac
+
+# Check for Xft library
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XFT" >&5
+$as_echo_n "checking for XFT... " >&6; }
+
+if test -n "$XFT_CFLAGS"; then
+    pkg_cv_XFT_CFLAGS="$XFT_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xft\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xft") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XFT_CFLAGS=`$PKG_CONFIG --cflags "xft" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XFT_LIBS"; then
+    pkg_cv_XFT_LIBS="$XFT_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xft\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xft") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XFT_LIBS=`$PKG_CONFIG --libs "xft" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               XFT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xft" 2>&1`
+        else
+               XFT_PKG_ERRORS=`$PKG_CONFIG --print-errors "xft" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XFT_PKG_ERRORS" >&5
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                xft_found=no
+elif test $pkg_failed = untried; then
+       xft_found=no
+else
+       XFT_CFLAGS=$pkg_cv_XFT_CFLAGS
+       XFT_LIBS=$pkg_cv_XFT_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       xft_found=yes
+fi
+
+
+case "$xft_found" in
+yes)
+
+$as_echo "#define XFT 1" >>confdefs.h
+
+       ;;
+esac
+
+# Check for MIT-SHM extension
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XEXT" >&5
+$as_echo_n "checking for XEXT... " >&6; }
+
+if test -n "$XEXT_CFLAGS"; then
+    pkg_cv_XEXT_CFLAGS="$XEXT_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xext\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xext") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XEXT_CFLAGS=`$PKG_CONFIG --cflags "xext" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XEXT_LIBS"; then
+    pkg_cv_XEXT_LIBS="$XEXT_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xext\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xext") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XEXT_LIBS=`$PKG_CONFIG --libs "xext" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               XEXT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xext" 2>&1`
+        else
+               XEXT_PKG_ERRORS=`$PKG_CONFIG --print-errors "xext" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XEXT_PKG_ERRORS" >&5
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                xext_found=no
+elif test $pkg_failed = untried; then
+       xext_found=no
+else
+       XEXT_CFLAGS=$pkg_cv_XEXT_CFLAGS
+       XEXT_LIBS=$pkg_cv_XEXT_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       xext_found=yes
+fi
+
+
+case "$xext_found" in
+yes)
+       save_LIBS="$LIBS"
+       LIBS="$XEXT_LIBS $LIBS"
+       for ac_func in XShmQueryExtension
+do :
+  ac_fn_c_check_func "$LINENO" "XShmQueryExtension" "ac_cv_func_XShmQueryExtension"
+if test "x$ac_cv_func_XShmQueryExtension" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_XSHMQUERYEXTENSION 1
+_ACEOF
+
+$as_echo "#define MITSHM 1" >>confdefs.h
+
+fi
+done
+
+       LIBS="$save_LIBS"
+       ;;
+esac
+
+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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     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" &&
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $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}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by x11perf $as_me 1.5.2, which was
+generated by GNU Autoconf 2.67.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+x11perf config.status 1.5.2
+configured by $0, generated by GNU Autoconf 2.67,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+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=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  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 || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries 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[        ]*=[    ]*/{
+h
+s///
+s/^/:/
+s/[     ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[  ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[      ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #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.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # 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.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$_am_arg" : 'X\(//\)[^/]' \| \
+        X"$_am_arg" : 'X\(//\)$' \| \
+        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_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=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# 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 || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/x11perf/configure.ac b/x11perf/configure.ac
new file mode 100755 (executable)
index 0000000..7e2640f
--- /dev/null
@@ -0,0 +1,81 @@
+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.60])
+AC_INIT([x11perf],
+       [1.5.2],
+       [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
+       [x11perf])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+         [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.8)
+
+AM_CONFIG_HEADER(config.h)
+
+XORG_DEFAULT_OPTIONS
+
+AC_TYPE_SIGNAL
+
+# Checks for pkg-config packages
+PKG_CHECK_MODULES(X11PERF, x11 xmuu)
+AC_SUBST(X11PERF_CFLAGS)
+AC_SUBST(X11PERF_LIBS)
+
+# Check for Xrender library
+PKG_CHECK_MODULES(XRENDER, xrender, [xrender_found=yes], [xrender_found=no])
+AC_SUBST(XRENDER_CFLAGS)
+AC_SUBST(XRENDER_LIBS)
+case "$xrender_found" in
+yes)
+       AC_DEFINE(XRENDER,1,[Xrender library available])
+       ;;
+esac
+
+# Check for Xft library
+PKG_CHECK_MODULES(XFT, xft, [xft_found=yes], [xft_found=no])
+AC_SUBST(XFT_CFLAGS)
+AC_SUBST(XFT_LIBS)
+case "$xft_found" in
+yes)
+       AC_DEFINE(XFT,1,[Xft library available])
+       ;;
+esac
+
+# Check for MIT-SHM extension
+PKG_CHECK_MODULES(XEXT, xext, [xext_found=yes], [xext_found=no])
+AC_SUBST(XEXT_CFLAGS)
+AC_SUBST(XEXT_LIBS)
+case "$xext_found" in
+yes)
+       save_LIBS="$LIBS"
+       LIBS="$XEXT_LIBS $LIBS"
+       AC_CHECK_FUNCS([XShmQueryExtension], 
+                      AC_DEFINE(MITSHM, 1, [MIT-SHM extension available]))
+       LIBS="$save_LIBS"
+       ;;
+esac
+
+AC_OUTPUT([Makefile])
diff --git a/x11perf/depcomp b/x11perf/depcomp
new file mode 100755 (executable)
index 0000000..df8eea7
--- /dev/null
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s,\\\\\\\\,/,g"
+   depmode=msvisualcpp
+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.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    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.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[     ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "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"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${
+              s/^ *//
+              s/ \\*$//
+              s/$/:/
+              p
+            }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # 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 mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $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 "X$1" != 'X--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 "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    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.
+    -arch)
+      eat=yes ;;
+    -*|$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 "X$1" != 'X--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.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::     \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # 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
+  ;;
+
+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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/x11perf/do_arcs.c b/x11perf/do_arcs.c
new file mode 100755 (executable)
index 0000000..5c5f1ba
--- /dev/null
@@ -0,0 +1,497 @@
+/*****************************************************************************
+Copyright 1988, 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.
+
+******************************************************************************/
+
+#include "x11perf.h"
+
+static XArc *arcs;
+static GC   pgc;
+
+#define DegreesToX(degrees) (degrees * 64)
+
+static void 
+GenerateCircles(XParms xp, Parms p, Bool partialArcs, Bool ddashed)
+{
+    int     i;
+    int     rows;       /* Number of rows filled in current column         */
+    int     x, y;       /* base of square to draw the circle in                    */
+    int     xorg, yorg; /* Used to get from column to column or row to row  */
+    int     size;
+    int     half;
+    int     startAngle, arcAngle;
+
+    if(ddashed)
+       pgc = xp->ddfggc;
+    else
+       pgc = xp->fggc;
+
+    size = p->special;
+    half = (size + 19) / 20;
+    arcs = (XArc *)malloc((p->objects) * sizeof(XArc));
+    x = xorg = half; y = yorg = half;
+    rows = 0;
+    startAngle = DegreesToX(0);
+    arcAngle = DegreesToX(360);
+
+    for (i = 0; i != p->objects; i++) {    
+       arcs[i].x = x;
+       arcs[i].y = y;
+       arcs[i].width = size;
+       arcs[i].height = size;
+       arcs[i].angle1 = startAngle;
+       arcs[i].angle2 = arcAngle;
+
+       if (partialArcs) {
+           startAngle += DegreesToX(30);
+           if (startAngle >= DegreesToX(360)) startAngle -= DegreesToX(360);
+           arcAngle -= DegreesToX(20);
+           if (arcAngle <= DegreesToX(0)) arcAngle += DegreesToX(360);
+       }
+
+       y += size + 1;
+       rows++;
+       if (y >= HEIGHT - size  - half || rows == MAXROWS) {
+           /* Go to next column */
+           rows = 0;
+           x += size + 1;
+           if (x >= WIDTH - size) {
+               yorg++;
+               if (yorg >= size + half || yorg >= HEIGHT - size - half) {
+                   yorg = half;
+                   xorg++;
+                   if (xorg >= size + half || xorg >= WIDTH - size - half) {
+                       xorg = half;
+                   }
+               }
+               x = xorg;
+           }
+           y = yorg;
+       }
+    }
+}
+
+int 
+InitCircles(XParms xp, Parms p, int reps)
+{
+    GenerateCircles(xp, p, False, False);
+    return reps;
+}
+
+int 
+InitPartCircles(XParms xp, Parms p, int reps)
+{
+    GenerateCircles(xp, p, True, False);
+    return reps;
+}
+
+
+int 
+InitChordPartCircles(XParms xp, Parms p, int reps)
+{
+    GenerateCircles(xp, p, True, False);
+    XSetArcMode(xp->d, xp->bggc, ArcChord);
+    XSetArcMode(xp->d, xp->fggc, ArcChord);
+    return reps;
+}
+
+
+int 
+InitSlicePartCircles(XParms xp, Parms p, int reps)
+{
+    GenerateCircles(xp, p, True, False);
+    XSetArcMode(xp->d, xp->bggc, ArcPieSlice);
+    XSetArcMode(xp->d, xp->fggc, ArcPieSlice);
+    return reps;
+}
+
+static void
+GenerateWideCircles(XParms xp, Parms p, Bool partialArcs, Bool ddashed)
+{
+    int            size;
+
+    GenerateCircles(xp, p, partialArcs, ddashed);
+
+    size = p->special;
+    if(ddashed) {
+       XSetLineAttributes(xp->d, xp->ddbggc, (int) ((size + 9) / 10),
+           LineSolid, CapRound, JoinRound);
+       XSetLineAttributes(xp->d, xp->ddfggc, (int) ((size + 9) / 10),
+           LineSolid, CapRound, JoinRound);
+    }
+    else {
+       XSetLineAttributes(xp->d, xp->bggc, (int) ((size + 9) / 10),
+           LineSolid, CapRound, JoinRound);
+       XSetLineAttributes(xp->d, xp->fggc, (int) ((size + 9) / 10),
+           LineSolid, CapRound, JoinRound);
+    }
+}
+
+int 
+InitWideCircles(XParms xp, Parms p, int reps)
+{
+    GenerateWideCircles (xp, p, False, False);
+    return reps;
+}
+int 
+InitPartWideCircles(XParms xp, Parms p, int reps)
+{
+    GenerateWideCircles (xp, p, True, False);
+    return reps;
+}
+int 
+InitDashedCircles(XParms xp, Parms p, int reps)
+{
+    char dashes[2];
+
+    GenerateCircles(xp, p, False, False);
+
+    /* Modify GCs to draw dashed */
+    XSetLineAttributes(xp->d, xp->bggc, 0, LineOnOffDash, CapButt, JoinMiter);
+    XSetLineAttributes(xp->d, xp->fggc, 0, LineOnOffDash, CapButt, JoinMiter);
+    dashes[0] = 3;   dashes[1] = 2;
+    XSetDashes(xp->d, xp->fggc, 0, dashes, 2);
+    XSetDashes(xp->d, xp->bggc, 0, dashes, 2);
+    return reps;
+}
+
+int 
+InitWideDashedCircles(XParms xp, Parms p, int reps)
+{
+    int                size;
+    XGCValues   gcv;
+    char       dashes[2];
+
+    GenerateWideCircles(xp, p, False, False);
+    size = p->special;
+    size = (size + 9) / 10;
+
+    /* Modify GCs to draw dashed */
+    dashes[0] = 2*size;   dashes[1] = 2*size;
+    gcv.line_style = LineOnOffDash;
+    XChangeGC(xp->d, xp->fggc, GCLineStyle, &gcv);
+    XChangeGC(xp->d, xp->bggc, GCLineStyle, &gcv);
+    XSetDashes(xp->d, xp->fggc, 0, dashes, 2);
+    XSetDashes(xp->d, xp->bggc, 0, dashes, 2);
+    return reps;
+}
+
+int 
+InitDoubleDashedCircles(XParms xp, Parms p, int reps)
+{
+    char dashes[2];
+
+    GenerateCircles(xp, p, False, True);
+
+    /* Modify GCs to draw dashed */
+    XSetLineAttributes(xp->d, xp->ddbggc, 0, LineDoubleDash, CapButt, JoinMiter);
+    XSetLineAttributes(xp->d, xp->ddfggc, 0, LineDoubleDash, CapButt, JoinMiter);
+    dashes[0] = 3;   dashes[1] = 2;
+    XSetDashes(xp->d, xp->ddfggc, 0, dashes, 2);
+    XSetDashes(xp->d, xp->ddbggc, 0, dashes, 2);
+    return reps;
+}
+
+int 
+InitWideDoubleDashedCircles(XParms xp, Parms p, int reps)
+{
+    int                size;
+    XGCValues   gcv;
+    char       dashes[2];
+
+    GenerateWideCircles(xp, p, False, True);
+    size = p->special;
+    size = (size + 9) / 10;
+
+    /* Modify GCs to draw dashed */
+    dashes[0] = 2*size;   dashes[1] = 2*size;
+    gcv.line_style = LineDoubleDash;
+    XChangeGC(xp->d, xp->ddfggc, GCLineStyle, &gcv);
+    XChangeGC(xp->d, xp->ddbggc, GCLineStyle, &gcv);
+    XSetDashes(xp->d, xp->ddfggc, 0, dashes, 2);
+    XSetDashes(xp->d, xp->ddbggc, 0, dashes, 2);
+    return reps;
+}
+
+static void 
+GenerateEllipses(XParms xp, Parms p, int partialArcs, Bool ddashed)
+{
+    int     size;
+    int     half;
+    int     rows;       /* Number of rows filled in current column         */
+    int     i;
+    int     x, y;          /* base of square to draw ellipse in            */
+    int     vsize, vsizeinc;
+    int     dir;
+    int     startAngle, arcAngle;
+
+    if(ddashed)
+       pgc = xp->ddfggc;
+    else
+       pgc = xp->fggc;
+
+    size = p->special;
+    half = (size + 19) / 20;
+    arcs = (XArc *)malloc((p->objects) * sizeof(XArc));
+    vsize = 1;
+    vsizeinc = (size - 1) / (p->objects - 1);
+    if (vsizeinc == 0) vsizeinc = 1;
+
+    x = half; y = half;
+    dir = 0;
+    rows = 0;
+    startAngle = DegreesToX(0);
+    arcAngle = DegreesToX(360);
+
+    for (i = 0; i != p->objects; i++) {    
+       arcs[i].x = x;
+       arcs[i].y = y;
+       if ((i & 1) ^ dir) {
+           /* Make vertical axis longer */
+           arcs[i].width = vsize;
+           arcs[i].height = size;
+       } else {
+           /* Make horizontal axis longer */
+           arcs[i].width = size;
+           arcs[i].height = vsize;
+       }
+       arcs[i].angle1 = startAngle;
+       arcs[i].angle2 = arcAngle;
+
+       if (partialArcs) {
+           startAngle += DegreesToX(30);
+           if (startAngle >= DegreesToX(360)) startAngle -= DegreesToX(360);
+           arcAngle -= DegreesToX(20);
+           if (arcAngle <= DegreesToX(0)) arcAngle += DegreesToX(360);
+       }
+
+       y += size + 1;
+       rows++;
+       if (y >= HEIGHT - size - half || rows == MAXROWS) {
+           /* Go to next column */
+           rows = 0;
+           y = half;
+           x += size + 1;
+           if (x >= WIDTH - size - half) {
+               x = half;
+           }
+       }
+       
+       vsize += vsizeinc;
+       if (vsize > size) {
+           vsize -= size;
+           dir = 1 - dir;
+       }
+    }
+}
+
+int 
+InitEllipses(XParms xp, Parms p, int reps)
+{
+    GenerateEllipses(xp, p, False, False);
+    return reps;
+}
+
+
+int 
+InitPartEllipses(XParms xp, Parms p, int reps)
+{
+    GenerateEllipses(xp, p, True, False);
+    return reps;
+}
+
+
+int 
+InitChordPartEllipses(XParms xp, Parms p, int reps)
+{
+    GenerateEllipses(xp, p, True, False);
+    XSetArcMode(xp->d, xp->bggc, ArcChord);
+    XSetArcMode(xp->d, xp->fggc, ArcChord);
+    return reps;
+}
+
+
+int 
+InitSlicePartEllipses(XParms xp, Parms p, int reps)
+{
+    GenerateEllipses(xp, p, True, False);
+    XSetArcMode(xp->d, xp->bggc, ArcPieSlice);
+    XSetArcMode(xp->d, xp->fggc, ArcPieSlice);
+    return reps;
+}
+
+
+static void
+GenerateWideEllipses(XParms xp, Parms p, Bool partialArcs, Bool ddashed)
+{
+    int size;
+
+    GenerateEllipses (xp, p, partialArcs, ddashed);
+    size = p->special;
+    if(ddashed) {
+       XSetLineAttributes(xp->d, xp->ddbggc, (int) ((size + 9) / 10),
+           LineSolid, CapRound, JoinRound);
+       XSetLineAttributes(xp->d, xp->ddfggc, (int) ((size + 9) / 10),
+           LineSolid, CapRound, JoinRound);
+    }
+    else {
+       XSetLineAttributes(xp->d, xp->bggc, (int) ((size + 9) / 10),
+           LineSolid, CapRound, JoinRound);
+       XSetLineAttributes(xp->d, xp->fggc, (int) ((size + 9) / 10),
+           LineSolid, CapRound, JoinRound);
+    }
+
+}
+
+int 
+InitWideEllipses(XParms xp, Parms p, int reps)
+{
+    GenerateWideEllipses(xp, p, False, False);
+    return reps;
+}
+int 
+InitPartWideEllipses(XParms xp, Parms p, int reps)
+{
+    GenerateWideEllipses(xp, p, True, False);
+    return reps;
+}
+int 
+InitDashedEllipses(XParms xp, Parms p, int reps)
+{
+    char dashes[2];
+
+    GenerateEllipses(xp, p, False, False);
+
+    /* Modify GCs to draw dashed */
+    XSetLineAttributes(xp->d, xp->bggc, 0, LineOnOffDash, CapButt, JoinMiter);
+    XSetLineAttributes(xp->d, xp->fggc, 0, LineOnOffDash, CapButt, JoinMiter);
+    dashes[0] = 3;   dashes[1] = 2;
+    XSetDashes(xp->d, xp->fggc, 0, dashes, 2);
+    XSetDashes(xp->d, xp->bggc, 0, dashes, 2);
+    return reps;
+}
+
+int 
+InitWideDashedEllipses(XParms xp, Parms p, int reps)
+{
+    int                size;
+    XGCValues   gcv;
+    char       dashes[2];
+
+    GenerateWideEllipses(xp, p, False, False);
+    size = p->special;
+    size = (size + 9) / 10;
+
+    /* Modify GCs to draw dashed */
+    dashes[0] = 2*size;   dashes[1] = 2*size;
+    gcv.line_style = LineOnOffDash;
+    XChangeGC(xp->d, xp->fggc, GCLineStyle, &gcv);
+    XChangeGC(xp->d, xp->bggc, GCLineStyle, &gcv);
+    XSetDashes(xp->d, xp->fggc, 0, dashes, 2);
+    XSetDashes(xp->d, xp->bggc, 0, dashes, 2);
+    return reps;
+}
+
+int 
+InitDoubleDashedEllipses(XParms xp, Parms p, int reps)
+{
+    char dashes[2];
+
+    GenerateEllipses(xp, p, False, True);
+
+    /* Modify GCs to draw dashed */
+    XSetLineAttributes(xp->d, xp->ddbggc, 0, LineDoubleDash, CapButt, JoinMiter);
+    XSetLineAttributes(xp->d, xp->ddfggc, 0, LineDoubleDash, CapButt, JoinMiter);
+    dashes[0] = 3;   dashes[1] = 2;
+    XSetDashes(xp->d, xp->ddfggc, 0, dashes, 2);
+    XSetDashes(xp->d, xp->ddbggc, 0, dashes, 2);
+    return reps;
+}
+
+int 
+InitWideDoubleDashedEllipses(XParms xp, Parms p, int reps)
+{
+    int                size;
+    XGCValues   gcv;
+    char       dashes[2];
+
+    GenerateWideEllipses(xp, p, False, True);
+    size = p->special;
+    size = (size + 9) / 10;
+
+    /* Modify GCs to draw dashed */
+    dashes[0] = 2*size;   dashes[1] = 2*size;
+    gcv.line_style = LineDoubleDash;
+    XChangeGC(xp->d, xp->ddfggc, GCLineStyle, &gcv);
+    XChangeGC(xp->d, xp->ddbggc, GCLineStyle, &gcv);
+    XSetDashes(xp->d, xp->ddfggc, 0, dashes, 2);
+    XSetDashes(xp->d, xp->ddbggc, 0, dashes, 2);
+    return reps;
+}
+
+void 
+DoArcs(XParms xp, Parms p, int reps)
+{
+    int i;
+
+    for (i = 0; i != reps; i++) {
+        XDrawArcs(xp->d, xp->w, pgc, arcs, p->objects);
+        if (pgc == xp->ddbggc)
+            pgc = xp->ddfggc;
+        else if(pgc == xp->ddfggc)
+            pgc = xp->ddbggc;
+        else if (pgc == xp->bggc)
+            pgc = xp->fggc;
+        else
+            pgc = xp->bggc;
+       CheckAbort ();
+    }
+}
+
+void 
+DoFilledArcs(XParms xp, Parms p, int reps)
+{
+    int i;
+
+    for (i = 0; i != reps; i++) {
+        XFillArcs(xp->d, xp->w, pgc, arcs, p->objects);
+        if (pgc == xp->ddbggc)
+            pgc = xp->ddfggc;
+        else if(pgc == xp->ddfggc)
+            pgc = xp->ddbggc;
+        else if (pgc == xp->bggc)
+            pgc = xp->fggc;
+        else
+            pgc = xp->bggc;
+       CheckAbort ();
+    }
+}
+
+void 
+EndArcs(XParms xp, Parms p)
+{
+    free(arcs);
+}
+
diff --git a/x11perf/do_blt.c b/x11perf/do_blt.c
new file mode 100755 (executable)
index 0000000..2834392
--- /dev/null
@@ -0,0 +1,681 @@
+/*****************************************************************************
+Copyright 1988, 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.
+
+******************************************************************************/
+
+#include "x11perf.h"
+#include <stdio.h>
+
+#define NUMPOINTS 100
+
+static Pixmap   pix;
+static XImage   *image;
+static XPoint   points[NUMPOINTS];
+static XSegment *segsa, *segsb;
+
+#define NegMod(x, y) ((y) - (((-x)-1) % (7)) - 1)
+
+static void 
+InitBltLines(void)
+{
+    int i, x, y;
+
+    points[0].x = points[0].y = y = 0;
+    for (i = 1; i != NUMPOINTS/2; i++) {    
+       if (i & 1) {
+           points[i].x = WIDTH-1;
+       } else {
+           points[i].x = 0;
+       }
+       y += HEIGHT / (NUMPOINTS/2);
+       points[i].y = y;
+    }
+    
+    x = 0;
+    for (i = NUMPOINTS/2; i!= NUMPOINTS; i++) {
+       if (i & 1) {
+           points[i].y = HEIGHT-1;
+       } else {
+           points[i].y = 0;
+       }
+       x += WIDTH / (NUMPOINTS/2);
+       points[i].x = x;
+    }
+}
+
+int 
+InitScroll(XParms xp, Parms p, int reps)
+{
+    InitBltLines();
+    XDrawLines(xp->d, xp->w, xp->fggc, points, NUMPOINTS, CoordModeOrigin);
+    return reps;
+}
+
+void 
+DoScroll(XParms xp, Parms p, int reps)
+{
+    int i, size, x, y, xorg, yorg, delta;
+
+    size = p->special;
+    xorg = 0;   yorg = 0;
+    x    = 0;   y    = 0;
+    if (xp->version == VERSION1_2) {
+       delta = 1;
+    } else {
+       /* Version 1.2 only scrolled up by 1 scanline, which made hardware
+          using page-mode access to VRAM look better on paper than it would
+          perform in a more realistic scroll.  So we've changed to scroll by
+          the height of the 6x13 fonts. */
+       delta = 13;
+    }
+
+    for (i = 0; i != reps; i++) {
+       XCopyArea(xp->d, xp->w, xp->w, xp->fggc, x, y + delta,
+           size, size, x, y);
+       y += size;
+       if (y + size + delta > HEIGHT) {
+           yorg += delta;
+           if (yorg >= size || yorg + size + delta > HEIGHT) {
+               yorg = 0;
+               xorg++;
+               if (xorg >= size || xorg + size > WIDTH) {
+                   xorg = 0;
+               }
+           }
+           y = yorg;
+           x += size;
+           if (x + size > WIDTH) {
+               x = xorg;
+           }
+       }
+       CheckAbort ();
+    }
+}
+
+void 
+MidScroll(XParms xp, Parms p)
+{
+    XClearWindow(xp->d, xp->w);
+    XDrawLines(xp->d, xp->w, xp->fggc, points, NUMPOINTS, CoordModeOrigin);
+}
+
+void 
+EndScroll(XParms xp, Parms p)
+{
+}
+
+static void 
+InitCopyLocations(XParms xp, Parms p, int reps)
+{
+    int x1, y1, x2, y2, size, i;
+    int xinc, yinc;
+    int width, height;
+
+    /* Try to exercise all alignments of src and destination equally, as well
+       as all 4 top-to-bottom/bottom-to-top, left-to-right, right-to-left
+       copying directions.  Computation done here just to make sure slow
+       machines aren't measuring anything but the XCopyArea calls.
+    */
+    size = p->special;
+    xinc = (size & ~3) + 1;
+    yinc = xinc + 3;
+
+    width = (WIDTH - size) & ~31;
+    height = (HEIGHT - size) & ~31;
+    
+    x1 = 0;
+    y1 = 0;
+    x2 = width;
+    y2 = height;
+    
+    segsa = (XSegment *)malloc(reps * sizeof(XSegment));
+    segsb = (XSegment *)malloc(reps * sizeof(XSegment));
+    for (i = 0; i != reps; i++) {
+       segsa[i].x1 = x1;
+       segsa[i].y1 = y1;
+       segsa[i].x2 = x2;
+       segsa[i].y2 = y2;
+
+       /* Move x2, y2, location backward */
+       x2 -= xinc;
+       if (x2 < 0) {
+           x2 = NegMod(x2, width);
+           y2 -= yinc;
+           if (y2 < 0) {
+               y2 = NegMod(y2, height);
+           }
+       }
+
+       segsb[i].x1 = x1;
+       segsb[i].y1 = y1;
+       segsb[i].x2 = x2;
+       segsb[i].y2 = y2;
+
+       /* Move x1, y1 location forward */
+       x1 += xinc;
+       if (x1 > width) {
+           x1 %= 32;
+           y1 += yinc;
+           if (y1 > height) {
+               y1 %= 32;
+           }
+       }
+    } /* end for */
+}
+
+
+int 
+InitCopyWin(XParms xp, Parms p, int reps)
+{
+    (void) InitScroll(xp, p, reps);
+    InitCopyLocations(xp, p, reps);
+    return reps;
+}
+
+int 
+InitCopyPix(XParms xp, Parms p, int reps)
+{
+    GC         pixgc;
+    (void) InitCopyWin(xp, p, reps);
+
+    /* Create pixmap to write stuff into, and initialize it */
+    pix = XCreatePixmap(xp->d, xp->w, WIDTH, HEIGHT, xp->vinfo.depth);
+    pixgc = XCreateGC(xp->d, pix, 0, NULL);
+    /* need a gc with GXcopy cos pixmaps contain junk on creation. mmm */
+    XCopyArea(xp->d, xp->w, pix, pixgc, 0, 0, WIDTH, HEIGHT, 0, 0);
+    XFreeGC(xp->d, pixgc);
+    return reps;
+}
+
+int 
+InitGetImage(XParms xp, Parms p, int reps)
+{
+    (void) InitCopyWin(xp, p, reps);
+
+    /* Create image to stuff bits into */
+    image = XGetImage(xp->d, xp->w, 0, 0, WIDTH, HEIGHT, xp->planemask,
+                     p->font==NULL?ZPixmap:XYPixmap);
+    if(image==NULL){
+       printf("XGetImage failed\n");
+       return False;
+    }  
+    return reps;
+}
+
+int 
+InitPutImage(XParms xp, Parms p, int reps)
+{
+    if(!InitGetImage(xp, p, reps))return False;
+    XClearWindow(xp->d, xp->w);
+    return reps;
+}
+
+static void 
+CopyArea(XParms xp, Parms p, int reps, Drawable src, Drawable dst)
+{
+    int i, size;
+    XSegment *sa, *sb;
+
+    size = p->special;
+    for (sa = segsa, sb = segsb, i = 0; i != reps; i++, sa++, sb++) {
+       XCopyArea(xp->d, src, dst, xp->fggc,
+           sa->x1, sa->y1, size, size, sa->x2, sa->y2);
+       XCopyArea(xp->d, src, dst, xp->fggc,
+           sa->x2, sa->y2, size, size, sa->x1, sa->y1);
+       XCopyArea(xp->d, src, dst, xp->fggc,
+           sb->x2, sb->y2, size, size, sb->x1, sb->y1);
+       XCopyArea(xp->d, src, dst, xp->fggc,
+           sb->x1, sb->y1, size, size, sb->x2, sb->y2);
+       CheckAbort ();
+    }
+}
+
+void 
+DoCopyWinWin(XParms xp, Parms p, int reps)
+{
+    CopyArea(xp, p, reps, xp->w, xp->w);
+}
+
+void 
+DoCopyPixWin(XParms xp, Parms p, int reps)
+{
+    CopyArea(xp, p, reps, pix, xp->w);
+}
+
+void 
+DoCopyWinPix(XParms xp, Parms p, int reps)
+{
+    CopyArea(xp, p, reps, xp->w, pix);
+    xp->p = pix;       /* HardwareSync will now sync on pixmap */
+}
+
+void 
+DoCopyPixPix(XParms xp, Parms p, int reps)
+{
+    CopyArea(xp, p, reps, pix, pix);
+    xp->p = pix;       /* HardwareSync will now sync on pixmap */
+}
+
+void 
+DoGetImage(XParms xp, Parms p, int reps)
+{
+    int i, size;
+    XSegment *sa, *sb;
+    int format;
+
+    size = p->special;
+    format = (p->font == NULL) ? ZPixmap : XYPixmap;
+    for (sa = segsa, sb = segsb, i = 0; i != reps; i++, sa++, sb++) {
+       XDestroyImage(image);
+       image = XGetImage(xp->d, xp->w, sa->x1, sa->y1, size, size,
+           xp->planemask, format);
+       if (image) XDestroyImage(image);
+       image = XGetImage(xp->d, xp->w, sa->x2, sa->y2, size, size,
+           xp->planemask, format);
+       if (image) XDestroyImage(image);
+       image = XGetImage(xp->d, xp->w, sb->x2, sb->y2, size, size,
+           xp->planemask, format);
+       if (image) XDestroyImage(image);
+       image = XGetImage(xp->d, xp->w, sb->x1, sb->y1, size, size,
+           xp->planemask, format);
+/*
+
+One might expect XGetSubImage to be slightly faster than XGetImage.  Go look
+at the code in Xlib.  MIT X11R3 ran approximately 30 times slower for a 500x500
+rectangle.
+
+       (void) XGetSubImage(xp->d, xp->w, sa->x1, sa->y1, size, size,
+           xp->planemask, ZPixmap, image, sa->x2, sa->y2);
+       (void) XGetSubImage(xp->d, xp->w, sa->x2, sa->y2, size, size,
+           xp->planemask, ZPixmap, image, sa->x1, sa->y1);
+       (void) XGetSubImage(xp->d, xp->w, sb->x2, sb->y2, size, size,
+           xp->planemask, ZPixmap, image, sb->x2, sb->y2);
+       (void) XGetSubImage(xp->d, xp->w, sb->x1, sb->y1, size, size,
+           xp->planemask, ZPixmap, image, sb->x2, sb->y2);
+*/
+       CheckAbort ();
+    }
+}
+
+void 
+DoPutImage(XParms xp, Parms p, int reps)
+{
+    int i, size;
+    XSegment *sa, *sb;
+
+    size = p->special;
+    for (sa = segsa, sb = segsb, i = 0; i != reps; i++, sa++, sb++) {
+       XPutImage(xp->d, xp->w, xp->fggc, image,
+           sa->x1, sa->y1, sa->x2, sa->y2, size, size);
+       XPutImage(xp->d, xp->w, xp->fggc, image,
+           sa->x2, sa->y2, sa->x1, sa->y1, size, size);
+       XPutImage(xp->d, xp->w, xp->fggc, image,
+           sb->x2, sb->y2, sb->x2, sb->y2, size, size);
+       XPutImage(xp->d, xp->w, xp->fggc, image,
+           sb->x1, sb->y1, sb->x2, sb->y2, size, size);
+       CheckAbort ();
+    }
+}
+
+#ifdef MITSHM
+
+#include <sys/types.h>
+#ifndef Lynx
+#include <sys/ipc.h>
+#include <sys/shm.h>
+#else
+#include <ipc.h>
+#include <shm.h>
+#endif
+#include <X11/extensions/XShm.h>
+
+static XImage          shm_image;
+static XShmSegmentInfo shm_info;
+
+static int haderror;
+static int (*origerrorhandler)(Display *, XErrorEvent *);
+
+static int 
+shmerrorhandler(Display *d, XErrorEvent *e)
+{
+    haderror++;
+    if(e->error_code==BadAccess) {
+       fprintf(stderr,"failed to attach shared memory\n");
+       return 0;
+    } else 
+       return (*origerrorhandler)(d,e);
+}
+
+int 
+InitShmPutImage(XParms xp, Parms p, int reps)
+{
+    int        image_size;
+
+    if(!InitGetImage(xp, p, reps))return False;
+    if (!XShmQueryExtension(xp->d)) {
+       /*
+        * Clean up here because cleanup function is not called if this
+        * function fails
+        */
+               if (image)
+           XDestroyImage(image);
+       image = NULL;
+       free(segsa);
+       free(segsb);
+       return False;
+    }  
+    XClearWindow(xp->d, xp->w);
+    shm_image = *image;
+    image_size = image->bytes_per_line * image->height;
+    /* allow XYPixmap choice: */
+    if(p->font)image_size *= xp->vinfo.depth;
+    shm_info.shmid = shmget(IPC_PRIVATE, image_size, IPC_CREAT|0777);
+    if (shm_info.shmid < 0)
+    {
+       /*
+        * Clean up here because cleanup function is not called if this
+        * function fails
+        */
+       if (image)
+           XDestroyImage(image);
+       image = NULL;
+       free(segsa);
+       free(segsb);
+       perror ("shmget");
+       return False;
+    }
+    shm_info.shmaddr = (char *) shmat(shm_info.shmid, NULL, 0);
+    if (shm_info.shmaddr == ((char *) -1))
+    {
+       /*
+        * Clean up here because cleanup function is not called if this
+        * function fails
+        */
+       if (image)
+           XDestroyImage(image);
+       image = NULL;
+       free(segsa);
+       free(segsb);
+       perror ("shmat");
+       shmctl (shm_info.shmid, IPC_RMID, NULL);
+       return False;
+    }
+    shm_info.readOnly = True;
+    XSync(xp->d,True);
+    haderror = False;
+    origerrorhandler = XSetErrorHandler(shmerrorhandler);
+    XShmAttach (xp->d, &shm_info);
+    XSync(xp->d,True); /* wait for error or ok */
+    XSetErrorHandler(origerrorhandler);
+    if(haderror){
+       /*
+        * Clean up here because cleanup function is not called if this
+        * function fails
+        */
+       if (image)
+           XDestroyImage(image);
+       image = NULL;
+       free(segsa);
+       free(segsb);
+       if(shmdt (shm_info.shmaddr)==-1)
+           perror("shmdt:");
+       if(shmctl (shm_info.shmid, IPC_RMID, NULL)==-1)
+           perror("shmctl rmid:");
+       return False;
+    }
+    shm_image.data = shm_info.shmaddr;
+    memmove( shm_image.data, image->data, image_size);
+    shm_image.obdata = (char *) &shm_info;
+    return reps;
+}
+
+void 
+DoShmPutImage(XParms xp, Parms p, int reps)
+{
+    int i, size;
+    XSegment *sa, *sb;
+
+    size = p->special;
+    for (sa = segsa, sb = segsb, i = 0; i != reps; i++, sa++, sb++) {
+       XShmPutImage(xp->d, xp->w, xp->fggc, &shm_image,
+           sa->x1, sa->y1, sa->x2, sa->y2, size, size, False);
+       XShmPutImage(xp->d, xp->w, xp->fggc, &shm_image,
+           sa->x2, sa->y2, sa->x1, sa->y1, size, size, False);
+       XShmPutImage(xp->d, xp->w, xp->fggc, &shm_image,
+           sb->x2, sb->y2, sb->x2, sb->y2, size, size, False);
+       XShmPutImage(xp->d, xp->w, xp->fggc, &shm_image,
+           sb->x1, sb->y1, sb->x2, sb->y2, size, size, False);
+       CheckAbort ();
+    }
+}
+
+void 
+EndShmPutImage(XParms xp, Parms p)
+{
+
+    EndGetImage (xp, p);
+    XShmDetach (xp->d, &shm_info);
+    XSync(xp->d, False);       /* need server to detach so can remove id */
+    if(shmdt (shm_info.shmaddr)==-1)
+       perror("shmdt:");
+    if(shmctl (shm_info.shmid, IPC_RMID, NULL)==-1)
+       perror("shmctl rmid:");
+}
+
+#endif
+
+
+void 
+MidCopyPix(XParms xp, Parms p)
+{
+    XClearWindow(xp->d, xp->w);
+}
+
+void 
+EndCopyWin(XParms xp, Parms p)
+{
+    EndScroll(xp, p);
+    free(segsa);
+    free(segsb);
+}
+
+void 
+EndCopyPix(XParms xp, Parms p)
+{
+    EndCopyWin(xp, p);
+    XFreePixmap(xp->d, pix);
+    /*
+     * Ensure that the next test doesn't try and sync on the pixmap
+     */
+    xp->p = (Pixmap)0;
+}
+
+void 
+EndGetImage(XParms xp, Parms p)
+{
+    EndCopyWin(xp, p);
+    if (image) XDestroyImage(image);
+}
+
+int
+InitCopyPlane(XParms xp, Parms p, int reps)
+{
+    XGCValues   gcv;
+    GC         pixgc;
+
+    InitBltLines();
+    InitCopyLocations(xp, p, reps);
+
+    /* Create pixmap to write stuff into, and initialize it */
+    pix = XCreatePixmap(xp->d, xp->w, WIDTH, HEIGHT, 
+           p->font==NULL ? 1 : xp->vinfo.depth);
+    gcv.graphics_exposures = False;
+    gcv.foreground = 0;
+    gcv.background = 1;
+    pixgc = XCreateGC(xp->d, pix, 
+               GCForeground | GCBackground | GCGraphicsExposures, &gcv);
+    XFillRectangle(xp->d, pix, pixgc, 0, 0, WIDTH, HEIGHT);
+    gcv.foreground = 1;
+    gcv.background = 0;
+    XChangeGC(xp->d, pixgc, GCForeground | GCBackground, &gcv);
+    XDrawLines(xp->d, pix, pixgc, points, NUMPOINTS, CoordModeOrigin);
+    XFreeGC(xp->d, pixgc);
+
+    return reps;
+}
+
+void 
+DoCopyPlane(XParms xp, Parms p, int reps)
+{
+    int                i, size;
+    XSegment    *sa, *sb;
+
+    size = p->special;
+    for (sa = segsa, sb = segsb, i = 0; i != reps; i++, sa++, sb++) {
+       XCopyPlane(xp->d, pix, xp->w, xp->fggc,
+           sa->x1, sa->y1, size, size, sa->x2, sa->y2, 1);
+       XCopyPlane(xp->d, pix, xp->w, xp->fggc,
+           sa->x2, sa->y2, size, size, sa->x1, sa->y1, 1);
+       XCopyPlane(xp->d, pix, xp->w, xp->fggc,
+           sb->x2, sb->y2, size, size, sb->x1, sb->y1, 1);
+       XCopyPlane(xp->d, pix, xp->w, xp->fggc,
+           sb->x1, sb->y1, size, size, sb->x2, sb->y2, 1);
+       CheckAbort ();
+    }
+}
+
+#include <X11/extensions/Xrender.h>
+
+static Picture winPict, pixPict;
+
+int
+InitCompositeWin(XParms xp, Parms p, int reps)
+{
+    XRenderPictFormat  *format;
+    (void) InitScroll (xp, p, reps);
+    InitCopyLocations (xp, p, reps);
+    format = XRenderFindVisualFormat (xp->d, xp->vinfo.visual);
+    winPict = XRenderCreatePicture (xp->d, xp->w, format, 0, NULL);
+    return reps;
+}
+
+int
+InitCompositePix(XParms xp, Parms p, int reps)
+{
+    XRenderPictFormat  *format = NULL;
+    int                        depth;
+
+    (void) InitCompositeWin (xp, p, reps);
+    
+    /* Create pixmap to write stuff into, and initialize it */
+    switch (xp->planemask) {
+    case PictStandardNative:
+       depth = xp->vinfo.depth;
+       format = XRenderFindVisualFormat (xp->d, xp->vinfo.visual);
+       break;
+    case PictStandardRGB24:
+       depth = 24;
+       break;
+    case PictStandardARGB32:
+       depth = 32;
+       break;
+    case PictStandardA8:
+       depth = 8;
+       break;
+    case PictStandardA4:
+       depth = 4;
+       break;
+    case PictStandardA1:
+       depth = 1;
+       break;
+    default:
+       depth = 0;
+       break;
+    }
+    if (!format)
+       format = XRenderFindStandardFormat (xp->d, xp->planemask);
+    
+    pix = XCreatePixmap(xp->d, xp->w, WIDTH, HEIGHT, depth);
+    pixPict = XRenderCreatePicture (xp->d, pix, format, 0, NULL);
+    
+    XRenderComposite (xp->d, PictOpClear,
+                     winPict, None, pixPict,
+                     0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
+    
+#if 1
+    XRenderComposite (xp->d, PictOpOver,
+                     winPict, None, pixPict,
+                     0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
+#endif
+    return reps;
+}
+
+void
+EndCompositeWin (XParms xp, Parms p)
+{
+    if (winPict)
+    {
+       XRenderFreePicture (xp->d, winPict);
+       winPict = None;
+    }
+    if (pixPict)
+    {
+       XRenderFreePicture (xp->d, pixPict);
+       pixPict = None;
+    }
+}
+
+static void 
+CompositeArea(XParms xp, Parms p, int reps, Picture src, Picture dst)
+{
+    int i, size;
+    XSegment *sa, *sb;
+
+    size = p->special;
+    for (sa = segsa, sb = segsb, i = 0; i != reps; i++, sa++, sb++) {
+       XRenderComposite (xp->d, xp->func,
+                         src, None, dst,
+                         sa->x1, sa->y1, 0, 0, 
+                         sa->x2, sa->y2, size, size);
+       XRenderComposite (xp->d, xp->func,
+                         src, None, dst,
+                         sa->x2, sa->y2, 0, 0, sa->x1, sa->y1, size, size);
+       XRenderComposite (xp->d, xp->func,
+                         src, None, dst,
+                         sb->x2, sb->y2, 0, 0, sb->x1, sb->y1, size, size);
+       XRenderComposite (xp->d, xp->func,
+                         src, None, dst,
+                         sb->x1, sb->y1, 0, 0, sb->x2, sb->y2, size, size);
+       CheckAbort ();
+    }
+}
+
+void
+DoCompositeWinWin (XParms xp, Parms p, int reps)
+{
+    CompositeArea (xp, p, reps, winPict, winPict);
+}
+
+void
+DoCompositePixWin (XParms xp, Parms p, int reps)
+{
+    CompositeArea (xp, p, reps, pixPict, winPict);
+}
diff --git a/x11perf/do_complex.c b/x11perf/do_complex.c
new file mode 100755 (executable)
index 0000000..3eac738
--- /dev/null
@@ -0,0 +1,194 @@
+/*****************************************************************************
+Copyright 1988, 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.
+
+******************************************************************************/
+
+#include "x11perf.h"
+
+#define NUM_POINTS 4    /* 4 points to an arrowhead */
+#define NUM_ANGLES 3    /* But mostly it looks like a triangle */
+static XPoint   *points;
+static GC       pgc;
+
+#include <math.h>
+#if defined(QNX4) || defined(__CYGWIN__) || defined(__UNIXOS2__)
+#define PI 3.14159265358979323846
+#else
+#define PI M_PI
+#endif /* QNX4 */
+
+int 
+InitComplexPoly(XParms xp, Parms p, int reps)
+{
+    int     i, j, numPoints;
+    int     x, y;
+    int     size, iradius;
+    double  phi, phiinc, radius, delta, phi2;
+    XPoint  *curPoint;
+
+    pgc = xp->fggc;
+
+    size = p->special;
+    phi = 0.0;
+    delta = 2.0 * PI / ((double) NUM_ANGLES);
+    if (xp->version == VERSION1_2) {
+       radius = ((double) size) * sqrt(3.0)/2.0;
+       phiinc = delta/10.0;
+    } else {
+       /* Version 1.2's radius computation was completely bogus, and resulted
+          in triangles with sides about 50% longer than advertised.  Since
+          in version 1.3 triangles are scaled to cover size^2 pixels, we do
+          the same computation here.  The arrowheads are a little larger than
+          simple triangles, because they lose 1/3 of their area due to the
+          notch cut out from them, so radius has to be sqrt(3/2) larger than
+          for simple triangles.
+        */
+       radius = ((double) size) * sqrt(sqrt(4.0/3.0));
+       phiinc = 1.75*PI / ((double) p->objects);
+    }
+    iradius = (int) radius + 1;
+
+    numPoints = (p->objects) * NUM_POINTS;  
+    points = (XPoint *)malloc(numPoints * sizeof(XPoint));
+    curPoint = points;
+    x = iradius;
+    y = iradius;
+    for (i = 0; i != p->objects; i++) {
+       for (j = 0; j != NUM_ANGLES; j++) {
+           phi2 = phi + ((double) j) * delta;
+           curPoint->x = (int) ((double)x + (radius * cos(phi2)) + 0.5);
+           curPoint->y = (int) ((double)y + (radius * sin(phi2)) + 0.5);
+           curPoint++;
+       }
+       curPoint->x = x;
+       curPoint->y = y;
+       curPoint++;
+
+       phi += phiinc;
+       y += 2 * iradius;
+       if (y + iradius >= HEIGHT) {
+           y = iradius;
+           x += 2 * iradius;
+           if (x + iradius >= WIDTH) {
+               x = iradius;
+           }
+       }
+    }
+    return reps;
+}
+
+void 
+DoComplexPoly(XParms xp, Parms p, int reps)
+{
+    int     i, j;
+    XPoint  *curPoint;
+
+    for (i = 0; i != reps; i++) {
+        curPoint = points;
+        for (j = 0; j != p->objects; j++) {
+            XFillPolygon(xp->d, xp->w, pgc, curPoint, NUM_POINTS, Complex, 
+                        CoordModeOrigin);
+            curPoint += NUM_POINTS;
+         }
+        if (pgc == xp->bggc)
+            pgc = xp->fggc;
+        else
+            pgc = xp->bggc;
+       CheckAbort ();
+    }
+}
+
+void 
+EndComplexPoly(XParms xp, Parms p)
+{
+    free(points);
+}
+
+int 
+InitGeneralPoly(XParms xp, Parms p, int reps)
+{
+    int     i, j, numPoints;
+    int            nsides;
+    int            x, y;
+    int     size, iradius;
+    double  phi, phiinc, inner_radius, outer_radius, delta, phi2;
+    XPoint  *curPoint;
+
+    pgc = xp->fggc;
+    size = p->special;
+    nsides = (long) p->font;
+    phi = 0.0;
+    delta = 2.0 * PI / ((double) nsides);
+    phiinc = delta / 10.0;
+
+    inner_radius = size / sqrt (nsides * tan (PI / nsides));
+    outer_radius = inner_radius / cos (PI / (2 * nsides));
+    numPoints = p->objects * nsides;
+    points = (XPoint *) malloc (numPoints * sizeof (XPoint));
+    curPoint = points;
+    iradius = outer_radius + 1;
+    x = iradius;
+    y = iradius;
+    for (i = 0; i < p->objects; i++) {
+       phi2 = phi;
+       for (j = 0; j < nsides; j++) {
+           curPoint->x = x + (outer_radius * cos(phi2) + 0.5);
+           curPoint->y = y + (outer_radius * sin(phi2) + 0.5);
+           curPoint++;
+           phi2 += delta;
+       }
+       phi += phiinc;
+       y += 2 * iradius;
+       if (y + iradius >= HEIGHT) {
+           y = iradius;
+           x += 2 * iradius;
+           if (x + iradius >= WIDTH) {
+               x = iradius;
+           }
+       }
+    }
+    return reps;
+}
+
+void 
+DoGeneralPoly(XParms xp, Parms p, int reps)
+{
+    int     i, j;
+    int            nsides;
+    int            mode;
+    XPoint  *curPoint;
+
+    nsides = (long) p->font;
+    mode = (long) p->bfont;
+    for (i = 0; i != reps; i++) {
+        curPoint = points;
+        for (j = 0; j != p->objects; j++) {
+            XFillPolygon(xp->d, xp->w, pgc, curPoint, nsides, mode, 
+                        CoordModeOrigin);
+            curPoint += nsides;
+         }
+        if (pgc == xp->bggc)
+            pgc = xp->fggc;
+        else
+            pgc = xp->bggc;
+       CheckAbort ();
+    }
+}
diff --git a/x11perf/do_dots.c b/x11perf/do_dots.c
new file mode 100755 (executable)
index 0000000..8279437
--- /dev/null
@@ -0,0 +1,65 @@
+/*****************************************************************************
+Copyright 1988, 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.
+
+******************************************************************************/
+
+#include "x11perf.h"
+
+static XPoint   *points;
+static GC       pgc;
+
+int 
+InitDots(XParms xp, Parms p, int reps)
+{
+    int i;
+
+    pgc = xp->fggc;
+
+    points = (XPoint *)malloc(p->objects * sizeof(XPoint));
+
+    for (i = 0; i != p->objects; i++) {
+       points[i].x = 2 * (i/MAXROWS);
+       points[i].y = 2 * (i%MAXROWS);
+    }
+    return reps;
+}
+
+void 
+DoDots(XParms xp, Parms p, int reps)
+{
+    int     i;
+
+    for (i = 0; i != reps; i++) {
+        XDrawPoints(xp->d, xp->w, pgc, points, p->objects, CoordModeOrigin);
+        if (pgc == xp->bggc)
+            pgc = xp->fggc;
+        else
+            pgc = xp->bggc;
+       CheckAbort ();
+    }
+}
+
+void 
+EndDots(XParms xp, Parms p)
+{
+    free(points);
+}
+
diff --git a/x11perf/do_lines.c b/x11perf/do_lines.c
new file mode 100755 (executable)
index 0000000..88a1ebd
--- /dev/null
@@ -0,0 +1,300 @@
+/*****************************************************************************
+Copyright 1988, 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.
+
+******************************************************************************/
+
+#include "x11perf.h"
+
+static XPoint   *points;
+static GC       pgc;
+
+static void 
+GenerateLines(XParms xp, Parms p, Bool ddashed)
+{
+    int size;
+    int half;          /* Half of width if wide line                   */
+    int i;
+    int     rows;       /* Number of rows filled in current column      */
+    int x, y;          /* Next point                                   */
+    int xdir, ydir;    /* Which direction x, y are going               */
+    int bigxdir;       
+    int x1 = 0, y1 = 0;        /* offsets to compute next point from current   */
+    int phase;         /* how far into 0..4*(size_1) we are            */
+    float phasef;       /* how far we are in real numbers              */
+    float phaseinc;     /* how much to increment phasef at each segment */
+    int size4;         /* 4 * size                                     */
+
+    if(ddashed)
+       pgc = xp->ddfggc;
+    else
+       pgc = xp->fggc;
+
+    size = p->special;
+    size4 = 4 * (size+1);
+    half = (size + 19) / 20;
+
+    points = (XPoint *)malloc((p->objects+1) * sizeof(XPoint));
+
+    /* All this x, x1, x1inc, etc. stuff is to create a pattern that
+       (1) scans down the screen vertically
+
+       (2) rotates the endpoints through all possible orientations
+
+       (3) bounces off bottom and top of window as needed
+
+       (4) moves left or right at each bounce to make things less boring
+    */
+
+    x     = half;
+    y     = half;
+    xdir  = 1;
+    ydir  = 1;
+    bigxdir = 1;
+    phasef = 0.0;
+    phaseinc = ((float)size4) / ((float)p->objects);
+    if (phaseinc < 1.0) phaseinc = 1.0;
+    rows = 0;
+
+    points[0].x = x;
+    points[0].y = y;
+
+    for (i = 1; i != (p->objects+1); i++) {    
+       phase = phasef;
+       switch (phase / (size+1)) {
+       case 0:
+           x1 = size;                  
+           y1 = phase;
+           break;
+
+       case 1:
+           x1 = size - phase % (size+1);
+           y1 = size;
+           break;
+
+       case 2:
+           x1 = phase % (size+1);
+           y1 = size;
+           break;
+
+       case 3:
+           x1 = size;
+           y1 = size - phase % (size+1);
+           break;
+       } /* end switch */
+
+       /* Move down or up the screen */
+       y += (ydir * y1);
+
+       /* If off either top or bottom, backtrack to previous position and go
+          the other way instead.  Also move in bigxdir if not already. */
+       rows++;
+       if (y < half || y >= (HEIGHT-half) || rows > MAXROWS) {
+           rows = 0;
+           if (bigxdir > 0) {
+               if (x + size < WIDTH - half) {
+                   xdir = 1;
+               } else {
+                   bigxdir = -1;
+               }
+           } else {
+               if (x - size > half) {
+                   xdir = -1;
+               } else {
+                   bigxdir = 1;
+               }
+           }
+           ydir = -ydir;
+           y += (2 * ydir * y1);
+           /* If still off top or bottom, we can't do the line we want.
+              This will happen infrequently if the window is not twice the
+              length of the line.  So instead, let's draw a line that puts
+              the line after this approximately through the center of the
+              window.   Since it is very unlikely that both x and y will
+              need such adjustment, line length (in pixels) should not
+              change...we just can't get the slope we want for this line. */
+           if (y < half) {
+               y = (HEIGHT - y1)/2;
+               ydir = 1;
+           } else if (y > (HEIGHT - half)) {
+               y = (HEIGHT + y1)/2;
+               ydir = -1;
+           }
+       }
+
+       /* Move x left or right by x1 */
+       x += (xdir * x1);
+       xdir = -xdir;
+       /* Again, if we are off the bottom then we can't really draw the line
+          we want.  */
+       if (x < half) {
+           x = (WIDTH - x1)/2;
+           xdir = 1;
+       } else if (x > (WIDTH - half)) {
+           x = (WIDTH + x1)/2;
+           xdir = -1;
+       }
+       points[i].x = x;
+       points[i].y = y;
+
+       /* Increment phasef */
+       phasef += phaseinc;
+       if (phasef >= size4) phasef -= size4;
+
+    }
+}
+int 
+InitLines(XParms xp, Parms p, int reps)
+{
+    GenerateLines(xp, p, False);
+       return reps;
+}
+
+static int 
+GenerateWideLines(XParms xp, Parms p, int reps, Bool ddashed)
+{
+    int size;
+
+    GenerateLines(xp, p, ddashed);
+
+    size = p->special;
+    if(ddashed) {
+       XSetLineAttributes(xp->d, xp->ddbggc, (int) ((size + 9) / 10),
+           LineSolid, CapRound, JoinRound);
+       XSetLineAttributes(xp->d, xp->ddfggc, (int) ((size + 9) / 10),
+           LineSolid, CapRound, JoinRound);
+    }
+    else {
+       XSetLineAttributes(xp->d, xp->bggc, (int) ((size + 9) / 10),
+           LineSolid, CapRound, JoinRound);
+       XSetLineAttributes(xp->d, xp->fggc, (int) ((size + 9) / 10),
+           LineSolid, CapRound, JoinRound);
+    }
+
+    return reps;
+}
+
+int 
+InitWideLines(XParms xp, Parms p, int reps)
+{
+    return GenerateWideLines(xp, p, reps, False);
+}
+int 
+InitDashedLines(XParms xp, Parms p, int reps)
+{
+    char dashes[2];
+
+    GenerateLines(xp, p, False);
+
+    /* Modify GCs to draw dashed */
+    XSetLineAttributes(xp->d, xp->bggc, 0, LineOnOffDash, CapButt, JoinMiter);
+    XSetLineAttributes(xp->d, xp->fggc, 0, LineOnOffDash, CapButt, JoinMiter);
+    dashes[0] = 3;   dashes[1] = 2;
+    XSetDashes(xp->d, xp->fggc, 0, dashes, 2);
+    XSetDashes(xp->d, xp->bggc, 0, dashes, 2);
+    return reps;
+}
+
+int 
+InitWideDashedLines(XParms xp, Parms p, int reps)
+{
+    int                size;
+    XGCValues   gcv;
+    char       dashes[2];
+
+    (void)GenerateWideLines(xp, p, reps, False);
+    size = p->special;
+    size = (size + 9) / 10;
+
+    /* Modify GCs to draw dashed */
+    dashes[0] = 2*size;   dashes[1] = 2*size;
+    gcv.line_style = LineOnOffDash;
+    XChangeGC(xp->d, xp->fggc, GCLineStyle, &gcv);
+    XChangeGC(xp->d, xp->bggc, GCLineStyle, &gcv);
+    XSetDashes(xp->d, xp->fggc, 0, dashes, 2);
+    XSetDashes(xp->d, xp->bggc, 0, dashes, 2);
+    return reps;
+}
+
+int 
+InitDoubleDashedLines(XParms xp, Parms p, int reps)
+{
+    char dashes[2];
+
+    GenerateLines(xp, p, True);
+
+    /* Modify GCs to draw dashed */
+    XSetLineAttributes(xp->d, xp->ddbggc, 0, LineDoubleDash, CapButt, JoinMiter);
+    XSetLineAttributes(xp->d, xp->ddfggc, 0, LineDoubleDash, CapButt, JoinMiter);
+    dashes[0] = 3;   dashes[1] = 2;
+    XSetDashes(xp->d, xp->ddfggc, 0, dashes, 2);
+    XSetDashes(xp->d, xp->ddbggc, 0, dashes, 2);
+    return reps;
+}
+
+int 
+InitWideDoubleDashedLines(XParms xp, Parms p, int reps)
+{
+    int                size;
+    XGCValues   gcv;
+    char       dashes[2];
+
+    (void)GenerateWideLines(xp, p, reps, True);
+    size = p->special;
+    size = (size + 9) / 10;
+
+    /* Modify GCs to draw dashed */
+    dashes[0] = 2*size;   dashes[1] = 2*size;
+    gcv.line_style = LineDoubleDash;
+    XChangeGC(xp->d, xp->ddfggc, GCLineStyle, &gcv);
+    XChangeGC(xp->d, xp->ddbggc, GCLineStyle, &gcv);
+    XSetDashes(xp->d, xp->ddfggc, 0, dashes, 2);
+    XSetDashes(xp->d, xp->ddbggc, 0, dashes, 2);
+    return reps;
+}
+
+void 
+DoLines(XParms xp, Parms p, int reps)
+{
+    int i;
+
+    for (i = 0; i != reps; i++)
+    {
+        XDrawLines(xp->d, xp->w, pgc, points, p->objects+1, CoordModeOrigin);
+        if (pgc == xp->ddbggc)
+            pgc = xp->ddfggc;
+        else if(pgc == xp->ddfggc)
+            pgc = xp->ddbggc;
+        else if (pgc == xp->bggc)
+            pgc = xp->fggc;
+        else
+            pgc = xp->bggc;
+       CheckAbort ();
+    }
+}
+
+void 
+EndLines(XParms xp, Parms p)
+{
+    free(points);
+}
+
diff --git a/x11perf/do_movewin.c b/x11perf/do_movewin.c
new file mode 100755 (executable)
index 0000000..ed96ae1
--- /dev/null
@@ -0,0 +1,205 @@
+/*****************************************************************************
+Copyright 1988, 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.
+
+******************************************************************************/
+
+#include "x11perf.h"
+
+static Window *children;
+static XPoint *positions;
+static Window cover;
+static int rows;
+static int x_offset, y_offset;  /* Private global data for DoMoveWindows */
+static int xmax, ymax;
+static int delta1;             /* Private global data for DoResizeWindows */
+
+#define STACK (4*(HEIGHT-10)/CHILDSIZE)
+
+int 
+InitMoveWindows(XParms xp, Parms p, int reps)
+{
+    int     i = 0;
+
+    rows = (p->objects + MAXCOLS - 1) / MAXCOLS;
+    
+    x_offset = 0;
+    y_offset = 0;
+    delta1   = 1;
+
+    children = (Window *) malloc (p->objects*sizeof (Window));
+    positions = (XPoint *) malloc(p->objects*sizeof(XPoint));
+
+    xmax = (CHILDSIZE+CHILDSPACE) * (rows > 1 ? MAXCOLS : p->objects);
+    ymax = rows * (CHILDSIZE+CHILDSPACE);
+
+    for (i = 0; i != p->objects; i++) {
+       positions[i].x = (CHILDSIZE+CHILDSPACE) * (i/rows) + CHILDSPACE/2;
+       positions[i].y = (CHILDSIZE+CHILDSPACE) * (i%rows) + CHILDSPACE/2;
+       children[i] = XCreateSimpleWindow(xp->d, xp->w,
+           positions[i].x, positions[i].y,
+           CHILDSIZE, CHILDSIZE, 0, xp->foreground, xp->foreground);
+    }
+    if (p->special)
+       XMapSubwindows (xp->d, xp->w);
+    return reps;
+}
+
+void 
+DoMoveWindows(XParms xp, Parms p, int reps)
+{
+    int     i, j;
+
+    for (i = 0; i != reps; i++) {
+       x_offset += 1;
+       y_offset += 3;
+       if (y_offset + ymax > HEIGHT)
+           y_offset = 0;
+       if (x_offset + xmax > WIDTH)
+           x_offset = 0;
+       for (j = 0; j != p->objects; j++) {
+           XMoveWindow(xp->d, children[j],
+           positions[j].x + x_offset, positions[j].y + y_offset);
+       }
+       CheckAbort ();
+    }
+}
+
+void 
+EndMoveWindows(XParms xp, Parms p)
+{
+    free(children);
+    free(positions);
+}
+
+void 
+DoResizeWindows(XParms xp, Parms p, int reps)
+{
+    int     i, j, delta2;
+
+    for (i = 0; i != reps; i++) {
+       delta1 = -delta1;
+       delta2 = delta1;
+       for (j = 0; j != p->objects; j++) {
+           delta2 = -delta2;
+           XResizeWindow(xp->d, children[j],
+               CHILDSIZE+delta2, CHILDSIZE-delta2);
+       }
+       CheckAbort ();
+    }
+}
+
+int
+InitCircWindows(XParms xp, Parms p, int reps)
+{
+    int     i;
+    int     pos;
+    int     color;
+
+    children = (Window *) malloc (p->objects * sizeof (Window));
+    for (i = 0; i != p->objects; i++) {
+       pos = i % STACK;
+       color = (i & 1 ? xp->foreground : xp->background);
+       children[i] = XCreateSimpleWindow (xp->d, xp->w, 
+           pos*CHILDSIZE/4 + (i/STACK)*2*CHILDSIZE, pos*CHILDSIZE/4,
+           CHILDSIZE, CHILDSIZE, 0, color, color);
+    }
+    if (p->special)
+       XMapSubwindows (xp->d, xp->w);
+    return reps;
+}
+
+void 
+DoCircWindows(XParms xp, Parms p, int reps)
+{
+    int     i, j;
+
+    for (i = 0; i != reps; i++)
+    {
+       for (j = 0; j != p->objects; j++)
+           XCirculateSubwindows (xp->d, xp->w, RaiseLowest);
+       CheckAbort ();
+    }
+}
+
+void 
+EndCircWindows(XParms xp, Parms p)
+{
+    free(children);
+}
+
+
+int 
+InitMoveTree(XParms xp, Parms p, int reps)
+{
+    int     i = 0;
+
+    rows = (p->objects + MAXCOLS - 1) / MAXCOLS;
+    
+    x_offset = 0;
+    y_offset = 0;
+    delta1   = 1;
+
+    children = (Window *) malloc (p->objects*sizeof (Window));
+    positions = (XPoint *) malloc(p->objects*sizeof(XPoint));
+
+    xmax = (CHILDSIZE+CHILDSPACE) * (rows > 1 ? MAXCOLS : p->objects);
+    ymax = rows * (CHILDSIZE+CHILDSPACE);
+
+    cover = XCreateSimpleWindow(xp->d, xp->w,
+                               0, 0, xmax, ymax, 0,
+                               xp->background, xp->background);
+                               
+    for (i = 0; i != p->objects; i++) {
+       positions[i].x = (CHILDSIZE+CHILDSPACE) * (i/rows) + CHILDSPACE/2;
+       positions[i].y = (CHILDSIZE+CHILDSPACE) * (i%rows) + CHILDSPACE/2;
+       children[i] = XCreateSimpleWindow(xp->d, cover,
+           positions[i].x, positions[i].y,
+           CHILDSIZE, CHILDSIZE, 0, xp->foreground, xp->foreground);
+    }
+    XMapSubwindows (xp->d, cover);
+    XMapWindow (xp->d, cover);
+    return reps;
+}
+
+void 
+DoMoveTree(XParms xp, Parms p, int reps)
+{
+    int     i;
+
+    for (i = 0; i != reps; i++) {
+       x_offset += 1;
+       y_offset += 3;
+       if (y_offset + ymax > HEIGHT)
+           y_offset = 0;
+       if (x_offset + xmax > WIDTH)
+           x_offset = 0;
+       XMoveWindow(xp->d, cover, x_offset, y_offset);
+       CheckAbort ();
+    }
+}
+
+void 
+EndMoveTree(XParms xp, Parms p)
+{
+    XDestroyWindow(xp->d, cover);
+    free(children);
+    free(positions);
+}
diff --git a/x11perf/do_rects.c b/x11perf/do_rects.c
new file mode 100755 (executable)
index 0000000..f697cdb
--- /dev/null
@@ -0,0 +1,121 @@
+/*****************************************************************************
+Copyright 1988, 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.
+
+******************************************************************************/
+
+#include "x11perf.h"
+#include "bitmaps.h"
+
+static XRectangle   *rects;
+static GC          pgc;
+
+int 
+InitRectangles(XParms xp, Parms p, int reps)
+{
+    int i;
+    int size = p->special;
+    int step;
+    int x, y;
+    int rows;
+    int        lw = 0;
+
+    pgc = xp->fggc;
+
+    if (p->bfont)
+    {
+       lw = atoi (p->bfont);
+
+       XSetLineAttributes(xp->d, xp->bggc, lw, LineSolid, CapButt, JoinMiter);
+       XSetLineAttributes(xp->d, xp->fggc, lw, LineSolid, CapButt, JoinMiter);
+       lw = (lw >> 1) + 1;
+    }
+
+    rects = (XRectangle *)malloc(p->objects * sizeof(XRectangle));
+    x = lw;
+    y = lw;
+    rows = 0;
+    if (xp->pack) {
+       /* Pack rectangles as close as possible, mainly for debugging faster
+          tiling, stippling routines in a server */
+       step = size;
+    } else {
+       /* Try to exercise all alignments...any odd number is okay */
+       step = size + 1 + (size % 2);
+    }
+
+    for (i = 0; i != p->objects; i++) {
+       rects[i].x = x;
+        rects[i].y = y;
+       rects[i].width = rects[i].height = size;
+
+       y += step;
+       rows++;
+       if (y + size > HEIGHT || rows == MAXROWS) {
+           rows = 0;
+           y = lw;
+           x += step;
+           if (x + size > WIDTH) {
+               x = lw;
+           }
+       }
+    }
+
+    SetFillStyle(xp, p);
+
+    return reps;
+}
+
+void 
+DoRectangles(XParms xp, Parms p, int reps)
+{
+    int i;
+
+    for (i = 0; i != reps; i++) {
+        XFillRectangles(xp->d, xp->w, pgc, rects, p->objects);
+        if (pgc == xp->bggc)
+            pgc = xp->fggc;
+        else
+            pgc = xp->bggc;
+       CheckAbort ();
+    }
+}
+
+void 
+DoOutlineRectangles(XParms xp, Parms  p, int reps)
+{
+    int        i;
+
+    for (i = 0; i != reps; i++) {
+       XDrawRectangles (xp->d, xp->w, pgc, rects, p->objects);
+        if (pgc == xp->bggc)
+            pgc = xp->fggc;
+        else
+            pgc = xp->bggc;
+       CheckAbort ();
+    }
+}
+
+void 
+EndRectangles(XParms xp, Parms p)
+{
+    free(rects);
+}
+
diff --git a/x11perf/do_segs.c b/x11perf/do_segs.c
new file mode 100755 (executable)
index 0000000..bc13fbd
--- /dev/null
@@ -0,0 +1,383 @@
+/*****************************************************************************
+Copyright 1988, 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.
+
+******************************************************************************/
+
+#include "x11perf.h"
+
+static XSegment *segments;
+static GC       pgc;
+
+static void 
+GenerateSegments(XParms xp, Parms p, Bool ddashed)
+{
+    int     size;
+    int     half;
+    int     i;
+    int     rows;          /* Number of rows filled in current column      */
+    int     x, y;          /* base of square to draw in                    */
+    int     x1=0, y1=0, x2=0, y2=0; /* offsets into square                 */
+    int     phase;         /* how far into 0..8*size we are                */
+    int     phaseinc;       /* how much to increment phase at each segment  */
+    int     size8;         /* 8 * size                                     */
+    XGCValues   gcv;
+
+    if(ddashed)
+       pgc = xp->ddfggc;
+    else
+       pgc = xp->fggc;
+
+
+    size = p->special;
+    size8 = 8 * size;
+    half = (size + 19) / 20;
+
+    segments = (XSegment *)malloc((p->objects) * sizeof(XSegment));
+
+    /* All this x, x1, etc. stuff is to create a pattern that
+       (1) scans down the screen vertically, with each new segment going
+           into a square of size^2.
+
+       (2) rotates the endpoints clockwise around the square
+
+       (3) rotates by ``large'' steps if we aren't going to paint enough
+           segments to get full coverage
+
+       (4) uses CapNotLast so we can create segments of length 1 that
+           nonetheless have a distinct direction
+    */
+
+    x     = half;  y     = half;
+    phase = 0;
+    phaseinc = size8 / p->objects;
+    if (phaseinc == 0) phaseinc = 1;
+    rows = 0;
+
+    for (i = 0; i != p->objects; i++) {    
+       switch (phase / size) {
+       case 0:
+           x1 = 0;
+           y1 = 0;
+           x2 = size;
+           y2 = phase;
+           break;
+
+       case 1:
+           x1 = phase % size;    
+           y1 = 0;
+           x2 = size;
+           y2 = size;
+           break;
+
+       case 2:
+           x1 = size;
+           y1 = 0;
+           x2 = size - phase % size;
+           y2 = size;
+           break;
+
+       case 3:
+           x1 = size;
+           y1 = phase % size;
+           x2 = 0;
+           y2 = size;
+           break;
+
+       case 4:
+           x1 = size;
+           y1 = size;
+           x2 = 0;
+           y2 = size - phase % size;
+           break;
+
+       case 5:
+           x1 = size - phase % size;
+           y1 = size;
+           x2 = 0;
+           y2 = 0;
+           break;
+
+       case 6:
+           x1 = 0;
+           y1 = size;
+           x2 = phase % size;
+           y2 = 0;
+           break;
+
+       case 7:
+           x1 = 0;
+           y1 = size - phase % size;
+           x2 = size;
+           y2 = 0;
+           break;
+       } /* end switch */
+
+       segments[i].x1 = x + x1;
+       segments[i].y1 = y + y1;
+       segments[i].x2 = x + x2;
+       segments[i].y2 = y + y2;
+
+       /* Change square to draw segment in */
+       rows++;
+       y += size;
+       if (y >= HEIGHT - size - half || rows == MAXROWS) {
+           /* Go to next column */
+           rows = 0;
+           y = half;
+           x += size;
+           if (x >= WIDTH - size - half) {
+               x = half;
+           }
+       }
+
+       /* Increment phase */
+       phase += phaseinc;
+       if (phase >= size8) phase -= size8;
+
+    }
+
+    gcv.cap_style = CapNotLast;
+
+    if(ddashed) {
+       XChangeGC(xp->d, xp->ddfggc, GCCapStyle, &gcv);
+       XChangeGC(xp->d, xp->ddbggc, GCCapStyle, &gcv);
+    } else {
+       XChangeGC(xp->d, xp->fggc, GCCapStyle, &gcv);
+       XChangeGC(xp->d, xp->bggc, GCCapStyle, &gcv);
+    }
+}
+   
+int 
+InitSegments(XParms xp, Parms p, int reps)
+{
+    GenerateSegments(xp, p, False);
+    return reps;
+}
+
+int 
+InitDashedSegments(XParms xp, Parms p, int reps)
+{
+    char dashes[2];
+
+    GenerateSegments(xp, p, False);
+
+    /* Modify GCs to draw dashed */
+    XSetLineAttributes
+       (xp->d, xp->bggc, 0, LineOnOffDash, CapNotLast, JoinMiter);
+    XSetLineAttributes
+       (xp->d, xp->fggc, 0, LineOnOffDash, CapNotLast, JoinMiter);
+    dashes[0] = 3;   dashes[1] = 2;
+    XSetDashes(xp->d, xp->fggc, 0, dashes, 2);
+    XSetDashes(xp->d, xp->bggc, 0, dashes, 2);
+    return reps;
+}
+
+int 
+InitDoubleDashedSegments(XParms xp, Parms p, int reps)
+{
+    char dashes[2];
+
+    GenerateSegments(xp, p, True);
+
+    /* Modify GCs to draw dashed */
+    XSetLineAttributes
+       (xp->d, xp->ddbggc, 0, LineDoubleDash, CapNotLast, JoinMiter);
+    XSetLineAttributes
+       (xp->d, xp->ddfggc, 0, LineDoubleDash, CapNotLast, JoinMiter);
+    dashes[0] = 3;   dashes[1] = 2;
+    XSetDashes(xp->d, xp->ddfggc, 0, dashes, 2);
+    XSetDashes(xp->d, xp->ddbggc, 0, dashes, 2);
+    return reps;
+}
+
+int 
+InitHorizSegments(XParms xp, Parms p, int reps)
+{
+    int     size;
+    int     half;
+    int     i;
+    int     rows;       /* Number of rows filled in current column      */
+    int     x, y;      /* base of square to draw in                    */
+    int     y1;                /* y position inside square                     */
+    int     inc;
+    XGCValues   gcv;
+
+    pgc = xp->fggc;
+
+    size = p->special;
+    half = (size + 19) / 20;
+
+    segments = (XSegment *)malloc((p->objects) * sizeof(XSegment));
+
+    x = half;
+    y = half;
+    y1 = 0;
+    rows = 0;
+    inc = size / p->objects;
+    if (inc == 0) inc = 1;
+
+    for (i = 0; i != p->objects; i++) {
+       if (i % 2) {
+           segments[i].x1 = x + size;
+           segments[i].x2 = x;
+           segments[i].y1 = y + size - y1;
+           segments[i].y2 = y + size - y1;
+           y1 += inc;
+           if (y1 >= size) y1 -= size;
+       } else {
+           segments[i].x1 = x;
+           segments[i].x2 = x + size;
+           segments[i].y1 = y + y1;
+           segments[i].y2 = y + y1;
+       }
+       rows++;
+       y += size;
+       if (y >= HEIGHT - size - half || rows == MAXROWS) {
+           rows = 0;
+           y = half;
+           x += size;
+           if (x >= WIDTH - size - half)
+               x = half;
+       }
+    }
+    gcv.cap_style = CapNotLast;
+    XChangeGC(xp->d, xp->fggc, GCCapStyle, &gcv);
+    XChangeGC(xp->d, xp->bggc, GCCapStyle, &gcv);
+    return reps;
+}
+
+int 
+InitWideHorizSegments(XParms xp, Parms p, int reps)
+{
+    int size;
+
+    (void)InitHorizSegments(xp, p, reps);
+
+    size = p->special;
+    XSetLineAttributes(xp->d, xp->bggc, (int) ((size + 9) / 10),
+       LineSolid, CapRound, JoinRound);
+    XSetLineAttributes(xp->d, xp->fggc, (int) ((size + 9) / 10),
+       LineSolid, CapRound, JoinRound);
+
+    return reps;
+}
+
+int 
+InitVertSegments(XParms xp, Parms p, int reps)
+{
+    int     size;
+    int     half;
+    int     i;
+    int     rows;       /* Number of rows filled in current column      */
+    int     x, y;      /* base of square to draw in                    */
+    int     x1;                /* x position inside square                     */
+    int     inc;
+    XGCValues   gcv;
+
+    pgc = xp->fggc;
+
+    size = p->special;
+    half = (size + 19) / 20;
+
+    segments = (XSegment *)malloc((p->objects) * sizeof(XSegment));
+
+    x = half;
+    y = half;
+    x1 = 0;
+    rows = 0;
+    inc = size / p->objects;
+    if (inc == 0) inc = 1;
+
+    for (i = 0; i != p->objects; i++) {
+       if (i % 2) {
+           segments[i].x1 = x + size - x1;
+           segments[i].x2 = x + size - x1;
+           segments[i].y1 = y + size;
+           segments[i].y2 = y;
+           x1 += inc;
+           if (x1 >= size) x1 -= size;
+       } else {
+           segments[i].x1 = x + x1;
+           segments[i].x2 = x + x1;
+           segments[i].y1 = y;
+           segments[i].y2 = y + size;
+       }
+       rows++;
+       y += size;
+       if (y >= HEIGHT - size - half || rows == MAXROWS) {
+           /* Go to next column */
+           rows = 0;
+           y = half;
+           x += size;
+           if (x >= WIDTH - size - half) {
+               x = half;
+           }
+       }
+    }
+    gcv.cap_style = CapNotLast;
+    XChangeGC(xp->d, xp->fggc, GCCapStyle, &gcv);
+    XChangeGC(xp->d, xp->bggc, GCCapStyle, &gcv);
+    return reps;
+}
+
+int 
+InitWideVertSegments(XParms xp, Parms p, int reps)
+{
+    int size;
+
+    (void)InitVertSegments(xp, p, reps);
+
+    size = p->special;
+    XSetLineAttributes(xp->d, xp->bggc, (int) ((size + 9) / 10),
+       LineSolid, CapRound, JoinRound);
+    XSetLineAttributes(xp->d, xp->fggc, (int) ((size + 9) / 10),
+       LineSolid, CapRound, JoinRound);
+
+    return reps;
+}
+
+void 
+DoSegments(XParms xp, Parms p, int reps)
+{
+    int i;
+
+    for (i = 0; i != reps; i++) {
+        XDrawSegments(xp->d, xp->w, pgc, segments, p->objects);
+        if (pgc == xp->ddbggc)
+            pgc = xp->ddfggc;
+        else if(pgc == xp->ddfggc)
+            pgc = xp->ddbggc;
+        else if (pgc == xp->bggc)
+            pgc = xp->fggc;
+        else
+            pgc = xp->bggc;
+       CheckAbort ();
+    }
+}
+
+void 
+EndSegments(XParms xp, Parms p)
+{
+    free(segments);
+}
+
diff --git a/x11perf/do_simple.c b/x11perf/do_simple.c
new file mode 100755 (executable)
index 0000000..0904b6f
--- /dev/null
@@ -0,0 +1,107 @@
+/*****************************************************************************
+Copyright 1988, 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.
+
+******************************************************************************/
+
+#ifndef VMS
+#include <X11/Xatom.h>
+#else
+#include <decw$include/Xatom.h>
+#endif
+
+#include "x11perf.h"
+
+static Atom XA_PK_TEMP;
+
+void 
+DoNoOp(XParms xp, Parms p, int reps)
+{
+    int     i;
+
+    for (i = 0; i != reps; i++) {
+       XNoOp(xp->d);
+       CheckAbort ();
+    }
+}
+
+
+void 
+DoGetAtom(XParms xp, Parms p, int reps)
+{
+    char    *atom;
+    int     i;
+
+    for (i = 0; i != reps; i++) {
+       atom = XGetAtomName (xp->d, 1);
+       XFree(atom); /* fix XBUG 6480 */
+       CheckAbort ();
+    }
+}
+
+void 
+DoQueryPointer(XParms xp, Parms p, int reps)
+{
+    int     i;
+    Window  w;
+    int     x;
+    unsigned int m;
+
+    for (i = 0; i != reps; i++) {
+       XQueryPointer (xp->d, xp->w, &w, &w, &x, &x, &x, &x, &m);
+       CheckAbort ();
+    }
+}
+
+int 
+InitGetProperty(XParms xp, Parms p, int reps)
+{
+    long foo[4];
+
+    foo[0] = 41;
+    foo[1] = 14;
+    foo[2] = 37;
+    foo[3] = 73;
+    XA_PK_TEMP = XInternAtom (xp->d, "_PK_TEMP", False);
+    XChangeProperty (
+           xp->d, xp->w, XA_PK_TEMP, XA_INTEGER, 32,
+           PropModeReplace, (unsigned char *)foo, 4);
+    return reps;
+}
+
+void 
+DoGetProperty(XParms xp, Parms p, int reps)
+{
+    int     i;
+    int     actual_format;
+    unsigned long actual_length, bytes_remaining;
+    unsigned char *prop;
+    
+    Atom actual_type;
+
+    for (i = 0; i != reps; i++) {
+       XGetWindowProperty (
+               xp->d, xp->w, XA_PK_TEMP, 0, 4,
+               False, AnyPropertyType, &actual_type, &actual_format,
+               &actual_length, &bytes_remaining, &prop);
+       CheckAbort ();
+       XFree(prop);
+    }
+}
diff --git a/x11perf/do_tests.c b/x11perf/do_tests.c
new file mode 100755 (executable)
index 0000000..ce3026b
--- /dev/null
@@ -0,0 +1,1338 @@
+/*****************************************************************************
+Copyright 1988, 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.
+
+******************************************************************************/
+
+#include "x11perf.h"
+
+/*
+ * some test must be done a certain multiple of times. That multiple is
+ * in the second half of the products below. You can edit the multiplier,
+ * just not the multiplicand.
+ */
+
+Test test[] = {
+  {"-dot",      "Dot", NULL,
+               InitDots, DoDots, NullProc, EndDots,
+               V1_2FEATURE, ROP, 0,
+               {POLY}},
+  {"-rect1",    "1x1 rectangle", NULL,
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 1, NULL, NULL, FillSolid}},
+  {"-rect10",   "10x10 rectangle", NULL,
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 10, NULL, NULL, FillSolid}},
+  {"-rect100",  "100x100 rectangle", NULL,
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {36, 100, NULL, NULL, FillSolid}},
+  {"-rect500",  "500x500 rectangle", NULL,
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {1, 500, NULL, NULL, FillSolid}},
+  {"-srect1",  "1x1 stippled rectangle",
+               "1x1 stippled rectangle (8x8 stipple)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 1, NULL, NULL, FillStippled}},
+  {"-srect10", "10x10 stippled rectangle",
+               "10x10 stippled rectangle (8x8 stipple)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 10, NULL, NULL, FillStippled}},
+  {"-srect100", "100x100 stippled rectangle",
+               "100x100 stippled rectangle (8x8 stipple)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {36, 100, NULL, NULL, FillStippled}},
+  {"-srect500", "500x500 stippled rectangle",
+               "500x500 stippled rectangle (8x8 stipple)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {1, 500, NULL, NULL, FillStippled}},
+  {"-osrect1",  "1x1 opaque stippled rectangle",
+               "1x1 opaque stippled rectangle (8x8 stipple)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 1, NULL, NULL, FillOpaqueStippled}},
+  {"-osrect10", "10x10 opaque stippled rectangle",
+               "10x10 opaque stippled rectangle (8x8 stipple)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 10, NULL, NULL, FillOpaqueStippled}},
+  {"-osrect100", "100x100 opaque stippled rectangle",
+               "100x100 opaque stippled rectangle (8x8 stipple)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {36, 100, NULL, NULL, FillOpaqueStippled}},
+  {"-osrect500", "500x500 opaque stippled rectangle",
+               "500x500 opaque stippled rectangle (8x8 stipple)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {1, 500, NULL, NULL, FillOpaqueStippled}},
+  {"-tilerect1", "1x1 4x4 tiled rectangle",
+               "1x1 tiled rectangle (4x4 tile)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 1, NULL, NULL, FillTiled}},
+  {"-tilerect10", "10x10 4x4 tiled rectangle",
+               "10x10 tiled rectangle (4x4 tile)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 10, NULL, NULL, FillTiled}},
+  {"-tilerect100", "100x100 4x4 tiled rectangle",
+               "100x100 tiled rectangle (4x4 tile)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {36, 100, NULL, NULL, FillTiled}},
+  {"-tilerect500", "500x500 4x4 tiled rectangle",
+               "500x500 tiled rectangle (4x4 tile)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {1, 500, NULL, NULL, FillTiled}},
+  {"-oddsrect1",  "1x1 stippled rectangle (17x15 stipple)", NULL,
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 1, "OddTile", NULL, FillStippled}},
+  {"-oddsrect10", "10x10 stippled rectangle (17x15 stipple)", NULL,
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 10, "OddTile", NULL, FillStippled}},
+  {"-oddsrect100", "100x100 stippled rectangle (17x15 stipple)", NULL,
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_4FEATURE, ROP, 0,
+               {36, 100, "OddTile", NULL, FillStippled}},
+  {"-oddsrect500", "500x500 stippled rectangle (17x15 stipple)", NULL,
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_4FEATURE, ROP, 0,
+               {1, 500, "OddTile", NULL, FillStippled}},
+  {"-oddosrect1",  "1x1 opaque stippled rectangle (17x15 stipple)", NULL,
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 1, "OddTile", NULL, FillOpaqueStippled}},
+  {"-oddosrect10", "10x10 opaque stippled rectangle (17x15 stipple)", NULL,
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 10, "OddTile", NULL, FillOpaqueStippled}},
+  {"-oddosrect100", "100x100 opaque stippled rectangle (17x15 stipple)", NULL,
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_4FEATURE, ROP, 0,
+               {36, 100, "OddTile", NULL, FillOpaqueStippled}},
+  {"-oddosrect500", "500x500 opaque stippled rectangle (17x15 stipple)", NULL,
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_4FEATURE, ROP, 0,
+               {1, 500, "OddTile", NULL, FillOpaqueStippled}},
+  {"-oddtilerect1", "1x1 tiled rectangle (17x15 tile)", NULL,
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 1, "OddTile", NULL, FillTiled}},
+  {"-oddtilerect10", "10x10 tiled rectangle (17x15 tile)", NULL,
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 10, "OddTile", NULL, FillTiled}},
+  {"-oddtilerect100", "100x100 tiled rectangle (17x15 tile)", NULL,
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_4FEATURE, ROP, 0,
+               {36, 100, "OddTile", NULL, FillTiled}},
+  {"-oddtilerect500", "500x500 tiled rectangle (17x15 tile)", NULL,
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_4FEATURE, ROP, 0,
+               {1, 500, "OddTile", NULL, FillTiled}},
+  {"-bigsrect1",  "1x1 161x145 stippled rectangle",
+               "1x1 stippled rectangle (161x145 stipple)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 1, "mensetmanus", NULL, FillStippled}},
+  {"-bigsrect10", "10x10 161x145 stippled rectangle",
+               "10x10 stippled rectangle (161x145 stipple)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 10, "mensetmanus", NULL, FillStippled}},
+  {"-bigsrect100", "100x100 161x145 stippled rectangle",
+               "100x100 stippled rectangle (161x145 stipple)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_3FEATURE, ROP, 0,
+               {36, 100, "mensetmanus", NULL, FillStippled}},
+  {"-bigsrect500", "500x500 161x145 stippled rectangle",
+               "500x500 stippled rectangle (161x145 stipple)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_3FEATURE, ROP, 0,
+               {1, 500, "mensetmanus", NULL, FillStippled}},
+  {"-bigosrect1",  "1x1 161x145 opaque stippled rectangle",
+               "1x1 opaque stippled rectangle (161x145 stipple)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 1, "mensetmanus", NULL, FillOpaqueStippled}},
+  {"-bigosrect10", "10x10 161x145 opaque stippled rectangle",
+               "10x10 opaque stippled rectangle (161x145 stipple)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 10, "mensetmanus", NULL, FillOpaqueStippled}},
+  {"-bigosrect100", "100x100 161x145 opaque stippled rectangle",
+               "100x100 opaque stippled rectangle (161x145 stipple)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_3FEATURE, ROP, 0,
+               {36, 100, "mensetmanus", NULL, FillOpaqueStippled}},
+  {"-bigosrect500", "500x500 161x145 opaque stippled rectangle",
+               "500x500 opaque stippled rectangle (161x145 stipple)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_3FEATURE, ROP, 0,
+               {1, 500, "mensetmanus", NULL, FillOpaqueStippled}},
+  {"-bigtilerect1", "1x1 161x145 tiled rectangle",
+               "1x1 tiled rectangle (161x145 tile)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 1, "mensetmanus", NULL, FillTiled}},
+  {"-bigtilerect10", "10x10 161x145 tiled rectangle",
+               "10x10 tiled rectangle (161x145 tile)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 10, "mensetmanus", NULL, FillTiled}},
+  {"-bigtilerect100", "100x100 161x145 tiled rectangle",
+               "100x100 tiled rectangle (161x145 tile)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {36, 100, "mensetmanus", NULL, FillTiled}},
+  {"-bigtilerect500", "500x500 161x145 tiled rectangle",
+               "500x500 tiled rectangle (161x145 tile)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_2FEATURE, ROP, 0,
+               {1, 500, "mensetmanus", NULL, FillTiled}},
+  {"-eschertilerect1", "1x1 216x208 tiled rectangle",
+               "1x1 tiled rectangle (216x208 tile)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 1, "escherknot", NULL, FillTiled}},
+  {"-eschertilerect10", "10x10 216x208 tiled rectangle",
+               "10x10 tiled rectangle (216x208 tile)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 10, "escherknot", NULL, FillTiled}},
+  {"-eschertilerect100", "100x100 216x208 tiled rectangle",
+               "100x100 tiled rectangle (216x208 tile)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_3FEATURE, ROP, 0,
+               {36, 100, "escherknot", NULL, FillTiled}},
+  {"-eschertilerect500", "500x500 216x208 tiled rectangle",
+               "500x500 tiled rectangle (216x208 tile)",
+               InitRectangles, DoRectangles, NullProc, EndRectangles,
+               V1_3FEATURE, ROP, 0,
+               {1, 500, "escherknot", NULL, FillTiled}},
+  {"-seg1",     "1-pixel line segment", NULL,
+               InitSegments, DoSegments, NullProc, EndSegments,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 1}},
+  {"-seg10",    "10-pixel line segment", NULL,
+               InitSegments, DoSegments, NullProc, EndSegments,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 10}},
+  {"-seg100",   "100-pixel line segment", NULL,
+               InitSegments, DoSegments, NullProc, EndSegments,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 100}},
+  {"-seg500",   "500-pixel line segment", NULL,
+               InitSegments, DoSegments, NullProc, EndSegments,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 500}},
+  {"-seg100c1", "100-pixel line segment (1 kid)", NULL,
+               InitSegments, DoSegments, NullProc, EndSegments,
+               V1_2FEATURE, ROP, 1,
+               {POLY, 100}},
+  {"-seg100c2", "100-pixel line segment (2 kids)", NULL,
+               InitSegments, DoSegments, NullProc, EndSegments,
+               V1_2FEATURE, ROP, 2,
+               {POLY, 100}},
+  {"-seg100c3", "100-pixel line segment (3 kids)", NULL,
+               InitSegments, DoSegments, NullProc, EndSegments,
+               V1_2FEATURE, ROP, 3,
+               {POLY, 100}},
+  {"-dseg10",   "10-pixel dashed segment", NULL,
+               InitDashedSegments, DoSegments, NullProc, EndSegments,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 10}},
+  {"-dseg100", "100-pixel dashed segment", NULL,
+               InitDashedSegments, DoSegments, NullProc, EndSegments,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 100}},
+  {"-ddseg100", "100-pixel double-dashed segment", NULL,
+               InitDoubleDashedSegments, DoSegments, NullProc, EndSegments,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 100}},
+  {"-hseg10",   "10-pixel horizontal line segment", NULL,
+               InitHorizSegments, DoSegments, NullProc, EndSegments,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 10}},
+  {"-hseg100",  "100-pixel horizontal line segment", NULL,
+               InitHorizSegments, DoSegments, NullProc, EndSegments,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 100}},
+  {"-hseg500",  "500-pixel horizontal line segment", NULL,
+               InitHorizSegments, DoSegments, NullProc, EndSegments,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 500}},
+  {"-vseg10",   "10-pixel vertical line segment", NULL,
+               InitVertSegments, DoSegments, NullProc, EndSegments,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 10}},
+  {"-vseg100",  "100-pixel vertical line segment", NULL,
+               InitVertSegments, DoSegments, NullProc, EndSegments,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 100}},
+  {"-vseg500",  "500-pixel vertical line segment", NULL,
+               InitVertSegments, DoSegments, NullProc, EndSegments,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 500}},
+  {"-whseg10",  "10x1 wide horizontal line segment", NULL,
+               InitWideHorizSegments, DoSegments, NullProc, EndSegments,
+               V1_3FEATURE, ROP, 0,
+               {200, 10}},
+  {"-whseg100", "100x10 wide horizontal line segment", NULL,
+               InitWideHorizSegments, DoSegments, NullProc, EndSegments,
+               V1_3FEATURE, ROP, 0,
+               {100, 100}},
+  {"-whseg500", "500x50 wide horizontal line segment", NULL,
+               InitWideHorizSegments, DoSegments, NullProc, EndSegments,
+               V1_3FEATURE, ROP, 0,
+               {50, 500}},
+  {"-wvseg10",  "10x1 wide vertical line segment", NULL,
+               InitWideVertSegments, DoSegments, NullProc, EndSegments,
+               V1_3FEATURE, ROP, 0,
+               {200, 10}},
+  {"-wvseg100", "100x10 wide vertical line segment", NULL,
+               InitWideVertSegments, DoSegments, NullProc, EndSegments,
+               V1_3FEATURE, ROP, 0,
+               {100, 100}},
+  {"-wvseg500", "500x50 wide vertical line segment", NULL,
+               InitWideVertSegments, DoSegments, NullProc, EndSegments,
+               V1_3FEATURE, ROP, 0,
+               {50, 500}},
+  {"-line1",   "1-pixel line", NULL,
+               InitLines, DoLines, NullProc, EndLines,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 1}},
+  {"-line10",   "10-pixel line", NULL,
+               InitLines, DoLines, NullProc, EndLines,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 10}},
+  {"-line100",  "100-pixel line", NULL,
+               InitLines, DoLines, NullProc, EndLines,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 100}},
+  {"-line500", "500-pixel line", NULL,
+               InitLines, DoLines, NullProc, EndLines,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 500}},
+  {"-dline10",  "10-pixel dashed line", NULL,
+               InitDashedLines, DoLines, NullProc, EndLines,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 10}},
+  {"-dline100", "100-pixel dashed line", NULL,
+               InitDashedLines, DoLines, NullProc, EndLines,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 100}},
+  {"-ddline100", "100-pixel double-dashed line", NULL,
+               InitDoubleDashedLines, DoLines, NullProc, EndLines,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 100}},
+  {"-wline10",  "10x1 wide line", NULL,
+               InitWideLines, DoLines, NullProc, EndLines,
+               V1_2FEATURE, ROP, 0,
+               {100, 10}},
+  {"-wline100", "100x10 wide line", NULL,
+               InitWideLines, DoLines, NullProc, EndLines,
+               V1_2FEATURE, ROP, 0,
+               {100, 100}},
+  {"-wline500", "500x50 wide line", NULL,
+               InitWideLines, DoLines, NullProc, EndLines,
+               V1_2FEATURE, ROP, 0,
+               {50, 500}},
+  {"-wdline100", "100x10 wide dashed line", NULL,
+               InitWideDashedLines, DoLines, NullProc, EndLines,
+               V1_2FEATURE, ROP, 0,
+               {100, 100}},
+  {"-wddline100",  "100x10 wide double-dashed line", NULL,
+               InitWideDoubleDashedLines, DoLines, NullProc, EndLines,
+               V1_2FEATURE, ROP, 0,
+               {100, 100}},
+  {"-orect10",  "10x10 rectangle outline", NULL,
+               InitRectangles, DoOutlineRectangles, NullProc, EndRectangles,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 10, NULL, "0", FillSolid}},
+  {"-orect100", "100x100 rectangle outline", NULL,
+               InitRectangles, DoOutlineRectangles, NullProc, EndRectangles,
+               V1_3FEATURE, ROP, 0,
+               {36, 100, NULL, "0", FillSolid}},
+  {"-orect500",        "500x500 rectangle outline", NULL,
+               InitRectangles, DoOutlineRectangles, NullProc, EndRectangles,
+               V1_3FEATURE, ROP, 0,
+               {1, 500, NULL, "0", FillSolid}},
+  {"-worect10",        "10x10 wide rectangle outline", NULL,
+               InitRectangles, DoOutlineRectangles, NullProc, EndRectangles,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 10, NULL, "1", FillSolid}},
+  {"-worect100", "100x100 wide rectangle outline", NULL,
+               InitRectangles, DoOutlineRectangles, NullProc, EndRectangles,
+               V1_3FEATURE, ROP, 0,
+               {36, 100, NULL, "10", FillSolid}},
+  {"-worect500", "500x500 wide rectangle outline", NULL,
+               InitRectangles, DoOutlineRectangles, NullProc, EndRectangles,
+               V1_3FEATURE, ROP, 0,
+               {1, 500, NULL, "50", FillSolid}},
+  {"-circle1",  "1-pixel circle", NULL,
+               InitCircles, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 1}},
+  {"-circle10", "10-pixel circle", NULL,
+               InitCircles, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 10}},
+  {"-circle100", "100-pixel circle", NULL,
+               InitCircles, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {200, 100}},
+  {"-circle500", "500-pixel circle", NULL,
+               InitCircles, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {50, 500}},
+  {"-dcircle100", "100-pixel dashed circle", NULL,
+               InitDashedCircles, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {100, 100}},
+  {"-ddcircle100", "100-pixel double-dashed circle", NULL,
+               InitDoubleDashedCircles, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {100, 100}},
+  {"-wcircle10", "10-pixel wide circle", NULL,
+               InitWideCircles, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 10}},
+  {"-wcircle100", "100-pixel wide circle", NULL,
+               InitWideCircles, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {100, 100}},
+  {"-wcircle500", "500-pixel wide circle", NULL,
+               InitWideCircles, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {25, 500}},
+  {"-wdcircle100", "100-pixel wide dashed circle", NULL,
+               InitWideDashedCircles, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {100, 100}},
+  {"-wddcircle100", "100-pixel wide double-dashed circle", NULL,
+               InitWideDoubleDashedCircles, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {100, 100}},
+  {"-pcircle10", "10-pixel partial circle", NULL,
+               InitPartCircles, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 10}},
+  {"-pcircle100", "100-pixel partial circle", NULL,
+               InitPartCircles, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {198, 100}},
+  {"-wpcircle10", "10-pixel wide partial circle", NULL,
+               InitPartWideCircles, DoArcs, NullProc, EndArcs,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 10}},
+  {"-wpcircle100", "100-pixel wide partial circle", NULL,
+               InitPartWideCircles, DoArcs, NullProc, EndArcs,
+               V1_3FEATURE, ROP, 0,
+               {198, 100}},
+  {"-fcircle1",  "1-pixel solid circle", NULL,
+               InitCircles, DoFilledArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 1}},
+  {"-fcircle10", "10-pixel solid circle", NULL,
+               InitCircles, DoFilledArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 10}},
+  {"-fcircle100", "100-pixel solid circle", NULL,
+               InitCircles, DoFilledArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {100, 100}},
+  {"-fcircle500", "500-pixel solid circle", NULL,
+               InitCircles, DoFilledArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {20, 500}},
+  {"-fcpcircle10", "10-pixel fill chord partial circle", NULL,
+               InitChordPartCircles, DoFilledArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 10}},
+  {"-fcpcircle100", "100-pixel fill chord partial circle", NULL,
+               InitChordPartCircles, DoFilledArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {108, 100}},
+  {"-fspcircle10", "10-pixel fill slice partial circle", NULL,
+               InitSlicePartCircles, DoFilledArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 10}},
+  {"-fspcircle100", "100-pixel fill slice partial circle", NULL,
+               InitSlicePartCircles, DoFilledArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {108, 100}},
+  {"-ellipse10", "10-pixel ellipse", NULL,
+               InitEllipses, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {500, 10}},
+  {"-ellipse100", "100-pixel ellipse", NULL,
+               InitEllipses, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {300, 100}},
+  {"-ellipse500", "500-pixel ellipse", NULL,
+               InitEllipses, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {100, 500}},
+  {"-dellipse100", "100-pixel dashed ellipse", NULL,
+               InitDashedEllipses, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {25, 100}},
+  {"-ddellipse100", "100-pixel double-dashed ellipse", NULL,
+               InitDoubleDashedEllipses, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {25, 100}},
+  {"-wellipse10", "10-pixel wide ellipse", NULL,
+               InitWideEllipses, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {200, 10}},
+  {"-wellipse100", "100-pixel wide ellipse", NULL,
+               InitWideEllipses, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {25, 100}},
+  {"-wellipse500", "500-pixel wide ellipse", NULL,
+               InitWideEllipses, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {20, 500}},
+  {"-wdellipse100", "100-pixel wide dashed ellipse", NULL,
+               InitWideDashedEllipses, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {25, 100}},
+  {"-wddellipse100", "100-pixel wide double-dashed ellipse", NULL,
+               InitWideDoubleDashedEllipses, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {25, 100}},
+  {"-pellipse10", "10-pixel partial ellipse", NULL,
+               InitPartEllipses, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {540, 10}},
+  {"-pellipse100", "100-pixel partial ellipse", NULL,
+               InitPartEllipses, DoArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {360, 100}},
+  {"-wpellipse10", "10-pixel wide partial ellipse", NULL,
+               InitPartWideEllipses, DoArcs, NullProc, EndArcs,
+               V1_3FEATURE, ROP, 0,
+               {540, 10}},
+  {"-wpellipse100", "100-pixel wide partial ellipse", NULL,
+               InitPartWideEllipses, DoArcs, NullProc, EndArcs,
+               V1_3FEATURE, ROP, 0,
+               {360, 100}},
+  {"-fellipse10", "10-pixel filled ellipse", NULL,
+               InitEllipses, DoFilledArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {200, 10}},
+  {"-fellipse100", "100-pixel filled ellipse", NULL,
+               InitEllipses, DoFilledArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {25, 100}},
+  {"-fellipse500", "500-pixel filled ellipse", NULL,
+               InitEllipses, DoFilledArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {10, 500}},
+  {"-fcpellipse10", "10-pixel fill chord partial ellipse", NULL,
+               InitChordPartEllipses, DoFilledArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {270, 10}},
+  {"-fcpellipse100", "100-pixel fill chord partial ellipse", NULL,
+               InitChordPartEllipses, DoFilledArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {36, 100}},
+  {"-fspellipse10", "10-pixel fill slice partial ellipse", NULL,
+               InitSlicePartEllipses, DoFilledArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {270, 10}},
+  {"-fspellipse100", "100-pixel fill slice partial ellipse", NULL,
+               InitSlicePartEllipses, DoFilledArcs, NullProc, EndArcs,
+               V1_2FEATURE, ROP, 0,
+               {36, 100}},
+  {"-triangle1", "Fill 1-pixel/side triangle", NULL,
+               InitTriangles, DoTriangles, NullProc, EndTriangles,
+               V1_2ONLY, ROP, 0,
+               {POLY, 1}},
+  {"-triangle10", "Fill 10-pixel/side triangle", NULL,
+               InitTriangles, DoTriangles, NullProc, EndTriangles,
+               V1_2ONLY, ROP, 0,
+               {POLY, 10}},
+  {"-triangle100", "Fill 100-pixel/side triangle", NULL,
+               InitTriangles, DoTriangles, NullProc, EndTriangles,
+               V1_2ONLY, ROP, 0,
+               {100, 100}},
+  {"-triangle1", "Fill 1x1 equivalent triangle", NULL,
+               InitTriangles, DoTriangles, NullProc, EndTriangles,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 1}},
+  {"-triangle10", "Fill 10x10 equivalent triangle", NULL,
+               InitTriangles, DoTriangles, NullProc, EndTriangles,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 10}},
+  {"-triangle100", "Fill 100x100 equivalent triangle", NULL,
+               InitTriangles, DoTriangles, NullProc, EndTriangles,
+               V1_3FEATURE, ROP, 0,
+               {100, 100}},
+  {"-trap1", "Fill 1x1 trapezoid", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 1}},
+  {"-trap10", "Fill 10x10 trapezoid", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 10}},
+  {"-trap100", "Fill 100x100 trapezoid", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_2FEATURE, ROP, 0,
+               {POLY/10, 100}},
+  {"-trap300", "Fill 300x300 trapezoid", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {2, 300}},
+  {"-strap1", "Fill 1x1 stippled trapezoid (8x8 stipple)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 1, NULL, NULL, FillStippled}},
+  {"-strap10", "Fill 10x10 stippled trapezoid",
+               "Fill 10x10 stippled trapezoid (8x8 stipple)",
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 10, NULL, NULL, FillStippled}},
+  {"-strap100", "Fill 100x100 stippled trapezoid",
+               "Fill 100x100 stippled trapezoid (8x8 stipple)",
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_2FEATURE, ROP, 0,
+               {100, 100, NULL, NULL, FillStippled}},
+  {"-strap300", "Fill 300x300 stippled trapezoid (8x8 stipple)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {2, 300, NULL, NULL, FillStippled}},
+  {"-ostrap1", "Fill 1x1 opaque stippled trapezoid (8x8 stipple)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 1, NULL, NULL, FillOpaqueStippled}},
+  {"-ostrap10", "Fill 10x10 opaque stippled trapezoid",
+               "Fill 10x10 opaque stippled trapezoid (8x8 stipple)",
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 10, NULL, NULL, FillOpaqueStippled}},
+  {"-ostrap100", "Fill 100x100 opaque stippled trapezoid",
+               "Fill 100x100 opaque stippled trapezoid (8x8 stipple)",
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_2FEATURE, ROP, 0,
+               {100, 100, NULL, NULL, FillOpaqueStippled}},
+  {"-ostrap300", "Fill 300x300 opaque stippled trapezoid (8x8 stipple)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {2, 300, NULL, NULL, FillOpaqueStippled}},
+  {"-tiletrap1", "Fill 1x1 tiled trapezoid (4x4 tile)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 1, NULL, NULL, FillTiled}},
+  {"-tiletrap10", "Fill 10x10 tiled trapezoid",
+               "Fill 10x10 tiled trapezoid (4x4 tile)",
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_2FEATURE, ROP, 0,
+               {POLY, 10, NULL, NULL, FillTiled}},
+  {"-tiletrap100", "Fill 100x100 tiled trapezoid",
+               "Fill 100x100 tiled trapezoid (4x4 tile)",
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_2FEATURE, ROP, 0,
+               {100, 100, NULL, NULL, FillTiled}},
+  {"-tiletrap300", "Fill 300x300 tiled trapezoid (4x4 tile)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {2, 300, NULL, NULL, FillTiled}},
+  {"-oddstrap1", "Fill 1x1 stippled trapezoid (17x15 stipple)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 1, "OddTile", NULL, FillStippled}},
+  {"-oddstrap10", "Fill 10x10 stippled trapezoid (17x15 stipple)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 10, "OddTile", NULL, FillStippled}},
+  {"-oddstrap100", "Fill 100x100 stippled trapezoid (17x15 stipple)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {100, 100, "OddTile", NULL, FillStippled}},
+  {"-oddstrap300", "Fill 300x300 stippled trapezoid (17x15 stipple)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {2, 300, "OddTile", NULL, FillStippled}},
+  {"-oddostrap1", "Fill 1x1 opaque stippled trapezoid (17x15 stipple)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 1, "OddTile", NULL, FillOpaqueStippled}},
+  {"-oddostrap10", "Fill 10x10 opaque stippled trapezoid (17x15 stipple)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 10, "OddTile", NULL, FillOpaqueStippled}},
+  {"-oddostrap100", "Fill 100x100 opaque stippled trapezoid (17x15 stipple)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {100, 100, "OddTile", NULL, FillOpaqueStippled}},
+  {"-oddostrap300", "Fill 300x300 opaque stippled trapezoid (17x15 stipple)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {2, 300, "OddTile", NULL, FillOpaqueStippled}},
+  {"-oddtiletrap1", "Fill 1x1 tiled trapezoid (17x15 tile)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 1, "OddTile", NULL, FillTiled}},
+  {"-oddtiletrap10", "Fill 10x10 tiled trapezoid (17x15 tile)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 10, "OddTile", NULL, FillTiled}},
+  {"-oddtiletrap100", "Fill 100x100 tiled trapezoid (17x15 tile)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {100, 100, "OddTile", NULL, FillTiled}},
+  {"-oddtiletrap300", "Fill 300x300 tiled trapezoid (17x15 tile)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {2, 300, "OddTile", NULL, FillTiled}},
+  {"-bigstrap1", "Fill 1x1 stippled trapezoid (161x145 stipple)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 1, "mensetmanus", NULL, FillStippled}},
+  {"-bigstrap10", "Fill 10x10 161x145 stippled trapezoid",
+               "Fill 10x10 stippled trapezoid (161x145 stipple)",
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 10, "mensetmanus", NULL, FillStippled}},
+  {"-bigstrap100", "Fill 100x100 161x145 stippled trapezoid",
+               "Fill 100x100 stippled trapezoid (161x145 stipple)",
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_3FEATURE, ROP, 0,
+               {100, 100, "mensetmanus", NULL, FillStippled}},
+  {"-bigstrap300", "Fill 300x300 stippled trapezoid (161x145 stipple)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {2, 300, "mensetmanus", NULL, FillStippled}},
+  {"-bigostrap1", "Fill 1x1 opaque stippled trapezoid (161x145 stipple)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 1, "mensetmanus", NULL, FillOpaqueStippled}},
+  {"-bigostrap10", "Fill 10x10 161x145 opaque stippled trapezoid",
+               "Fill 10x10 opaque stippled trapezoid (161x145 stipple)",
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 10, "mensetmanus", NULL, FillOpaqueStippled}},
+  {"-bigostrap100", "Fill 100x100 161x145 opaque stippled trapezoid",
+               "Fill 100x100 opaque stippled trapezoid (161x145 stipple)",
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_3FEATURE, ROP, 0,
+               {100, 100, "mensetmanus", NULL, FillOpaqueStippled}},
+  {"-bigostrap300", "Fill 300x300 opaque stippled trapezoid (161x145 stipple)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {2, 300, "mensetmanus", NULL, FillOpaqueStippled}},
+  {"-bigtiletrap1", "Fill 1x1 tiled trapezoid (161x145 tile)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 1, "mensetmanus", NULL, FillTiled}},
+  {"-bigtiletrap10", "Fill 10x10 161x145 tiled trapezoid",
+               "Fill 10x10 tiled trapezoid (161x145 tile)",
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 10, "mensetmanus", NULL, FillTiled}},
+  {"-bigtiletrap100", "Fill 100x100 161x145 tiled trapezoid",
+               "Fill 100x100 tiled trapezoid (161x145 tile)",
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_3FEATURE, ROP, 0,
+               {100, 100, "mensetmanus", NULL, FillTiled}},
+  {"-bigtiletrap300", "Fill 300x300 tiled trapezoid (161x145 tile)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {2, 300, "mensetmanus", NULL, FillTiled}},
+  {"-eschertiletrap1", "Fill 1x1 tiled trapezoid (216x208 tile)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 1, "escherknot", NULL, FillTiled}},
+  {"-eschertiletrap10", "Fill 10x10 216x208 tiled trapezoid",
+               "Fill 10x10 tiled trapezoid (216x208 tile)",
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 10, "escherknot", NULL, FillTiled}},
+  {"-eschertiletrap100", "Fill 100x100 216x208 tiled trapezoid",
+               "Fill 100x100 tiled trapezoid (216x208 tile)",
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_3FEATURE, ROP, 0,
+               {36, 100, "escherknot", NULL, FillTiled}},
+  {"-eschertiletrap300", "Fill 300x300 tiled trapezoid (216x208 tile)", NULL,
+               InitTrapezoids, DoTrapezoids, NullProc, EndTrapezoids,
+               V1_4FEATURE, ROP, 0,
+               {2, 300, "escherknot", NULL, FillTiled}},
+#ifdef XRENDER
+  {"-aatrap1", "Fill 1x1 aa trap", NULL,
+               InitFixedTraps, DoFixedTraps, NullProc, EndFixedTraps,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 1 }},
+  {"-aatrap10", "Fill 10x10 aa trap", NULL,
+               InitFixedTraps, DoFixedTraps, NullProc, EndFixedTraps,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 10 }},
+  {"-aatrap100", "Fill 100x100 aa trap", NULL,
+               InitFixedTraps, DoFixedTraps, NullProc, EndFixedTraps,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 100 }},
+  {"-aatrap300", "Fill 300x300 aa trap", NULL,
+               InitFixedTraps, DoFixedTraps, NullProc, EndFixedTraps,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 300 }},
+  {"-aa4trap1", "Fill 1x1 aa trap with 4 bit alpha", NULL,
+               InitFixedTraps, DoFixedTraps, NullProc, EndFixedTraps,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 1, "4" }},
+  {"-aa4trap10", "Fill 10x10 aa trap with 4 bit alpha", NULL,
+               InitFixedTraps, DoFixedTraps, NullProc, EndFixedTraps,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 10, "4" }},
+  {"-aa4trap100", "Fill 100x100 aa trap with 4 bit alpha", NULL,
+               InitFixedTraps, DoFixedTraps, NullProc, EndFixedTraps,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 100, "4" }},
+  {"-aa4trap300", "Fill 300x300 aa trap with 4 bit alpha", NULL,
+               InitFixedTraps, DoFixedTraps, NullProc, EndFixedTraps,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 300, "4" }},
+  {"-aa1trap1", "Fill 1x1 aa trap with 1 bit alpha", NULL,
+               InitFixedTraps, DoFixedTraps, NullProc, EndFixedTraps,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 1, "1" }},
+  {"-aa1trap10", "Fill 10x10 aa trap with 1 bit alpha", NULL,
+               InitFixedTraps, DoFixedTraps, NullProc, EndFixedTraps,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 10, "1" }},
+  {"-aa1trap100", "Fill 100x100 aa trap with 1 bit alpha", NULL,
+               InitFixedTraps, DoFixedTraps, NullProc, EndFixedTraps,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 100, "1" }},
+  {"-aa1trap300", "Fill 300x300 aa trap with 1 bit alpha", NULL,
+               InitFixedTraps, DoFixedTraps, NullProc, EndFixedTraps,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 300, "1" }},
+
+  {"-aatrap2x1", "Fill 2x1 aa trap", NULL,
+               InitFixedTraps, DoFixedTraps, NullProc, EndFixedTraps,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 1, "8,2" }},
+  {"-aatrap2x10", "Fill 2x10 aa trap", NULL,
+               InitFixedTraps, DoFixedTraps, NullProc, EndFixedTraps,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 10, "8,2" }},
+  {"-aatrap2x100", "Fill 2x100 aa trap", NULL,
+               InitFixedTraps, DoFixedTraps, NullProc, EndFixedTraps,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 100, "8,2" }},
+  {"-aatrap2x300", "Fill 2x300 aa trap", NULL,
+               InitFixedTraps, DoFixedTraps, NullProc, EndFixedTraps,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 300, "8,2" }},
+
+  {"-aatrapezoid1", "Fill 1x1 aa trapezoid", NULL,
+               InitFixedTrapezoids, DoFixedTrapezoids, NullProc, EndFixedTrapezoids,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 1 }},
+  {"-aatrapezoid10", "Fill 10x10 aa trapezoid", NULL,
+               InitFixedTrapezoids, DoFixedTrapezoids, NullProc, EndFixedTrapezoids,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 10 }},
+  {"-aatrapezoid100", "Fill 100x100 aa trapezoid", NULL,
+               InitFixedTrapezoids, DoFixedTrapezoids, NullProc, EndFixedTrapezoids,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 100 }},
+  {"-aatrapezoid300", "Fill 300x300 aa trapezoid", NULL,
+               InitFixedTrapezoids, DoFixedTrapezoids, NullProc, EndFixedTrapezoids,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 300 }},
+  {"-addaatrapezoid1", "Fill 1x1 aa pre-added trapezoid", NULL,
+               InitFixedTrapezoids, DoFixedTrapezoids, NullProc, EndFixedTrapezoids,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 1, "add" }},
+  {"-addaatrapezoid10", "Fill 10x10 aa pre-added trapezoid", NULL,
+               InitFixedTrapezoids, DoFixedTrapezoids, NullProc, EndFixedTrapezoids,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 10, "add" }},
+  {"-addaatrapezoid100", "Fill 100x100 aa pre-added trapezoid", NULL,
+               InitFixedTrapezoids, DoFixedTrapezoids, NullProc, EndFixedTrapezoids,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 100, "add" }},
+  {"-addaatrapezoid300", "Fill 300x300 aa pre-added trapezoid", NULL,
+               InitFixedTrapezoids, DoFixedTrapezoids, NullProc, EndFixedTrapezoids,
+               V1_5FEATURE, NONROP, 0,
+               {POLY, 300, "add" }},
+#endif
+  {"-complex10", "Fill 10-pixel/side complex polygon", NULL,
+               InitComplexPoly, DoComplexPoly, NullProc, EndComplexPoly,
+               V1_2ONLY, ROP, 0,
+               {POLY, 10}},
+  {"-complex100", "Fill 100-pixel/side complex polygons", NULL,
+               InitComplexPoly, DoComplexPoly, NullProc, EndComplexPoly,
+               V1_2ONLY, ROP, 0,
+               {POLY/10, 100}},
+  {"-complex10", "Fill 10x10 equivalent complex polygon", NULL,
+               InitComplexPoly, DoComplexPoly, NullProc, EndComplexPoly,
+               V1_3FEATURE, ROP, 0,
+               {POLY, 10}},
+  {"-complex100", "Fill 100x100 equivalent complex polygons", NULL,
+               InitComplexPoly, DoComplexPoly, NullProc, EndComplexPoly,
+               V1_3FEATURE, ROP, 0,
+               {POLY/10, 100}},
+  {"-64poly10convex", "Fill 10x10 64-gon (Convex)", NULL,
+               InitGeneralPoly, DoGeneralPoly, NullProc, EndComplexPoly,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 10, (char *) 64, (char *) Convex}},
+  {"-64poly100convex", "Fill 100x100 64-gon (Convex)", NULL,
+               InitGeneralPoly, DoGeneralPoly, NullProc, EndComplexPoly,
+               V1_4FEATURE, ROP, 0,
+               {POLY/10, 100, (char *) 64, (char *) Convex}},
+  {"-64poly10complex", "Fill 10x10 64-gon (Complex)", NULL,
+               InitGeneralPoly, DoGeneralPoly, NullProc, EndComplexPoly,
+               V1_4FEATURE, ROP, 0,
+               {POLY, 10, (char *) 64, (char *) Complex}},
+  {"-64poly100complex", "Fill 100x100 64-gon (Complex)", NULL,
+               InitGeneralPoly, DoGeneralPoly, NullProc, EndComplexPoly,
+               V1_4FEATURE, ROP, 0,
+               {POLY/10, 100, (char *) 64, (char *) Complex}},
+  {"-ftext",    "Char in 80-char line (6x13)", NULL,
+               InitText, DoText, ClearTextWin, EndText,
+               V1_2FEATURE, ROP, 0,
+               {80, False, "6x13", NULL}},
+  {"-f8text",    "Char in 70-char line (8x13)", NULL,
+               InitText, DoText, ClearTextWin, EndText,
+               V1_3FEATURE, ROP, 0,
+               {70, False, "8x13", NULL}},
+  {"-f9text",    "Char in 60-char line (9x15)", NULL,
+               InitText, DoText, ClearTextWin, EndText,
+               V1_3FEATURE, ROP, 0,
+               {60, False, "9x15", NULL}},
+  {"-f14text16",  "Char16 in 40-char line (k14)", NULL,
+               InitText16, DoText16, ClearTextWin, EndText16,
+               V1_3FEATURE, ROP, 0,
+               {40, False,
+             "-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-*",
+               NULL}},
+  {"-f24text16",  "Char16 in 23-char line (k24)", NULL,
+               InitText16, DoText16, ClearTextWin, EndText16,
+               V1_3FEATURE, ROP, 0,
+               {23, False, 
+             "-jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-*",
+               NULL}},
+  {"-tr10text", "Char in 80-char line (TR 10)", NULL,
+               InitText, DoText, ClearTextWin, EndText,
+               V1_2FEATURE, ROP, 0,
+               {80, False, 
+               "-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1", 
+               NULL}},
+  {"-tr24text", "Char in 30-char line (TR 24)", NULL,
+               InitText, DoText, ClearTextWin, EndText,
+               V1_2FEATURE, ROP, 0,
+               {30, False, 
+               "-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1",
+               NULL}},
+  {"-polytext", "Char in 20/40/20 line (6x13, TR 10)", NULL,
+               InitText, DoPolyText, ClearTextWin, EndText,
+               V1_2FEATURE, ROP, 0,
+               {80, True, "6x13", 
+               "-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1"}},
+  {"-polytext16", "Char16 in 7/14/7 line (k14, k24)", NULL,
+               InitText16, DoPolyText16, ClearTextWin, EndText16,
+               V1_3FEATURE, ROP, 0,
+               {28, True, 
+            "-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-*",
+             "-jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-*"}},
+  {"-fitext",   "Char in 80-char image line (6x13)", NULL,
+               InitText, DoImageText, ClearTextWin, EndText,
+               V1_2FEATURE, PLANEMASK, 0,
+               {80, False, "6x13", NULL}},
+  {"-f8itext",   "Char in 70-char image line (8x13)", NULL,
+               InitText, DoImageText, ClearTextWin, EndText,
+               V1_3FEATURE, PLANEMASK, 0,
+               {70, False, "8x13", NULL}},
+  {"-f9itext",   "Char in 60-char image line (9x15)", NULL,
+               InitText, DoImageText, ClearTextWin, EndText,
+               V1_3FEATURE, PLANEMASK, 0,
+               {60, False, "9x15", NULL}},
+  {"-f14itext16", "Char16 in 40-char image line (k14)", NULL,
+               InitText16, DoImageText16, ClearTextWin, EndText16,
+               V1_3FEATURE, PLANEMASK, 0,
+               {40, False,
+             "-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-*",
+               NULL}},
+  {"-f24itext16", "Char16 in 23-char image line (k24)", NULL,
+               InitText16, DoImageText16, ClearTextWin, EndText16,
+               V1_3FEATURE, PLANEMASK, 0,
+               {23, False, 
+             "-jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-*",
+               NULL}},
+  {"-tr10itext", "Char in 80-char image line (TR 10)", NULL,
+               InitText, DoImageText, ClearTextWin, EndText,
+               V1_2FEATURE, PLANEMASK, 0,
+               {80, False, 
+               "-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1", 
+               NULL}},
+  {"-tr24itext", "Char in 30-char image line (TR 24)", NULL,
+               InitText, DoImageText, ClearTextWin, EndText,
+               V1_2FEATURE, PLANEMASK, 0,
+               {30, False, 
+               "-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1",
+               NULL}},
+#ifdef XFT
+  {"-aa10text", "Char in 80-char aa line (Charter 10)", NULL,
+               InitAAText, DoAAText, ClearTextWin, EndAAText,
+               V1_5FEATURE, NONROP, 0,
+               {80, 10, "charter:antialias=true:rgba=0:pixelsize=10", NULL}},
+  {"-aa24text", "Char in 30-char aa line (Charter 24)", NULL,
+               InitAAText, DoAAText, ClearTextWin, EndAAText,
+               V1_5FEATURE, NONROP, 0,
+               {30, 24, "charter:antialias=true:rgba=0:pixelsize=24", NULL}},
+  {"-aaftext", "Char in 80-char aa line (Courier 12)", NULL,
+               InitAAText, DoAAText, ClearTextWin, EndAAText,
+               V1_5FEATURE, NONROP, 0,
+               {80, 12, "courier:antialias=true:rgba=0:pixelsize=12", NULL}},
+  {"-a10text", "Char in 80-char a line (Charter 10)", NULL,
+               InitAAText, DoAAText, ClearTextWin, EndAAText,
+               V1_5FEATURE, NONROP, 0,
+               {80, 10, "charter:antialias=false:rgba=0:pixelsize=10", NULL}},
+  {"-a24text", "Char in 30-char a line (Charter 24)", NULL,
+               InitAAText, DoAAText, ClearTextWin, EndAAText,
+               V1_5FEATURE, NONROP, 0,
+               {30, 24, "charter:antialias=false:rgba=0:pixelsize=24", NULL}},
+  {"-aftext", "Char in 80-char a line (Courier 12)", NULL,
+               InitAAText, DoAAText, ClearTextWin, EndAAText,
+               V1_5FEATURE, NONROP, 0,
+               {80, 12, "courier:antialias=false:rgba=0:pixelsize=12", NULL}},
+  {"-rgb10text", "Char in 80-char rgb line (Charter 10)", NULL,
+               InitAAText, DoAAText, ClearTextWin, EndAAText,
+               V1_5FEATURE, NONROP, 0,
+               {80, 10, "charter:antialias=true:rgba=rgb:pixelsize=10", NULL}},
+  {"-rgb24text", "Char in 30-char rgb line (Charter 24)", NULL,
+               InitAAText, DoAAText, ClearTextWin, EndAAText,
+               V1_5FEATURE, NONROP, 0,
+               {30, 24, "charter:antialias=true:rgba=rgb:pixelsize=24", NULL}},
+  {"-rgbftext", "Char in 80-char rgb line (Courier 12)", NULL,
+               InitAAText, DoAAText, ClearTextWin, EndAAText,
+               V1_5FEATURE, NONROP, 0,
+               {80, 12, "courier:antialias=true:rgba=rgb:pixelsize=12", NULL}},
+  {"-caa10text", "Char in 80-char aa core line (Charter 10)", NULL,
+               InitAAText, DoAAText, ClearTextWin, EndAAText,
+               V1_5FEATURE, NONROP, 0,
+               {80, 10, "charter:antialias=true:render=false:rgba=0:pixelsize=10", NULL}},
+  {"-caa24text", "Char in 30-char aa core line (Charter 24)", NULL,
+               InitAAText, DoAAText, ClearTextWin, EndAAText,
+               V1_5FEATURE, NONROP, 0,
+               {30, 24, "charter:antialias=true:render=false:rgba=0:pixelsize=24", NULL}},
+  {"-caaftext", "Char in 80-char aa core line (Courier 12)", NULL,
+               InitAAText, DoAAText, ClearTextWin, EndAAText,
+               V1_5FEATURE, NONROP, 0,
+               {80, 12, "courier:antialias=true:render=false:rgba=0:pixelsize=12", NULL}},
+  {"-ca10text", "Char in 80-char a core line (Charter 10)", NULL,
+               InitAAText, DoAAText, ClearTextWin, EndAAText,
+               V1_5FEATURE, NONROP, 0,
+               {80, 10, "charter:antialias=false:render=false:rgba=0:pixelsize=10", NULL}},
+  {"-ca24text", "Char in 30-char a core line (Charter 24)", NULL,
+               InitAAText, DoAAText, ClearTextWin, EndAAText,
+               V1_5FEATURE, NONROP, 0,
+               {30, 24, "charter:antialias=false:render=false:rgba=0:pixelsize=24", NULL}},
+  {"-caftext", "Char in 80-char a core line (Courier 12)", NULL,
+               InitAAText, DoAAText, ClearTextWin, EndAAText,
+               V1_5FEATURE, NONROP, 0,
+               {80, 12, "courier:antialias=false:render=false:rgba=0:pixelsize=12", NULL}},
+  {"-rgb10text", "Char in 80-char rgb core line (Charter 10)", NULL,
+               InitAAText, DoAAText, ClearTextWin, EndAAText,
+               V1_5FEATURE, NONROP, 0,
+               {80, 10, "charter:antialias=true:render=false:rgba=rgb:pixelsize=10", NULL}},
+  {"-rgb24text", "Char in 30-char rgb core line (Charter 24)", NULL,
+               InitAAText, DoAAText, ClearTextWin, EndAAText,
+               V1_5FEATURE, NONROP, 0,
+               {30, 24, "charter:antialias=true:render=false:rgba=rgb:pixelsize=24", NULL}},
+  {"-rgbftext", "Char in 80-char rgb core line (Courier 12)", NULL,
+               InitAAText, DoAAText, ClearTextWin, EndAAText,
+               V1_5FEATURE, NONROP, 0,
+               {80, 12, "courier:antialias=true:render=false:rgba=rgb:pixelsize=12", NULL}},
+#endif
+  {"-scroll10", "Scroll 10x10 pixels", NULL,
+               InitScroll, DoScroll, MidScroll, EndScroll,
+               V1_2FEATURE, ROP, 0,
+               {1, 10}},
+  {"-scroll100", "Scroll 100x100 pixels", NULL,
+               InitScroll, DoScroll, MidScroll, EndScroll,
+               V1_2FEATURE, ROP, 0,
+               {1, 100}},
+  {"-scroll500", "Scroll 500x500 pixels", NULL,
+               InitScroll, DoScroll, MidScroll, EndScroll,
+               V1_2FEATURE, ROP, 0,
+               {1, 500}},
+  {"-copywinwin10", "Copy 10x10 from window to window", NULL,
+               InitCopyWin, DoCopyWinWin, MidScroll, EndCopyWin,
+               V1_2FEATURE, ROP, 0,
+               {4, 10}},
+  {"-copywinwin100", "Copy 100x100 from window to window", NULL,
+               InitCopyWin, DoCopyWinWin, MidScroll, EndCopyWin,
+               V1_2FEATURE, ROP, 0,
+               {4, 100}},
+  {"-copywinwin500", "Copy 500x500 from window to window", NULL,
+               InitCopyWin, DoCopyWinWin, MidScroll, EndCopyWin,
+               V1_2FEATURE, ROP, 0,
+               {4, 500}},
+  {"-copypixwin10", "Copy 10x10 from pixmap to window", NULL,
+               InitCopyPix, DoCopyPixWin, MidCopyPix, EndCopyPix,
+               V1_2FEATURE, ROP, 0,
+               {4, 10}},
+  {"-copypixwin100", "Copy 100x100 from pixmap to window", NULL,
+               InitCopyPix, DoCopyPixWin, MidCopyPix, EndCopyPix, 
+               V1_2FEATURE, ROP, 0,
+               {4, 100}},
+  {"-copypixwin500", "Copy 500x500 from pixmap to window", NULL,
+               InitCopyPix, DoCopyPixWin, MidCopyPix, EndCopyPix,
+               V1_2FEATURE, ROP, 0,
+               {4, 500}},
+  {"-copywinpix10", "Copy 10x10 from window to pixmap", NULL,
+               InitCopyPix, DoCopyWinPix, MidScroll, EndCopyPix,
+               V1_2FEATURE, ROP, 0,
+               {4, 10}},
+  {"-copywinpix100", "Copy 100x100 from window to pixmap", NULL,
+               InitCopyPix, DoCopyWinPix, MidScroll, EndCopyPix, 
+               V1_2FEATURE, ROP, 0,
+               {4, 100}},
+  {"-copywinpix500", "Copy 500x500 from window to pixmap", NULL,
+               InitCopyPix, DoCopyWinPix, MidScroll, EndCopyPix,
+               V1_2FEATURE, ROP, 0,
+               {4, 500}},
+  {"-copypixpix10", "Copy 10x10 from pixmap to pixmap", NULL,
+               InitCopyPix, DoCopyPixPix, NullProc, EndCopyPix,
+               V1_2FEATURE, ROP, 0,
+               {4, 10}},
+  {"-copypixpix100", "Copy 100x100 from pixmap to pixmap", NULL,
+               InitCopyPix, DoCopyPixPix, NullProc, EndCopyPix, 
+               V1_2FEATURE, ROP, 0,
+               {4, 100}},
+  {"-copypixpix500", "Copy 500x500 from pixmap to pixmap", NULL,
+               InitCopyPix, DoCopyPixPix, NullProc, EndCopyPix,
+               V1_2FEATURE, ROP, 0,
+               {4, 500}},
+  {"-copyplane10", "Copy 10x10 1-bit deep plane", NULL,
+               InitCopyPlane, DoCopyPlane, MidCopyPix, EndCopyPix,
+               V1_2FEATURE, ROP, 0,
+               {4, 10}},
+  {"-copyplane100", "Copy 100x100 1-bit deep plane", NULL,
+               InitCopyPlane, DoCopyPlane, MidCopyPix, EndCopyPix,
+               V1_2FEATURE, ROP, 0,
+               {4, 100}},
+  {"-copyplane500", "Copy 500x500 1-bit deep plane", NULL,
+               InitCopyPlane, DoCopyPlane, MidCopyPix, EndCopyPix,
+               V1_2FEATURE, ROP, 0,
+               {4, 500}},
+  {"-deepcopyplane10", "Copy 10x10 n-bit deep plane", NULL,
+               InitCopyPlane, DoCopyPlane, MidCopyPix, EndCopyPix,
+               V1_5FEATURE, ROP, 0,
+               {4, 10, "Deep"}},
+  {"-deepcopyplane100", "Copy 100x100 n-bit deep plane", NULL,
+               InitCopyPlane, DoCopyPlane, MidCopyPix, EndCopyPix,
+               V1_5FEATURE, ROP, 0,
+               {4, 100, "Deep"}},
+  {"-deepcopyplane500", "Copy 500x500 n-bit deep plane", NULL,
+               InitCopyPlane, DoCopyPlane, MidCopyPix, EndCopyPix,
+               V1_5FEATURE, ROP, 0,
+               {4, 500, "Deep"}},
+  {"-putimage10", "PutImage 10x10 square", NULL,
+               InitPutImage, DoPutImage, MidCopyPix, EndGetImage,
+               V1_2FEATURE, ROP, 0,
+               {4, 10}},
+  {"-putimage100", "PutImage 100x100 square", NULL,
+               InitPutImage, DoPutImage, MidCopyPix, EndGetImage,
+               V1_2FEATURE, ROP, 0,
+               {4, 100}},
+  {"-putimage500", "PutImage 500x500 square", NULL,
+               InitPutImage, DoPutImage, MidCopyPix, EndGetImage,
+               V1_2FEATURE, ROP, 0,
+               {4, 500}},
+  {"-putimagexy10", "PutImage XY 10x10 square", NULL,
+               InitPutImage, DoPutImage, MidCopyPix, EndGetImage,
+               V1_4FEATURE, ROP, 0,
+               {4, 10, "XY"}},
+  {"-putimagexy100", "PutImage XY 100x100 square", NULL,
+               InitPutImage, DoPutImage, MidCopyPix, EndGetImage,
+               V1_4FEATURE, ROP, 0,
+               {4, 100, "XY"}},
+  {"-putimagexy500", "PutImage XY 500x500 square", NULL,
+               InitPutImage, DoPutImage, MidCopyPix, EndGetImage,
+               V1_4FEATURE, ROP, 0,
+               {4, 500, "XY"}},
+#ifdef MITSHM
+  {"-shmput10", "ShmPutImage 10x10 square", NULL,
+               InitShmPutImage, DoShmPutImage, MidCopyPix, EndShmPutImage,
+               V1_2FEATURE, ROP, 0,
+               {4, 10}},
+  {"-shmput100", "ShmPutImage 100x100 square", NULL,
+               InitShmPutImage, DoShmPutImage, MidCopyPix, EndShmPutImage,
+               V1_2FEATURE, ROP, 0,
+               {4, 100}},
+  {"-shmput500", "ShmPutImage 500x500 square", NULL,
+               InitShmPutImage, DoShmPutImage, MidCopyPix, EndShmPutImage,
+               V1_2FEATURE, ROP, 0,
+               {4, 500}},
+  {"-shmputxy10", "ShmPutImage XY 10x10 square", NULL,
+               InitShmPutImage, DoShmPutImage, MidCopyPix, EndShmPutImage,
+               V1_4FEATURE, ROP, 0,
+               {4, 10, "XY"}},
+  {"-shmputxy100", "ShmPutImage XY 100x100 square", NULL,
+               InitShmPutImage, DoShmPutImage, MidCopyPix, EndShmPutImage,
+               V1_4FEATURE, ROP, 0,
+               {4, 100, "XY"}},
+  {"-shmputxy500", "ShmPutImage XY 500x500 square", NULL,
+               InitShmPutImage, DoShmPutImage, MidCopyPix, EndShmPutImage,
+               V1_4FEATURE, ROP, 0,
+               {4, 500, "XY"}},
+#endif
+  {"-getimage10", "GetImage 10x10 square", NULL,
+               InitGetImage, DoGetImage, NullProc, EndGetImage,
+               V1_2FEATURE, PLANEMASK, 0,
+               {4, 10}},
+  {"-getimage100", "GetImage 100x100 square", NULL,
+               InitGetImage, DoGetImage, NullProc, EndGetImage,
+               V1_2FEATURE, PLANEMASK, 0,
+               {4, 100}},
+  {"-getimage500", "GetImage 500x500 square", NULL,
+               InitGetImage, DoGetImage, NullProc, EndGetImage,
+               V1_2FEATURE, PLANEMASK, 0,
+               {4, 500}},
+  {"-getimagexy10", "GetImage XY 10x10 square", NULL,
+               InitGetImage, DoGetImage, NullProc, EndGetImage,
+               V1_4FEATURE, PLANEMASK, 0,
+               {4, 10, "XY"}},
+  {"-getimagexy100", "GetImage XY 100x100 square", NULL,
+               InitGetImage, DoGetImage, NullProc, EndGetImage,
+               V1_4FEATURE, PLANEMASK, 0,
+               {4, 100, "XY"}},
+  {"-getimagexy500", "GetImage XY 500x500 square", NULL,
+               InitGetImage, DoGetImage, NullProc, EndGetImage,
+               V1_4FEATURE, PLANEMASK, 0,
+               {4, 500, "XY"}},
+  {"-compwinwin10", "Composite 10x10 from window to window", NULL,
+               InitCompositeWin, DoCompositeWinWin, MidScroll, EndCompositeWin,
+               VERSION1_6, COMP, 0,
+               {4, 10}},
+  {"-compwinwin100", "Composite 100x100 from window to window", NULL,
+               InitCompositeWin, DoCompositeWinWin, MidScroll, EndCompositeWin,
+               VERSION1_6, COMP, 0,
+               {4, 100}},
+  {"-compwinwin500", "Composite 500x500 from window to window", NULL,
+               InitCompositeWin, DoCompositeWinWin, MidScroll, EndCompositeWin,
+               VERSION1_6, COMP, 0,
+               {4, 500}},
+  {"-comppixwin10", "Composite 10x10 from pixmap to window", NULL,
+               InitCompositePix, DoCompositePixWin, MidScroll, EndCompositeWin,
+               VERSION1_6, COMP, 0,
+               {4, 10}},
+  {"-comppixwin100", "Composite 100x100 from pixmap to window", NULL,
+               InitCompositePix, DoCompositePixWin, MidScroll, EndCompositeWin,
+               VERSION1_6, COMP, 0,
+               {4, 100}},
+  {"-comppixwin500", "Composite 500x500 from pixmap to window", NULL,
+               InitCompositePix, DoCompositePixWin, MidScroll, EndCompositeWin,
+               VERSION1_6, COMP, 0,
+               {4, 500}},
+  {"-noop",     "X protocol NoOperation", NULL,
+               NullInitProc, DoNoOp, NullProc, NullProc,
+               V1_2FEATURE, PLANEMASK, 0,
+               {1}},
+  {"-atom",     "GetAtomName", NULL,
+               NullInitProc, DoGetAtom, NullProc, NullProc,
+               VERSION1_2 | VERSION1_3, NONROP, 0,
+               {1}},
+  {"-pointer",  "QueryPointer", NULL,
+               NullInitProc, DoQueryPointer, NullProc, NullProc,
+               V1_4FEATURE, NONROP, 0,
+               {1}},
+  {"-prop",     "GetProperty", NULL,
+               InitGetProperty, DoGetProperty, NullProc, NullProc,
+               V1_2FEATURE, NONROP, 0,
+               {1}},
+  {"-gc",       "Change graphics context", NULL,
+               InitGC, DoChangeGC, NullProc, EndGC,
+               V1_2FEATURE, NONROP, 0,
+               {4}},
+  {"-create",   "Create and map subwindows", NULL,
+               InitCreate, CreateChildren, DestroyChildren, EndCreate,
+               V1_2FEATURE, WINDOW, 0,
+               {0, True}},
+  {"-ucreate",  "Create unmapped window", NULL,
+               InitCreate, CreateChildren, DestroyChildren, EndCreate,
+               V1_2FEATURE, WINDOW, 0,
+               {0, False}},
+  {"-map",      "Map window via parent", NULL,
+               InitMap, MapParents, UnmapParentsCleanup, EndCreate,
+               V1_2FEATURE, WINDOW, 0,
+               {0, True}},
+  {"-unmap",    "Unmap window via parent", NULL,
+               InitDestroy, UnmapParents, MapParentsCleanup, EndCreate,
+               V1_2FEATURE, WINDOW, 0,
+               {0, True}},
+  {"-destroy",  "Destroy window via parent", NULL,
+               InitDestroy, DestroyParents, RenewParents, EndCreate,
+               V1_2FEATURE, WINDOW, 0,
+               {0, True}},
+  {"-popup",    "Hide/expose window via popup", NULL,
+               InitPopups, DoPopUps, NullProc, EndPopups,
+               V1_2FEATURE, WINDOW, 0,
+               {0, True}},
+  {"-move",     "Move window", NULL,
+               InitMoveWindows, DoMoveWindows, NullProc, EndMoveWindows,
+               V1_2FEATURE, WINDOW, 0,
+               {0, True}},
+  {"-umove",    "Moved unmapped window", NULL,
+               InitMoveWindows, DoMoveWindows, NullProc, EndMoveWindows,
+               V1_2FEATURE, WINDOW, 0,
+               {0, False}},
+  {"-movetree", "Move window via parent", NULL,
+               InitMoveTree, DoMoveTree, NullProc, EndMoveTree,
+               V1_2FEATURE, WINDOW, 0,
+               {4, True}},
+  {"-resize",   "Resize window", NULL,
+               InitMoveWindows, DoResizeWindows, NullProc, EndMoveWindows,
+               V1_2FEATURE, WINDOW, 0,
+               {4, True}},
+  {"-uresize",  "Resize unmapped window", NULL,
+               InitMoveWindows, DoResizeWindows, NullProc, EndMoveWindows,
+               V1_2FEATURE, WINDOW, 0,
+               {4, False}},
+  {"-circulate", "Circulate window", NULL,
+               InitCircWindows, DoCircWindows, NullProc, EndCircWindows,
+               V1_2FEATURE, WINDOW, 0,
+               {4, True}},
+  {"-ucirculate", "Circulate Unmapped window", NULL,
+               InitCircWindows, DoCircWindows, NullProc, EndCircWindows,
+               V1_2FEATURE, WINDOW, 0,
+               {4, False}},
+  { NULL, NULL, NULL,
+               NULL, NULL, NULL, NULL,
+               0, NONROP, 0,
+               {0, False}}
+};
diff --git a/x11perf/do_text.c b/x11perf/do_text.c
new file mode 100755 (executable)
index 0000000..6b41201
--- /dev/null
@@ -0,0 +1,512 @@
+/*****************************************************************************
+Copyright 1988, 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.
+
+******************************************************************************/
+
+#include "x11perf.h"
+#include <stdio.h>
+
+static char **charBuf;
+static XFontStruct *font, *bfont;
+static int height, ypos;
+static XTextItem *items;
+static int charsPerLine, totalLines;
+
+#define XPOS 20
+#define SEGS 3
+
+
+int 
+InitText(XParms xp, Parms p, int reps)
+{
+    int                i, j;
+    char       ch;
+    XGCValues   gcv;
+
+    font = XLoadQueryFont(xp->d, p->font);
+    if (font == NULL) {
+       printf("Could not load font '%s', benchmark omitted\n", p->font);
+       return 0;
+    }
+
+    bfont = NULL;
+    if (p->bfont != NULL) {
+       bfont = XLoadQueryFont(xp->d, p->bfont);
+       if (bfont == NULL) {
+           printf("Could not load font '%s', benchmark omitted\n", p->bfont);
+           return 0;
+       }
+    }
+
+    ypos = XPOS;
+    height = (font->max_bounds.ascent + font->max_bounds.descent) + 1;
+    if (bfont != NULL) {
+       int     h = (bfont->max_bounds.ascent + bfont->max_bounds.descent) + 1;
+       if (h > height)
+           height = h;
+    }
+    gcv.font = font->fid;
+    XChangeGC(xp->d, xp->fggc, GCFont, &gcv);
+    XChangeGC(xp->d, xp->bggc, GCFont, &gcv);
+
+    charsPerLine = p->objects;
+    charsPerLine = (charsPerLine + 3) & ~3;
+    p->objects = charsPerLine;
+
+    totalLines = '\177' - ' ' + 1;
+    if (totalLines > reps) totalLines = reps;
+
+    charBuf = (char **) malloc(totalLines*sizeof (char *));
+    if (p->special)
+       items = (XTextItem *) malloc(totalLines*SEGS*sizeof (XTextItem));
+
+    for (i = 0; i != totalLines; i++) {
+       charBuf[i] = (char *) malloc (sizeof (char)*charsPerLine);
+       ch = i + ' ';
+       for (j = 0; j != charsPerLine; j++) {
+           charBuf[i][j] = ch;
+           if (ch == '\177') ch = ' '; else ch++;
+       }
+       if (p->special) {
+           items[i*SEGS+0].chars = &(charBuf[i][0]);
+           items[i*SEGS+0].nchars = charsPerLine/4;
+           items[i*SEGS+0].delta = 0;
+           items[i*SEGS+0].font = font->fid;
+           items[i*SEGS+1].chars = &(charBuf[i][charsPerLine/4]);
+           items[i*SEGS+1].nchars = charsPerLine/2;
+           items[i*SEGS+1].delta = 3;
+           items[i*SEGS+1].font = bfont->fid;
+           items[i*SEGS+2].chars = &(charBuf[i][3*charsPerLine/4]);
+           items[i*SEGS+2].nchars = charsPerLine/4;
+           items[i*SEGS+2].delta = 3;
+           items[i*SEGS+2].font = font->fid;
+       }
+    }
+    return reps;
+}
+
+
+#define GetRealChar(font, totalChars, ch)                              \
+{                                                                      \
+    XCharStruct *pci;                                                  \
+    do {                                                               \
+       ch--;                                                           \
+       if (ch < 0) {                                                   \
+           ch = totalChars-1;                                          \
+       }                                                               \
+       if (font->per_char == NULL) break;                              \
+       pci = &(font->per_char[ch]);                                    \
+    } while ( (pci->lbearing | pci->rbearing | pci->width              \
+             | pci->ascent | pci->descent | pci->attributes) == 0);     \
+} /* GetRealChar */
+
+int 
+InitText16(XParms xp, Parms p, int reps)
+{
+    register int       i, j;
+    register char      *pbuf0, *pbuf1, *pbuf2;
+    XGCValues          gcv;
+    int                        rows, columns, totalChars, ch;
+    int                        brows, bcolumns = 0, btotalChars = 0, bch = 0;
+
+    font = XLoadQueryFont(xp->d, p->font);
+    if (font == NULL) {
+       printf("Could not load font '%s', benchmark omitted\n", p->font);
+       return 0;
+    }
+    rows = font->max_byte1 - font->min_byte1 + 1;
+    columns = font->max_char_or_byte2 - font->min_char_or_byte2 + 1;
+    totalChars = rows * columns;
+    totalLines = rows;
+    ch = totalChars;
+
+    bfont = NULL;
+    if (p->bfont != NULL) {
+       bfont = XLoadQueryFont(xp->d, p->bfont);
+       if (bfont == NULL) {
+           printf("Could not load font '%s', benchmark omitted\n", p->bfont);
+           return 0;
+       }
+       brows = bfont->max_byte1 - bfont->min_byte1 + 1;
+       bcolumns = bfont->max_char_or_byte2 - bfont->min_char_or_byte2 + 1;
+       btotalChars = brows * bcolumns;
+       bch = btotalChars;
+       if (brows > totalLines) totalLines = brows;
+    }
+
+    ypos = XPOS;
+    height = (font->max_bounds.ascent + font->max_bounds.descent) + 1;
+    if (bfont != NULL) {
+       int     h = (bfont->max_bounds.ascent + bfont->max_bounds.descent) + 1;
+       if (h > height)
+           height = h;
+    }
+    gcv.font = font->fid;
+    XChangeGC(xp->d, xp->fggc, GCFont, &gcv);
+    XChangeGC(xp->d, xp->bggc, GCFont, &gcv);
+
+    charsPerLine = p->objects;
+
+    if (totalLines > reps) totalLines = reps;
+
+    if (p->special) {
+       charsPerLine = (charsPerLine + 3) & ~3; /* make a multiple of four */
+       p->objects = charsPerLine;
+
+       items = (XTextItem *) malloc(totalLines*SEGS*sizeof (XTextItem));
+
+       for (i = 0; i < totalLines; i++) {
+           pbuf0 = items[i*SEGS+0].chars =
+                           (char *) malloc (sizeof (char)*charsPerLine/2);
+           items[i*SEGS+0].nchars = charsPerLine/4;
+           items[i*SEGS+0].delta = 0;
+           items[i*SEGS+0].font = font->fid;
+           pbuf1 = items[i*SEGS+1].chars =
+                           (char *) malloc (sizeof (char)*charsPerLine);
+           items[i*SEGS+1].nchars = charsPerLine/2;
+           items[i*SEGS+1].delta = 3;
+           items[i*SEGS+1].font = bfont->fid;
+           pbuf2 = items[i*SEGS+2].chars =
+                           (char *) malloc (sizeof (char)*charsPerLine/2);
+           items[i*SEGS+2].nchars = charsPerLine/4;
+           items[i*SEGS+2].delta = 3;
+           items[i*SEGS+2].font = font->fid;
+           for (j = 0; j < charsPerLine/4; j++) {
+               GetRealChar(font, totalChars, ch);
+               *pbuf0++ = ch / columns + font->min_byte1;
+               *pbuf0++ = ch % columns + font->min_char_or_byte2;
+               GetRealChar(font, totalChars, ch);
+               *pbuf2++ = ch / columns + font->min_byte1;
+               *pbuf2++ = ch % columns + font->min_char_or_byte2;
+           }
+           for (j = 0; j < charsPerLine/2; j++) {
+               GetRealChar(bfont, btotalChars, bch);
+               *pbuf1++ = bch / bcolumns + bfont->min_byte1;
+               *pbuf1++ = bch % bcolumns + bfont->min_char_or_byte2;
+           }
+       }
+    } else {
+       charBuf = (char **) malloc(totalLines*sizeof (char *));
+       for (i = 0; i < totalLines; i++) {
+           pbuf0 = charBuf[i] = (char *) malloc (sizeof (char)*charsPerLine*2);
+           for (j = 0; j < charsPerLine; j++) {
+               GetRealChar(font, totalChars, ch);
+               *pbuf0++ = ch / columns + font->min_byte1;
+               *pbuf0++ = ch % columns + font->min_char_or_byte2;
+           }
+       }
+    }
+    return reps;
+}
+
+void 
+DoText(XParms xp, Parms p, int reps)
+{
+    int     i, line, startLine;
+
+    startLine = 0;
+    line = 0;
+    for (i = 0; i != reps; i++) {
+       XDrawString(
+           xp->d, xp->w, xp->fggc, XPOS, ypos, charBuf[line], charsPerLine);
+       ypos += height;
+       if (ypos > HEIGHT - height) {
+           /* Wraparound to top of window */
+           ypos = XPOS;
+           line = startLine;
+           startLine = (startLine + 1) % totalLines;
+       }
+       line = (line + 1) % totalLines;
+       CheckAbort ();
+    }
+}
+
+void 
+DoText16(XParms xp, Parms p, int reps)
+{
+    int     i, line, startLine;
+
+    startLine = 0;
+    line = 0;
+    for (i = 0; i < reps; i++) {
+       XDrawString16(
+           xp->d, xp->w, xp->fggc, XPOS, ypos, (XChar2b *)charBuf[line], charsPerLine);
+       ypos += height;
+       if (ypos > HEIGHT - height) {
+           /* Wraparound to top of window */
+           ypos = XPOS;
+           line = startLine;
+           startLine = (startLine + 1) % totalLines;
+       }
+       line = (line + 1) % totalLines;
+       CheckAbort ();
+    }
+}
+
+void 
+DoPolyText(XParms xp, Parms p, int reps)
+{
+    int     i, line, startLine;
+
+    startLine = 0;
+    line = 0;
+    for (i = 0; i != reps; i++) {
+       XDrawText(
+           xp->d, xp->w, xp->fggc, XPOS, ypos, &items[line*SEGS], SEGS);
+       ypos += height;
+       if (ypos > HEIGHT - height) {
+           /* Wraparound to top of window */
+           ypos = XPOS;
+           line = startLine;
+           startLine = (startLine + 1) % totalLines;
+       }
+       line = (line + 1) % totalLines;
+       CheckAbort ();
+    }
+}
+
+void 
+DoPolyText16(XParms xp, Parms p, int reps)
+{
+    int     i, line, startLine;
+
+    startLine = 0;
+    line = 0;
+    for (i = 0; i != reps; i++) {
+       XDrawText16(
+           xp->d, xp->w, xp->fggc, XPOS, ypos, (XTextItem16 *)&items[line*SEGS], SEGS);
+       ypos += height;
+       if (ypos > HEIGHT - height) {
+           /* Wraparound to top of window */
+           ypos = XPOS;
+           line = startLine;
+           startLine = (startLine + 1) % totalLines;
+       }
+       line = (line + 1) % totalLines;
+       CheckAbort ();
+    }
+}
+
+void 
+DoImageText(XParms xp, Parms p, int reps)
+{
+    int     i, line, startLine;
+
+    startLine = 0;
+    line = 0;
+    for (i = 0; i != reps; i++) {
+       XDrawImageString(
+           xp->d, xp->w, xp->fggc, XPOS, ypos, charBuf[line], charsPerLine);
+       ypos += height;
+       if (ypos > HEIGHT - height) {
+           /* Wraparound to top of window */
+           ypos = XPOS;
+           startLine = (startLine + 17) % totalLines;
+           line = startLine;
+       }
+       line = (line + 1) % totalLines;
+       CheckAbort ();
+    }
+}
+
+void 
+DoImageText16(XParms xp, Parms p, int reps)
+{
+    int     i, line, startLine;
+
+    startLine = 0;
+    line = 0;
+    for (i = 0; i != reps; i++) {
+       XDrawImageString16(
+           xp->d, xp->w, xp->fggc, XPOS, ypos, (XChar2b *)charBuf[line], charsPerLine);
+       ypos += height;
+       if (ypos > HEIGHT - height) {
+           /* Wraparound to top of window */
+           ypos = XPOS;
+           startLine = (startLine + 17) % totalLines;
+           line = startLine;
+       }
+       line = (line + 1) % totalLines;
+       CheckAbort ();
+    }
+}
+
+void 
+ClearTextWin(XParms xp, Parms p)
+{
+    XClearWindow(xp->d, xp->w);
+}
+
+void 
+EndText(XParms xp, Parms p)
+{
+    int i;
+
+    if(font==NULL)return;
+    for (i = 0; i != totalLines; i++)
+       free(charBuf[i]);
+    free(charBuf);
+    if (p->special)
+       free(items);
+    XFreeFont(xp->d, font);
+    if (bfont != NULL)
+       XFreeFont(xp->d, bfont);
+}
+
+void 
+EndText16(XParms xp, Parms p)
+{
+    int i;
+
+    if(font==NULL)return;
+    if (p->special) {
+       for (i = 0; i < totalLines; i++) {
+           free(items[i*SEGS+0].chars);
+           free(items[i*SEGS+1].chars);
+           free(items[i*SEGS+2].chars);
+       }
+       free(items);
+    } else {
+       for (i = 0; i < totalLines; i++) {
+           free(charBuf[i]);
+       }
+       free(charBuf);
+    }
+    XFreeFont(xp->d, font);
+    if(bfont != NULL) {
+       XFreeFont(xp->d, bfont);
+    }
+}
+
+#ifdef XFT
+#include <X11/extensions/Xrender.h>
+#include <X11/Xft/Xft.h>
+
+static XftFont *aafont;
+static XftDraw *aadraw;
+static XftColor        aacolor;
+
+int 
+InitAAText(XParms xp, Parms p, int reps)
+{
+    int                        i, j;
+    char               ch;
+    XRenderColor       color;
+
+    aafont = XftFontOpenName (xp->d, DefaultScreen (xp->d), p->font);
+    
+    if (aafont == NULL) 
+    {
+       printf("Could not load font '%s', benchmark omitted\n", 
+              p->font);
+       return 0;
+    }
+
+    aadraw = XftDrawCreate (xp->d, xp->w, 
+                           xp->vinfo.visual, 
+                           xp->cmap);
+
+    if (!aadraw) 
+    {
+       printf ("Cannot create XftDraw object\n");
+       XftFontClose (xp->d, aafont);
+       return 0;
+    }
+    color.red = 0;
+    color.green = 0;
+    color.blue = 0;
+    color.alpha = 0xffff;
+    if (!XftColorAllocValue (xp->d,
+                            xp->vinfo.visual, 
+                            xp->cmap,
+                            &color, &aacolor))
+    {
+       printf ("Cannot allocate black\n");
+       XftFontClose (xp->d, aafont);
+       XftDrawDestroy (aadraw);
+       aafont = NULL;
+       aadraw = NULL;
+       return 0;
+    }
+    
+    ypos = XPOS;
+    height = aafont->height;
+    
+    charsPerLine = p->objects;
+    charsPerLine = (charsPerLine + 3) & ~3;
+    p->objects = charsPerLine;
+
+    totalLines = '\177' - ' ' + 1;
+    if (totalLines > reps) totalLines = reps;
+
+    charBuf = (char **) malloc(totalLines*sizeof (char *));
+
+    for (i = 0; i != totalLines; i++) {
+       charBuf[i] = (char *) malloc (sizeof (char)*charsPerLine);
+       ch = i + ' ';
+       for (j = 0; j != charsPerLine; j++) {
+           charBuf[i][j] = ch;
+           if (ch == '\177') ch = ' '; else ch++;
+       }
+    }
+    return reps;
+}
+
+void 
+DoAAText(XParms xp, Parms p, int reps)
+{
+    int     i, line, startLine;
+
+    startLine = 0;
+    line = 0;
+    for (i = 0; i != reps; i++) {
+       XftDrawString8 (aadraw, &aacolor, aafont, 
+                      XPOS, ypos, (unsigned char *) charBuf[line], charsPerLine);
+       ypos += height;
+       if (ypos > HEIGHT - height) {
+           /* Wraparound to top of window */
+           ypos = XPOS;
+           line = startLine;
+           startLine = (startLine + 1) % totalLines;
+       }
+       line = (line + 1) % totalLines;
+       CheckAbort ();
+    }
+}
+
+void 
+EndAAText(XParms xp, Parms p)
+{
+    int i;
+
+    if(!aadraw)return;
+    for (i = 0; i != totalLines; i++)
+       free(charBuf[i]);
+    free(charBuf);
+    XftDrawDestroy (aadraw);
+    XftFontClose (xp->d, aafont);
+    XftColorFree (xp->d,
+                 xp->vinfo.visual, 
+                 xp->cmap,
+                 &aacolor);
+}
+
+#endif
diff --git a/x11perf/do_traps.c b/x11perf/do_traps.c
new file mode 100755 (executable)
index 0000000..326b56e
--- /dev/null
@@ -0,0 +1,395 @@
+/*****************************************************************************
+Copyright 1988, 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.
+
+******************************************************************************/
+
+#include "x11perf.h"
+#include "bitmaps.h"
+
+#define NUM_POINTS 4   /* 4 points to a trapezoid */
+static XPoint *points;
+static GC      pgc;
+
+int 
+InitTrapezoids(XParms xp, Parms p, int reps)
+{
+    int     i, numPoints;
+    int     rows;
+    int     x, y;
+    int     size, skew;
+    XPoint  *curPoint;
+
+    pgc = xp->fggc;
+
+    size = p->special;
+    numPoints = (p->objects) * NUM_POINTS;  
+    points = (XPoint *)malloc(numPoints * sizeof(XPoint));
+    curPoint = points;
+    x = size;
+    y = 0;
+    rows = 0;
+    skew = size;
+
+    for (i = 0; i != p->objects; i++, curPoint += NUM_POINTS) {
+       curPoint[0].x = x - skew;
+       curPoint[0].y = y;
+       curPoint[1].x = x - skew + size;
+       curPoint[1].y = y;
+       curPoint[2].x = x + skew;
+       curPoint[2].y = y + size;
+       curPoint[3].x = x + skew - size;
+       curPoint[3].y = y + size;
+
+       skew--;
+       if (skew < 0) skew = size;
+
+       y += size;
+       rows++;
+       if (y + size > HEIGHT || rows == MAXROWS) {
+           rows = 0;
+           y = 0;
+           x += 2 * size;
+           if (x + size > WIDTH) {
+               x = size;
+           }
+       }
+    }
+
+    SetFillStyle(xp, p);
+    return reps;
+}
+
+void 
+DoTrapezoids(XParms xp, Parms p, int reps)
+{
+    int     i, j;
+    XPoint  *curPoint;
+
+    for (i = 0; i != reps; i++) {
+        curPoint = points;
+        for (j = 0; j != p->objects; j++) {
+            XFillPolygon(xp->d, xp->w, pgc, curPoint, NUM_POINTS, Convex, 
+                        CoordModeOrigin);
+            curPoint += NUM_POINTS;
+       }
+        if (pgc == xp->bggc)
+            pgc = xp->fggc;
+        else
+            pgc = xp->bggc;
+       CheckAbort ();
+    }
+}
+
+void 
+EndTrapezoids(XParms xp, Parms p)
+{
+    free(points);
+}
+
+#ifdef XRENDER
+#include <X11/extensions/Xrender.h>
+#include <X11/Xft/Xft.h>
+
+static XTrap               *traps;
+static XTrapezoid          *trapezoids;
+static XftDraw             *aadraw;
+static XftColor                    aablack, aawhite;
+static XRenderColor        transparent = { 0, 0, 0, 0 };
+static XRenderPictFormat    *maskFormat;
+static Pixmap              maskPixmap;
+static Picture             mask;
+
+int
+InitFixedTraps(XParms xp, Parms p, int reps)
+{
+    int     i, numTraps;
+    int     rows;
+    int     x, y;
+    int     size, skew;
+    XTrap      *curTrap;
+    XRenderColor       color;
+    int                        major, minor;
+    int                depth;
+    int                width;
+    int                std_fmt;
+
+    XRenderQueryVersion (xp->d, &major, &minor);
+    if (major == 0 && minor < 9)
+       return 0;
+
+    pgc = xp->fggc;
+
+    size = p->special;
+    numTraps = p->objects;
+    traps = (XTrap *)malloc(numTraps * sizeof(XTrap));
+    curTrap = traps;
+    x = size;
+    y = 0;
+    rows = 0;
+    skew = size;
+    aadraw = XftDrawCreate (xp->d, xp->w, 
+                           xp->vinfo.visual, 
+                           xp->cmap);
+    
+    depth = 0;
+    width = 0;
+    if (p->font)
+       sscanf (p->font, "%d,%d", &depth, &width);
+
+    switch (depth) {
+    case 8:
+    default:
+       depth = 8;
+       std_fmt = PictStandardA8;
+       break;
+    case 4:
+       std_fmt = PictStandardA4;
+       break;
+    case 1:
+       std_fmt = PictStandardA1;
+       break;
+    }
+    maskFormat = XRenderFindStandardFormat (xp->d, std_fmt);
+    
+    maskPixmap = XCreatePixmap (xp->d, xp->w, WIDTH, HEIGHT, depth);
+
+    mask = XRenderCreatePicture (xp->d, maskPixmap, maskFormat, 0, NULL);
+    
+    color.red = 0;
+    color.green = 0;
+    color.blue = 0;
+    color.alpha = 0xffff;
+    if (!XftColorAllocValue (xp->d,
+                            xp->vinfo.visual, 
+                            xp->cmap,
+                            &color, &aablack))
+    {
+       XftDrawDestroy (aadraw);
+       aadraw = NULL;
+       return 0;
+    }
+    color.red = 0xffff;
+    color.green = 0xffff;
+    color.blue = 0xffff;
+    color.alpha = 0xffff;
+    if (!XftColorAllocValue (xp->d,
+                            xp->vinfo.visual, 
+                            xp->cmap,
+                            &color, &aawhite))
+    {
+       XftDrawDestroy (aadraw);
+       aadraw = NULL;
+       return 0;
+    }
+
+    if (width == 0)
+       width = size;
+    for (i = 0; i != p->objects; i++, curTrap ++) {
+       curTrap->top.y = XDoubleToFixed (y);
+       curTrap->top.left = XDoubleToFixed (x - skew);
+       curTrap->top.right = XDoubleToFixed (x - skew + width);
+       curTrap->bottom.y = XDoubleToFixed (y + size);
+       curTrap->bottom.left = XDoubleToFixed (x + skew - width);
+       curTrap->bottom.right = XDoubleToFixed (x + skew);
+       
+       skew--;
+       if (skew < 0) skew = size;
+
+       y += size;
+       rows++;
+       if (y + size > HEIGHT || rows == MAXROWS) {
+           rows = 0;
+           y = 0;
+           x += 2 * size;
+           if (x + size > WIDTH) {
+               x = size;
+           }
+       }
+    }
+    
+    SetFillStyle(xp, p);
+    return reps;
+}
+
+void 
+DoFixedTraps(XParms xp, Parms p, int reps)
+{
+    int                i;
+    Picture    white, black, src, dst;
+
+    white = XftDrawSrcPicture (aadraw, &aawhite);
+    black = XftDrawSrcPicture (aadraw, &aablack);
+    dst = XftDrawPicture (aadraw);
+
+    src = black;
+    for (i = 0; i != reps; i++) {
+       XRenderFillRectangle (xp->d, PictOpSrc, mask, &transparent,
+                             0, 0, WIDTH, HEIGHT);
+       XRenderAddTraps (xp->d, mask, 0, 0, traps, p->objects);
+       XRenderComposite (xp->d, PictOpOver, src, mask, dst,
+                         0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
+        if (src == black)
+           src = white;
+        else
+            src = black;
+       CheckAbort ();
+    }
+}
+
+void
+EndFixedTraps (XParms xp, Parms p)
+{
+    free (traps);
+    XftDrawDestroy (aadraw);
+    XRenderFreePicture (xp->d, mask);
+    XFreePixmap (xp->d, maskPixmap);
+}
+
+int
+InitFixedTrapezoids(XParms xp, Parms p, int reps)
+{
+    int     i, numTraps;
+    int     rows;
+    int     x, y;
+    int     size, skew;
+    XTrapezoid *curTrap;
+    XRenderColor       color;
+
+    pgc = xp->fggc;
+
+    size = p->special;
+    numTraps = p->objects;
+    trapezoids = (XTrapezoid *)malloc(numTraps * sizeof(XTrapezoid));
+    curTrap = trapezoids;
+    x = size;
+    y = 0;
+    rows = 0;
+    skew = size;
+    aadraw = XftDrawCreate (xp->d, xp->w, 
+                           xp->vinfo.visual, 
+                           xp->cmap);
+    if (p->font && !strcmp (p->font, "add"))
+    {
+       XRenderPictFormat   templ;
+       templ.type = PictTypeDirect;
+       templ.depth = 8;
+       templ.direct.alpha = 0;
+       templ.direct.alphaMask = 0xff;
+       maskFormat = XRenderFindFormat (xp->d, 
+                                       PictFormatType |
+                                       PictFormatDepth |
+                                       PictFormatAlpha |
+                                       PictFormatAlphaMask,
+                                       &templ,
+                                       0);
+    }
+    else
+       maskFormat = NULL;
+    color.red = 0;
+    color.green = 0;
+    color.blue = 0;
+    color.alpha = 0xffff;
+    if (!XftColorAllocValue (xp->d,
+                            xp->vinfo.visual, 
+                            xp->cmap,
+                            &color, &aablack))
+    {
+       XftDrawDestroy (aadraw);
+       aadraw = NULL;
+       return 0;
+    }
+    color.red = 0xffff;
+    color.green = 0xffff;
+    color.blue = 0xffff;
+    color.alpha = 0xffff;
+    if (!XftColorAllocValue (xp->d,
+                            xp->vinfo.visual, 
+                            xp->cmap,
+                            &color, &aawhite))
+    {
+       XftDrawDestroy (aadraw);
+       aadraw = NULL;
+       return 0;
+    }
+
+    for (i = 0; i != p->objects; i++, curTrap ++) {
+       curTrap->top = XDoubleToFixed (y);
+       curTrap->bottom = XDoubleToFixed (y + size);
+       curTrap->left.p1.x = XDoubleToFixed (x - skew);
+       curTrap->left.p1.y = XDoubleToFixed (y);
+       curTrap->left.p2.x = XDoubleToFixed (x + skew - size);
+       curTrap->left.p2.y = XDoubleToFixed (y + size);
+       
+       curTrap->right.p1.x = XDoubleToFixed (x - skew + size);
+       curTrap->right.p1.y = XDoubleToFixed (y);
+       curTrap->right.p2.x = XDoubleToFixed (x + skew);
+       curTrap->right.p2.y = XDoubleToFixed (y + size);
+       
+       skew--;
+       if (skew < 0) skew = size;
+
+       y += size;
+       rows++;
+       if (y + size > HEIGHT || rows == MAXROWS) {
+           rows = 0;
+           y = 0;
+           x += 2 * size;
+           if (x + size > WIDTH) {
+               x = size;
+           }
+       }
+    }
+
+    
+    SetFillStyle(xp, p);
+    return reps;
+}
+
+void 
+DoFixedTrapezoids(XParms xp, Parms p, int reps)
+{
+    int                i;
+    Picture    white, black, src, dst;
+
+    white = XftDrawSrcPicture (aadraw, &aawhite);
+    black = XftDrawSrcPicture (aadraw, &aablack);
+    dst = XftDrawPicture (aadraw);
+
+    src = black;
+    for (i = 0; i != reps; i++) {
+       XRenderCompositeTrapezoids (xp->d, PictOpOver, src, dst, maskFormat,
+                                   0, 0, trapezoids, p->objects);
+        if (src == black)
+           src = white;
+        else
+            src = black;
+       CheckAbort ();
+    }
+}
+
+void
+EndFixedTrapezoids (XParms xp, Parms p)
+{
+    free (trapezoids);
+    XftDrawDestroy (aadraw);
+}
+
+#endif /* XRENDER */
diff --git a/x11perf/do_tris.c b/x11perf/do_tris.c
new file mode 100755 (executable)
index 0000000..cf0200e
--- /dev/null
@@ -0,0 +1,232 @@
+/*****************************************************************************
+Copyright 1988, 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.
+
+******************************************************************************/
+
+
+#undef POLYTRIANGLE_HACK    /* don't use this code */
+#ifdef POLYTRIANGLE_HACK
+#include <X11/Xlibint.h>
+#endif
+
+#include "x11perf.h"
+#include "bitmaps.h"
+#include <stdio.h>
+#include <math.h>
+
+#define NUM_POINTS 3   /* 3 points to a triangle */
+static XPoint *points;
+static GC     pgc;
+
+#ifndef PI
+#define PI  3.14159265357989
+#endif
+
+static double 
+Area(XPoint p1, XPoint p2, XPoint p3)
+{
+    return
+      (p1.x*p2.y - p1.x*p3.y + p2.x*p3.y - p2.x*p1.y + p3.x*p1.y - p3.x*p2.y)/2;
+}
+
+/*
+static double 
+Distance(XPoint p1, XPoint p2)
+{
+    return sqrt((float) ((p1.x-p2.x)*(p1.x-p2.x) + (p1.y-p2.y)*(p1.y-p2.y)));
+}
+*/
+    
+int 
+InitTriangles(XParms xp, Parms p, int reps)
+{
+    int     i, j, numPoints;
+    int     rows;
+    int     x, y;
+    int     size, iradius;
+    double  phi, phiinc, radius, delta, phi2, area, aarea;
+    XPoint  *curPoint;
+
+    pgc = xp->fggc;
+
+    size = p->special;
+    phi = 0.0;
+    delta = 2.0 * PI / ((double) NUM_POINTS);
+    if (xp->version == VERSION1_2) {
+       radius = ((double) size) * sqrt(3.0)/2.0;
+       phiinc = delta/10.0;
+    } else {
+       /* Version 1.2's radius computation was completely bogus, and resulted
+          in triangles with sides about 50% longer than advertised.  However,
+          this inadvertently resulted in triangles with areas just a little bit
+          smaller than the triangle that covers size^2 pixels, which would
+          make the area directly comparable to 10x10 rectangles and 10x10
+          trapezoids.  So here's the new computation so -triangleN has the same
+          area as -rectN.
+        */
+       radius = ((double) size) * sqrt(sqrt(16.0/27.0));
+       phiinc = 1.75*PI / ((double) p->objects);
+    }
+    iradius = (int) (radius + 0.5);
+
+    numPoints = (p->objects) * NUM_POINTS;  
+    points = (XPoint *)malloc(numPoints * sizeof(XPoint));
+    curPoint = points;
+    x = iradius;
+    y = iradius;
+    rows = 0;
+    aarea = 0.0;
+
+    for (i = 0; i != p->objects; i++) {
+       for (j = 0; j != NUM_POINTS; j++) {
+           phi2 = phi + ((double) j) * delta;
+           curPoint->x = (int) ((double)x + (radius * cos(phi2)) + 0.5);
+           curPoint->y = (int) ((double)y + (radius * sin(phi2)) + 0.5);
+           curPoint++;
+       }
+       area = Area(curPoint[-1], curPoint[-2], curPoint[-3]);
+       aarea += area;
+/*     printf("%6.1lf %6.1lf %6.1lf   %6.1lf\n",
+           Distance(curPoint[-1], curPoint[-2]),
+           Distance(curPoint[-1], curPoint[-3]),
+           Distance(curPoint[-2], curPoint[-3]),
+           area);
+*/     
+       phi += phiinc;
+       y += 2 * iradius;
+       rows++;
+       if (y + iradius > HEIGHT || rows == MAXROWS) {
+           rows = 0;
+           y = iradius;
+           x += 2 * iradius;
+           if (x + iradius > WIDTH) {
+               x = iradius;
+           }
+       }
+    }
+/*    printf("Average area = %6.2lf\n", aarea/p->objects); */
+
+    SetFillStyle(xp, p);
+
+    return reps;
+}
+
+#ifndef POLYTRIANGLE_HACK
+
+void 
+DoTriangles(XParms xp, Parms p, int reps)
+{
+    int     i, j;
+    XPoint  *curPoint;
+
+    for (i = 0; i != reps; i++) {
+        curPoint = points;
+        for (j = 0; j != p->objects; j++) {
+            XFillPolygon(xp->d, xp->w, pgc, curPoint, NUM_POINTS, Convex, 
+                        CoordModeOrigin);
+            curPoint += NUM_POINTS;
+       }
+        if (pgc == xp->bggc)
+            pgc = xp->fggc;
+        else
+            pgc = xp->bggc;
+       CheckAbort ();
+    }
+}
+
+#else
+
+static xReq _dummy_request = {
+       0, 0, 0
+};
+
+static void
+XPolyTriangle(register Display *dpy, 
+             Drawable d, GC gc, XPoint *points, 
+             int n_triangles, int shape, int mode)
+{
+    register xFillPolyReq *req;
+    register long nbytes;
+    int                max_triangles;
+    int                n_this_time;
+    int                *buf, *pts;
+    int                gcid;
+    int                last;
+
+    max_triangles = (dpy->bufmax - dpy->buffer) / 28;
+    LockDisplay(dpy);
+    FlushGC(dpy, gc);
+    dpy->request += n_triangles;
+    pts = (int *) points;
+    gcid = gc->gid;
+    last = shape | (mode << 8);
+    while (n_triangles)
+    {
+       if ((n_this_time = max_triangles) > n_triangles)
+           n_this_time = n_triangles;
+       n_triangles -= n_this_time;
+       GetReqExtra(FillPoly, 
+           (SIZEOF(xFillPolyReq) + 12) * n_this_time - SIZEOF(xFillPolyReq), req);
+       --dpy->request;
+
+       buf = req;
+        while (n_this_time--)
+       {
+           buf[0] = X_FillPoly | (7 << 16);
+           buf[1] = d;
+           buf[2] = gcid;
+           buf[3] = last;
+           buf[4] = pts[0];
+           buf[5] = pts[1];
+           buf[6] = pts[2];
+           buf += 7;
+           pts += 3;
+       }
+    }
+    dpy->last_req = &_dummy_request;
+    UnlockDisplay(dpy);
+    SyncHandle();
+}
+
+void 
+DoTriangles(XParms xp, Parms p, int reps)
+{
+    int     i, j;
+    XPoint  *curPoint;
+
+    for (i = 0; i != reps; i++) {
+        XPolyTriangle (xp->d, xp->w, pgc, points, p->objects, Convex, 
+                        CoordModeOrigin);
+        if (pgc == xp->bggc)
+            pgc = xp->fggc;
+        else
+            pgc = xp->bggc;
+       CheckAbort ();
+    }
+}
+#endif
+
+void 
+EndTriangles(XParms xp, Parms p)
+{
+    free(points);
+}
+
diff --git a/x11perf/do_valgc.c b/x11perf/do_valgc.c
new file mode 100755 (executable)
index 0000000..75f1a1a
--- /dev/null
@@ -0,0 +1,76 @@
+/*****************************************************************************
+Copyright 1988, 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.
+
+******************************************************************************/
+
+#ifndef VMS
+#include <X11/Xatom.h>
+#else
+#include <decw$include/Xatom.h>
+#endif
+#include "x11perf.h"
+
+static Window win[2];
+
+int 
+InitGC(XParms xp, Parms p, int reps)
+{
+    win[0] = XCreateSimpleWindow(
+       xp->d, xp->w, 10, 10, 10, 10, 1, xp->foreground, xp->background);
+    win[1] = XCreateSimpleWindow(
+       xp->d, xp->w, 30, 30, 10, 10, 1, xp->foreground, xp->background);
+    XMapSubwindows(xp->d, xp->w);
+    return reps;
+}
+
+void 
+DoChangeGC(XParms xp, Parms p, int reps)
+{
+    int                i;
+    XGCValues   gcv;
+
+    for (i = 0; i != reps; i++) {
+        gcv.foreground = xp->foreground;
+        XChangeGC(xp->d, xp->fggc, GCForeground , &gcv);
+        XDrawPoint(xp->d, win[0], xp->fggc, 5, 5);       
+
+        gcv.foreground = xp->background;
+        XChangeGC(xp->d, xp->fggc, GCForeground , &gcv);
+        XDrawPoint(xp->d, win[1], xp->fggc, 5, 5);       
+
+        gcv.foreground = xp->background;
+        XChangeGC(xp->d, xp->fggc, GCForeground , &gcv);
+        XDrawPoint(xp->d, win[0], xp->fggc, 5, 5);       
+
+        gcv.foreground = xp->foreground;
+        XChangeGC(xp->d, xp->fggc, GCForeground , &gcv);
+        XDrawPoint(xp->d, win[1], xp->fggc, 5, 5);       
+       CheckAbort ();
+    }
+}
+
+void 
+EndGC(XParms xp, Parms p)
+{
+    XDestroyWindow(xp->d, win[0]);
+    XDestroyWindow(xp->d, win[1]);
+}
+
diff --git a/x11perf/do_windows.c b/x11perf/do_windows.c
new file mode 100755 (executable)
index 0000000..024d76b
--- /dev/null
@@ -0,0 +1,281 @@
+/*****************************************************************************
+Copyright 1988, 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.
+
+******************************************************************************/
+
+#include "x11perf.h"
+
+static Window *parents;
+static Window *isolates;
+static int childrows, childcolumns, childwindows;
+static int parentrows, parentcolumns, parentwindows;
+static int parentwidth, parentheight;
+static Window popup;
+
+static void 
+ComputeSizes(XParms xp, Parms p)
+{
+    childwindows = p->objects;
+    childrows = (childwindows + MAXCOLS - 1) / MAXCOLS;
+    childcolumns = (childrows > 1 ? MAXCOLS : childwindows);
+
+    parentwidth = (CHILDSIZE+CHILDSPACE) * childcolumns;
+    parentheight = (CHILDSIZE+CHILDSPACE) * childrows;
+}
+
+int 
+CreateParents(XParms xp, Parms p, int reps)
+{
+    int     i;
+
+    ComputeSizes(xp, p);
+
+    parentcolumns = WIDTH / parentwidth;
+    parentrows = HEIGHT / parentheight;
+    parentwindows = parentcolumns * parentrows; /* Max reps we can fit */
+
+    if (parentwindows > reps) {
+       parentwindows = reps;
+    }
+
+    /* We will do parentwindows sets of childwindows, in order to get better
+       timing accuracy.  Creating 4 windows at a millisecond apiece or so
+       is a bit faster than the 60 Hz clock. */
+    isolates = (Window *)malloc(parentwindows * sizeof(Window));
+    parents = (Window *)malloc(parentwindows * sizeof(Window));
+
+    /*
+     *  Create isolation windows for the parents, and then the parents
+     *  themselves.  These isolation windows ensure that parent and children
+     *  windows created/mapped in DoWins and DoWin2 all see the same local
+     *  environment...the parent is an only child, and each parent contains
+     *  the number of children we are trying to get benchmarks on.
+     */
+
+    for (i = 0; i != parentwindows; i++) {
+       isolates[i] = XCreateSimpleWindow(xp->d, xp->w,
+           (i/parentrows)*parentwidth, (i%parentrows)*parentheight,
+           parentwidth, parentheight, 0, xp->background, xp->background);
+       parents[i] = XCreateSimpleWindow(xp->d, isolates[i],
+           0, 0, parentwidth, parentheight, 0, xp->background, xp->background);
+    }
+
+    XMapSubwindows(xp->d, xp->w);
+    return parentwindows;
+} /* CreateParents */
+
+
+void 
+MapParents(XParms xp, Parms p, int reps)
+{
+    int i;
+
+    for (i = 0; i != parentwindows; i++) {
+       XMapWindow(xp->d, parents[i]);
+    }
+}
+
+void 
+MapParentsCleanup(XParms xp, Parms p)
+{
+    int i;
+
+    for (i = 0; i != parentwindows; i++) {
+       XMapWindow(xp->d, parents[i]);
+    }
+}
+
+
+int 
+InitCreate(XParms xp, Parms p, int reps)
+{
+    reps = CreateParents(xp, p, reps);
+    MapParents(xp, p, reps);
+    return reps;
+}
+
+static void 
+CreateChildGroup(XParms xp, Parms p, Window parent)
+{
+    int j;
+
+    for (j = 0; j != childwindows; j++) {
+       (void) XCreateSimpleWindow (xp->d, parent,
+               (CHILDSIZE+CHILDSPACE) * (j/childrows) + CHILDSPACE/2,
+               (CHILDSIZE+CHILDSPACE) * (j%childrows) + CHILDSPACE/2,
+               CHILDSIZE, CHILDSIZE, 0, xp->background, xp->foreground);
+    }
+
+    if (p->special)
+       XMapSubwindows (xp->d, parent);
+}
+
+void 
+CreateChildren(XParms xp, Parms p, int reps)
+{
+    int     i;
+
+    for (i = 0; i != parentwindows; i++) {
+       CreateChildGroup(xp, p, parents[i]);
+    } /* end i */
+}
+
+void 
+DestroyChildren(XParms xp, Parms p)
+{
+    int i;
+
+    for (i = 0; i != parentwindows; i++) {
+       XDestroySubwindows(xp->d, parents[i]);
+    }
+}
+
+void 
+EndCreate(XParms xp, Parms p)
+{
+    XDestroySubwindows(xp->d, xp->w);
+    free(parents);
+    free(isolates);
+}
+
+
+int 
+InitMap(XParms xp, Parms p, int reps)
+{
+    reps = CreateParents(xp, p, reps);
+    CreateChildren(xp, p, reps);
+    return reps;
+}
+
+void 
+UnmapParents(XParms xp, Parms p, int reps)
+{
+    int i;
+
+    for (i = 0; i != parentwindows; i++) {
+       XUnmapWindow(xp->d, parents[i]);
+    }
+}
+
+void 
+UnmapParentsCleanup(XParms xp, Parms p)
+{
+    int i;
+
+    for (i = 0; i != parentwindows; i++) {
+       XUnmapWindow(xp->d, parents[i]);
+    }
+}
+
+int 
+InitDestroy(XParms xp, Parms p, int reps)
+{
+    reps = CreateParents(xp, p, reps);
+    CreateChildren(xp, p, reps);
+    MapParents(xp, p, reps);
+    return reps;
+}
+
+void 
+DestroyParents(XParms xp, Parms p, int reps)
+{
+    int i;
+
+    for (i = 0; i != parentwindows; i++) {
+       XDestroyWindow(xp->d, parents[i]);
+    }
+}
+
+
+void 
+RenewParents(XParms xp, Parms p)
+{
+    int i;
+
+    for (i = 0; i != parentwindows; i++) {
+       parents[i] = XCreateSimpleWindow(xp->d, isolates[i],
+           0, 0, parentwidth, parentheight, 0, xp->background, xp->background);
+    }
+    CreateChildren(xp, p, parentwindows);
+    MapParents(xp, p, parentwindows);
+}
+
+int 
+InitPopups(XParms xp, Parms p, int reps)
+{
+#ifdef CHILDROOT
+    XWindowAttributes    xwa;
+#endif
+    XSetWindowAttributes xswa;
+    Window isolate;
+
+#ifdef CHILDROOT
+    ComputeSizes(xp, p);
+    CreateChildGroup(xp, p, xp->w);
+
+    /* Now create simple window to pop up over children */
+    (void) XGetWindowAttributes(xp->d, xp->w, &xwa);
+    xswa.override_redirect = True;
+    popup =  XCreateSimpleWindow (
+           xp->d, DefaultRootWindow(xp->d), 
+           xwa.x + xwa.border_width, xwa.y + xwa.border_width,
+           parentwidth, parentheight,
+           0, xp->foreground, xp->foreground);
+#else   
+    isolate = XCreateSimpleWindow(
+           xp->d, xp->w, 0, 0, WIDTH, HEIGHT,
+           0, xp->background, xp->background);
+
+    ComputeSizes(xp, p);
+    CreateChildGroup(xp, p, isolate);
+    XMapWindow(xp->d, isolate);
+
+    /* Now create simple window to pop up over children */
+    xswa.override_redirect = True;
+    popup =  XCreateSimpleWindow (
+           xp->d, xp->w, 0, 0,
+           parentwidth, parentheight,
+           0, xp->foreground, xp->foreground);
+#endif
+    XChangeWindowAttributes (xp->d, popup, CWOverrideRedirect, &xswa);
+    return reps;
+}
+
+void 
+DoPopUps(XParms xp, Parms p, int reps)
+{
+    int i;
+    for (i = 0; i != reps; i++) {
+        XMapWindow(xp->d, popup);
+       XUnmapWindow(xp->d, popup);
+       CheckAbort ();
+    }
+}
+
+void 
+EndPopups(XParms xp, Parms p)
+{
+    XDestroySubwindows(xp->d, xp->w);
+#ifdef CHILDROOT
+    XDestroyWindow(xp->d, popup);
+#endif
+}
+
diff --git a/x11perf/fillblnk b/x11perf/fillblnk
new file mode 100755 (executable)
index 0000000..dbd2ec1
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+echo '#####EOF#####' | cat $2 - $1 |
+awk -F: '\
+$1 == "#####EOF#####"  { filling = 1; currentItem = 1; lastItem = NR; next; }
+filling != "1" { itemOrder[" " $1] = NR; name[NR] = $1; }
+filling == "1" { rate[itemOrder[$2]] = $1; }
+END    {
+       for (i = 1; i < lastItem; i++) {
+               if (rate[i] != "") {
+                       printf ("%s: %s\n", rate[i], name[i]);
+               } else {
+                       printf (" 0 trep @ 0.0 msec (0.0/sec): %s\n", name[i]);
+               }
+       }
+       }'
diff --git a/x11perf/install-sh b/x11perf/install-sh
new file mode 100755 (executable)
index 0000000..6781b98
--- /dev/null
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# 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.
+
+nl='
+'
+IFS=" ""       $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+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:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+       shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+       case $mode in
+         *' '* | *'    '* | *'
+'*       | *'*'* | *'?'* | *'['*)
+           echo "$0: invalid mode: $mode" >&2
+           exit 1;;
+       esac
+       shift;;
+
+    -o) chowncmd="$chownprog $2"
+       shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+       shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)        shift
+       break;;
+
+    -*)        echo "$0: invalid option: $1" >&2
+       exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # 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: $dst_arg: Is a directory" >&2
+       exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+       (dirname "$dst") 2>/dev/null ||
+       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+            X"$dst" : 'X\(//\)[^/]' \| \
+            X"$dst" : 'X\(//\)$' \| \
+            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+       echo X"$dst" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+       # Create intermediate dirs using mode 755 as modified by the umask.
+       # This is like FreeBSD 'install' as of 1997-10-28.
+       umask=`umask`
+       case $stripcmd.$umask in
+         # Optimize common cases.
+         *[2367][2367]) mkdir_umask=$umask;;
+         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+         *[0-7])
+           mkdir_umask=`expr $umask + 22 \
+             - $umask % 100 % 40 + $umask % 20 \
+             - $umask % 10 % 4 + $umask % 2
+           `;;
+         *) mkdir_umask=$umask,go-w;;
+       esac
+
+       # With -d, create the new directory with the user-specified mode.
+       # Otherwise, rely on $mkdir_umask.
+       if test -n "$dir_arg"; then
+         mkdir_mode=-m$mode
+       else
+         mkdir_mode=
+       fi
+
+       posix_mkdir=false
+       case $umask in
+         *[123567][0-7][0-7])
+           # POSIX mkdir -p sets u+wx bits regardless of umask, which
+           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+           ;;
+         *)
+           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+           if (umask $mkdir_umask &&
+               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+           then
+             if test -z "$dir_arg" || {
+                  # Check for POSIX incompatibilities with -m.
+                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                  # other-writeable bit of parent directory when it shouldn't.
+                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                  case $ls_ld_tmpdir in
+                    d????-?r-*) different_mode=700;;
+                    d????-?--*) different_mode=755;;
+                    *) false;;
+                  esac &&
+                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                  }
+                }
+             then posix_mkdir=:
+             fi
+             rmdir "$tmpdir/d" "$tmpdir"
+           else
+             # Remove any dirs left behind by ancient mkdir implementations.
+             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+           fi
+           trap '' 0;;
+       esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+       umask $mkdir_umask &&
+       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+       /*) prefix='/';;
+       -*) prefix='./';;
+       *)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+       test -z "$d" && continue
+
+       prefix=$prefix$d
+       if test -d "$prefix"; then
+         prefixes=
+       else
+         if $posix_mkdir; then
+           (umask=$mkdir_umask &&
+            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+           # Don't fail if two instances are running concurrently.
+           test -d "$prefix" || exit 1
+         else
+           case $prefix in
+             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+             *) qprefix=$prefix;;
+           esac
+           prefixes="$prefixes '$qprefix'"
+         fi
+       fi
+       prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+       # Don't fail if two instances are running concurrently.
+       (umask $mkdir_umask &&
+        eval "\$doit_exec \$mkdirprog $prefixes") ||
+         test -d "$dstdir" || exit 1
+       obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # 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
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"    2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+       # Now remove or move aside any old file at destination location.
+       # We try this two ways since rm can't unlink itself on some
+       # systems and the destination file might be busy for other
+       # reasons.  In this case, the final cleanup might fail but the new
+       # file should still install successfully.
+       {
+         test ! -f "$dst" ||
+         $doit $rmcmd -f "$dst" 2>/dev/null ||
+         { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+           { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+         } ||
+         { echo "$0: cannot unlink or rename $dst" >&2
+           (exit 1); exit 1
+         }
+       } &&
+
+       # Now rename the file to the real destination.
+       $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/x11perf/missing b/x11perf/missing
new file mode 100755 (executable)
index 0000000..28055d2
--- /dev/null
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# 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=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+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'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  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]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
+# 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).  This is about non-GNU programs, so use $1 not
+# $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 $program 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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if test ! -f y.tab.h; then
+       echo >y.tab.h
+    fi
+    if test ! -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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if test ! -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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit $?
+    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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+       /^@setfilename/{
+         s/.* \([^ ]*\) *$/\1/
+         p
+         q
+       }' $infile`
+      # ... 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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/x11perf/perfboth b/x11perf/perfboth
new file mode 100755 (executable)
index 0000000..f529841
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/sh
+awk '
+/^     1/ && READY == 0 {      printf ("    1   ");
+               for (i = 2; i < NF; i++)
+                       printf ("          %2d        ", i);
+               printf ("   Operation\n");
+               next;
+       }
+/^---/ {       printf ("--------");
+               for (i = 2; i <= NF; i++)
+                       printf ("   -----------------");
+               printf ("\n");
+               READY=1; next;
+       }
+READY==1 {
+               base=$1;
+               printf ("%8.1f", base);
+               for (i = 2; i < '$1'; i++) {
+                       if (base == 0)
+                               printf ("   %8.1f         ", $i);
+                       else {
+                               rate=$i/base;
+                               if (rate < .1)
+                                       printf ("   %8.1f (%6.3f)", $i, rate);
+                               else if (rate < 1000)
+                                       printf ("   %8.1f (%6.2f)", $i, rate);
+                               else
+                                       printf ("   %8.1f (%6.0f)", $i, rate);
+                       }
+               }
+               printf ("   ");
+               for (; i <= NF; i++)
+               {
+                       printf ("%s ", $i);
+               }
+               printf ("\n");
+               next;
+          }
+          { print $0; }
+'
diff --git a/x11perf/perfratio b/x11perf/perfratio
new file mode 100755 (executable)
index 0000000..6ff3a12
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/sh
+awk '
+/^     1/ && READY == 0 {      printf ("     1  ");
+               for (i = 2; i < NF; i++)
+                       printf ("     %2d ", i);
+               printf ("   Operation\n");
+               next;
+       }
+/^---/ {       printf ("--------");
+               for (i = 2; i < NF; i++)
+                       printf ("  ------");
+               printf ("   ---------\n");
+               READY=1; next;
+       }
+READY==1 {
+               base=$1;
+               printf ("%8.1f", base);
+               for (i = 2; i < '$1'; i++) {
+                       if (base == 0)
+                               printf ("   lots ", $i);
+                       else {
+                               rate=$i/base;
+                               if (rate < .1)
+                                       printf ("  %6.3f", rate);
+                               else if (rate < 1000)
+                                       printf ("  %6.2f", rate);
+                               else
+                                       printf ("  %6.0f", rate);
+                       }
+               }
+               printf ("   ");
+               for (; i <= NF; i++)
+               {
+                       printf ("%s ", $i);
+               }
+               printf ("\n");
+               next;
+          }
+          { print $0; }
+'
diff --git a/x11perf/x11pcomp.cpp b/x11perf/x11pcomp.cpp
new file mode 100755 (executable)
index 0000000..be7d397
--- /dev/null
@@ -0,0 +1,103 @@
+XCOMM! /bin/sh
+XCOMM
+XCOMM $XFree86$
+XCOMM
+XCOMM Collects multiple outputs of x11perf.  Just feed it a list of files, each
+XCOMM containing the output from an x11perf run, and this shell will extract the
+XCOMM object/second information and show it in tabular form.  An 80-column line
+XCOMM is big enough to compare 4 different servers.
+XCOMM
+XCOMM This script normally uses the results from $1 to extract the test label
+XCOMM descriptions, so you can run x11perf on a subset of the test and then
+XCOMM compare the results.  But note that x11perffill requires the labels file
+XCOMM to be a superset of the x11perf results file.  If you run into an ugly
+XCOMM situation in which none of the servers completes the desired tests 
+XCOMM (quite possible on non-DEC servers :), you can use -l <filename> as $1 and
+XCOMM $2 to force x11perfcomp to use the labels stored in file $2.  (You can run
+XCOMM x11perf with the -labels option to generate such a file.)
+XCOMM
+XCOMM Mark Moraes, University of Toronto <moraes@csri.toronto.edu>
+XCOMM Joel McCormack, DEC Western Research Lab <joel@decwrl.dec.com>
+XCOMM
+
+PATH=LIBPATH:.:$PATH
+export PATH
+
+set -e
+tmp=${TMPDIR-/tmp}/rates.$$
+trap "rm -rf $tmp" 0 1 2 15
+mkdir $tmp || exit 1
+mkdir $tmp/rates
+ratio=
+allfiles=
+XCOMM Include relative rates in output?  Report only relative rates?
+case $1 in
+-r|-a)
+       ratio=1
+       shift;
+       ;;
+-ro)
+       ratio=2
+       shift;
+       ;;
+esac
+XCOMM Get either the provided label file, or construct one from all the
+XCOMM files given.
+case $1 in
+-l)    cp $2 $tmp/labels
+       shift; shift
+       ;;
+*)     for file in "$@"; do
+               awk '$2 == "reps" || $2 == "trep" { print $0; next; }' $file |
+               sed 's/^.*: //' |
+               sed 's/ /_/g' |
+               awk 'NR > 1     { printf ("%s %s\n", prev, $0); } \
+                               { prev = $0; }'
+       done | tsort 2>/dev/null | sed 's/_/ /g' > $tmp/labels
+       ;;
+esac
+XCOMM Go through all files, and create a corresponding rate file for each
+n=1
+for i
+do
+XCOMM Get lines with average numbers, fill in any tests that may be missing
+XCOMM then extract the rate field
+       base=`basename $i`
+       (echo "     $n  "
+        echo '--------'
+        awk '$2 == "reps" || $2 == "trep" { \
+               line = $0; \
+               next; \
+           } \
+           NF == 0 && line != "" { \
+               print line; \
+               line=""; \
+               next; \
+           } \
+        ' $i > $tmp/$n.avg
+        fillblnk $tmp/$n.avg $tmp/labels |
+        sed 's/( *\([0-9]*\)/(\1/'   |
+        awk '$2 == "reps" || $2 == "trep" { \
+                                               n = substr($6,2,length($6)-7); \
+                                               printf "%8s\n", n; \
+                                          }'
+       ) > $tmp/rates/$n
+       echo "$n: $i"
+       allfiles="$allfiles$tmp/rates/$n "
+       n=`expr $n + 1`
+done
+case x$ratio in
+x)
+       ratio=/bin/cat
+       ;;
+x1)
+       ratio="perfboth $n"
+       ;;
+*)
+       ratio="perfratio $n"
+       ;;
+esac
+echo ''
+(echo Operation; echo '---------'; cat $tmp/labels) |
+paste $allfiles - | sed 's/    /  /g' | $ratio
+rm -rf $tmp
diff --git a/x11perf/x11perf.c b/x11perf/x11perf.c
new file mode 100755 (executable)
index 0000000..15eb04d
--- /dev/null
@@ -0,0 +1,1579 @@
+/****************************************************************************
+Copyright 1988, 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.
+
+****************************************************************************/
+
+#include <stdio.h>
+#include <ctype.h>
+#include <signal.h>
+
+#ifndef VMS
+#include <X11/Xatom.h>
+#include <X11/Xos.h>
+#else
+#include <decw$include/Xatom.h>
+#endif
+#include "x11perf.h"
+#include <X11/Xmu/SysUtil.h>
+
+#include <time.h>
+#define Time_t time_t
+#include <stdlib.h>
+
+/* Only for working on ``fake'' servers, for hardware that doesn't exist */
+static Bool     drawToFakeServer = False;
+static Bool     falsePrecision  = False;
+static Pixmap   tileToQuery     = None;
+static char *displayName;
+int    abortTest;
+
+typedef struct _RopNames { char        *name; int  rop; } RopNameRec, *RopNamePtr;
+
+static RopNameRec ropNames[] = {
+       { "clear",        GXclear },            /* 0 */
+       { "and",          GXand },              /* src AND dst */
+       { "andReverse",   GXandReverse },       /* src AND NOT dst */
+       { "copy",         GXcopy },             /* src */
+       { "andInverted",  GXandInverted },      /* NOT src AND dst */
+       { "noop",         GXnoop },             /* dst */
+       { "xor",          GXxor },              /* src XOR dst */
+       { "or",           GXor },               /* src OR dst */
+       { "nor",          GXnor },              /* NOT src AND NOT dst */
+       { "equiv",        GXequiv },            /* NOT src XOR dst */
+       { "invert",       GXinvert },           /* NOT dst */
+       { "orReverse",    GXorReverse },        /* src OR NOT dst */
+       { "copyInverted", GXcopyInverted },     /* NOT src */
+       { "orInverted",   GXorInverted },       /* NOT src OR dst */
+       { "nand",         GXnand },             /* NOT src OR NOT dst */
+       { "set",          GXset }               /* 1 */
+};
+
+static RopNameRec popNames[] = {
+       { "Clear",        PictOpClear },
+       { "Src",          PictOpSrc },
+       { "Dst",          PictOpDst },
+       { "Over",         PictOpOver },
+       { "OverReverse",  PictOpOverReverse },
+       { "In",           PictOpIn },
+       { "InReverse",    PictOpInReverse },
+       { "Out",          PictOpOut },
+       { "OutReverse",   PictOpOutReverse },
+       { "Atop",         PictOpAtop },
+       { "AtopReverse",  PictOpAtopReverse },
+       { "Xor",          PictOpXor },
+       { "Add",          PictOpAdd },
+       { "Saturate",     PictOpSaturate },
+};
+
+static RopNameRec formatNames[] = {
+    { "RGB24",   PictStandardRGB24 },
+    { "ARGB32",          PictStandardARGB32 },
+    { "A8",      PictStandardA8 },
+    { "A4",      PictStandardA4 },
+    { "A1",      PictStandardA1 },
+    { "NATIVE",          PictStandardNative },
+};
+
+static char *(visualClassNames)[] = {
+    "StaticGray",
+    "GrayScale",
+    "StaticColor",
+    "PseudoColor",
+    "TrueColor",
+    "DirectColor"
+};
+
+static Bool     labels         = False;
+static int      repeat         = 5;
+static int     seconds         = 5;
+
+static Window   status;     /* Status window and GC */
+static GC       tgc;
+static int     HSx, HSy;
+
+static double syncTime = 0.0;
+
+static int saveargc;
+static char **saveargv;
+
+#define NUM_ROPS    16
+static int  numRops = 1;
+static int  rops[NUM_ROPS] = { GXcopy };
+#define NUM_POPS    14
+static int  numPops = 1;
+static int  pops[NUM_POPS] = { PictOpOver };
+#define NUM_FORMATS 6
+static int  numFormats = 1;
+static int  formats[NUM_FORMATS] = { PictStandardNative };
+static int  numPlanemasks = 1;
+static unsigned long planemasks[256] = { (unsigned long)~0 };
+
+static char *foreground = NULL;
+static char *background = NULL;
+static char *ddbackground = NULL;
+static int clips = 0;
+
+static int numSubWindows = 7;
+static unsigned long subWindows[] = {4, 16, 25, 50, 75, 100, 200, 0};
+
+static int  fixedReps = 0;
+
+static Bool *doit;
+
+static XRectangle ws[] = {  /* Clip rectangles */
+    {195, 195, 120, 120},
+    { 45, 145, 120, 120},
+    {345, 245, 120, 120},
+    { 45, 275, 120, 120},
+    {345, 115, 120, 120},
+    {195, 325, 120, 120}
+
+};
+#define MAXCLIP     (sizeof(ws) / sizeof(ws[0]))
+static Window clipWindows[MAXCLIP];
+static Colormap cmap;
+static int depth = -1;  /* -1 means use default depth */
+static int vclass = -1; /* -1 means use CopyFromParent */
+
+/* ScreenSaver state */
+static XParmRec    xparms;
+static int ssTimeout, ssInterval, ssPreferBlanking, ssAllowExposures;
+
+/* Static functions */
+static int GetWords(int argi, int argc, char **argv, char **wordsp, int *nump);
+static int GetNumbers(int argi, int argc, char **argv, unsigned long *intsp, 
+                     int *nump);
+static int GetRops(int argi, int argc, char **argv, int *ropsp, int *nump);
+static int GetPops(int argi, int argc, char **argv, int *popsp, int *nump);
+static int GetFormats(int argi, int argc, char **argv, int *formatsp, int *nump);
+
+/************************************************
+*          time related stuff                  *
+************************************************/
+
+#ifdef VMS
+
+typedef struct _vms_time {
+    unsigned long low;
+    unsigned long high;
+}vms_time;
+
+struct timeval {
+    long tv_sec;        /* seconds since Jan. 1, 1970 */
+    long tv_usec;  /* and microseconds */
+};
+
+struct timezone {
+    int  tz_minuteswest;     /* of Greenwich */
+    int  tz_dsttime;    /* type of dst correction to apply */
+};
+
+
+static int firsttime = True;
+static vms_time basetime;
+
+int gettimeofday(tp)
+    struct timeval *tp;
+{
+    vms_time current_time, resultant;
+    unsigned long mumble, foo;
+    int status;
+
+    if (firsttime) {
+        sys$gettim(&basetime);
+        firsttime = False;
+    }
+    sys$gettim(&current_time);
+    resultant.high = current_time.high - basetime.high;
+    resultant.low = current_time.low - basetime.low;
+    if (current_time.low < basetime.low) {
+        resultant.high -= 1;
+    }
+    status = lib$ediv( &(10000000), &resultant, &tp->tv_sec, &tp->tv_usec);
+    tp->tv_usec /= 10;
+    return 0;
+}
+
+#endif
+
+static struct  timeval start;
+
+static void 
+PrintTime(void)
+{
+    Time_t t;
+
+    t = time((Time_t *)NULL);
+    printf("%s\n", ctime(&t));
+}
+
+static void 
+InitTimes(void)
+{
+    X_GETTIMEOFDAY(&start);
+}
+
+static double 
+ElapsedTime(double correction)
+{
+    struct timeval stop;
+
+    X_GETTIMEOFDAY(&stop);
+    if (stop.tv_usec < start.tv_usec) {
+        stop.tv_usec += 1000000;
+       stop.tv_sec -= 1;
+    }
+    return  (double)(stop.tv_usec - start.tv_usec) +
+            (1000000.0 * (double)(stop.tv_sec - start.tv_sec)) - correction;
+}
+
+static double 
+RoundTo3Digits(double d)
+{
+    /* It's kind of silly to print out things like ``193658.4/sec'' so just
+       junk all but 3 most significant digits. */
+    double exponent, sign;
+
+    if (falsePrecision)
+        return d;
+
+    exponent = 1.0;
+    /* the code below won't work if d should happen to be non-positive. */
+    if (d < 0.0) {
+       d = -d;
+       sign = -1.0;
+    } else
+       sign = 1.0;
+    if (d >= 1000.0) {
+       do {
+           exponent *= 10.0;
+       } while (d/exponent >= 1000.0);
+       d = (double)((int) (d/exponent + 0.5));
+       d *= exponent;
+    } else {
+       if (d != 0.0) {
+           while (d*exponent < 100.0) {
+               exponent *= 10.0;
+           }
+       }
+       d = (double)((int) (d*exponent + 0.5));
+       d /= exponent;
+    }
+    return d * sign;
+}
+
+
+static void 
+ReportTimes(double usecs, int n, char *str, int average)
+{
+    double msecsperobj, objspersec;
+
+    if(usecs != 0.0)
+    {
+        msecsperobj = usecs / (1000.0 * (double)n);
+        objspersec = (double) n * 1000000.0 / usecs;
+
+        /* Round obj/sec to 3 significant digits.  Leave msec untouched, to
+          allow averaging results from several repetitions. */
+        objspersec =  RoundTo3Digits(objspersec);
+
+        if (average) {
+           printf("%7d trep @ %8.4f msec (%8.1f/sec): %s\n", 
+                   n, msecsperobj, objspersec, str);
+       } else {
+           printf("%7d reps @ %8.4f msec (%8.1f/sec): %s\n", 
+               n, msecsperobj, objspersec, str);
+       }
+    } else {
+       printf("%6d %sreps @ 0.0 msec (unmeasurably fast): %s\n",
+           n, average ? "t" : "", str);
+    }
+
+}
+
+
+
+/************************************************
+*              Generic X stuff                 *
+************************************************/
+
+static char *program_name;
+static void usage(void);
+
+/*
+ * Get_Display_Name (argc, argv) Look for -display, -d, or host:dpy (obselete)
+ * If found, remove it from command line.  Don't go past a lone -.
+ */
+static char *
+Get_Display_Name(int *pargc, /* MODIFIED */
+                char **argv) /* MODIFIED */
+{
+    int     argc = *pargc;
+    char    **pargv = argv+1;
+    char    *displayname = NULL;
+    int     i;
+
+    for (i = 1; i != argc; i++) {
+       char *arg = argv[i];
+
+       if (!strcmp (arg, "-display") || !strcmp (arg, "-d")) {
+           if (++i >= argc) usage ();
+
+           displayname = argv[i];
+           *pargc -= 2;
+           continue;
+       }
+       if (!strcmp(arg,"-")) {
+           while (i<argc)  *pargv++ = argv[i++];
+           break;
+       }
+       *pargv++ = arg;
+    }
+
+    *pargv = NULL;
+    return (displayname);
+}
+
+
+/*
+ * GetVersion (argc, argv) Look for -v1.2, -v1.3, or -v1.4.
+ * If found remove it from command line.  Don't go past a lone -.
+ */
+
+static Version 
+GetVersion(int *pargc, /* MODIFIED */
+          char **argv)  /* MODIFIED */
+{
+    int     argc = *pargc;
+    char    **pargv = argv+1;
+    Version version = VERSION1_6;
+    int     i;
+    Bool    found = False;
+
+    for (i = 1; i != argc; i++) {
+       char *arg = argv[i];
+
+       if (!strcmp (arg, "-v1.2")) {
+           version = VERSION1_2;
+           *pargc -= 1;
+           if (found) {
+               fprintf(stderr, "Warning: multiple version specifications\n");
+           }
+           found = True;
+           continue;
+       }
+       if (!strcmp (arg, "-v1.3")) {
+           version = VERSION1_3;
+           *pargc -= 1;
+           if (found) {
+               fprintf(stderr, "Warning: multiple version specifications\n");
+           }
+           found = True;
+           continue;
+       }
+       if (!strcmp (arg, "-v1.4")) {
+           version = VERSION1_4;
+           *pargc -= 1;
+           if (found) {
+               fprintf(stderr, "Warning: multiple version specifications\n");
+           }
+           found = True;
+           continue;
+       }
+       if (!strcmp (arg, "-v1.5")) {
+           version = VERSION1_5;
+           *pargc -= 1;
+           if (found) {
+               fprintf(stderr, "Warning: multiple version specifications\n");
+           }
+           found = True;
+           continue;
+       }
+       if (!strcmp(arg,"-")) {
+           while (i<argc)  *pargv++ = argv[i++];
+           break;
+       }
+       *pargv++ = arg;
+    }
+
+    *pargv = NULL;
+    return (version);
+}
+
+
+
+/*
+ * Open_Display: Routine to open a display with correct error handling.
+ */
+static Display *
+Open_Display(char *display_name)
+{
+    Display *d;
+
+    d = XOpenDisplay(display_name);
+    if (d == NULL) {
+       fprintf (stderr, "%s:  unable to open display '%s'\n",
+                program_name, XDisplayName (display_name));
+       exit(1);
+    }
+
+    return(d);
+}
+
+
+/* defined by autoconf AC_TYPE_SIGNAL, need to define for Imake */
+#ifndef RETSIGTYPE 
+# ifdef SIGNALRETURNSINT
+#  define RETSIGTYPE int
+# else
+#  define RETSIGTYPE void
+# endif
+#endif
+
+static RETSIGTYPE
+Cleanup(int sig)
+{
+    abortTest = sig;
+}
+
+void
+AbortTest(void)
+{
+    fflush(stdout);
+    
+    XSetScreenSaver(xparms.d, ssTimeout, ssInterval, ssPreferBlanking,
+       ssAllowExposures);
+    XFlush(xparms.d);
+    exit (abortTest);
+}
+
+/************************************************
+*              Performance stuff               *
+************************************************/
+
+
+static void 
+usage(void)
+{
+    char    **cpp;
+    int     i = 0;
+    static char *help_message[] = {
+"where options include:",
+"    -display <host:display>   the X server to contact",
+"    -sync                     do the tests in synchronous mode",
+"    -pack                     pack rectangles right next to each other",
+"    -repeat <n>               do tests <n> times (default = 5)",
+"    -time <s>                 do tests for <s> seconds each (default = 5)",
+/*
+"    -draw                     draw after each test -- pmax only",
+*/
+"    -all                      do all tests",
+"    -range <test1>[,<test2>]  like all, but do <test1> to <test2>",
+"    -labels                   generate test labels for use by fillblnk",
+"    -fg                       the foreground color to use",
+"    -bg                       the background color to use",
+"    -clips <default>          default number of clip windows per test",
+"    -ddbg                     the background color to use for DoubleDash",
+"    -rop <rop0 rop1 ...>      use the given rops to draw (default = GXcopy)",
+"    -pm <pm0 pm1 ...>         use the given planemasks to draw (default = ~0)",
+"    -depth <depth>            use a visual with <depth> planes per pixel",
+"    -vclass <class>           the visual class to use (default = root)",
+"    -reps <n>                 fix the rep count (default = auto scale)",
+"    -subs <s0 s1 ...>         a list of the number of sub-windows to use",
+"    -v1.2                     perform only v1.2 tests using old semantics",
+"    -v1.3                     perform only v1.3 tests using old semantics",
+"    -su                       request save unders on windows",
+"    -bs <backing_store_hint>  WhenMapped or Always (default = NotUseful)",
+NULL};
+
+    fflush(stdout);
+    fprintf(stderr, "usage: %s [-options ...]\n", program_name);
+    for (cpp = help_message; *cpp; cpp++) {
+       fprintf(stderr, "%s\n", *cpp);
+    }
+    while (test[i].option != NULL) {
+       if (test[i].versions & xparms.version ) {
+           fprintf(stderr, "    %-24s   %s\n",
+               test[i].option,
+               test[i].label14 ? test[i].label14 : test[i].label);
+       }
+        i++;
+    }
+    fprintf(stderr, "\n");
+    
+    /* Print out original command line as the above usage message is so long */
+    for (i = 0; i != saveargc; i++) {
+       fprintf(stderr, "%s ", saveargv[i]);
+    }
+    fprintf(stderr, "\n\n");
+    exit (1);
+}
+
+void 
+NullProc(XParms xp, Parms p)
+{
+}
+
+int 
+NullInitProc(XParms xp, Parms p, int reps)
+{
+    return reps;
+}
+
+static void 
+HardwareSync(XParms xp)
+{
+    /*
+     * Some graphics hardware allows the server to claim it is done,
+     * while in reality the hardware is busily working away.  So fetch
+     * a pixel from the drawable that was drawn to, which should be
+     * enough to make the server wait for the graphics hardware.
+     */
+    XImage *image;
+
+    image = XGetImage(xp->d, xp->p ? xp->p : xp->w, HSx, HSy, 
+                     1, 1, ~0, ZPixmap);
+    if (image) XDestroyImage(image);
+}
+
+static void 
+DoHardwareSync(XParms xp, Parms p, int reps)    
+{
+    int i;
+    
+    for (i = 0; i != reps; i++) {
+       HardwareSync(xp);
+       CheckAbort ();
+    }
+}
+
+static Test syncTest = {
+    "syncTime", "Internal test for finding how long HardwareSync takes", NULL,
+    NullInitProc, DoHardwareSync, NullProc, NullProc, 
+    V1_2FEATURE, NONROP, 0,
+    {1}
+};
+
+
+static Window 
+CreatePerfWindow(XParms xp, int x, int y, int width, int height)
+{
+    XSetWindowAttributes xswa;
+    Window w;
+/*
+    Screen *s;
+    int su;
+
+    s = DefaultScreenOfDisplay(xp->d);
+    su = XDoesBackingStore(s);
+    printf("Backing store of screen returns %d\n", su);
+    su = XDoesSaveUnders(s);
+    printf("Save unders of screen returns %d\n", su);
+    su = XPlanesOfScreen(s);
+    printf("Planes of screen returns %d\n", su);
+*/
+    xswa.background_pixel = xp->background;
+    xswa.border_pixel = xp->foreground;
+    xswa.colormap = cmap;
+    xswa.override_redirect = True;
+    xswa.backing_store = xp->backing_store;
+    xswa.save_under = xp->save_under;
+    w = XCreateWindow(xp->d, DefaultRootWindow(xp->d), x, y, width, height, 1,
+        xp->vinfo.depth, CopyFromParent, xp->vinfo.visual,
+       CWBackPixel | CWBorderPixel | CWColormap | CWOverrideRedirect 
+       | CWBackingStore | CWSaveUnder, &xswa);
+    XMapWindow (xp->d, w);
+    return w;
+}
+
+
+static void 
+CreateClipWindows(XParms xp, int clips)
+{
+    int j;
+    XWindowAttributes    xwa;
+
+    (void) XGetWindowAttributes(xp->d, xp->w, &xwa);
+    if (clips > MAXCLIP) clips = MAXCLIP;
+    for (j = 0; j != clips; j++) {
+       clipWindows[j] = CreatePerfWindow(xp,
+           xwa.x + ws[j].x, xwa.y + ws[j].y, ws[j].width, ws[j].height);
+    }
+} /* CreateClipWindows */
+
+
+static void 
+DestroyClipWindows(XParms xp, int clips)
+{
+    int j;
+
+    if (clips > MAXCLIP) clips = MAXCLIP;
+    for (j = 0; j != clips; j++) {
+       XDestroyWindow(xp->d, clipWindows[j]);
+    }
+} /* DestroyClipWindows */
+
+
+static double 
+DoTest(XParms xp, Test *test, int reps)
+{
+    double  time;
+    unsigned int ret_width, ret_height;
+
+    /* Tell screen-saver to restart counting again.  See comments below for the
+       XSetScreenSaver call. */
+    XForceScreenSaver(xp->d, ScreenSaverReset);
+    HardwareSync (xp); 
+    InitTimes ();
+    (*test->proc) (xp, &test->parms, reps);
+    HardwareSync(xp);
+
+    time = ElapsedTime(syncTime);
+    CheckAbort ();
+    if (drawToFakeServer)
+        XQueryBestSize(xp->d, TileShape, tileToQuery,
+                      32, 32, &ret_width, &ret_height);
+    (*test->passCleanup) (xp, &test->parms);
+    return time;
+}
+
+
+static int 
+CalibrateTest(XParms xp, Test *test, int seconds, double *usecperobj)
+{
+#define goal    2500000.0   /* Try to get up to 2.5 seconds                */
+#define enough  2000000.0   /* But settle for 2.0 seconds                  */
+#define tick      10000.0   /* Assume clock not faster than .01 seconds     */
+
+    double  usecs;
+    int     reps, didreps;  /* Reps desired, reps performed                */
+    int     exponent;
+
+    /* Attempt to get an idea how long each rep lasts by getting enough
+       reps to last more tan enough.  Then scale that up to the number of
+       seconds desired.
+
+       If init call to test ever fails, return False and test will be skipped.
+    */
+
+    if (fixedReps != 0) {
+       return fixedReps;
+    }
+    reps = 1;
+    for (;;) {
+       XDestroySubwindows(xp->d, xp->w);
+       XClearWindow(xp->d, xp->w);
+       didreps = (*test->init) (xp, &test->parms, reps);
+       CheckAbort ();
+       if (didreps == 0) {
+           return 0;
+       }
+       if ( test->clips < clips )
+         test->clips = clips ;
+       /* Create clip windows if requested */
+       CreateClipWindows(xp, test->clips);
+       HardwareSync(xp);
+       InitTimes();
+       (*test->proc) (xp, &test->parms, reps);
+       HardwareSync(xp);
+       usecs = ElapsedTime(syncTime);
+       (*test->passCleanup) (xp, &test->parms);
+       (*test->cleanup) (xp, &test->parms);
+       DestroyClipWindows(xp, test->clips);
+       CheckAbort ();
+
+       if (didreps != reps) {
+           /* The test can't do the number of reps as we asked for.  
+              Give up */
+           *usecperobj = 
+               usecs / (double)(didreps * test->parms.objects);
+           return didreps;
+       }
+       /* Did we go long enough? */
+       if (usecs >= enough) break;
+
+       /* Don't let too short a clock make new reps wildly high */
+       if (usecs <= tick)reps = reps*10;
+       else{
+           /* Try to get up to goal seconds. */
+           reps = (int) (goal * (double)reps / usecs) + 1;
+       }
+    }
+
+    *usecperobj = usecs / (double) (reps * test->parms.objects);
+    reps = (int) ((double)seconds * 1000000.0 * (double)reps / usecs) + 1;
+
+    /* Now round reps up to 1 digit accuracy, so we don't get stupid-looking
+       numbers of repetitions. */
+    reps--;
+    exponent = 1;
+    while (reps > 9) {
+       reps /= 10;
+       exponent *= 10;
+    }
+    reps = (reps + 1) * exponent;
+    return reps;
+} /* CalibrateTest */
+
+static void 
+CreatePerfGCs(XParms xp, int func, unsigned long pm)
+{
+    XGCValues gcvfg, gcvbg, gcvddbg,gcvddfg;
+    unsigned long      fg, bg, ddbg;
+
+    fg = xp->foreground;
+    bg = xp->background;
+    ddbg = xp->ddbackground;
+    gcvfg.graphics_exposures = False;
+    gcvbg.graphics_exposures = False;
+    gcvddfg.graphics_exposures = False;
+    gcvddbg.graphics_exposures = False;
+    gcvfg.plane_mask = pm;
+    gcvbg.plane_mask = pm;
+    gcvddfg.plane_mask = pm;
+    gcvddbg.plane_mask = pm;
+    gcvfg.function = func;
+    gcvbg.function = func;
+    gcvddfg.function = func;
+    gcvddbg.function = func;
+    
+    if (func == GXxor) {
+       /* Make test look good visually if possible */
+       gcvbg.foreground = gcvfg.foreground = bg ^ fg;
+       gcvbg.background = gcvfg.background = bg;
+       /* Double Dash GCs (This doesn't make a huge amount of sense) */
+       gcvddbg.foreground = gcvddfg.foreground = bg ^ fg;
+       gcvddbg.background = gcvddfg.foreground = bg ^ ddbg;
+    } else {
+       gcvfg.foreground = fg;
+       gcvfg.background = bg;
+       gcvbg.foreground = bg;
+       gcvbg.background = fg;
+       gcvddfg.foreground = fg;
+       gcvddfg.background = ddbg;
+       gcvddbg.foreground = ddbg;
+       gcvddbg.background = fg;
+    }
+    xp->fggc = XCreateGC(xp->d, xp->w,
+       GCForeground | GCBackground | GCGraphicsExposures
+      | GCFunction | GCPlaneMask, &gcvfg);
+    xp->bggc = XCreateGC(xp->d, xp->w, 
+       GCForeground | GCBackground | GCGraphicsExposures
+      | GCFunction | GCPlaneMask, &gcvbg);
+    xp->ddfggc = XCreateGC(xp->d, xp->w,
+       GCForeground | GCBackground | GCGraphicsExposures
+      | GCFunction | GCPlaneMask, &gcvddfg);
+    xp->ddbggc = XCreateGC(xp->d, xp->w, 
+       GCForeground | GCBackground | GCGraphicsExposures
+      | GCFunction | GCPlaneMask, &gcvddbg);
+}
+
+
+static void 
+DestroyPerfGCs(XParms xp)
+{
+    XFreeGC(xp->d, xp->fggc);
+    XFreeGC(xp->d, xp->bggc);
+    XFreeGC(xp->d, xp->ddfggc);
+    XFreeGC(xp->d, xp->ddbggc);
+}
+
+static unsigned long 
+AllocateColor(Display *display, char *name, unsigned long pixel)
+{
+    XColor      color;
+
+    if (name != NULL) {
+       /* Try to parse color name */
+       if (XParseColor(display, cmap, name, &color)) {
+           if (XAllocColor(display, cmap, &color)) {
+               pixel = color.pixel;
+           } else {
+               (void) fprintf(stderr,
+                   "Can't allocate colormap entry for color %s\n", name);
+           }
+       } else {
+           if(*name >= '0' && *name <= '9')
+               pixel = atoi(name);
+           else
+               (void) fprintf(stderr, "Can't parse color name %s\n", name);
+       }
+    }
+    return pixel;
+} /* AllocateColor */
+
+
+static void 
+DisplayStatus(Display *d, char *message, char *test, int try)
+{
+    char    s[500];
+
+    XClearWindow(d, status);
+    sprintf(s, "%d %s %s", try, message, test);
+    /* We should really look at the height, descent of the font, etc. but
+       who cares.  This works. */
+    XDrawString(d, status, tgc, 10, 13, s, strlen(s));
+}
+
+
+static void 
+ProcessTest(XParms xp, Test *test, int func, unsigned long pm, char *label)
+{
+    double  time, totalTime;
+    int     reps;
+    int     j;
+
+    xp->planemask = pm;
+    xp->func = func;
+    if (test->testType == COMP)
+    {
+       func = GXcopy;
+       pm = ~0L;
+    }
+    CreatePerfGCs(xp, func, pm);
+    DisplayStatus(xp->d, "Calibrating", label, 0);
+    reps = CalibrateTest(xp, test, seconds, &time);
+    if (reps != 0) {
+       srand(1);       /* allow reproducible results */
+       XDestroySubwindows(xp->d, xp->w);
+       XClearWindow(xp->d, xp->w);
+       reps = (*test->init) (xp, &test->parms, reps);
+       if (abortTest)
+           AbortTest ();
+       /*
+        * if using fixedReps then will not have done CalibrateTest so must
+        * check result of init for 0 here
+        */
+       if(reps == 0){
+           DestroyPerfGCs(xp);
+           return;
+       }
+       /* Create clip windows if requested */
+       CreateClipWindows(xp, test->clips);
+
+       totalTime = 0.0;
+       for (j = 0; j != repeat; j++) {
+           DisplayStatus(xp->d, "Testing", label, j+1);
+           time = DoTest(xp, test, reps);
+           if (abortTest)
+               AbortTest ();
+           totalTime += time;
+           ReportTimes (time, reps * test->parms.objects,
+                   label, False);
+       }
+       if (repeat > 1) {
+           ReportTimes(totalTime,
+               repeat * reps * test->parms.objects,
+               label, True);
+       }
+       (*test->cleanup) (xp, &test->parms);
+       DestroyClipWindows(xp, test->clips);
+    } else {
+       /* Test failed to initialize properly */
+    }
+    printf ("\n");
+    fflush(stdout);
+    DestroyPerfGCs(xp);
+} /* ProcessTest */
+
+#define Strstr strstr
+
+#define LABELP(i) (test[i].label14 && (xparms.version >= VERSION1_4) \
+                       ? test[i].label14 : test[i].label)
+
+int
+main(int argc, char *argv[])
+{
+    int                i, j, n, skip;
+    int                numTests;       /* Even though the linker knows, we don't. */
+    char       hostname[100];
+    Bool       foundOne = False;
+    Bool       synchronous = False;
+    XGCValues  tgcv;
+    int                screen;
+    int                rop, pm;
+    int                pop, format;
+    int                window_y, window_x;
+    XVisualInfo *vinfolist, vinfotempl;
+    unsigned long vmask;
+
+    /* Save away argv, argc, for usage to print out */
+    saveargc = argc;
+    saveargv = (char **) malloc(argc * sizeof(char *));
+    for (i = 0; i != argc; i++) {
+       saveargv[i] = argv[i];
+    }
+
+    xparms.pack = False;
+    xparms.save_under = False;
+    xparms.backing_store = NotUseful;
+
+    /* Count number of tests */
+    ForEachTest(numTests);
+    doit = (Bool *)calloc(numTests, sizeof(Bool));
+
+    /* Parse arguments */
+    program_name = argv[0];
+    displayName = Get_Display_Name (&argc, argv);
+    xparms.version = GetVersion(&argc, argv);
+    for (i = 1; i != argc; i++) {
+       if (strcmp (argv[i], "-all") == 0) {
+           ForEachTest (j)
+               doit[j] = test[j].versions & xparms.version;
+           foundOne = True;
+       } else if (strcmp (argv[i], "-labels") == 0) {
+           labels = True;
+       } else if (strcmp(argv[i], "-range") == 0) {
+           char *cp1;
+           char *cp2;
+           
+           if (argc <= ++i)
+               usage();
+           cp1 = argv[i];
+           if (*cp1 == '-')
+               cp1++;
+           for (cp2 = cp1; *cp2 != '\0' && *cp2 != ','; cp2++) {};
+           if (*cp2 == ',') {
+               *cp2++ = '\0';
+               if (*cp2 == '-')
+                   cp2++;
+           } else {
+               cp2 = "-";
+           }
+           ForEachTest (j) {
+               if (strcmp (cp1, (test[j].option) + 1) == 0 &&
+                   (test[j].versions & xparms.version)) {
+                   int k = j;
+                   do {
+                       doit[k] = test[j].versions & xparms.version;
+                   } while (!(strcmp(cp2, (test[k].option + 1)) == 0 &&
+                              (test[k].versions & xparms.version)) &&
+                            test[++k].option != NULL);
+                   if (*cp2 != '-' && test[k].option == NULL)
+                       usage();
+                   break;
+               }
+           }
+           if (test[j].option == NULL)
+               usage();
+           foundOne = True;
+       } else if (strcmp (argv[i], "-sync") == 0) {
+           synchronous = True;
+       } else if (strcmp (argv[i], "-pack") == 0) {
+           xparms.pack = True;
+       } else if (strcmp (argv[i], "-draw") == 0) {
+           drawToFakeServer = True;
+        } else if (strcmp (argv[i], "-falseprecision") == 0) {
+            falsePrecision = True;
+       } else if (strcmp (argv[i], "-repeat") == 0) {
+           i++;
+           if (argc <= i)
+               usage ();
+           repeat = atoi (argv[i]);
+           if (repeat <= 0)
+              usage ();
+       } else if (strcmp (argv[i], "-time") == 0) {
+           i++;
+           if (argc <= i)
+               usage ();
+           seconds = atoi (argv[i]);
+           if (seconds <= 0)
+              usage ();
+       } else if (strcmp(argv[i], "-fg") == 0) {
+           i++;
+           if (argc <= i)
+               usage ();
+           foreground = argv[i];
+        } else if (strcmp(argv[i], "-bg") == 0) {
+           i++;
+           if (argc <= i)
+               usage ();
+           background = argv[i];
+           if(ddbackground == NULL)
+               ddbackground = argv[i];
+       } else if (strcmp(argv[i], "-clips") == 0 ) {
+           i++;
+           if (argc <= i)
+               usage ();
+           clips = atoi( argv[i] );
+       } else if (strcmp(argv[i], "-ddbg") == 0) {
+           if (argc <= i)
+               usage ();
+           i++;
+           ddbackground = argv[i];
+       } else if (strcmp(argv[i], "-rop") == 0) {
+           skip = GetRops (i+1, argc, argv, rops, &numRops);
+           i += skip;
+       } else if (strcmp(argv[i], "-pop") == 0) {
+           skip = GetPops (i+1, argc, argv, pops, &numPops);
+           i += skip;
+       } else if (strcmp(argv[i], "-format") == 0) {
+           skip = GetFormats (i+1, argc, argv, formats, &numFormats);
+           i += skip;
+       } else if (strcmp(argv[i], "-pm") == 0) {
+           skip = GetNumbers (i+1, argc, argv, planemasks, &numPlanemasks);
+           i += skip;
+       } else if (strcmp(argv[i], "-xor") == 0) {
+           numRops = 1;
+           rops[0] = GXxor;
+       } else if (strcmp (argv[i], "-both") == 0) {
+           numRops = 2;
+           rops[0] = GXcopy;
+           rops[1] = GXxor;
+       } else if (strcmp(argv[i], "-reps") == 0) {
+           i++;
+           if (argc <= i)
+               usage ();
+           fixedReps = atoi (argv[i]);
+           if (fixedReps <= 0)
+               usage ();
+        } else if (strcmp(argv[i], "-depth") == 0) {
+           i++;
+           if (argc <= i)
+                usage ();
+            depth = atoi(argv[i]);
+            if (depth <= 0)
+               usage ();
+        } else if (strcmp(argv[i], "-vclass") == 0) {
+           i++;
+           if (argc <= i)
+                usage ();
+           for (j = StaticGray; j <= DirectColor; j++) {
+               if (strcmp(argv[i], visualClassNames[j]) == 0) {
+                   vclass = j;
+                   break;
+               }
+           }
+            if (vclass < 0)
+               usage ();
+       } else if (strcmp(argv[i], "-subs") == 0) {
+           skip = GetNumbers (i+1, argc, argv, subWindows, &numSubWindows);
+           i += skip;
+       } else if (strcmp(argv[i], "-v1.2") == 0) {
+           xparms.version = VERSION1_2;
+       } else if (strcmp(argv[i], "-v1.3") == 0) {
+           xparms.version = VERSION1_3;
+       } else if (strcmp(argv[i], "-su") == 0) {
+           xparms.save_under = True;
+       } else if (strcmp(argv[i], "-bs") == 0) {
+           i++;
+           if (argc <= i)
+               usage ();
+           if (strcmp(argv[i], "WhenMapped") == 0) {
+             xparms.backing_store = WhenMapped;
+           } else if (strcmp(argv[i], "Always") == 0) {
+             xparms.backing_store = Always;
+           } else usage ();
+       } else {
+           int len,found;
+           ForEachTest (j) {
+               if (strcmp (argv[i], test[j].option) == 0 &&
+                   (test[j].versions & xparms.version)) {
+                   doit[j] = True;
+                   goto LegalOption;
+               }
+           }
+           found = False;
+           len = strlen(argv[i]);
+           if(len>=3)
+           ForEachTest (j) {
+               if (Strstr (test[j].option, argv[i]+1) != NULL) {
+                   fprintf(stderr,"    -> %s   %s\n", test[j].option, LABELP(j));
+                   doit[j] = found = True;
+               }
+           }
+           if(!found)
+           ForEachTest (j) {
+               if (Strstr (LABELP(j), argv[i]+1) != NULL) {
+                   fprintf(stderr,"    -> %s   %s\n", test[j].option, LABELP(j));
+                   doit[j] = found = True;
+               }
+           }
+           if(!found)
+               usage ();
+       LegalOption: 
+               foundOne = True;
+       }
+    }
+
+    if (labels) {
+       /* Just print out list of tests for use with .sh programs that
+          assemble data from different x11perf runs into a nice format */
+       ForEachTest (i) {
+           int child;
+           if (doit[i]) {
+               switch (test[i].testType) {
+                   case NONROP:
+                       printf ("%s\n", LABELP(i));
+                       break;
+    
+                   case ROP:
+                       /* Run it through all specified rops and planemasks */
+                       for (rop = 0; rop < numRops; rop++) {
+                           for (pm = 0; pm < numPlanemasks; pm++) {
+                               if (planemasks[pm] == ~0) {
+                                   if (rops[rop] == GXcopy) {
+                                       printf ("%s\n", LABELP(i));
+                                   } else {
+                                       printf ("(%s) %s\n",
+                                           ropNames[rops[rop]].name,
+                                           LABELP(i));
+                                   }
+                               } else {
+                                   printf ("(%s 0x%lx) %s\n",
+                                           ropNames[rops[rop]].name,
+                                           planemasks[pm],
+                                           LABELP(i));
+                               }
+                           } /* for pm */
+                       } /* for rop */
+                       break;
+                   
+                   case PLANEMASK:
+                       /* Run it through all specified planemasks */
+                       for (pm = 0; pm < numPlanemasks; pm++) {
+                           if (planemasks[pm] == ~0) {
+                               printf ("%s\n", LABELP(i));
+                           } else {
+                               printf ("(0x%lx) %s\n",
+                                       planemasks[pm],
+                                       LABELP(i));
+                           }
+                       } /* for pm */
+                       break;
+                   
+                   case WINDOW:
+                       for (child = 0; child != numSubWindows; child++) {
+                           printf ("%s (%ld kids)\n",
+                               LABELP(i), subWindows[child]);
+                       }
+                       break;
+                   case COMP:
+                       /* Run it through all specified pops */
+                       for (pop = 0; pop < numPops; pop++) {
+                           if (pops[pop] == PictOpOver) {
+                               printf ("%s\n", LABELP(i));
+                           } else {
+                               printf ("(%s) %s\n",
+                                       popNames[pops[pop]].name,
+                                       LABELP(i));
+                           }
+                       } /* for pop */
+                       break;
+               } /* switch */
+           }
+       }
+       exit(0);
+    }
+
+    if (!foundOne)
+       usage ();
+    xparms.d = Open_Display (displayName);
+    screen = DefaultScreen(xparms.d);
+
+    /* get visual info of default visual */
+    vmask = VisualIDMask | VisualScreenMask;
+    vinfotempl.visualid = XVisualIDFromVisual(XDefaultVisual(xparms.d, screen));
+    vinfotempl.screen = screen;
+    vinfolist = XGetVisualInfo(xparms.d, vmask, &vinfotempl, &n);
+    if (!vinfolist || n != 1) {
+       fprintf (stderr, "%s: can't get visual info of default visual\n",
+           program_name);
+       exit(1);
+    }
+
+    if (depth == -1 && vclass == -1) {
+       /* use the default visual and colormap */
+       xparms.vinfo = *vinfolist;
+       cmap = XDefaultColormap(xparms.d, screen);
+    } else {
+       /* find the specified visual */
+       int errorDepth = vinfolist[0].depth;
+       int errorClass = vinfolist[0].class;
+
+       vmask = VisualScreenMask;
+       vinfotempl.screen = screen;
+       if (depth >= 0) {
+           vinfotempl.depth = depth;
+           vmask |= VisualDepthMask;
+           errorDepth = depth;
+       }
+       if (vclass >= 0) {
+           vinfotempl.class = vclass;
+           vmask |= VisualClassMask;
+           errorClass = vclass;
+       }
+       vinfolist = XGetVisualInfo(xparms.d, vmask, &vinfotempl, &n);
+       if (!vinfolist) {
+           fprintf (stderr,
+               "%s: can't find a visual of depth %d and class %s\n",
+               program_name, errorDepth, visualClassNames[errorClass]);
+           exit(1);
+       }
+       xparms.vinfo = *vinfolist;  /* use the first one in list */
+       if (xparms.vinfo.visualid ==
+           XVisualIDFromVisual(XDefaultVisual(xparms.d, screen))) {
+           /* matched visual is same as default visual */
+           cmap = XDefaultColormap(xparms.d, screen);
+       } else {
+           cmap = XCreateColormap(xparms.d, DefaultRootWindow(xparms.d),
+               xparms.vinfo.visual, AllocNone);
+           /* since this is not default cmap, must force color allocation */
+           if (!foreground) foreground = "Black";
+           if (!background) background = "White";
+           XInstallColormap(xparms.d, cmap);
+       }
+    }
+    xparms.cmap = cmap;
+    
+    printf("x11perf - X11 performance program, version %s\n",
+          xparms.version & VERSION1_5 ? "1.5" :
+          xparms.version & VERSION1_4 ? "1.4" :
+          xparms.version & VERSION1_3 ? "1.3" :
+          "1.2"
+          );
+    XmuGetHostname(hostname, 100);
+    printf ("%s server version %d on %s\nfrom %s\n",
+           ServerVendor (xparms.d), VendorRelease (xparms.d),
+           DisplayString (xparms.d), hostname);
+    PrintTime ();
+
+    /* Force screen out of screen-saver mode, grab current data, and set
+       time to blank to 8 hours.  We should just be able to turn the screen-
+       saver off, but this causes problems on some servers.  We also reset
+       the screen-saver timer each test, as 8 hours is about the maximum time
+       we can use, and that isn't long enough for some X terminals using a
+       serial protocol to finish all the tests.  As long as the tests run to 
+       completion, the old screen-saver values are restored. */
+    XForceScreenSaver(xparms.d, ScreenSaverReset);
+    XGetScreenSaver(xparms.d, &ssTimeout, &ssInterval, &ssPreferBlanking,
+       &ssAllowExposures);
+    (void) signal(SIGINT, Cleanup); /* ^C */
+#ifdef SIGQUIT
+    (void) signal(SIGQUIT, Cleanup);
+#endif
+    (void) signal(SIGTERM, Cleanup);
+#ifdef SIGHUP
+    (void) signal(SIGHUP, Cleanup);
+#endif
+    XSetScreenSaver(xparms.d, 8 * 3600, ssInterval, ssPreferBlanking, 
+       ssAllowExposures);
+
+    if (drawToFakeServer) {
+        tileToQuery =
+           XCreatePixmap(xparms.d, DefaultRootWindow (xparms.d), 32, 32, 1);
+    }
+
+
+    xparms.foreground =
+       AllocateColor(xparms.d, foreground, BlackPixel(xparms.d, screen));
+    xparms.background =
+       AllocateColor(xparms.d, background, WhitePixel(xparms.d, screen));
+    xparms.ddbackground =
+       AllocateColor(xparms.d, ddbackground, WhitePixel(xparms.d, screen));
+    window_x = 2;
+    if (DisplayWidth(xparms.d, screen) < WIDTH + window_x + 1)
+       window_x = -1;
+    window_y = 2;
+    if (DisplayHeight(xparms.d, screen) < HEIGHT + window_y + 1)
+       window_y = -1;
+    xparms.w = CreatePerfWindow(&xparms, window_x, window_y, WIDTH, HEIGHT);
+    HSx = WIDTH-1;
+    if (window_x + 1 + WIDTH > DisplayWidth(xparms.d, screen))
+       HSx = DisplayWidth(xparms.d, screen) - (1 + window_x + 1);
+    HSy = HEIGHT-1;
+    if (window_y + 1 + HEIGHT > DisplayHeight(xparms.d, screen))
+       HSy = DisplayHeight(xparms.d, screen) - (1 + window_y + 1);
+    status = CreatePerfWindow(&xparms, window_x, HEIGHT+5, WIDTH, 20);
+    tgcv.foreground = 
+       AllocateColor(xparms.d, "black", BlackPixel(xparms.d, screen));
+    tgcv.background = 
+       AllocateColor(xparms.d, "white", WhitePixel(xparms.d, screen));
+    tgc = XCreateGC(xparms.d, status, GCForeground | GCBackground, &tgcv);
+   
+    xparms.p = (Pixmap)0;
+
+    if (synchronous)
+       XSynchronize (xparms.d, True);
+
+    /* Get mouse pointer out of the way of the performance window.  On
+       software cursor machines it will slow graphics performance.  On
+       all current MIT-derived servers it will slow window 
+       creation/configuration performance. */
+    XWarpPointer(xparms.d, None, status, 0, 0, 0, 0, WIDTH+32, 20+32);
+
+    /* Figure out how long to call HardwareSync, so we can adjust for that
+       in our total elapsed time */
+    (void) CalibrateTest(&xparms, &syncTest, 1, &syncTime);
+    printf("Sync time adjustment is %6.4f msecs.\n\n", syncTime/1000);
+
+    ForEachTest (i) {
+       int child;
+       char label[200];
+
+       if (doit[i] && (test[i].versions & xparms.version)) {
+           switch (test[i].testType) {
+               case NONROP:
+                   /* Simplest...just run it once */
+                   strcpy (label, LABELP(i));
+                   ProcessTest(&xparms, &test[i], GXcopy, ~0L, label);
+                   break;
+
+               case ROP:
+                   /* Run it through all specified rops and planemasks */
+                   for (rop = 0; rop < numRops; rop++) {
+                       for (pm = 0; pm < numPlanemasks; pm++) {
+                           if (planemasks[pm] == ~0) {
+                               if (rops[rop] == GXcopy) {
+                                   sprintf (label, "%s", LABELP(i));
+                               } else {
+                                   sprintf (label, "(%s) %s",
+                                       ropNames[rops[rop]].name,
+                                       LABELP(i));
+                               }
+                           } else {
+                               sprintf (label, "(%s 0x%lx) %s",
+                                       ropNames[rops[rop]].name,
+                                       planemasks[pm],
+                                       LABELP(i));
+                           }
+                           ProcessTest(&xparms, &test[i], rops[rop],
+                                       planemasks[pm], label);
+                       } /* for pm */
+                   } /* for rop */
+                   break;
+               
+               case PLANEMASK:
+                   /* Run it through all specified planemasks */
+                   for (pm = 0; pm < numPlanemasks; pm++) {
+                       if (planemasks[pm] == ~0) {
+                           sprintf (label, "%s", LABELP(i));
+                       } else {
+                           sprintf (label, "(0x%lx) %s",
+                                   planemasks[pm],
+                                   LABELP(i));
+                       }
+                       ProcessTest(&xparms, &test[i], GXcopy,
+                                   planemasks[pm], label);
+                   } /* for pm */
+                   break;
+               
+               case WINDOW:
+                   /* Loop through number of children array */
+                   for (child = 0; child != numSubWindows; child++) {
+                       test[i].parms.objects = subWindows[child];
+                       sprintf(label, "%s (%d kids)",
+                           LABELP(i), test[i].parms.objects);
+                       ProcessTest(&xparms, &test[i], GXcopy, ~0L, label);
+                   }
+                   break;
+               case COMP:
+                   /* Loop through the composite operands */
+                   for (pop = 0; pop < numPops; pop++) {
+                       for (format = 0; format < numFormats; format++) {
+                           if (formats[format] == PictStandardNative) {
+                               if (pops[pop] == PictOpOver) {
+                                   sprintf (label, "%s", LABELP(i));
+                               } else {
+                                   sprintf (label, "(%s) %s",
+                                            popNames[pops[pop]].name,
+                                            LABELP(i));
+                               }
+                           } else {
+                               sprintf (label, "(%s %s) %s",
+                                       popNames[pops[pop]].name,
+                                       formatNames[formats[format]].name,
+                                       LABELP(i));
+                           }
+                           ProcessTest (&xparms, &test[i], pops[pop], formats[format], label);
+                       }
+                   }
+                   break;
+           } /* switch */
+       } /* if doit */
+    } /* ForEachTest */
+
+    XFreeGC(xparms.d, tgc);
+    XDestroyWindow(xparms.d, xparms.w);
+    XFree(vinfolist);
+    if (drawToFakeServer)
+      XFreePixmap(xparms.d, tileToQuery);
+    /* Restore ScreenSaver to original state. */
+    XSetScreenSaver(xparms.d, ssTimeout, ssInterval, ssPreferBlanking,
+       ssAllowExposures);
+    XCloseDisplay(xparms.d);
+    free(saveargv);
+    free(doit);
+    exit(0);
+}
+
+static int
+GetWords (int argi, int argc, char **argv, char **wordsp, int *nump)
+{
+    int            count;
+
+    if (argc <= argi)
+       usage();
+    count = 0;
+    while (argv[argi] && *(argv[argi]) != '-') {
+       *wordsp++ = argv[argi];
+       ++argi;
+       count++;
+    }
+    *nump = count;
+    return count;
+}
+
+static long
+atox (char *s)
+{
+    long   v, c = 0;
+
+    v = 0;
+    while (*s) {
+       if ('0' <= *s && *s <= '9')
+           c = *s - '0';
+       else if ('a' <= *s && *s <= 'f')
+           c = *s - 'a' + 10;
+       else if ('A' <= *s && *s <= 'F')
+           c = *s - 'A' + 10;
+       v = v * 16 + c;
+       s++;
+    }
+    return v;
+}
+
+static int 
+GetNumbers (int argi, int argc, char **argv, unsigned long *intsp, int *nump)
+{
+    char    *words[256];
+    int            count;
+    int            i;
+    int            flip;
+
+    count = GetWords (argi, argc, argv, words, nump);
+    for (i = 0; i < count; i++) {
+       flip = 0;
+       if (!strncmp (words[i], "~", 1)) {
+           words[i]++;
+           flip = ~0;
+       }
+       if (!strncmp (words[i], "0x", 2))
+           intsp[i] = atox(words[i] + 2) ^ flip;
+       else
+           intsp[i] = atoi (words[i]) ^ flip;
+    }
+    return count;
+}
+
+static int
+GetRops (int argi, int argc, char **argv, int *ropsp, int *nump)
+{
+    char    *words[256];
+    int            count;
+    int            i;
+    int            rop;
+
+    count = GetWords (argi, argc, argv, words, nump);
+    for (i = 0; i < count; i++) {
+       if (!strncmp (words[i], "GX", 2))
+           words[i] += 2;
+       if (!strcmp (words[i], "all")) {
+           for (i = 0; i < NUM_ROPS; i++)
+               ropsp[i] = ropNames[i].rop;
+           *nump = NUM_ROPS;
+           break;
+       }
+       for (rop = 0; rop < NUM_ROPS; rop++) {
+           if (!strcmp (words[i], ropNames[rop].name)) {
+               ropsp[i] = ropNames[rop].rop;
+               break;
+           }
+       }
+       if (rop == NUM_ROPS) {
+           usage ();
+           fprintf (stderr, "unknown rop name %s\n", words[i]);
+       }
+    }
+    return count;
+}
+
+static int
+GetPops (int argi, int argc, char **argv, int *popsp, int *nump)
+{
+    char    *words[256];
+    int            count;
+    int            i;
+    int            pop;
+
+    count = GetWords (argi, argc, argv, words, nump);
+    for (i = 0; i < count; i++) {
+       if (!strncmp (words[i], "PictOp", 6))
+           words[i] += 6;
+       if (!strcmp (words[i], "all")) {
+           for (i = 0; i < NUM_POPS; i++)
+               popsp[i] = popNames[i].rop;
+           *nump = NUM_POPS;
+           break;
+       }
+       for (pop = 0; pop < NUM_POPS; pop++) {
+           if (!strcmp (words[i], popNames[pop].name)) {
+               popsp[i] = popNames[pop].rop;
+               break;
+           }
+       }
+       if (pop == NUM_POPS) {
+           usage ();
+           fprintf (stderr, "unknown picture op name %s\n", words[i]);
+       }
+    }
+    return count;
+}
+
+static int
+GetFormats (int argi, int argc, char **argv, int *formatsp, int *nump)
+{
+    char    *words[256];
+    int            count;
+    int            i;
+    int            format;
+
+    count = GetWords (argi, argc, argv, words, nump);
+    for (i = 0; i < count; i++) {
+       if (!strcmp (words[i], "all")) {
+           for (i = 0; i < NUM_FORMATS; i++)
+               formatsp[i] = formatNames[i].rop;
+           *nump = NUM_FORMATS;
+           break;
+       }
+       for (format = 0; format < NUM_FORMATS; format++) {
+           if (!strcmp (words[i], formatNames[format].name)) {
+               formatsp[i] = formatNames[format].rop;
+               break;
+           }
+       }
+       if (format == NUM_FORMATS) {
+           usage ();
+           fprintf (stderr, "unknown format name %s\n", words[i]);
+       }
+    }
+    return count;
+}
diff --git a/x11perf/x11perf.h b/x11perf/x11perf.h
new file mode 100755 (executable)
index 0000000..597b1f7
--- /dev/null
@@ -0,0 +1,380 @@
+/*****************************************************************************
+Copyright 1988, 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.
+
+******************************************************************************/
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifndef VMS
+#include <X11/Xlib.h>
+#include <stdlib.h>
+#include <X11/Xutil.h>
+#else
+#include <decw$include/Xlib.h>
+#include <decw$include/Xutil.h>
+#endif
+#if defined(XlibSpecificationRelease) && XlibSpecificationRelease >= 5
+#include <X11/Xfuncs.h>
+#endif
+#include <stddef.h>
+#include <X11/extensions/Xrender.h>
+
+#define POLY        1000       /* # (small) items in poly calls        */
+#define MAXROWS               40       /* Max rows of items in poly calls      */
+#define MAXCOLS               25       /* Max columns of items                 */
+
+#define WIDTH         600      /* Size of large window to work within  */
+#define HEIGHT        600
+
+#define CHILDSIZE       8       /* Size of children on windowing tests  */
+#define CHILDSPACE      4       /* Space between children              */
+
+#define BigTile        ((char *)2)             /* Big tile/stipple */
+#define OddTile        ((char *)1)             /* Odd sized tile/stipple */
+
+#define PictStandardNative    5
+
+typedef unsigned char Version;
+
+#define VERSION1_2  ((Version)(1 << 0))
+#define VERSION1_3  ((Version)(1 << 1))
+#define VERSION1_4  ((Version)(1 << 2))
+#define VERSION1_5  ((Version)(1 << 3))
+#define VERSION1_6  ((Version)(1 << 4))
+#define V1_2ONLY VERSION1_2
+#define V1_2FEATURE    (VERSION1_2 | VERSION1_3 | VERSION1_4 | VERSION1_5 | VERSION1_6)
+#define V1_3FEATURE    (VERSION1_3 | VERSION1_4 | VERSION1_5 | VERSION1_6)
+#define V1_4FEATURE    (VERSION1_4 | VERSION1_5 | VERSION1_6)
+#define V1_5FEATURE     (VERSION1_5 | VERSION1_6)
+#define V1_6FEATURE     (VERSION1_6)
+
+typedef struct _Parms {
+    /* Required fields */
+    int  objects;       /* Number of objects to process in one X call      */
+
+    /* Optional fields.  (Wouldn't object-oriented programming be nice ?)   */
+    int  special;       /* Usually size of objects to paint                */
+    char *font, *bfont;
+    int  fillStyle;     /* Solid, transparent stipple, opaque stipple, tile */
+} ParmRec, *Parms;
+
+typedef struct _XParms {
+    Display        *d;
+    Window         w;
+    Pixmap          p;
+    GC             fggc;
+    GC             bggc;
+    GC             ddfggc;
+    GC             ddbggc;
+    Picture        w_picture;
+    Picture        p_picture;
+    unsigned long   foreground;
+    unsigned long   background;
+    unsigned long   ddbackground;
+    XVisualInfo     vinfo;
+    Bool           pack;
+    Version        version;
+    Bool           save_under;
+    int                    backing_store;
+    unsigned long   planemask;
+    int                    func;
+    int                    format;
+    Colormap       cmap;
+} XParmRec, *XParms;
+
+typedef int (*InitProc)(XParms xp, Parms p, int reps);
+typedef void (*Proc)(XParms xp, Parms p, int reps);
+typedef void (*CleanupProc)(XParms xp, Parms p);
+
+typedef enum {
+    WINDOW,     /* Windowing test, rop, planemask have no affect       */
+    ROP,       /* Graphics test, rop, planemask has some affect        */
+    PLANEMASK,  /* Graphics test, rop no affect, planemask some affect  */
+    NONROP,     /* Graphics or overhead test, rop has no affect                */
+    COMP        /* Graphics test, render op                             */
+} TestType;
+
+typedef struct _Test {
+    char       *option;    /* Name to use in prompt line                   */
+    char       *label;     /* Fuller description of test                   */
+    char       *label14;   /* Labels that are different in Version 1.4     */
+    InitProc    init;       /* Initialization procedure                            */
+    Proc       proc;       /* Timed benchmark procedure                    */
+    CleanupProc        passCleanup;/* Cleanup between repetitions of same test     */
+    CleanupProc        cleanup;    /* Cleanup after test                           */
+    Version     versions;   /* Test in 1.2 only, 1.3 only, or both         */
+    TestType    testType;   /* Windowing, graphics rop, graphics non-rop    */
+    int                clips;      /* Number of obscuring windows to force clipping*/
+    ParmRec     parms;      /* Parameters passed to test procedures        */
+} Test;
+
+extern void NullProc(XParms xp, Parms p);
+extern int NullInitProc(XParms xp, Parms p, int reps);
+
+extern Test test[];
+
+extern int abortTest;
+
+extern void AbortTest (void);
+
+#define CheckAbort()  if (abortTest) AbortTest ()
+#define ForEachTest(x) for (x = 0; test[x].option != NULL; x++)
+
+
+/* do_arcs.c */
+extern int InitCircles ( XParms xp, Parms p, int reps );
+extern int InitPartCircles ( XParms xp, Parms p, int reps );
+extern int InitChordPartCircles ( XParms xp, Parms p, int reps );
+extern int InitSlicePartCircles ( XParms xp, Parms p, int reps );
+extern int InitWideCircles ( XParms xp, Parms p, int reps );
+extern int InitPartWideCircles ( XParms xp, Parms p, int reps );
+extern int InitDashedCircles ( XParms xp, Parms p, int reps );
+extern int InitWideDashedCircles ( XParms xp, Parms p, int reps );
+extern int InitDoubleDashedCircles ( XParms xp, Parms p, int reps );
+extern int InitWideDoubleDashedCircles ( XParms xp, Parms p, int reps );
+extern int InitEllipses ( XParms xp, Parms p, int reps );
+extern int InitPartEllipses ( XParms xp, Parms p, int reps );
+extern int InitChordPartEllipses ( XParms xp, Parms p, int reps );
+extern int InitSlicePartEllipses ( XParms xp, Parms p, int reps );
+extern int InitWideEllipses ( XParms xp, Parms p, int reps );
+extern int InitPartWideEllipses ( XParms xp, Parms p, int reps );
+extern int InitDashedEllipses ( XParms xp, Parms p, int reps );
+extern int InitWideDashedEllipses ( XParms xp, Parms p, int reps );
+extern int InitDoubleDashedEllipses ( XParms xp, Parms p, int reps );
+extern int InitWideDoubleDashedEllipses ( XParms xp, Parms p, int reps );
+extern void DoArcs ( XParms xp, Parms p, int reps );
+extern void DoFilledArcs ( XParms xp, Parms p, int reps );
+extern void EndArcs ( XParms xp, Parms p );
+
+/* do_blt.c */
+extern int InitScroll ( XParms xp, Parms p, int reps );
+extern void DoScroll ( XParms xp, Parms p, int reps );
+extern void MidScroll ( XParms xp, Parms p );
+extern void EndScroll ( XParms xp, Parms p );
+extern int InitCopyWin ( XParms xp, Parms p, int reps );
+extern int InitCopyPix ( XParms xp, Parms p, int reps );
+extern int InitGetImage ( XParms xp, Parms p, int reps );
+extern int InitPutImage ( XParms xp, Parms p, int reps );
+extern void DoCopyWinWin ( XParms xp, Parms p, int reps );
+extern void DoCopyPixWin ( XParms xp, Parms p, int reps );
+extern void DoCopyWinPix ( XParms xp, Parms p, int reps );
+extern void DoCopyPixPix ( XParms xp, Parms p, int reps );
+extern void DoGetImage ( XParms xp, Parms p, int reps );
+extern void DoPutImage ( XParms xp, Parms p, int reps );
+#ifdef MITSHM
+extern int InitShmPutImage ( XParms xp, Parms p, int reps );
+extern void DoShmPutImage ( XParms xp, Parms p, int reps );
+extern void EndShmPutImage ( XParms xp, Parms p );
+#endif
+extern void MidCopyPix ( XParms xp, Parms p );
+extern void EndCopyWin ( XParms xp, Parms p );
+extern void EndCopyPix ( XParms xp, Parms p );
+extern void EndGetImage ( XParms xp, Parms p );
+extern int InitCopyPlane ( XParms xp, Parms p, int reps );
+extern void DoCopyPlane ( XParms xp, Parms p, int reps );
+
+int
+InitCompositeWin(XParms xp, Parms p, int reps);
+
+void
+EndCompositeWin (XParms xp, Parms p);
+
+void
+DoCompositeWinWin (XParms xp, Parms p, int reps);
+
+int
+InitCompositePix(XParms xp, Parms p, int reps);
+
+void
+EndCompositePix (XParms xp, Parms p);
+
+void
+DoCompositePixWin (XParms xp, Parms p, int reps);
+
+/* do_complex.c */
+extern int InitComplexPoly ( XParms xp, Parms p, int reps );
+extern void DoComplexPoly ( XParms xp, Parms p, int reps );
+extern void EndComplexPoly ( XParms xp, Parms p );
+extern int InitGeneralPoly ( XParms xp, Parms p, int reps );
+extern void DoGeneralPoly ( XParms xp, Parms p, int reps );
+
+/* do_dots.c */
+extern int InitDots ( XParms xp, Parms p, int reps );
+extern void DoDots ( XParms xp, Parms p, int reps );
+extern void EndDots ( XParms xp, Parms p );
+
+/* do_lines.c */
+extern int InitLines ( XParms xp, Parms p, int reps );
+extern int InitWideLines ( XParms xp, Parms p, int reps );
+extern int InitDashedLines ( XParms xp, Parms p, int reps );
+extern int InitWideDashedLines ( XParms xp, Parms p, int reps );
+extern int InitDoubleDashedLines ( XParms xp, Parms p, int reps );
+extern int InitWideDoubleDashedLines ( XParms xp, Parms p, int reps );
+extern void DoLines ( XParms xp, Parms p, int reps );
+extern void EndLines ( XParms xp, Parms p );
+
+/* do_movewin.c */
+extern int InitMoveWindows ( XParms xp, Parms p, int reps );
+extern void DoMoveWindows ( XParms xp, Parms p, int reps );
+extern void EndMoveWindows ( XParms xp, Parms p );
+extern void DoResizeWindows ( XParms xp, Parms p, int reps );
+extern int InitCircWindows ( XParms xp, Parms p, int reps );
+extern void DoCircWindows ( XParms xp, Parms p, int reps );
+extern void EndCircWindows ( XParms xp, Parms p );
+extern int InitMoveTree ( XParms xp, Parms p, int reps );
+extern void DoMoveTree ( XParms xp, Parms p, int reps );
+extern void EndMoveTree ( XParms xp, Parms p );
+
+/* do_rects.c */
+extern int InitRectangles ( XParms xp, Parms p, int reps );
+extern void DoRectangles ( XParms xp, Parms p, int reps );
+extern void DoOutlineRectangles ( XParms xp, Parms p, int reps );
+extern void EndRectangles ( XParms xp, Parms p );
+
+/* do_segs.c */
+extern int InitSegments ( XParms xp, Parms p, int reps );
+extern int InitDashedSegments ( XParms xp, Parms p, int reps );
+extern int InitDoubleDashedSegments ( XParms xp, Parms p, int reps );
+extern int InitHorizSegments ( XParms xp, Parms p, int reps );
+extern int InitWideHorizSegments ( XParms xp, Parms p, int reps );
+extern int InitVertSegments ( XParms xp, Parms p, int reps );
+extern int InitWideVertSegments ( XParms xp, Parms p, int reps );
+extern void DoSegments ( XParms xp, Parms p, int reps );
+extern void EndSegments ( XParms xp, Parms p );
+
+/* do_simple.c */
+extern void DoNoOp ( XParms xp, Parms p, int reps );
+extern void DoGetAtom ( XParms xp, Parms p, int reps );
+extern void DoQueryPointer ( XParms xp, Parms p, int reps );
+extern int InitGetProperty ( XParms xp, Parms p, int reps );
+extern void DoGetProperty ( XParms xp, Parms p, int reps );
+
+/* do_text.c */
+extern int InitText ( XParms xp, Parms p, int reps );
+extern int InitText16 ( XParms xp, Parms p, int reps );
+extern void DoText ( XParms xp, Parms p, int reps );
+extern void DoText16 ( XParms xp, Parms p, int reps );
+extern void DoPolyText ( XParms xp, Parms p, int reps );
+extern void DoPolyText16 ( XParms xp, Parms p, int reps );
+extern void DoImageText ( XParms xp, Parms p, int reps );
+extern void DoImageText16 ( XParms xp, Parms p, int reps );
+extern void ClearTextWin ( XParms xp, Parms p );
+extern void EndText ( XParms xp, Parms p );
+extern void EndText16 ( XParms xp, Parms p );
+#ifdef XFT
+extern int InitAAText (XParms xp, Parms p, int reps );
+extern void DoAAText (XParms xp, Parms p, int reps );
+extern void EndAAText ( XParms xp, Parms p );
+#endif
+
+/* do_traps.c */
+extern int InitTrapezoids ( XParms xp, Parms p, int reps );
+extern void DoTrapezoids ( XParms xp, Parms p, int reps );
+extern void EndTrapezoids ( XParms xp, Parms p );
+#ifdef XRENDER
+extern int InitFixedTraps ( XParms xp, Parms p, int reps );
+extern void DoFixedTraps ( XParms xp, Parms p, int reps );
+extern void EndFixedTraps ( XParms xp, Parms p );
+extern int InitFixedTrapezoids ( XParms xp, Parms p, int reps );
+extern void DoFixedTrapezoids ( XParms xp, Parms p, int reps );
+extern void EndFixedTrapezoids ( XParms xp, Parms p );
+#endif
+
+/* do_tris.c */
+extern int InitTriangles ( XParms xp, Parms p, int reps );
+extern void DoTriangles ( XParms xp, Parms p, int reps );
+extern void EndTriangles ( XParms xp, Parms p );
+
+/* do_valgc.c */
+extern int InitGC ( XParms xp, Parms p, int reps );
+extern void DoChangeGC ( XParms xp, Parms p, int reps );
+extern void EndGC ( XParms xp, Parms p );
+
+/* do_windows.c */
+extern int CreateParents ( XParms xp, Parms p, int reps );
+extern void MapParents ( XParms xp, Parms p, int reps );
+extern void MapParentsCleanup ( XParms xp, Parms p );
+extern int InitCreate ( XParms xp, Parms p, int reps );
+extern void CreateChildren ( XParms xp, Parms p, int reps );
+extern void DestroyChildren ( XParms xp, Parms p );
+extern void EndCreate ( XParms xp, Parms p );
+extern int InitMap ( XParms xp, Parms p, int reps );
+extern void UnmapParents ( XParms xp, Parms p, int reps );
+extern void UnmapParentsCleanup ( XParms xp, Parms p);
+extern int InitDestroy ( XParms xp, Parms p, int reps );
+extern void DestroyParents ( XParms xp, Parms p, int reps );
+extern void RenewParents ( XParms xp, Parms p );
+extern int InitPopups ( XParms xp, Parms p, int reps );
+extern void DoPopUps ( XParms xp, Parms p, int reps );
+extern void EndPopups ( XParms xp, Parms p );
+
+
+/*****************************************************************************
+
+About x11perf:
+
+Many graphics benchmarks assume that the graphics device is used to display the
+output of a single fancy graphics application, and that the user gets his work
+done on some other device, like a terminal.  Such benchmarks usually measure
+drawing speed for lines, polygons, text, etc.
+
+Since workstations are not used as standalone graphics engines, but as
+super-terminals, x11perf measures window management performance as well as
+traditional graphics performace.  x11perf includes benchmarks for the time it
+takes to create and map windows (as when you start up an application); to map a
+pre-existing set of windows onto the screen (as when you deiconify an
+application or pop up a menu); and to rearrange windows (as when you slosh
+windows to and fro trying to find the one you want).
+
+x11perf also measures graphics performance for operations not normally used in
+standalone graphics displays, but are nonetheless used frequently by X
+applications.  Such operations include CopyPlane (used by the PostScript
+previewer), scrolling (used in text windows), and various stipples and tiles
+(used for CAD and half-toning, respectively).
+
+x11perf DOES NOT attempt to whittle down measurements to a single ``HeXStones''
+number.  We consider such numbers to be uninformative at best and misleading at
+worst.  x11perf should be used to analyze particular strengths and weaknesses
+of servers, and is most useful when used by a server writer who wants to
+analyze and improve a server.
+
+For repeatable results, x11perf should be run using a local connection on a
+freshly-started server.  The default configuration runs each test 5 times, in
+order to see if each trial takes approximately the same amount of time.
+Strange glitches should be examined; if non-repeatable I chalk them up to
+daemons and network traffic.  Each trial is run for 5 seconds, in order to
+reduce random time differences.  The number of objects processed per second is
+displayed to 3 significant digits, but you'll be lucky on most UNIX system if
+the numbers are actually consistent to 2 digits.
+
+The current program is mostly the responsibility of Joel McCormack.  It is
+based upon the x11perf developed by Phil Karlton, Susan Angebranndt, and Chris
+Kent, who wanted to assess performance differences between various servers.
+Mary Walker, Todd Newman, and I added several tests in order to write and tune
+the pmax (DECStation 3100) servers.  For a general release to the world, I've
+basically rewritten x11perf to ease making comparisons between widely varying
+machines, to cover most important X functionality (the notable exception being
+wide lines), and to exercise graphics operations in as many different
+orientations and alignments as possible.
+
+******************************************************************************/
diff --git a/x11perf/x11perf.man b/x11perf/x11perf.man
new file mode 100755 (executable)
index 0000000..b1e7be2
--- /dev/null
@@ -0,0 +1,1016 @@
+.\" Copyright 1988, 1989 Digital Equipment Corporation.
+.\" Copyright 1989, 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.
+.\"
+.\"
+.TH X11PERF 1 __xorgversion__
+.SH NAME
+x11perf \- X11 server performance test program
+.SH SYNTAX
+.B x11perf
+[ \-option ... ]
+.SH DESCRIPTION
+The
+.I x11perf
+program runs one or more performance tests and reports how fast an X server can
+execute the tests.
+.PP
+Many graphics benchmarks assume that the graphics device is used to display the
+output of a single fancy graphics application, and that the user gets his work
+done on some other device, like a terminal.  Such benchmarks usually measure
+drawing speed for lines, polygons, text, etc.
+.PP
+Since workstations are not used as standalone graphics engines, but as
+super-terminals, 
+.I x11perf 
+measures window management performance as well as
+traditional graphics performance.  
+.I x11perf 
+includes benchmarks for the time it
+takes to create and map windows (as when you start up an application); to map a
+pre-existing set of windows onto the screen (as when you deiconify an
+application or pop up a menu); and to rearrange windows (as when you slosh
+windows to and fro trying to find the one you want).
+.PP
+.I x11perf 
+also measures graphics performance for operations not normally used in
+standalone graphics displays, but are nonetheless used frequently by X
+applications.  Such operations include CopyPlane (used to map bitmaps into
+pixels), scrolling (used in text windows), and various stipples and tiles
+(used for CAD and color half-toning, respectively).
+.PP
+.I x11perf 
+should be used to analyze particular strengths and weaknesses
+of servers, and is most useful to a server writer who wants to
+analyze and improve a server.
+.I x11perf
+is meant to comprehensively exercise just about every X11 operation you can
+perform; it does not purport to be a representative sample of the
+operations that X11 applications actually use.
+While it can be used as a benchmark, it was written and is intended as
+a performance testing tool.
+.PP
+As such,
+.I x11perf 
+DOES NOT whittle down measurements to a single ``HeXStones''
+or ``MeXops'' number.  We consider such numbers to be uninformative 
+at best and misleading at worst.  
+Some servers which are very fast for certain applications can be
+very slow for others.
+No single number or small set of numbers are sufficient to
+characterize how an X implementation will perform on all applications.
+However, by knowledge of your favorite application, you
+may be able to use the numbers
+.I x11perf
+reports to predict its performance on a given X implementation.
+.PP
+That said, you might also want to look at
+.I x11perfcomp(1),
+a program to compare the outputs of different 
+.I x11perf
+runs.  You provide a list of files containing results from
+.I x11perf,
+and it lays them out in a nice tabular format.
+.PP
+For repeatable results, 
+.I x11perf 
+should be run using a local connection on a
+freshly-started server.  The default configuration runs each test 5 times, in
+order to see if each trial takes approximately the same amount of time.
+Strange glitches should be examined; if non-repeatable one might
+chalk them up to
+daemons and network traffic.  Each trial is run for 5 seconds, in order to
+reduce random time differences.  The number of objects processed per second is
+displayed to 3 significant digits, but you'll be lucky on most UNIX system if
+the numbers are actually consistent to 2 digits.
+.I x11perf
+moves the cursor out of the test window; you should be careful not
+to bump the mouse and move it back into the window.
+(A prize to people who correctly explain why!!).
+.PP
+Before running a test,
+.I x11perf
+determines what the round trip time to the server is, and factors this out of
+the final timing reported.  It ensures that the server has actually performed
+the work requested by fetching a pixel back from the test window, which means
+that servers talking to graphics accelerators can't claim that they are done,
+while in the meantime the accelerator is painting madly.
+.PP
+By default 
+.I x11perf
+automatically calibrates the number of repetitions of each test,
+so that each should take approximately the same length of time to run across
+servers of widely differing speeds.  However, since each test must be run to
+completion at least once, some slow servers may take a very long time,
+particularly on the window moving and resizing tests, and on the arc drawing
+tests.
+.PP
+All timing reports are for the smallest object involved.  For example, the line
+tests use a PolyLine request to paint several lines at once, but report how
+many lines per second the server can paint, not how many PolyLine requests per
+second.  Text tests paint a line of characters, but report on the number of
+characters per second.  Some window tests map, unmap, or move a single parent
+window, but report on how many children windows per second the server can map,
+unmap, or move.
+.PP
+The current program is mostly the responsibility of Joel McCormack.  It is
+based upon the x11perf developed by Phil Karlton, Susan Angebranndt, Chris
+Kent, Mary Walker, and Todd Newman, who wanted to assess performance differences between various servers.
+Several tests were added  in order to write and tune
+the PMAX (DECStation 3100) servers.  
+For a general release to the world, 
+.I x11perf 
+was rewritten to ease making comparisons between widely varying
+machines, to cover most important (and unimportant) X functionality,
+and to exercise graphics operations in as many different
+orientations and alignments as possible.
+.SH OPTIONS
+.I x11perf 
+is solely Xlib based, and
+accepts the options listed below:
+.TP 14
+.B \-display host:dpy
+Specifies which display to use.
+.TP 14
+.B \-sync
+Runs the tests in synchronous mode.
+Normally only useful for debugging 
+.I x11perf .
+.TP 14
+.B \-pack
+Runs rectangle tests so that they pack rectangles right next to each other.
+This makes it easy to debug server code for stipples and tiles...if the
+pattern looks ugly, you've got alignment problems.
+.TP 14
+.B \-repeat \fI<n>\fP
+Repeats each test 
+.I n
+times (by default each test is run 5 times).
+.TP 14
+.B \-time \fI<s>\fP
+Specifies how long in seconds each test should be run (default 5 seconds).
+.TP 14
+.B \-all
+Runs all tests.  This may take a while.
+.TP 14
+.B \-range \fI<test1>\fP[,\fI<test2>\fP]
+Runs all the tests starting from the specified name \fItest1\fP until
+the name \fItest2\fP, including both the specified tests. The testnames
+should be one of the options starting from -dot. (eg) -range line100
+will perform the tests from the 100 pixel line test, and go on till the
+last test, -range line100,dline10 will do the tests from line100 to
+dline10.
+.TP 14
+.B \-labels
+Generates just the descriptive labels for each test specified.  See
+.I x11perfcomp
+for more details.
+.TP 14
+.B \-fg \fIcolor-or-pixel\fP
+Specifies the foreground color or pixel value to use.
+.TP 14
+.B \-bg \fIcolor-or-pixel\fP
+Specifies the background color or pixel value to use.
+.TP 14
+.B \-clips \fIdefault\fP
+Default number of clip windows.
+.TP 14
+.B \-ddbg \fIcolor-or-pixel\fP
+Specifies the color or pixel value to use for drawing
+the odd segments of a DoubleDashed line or arc.
+This will default to the bg color.
+.TP 14
+.B \-rop <rop0 rop1 ...>
+Use specified raster ops (default is GXcopy).
+This option only affects graphics
+benchmarks in which the graphics function is actually used.
+.TP 14
+.B \-pm <pm0 pm1 ...>
+Use specified planemasks (default is ~0).
+This option only affects graphics
+benchmarks in which the planemask is actually used.
+.TP 14
+.B \-depth <depth>
+Use a visual with <depth> planes per pixel (default is the default
+visual).
+.TP 14
+.B \-vclass <vclass>
+Use a visual with of class <vclass>.  <vclass> can be StaticGray, GrayScale,
+StaticColor, PseudoColor, TrueColor, or DirectColor.  (default is the default
+visual).
+.TP 14
+.B \-reps <n>
+Specify the repetition count (Default is number that takes approx. 5 seconds)
+.TP 14
+.B \-subs <s0 s1 ...>
+Specify the number of sub windows to use in the Window tests.
+Default is  4, 16, 25, 50, 75, 100 and 200.
+.TP 14
+.B \-v1.2
+Perform only x11perf Version 1.2 tests using Version 1.2 semantics.
+.TP 14
+.B \-v1.3
+Perform only x11perf Version 1.3 tests using Version 1.3 semantics.
+.TP 14
+.B \-su
+Set the save_under window attribute to True on all windows created by x11perf.
+Default is False.
+.TP 14
+.B \-bs <backing_store_hint>
+Set the backing_store window attribute to the given value on all windows 
+created by x11perf. <backing_store_hint> can be WhenMapped or 
+Always.  Default is NotUseful.
+.TP 14
+.B \-dot
+Dot.
+.TP 14
+.B \-rect1
+1x1 solid-filled rectangle.
+.TP 14
+.B \-rect10
+10x10 solid-filled rectangle.
+.TP 14
+.B \-rect100
+100x100 solid-filled rectangle.
+.TP 14
+.B \-rect500
+500x500 solid-filled rectangle.
+.TP 14
+.B \-srect1
+1x1 transparent stippled rectangle, 8x8 stipple pattern.
+.TP 14
+.B \-srect10
+10x10 transparent stippled rectangle, 8x8 stipple pattern.
+.TP 14
+.B \-srect100
+100x100 transparent stippled rectangle, 8x8 stipple pattern.
+.TP 14
+.B \-srect500
+500x500 transparent stippled rectangle, 8x8 stipple pattern.
+.TP 14
+.B \-osrect1
+1x1 opaque stippled rectangle, 8x8 stipple pattern.
+.TP 14
+.B \-osrect10
+10x10 opaque stippled rectangle, 8x8 stipple pattern.
+.TP 14
+.B \-osrect100
+100x100 opaque stippled rectangle, 8x8 stipple pattern.
+.TP 14
+.B \-osrect500
+500x500 opaque stippled rectangle, 8x8 stipple pattern.
+.TP 14
+.B \-tilerect1
+1x1 tiled rectangle, 4x4 tile pattern.
+.TP 14
+.B \-tilerect10
+10x10 tiled rectangle, 4x4 tile pattern.
+.TP 14
+.B \-tilerect100
+100x100 tiled rectangle, 4x4 tile pattern.
+.TP 14
+.B \-tilerect500
+500x500 tiled rectangle, 4x4 tile pattern.
+.TP 14
+.B \-oddsrect1
+1x1 transparent stippled rectangle, 17x15 stipple pattern.
+.TP 14
+.B \-oddsrect10
+10x10 transparent stippled rectangle, 17x15 stipple pattern.
+.TP 14
+.B \-oddsrect100
+100x100 transparent stippled rectangle, 17x15 stipple pattern.
+.TP 14
+.B \-oddsrect500
+500x500 transparent stippled rectangle, 17x15 stipple pattern.
+.TP 14
+.B \-oddosrect1
+1x1 opaque stippled rectangle, 17x15 stipple pattern.
+.TP 14
+.B \-oddosrect10
+10x10 opaque stippled rectangle, 17x15 stipple pattern.
+.TP 14
+.B \-oddosrect100
+100x100 opaque stippled rectangle, 17x15 stipple pattern.
+.TP 14
+.B \-oddosrect500
+500x500 opaque stippled rectangle, 17x15 stipple pattern.
+.TP 14
+.B \-oddtilerect1
+1x1 tiled rectangle, 17x15 tile pattern.
+.TP 14
+.B \-oddtilerect10
+10x10 tiled rectangle, 17x15 tile pattern.
+.TP 14
+.B \-oddtilerect100
+100x100 tiled rectangle, 17x15 tile pattern.
+.TP 14
+.B \-oddtilerect500
+500x500 tiled rectangle, 17x15 tile pattern.
+.TP 14
+.B \-bigsrect1
+1x1 stippled rectangle, 161x145 stipple pattern.
+.TP 14
+.B \-bigsrect10
+10x10 stippled rectangle, 161x145 stipple pattern.
+.TP 14
+.B \-bigsrect100
+100x100 stippled rectangle, 161x145 stipple pattern.
+.TP 14
+.B \-bigsrect500
+500x500 stippled rectangle, 161x145 stipple pattern.
+.TP 14
+.B \-bigosrect1
+1x1 opaque stippled rectangle, 161x145 stipple pattern.
+.TP 14
+.B \-bigosrect10
+10x10 opaque stippled rectangle, 161x145 stipple pattern.
+.TP 14
+.B \-bigosrect100
+100x100 opaque stippled rectangle, 161x145 stipple pattern.
+.TP 14
+.B \-bigosrect500
+500x500 opaque stippled rectangle, 161x145 stipple pattern.
+.TP 14
+.B \-bigtilerect1
+1x1 tiled rectangle, 161x145 tile pattern.
+.TP 14
+.B \-bigtilerect10
+10x10 tiled rectangle, 161x145 tile pattern.
+.TP 14
+.B \-bigtilerect100
+100x100 tiled rectangle, 161x145 tile pattern.
+.TP 14
+.B \-bigtilerect500
+500x500 tiled rectangle, 161x145 tile pattern.
+.TP 14
+.B \-eschertilerect1
+1x1 tiled rectangle, 215x208 tile pattern.
+.TP 14
+.B \-eschertilerect10
+10x10 tiled rectangle, 215x208 tile pattern.
+.TP 14
+.B \-eschertilerect100
+100x100 tiled rectangle, 215x208 tile pattern.
+.TP 14
+.B \-eschertilerect500
+500x500 tiled rectangle, 215x208 tile pattern.
+.TP 14
+.B \-seg1
+1-pixel thin line segment.
+.TP 14
+.B \-seg10
+10-pixel thin line segment.
+.TP 14
+.B \-seg100
+100-pixel thin line segment.
+.TP 14
+.B \-seg500
+500-pixel thin line segment.
+.TP 14
+.B \-seg100c1
+100-pixel thin line segment (1 obscuring rectangle).
+.TP 14
+.B \-seg100c2
+100-pixel thin line segment (2 obscuring rectangles).
+.TP 14
+.B \-seg100c3
+100-pixel thin line segment (3 obscuring rectangles).
+.TP 14
+.B \-dseg10
+10-pixel thin dashed segment (3 on, 2 off).
+.TP 14
+.B \-dseg100
+100-pixel thin dashed segment (3 on, 2 off).
+.TP 14
+.B \-ddseg100
+100-pixel thin double-dashed segment (3 fg, 2 bg).
+.TP 14
+.B \-hseg10
+10-pixel thin horizontal line segment.
+.TP 14
+.B \-hseg100
+100-pixel thin horizontal line segment.
+.TP 14
+.B \-hseg500
+500-pixel thin horizontal line segment.
+.TP 14
+.B \-vseg10
+10-pixel thin vertical line segment.
+.TP 14
+.B \-vseg100
+100-pixel thin vertical line segment.
+.TP 14
+.B \-vseg500
+500-pixel thin vertical line segment.
+.TP 14
+.B \-whseg10
+10-pixel wide horizontal line segment.
+.TP 14
+.B \-whseg100
+100-pixel wide horizontal line segment.
+.TP 14
+.B \-whseg500
+500-pixel wide horizontal line segment.
+.TP 14
+.B \-wvseg10
+10-pixel wide vertical line segment.
+.TP 14
+.B \-wvseg100
+100-pixel wide vertical line segment.
+.TP 14
+.B \-wvseg500
+500-pixel wide vertical line segment.
+.TP 14
+.B \-line1
+1-pixel thin (width 0) line.
+.TP 14
+.B \-line10
+10-pixel thin line.
+.TP 14
+.B \-line100
+100-pixel thin line.
+.TP 14
+.B \-line500
+500-pixel thin line.
+.TP 14
+.B \-dline10
+10-pixel thin dashed line (3 on, 2 off).
+.TP 14
+.B \-dline100
+100-pixel thin dashed line (3 on, 2 off).
+.TP 14
+.B \-ddline100
+100-pixel thin double-dashed line (3 fg, 2 bg).
+.TP 14
+.B \-wline10
+10-pixel line, line width 1.
+.TP 14
+.B \-wline100
+100-pixel line, line width 10.
+.TP 14
+.B \-wline500
+500-pixel line, line width 50.
+.TP 14
+.B \-wdline100
+100-pixel dashed line, line width 10 (30 on, 20 off).
+.TP 14
+.B \-wddline100
+100-pixel double-dashed line, line width 10 (30 fg, 20 bg).
+.TP 14
+.B \-orect10
+10x10 thin rectangle outline.
+.TP 14
+.B \-orect100
+100-pixel thin vertical line segment.
+.TP 14
+.B \-orect500
+500-pixel thin vertical line segment.
+.TP 14
+.B \-worect10
+10x10 wide rectangle outline.
+.TP 14
+.B \-worect100
+100-pixel wide vertical line segment.
+.TP 14
+.B \-worect500
+500-pixel wide vertical line segment.
+.TP 14
+.B \-circle1
+1-pixel diameter thin (line width 0) circle.
+.TP 14
+.B \-circle10
+10-pixel diameter thin circle.
+.TP 14
+.B \-circle100
+100-pixel diameter thin circle.
+.TP 14
+.B \-circle500
+500-pixel diameter thin circle.
+.TP 14
+.B \-dcircle100
+100-pixel diameter thin dashed circle (3 on, 2 off).
+.TP 14
+.B \-ddcircle100
+100-pixel diameter thin double-dashed circle (3 fg, 2 bg).
+.TP 14
+.B \-wcircle10
+10-pixel diameter circle, line width 1.
+.TP 14
+.B \-wcircle100
+100-pixel diameter circle, line width 10.
+.TP 14
+.B \-wcircle500
+500-pixel diameter circle, line width 50.
+.TP 14
+.B \-wdcircle100
+100-pixel diameter dashed circle, line width 10 (30 on, 20 off).
+.TP 14
+.B \-wddcircle100
+100-pixel diameter double-dashed circle, line width 10 (30 fg, 20 bg).
+.TP 14
+.B \-pcircle10
+10-pixel diameter thin partial circle,
+orientation and arc angle evenly distributed.
+.TP 14
+.B \-pcircle100
+100-pixel diameter thin partial circle.
+.TP 14
+.B \-wpcircle10
+10-pixel diameter wide partial circle.
+.TP 14
+.B \-wpcircle100
+100-pixel diameter wide partial circle.
+.TP 14
+.B \-fcircle1
+1-pixel diameter filled circle.
+.TP 14
+.B \-fcircle10
+10-pixel diameter filled circle.
+.TP 14
+.B \-fcircle100
+100-pixel diameter filled circle.
+.TP 14
+.B \-fcircle500
+500-pixel diameter filled circle.
+.TP 14
+.B \-fcpcircle10
+10-pixel diameter partial filled circle, chord fill,
+orientation and arc angle evenly distributed.
+.TP 14
+.B \-fcpcircle100
+100-pixel diameter partial filled circle, chord fill.
+.TP 14
+.B \-fspcircle10
+10-pixel diameter partial filled circle, pie slice fill,
+orientation and arc angle evenly distributed.
+.TP 14
+.B \-fspcircle100
+100-pixel diameter partial filled circle, pie slice fill.
+.TP 14
+.B \-ellipse10
+10-pixel diameter thin (line width 0) ellipse, major and
+minor axis sizes evenly distributed.
+.TP 14
+.B \-ellipse100
+100-pixel diameter thin ellipse.
+.TP 14
+.B \-ellipse500
+500-pixel diameter thin ellipse.
+.TP 14
+.B \-dellipse100
+100-pixel diameter thin dashed ellipse (3 on, 2 off).
+.TP 14
+.B \-ddellipse100
+100-pixel diameter thin double-dashed ellipse (3 fg, 2 bg).
+.TP 14
+.B \-wellipse10
+10-pixel diameter ellipse, line width 1.
+.TP 14
+.B \-wellipse100
+100-pixel diameter ellipse, line width 10.
+.TP 14
+.B \-wellipse500
+500-pixel diameter ellipse, line width 50.
+.TP 14
+.B \-wdellipse100
+100-pixel diameter dashed ellipse, line width 10 (30 on, 20 off).
+.TP 14
+.B \-wddellipse100
+100-pixel diameter double-dashed ellipse, line width 10 (30 fg, 20 bg).
+.TP 14
+.B \-pellipse10
+10-pixel diameter thin partial ellipse.
+.TP 14
+.B \-pellipse100
+100-pixel diameter thin partial ellipse.
+.TP 14
+.B \-wpellipse10
+10-pixel diameter wide partial ellipse.
+.TP 14
+.B \-wpellipse100
+100-pixel diameter wide partial ellipse.
+.TP 14
+.B \-fellipse10
+10-pixel diameter filled ellipse.
+.TP 14
+.B \-fellipse100
+100-pixel diameter filled ellipse.
+.TP 14
+.B \-fellipse500
+500-pixel diameter filled ellipse.
+.TP 14
+.B \-fcpellipse10
+10-pixel diameter partial filled ellipse, chord fill.
+.TP 14
+.B \-fcpellipse100
+100-pixel diameter partial filled ellipse, chord fill.
+.TP 14
+.B \-fspellipse10
+10-pixel diameter partial filled ellipse, pie slice fill.
+.TP 14
+.B \-fspellipse100
+100-pixel diameter partial filled ellipse, pie slice fill.
+.TP 14
+.B \-triangle1
+Fill 1-pixel/side triangle.
+.TP 14
+.B \-triangle10
+Fill 10-pixel/side triangle.
+.TP 14
+.B \-triangle100
+Fill 100-pixel/side triangle.
+.TP 14
+.B \-trap1
+Fill 1x1 trapezoid.
+.TP 14
+.B \-trap10
+Fill 10x10 trapezoid.
+.TP 14
+.B \-trap100
+Fill 100x100 trapezoid.
+.TP 14
+.B \-trap300
+Fill 300x300 trapezoid.
+.TP 14
+.B \-strap1
+Fill 1x1 transparent stippled trapezoid, 8x8 stipple pattern.
+.TP 14
+.B \-strap10
+Fill 10x10 transparent stippled trapezoid, 8x8 stipple pattern.
+.TP 14
+.B \-strap100
+Fill 100x100 transparent stippled trapezoid, 8x8 stipple pattern.
+.TP 14
+.B \-strap300
+Fill 300x300 transparent stippled trapezoid, 8x8 stipple pattern.
+.TP 14
+.B \-ostrap1
+Fill 10x10 opaque stippled trapezoid, 8x8 stipple pattern.
+.TP 14
+.B \-ostrap10
+Fill 10x10 opaque stippled trapezoid, 8x8 stipple pattern.
+.TP 14
+.B \-ostrap100
+Fill 100x100 opaque stippled trapezoid, 8x8 stipple pattern.
+.TP 14
+.B \-ostrap300
+Fill 300x300 opaque stippled trapezoid, 8x8 stipple pattern.
+.TP 14
+.B \-tiletrap1
+Fill 10x10 tiled trapezoid, 4x4 tile pattern.
+.TP 14
+.B \-tiletrap10
+Fill 10x10 tiled trapezoid, 4x4 tile pattern.
+.TP 14
+.B \-tiletrap100
+Fill 100x100 tiled trapezoid, 4x4 tile pattern.
+.TP 14
+.B \-tiletrap300
+Fill 300x300 tiled trapezoid, 4x4 tile pattern.
+.TP 14
+.B \-oddstrap1
+Fill 1x1 transparent stippled trapezoid, 17x15 stipple pattern.
+.TP 14
+.B \-oddstrap10
+Fill 10x10 transparent stippled trapezoid, 17x15 stipple pattern.
+.TP 14
+.B \-oddstrap100
+Fill 100x100 transparent stippled trapezoid, 17x15 stipple pattern.
+.TP 14
+.B \-oddstrap300
+Fill 300x300 transparent stippled trapezoid, 17x15 stipple pattern.
+.TP 14
+.B \-oddostrap1
+Fill 10x10 opaque stippled trapezoid, 17x15 stipple pattern.
+.TP 14
+.B \-oddostrap10
+Fill 10x10 opaque stippled trapezoid, 17x15 stipple pattern.
+.TP 14
+.B \-oddostrap100
+Fill 100x100 opaque stippled trapezoid, 17x15 stipple pattern.
+.TP 14
+.B \-oddostrap300
+Fill 300x300 opaque stippled trapezoid, 17x15 stipple pattern.
+.TP 14
+.B \-oddtiletrap1
+Fill 10x10 tiled trapezoid, 17x15 tile pattern.
+.TP 14
+.B \-oddtiletrap10
+Fill 10x10 tiled trapezoid, 17x15 tile pattern.
+.TP 14
+.B \-oddtiletrap100
+Fill 100x100 tiled trapezoid, 17x15 tile pattern.
+.TP 14
+.B \-oddtiletrap300
+Fill 300x300 tiled trapezoid, 17x15 tile pattern.
+.TP 14
+.B \-bigstrap1
+Fill 1x1 transparent stippled trapezoid, 161x145 stipple pattern.
+.TP 14
+.B \-bigstrap10
+Fill 10x10 transparent stippled trapezoid, 161x145 stipple pattern.
+.TP 14
+.B \-bigstrap100
+Fill 100x100 transparent stippled trapezoid, 161x145 stipple pattern.
+.TP 14
+.B \-bigstrap300
+Fill 300x300 transparent stippled trapezoid, 161x145 stipple pattern.
+.TP 14
+.B \-bigostrap1
+Fill 10x10 opaque stippled trapezoid, 161x145 stipple pattern.
+.TP 14
+.B \-bigostrap10
+Fill 10x10 opaque stippled trapezoid, 161x145 stipple pattern.
+.TP 14
+.B \-bigostrap100
+Fill 100x100 opaque stippled trapezoid, 161x145 stipple pattern.
+.TP 14
+.B \-bigostrap300
+Fill 300x300 opaque stippled trapezoid, 161x145 stipple pattern.
+.TP 14
+.B \-bigtiletrap1
+Fill 10x10 tiled trapezoid, 161x145 tile pattern.
+.TP 14
+.B \-bigtiletrap10
+Fill 10x10 tiled trapezoid, 161x145 tile pattern.
+.TP 14
+.B \-bigtiletrap100
+Fill 100x100 tiled trapezoid, 161x145 tile pattern.
+.TP 14
+.B \-bigtiletrap300
+Fill 300x300 tiled trapezoid, 161x145 tile pattern.
+.TP 14
+.B \-eschertiletrap1
+Fill 1x1 tiled trapezoid, 216x208 tile pattern.
+.TP 14
+.B \-eschertiletrap10
+Fill 10x10 tiled trapezoid, 216x208 tile pattern.
+.TP 14
+.B \-eschertiletrap100
+Fill 100x100 tiled trapezoid, 216x208 tile pattern.
+.TP 14
+.B \-eschertiletrap300
+Fill 300x300 tiled trapezoid, 216x208 tile pattern.
+.TP 14
+.B \-complex10
+Fill 10-pixel/side complex polygon.
+.TP 14
+.B \-complex100
+Fill 100-pixel/side complex polygon.
+.TP 14
+.B \-64poly10convex
+Fill 10x10 convex 64-gon.
+.TP 14
+.B \-64poly100convex
+Fill 100x100 convex 64-gon.
+.TP 14
+.B \-64poly10complex
+Fill 10x10 complex 64-gon.
+.TP 14
+.B \-64poly100complex
+Fill 100x100 complex 64-gon.
+.TP 14
+.B \-ftext
+Character in 80-char line (6x13).
+.TP 14
+.B \-f8text
+Character in 70-char line (8x13).
+.TP 14
+.B \-f9text
+Character in 60-char line (9x15).
+.TP 14
+.B \-f14text16
+2-byte character in 40-char line (k14).
+.TP 14
+.B \-tr10text
+Character in 80-char line (Times-Roman 10).
+.TP 14
+.B \-tr24text
+Character in 30-char line (Times-Roman 24).
+.TP 14
+.B \-polytext
+Character in 20/40/20 line (6x13, Times-Roman 10, 6x13).
+.TP 14
+.B \-polytext16
+2-byte character in 7/14/7 line (k14, k24).
+.TP 14
+.B \-fitext
+Character in 80-char image line (6x13).
+.TP 14
+.B \-f8itext
+Character in 70-char image line (8x13).
+.TP 14
+.B \-f9itext
+Character in 60-char image line (9x15).
+.TP 14
+.B \-f14itext16
+2-byte character in 40-char image line (k14).
+.TP 14
+.B \-f24itext16
+2-byte character in 23-char image line (k24).
+.TP 14
+.B \-tr10itext
+Character in 80-char image line (Times-Roman 10).
+.TP 14
+.B \-tr24itext
+Character in 30-char image line (Times-Roman 24).
+.TP 14
+.B \-scroll10
+Scroll 10x10 pixels vertically.
+.TP 14
+.B \-scroll100
+Scroll 100x100 pixels vertically.
+.TP 14
+.B \-scroll500
+Scroll 500x500 pixels vertically.
+.TP 14
+.B \-copywinwin10
+Copy 10x10 square from window to window.
+.TP 14
+.B \-copywinwin100
+Copy 100x100 square from window to window.
+.TP 14
+.B \-copywinwin500
+Copy 500x500 square from window to window.
+.TP 14
+.B \-copypixwin10
+Copy 10x10 square from pixmap to window.
+.TP 14
+.B \-copypixwin100
+Copy 100x100 square from pixmap to window.
+.TP 14
+.B \-copypixwin500
+Copy 500x500 square from pixmap to window.
+.TP 14
+.B \-copywinpix10
+Copy 10x10 square from window to pixmap.
+.TP 14
+.B \-copywinpix100
+Copy 100x100 square from window to pixmap.
+.TP 14
+.B \-copywinpix500
+Copy 500x500 square from window to pixmap.
+.TP 14
+.B \-copypixpix10
+Copy 10x10 square from pixmap to pixmap.
+.TP 14
+.B \-copypixpix100
+Copy 100x100 square from pixmap to pixmap.
+.TP 14
+.B \-copypixpix500
+Copy 500x500 square from pixmap to pixmap.
+.TP 14
+.B \-copyplane10
+Copy 10x10 1-bit deep plane.
+.TP 14
+.B \-copyplane100
+Copy 100x100 1-bit deep plane.
+.TP 14
+.B \-copyplane500
+Copy 500x500 1-bit deep plane.
+.TP 14
+.B \-putimage10
+PutImage 10x10 square.
+.TP 14
+.B \-putimage100
+PutImage 100x100 square.
+.TP 14
+.B \-putimage500
+PutImage 500x500 square.
+.TP 14
+.B \-putimagexy10
+PutImage XY format 10x10 square.
+.TP 14
+.B \-putimagexy100
+PutImage XY format 100x100 square.
+.TP 14
+.B \-putimagexy500
+PutImage XY format 500x500 square.
+.TP 14
+.B \-shmput10
+PutImage 10x10 square, MIT shared memory extension.
+.TP 14
+.B \-shmput100
+PutImage 100x100 square, MIT shared memory extension.
+.TP 14
+.B \-shmput500
+PutImage 500x500 square, MIT shared memory extension.
+.TP 14
+.B \-shmputxy10
+PutImage XY format 10x10 square, MIT shared memory extension.
+.TP 14
+.B \-shmputxy100
+PutImage XY format 100x100 square, MIT shared memory extension.
+.TP 14
+.B \-shmputxy500
+PutImage XY format 500x500 square, MIT shared memory extension.
+.TP 14
+.B \-getimage10
+GetImage 10x10 square.
+.TP 14
+.B \-getimage100
+GetImage 100x100 square.
+.TP 14
+.B \-getimage500
+GetImage 500x500 square.
+.TP 14
+.B \-getimagexy10
+GetImage XY format 10x10 square.
+.TP 14
+.B \-getimagexy100
+GetImage XY format 100x100 square.
+.TP 14
+.B \-getimagexy500
+GetImage XY format 500x500 square.
+.TP 14
+.B \-noop
+X protocol NoOperation.
+.TP 14
+.B \-atom
+GetAtomName.
+.TP 14
+.B \-pointer
+QueryPointer.
+.TP 14
+.B \-prop
+GetProperty.
+.TP 14
+.B \-gc
+Change graphics context.
+.TP 14
+.B \-create
+Create child window and map using MapSubwindows.
+.TP 14
+.B \-ucreate
+Create unmapped window.
+.TP 14
+.B \-map
+Map child window via MapWindow on parent.
+.TP 14
+.B \-unmap
+Unmap child window via UnmapWindow on parent.
+.TP 14
+.B \-destroy
+Destroy child window via DestroyWindow parent.
+.TP 14
+.B \-popup
+Hide/expose window via Map/Unmap popup window.
+.TP 14
+.B \-move
+Move window.
+.TP 14
+.B \-umove
+Moved unmapped window.
+.TP 14
+.B \-movetree
+Move window via MoveWindow on parent.
+.TP 14
+.B \-resize
+Resize window.
+.TP 14
+.B \-uresize
+Resize unmapped window.
+.TP 14
+.B \-circulate
+Circulate lowest window to top.
+.TP 14
+.B \-ucirculate
+Circulate unmapped window to top.
+.SH X DEFAULTS
+There are no X defaults used by this program.
+.SH "SEE ALSO"
+X(__miscmansuffix__), x11perfcomp(1)
+.SH AUTHORS
+Joel McCormack
+.br
+Phil Karlton
+.br
+Susan Angebranndt
+.br
+Chris Kent
+.br
+Keith Packard
+.br
+Graeme Gill
diff --git a/x11perf/x11perfcomp.man b/x11perf/x11perfcomp.man
new file mode 100755 (executable)
index 0000000..45e4ad3
--- /dev/null
@@ -0,0 +1,80 @@
+.\" Copyright 1993, 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.
+.\"
+.\"
+.TH X11PERFCOMP 1 __xorgversion__
+.SH NAME
+x11perfcomp \- X11 server performance comparison program
+.SH SYNTAX
+.B x11perfcomp
+[ \-r | \-ro ] [ \-l label_file ] files
+.SH DESCRIPTION
+The
+.I x11perfcomp
+program merges the output of several
+.I x11perf(1)
+runs into a nice tabular
+format.  It takes the results in each file, fills in any missing test results if
+necessary, and for each test shows the objects/second rate of each server.
+If invoked with the -r or -ro options, it shows the relative performance 
+of each server to the first server.
+.PP
+Normally,
+.I x11perfcomp
+uses the first file specified to determine which specific tests it should
+report on.  Some (non-DEC :) servers may fail to perform
+all tests.  In this case,
+.I x11perfcomp
+automatically substitutes in a rate of 0.0 objects/second. 
+Since the first file
+determines which tests to report on, this file must contain a superset of
+the tests reported in the other files, else 
+.I x11perfcomp
+will fail.
+.PP
+You can provide an explicit list of tests to report on
+by using the -l switch to specify a file of labels.  You can create a label
+file by using the -label option in 
+.I x11perf.
+.SH OPTIONS
+.I x11perfcomp
+accepts the options listed below:
+.TP 16
+.B \-r
+Specifies that the output should also include relative server
+performance.
+.TP 16
+.B \-ro
+Specifies that the output should include only relative server performance.
+.TP 16
+.B \-l label_file
+Specifies a label file to use.
+.SH X DEFAULTS
+There are no X defaults used by this program.
+.SH "SEE ALSO"
+X(__miscmansuffix__), x11perf(1)
+.SH AUTHORS
+Mark Moraes wrote the original scripts to compare servers.
+.br
+Joel McCormack just munged them together a bit.
diff --git a/xbiff/COPYING b/xbiff/COPYING
new file mode 100644 (file)
index 0000000..2836b5a
--- /dev/null
@@ -0,0 +1,25 @@
+Copyright (c) 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
diff --git a/xbiff/ChangeLog b/xbiff/ChangeLog
new file mode 100644 (file)
index 0000000..9cf2a39
--- /dev/null
@@ -0,0 +1,285 @@
+commit 6b546577aadec95c09da148936dbfd55b9cd0216
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Dec 17 08:32:12 2009 -0800
+
+    xbiff 1.0.2
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 82e802ad978b110dd093b620e91589ca689dcff6
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Dec 17 08:25:19 2009 -0800
+
+    Fill in COPYING with notices from source code
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit d8c551691ff2c28b2d90af47ada68bc3ee78bdc8
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Nov 26 09:19:52 2009 -0500
+
+    Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES
+    
+    Now that the INSTALL file is generated.
+    Allows running make maintainer-clean.
+
+commit c7475f38f7aec802914af26043bb0d950880a77e
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Wed Oct 28 14:09:08 2009 -0400
+
+    INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206
+    
+    Add missing INSTALL file. Use standard GNU file on building tarball
+    README may have been updated
+    Remove AUTHORS file as it is empty and no content available yet.
+    Remove NEWS file as it is empty and no content available yet.
+
+commit be7954a66400b0efacf01d159752f5ea2886564f
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Mon Oct 26 22:08:38 2009 -0400
+
+    Makefile.am: ChangeLog not required: EXTRA_DIST or *CLEANFILES #24432
+    
+    ChangeLog filename is known to Automake and requires no further
+    coding in the makefile.
+
+commit 4511a4a0030b9a33a6056f76a5e126d76611c463
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Oct 22 12:34:15 2009 -0400
+
+    .gitignore: use common defaults with custom section # 24239
+    
+    Using common defaults will reduce errors and maintenance.
+    Only the very small or inexistent custom section need periodic maintenance
+    when the structure of the component changes. Do not edit defaults.
+
+commit 111206b3ad0b0536bdc8c39425f79f50665c3000
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Oct 12 18:34:18 2009 -0700
+
+    Migrate to xorg macros 1.3 & XORG_DEFAULT_OPTIONS
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 492785cb489963cff20e7d20b87d33ffa5508247
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Oct 1 14:54:20 2009 -0700
+
+    Add README with pointers to mailing lists, bugzilla, & git
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit b88273dcdd403e058888fbcdf4a0470854045179
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Jan 13 20:54:08 2009 -0200
+
+    Ansification and compile warning fixes.
+    
+      This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects
+    make distcheck and all gcc 4.3 and sparse warnings.
+
+commit 4882f2fc26a5976fe7744286932263c83f1c61dc
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Wed Aug 20 10:32:49 2008 -0400
+
+    xaw8 is gone, use xaw7
+
+commit bdd747628f08de80eb311d6e7ef2cd1dd9b34943
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Dec 6 16:37:09 2007 -0500
+
+    Replace static ChangeLog with dist-hook to generate from git log
+
+commit e00caacfa0a86692928f81039ece9341745bc3d0
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Mon Sep 3 05:51:15 2007 -0400
+
+    Add *~ to .gitignore to skip patch/emacs droppings
+
+commit e3abf6683d15c67e796a395b30437fd01ff3b538
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Aug 23 19:24:40 2007 -0400
+
+    Rename .cvsignore to .gitignore
+
+commit 0365e1a08ddb0c5961a0c52f9cf4a8368cf312e5
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 21 02:29:48 2005 +0000
+
+    Update package version for X11R7 release.
+
+commit 7ad243529fe6d78e52dea5a22a24f7f83a22ba62
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Dec 19 16:22:42 2005 +0000
+
+    Stub COPYING files
+
+commit efd4fed0e413ddf6d93c366041f6cb9a6e622375
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:24:04 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+commit d54d4ef448b3e16ec9151c6dd4143ca32eaf32a5
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 6 22:48:19 2005 +0000
+
+    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit a2cf84dad681150f17186bc929e4958017d19d8c
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Dec 3 05:49:18 2005 +0000
+
+    Update package version number for X11R7 RC3 release.
+
+commit 96700fc277e1a211aca0fe1b2e87d87d7f359fcc
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Nov 28 22:01:39 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 ca0fb29b3fe6e8b574dfe2e692734127ab7a3d43
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Mon Nov 21 10:34:58 2005 +0000
+
+    Another pass at .cvsignores for apps.
+
+commit acded00af405734d1611db4fe6d0e9940b8bd326
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Sun Nov 20 22:08:50 2005 +0000
+
+    Add/improve .cvsignore files for apps.
+
+commit 8114be741f5386cebfa24de82474b49c438dc78d
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Nov 19 07:15:36 2005 +0000
+
+    Update pkgconfig files to separate library build-time dependencies from
+        application build-time dependencies, and update package deps to work
+        with separate build roots.
+
+commit 3097fcab22bf84f0bb6faee69c99c950a79bb1c4
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:47:52 2005 +0000
+
+    Update package version number for RC1 release.
+
+commit 7aeb50852f7111ba9a4ad3404bea0d20e1602502
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Oct 17 23:56:21 2005 +0000
+
+    Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to
+        work better with BSD make
+
+commit c080a49a36c2f90fae774550553791da721e9240
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Fri Oct 14 00:25:43 2005 +0000
+
+    Use sed to fill in variables in man page
+
+commit ae73bd0c0087ebde446d6e4956242088a315ab6c
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Tue Sep 27 18:35:34 2005 +0000
+
+    Fix configure.ac to not require xaw8 unconditionally.
+
+commit 25b5d282c0264508adbd695010632cde93f55a2f
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Aug 1 20:25:29 2005 +0000
+
+    Install man pages to section 1 instead of section m (Patch from Donnie
+        Berkholz)
+
+commit b89877374f51e8b9c83ca1aa55e246391038ffba
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Jul 29 21:22:31 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 a8d1903bfd5ee45e6736427be85adef5624d661a
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Sat Jul 23 15:46:06 2005 +0000
+
+    xbiff depends on Xaw
+
+commit d9ea3ae597b97c173faa6dd29077ddf3a4bbc5ac
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed Jul 20 19:31:51 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 df4faebea1a9a32c5c4b78a2585cbf6a443181a7
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Sat Jul 16 21:40:42 2005 +0000
+
+    Add _BSD_SOURCE - patch from Stefan Dirsch
+
+commit b3b0fffccaec04ca4bf47409dc39fba17819ee06
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Fri Jul 15 16:53:50 2005 +0000
+
+    Add dependency on xbitmaps
+
+commit ee0c19e43392bb8bc343a617d92e3784845511b6
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Wed Jul 6 15:21:38 2005 +0000
+
+    Build system for xbiff
+
+commit dbaae0652239411598a00da1ee5af65a5b101a98
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 19:54:38 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+commit fd6ce9234674249a5ef7cc6fb3a13d3ff604a24a
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:35:00 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit d0ae3505f328fbc52752a17b7d3033021ce2b0c3
+Author: Egbert Eich <eich@suse.de>
+Date:   Wed Mar 3 12:12:55 2004 +0000
+
+    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit c946d9c9cf9222327544ca677e26de0fe796ba95
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:36:16 2004 +0000
+
+    readding XFree86's cvs IDs
+
+commit 1fb603e5ba366ab79a17f6d79f7fc6dd6988cda6
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 09:23:58 2004 +0000
+
+    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit 8dcf7ae639f46e982131632b7cc0c37a8fd4ee97
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:29:03 2003 +0000
+
+    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit f2fc3bc2312c7af4f0cd5fee2e08be7c0ca115b3
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:58 2003 +0000
+
+    XFree86 4.3.0.1
+
+commit 248f03b4a519c635bdfa16ae1c7aa708a006c580
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:58 2003 +0000
+
+    Initial revision
diff --git a/xbiff/INSTALL b/xbiff/INSTALL
new file mode 100644 (file)
index 0000000..8b82ade
--- /dev/null
@@ -0,0 +1,291 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008 Free Software Foundation, Inc.
+
+   This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+   Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package.  The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.
+
+     Running `configure' might take a while.  While running, it prints
+     some messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+  6. Often, you can also type `make uninstall' to remove the installed
+     files again.
+
+Compilers and Options
+=====================
+
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+   You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you can use GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory.  After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+   On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor.  Like
+this:
+
+     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CPP="gcc -E" CXXCPP="g++ -E"
+
+   This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+   By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+   Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Particular systems
+==================
+
+   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+     ./configure CC="cc -Ae"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
+a workaround.  If GNU CC is not installed, it is therefore recommended
+to try
+
+     ./configure CC="cc"
+
+and if that doesn't work, try
+
+     ./configure CC="cc -nodtk"
+
+Specifying the System Type
+==========================
+
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+   Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug.  Until the bug is fixed you can use this workaround:
+
+     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+   `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+     Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+     Print a summary of the options unique to this package's
+     `configure', and exit.  The `short' variant lists options used
+     only in the top level, while the `recursive' variant lists options
+     also present in any nested packages.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+     Use DIR as the installation prefix.  *Note Installation Names::
+     for more details, including other options available for fine-tuning
+     the installation locations.
+
+`--no-create'
+`-n'
+     Run the configure checks, but stop before creating any output
+     files.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/xbiff/Mailbox.c b/xbiff/Mailbox.c
new file mode 100644 (file)
index 0000000..d7f7fb8
--- /dev/null
@@ -0,0 +1,654 @@
+/* $XConsortium: Mailbox.c,v 1.64 94/04/17 20:43:26 rws Exp $ */
+/*
+
+Copyright (c) 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86: xc/programs/xbiff/Mailbox.c,v 1.4 2001/08/01 00:45:02 tsi Exp $ */
+
+/*
+ * Author:  Jim Fulton, MIT X Consortium
+ *
+ * I recommend that you use the new mailfull and mailempty bitmaps instead of
+ * the ugly mailboxes:
+ *
+ *         XBiff*fullPixmap:  mailfull
+ *         XBiff*emptyPixmap:  mailempty
+ */
+
+#include <X11/IntrinsicP.h>            /* for toolkit stuff */
+#include <X11/StringDefs.h>            /* for useful atom names */
+#include <X11/cursorfont.h>            /* for cursor constants */
+#include <X11/Xosdefs.h>               /* for X_NOT_POSIX def */
+#include <stdlib.h>
+#ifdef WIN32
+#include <X11/Xw32defs.h>
+#else
+#include <pwd.h>                       /* for getting username */
+#endif
+#include <sys/stat.h>                  /* for stat() ** needs types.h ***/
+#include <stdio.h>                     /* for printing error messages */
+#include <unistd.h>
+
+#ifndef X_NOT_POSIX
+#ifdef _POSIX_SOURCE
+# include <sys/wait.h>
+#else
+#define _POSIX_SOURCE
+# include <sys/wait.h>
+#undef _POSIX_SOURCE
+#endif
+# define waitCode(w)   WEXITSTATUS(w)
+# define waitSig(w)    WIFSIGNALED(w)
+typedef int            waitType;
+# define INTWAITTYPE
+#else /* ! X_NOT_POSIX */
+#ifdef SYSV
+# define waitCode(w)   (((w) >> 8) & 0x7f)
+# define waitSig(w)    ((w) & 0xff)
+typedef int            waitType;
+# define INTWAITTYPE
+#else
+#ifdef WIN32
+#include <process.h>
+# define INTWAITTYPE
+typedef int            waitType;
+# define waitCode(w)   (w)
+# define waitSig(w)    (0)
+#else
+# include      <sys/wait.h>
+# define waitCode(w)   ((w).w_T.w_Retcode)
+# define waitSig(w)    ((w).w_T.w_Termsig)
+typedef union wait     waitType;
+#endif /* WIN32 else */
+#endif /* SYSV else */
+#endif /* ! X_NOT_POSIX else */
+
+#include <X11/bitmaps/mailfull>                /* for flag up (mail present) bits */
+#include <X11/bitmaps/mailempty>       /* for flag down (mail not here) */
+
+#include <X11/Xaw/XawInit.h>
+#include "MailboxP.h"          /* for implementation mailbox stuff */
+#include <X11/Xmu/Drawing.h>
+#include <X11/extensions/shape.h>
+
+/*
+ * The default user interface is to have the mailbox turn itself off whenever
+ * the user presses a button in it.  Expert users might want to make this 
+ * happen on EnterWindow.  It might be nice to provide support for some sort of
+ * exit callback so that you can do things like press q to quit.
+ */
+
+static char defaultTranslations[] = 
+  "<ButtonPress>:  unset()";
+
+static void Set (Widget gw, XEvent *event, String *params, Cardinal *nparams);
+static void Check(Widget gw, XEvent *event, String *params, Cardinal *nparams);
+static void Unset(Widget gw, XEvent *event, String *params, Cardinal *nparams);
+
+static XtActionsRec actionsList[] = { 
+    { "check", Check },
+    { "unset", Unset },
+    { "set",   Set },
+};
+
+
+/* Initialization of defaults */
+
+#define offset(field) XtOffsetOf(MailboxRec, mailbox.field)
+#define goffset(field) XtOffsetOf(WidgetRec, core.field)
+
+static Dimension defDim = 48;
+static Pixmap nopix = None;
+
+static XtResource resources[] = {
+    { XtNwidth, XtCWidth, XtRDimension, sizeof (Dimension), 
+       goffset (width), XtRDimension, (XtPointer)&defDim },
+    { XtNheight, XtCHeight, XtRDimension, sizeof (Dimension),
+       goffset (height), XtRDimension, (XtPointer)&defDim },
+    { XtNupdate, XtCInterval, XtRInt, sizeof (int),
+       offset (update), XtRString, "30" },
+    { XtNforeground, XtCForeground, XtRPixel, sizeof (Pixel),
+       offset (foreground_pixel), XtRString, XtDefaultForeground },
+    { XtNfile, XtCFile, XtRString, sizeof (String),
+       offset (filename), XtRString, NULL },
+    { XtNcheckCommand, XtCCheckCommand, XtRString, sizeof(char*),
+       offset (check_command), XtRString, NULL},
+    { XtNvolume, XtCVolume, XtRInt, sizeof(int),
+       offset (volume), XtRString, "33"},
+    { XtNonceOnly, XtCBoolean, XtRBoolean, sizeof(Boolean),
+       offset (once_only), XtRImmediate, (XtPointer)False },
+    { XtNfullPixmap, XtCPixmap, XtRBitmap, sizeof(Pixmap),
+       offset (full.bitmap), XtRString, "flagup" },
+    { XtNfullPixmapMask, XtCPixmapMask, XtRBitmap, sizeof(Pixmap),
+       offset (full.mask), XtRBitmap, (XtPointer) &nopix },
+    { XtNemptyPixmap, XtCPixmap, XtRBitmap, sizeof(Pixmap),
+       offset (empty.bitmap), XtRString, "flagdown" },
+    { XtNemptyPixmapMask, XtCPixmapMask, XtRBitmap, sizeof(Pixmap),
+       offset (empty.mask), XtRBitmap, (XtPointer) &nopix },
+    { XtNflip, XtCFlip, XtRBoolean, sizeof(Boolean),
+       offset (flipit), XtRString, "true" },
+    { XtNshapeWindow, XtCShapeWindow, XtRBoolean, sizeof(Boolean),
+        offset (shapeit), XtRString, "false" },
+};
+
+#undef offset
+#undef goffset
+
+static void GetMailFile(MailboxWidget w);
+static void CloseDown (MailboxWidget w, int status);
+
+static void check_mailbox(MailboxWidget w, Boolean force_redraw, Boolean reset);
+static void redraw_mailbox (MailboxWidget w);
+static void beep (MailboxWidget w);
+static void Initialize (Widget request, Widget new,
+                       ArgList args, Cardinal *num_args);
+static void Realize (Widget gw, XtValueMask *valuemaskp,
+                    XSetWindowAttributes *attr);
+static void Destroy (Widget gw);
+static void Redisplay (Widget gw, XEvent *event, Region region);
+static Boolean SetValues (Widget gcurrent, Widget grequest, Widget gnew,
+                         ArgList args, Cardinal *num_args);
+
+MailboxClassRec mailboxClassRec = {
+    { /* core fields */
+    /* superclass              */      (WidgetClass) &simpleClassRec,
+    /* class_name              */      "Mailbox",
+    /* widget_size             */      sizeof(MailboxRec),
+    /* class_initialize                */      XawInitializeWidgetSet,
+    /* class_part_initialize   */      NULL,
+    /* class_inited            */      FALSE,
+    /* initialize              */      Initialize,
+    /* initialize_hook         */      NULL,
+    /* realize                 */      Realize,
+    /* actions                 */      actionsList,
+    /* num_actions             */      XtNumber(actionsList),
+    /* resources               */      resources,
+    /* resource_count          */      XtNumber(resources),
+    /* xrm_class               */      NULLQUARK,
+    /* compress_motion         */      TRUE,
+    /* compress_exposure       */      TRUE,
+    /* compress_enterleave     */      TRUE,
+    /* visible_interest                */      FALSE,
+    /* destroy                 */      Destroy,
+    /* resize                  */      NULL,
+    /* expose                  */      Redisplay,
+    /* set_values              */      SetValues,
+    /* set_values_hook         */      NULL,
+    /* set_values_almost       */      XtInheritSetValuesAlmost,
+    /* get_values_hook         */      NULL,
+    /* accept_focus            */      NULL,
+    /* version                 */      XtVersion,
+    /* callback_private                */      NULL,
+    /* tm_table                        */      defaultTranslations,
+    /* query_geometry          */      XtInheritQueryGeometry,
+    /* display_accelerator     */      XtInheritDisplayAccelerator,
+    /* extension               */      NULL
+    },
+    { /* simple fields */
+    /* change_sensitive         */     XtInheritChangeSensitive
+    },
+    { /* mailbox fields */
+    /* ignore                   */     0
+    }
+};
+
+WidgetClass mailboxWidgetClass = (WidgetClass) &mailboxClassRec;
+
+
+/*
+ * widget initialization
+ */
+
+static GC get_mailbox_gc (MailboxWidget w)
+{
+    XtGCMask valuemask;
+    XGCValues xgcv;
+
+    valuemask = GCForeground | GCBackground | GCFunction | GCGraphicsExposures;
+    xgcv.foreground = w->mailbox.foreground_pixel;
+    xgcv.background = w->core.background_pixel;
+    xgcv.function = GXcopy;
+    xgcv.graphics_exposures = False;   /* this is Bool, not Boolean */
+    return (XtGetGC ((Widget) w, valuemask, &xgcv));
+}
+
+
+/* ARGSUSED */
+static void Initialize (Widget request, Widget new,
+                       ArgList args, Cardinal *num_args)
+{
+    MailboxWidget w = (MailboxWidget) new;
+    int shape_event_base, shape_error_base;
+
+    if (w->core.width <= 0) w->core.width = 1;
+    if (w->core.height <= 0) w->core.height = 1;
+
+    if (w->mailbox.shapeit && !XShapeQueryExtension (XtDisplay (w),
+                                                    &shape_event_base,
+                                                    &shape_error_base))
+      w->mailbox.shapeit = False;
+    w->mailbox.shape_cache.mask = None;
+    w->mailbox.gc = get_mailbox_gc (w);
+    w->mailbox.interval_id = (XtIntervalId) 0;
+    w->mailbox.full.pixmap = None;
+    w->mailbox.empty.pixmap = None;
+    w->mailbox.flag_up = FALSE;
+    w->mailbox.last_size = 0;
+    if (!w->mailbox.filename) GetMailFile (w);
+    return;
+}
+
+
+/*
+ * action procedures
+ */
+
+/*
+ * pretend there is new mail; put widget in flagup state
+ */
+
+/* ARGSUSED */
+static void Set (Widget gw, XEvent *event, String *params, Cardinal *nparams)
+{
+    MailboxWidget w = (MailboxWidget) gw;
+
+    w->mailbox.last_size = -1;
+
+    check_mailbox (w, TRUE, FALSE);    /* redraw, no reset */
+}
+
+
+/*
+ * ack the existing mail; put widget in flagdown state
+ */
+
+/* ARGSUSED */
+static void Unset (Widget gw, XEvent *event, String *params, Cardinal *nparams)
+{
+    MailboxWidget w = (MailboxWidget) gw;
+
+    check_mailbox (w, TRUE, TRUE);     /* redraw, reset */
+}
+
+
+/*
+ * look to see if there is new mail; if so, Set, else Unset
+ */
+
+/* ARGSUSED */
+static void Check (Widget gw, XEvent *event, String *params, Cardinal *nparams)
+{
+    MailboxWidget w = (MailboxWidget) gw;
+
+    check_mailbox (w, TRUE, FALSE);    /* redraw, no reset */
+}
+
+
+/* ARGSUSED */
+static void clock_tic (XtPointer client_data, XtIntervalId *id)
+{
+    MailboxWidget w = (MailboxWidget) client_data;
+
+    check_mailbox (w, FALSE, FALSE);   /* no redraw, no reset */
+
+    /*
+     * and reset the timer
+     */
+
+    w->mailbox.interval_id =
+       XtAppAddTimeOut (XtWidgetToApplicationContext((Widget) w),
+                        w->mailbox.update * 1000, clock_tic, client_data);
+
+    return;
+}
+
+static Pixmap make_pixmap (Display *dpy, MailboxWidget w, Pixmap bitmap,
+                          int depth, Boolean flip, int *widthp, int *heightp)
+{
+    Window root;
+    int x, y;
+    unsigned int width, height, bw, dep;
+    unsigned long fore, back;
+
+    if (!XGetGeometry (dpy, bitmap, &root, &x, &y, &width, &height, &bw, &dep))
+      return None;
+
+    *widthp = (int) width;
+    *heightp = (int) height;
+    if (flip) {
+       fore = w->core.background_pixel;
+       back = w->mailbox.foreground_pixel;
+    } else {
+       fore = w->mailbox.foreground_pixel;
+       back = w->core.background_pixel;
+    }
+    return XmuCreatePixmapFromBitmap (dpy, w->core.window, bitmap, 
+                                     width, height, depth, fore, back);
+}
+
+static void Realize (Widget gw, XtValueMask *valuemaskp,
+                    XSetWindowAttributes *attr)
+{
+    MailboxWidget w = (MailboxWidget) gw;
+    register Display *dpy = XtDisplay (w);
+    int depth = w->core.depth;
+
+    *valuemaskp |= (CWBitGravity | CWCursor);
+    attr->bit_gravity = ForgetGravity;
+    attr->cursor = XCreateFontCursor (dpy, XC_top_left_arrow);
+
+    (*mailboxWidgetClass->core_class.superclass->core_class.realize)
+       (gw, valuemaskp, attr);
+
+    /*
+     * build up the pixmaps that we'll put into the image
+     */
+    if (w->mailbox.full.bitmap == None) {
+       w->mailbox.full.bitmap = 
+         XCreateBitmapFromData (dpy, w->core.window, (char *) mailfull_bits,
+                                mailfull_width, mailfull_height);
+    }
+    if (w->mailbox.empty.bitmap == None) {
+       w->mailbox.empty.bitmap =
+         XCreateBitmapFromData (dpy, w->core.window, (char *) mailempty_bits,
+                                mailempty_width, mailempty_height);
+    }
+
+    w->mailbox.empty.pixmap = make_pixmap (dpy, w, w->mailbox.empty.bitmap,
+                                          depth, False,
+                                          &w->mailbox.empty.width,
+                                          &w->mailbox.empty.height);
+    w->mailbox.full.pixmap = make_pixmap (dpy, w, w->mailbox.full.bitmap,
+                                         depth, w->mailbox.flipit,
+                                         &w->mailbox.full.width,
+                                         &w->mailbox.full.height);
+                        
+    if (w->mailbox.empty.mask == None && w->mailbox.full.mask == None)
+      w->mailbox.shapeit = False;
+
+    w->mailbox.interval_id = 
+       XtAppAddTimeOut (XtWidgetToApplicationContext((Widget) w),
+                        w->mailbox.update * 1000, clock_tic, (XtPointer) w);
+
+    w->mailbox.shape_cache.mask = None;
+
+    check_mailbox (w, TRUE, FALSE);
+
+    return;
+}
+
+
+static void Destroy (Widget gw)
+{
+    MailboxWidget w = (MailboxWidget) gw;
+    Display *dpy = XtDisplay (gw);
+
+    XtFree (w->mailbox.filename);
+    if (w->mailbox.interval_id) XtRemoveTimeOut (w->mailbox.interval_id);
+    XtReleaseGC(gw, w->mailbox.gc);
+#define freepix(p) if (p) XFreePixmap (dpy, p)
+    freepix (w->mailbox.full.bitmap);          /* until cvter does ref cnt */
+    freepix (w->mailbox.full.mask);            /* until cvter does ref cnt */
+    freepix (w->mailbox.full.pixmap);
+    freepix (w->mailbox.empty.bitmap);         /* until cvter does ref cnt */
+    freepix (w->mailbox.empty.mask);           /* until cvter does ref cnt */
+    freepix (w->mailbox.empty.pixmap);
+    freepix (w->mailbox.shape_cache.mask);
+#undef freepix
+}
+
+
+static void Redisplay (Widget gw, XEvent *event, Region region)
+{
+    MailboxWidget w = (MailboxWidget) gw;
+
+    check_mailbox (w, TRUE, FALSE);
+}
+
+
+static void check_mailbox (MailboxWidget w, Boolean force_redraw, Boolean reset)
+{
+    long mailboxsize = 0;
+    Boolean readSinceLastWrite = FALSE;
+
+    if (w->mailbox.check_command != NULL) {
+       waitType wait_status;
+       int     check_status;
+#ifdef INTWAITTYPE
+       wait_status = system(w->mailbox.check_command);
+#else
+       wait_status.w_status = system(w->mailbox.check_command);
+#endif
+       check_status = waitCode(wait_status);
+
+       /* error in sh checkCommand execution */
+       if (waitSig(wait_status))
+           check_status = 2;           /* act as if there is no mail */
+
+       switch (check_status) {
+         case 0:
+           mailboxsize = w->mailbox.last_size + 1;
+           break;
+         case 2:
+           mailboxsize = 0;
+           break;
+         default:      /* treat everything else as no change */
+                       /* case 1 is no change */
+           mailboxsize = w->mailbox.last_size;
+       }
+    } else {
+       struct stat st;
+       if (stat (w->mailbox.filename, &st) == 0) {
+           mailboxsize = st.st_size;
+           readSinceLastWrite = (st.st_atime > st.st_mtime);
+       }
+    }
+
+    /*
+     * Now check for changes.  If reset is set then we want to pretent that
+     * there is no mail.  If the mailbox is empty then we want to turn off
+     * the flag.  Otherwise if the mailbox has changed size then we want to
+     * put the flag up, unless the mailbox has been read since the last 
+     * write.
+     *
+     * The cases are:
+     *    o  forced reset by user                        DOWN
+     *    o  no mailbox or empty (zero-sized) mailbox    DOWN
+     *    o  if read after most recent write            DOWN
+     *    o  same size as last time                      no change
+     *    o  bigger than last time                       UP
+     *    o  smaller than last time but non-zero         UP
+     *
+     * The last two cases can be expressed as different from last
+     * time and non-zero.
+     */
+
+    if (reset) {                       /* forced reset */
+       w->mailbox.flag_up = FALSE;
+       force_redraw = TRUE;
+    } else if (mailboxsize == 0) {     /* no mailbox or empty */
+       w->mailbox.flag_up = FALSE;
+       if (w->mailbox.last_size > 0) force_redraw = TRUE;  /* if change */
+    } else if (readSinceLastWrite) {   /* only when checkCommand is NULL */
+       /* mailbox has been read after most recent write */
+       if (w->mailbox.flag_up) {
+           w->mailbox.flag_up = FALSE;
+           force_redraw = TRUE;
+       }
+    } else if (mailboxsize != w->mailbox.last_size) {  /* different size */
+       if (!w->mailbox.once_only || !w->mailbox.flag_up)
+           beep(w); 
+       if (!w->mailbox.flag_up)
+           force_redraw = w->mailbox.flag_up = TRUE;
+    } 
+
+    w->mailbox.last_size = mailboxsize;
+    if (force_redraw) redraw_mailbox (w);
+    return;
+}
+
+/*
+ * get user name for building mailbox
+ */
+
+static void GetMailFile (MailboxWidget w)
+{
+    char *username;
+    char *mailpath;
+#ifdef WIN32
+    if (!(username = getenv("USERNAME"))) {
+       fprintf (stderr, "%s:  unable to find a username for you.\n",
+                "Mailbox widget");
+       CloseDown (w, 1);
+    }
+#else
+
+    username = getlogin ();
+    if (!username) {
+       struct passwd *pw = getpwuid (getuid ());
+
+       if (!pw) {
+           fprintf (stderr, "%s:  unable to find a username for you.\n",
+                    "Mailbox widget");
+           CloseDown (w, 1);
+       }
+       username = pw->pw_name;
+    }
+#endif
+    if ((mailpath = getenv("MAIL"))) {
+       w->mailbox.filename = (String) XtMalloc (strlen (mailpath) + 1);
+       strcpy (w->mailbox.filename, mailpath);
+    } else {
+       w->mailbox.filename = (String) XtMalloc (strlen (MAILBOX_DIRECTORY) + 1
+                                                + strlen (username) + 1);
+       strcpy (w->mailbox.filename, MAILBOX_DIRECTORY);
+       strcat (w->mailbox.filename, "/");
+       strcat (w->mailbox.filename, username);
+    }
+    return;
+}
+
+static void CloseDown (MailboxWidget w, int status)
+{
+    Display *dpy = XtDisplay (w);
+
+    XtDestroyWidget ((Widget)w);
+    XCloseDisplay (dpy);
+    exit (status);
+}
+
+
+/* ARGSUSED */
+static Boolean SetValues (Widget gcurrent, Widget grequest, Widget gnew,
+                         ArgList args, Cardinal *num_args)
+{
+    MailboxWidget current = (MailboxWidget) gcurrent;
+    MailboxWidget new = (MailboxWidget) gnew;
+    Boolean redisplay = FALSE;
+
+    if (current->mailbox.update != new->mailbox.update) {
+       if (current->mailbox.interval_id) 
+         XtRemoveTimeOut (current->mailbox.interval_id);
+       new->mailbox.interval_id =
+           XtAppAddTimeOut (XtWidgetToApplicationContext(gnew),
+                            new->mailbox.update * 1000, clock_tic,
+                            (XtPointer) gnew);
+    }
+
+    if (current->mailbox.foreground_pixel != new->mailbox.foreground_pixel ||
+       current->core.background_pixel != new->core.background_pixel) {
+       XtReleaseGC (gcurrent, current->mailbox.gc);
+       new->mailbox.gc = get_mailbox_gc (new);
+       redisplay = TRUE;
+    }
+
+    return (redisplay);
+}
+
+
+/*
+ * drawing code
+ */
+
+static void redraw_mailbox (MailboxWidget w)
+{
+    register Display *dpy = XtDisplay (w);
+    register Window win = XtWindow (w);
+    register int x, y;
+    GC gc = w->mailbox.gc;
+    Pixel back = w->core.background_pixel;
+    struct _mbimage *im;
+
+    /* center the picture in the window */
+
+    if (w->mailbox.flag_up) {          /* paint the "up" position */
+       im = &w->mailbox.full;
+       if (w->mailbox.flipit) back = w->mailbox.foreground_pixel;
+    } else {                           /* paint the "down" position */
+       im = &w->mailbox.empty;
+    }
+    x = (((int)w->core.width) - im->width) / 2;
+    y = (((int)w->core.height) - im->height) / 2;
+
+    XSetWindowBackground (dpy, win, back);
+    XClearWindow (dpy, win);
+    XCopyArea (dpy, im->pixmap, win, gc, 0, 0, im->width, im->height, x, y);
+
+    /*
+     * XXX - temporary hack; walk up widget tree to find top most parent (which
+     * will be a shell) and mash it to have our shape.  This will be replaced
+     * by a special shell widget.
+     */
+    if (w->mailbox.shapeit) {
+       Widget parent;
+
+       for (parent = (Widget) w; XtParent(parent);
+            parent = XtParent(parent)) {
+           x += parent->core.x + parent->core.border_width;
+           y += parent->core.y + parent->core.border_width;
+       }
+
+       if (im->mask != w->mailbox.shape_cache.mask ||
+           x != w->mailbox.shape_cache.x || y != w->mailbox.shape_cache.y) {
+           XShapeCombineMask (XtDisplay(parent), XtWindow(parent),
+                              ShapeBounding, x, y, im->mask, ShapeSet);
+           w->mailbox.shape_cache.mask = im->mask;
+           w->mailbox.shape_cache.x = x;
+           w->mailbox.shape_cache.y = y;
+       }
+    }
+
+    return;
+}
+
+
+static void beep (MailboxWidget w)
+{
+    XBell (XtDisplay (w), w->mailbox.volume);
+    return;
+}
diff --git a/xbiff/Mailbox.h b/xbiff/Mailbox.h
new file mode 100644 (file)
index 0000000..dc7f1eb
--- /dev/null
@@ -0,0 +1,74 @@
+/* $XConsortium: Mailbox.h,v 1.21 94/04/17 20:43:27 rws Exp $ */
+/*
+
+Copyright (c) 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+
+#ifndef _XawMailbox_h
+#define _XawMailbox_h
+
+/*
+ * Mailbox widget; looks a lot like the clock widget, don't it...
+ */
+
+/* resource names used by mailbox widget that aren't defined in StringDefs.h */
+
+#ifndef _XtStringDefs_h_
+#define XtNupdate "update"
+#endif
+
+/* command to exec */
+#define XtNcheckCommand "checkCommand"
+#define XtNonceOnly "onceOnly"
+
+/* Int: volume for bell */
+#define XtNvolume "volume"
+#define XtNfullPixmap "fullPixmap"
+#define XtNfullPixmapMask "fullPixmapMask"
+#define XtNemptyPixmap "emptyPixmap"
+#define XtNemptyPixmapMask "emptyPixmapMask"
+#define XtNflip "flip"
+#define XtNshapeWindow "shapeWindow"
+
+#define XtCCheckCommand "CheckCommand"
+#define XtCVolume "Volume"
+#define XtCPixmapMask "PixmapMask"
+#define XtCFlip "Flip"
+#define XtCShapeWindow "ShapeWindow"
+
+
+/* structures */
+
+typedef struct _MailboxRec *MailboxWidget;  /* see MailboxP.h */
+typedef struct _MailboxClassRec *MailboxWidgetClass;  /* see MailboxP.h */
+
+
+extern WidgetClass mailboxWidgetClass;
+
+#endif /* _XawMailbox_h */
+/* DON'T ADD STUFF AFTER THIS #endif */
diff --git a/xbiff/MailboxP.h b/xbiff/MailboxP.h
new file mode 100644 (file)
index 0000000..937f895
--- /dev/null
@@ -0,0 +1,101 @@
+/* $XConsortium: MailboxP.h,v 1.22 94/04/17 20:43:27 rws Exp $ */
+/*
+
+Copyright (c) 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86: xc/programs/xbiff/MailboxP.h,v 1.1 2000/02/13 03:56:12 dawes Exp $ */
+
+#ifndef _XawMailboxP_h
+#define _XawMailboxP_h
+
+#include "Mailbox.h"
+#include <X11/Xaw/SimpleP.h>
+
+#if defined(SYSV)
+#define MAILBOX_DIRECTORY "/usr/mail"
+#elif defined(SVR4)
+#define MAILBOX_DIRECTORY "/var/mail"
+#elif defined(CSRG_BASED)
+#include <paths.h>
+#ifdef _PATH_MAILDIR
+#define MAILBOX_DIRECTORY _PATH_MAILDIR
+#endif
+#elif defined(__linux__)
+#define MAILBOX_DIRECTORY "/var/spool/mail"
+#endif
+
+#ifndef MAILBOX_DIRECTORY
+#define MAILBOX_DIRECTORY "/usr/spool/mail"
+#endif
+
+typedef struct {                       /* new fields for mailbox widget */
+    /* resources */
+    int update;                                /* seconds between updates */
+    Pixel foreground_pixel;            /* color index of normal state fg */
+    String filename;                   /* filename to watch */
+    String check_command;              /* command to exec for mail check */
+    Boolean flipit;                    /* do flip of full pixmap */
+    int volume;                                /* bell volume */
+    Boolean once_only;                 /* ring bell only once on new mail */
+    /* local state */
+    GC gc;                             /* normal GC to use */
+    long last_size;                    /* size in bytes of mailboxname */
+    XtIntervalId interval_id;          /* time between checks */
+    Boolean flag_up;                   /* is the flag up? */
+    struct _mbimage {
+       Pixmap bitmap, mask;            /* depth 1, describing shape */
+       Pixmap pixmap;                  /* full depth pixmap */
+       int width, height;              /* geometry of pixmaps */
+    } full, empty;
+    Boolean shapeit;                   /* do shape extension */
+    struct {
+       Pixmap mask;
+       int x, y;
+    } shape_cache;                     /* last set of info */
+} MailboxPart;
+
+typedef struct _MailboxRec {           /* full instance record */
+    CorePart core;
+    SimplePart simple;
+    MailboxPart mailbox;
+} MailboxRec;
+
+
+typedef struct {                       /* new fields for mailbox class */
+    int dummy;                         /* stupid C compiler */
+} MailboxClassPart;
+
+typedef struct _MailboxClassRec {      /* full class record declaration */
+    CoreClassPart core_class;
+    SimpleClassPart simple_class;
+    MailboxClassPart mailbox_class;
+} MailboxClassRec;
+
+extern MailboxClassRec mailboxClassRec;         /* class pointer */
+
+#endif /* _XawMailboxP_h */
diff --git a/xbiff/Makefile.am b/xbiff/Makefile.am
new file mode 100644 (file)
index 0000000..b49c553
--- /dev/null
@@ -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.
+
+bin_PROGRAMS = xbiff
+
+AM_CFLAGS = $(CWARNFLAGS) $(XBIFF_CFLAGS) -D_BSD_SOURCE
+xbiff_LDADD = $(XBIFF_LIBS)
+
+xbiff_SOURCES =        \
+        Mailbox.c \
+        Mailbox.h \
+        MailboxP.h \
+        xbiff.c
+
+appman_PRE = \
+        xbiff.man
+
+EXTRA_DIST = bitmaps/mail-down bitmaps/mail-up bitmaps/mail-down-mask bitmaps/mail-up-mask
+
+appmandir = $(APP_MAN_DIR)
+
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+
+EXTRA_DIST += $(appman_PRE)
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+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):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/xbiff/Makefile.in b/xbiff/Makefile.in
new file mode 100644 (file)
index 0000000..69764ba
--- /dev/null
@@ -0,0 +1,773 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = xbiff$(EXEEXT)
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+       $(top_srcdir)/configure COPYING ChangeLog INSTALL config.guess \
+       config.sub depcomp install-sh missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_xbiff_OBJECTS = Mailbox.$(OBJEXT) xbiff.$(OBJEXT)
+xbiff_OBJECTS = $(am_xbiff_OBJECTS)
+am__DEPENDENCIES_1 =
+xbiff_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(xbiff_SOURCES)
+DIST_SOURCES = $(xbiff_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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+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@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+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@
+CHANGELOG_CMD = @CHANGELOG_CMD@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
+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@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_CMD = @INSTALL_CMD@
+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@
+MAKEINFO = @MAKEINFO@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XBIFF_CFLAGS = @XBIFF_CFLAGS@
+XBIFF_LIBS = @XBIFF_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__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@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CFLAGS = $(CWARNFLAGS) $(XBIFF_CFLAGS) -D_BSD_SOURCE
+xbiff_LDADD = $(XBIFF_LIBS)
+xbiff_SOURCES = \
+        Mailbox.c \
+        Mailbox.h \
+        MailboxP.h \
+        xbiff.c
+
+appman_PRE = \
+        xbiff.man
+
+EXTRA_DIST = bitmaps/mail-down bitmaps/mail-up bitmaps/mail-down-mask \
+       bitmaps/mail-up-mask $(appman_PRE)
+appmandir = $(APP_MAN_DIR)
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+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) --foreign'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign 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)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+       @if test ! -f $@; then \
+         rm -f stamp-h1; \
+         $(MAKE) $(AM_MAKEFLAGS) 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) 
+       ($(am__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)'; test -n "$(bindir)" || list=; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p; \
+         then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+xbiff$(EXEEXT): $(xbiff_OBJECTS) $(xbiff_DEPENDENCIES) 
+       @rm -f xbiff$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(xbiff_OBJECTS) $(xbiff_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mailbox.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xbiff.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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) '$<'`
+install-appmanDATA: $(appman_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)"
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \
+       done
+
+uninstall-appmanDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appmandir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appmandir)" && rm -f $$files
+
+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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       set x; \
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       $(am__remove_distdir)
+       test -d "$(distdir)" || mkdir "$(distdir)"
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$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
+       -test -n "$(am__skip_mode_fix)" \
+       || find "$(distdir)" -type d ! -perm -755 \
+               -exec chmod u+rwx,go+rx {} \; -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 $(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-lzma: distdir
+       tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+       $(am__remove_distdir)
+
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+       $(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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+       *.tar.bz2*) \
+         bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.lzma*) \
+         lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+       *.tar.Z*) \
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+       *.shar.gz*) \
+         GZIP=$(GZIP_ENV) gzip -dc $(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)
+       test -d $(distdir)/_build || exit 0; \
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && am__cwd=`pwd` \
+         && $(am__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 \
+         && cd "$$am__cwd" \
+         || exit 1
+       $(am__remove_distdir)
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+       @$(am__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)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-appmanDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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
+
+.MAKE: all install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+       clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
+       dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \
+       dist-zip distcheck distclean distclean-compile \
+       distclean-generic distclean-hdr distclean-tags distcleancheck \
+       distdir distuninstallcheck dvi dvi-am html html-am info \
+       info-am install install-am install-appmanDATA \
+       install-binPROGRAMS install-data install-data-am install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+       tags uninstall uninstall-am uninstall-appmanDATA \
+       uninstall-binPROGRAMS
+
+
+.man.$(APP_MAN_SUFFIX):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
+
+# 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/xbiff/README b/xbiff/README
new file mode 100644 (file)
index 0000000..a8613bd
--- /dev/null
@@ -0,0 +1,27 @@
+xbiff provides graphical notification of new e-mail.
+It only handles mail stored in a filesystem accessible file,
+not via IMAP, POP or other remote access protocols.
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+        http://lists.freedesktop.org/mailman/listinfo/xorg
+
+Please submit bug reports to the Xorg bugzilla:
+
+        https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+The master development code repository can be found at:
+
+        git://anongit.freedesktop.org/git/xorg/app/xbiff
+
+        http://cgit.freedesktop.org/xorg/app/xbiff
+
+For patch submission instructions, see:
+
+       http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
+For more information on the git code manager, see:
+
+        http://wiki.x.org/wiki/GitPage
+
diff --git a/xbiff/aclocal.m4 b/xbiff/aclocal.m4
new file mode 100644 (file)
index 0000000..ce9e7c0
--- /dev/null
@@ -0,0 +1,1784 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009  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.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
+[m4_warning([this file was generated for autoconf 2.65.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11.1], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# 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, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# 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])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+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, 2006, 2009
+# 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 10
+
+# 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], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$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
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    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, 2006, 2008, 2009 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 16
+
+# 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.62])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
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+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
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_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)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+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
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_AM_DEPENDENCIES(OBJC)],
+                 [define([AC_PROG_OBJC],
+                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# 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_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
+                         (and sometimes confusing) to the casual installer],
+      [USE_MAINTAINER_MODE=$enableval],
+      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  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, 2009  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_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.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
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+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, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# 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
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# 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, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _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],
+[m4_foreach_w([_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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# 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
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# 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) 2009  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 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# 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="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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
+
+dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
+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 ensure that this macro is defined, also add:
+# m4_ifndef([XORG_MACROS_VERSION],
+#     [m4_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.
+m4_defun([XORG_MACROS_VERSION],[
+m4_define([vers_have], [1.4.1])
+m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
+m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
+m4_if(m4_cmp(maj_have, maj_needed), 0,,
+    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
+m4_if(m4_version_compare(vers_have, [$1]), -1,
+    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
+m4_undefine([vers_have])
+m4_undefine([maj_have])
+m4_undefine([maj_needed])
+]) # 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])
+       # under Cygwin unix is still defined even with -undef
+       elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+               RAWCPPFLAGS="-undef -ansi"
+               AC_MSG_RESULT([yes, with -ansi])
+       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],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+
+if test x"$cross_compiling" = x"yes" ; then
+  HAVE_DEFS_ENT=no
+else
+  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+fi
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+AC_PATH_PROG(PS2PDF, ps2pdf)
+
+AC_MSG_CHECKING([Whether to build documentation])
+
+if test x$HAVE_DEFS_ENT != 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 && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([Whether to build text documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([Whether to build PDF documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([Whether to build PostScript documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([Whether to build HTML documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# 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,
+       AS_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],
+               [MALLOC_ZERO_RETURNS_NULL=yes])
+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, [AS_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, [AS_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
+
+# XORG_CWARNFLAGS
+# ---------------
+# Minimum version: 1.2.0
+#
+# Defines CWARNFLAGS to enable C compiler warnings.
+#
+AC_DEFUN([XORG_CWARNFLAGS], [
+AC_REQUIRE([AC_PROG_CC])
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+AC_SUBST(CWARNFLAGS)
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+]) # XORG_CWARNFLAGS
+
+# XORG_STRICT_OPTION
+# -----------------------
+# Minimum version: 1.3.0
+#
+# Add configure option to enable strict compilation
+AC_DEFUN([XORG_STRICT_OPTION], [
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CC_C99])
+AC_REQUIRE([XORG_CWARNFLAGS])
+
+AC_ARG_ENABLE(strict-compilation,
+                         AS_HELP_STRING([--enable-strict-compilation],
+                         [Enable all warnings from compiler and make them errors (default: disabled)]),
+                         [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
+if test "x$STRICT_COMPILE" = "xyes"; then
+       AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+       AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+AC_SUBST([CWARNFLAGS])
+]) # XORG_STRICT_OPTION
+
+# XORG_DEFAULT_OPTIONS
+# --------------------
+# Minimum version: 1.3.0
+#
+# Defines default options for X.Org modules.
+#
+AC_DEFUN([XORG_DEFAULT_OPTIONS], [
+XORG_CWARNFLAGS
+XORG_STRICT_OPTION
+XORG_RELEASE_VERSION
+XORG_CHANGELOG
+XORG_INSTALL
+XORG_MANPAGE_SECTIONS
+]) # XORG_DEFAULT_OPTIONS
+
+# XORG_INSTALL()
+# ----------------
+# Minimum version: 1.4.0
+#
+# Defines the variable INSTALL_CMD as the command to copy
+# INSTALL from $prefix/share/doc/util-macros.
+#
+AC_DEFUN([XORG_INSTALL], [
+AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+macros_docdir=$($PKG_CONFIG --print-errors --variable=docdir xorg-macros)
+INSTALL_CMD="(cp -f "$macros_docdir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"docdir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+AC_SUBST([INSTALL_CMD])
+]) # XORG_INSTALL
+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.  Also
+# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+AC_DEFUN([XORG_RELEASE_VERSION],[
+       AC_ARG_WITH(release-version,
+                       AS_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
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+               [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+               [Major version of this package])
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+               [$PVM],
+               [Minor version of this package])
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+               [$PVP],
+               [Patch version of this package])
+])
+
+# XORG_CHANGELOG()
+# ----------------
+# Minimum version: 1.2.0
+#
+# Defines the variable CHANGELOG_CMD as the command to generate
+# ChangeLog from git.
+#
+#
+AC_DEFUN([XORG_CHANGELOG], [
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+AC_SUBST([CHANGELOG_CMD])
+]) # XORG_CHANGELOG
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# 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 "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _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 --print-errors "$2" 2>&1`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       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 <http://pkg-config.freedesktop.org/>.])],
+               [$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
+
diff --git a/xbiff/bitmaps/mail-down b/xbiff/bitmaps/mail-down
new file mode 100644 (file)
index 0000000..9d8a59d
--- /dev/null
@@ -0,0 +1,27 @@
+#define mail_down_width 48
+#define mail_down_height 48
+static char mail_down_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/xbiff/bitmaps/mail-down-mask b/xbiff/bitmaps/mail-down-mask
new file mode 100644 (file)
index 0000000..5f5a62f
--- /dev/null
@@ -0,0 +1,29 @@
+#define mail_down_mask_width 48
+#define mail_down_mask_height 48
+#define mail_down_mask_x_hot -1
+#define mail_down_mask_y_hot -1
+static char mail_down_mask_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/xbiff/bitmaps/mail-up b/xbiff/bitmaps/mail-up
new file mode 100644 (file)
index 0000000..2aabbdd
--- /dev/null
@@ -0,0 +1,27 @@
+#define mail_up_width 48
+#define mail_up_height 48
+static char mail_up_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20,
+   0x00, 0xfa, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a,
+   0x00, 0x3a, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2e,
+   0xe0, 0xff, 0xff, 0xff, 0xff, 0x21, 0x20, 0x00, 0x00, 0x00, 0x00, 0x21,
+   0xa0, 0x03, 0x00, 0x00, 0x70, 0x21, 0x20, 0x00, 0x00, 0x00, 0x50, 0x21,
+   0xa0, 0x1f, 0x00, 0x00, 0x50, 0x21, 0x20, 0x00, 0x00, 0x00, 0x70, 0x21,
+   0xfe, 0xff, 0xff, 0xff, 0x0f, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x21,
+   0xfa, 0x01, 0x00, 0x80, 0x0b, 0x21, 0x02, 0x00, 0x00, 0x80, 0x0a, 0x21,
+   0xba, 0x01, 0x00, 0x80, 0x0a, 0x21, 0x02, 0x00, 0x00, 0x80, 0x0b, 0x21,
+   0x3a, 0x00, 0x00, 0x00, 0x08, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x21,
+   0x02, 0xc0, 0xfb, 0x03, 0x08, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x3f,
+   0x02, 0xc0, 0xbd, 0x0f, 0x08, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01,
+   0x02, 0xc0, 0x7f, 0x7b, 0x08, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01,
+   0x02, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00,
+   0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00,
+   0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00,
+   0xfe, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/xbiff/bitmaps/mail-up-mask b/xbiff/bitmaps/mail-up-mask
new file mode 100644 (file)
index 0000000..002e54e
--- /dev/null
@@ -0,0 +1,29 @@
+#define mail_up_mask_width 48
+#define mail_up_mask_height 48
+#define mail_up_mask_x_hot -1
+#define mail_up_mask_y_hot -1
+static char mail_up_mask_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0x00, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0x00, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0x00, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0xf0, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0xf0, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0xf0, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,
+   0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00,
+   0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00,
+   0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/xbiff/config.guess b/xbiff/config.guess
new file mode 100755 (executable)
index 0000000..dc84c68
--- /dev/null
@@ -0,0 +1,1501 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+#   Free Software Foundation, Inc.
+
+timestamp='2009-11-20'
+
+# 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 (context
+# diff format) to <config-patches@gnu.org> and include a 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.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+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 <config-patches@gnu.org>."
+
+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, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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 "$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 ;;
+           sh5el) machine=sh5le-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 -q __ELF__
+               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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+       echo i386-pc-auroraux${UNAME_RELEASE}
+       exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+       eval $set_cc_for_build
+       SUN_ARCH="i386"
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       echo ${SUN_ARCH}-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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:*:[456])
+       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+               IBM_ARCH=rs6000
+       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 <stdlib.h>
+              #include <unistd.h>
+
+              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 -q __LP64__
+           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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       exit ;;
+    i*:CYGWIN*:*)
+       echo ${UNAME_MACHINE}-pc-cygwin
+       exit ;;
+    *: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 ;;
+    *:Interix*:*)
+       case ${UNAME_MACHINE} in
+           x86)
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           authenticamd | genuineintel | EM64T)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+           IA64)
+               echo ia64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+       esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       exit ;;
+    8664:Windows_NT:*)
+       echo x86_64-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*:*:* | x86_64: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 ;;
+    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 -q ld.so.1
+       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+       exit ;;
+    arm*:Linux:*:*)
+       eval $set_cc_for_build
+       if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_EABI__
+       then
+           echo ${UNAME_MACHINE}-unknown-linux-gnu
+       else
+           echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+       fi
+       exit ;;
+    avr32*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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 ;;
+    i*86:Linux:*:*)
+       LIBC=gnu
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+       echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+       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:*:* | mips64:Linux:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #undef CPU
+       #undef ${UNAME_MACHINE}
+       #undef ${UNAME_MACHINE}el
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=${UNAME_MACHINE}el
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       CPU=${UNAME_MACHINE}
+       #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; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-unknown-linux-gnu
+       exit ;;
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-gnu
+       exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+       echo hppa64-unknown-linux-gnu
+       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 ;;
+    ppc64:Linux:*:*)
+       echo powerpc64-unknown-linux-gnu
+       exit ;;
+    ppc:Linux:*:*)
+       echo powerpc-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 ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-gnu
+       exit ;;
+    x86_64:Linux:*:*)
+       echo x86_64-unknown-linux-gnu
+       exit ;;
+    xtensa*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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.[02]*:*)
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-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; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       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; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; 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.[02]*:*)
+       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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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 ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       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 ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-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
+           i386)
+               eval $set_cc_for_build
+               if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+                 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+                     (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+                     grep IS_64BIT_ARCH >/dev/null
+                 then
+                     UNAME_PROCESSOR="x86_64"
+                 fi
+               fi ;;
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/xbiff/config.h.in b/xbiff/config.h.in
new file mode 100644 (file)
index 0000000..7c9cfb1
--- /dev/null
@@ -0,0 +1,64 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* 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 home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
diff --git a/xbiff/config.sub b/xbiff/config.sub
new file mode 100755 (executable)
index 0000000..2a55a50
--- /dev/null
@@ -0,0 +1,1705 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+#   Free Software Foundation, Inc.
+
+timestamp='2009-11-20'
+
+# 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 <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted GNU 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.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# 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 <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-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 | -microblaze)
+               os=
+               basic_machine=$1
+               ;;
+        -bluegene*)
+               os=-cnk
+               ;;
+       -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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | bfin \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fido | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | lm32 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore | mep | metag \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64octeon | mips64octeonel \
+       | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | moxie \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | rx \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | ubicom32 \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | z8k | z80)
+               basic_machine=$basic_machine-unknown
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12 | picochip)
+               # Motorola 68HC11/12.
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64octeon-* | mips64octeonel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | none-* | np1-* | ns16k-* | ns32k-* \
+       | orion-* \
+       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+       | pyramid-* \
+       | romp-* | rs6000-* | rx-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+       | tron-* \
+       | ubicom32-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa*-* \
+       | ymp-* \
+       | z8k-* | z80-*)
+               ;;
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               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
+               ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       bluegene*)
+               basic_machine=powerpc-ibm
+               os=-cnk
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+        cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
+       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
+               ;;
+       cr16)
+               basic_machine=cr16-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
+               ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
+       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
+               ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       m88k-omron*)
+               basic_machine=m88k-omron
+               ;;
+       magnum | m3230)
+               basic_machine=mips-mips
+               os=-sysv
+               ;;
+       merlin)
+               basic_machine=ns32k-utek
+               os=-sysv
+               ;;
+        microblaze)
+               basic_machine=microblaze-xilinx
+               ;;
+       mingw32)
+               basic_machine=i386-pc
+               os=-mingw32
+               ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
+       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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       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
+               ;;
+       tile*)
+               basic_machine=tile-unknown
+               os=-linux-gnu
+               ;;
+       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
+               ;;
+       z80-*-coff)
+               basic_machine=z80-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[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+               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.
+        -auroraux)
+               os=-auroraux
+               ;;
+       -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* | -cnk* | -sunos | -sunos[34]*\
+             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+             | -sym* | -kopensolaris* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* | -aros* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
+             | -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* | -cegcc* \
+             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -linux-newlib* | -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* | -rdos* | -toppers* | -drops* | -es*)
+       # 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
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+       -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
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
+       *-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
+               ;;
+        mep-*)
+               os=-elf
+               ;;
+       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
+                               ;;
+                       -cnk*|-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/xbiff/configure b/xbiff/configure
new file mode 100755 (executable)
index 0000000..05866a7
--- /dev/null
@@ -0,0 +1,6014 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.65 for xbiff 1.0.2.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+        /*)
+          for as_base in sh bash ksh sh5; do
+            # Try only shells that exist, to save several forks.
+            as_shell=$as_dir/$as_base
+            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+          done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+       # neutralization value for shells without unset; and this also
+       # works around shells that cannot unset nonexistent variables.
+       BASH_ENV=/dev/null
+       ENV=/dev/null
+       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+       export CONFIG_SHELL
+       exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$?; test $as_status -eq 0 && as_status=1
+  if test "$3"; then
+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  fi
+  $as_echo "$as_me: error: $1" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# 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`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='xbiff'
+PACKAGE_TARNAME='xbiff'
+PACKAGE_VERSION='1.0.2'
+PACKAGE_STRING='xbiff 1.0.2'
+PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+XBIFF_LIBS
+XBIFF_CFLAGS
+ADMIN_MAN_DIR
+DRIVER_MAN_DIR
+MISC_MAN_DIR
+FILE_MAN_DIR
+LIB_MAN_DIR
+APP_MAN_DIR
+ADMIN_MAN_SUFFIX
+DRIVER_MAN_SUFFIX
+MISC_MAN_SUFFIX
+FILE_MAN_SUFFIX
+LIB_MAN_SUFFIX
+APP_MAN_SUFFIX
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+INSTALL_CMD
+PKG_CONFIG
+CHANGELOG_CMD
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+CWARNFLAGS
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_silent_rules
+enable_strict_compilation
+with_release_version
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+PKG_CONFIG
+XBIFF_CFLAGS
+XBIFF_LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)   ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=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 ;;
+
+  -*) as_fn_error "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information."
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_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'`
+  as_fn_error "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
+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
+    $as_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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error "pwd does not report name of working directory"
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 xbiff 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/xbiff]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_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 xbiff 1.0.2:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --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
+  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')
+  --enable-strict-compilation
+                          Enable all warnings from compiler and make them
+                          errors (default: disabled)
+
+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<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  PKG_CONFIG  path to pkg-config utility
+  XBIFF_CFLAGS
+              C compiler flags for XBIFF, overriding pkg-config
+  XBIFF_LIBS  linker flags for XBIFF, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+xbiff configure 1.0.2
+generated by GNU Autoconf 2.65
+
+Copyright (C) 2009 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
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR
+# ------------------------------------
+# Tests whether SYMBOL is declared, setting cache variable VAR accordingly.
+ac_fn_c_check_decl ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5
+$as_echo_n "checking whether $2 is declared... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+#ifndef $2
+  (void) $2;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_decl
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_compile
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by xbiff $as_me 1.0.2, which was
+generated by GNU Autoconf 2.65.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append 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
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+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,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > 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
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_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.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_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 $ac_precious_vars; 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,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_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
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_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.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+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.11'
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  for ac_t in install-sh install.sh shtool; do
+    if test -f "$ac_dir/$ac_t"; then
+      ac_aux_dir=$ac_dir
+      ac_install_sh="$ac_aux_dir/$ac_t -c"
+      break 2
+    fi
+  done
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$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'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# 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".
+      as_fn_error "ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "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 $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+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='xbiff'
+ 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"}
+
+# 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 -'
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-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
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$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
+
+
+
+# Require xorg-macros 1.3 or later: XORG_DEFAULT_OPTIONS
+
+
+
+
+
+
+
+
+
+
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+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
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "no acceptable C compiler found in \$PATH
+See \`config.log' for more details." "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM 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.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "C compiler cannot create executables
+See \`config.log' for more details." "$LINENO" 5; }; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+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
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-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=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+  $as_echo_n "(cached) " >&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
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$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
+
+
+
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." "$LINENO" 5; }
+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
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+eval as_val=\$$as_ac_Header
+   if test "x$as_val" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if test "${ac_cv_prog_cc_c99+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+       {
+       case 's': // string
+         str = va_arg (args_copy, const char *);
+         break;
+       case 'd': // int
+         number = va_arg (args_copy, int);
+         break;
+       case 'f': // float
+         fnumber = va_arg (args_copy, double);
+         break;
+       default:
+         break;
+       }
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+         || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+fi
+
+
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default"
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then :
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=0;;
+esac
+AM_BACKSLASH='\'
+
+
+
+
+
+
+
+# Check whether --enable-strict-compilation was given.
+if test "${enable_strict_compilation+set}" = set; then :
+  enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval
+else
+  STRICT_COMPILE=no
+fi
+
+if test "x$STRICT_COMPILE" = "xyes"; then
+       ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default"
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then :
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+       ac_fn_c_check_decl "$LINENO" "__INTEL_COMPILER" "ac_cv_have_decl___INTEL_COMPILER" "$ac_includes_default"
+if test "x$ac_cv_have_decl___INTEL_COMPILER" = x""yes; then :
+  INTELCC="yes"
+else
+  INTELCC="no"
+fi
+
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+
+
+
+
+# Check whether --with-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"
+               { $as_echo "$as_me:${as_lineno-$LINENO}: Building with package name set to $PACKAGE" >&5
+$as_echo "$as_me: Building with package name set to $PACKAGE" >&6;}
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+
+
+
+
+macros_docdir=$($PKG_CONFIG --print-errors --variable=docdir xorg-macros)
+INSTALL_CMD="(cp -f "$macros_docdir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"docdir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XBIFF" >&5
+$as_echo_n "checking for XBIFF... " >&6; }
+
+if test -n "$XBIFF_CFLAGS"; then
+    pkg_cv_XBIFF_CFLAGS="$XBIFF_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xaw7 xbitmaps xext\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xaw7 xbitmaps xext") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XBIFF_CFLAGS=`$PKG_CONFIG --cflags "xaw7 xbitmaps xext" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XBIFF_LIBS"; then
+    pkg_cv_XBIFF_LIBS="$XBIFF_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xaw7 xbitmaps xext\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xaw7 xbitmaps xext") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XBIFF_LIBS=`$PKG_CONFIG --libs "xaw7 xbitmaps xext" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               XBIFF_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xaw7 xbitmaps xext" 2>&1`
+        else
+               XBIFF_PKG_ERRORS=`$PKG_CONFIG --print-errors "xaw7 xbitmaps xext" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XBIFF_PKG_ERRORS" >&5
+
+       as_fn_error "Package requirements (xaw7 xbitmaps xext) were not met:
+
+$XBIFF_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 XBIFF_CFLAGS
+and XBIFF_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 XBIFF_CFLAGS
+and XBIFF_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." "$LINENO" 5; }
+else
+       XBIFF_CFLAGS=$pkg_cv_XBIFF_CFLAGS
+       XBIFF_LIBS=$pkg_cv_XBIFF_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     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" &&
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+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_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $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}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$?; test $as_status -eq 0 && as_status=1
+  if test "$3"; then
+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  fi
+  $as_echo "$as_me: error: $1" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by xbiff $as_me 1.0.2, which was
+generated by GNU Autoconf 2.65.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+xbiff config.status 1.0.2
+configured by $0, generated by GNU Autoconf 2.65,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2009 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+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
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  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 || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || as_fn_error "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# 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
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #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.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # 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.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || as_fn_error "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || as_fn_error "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+       || as_fn_error "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$_am_arg" : 'X\(//\)[^/]' \| \
+        X"$_am_arg" : 'X\(//\)$' \| \
+        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_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=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# 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 || as_fn_exit $?
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/xbiff/configure.ac b/xbiff/configure.ac
new file mode 100644 (file)
index 0000000..1ded032
--- /dev/null
@@ -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(xbiff, [1.0.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xbiff)
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros 1.3 or later: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+         [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+
+AM_CONFIG_HEADER(config.h)
+
+AC_PROG_CC
+AC_PROG_INSTALL
+
+XORG_DEFAULT_OPTIONS
+
+PKG_CHECK_MODULES(XBIFF, xaw7 xbitmaps xext)
+
+AC_SUBST(XBIFF_CFLAGS)
+AC_SUBST(XBIFF_LIBS)
+
+AC_OUTPUT([Makefile])
diff --git a/xbiff/depcomp b/xbiff/depcomp
new file mode 100755 (executable)
index 0000000..df8eea7
--- /dev/null
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s,\\\\\\\\,/,g"
+   depmode=msvisualcpp
+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.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    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.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[     ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "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"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${
+              s/^ *//
+              s/ \\*$//
+              s/$/:/
+              p
+            }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # 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 mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $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 "X$1" != 'X--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 "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    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.
+    -arch)
+      eat=yes ;;
+    -*|$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 "X$1" != 'X--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.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::     \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # 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
+  ;;
+
+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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xbiff/install-sh b/xbiff/install-sh
new file mode 100755 (executable)
index 0000000..6781b98
--- /dev/null
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# 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.
+
+nl='
+'
+IFS=" ""       $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+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:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+       shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+       case $mode in
+         *' '* | *'    '* | *'
+'*       | *'*'* | *'?'* | *'['*)
+           echo "$0: invalid mode: $mode" >&2
+           exit 1;;
+       esac
+       shift;;
+
+    -o) chowncmd="$chownprog $2"
+       shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+       shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)        shift
+       break;;
+
+    -*)        echo "$0: invalid option: $1" >&2
+       exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # 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: $dst_arg: Is a directory" >&2
+       exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+       (dirname "$dst") 2>/dev/null ||
+       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+            X"$dst" : 'X\(//\)[^/]' \| \
+            X"$dst" : 'X\(//\)$' \| \
+            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+       echo X"$dst" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+       # Create intermediate dirs using mode 755 as modified by the umask.
+       # This is like FreeBSD 'install' as of 1997-10-28.
+       umask=`umask`
+       case $stripcmd.$umask in
+         # Optimize common cases.
+         *[2367][2367]) mkdir_umask=$umask;;
+         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+         *[0-7])
+           mkdir_umask=`expr $umask + 22 \
+             - $umask % 100 % 40 + $umask % 20 \
+             - $umask % 10 % 4 + $umask % 2
+           `;;
+         *) mkdir_umask=$umask,go-w;;
+       esac
+
+       # With -d, create the new directory with the user-specified mode.
+       # Otherwise, rely on $mkdir_umask.
+       if test -n "$dir_arg"; then
+         mkdir_mode=-m$mode
+       else
+         mkdir_mode=
+       fi
+
+       posix_mkdir=false
+       case $umask in
+         *[123567][0-7][0-7])
+           # POSIX mkdir -p sets u+wx bits regardless of umask, which
+           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+           ;;
+         *)
+           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+           if (umask $mkdir_umask &&
+               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+           then
+             if test -z "$dir_arg" || {
+                  # Check for POSIX incompatibilities with -m.
+                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                  # other-writeable bit of parent directory when it shouldn't.
+                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                  case $ls_ld_tmpdir in
+                    d????-?r-*) different_mode=700;;
+                    d????-?--*) different_mode=755;;
+                    *) false;;
+                  esac &&
+                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                  }
+                }
+             then posix_mkdir=:
+             fi
+             rmdir "$tmpdir/d" "$tmpdir"
+           else
+             # Remove any dirs left behind by ancient mkdir implementations.
+             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+           fi
+           trap '' 0;;
+       esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+       umask $mkdir_umask &&
+       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+       /*) prefix='/';;
+       -*) prefix='./';;
+       *)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+       test -z "$d" && continue
+
+       prefix=$prefix$d
+       if test -d "$prefix"; then
+         prefixes=
+       else
+         if $posix_mkdir; then
+           (umask=$mkdir_umask &&
+            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+           # Don't fail if two instances are running concurrently.
+           test -d "$prefix" || exit 1
+         else
+           case $prefix in
+             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+             *) qprefix=$prefix;;
+           esac
+           prefixes="$prefixes '$qprefix'"
+         fi
+       fi
+       prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+       # Don't fail if two instances are running concurrently.
+       (umask $mkdir_umask &&
+        eval "\$doit_exec \$mkdirprog $prefixes") ||
+         test -d "$dstdir" || exit 1
+       obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # 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
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"    2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+       # Now remove or move aside any old file at destination location.
+       # We try this two ways since rm can't unlink itself on some
+       # systems and the destination file might be busy for other
+       # reasons.  In this case, the final cleanup might fail but the new
+       # file should still install successfully.
+       {
+         test ! -f "$dst" ||
+         $doit $rmcmd -f "$dst" 2>/dev/null ||
+         { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+           { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+         } ||
+         { echo "$0: cannot unlink or rename $dst" >&2
+           (exit 1); exit 1
+         }
+       } &&
+
+       # Now rename the file to the real destination.
+       $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xbiff/missing b/xbiff/missing
new file mode 100755 (executable)
index 0000000..28055d2
--- /dev/null
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# 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=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+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'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  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]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
+# 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).  This is about non-GNU programs, so use $1 not
+# $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 $program 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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if test ! -f y.tab.h; then
+       echo >y.tab.h
+    fi
+    if test ! -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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if test ! -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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit $?
+    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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+       /^@setfilename/{
+         s/.* \([^ ]*\) *$/\1/
+         p
+         q
+       }' $infile`
+      # ... 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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xbiff/xbiff.c b/xbiff/xbiff.c
new file mode 100644 (file)
index 0000000..a5ecdef
--- /dev/null
@@ -0,0 +1,123 @@
+/* $XConsortium: xbiff.c,v 1.19 94/04/17 20:43:28 rws Exp $ */
+/*
+
+Copyright (c) 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86: xc/programs/xbiff/xbiff.c,v 1.3tsi Exp $ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <X11/Xatom.h>
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include "Mailbox.h"
+#include <X11/Xaw/Cardinals.h>
+
+static const char *ProgramName;
+
+static XrmOptionDescRec options[] = {
+{ "-update", "*mailbox.update", XrmoptionSepArg, (caddr_t) NULL },
+{ "-file",   "*mailbox.file", XrmoptionSepArg, (caddr_t) NULL },
+{ "-volume", "*mailbox.volume", XrmoptionSepArg, (caddr_t) NULL },
+{ "-shape",  "*mailbox.shapeWindow", XrmoptionNoArg, (caddr_t) "on" },
+};
+
+static Atom wm_delete_window;
+
+static void quit (Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    if (event->type == ClientMessage &&
+        event->xclient.data.l[0] != wm_delete_window) {
+        XBell (XtDisplay(w), 0);
+        return;
+    }
+    XCloseDisplay (XtDisplay(w));
+    exit (0);
+}
+
+static XtActionsRec xbiff_actions[] = {
+    { "quit", quit },
+};
+
+static void Usage (void)
+{
+    static const char *help_message[] = {
+"where options include:",
+"    -display host:dpy              X server to contact",
+"    -geometry geom                 size of mailbox",
+"    -file file                     file to watch",
+"    -update seconds                how often to check for mail",
+"    -volume percentage             how loud to ring the bell",
+"    -bg color                      background color",
+"    -fg color                      foreground color",
+"    -rv                            reverse video",
+"    -shape                         shape the window",
+NULL};
+    const char **cpp;
+
+    fprintf (stderr, "usage:  %s [-options ...]\n", ProgramName);
+    for (cpp = help_message; *cpp; cpp++)
+       fprintf (stderr, "%s\n", *cpp);
+    fprintf (stderr, "\n");
+    exit (1);
+}
+
+
+int
+main (int argc, char **argv)
+{
+    XtAppContext xtcontext;
+    Widget toplevel;
+
+    ProgramName = argv[0];
+
+    XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
+
+    toplevel = XtAppInitialize(&xtcontext, "XBiff", options, XtNumber (options),
+                              &argc, argv, NULL, NULL, 0);
+    if (argc != 1) Usage ();
+
+    /*
+     * This is a hack so that f.delete will do something useful in this
+     * single-window application.
+     */
+    wm_delete_window = XInternAtom (XtDisplay(toplevel), "WM_DELETE_WINDOW",
+                                    False);
+    XtAppAddActions (xtcontext, xbiff_actions, XtNumber(xbiff_actions));
+    XtOverrideTranslations(toplevel,
+                  XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()"));
+
+    (void) XtCreateManagedWidget ("mailbox", mailboxWidgetClass, toplevel,
+                                 NULL, 0);
+    XtRealizeWidget (toplevel);
+    (void) XSetWMProtocols (XtDisplay(toplevel), XtWindow(toplevel),
+                            &wm_delete_window, 1);
+    XtAppMainLoop (xtcontext);
+
+    return 0;
+}
diff --git a/xbiff/xbiff.man b/xbiff/xbiff.man
new file mode 100644 (file)
index 0000000..38ba28c
--- /dev/null
@@ -0,0 +1,216 @@
+.\" $XConsortium: xbiff.man,v 1.22 94/04/17 20:43:28 gildea Exp $
+.\" Copyright (c) 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+.\" from the X Consortium.
+.\"
+.\" $XFree86: xc/programs/xbiff/xbiff.man,v 1.3 2001/01/27 18:21:08 dawes Exp $
+.\"
+.TH XBIFF 1 __xorgversion__
+.SH NAME
+xbiff \- mailbox flag for X
+.SH SYNOPSIS
+.B xbiff
+[ \-\fItoolkitoption\fP ... ] [ \fI\-option\fP ... ]
+.SH DESCRIPTION
+The
+.I xbiff
+program displays a little image of a mailbox.  When there is no mail,
+the flag on the mailbox is down.  When mail arrives, the flag goes up
+and the mailbox beeps.  By default, pressing any mouse button in the
+image forces \fIxbiff\fP to remember the current size of the mail file
+as being the ``empty'' size and to lower the flag.
+.SH OPTIONS
+.I Xbiff
+accepts all of the standard X Toolkit command line options along with the
+additional options listed below:
+.TP 8
+.B \-help
+This option indicates that a brief summary of the allowed options should be
+printed on the standard error.
+.TP 8
+.B \-update \fIseconds\fP
+This option specifies the frequency in seconds at which \fIxbiff\fP
+should update its display.  If the mailbox is obscured and then exposed,
+it will be updated immediately.  The default is 30 seconds.
+.TP 8
+.B \-file \fIfilename\fP
+This option specifies the name of the file which should be monitored.  By
+default it watches your inbox in the default location for your
+system (some examples are
+.RI /var/mail/ username ,
+.RI /usr/spool/mail/ username ,
+.RI /var/spool/mail/ username
+(where
+.I username
+is your login name).  If the MAIL environment variable is set,
+the file specified by it will be monitored.
+.TP 8
+.B \-volume \fIpercentage\fP
+This option specifies how loud the bell should be rung when new mail comes in.
+.TP 8
+.B \-shape
+This option indicates that the mailbox window should be shaped if masks for
+the empty or full images are given.
+.PP
+The following standard X Toolkit command line arguments are commonly used with 
+.I xbiff:
+.TP 8
+.B \-display \fIdisplay\fP
+This option specifies the X server to contact.
+.TP 8
+.B \-geometry \fIgeometry\fP
+This option specifies the preferred size and position of the mailbox window.
+The mailbox is 48 pixels wide and 48 pixels high and will be centered in
+the window.
+.TP 8
+.B \-bg \fIcolor\fP
+This option specifies the color to use for the background of the window.  
+.TP 8
+.B \-bd \fIcolor\fP
+This option specifies the color to use for the border of the window.
+.TP 8
+.B \-bw \fInumber\fP
+This option specifies the width in pixels of the border surrounding the window.
+.TP 8
+.B \-fg \fIcolor\fP
+This option specifies the color to use for the foreground of the window.
+.TP 8
+.B \-rv
+This option indicates that reverse video should be simulated by swapping
+the foreground and background colors.
+.TP 8
+.B \-xrm \fIresourcestring\fP
+This option specifies a resource string to be used.  This is especially
+useful for setting resources that do not have separate command line options.
+.SH X DEFAULTS
+The application class name is XBiff.
+This program uses the 
+.I Mailbox
+widget.
+It understands all of the core resource names and
+classes as well as:
+.PP
+.TP 8
+.B checkCommand (\fPclass\fB CheckCommand)
+Specifies a shell command to be executed to check for new mail rather than
+examining the size of \fBfile\fP.  The specified string value is used as the
+argument to a \fIsystem\fP(3) call and may therefore contain i/o redirection.
+An exit status of 0 indicates that new mail is waiting, 1 indicates that there
+has been no change in size, and 2 indicates that the mail has been cleared.
+By default, no shell command is provided.
+.TP 8
+.B file (\fPclass\fB File)
+Specifies the name of the file to monitor.  The default is as described
+above for the
+.B \-file
+command line option.
+.TP 8
+.B onceOnly (\fPclass\fB Boolean)
+Specifies that the bell is only rung the first time new mail is found
+and is not rung again until at least one interval has passed with
+no mail waiting.  The window will continue to indicate the presence
+of new mail until it has been retrieved.  The default is false.
+.TP 8
+.B width (\fPclass\fB Width)
+Specifies the width of the mailbox.
+.TP 8
+.B height (\fPclass\fB Height)
+Specifies the height of the mailbox.
+.TP 8
+.B update (\fPclass\fB Interval)
+Specifies the frequency in seconds at which the mail should be checked.
+The default is 30.
+.TP 8
+.B volume (\fPclass\fB Volume)
+Specifies how loud the bell should be rung.  The default is 33 percent.
+.TP 8
+.B foreground (\fPclass\fB Foreground)
+Specifies the color for the foreground.
+.TP 8
+.B reverseVideo (\fPclass\fB ReverseVideo)
+Specifies that the foreground and background should be reversed.
+.TP 8
+.B flip (\fPclass\fB Flip)
+Specifies whether or not the image that is shown when mail has arrived 
+should be inverted.  The default is ``true.''
+.TP 8
+.B fullPixmap (\fPclass\fB Pixmap)
+Specifies a bitmap to be shown when new mail has arrived.
+The default is flagup.
+.TP 8
+.B emptyPixmap (\fPclass\fB Pixmap)
+Specifies a bitmap to be shown when no new mail is present.
+The default is flagdown.
+.TP 8
+.B shapeWindow (\fPclass\fB ShapeWindow)
+Specifies whether or not the mailbox window should be shaped to the
+given fullPixmapMask and emptyPixmapMask.  The default is false.
+.TP 8
+.B fullPixmapMask (\fPclass\fB PixmapMask)
+Specifies a mask for the bitmap to be shown when new mail has arrived.
+The default is none.
+.TP 8
+.B emptyPixmapMask (\fPclass\fB PixmapMask)
+Specifies a mask for the bitmap to be shown when no new mail is present.
+The default is none.
+.SH ACTIONS
+The \fIMailbox\fP widget provides the following actions for use in event
+translations:
+.TP 8
+.B check()
+This action causes the widget to check for new mail and display the flag
+appropriately.
+.TP 8
+.B unset()
+This action causes the widget to lower the flag until new mail comes in.
+.TP 8
+.B set()
+This action causes the widget to raise the flag until the user resets it.
+.PP
+The default translation is 
+.sp
+.nf
+        <ButtonPress>:  unset()
+.fi
+.sp
+.SH ENVIRONMENT
+.PP
+.TP 8
+.B DISPLAY
+to get the default host and display number.
+.TP 8
+.B XENVIRONMENT
+to get the name of a resource file that overrides the global resources
+stored in the RESOURCE_MANAGER property.
+.SH "SEE ALSO"
+X(__miscmansuffix__),
+xrdb(1),
+stat(2)
+.SH BUGS
+The mailbox bitmaps are ugly.
+.SH AUTHOR
+Jim Fulton, MIT X Consortium
+.br
+Additional hacks by Ralph Swick, DEC/MIT Project Athena
diff --git a/xcalc/COPYING b/xcalc/COPYING
new file mode 100644 (file)
index 0000000..42a20fb
--- /dev/null
@@ -0,0 +1,47 @@
+Copyright (c) 1989, 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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+------------------------------------------------------------------------------
+
+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.
diff --git a/xcalc/ChangeLog b/xcalc/ChangeLog
new file mode 100644 (file)
index 0000000..ba79097
--- /dev/null
@@ -0,0 +1,361 @@
+commit 6c21e467c805d62593d34da9e83a2fa2f01798a6
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Dec 17 19:51:44 2009 -0800
+
+    xcalc 1.0.3
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 146b1da64e575d330c2599161938140a4233cb6a
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Dec 17 19:21:22 2009 -0800
+
+    Apply automake silencer to man page generation rule
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit abb1bf5b74642f8d40ca5fbf87490c5186f41590
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Nov 26 09:19:52 2009 -0500
+
+    Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES
+    
+    Now that the INSTALL file is generated.
+    Allows running make maintainer-clean.
+
+commit 109d08574cf3d951d73668a5a23c97dad94d6e75
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Wed Oct 28 14:09:08 2009 -0400
+
+    INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206
+    
+    Add missing INSTALL file. Use standard GNU file on building tarball
+    README may have been updated
+    Remove AUTHORS file as it is empty and no content available yet.
+    Remove NEWS file as it is empty and no content available yet.
+
+commit dc35d949925e76e74403b4aea02c2ff198bf0ec6
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Tue Oct 27 15:07:24 2009 -0400
+
+    Deploy the new XORG_DEFAULT_OPTIONS #24242
+    
+    This macro aggregate a number of existing macros that sets commmon
+    X.Org components configuration options. It shields the configuration file from
+    future changes.
+
+commit 31a1d8fc1486e6dd0cb9c5ba569c820b3b79d890
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Mon Oct 26 22:08:38 2009 -0400
+
+    Makefile.am: ChangeLog not required: EXTRA_DIST or *CLEANFILES #24432
+    
+    ChangeLog filename is known to Automake and requires no further
+    coding in the makefile.
+
+commit befb756a62a11a857f20f903b8b892768a58e229
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Oct 22 12:34:15 2009 -0400
+
+    .gitignore: use common defaults with custom section # 24239
+    
+    Using common defaults will reduce errors and maintenance.
+    Only the very small or inexistent custom section need periodic maintenance
+    when the structure of the component changes. Do not edit defaults.
+
+commit eab3461ac8e9e809094f45ca2084ddf7b4485035
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Sep 27 15:37:25 2009 -0400
+
+    Makefile.am: do not include autogen.sh in distribution #24183
+    
+    This is a private build script that should not be distributed
+
+commit b685a52aa117e9c7841fdb9b9e6b44fe898cd929
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Oct 1 14:54:20 2009 -0700
+
+    Add README with pointers to mailing lists, bugzilla, & git
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit dd6ca812a9e540ade4afd5db9dd13ea7ed3ea3ab
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Mon Jan 12 20:09:07 2009 -0200
+
+    Ansification and compile warning fixes.
+    
+      This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects
+    make distcheck and all gcc 4.3 and sparse warnings.
+
+commit fd75efe1d9b57c483f7cedd9e2dce34b97eef75e
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Wed Aug 20 10:32:49 2008 -0400
+
+    xaw8 is gone, use xaw7
+
+commit e8360958ef3dba1e7ab8282c5055b0ccf5650f1c
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Fri May 16 14:20:03 2008 +0200
+
+    $(builddir) is the current directory
+    
+    Apparently automake doesn't always export the builddir variable.
+    This fixes my previous commit.
+
+commit d3849e5474e65d2cf4212118896883330752c763
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Sun Apr 20 19:42:48 2008 +0200
+
+    Fix build with builddir != srcdir
+
+commit 18db0ddc3a18317585172374d0157dbdc76146aa
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Thu Mar 27 20:07:34 2008 -0700
+
+    Build fix for file systems that are not case sensitive
+
+commit 9f76a0d8684da6dfad67282be213139b6f87a05a
+Author: Matthieu Herrb <matthieu@bluenote.herrb.net>
+Date:   Sat Mar 8 22:09:59 2008 +0100
+
+    Makefile.am: nuke RCS Id
+
+commit 19fad31ddef4c1063ee2315dfee94e4ebb5f0ff0
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Aug 21 11:23:52 2007 -0700
+
+    Version bump: 1.0.2
+
+commit c4ada4a7ee46f8ab0dfeb2cd311758d9197a59a8
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Aug 21 11:19:09 2007 -0700
+
+    Fill in COPYING with copyright/license notices from source files
+
+commit 5ee182a964d0ba16315935ec9bfd91779ed4a2a1
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Aug 21 11:15:50 2007 -0700
+
+    Replace static changelog with dist-hook to generate from git log
+
+commit 3c9230230e88f6421ea3549f813eabceb4120734
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Aug 21 11:03:07 2007 -0700
+
+    renamed: .cvsignore -> .gitignore
+
+commit b2c489924708b202f33f6528d3269911662f906c
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Aug 21 11:02:19 2007 -0700
+
+    Change xcalc_CFLAGS to AM_CFLAGS to make automake-1.10 happier
+
+commit b586f35824d7c3bc061ba96e82b48744041dac59
+Author: Mike Markowski <mm@udel.edu>
+Date:   Wed Jul 12 11:28:40 2006 -0700
+
+    Bug #4914: Add HP mode resources to XCalc-color app-defaults
+    
+    X.Org bug #4914 <https://bugs.freedesktop.org/show_bug.cgi?id=4914>
+    Patch #3658 <https://bugs.freedesktop.org/attachment.cgi?id=3658>
+
+commit 322a3bd493b99164925e852df5ffa8e1a650f496
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 21 02:29:48 2005 +0000
+
+    Update package version for X11R7 release.
+
+commit 8b7933c8192364e55b863b3e88ad64dbd6004bcc
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Dec 19 16:22:42 2005 +0000
+
+    Stub COPYING files
+
+commit 543045f1c5effcafe60ee86ab02663ea5253d7b1
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:24:05 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+commit ffb4bc9e1bbff3648d9a60d29c8efe8292b2e6d2
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 7 16:17:58 2005 +0000
+
+    Change to use the app-defaults default dir configured in libXt.
+
+commit f8c6b6ee02de9f4991e4894386fd1f914e71f295
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 6 22:48:19 2005 +0000
+
+    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit db75d5541e32a82c1a200f5db94258c55144aee9
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Dec 3 05:49:18 2005 +0000
+
+    Update package version number for X11R7 RC3 release.
+
+commit 217c43175b253fb436dfe2c17c258440efbf1b4d
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Nov 28 22:01:39 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 35347991b10472019e814b4346f9f55f33fa6850
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Mon Nov 21 10:34:58 2005 +0000
+
+    Another pass at .cvsignores for apps.
+
+commit ec23a703b3dd3ca07bcb67599d2aa20186b812db
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Sun Nov 20 22:08:50 2005 +0000
+
+    Add/improve .cvsignore files for apps.
+
+commit 4b974526a94abe02297f7ecf427cb78681c9bfb3
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:47:52 2005 +0000
+
+    Update package version number for RC1 release.
+
+commit b0d618388ae24bb2bbcfbb43b313306b3b8d342f
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Oct 18 00:32:54 2005 +0000
+
+    Change default install dir for app-default files from
+        $(sysconfdir)/X11/app-defaults to $(libdir)/X11/app-defaults to match
+        the monolith & allow localization
+
+commit 933a86b8c6d64e974b314c5e3617fa2cbb213cce
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Oct 17 23:56:21 2005 +0000
+
+    Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to
+        work better with BSD make
+
+commit 203bc6e49653660050a874508da2c57e089c3c54
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Fri Oct 14 00:25:43 2005 +0000
+
+    Use sed to fill in variables in man page
+
+commit e70773cb5c4269627e0d8750f7852ed865fd8eaf
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Thu Oct 13 20:11:00 2005 +0000
+
+    Fix app-default files to install under the same names as in the monolith
+        instead of their short names used only for 14-character filename length
+        limited ancient filesystems
+
+commit 9648bcddee6779eed395d60f17a13bcf13fa9042
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Aug 1 20:25:29 2005 +0000
+
+    Install man pages to section 1 instead of section m (Patch from Donnie
+        Berkholz)
+
+commit cdd93a4e3c1dac5f23ad21c5fac4fbc054e0a42d
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Jul 29 21:22:31 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 2347df01911fc8061071cb80018963b79514e4b4
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Jul 26 15:44:01 2005 +0000
+
+    Replace more GNU make-ism's with more portable macros
+
+commit b7161f370dbabeb536e9dc078f05e1ffd67847fb
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed Jul 20 19:31:51 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 526ab098fe73f9dde13b651ae8c70fbec56594c2
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Sun Jul 17 20:11:02 2005 +0000
+
+    fix rules to work with non-GNU make and outside of $srcdir
+
+commit 392f5dd1907a5110c89b308ef51122b39b23dde5
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Wed Jun 29 23:12:07 2005 +0000
+
+    Build system for Xcalc
+
+commit a72c79567a4f550dfafb532b03be79339c5a4a30
+Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>
+Date:   Tue Jul 6 09:24:58 2004 +0000
+
+    Bugzilla #665: bugs in xcalc -rpn mode decimal_point is a const char* not
+        char. the patch uses strcmp instead of plain char == char operator and
+        allows decimal_point to be of any length. localeconv() is only called
+        if X_LOCALE is _not_ defined
+
+commit bbcc481006d4b5f4e8d1276db2220cf96a355985
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sun May 23 20:03:49 2004 +0000
+
+    xc/programs/xcalc/math.c
+    xcalc -rpn mode errors (Geoffery Coram)
+
+commit ed6ab3f1b45a5101a4cddfca754291b4523520a1
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 19:54:38 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+commit bb536859850357b05511068fab838dd3a1436ef6
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:35:00 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit fecd81156f60db136eaf9cf79a34b7d076bbae06
+Author: Egbert Eich <eich@suse.de>
+Date:   Wed Mar 3 12:12:55 2004 +0000
+
+    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit 3acc8a33b8eec4fe9164e12507cafb3c161d3cbe
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:36:16 2004 +0000
+
+    readding XFree86's cvs IDs
+
+commit 70f4b224345cc7c43d1960858c27a11541ea55c4
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 09:23:58 2004 +0000
+
+    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit c61023614eb9182293f5c26c22a3babf65f1dee1
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:29:03 2003 +0000
+
+    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit c538606166a71ab7b711de7394cc61add265a209
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:58 2003 +0000
+
+    XFree86 4.3.0.1
+
+commit 411b0e9e319550a394b0a5945543f39a5affc6a6
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:58 2003 +0000
+
+    Initial revision
diff --git a/xcalc/INSTALL b/xcalc/INSTALL
new file mode 100644 (file)
index 0000000..8b82ade
--- /dev/null
@@ -0,0 +1,291 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008 Free Software Foundation, Inc.
+
+   This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+   Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package.  The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.
+
+     Running `configure' might take a while.  While running, it prints
+     some messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+  6. Often, you can also type `make uninstall' to remove the installed
+     files again.
+
+Compilers and Options
+=====================
+
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+   You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you can use GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory.  After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+   On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor.  Like
+this:
+
+     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CPP="gcc -E" CXXCPP="g++ -E"
+
+   This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+   By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+   Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Particular systems
+==================
+
+   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+     ./configure CC="cc -Ae"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
+a workaround.  If GNU CC is not installed, it is therefore recommended
+to try
+
+     ./configure CC="cc"
+
+and if that doesn't work, try
+
+     ./configure CC="cc -nodtk"
+
+Specifying the System Type
+==========================
+
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+   Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug.  Until the bug is fixed you can use this workaround:
+
+     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+   `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+     Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+     Print a summary of the options unique to this package's
+     `configure', and exit.  The `short' variant lists options used
+     only in the top level, while the `recursive' variant lists options
+     also present in any nested packages.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+     Use DIR as the installation prefix.  *Note Installation Names::
+     for more details, including other options available for fine-tuning
+     the installation locations.
+
+`--no-create'
+`-n'
+     Run the configure checks, but stop before creating any output
+     files.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/xcalc/Makefile.am b/xcalc/Makefile.am
new file mode 100644 (file)
index 0000000..46a0d1d
--- /dev/null
@@ -0,0 +1,88 @@
+# 
+#  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 = xcalc
+
+AM_CFLAGS = $(XCALC_CFLAGS)
+xcalc_LDADD = $(XCALC_LIBS) -lm
+
+xcalc_SOURCES =        \
+        actions.c \
+        math.c \
+        xcalc.c \
+        xcalc.h
+
+appman_PRE = \
+        xcalc.man
+
+# App default files  (*.ad)
+
+DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
+
+appdefaultdir = @appdefaultdir@
+
+dist_appdefault_DATA = \
+        app-defaults/XCalc \
+        app-defaults/XCalc-color
+
+
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
+
+appmandir = $(APP_MAN_DIR)
+
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+
+EXTRA_DIST = $(appman_PRE) autogen.sh
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+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):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
diff --git a/xcalc/Makefile.in b/xcalc/Makefile.in
new file mode 100644 (file)
index 0000000..df1b164
--- /dev/null
@@ -0,0 +1,810 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = xcalc$(EXEEXT)
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(dist_appdefault_DATA) \
+       $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+       $(srcdir)/config.h.in $(top_srcdir)/configure COPYING \
+       ChangeLog INSTALL config.guess config.sub depcomp install-sh \
+       missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" \
+       "$(DESTDIR)$(appdefaultdir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_xcalc_OBJECTS = actions.$(OBJEXT) math.$(OBJEXT) xcalc.$(OBJEXT)
+xcalc_OBJECTS = $(am_xcalc_OBJECTS)
+am__DEPENDENCIES_1 =
+xcalc_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(xcalc_SOURCES)
+DIST_SOURCES = $(xcalc_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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+DATA = $(appman_DATA) $(dist_appdefault_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@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPDEFS_CFLAGS = @APPDEFS_CFLAGS@
+APPDEFS_LIBS = @APPDEFS_LIBS@
+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@
+CHANGELOG_CMD = @CHANGELOG_CMD@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
+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@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_CMD = @INSTALL_CMD@
+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@
+MAKEINFO = @MAKEINFO@
+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'
+
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+SED = sed
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XCALC_CFLAGS = @XCALC_CFLAGS@
+XCALC_LIBS = @XCALC_LIBS@
+XORG_MAN_PAGE = @XORG_MAN_PAGE@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+appdefaultdir = @appdefaultdir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CFLAGS = $(XCALC_CFLAGS)
+xcalc_LDADD = $(XCALC_LIBS) -lm
+xcalc_SOURCES = \
+        actions.c \
+        math.c \
+        xcalc.c \
+        xcalc.h
+
+appman_PRE = \
+        xcalc.man
+
+
+# App default files  (*.ad)
+DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
+dist_appdefault_DATA = \
+        app-defaults/XCalc \
+        app-defaults/XCalc-color
+
+appmandir = $(APP_MAN_DIR)
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+EXTRA_DIST = $(appman_PRE) autogen.sh
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+CLEANFILES = $(appman_DATA)
+
+# Strings to replace in man pages
+XORGRELSTRING = @PACKAGE_STRING@
+XORGMANNAME = X Version 11
+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) --foreign'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign 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)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+       @if test ! -f $@; then \
+         rm -f stamp-h1; \
+         $(MAKE) $(AM_MAKEFLAGS) 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) 
+       ($(am__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)'; test -n "$(bindir)" || list=; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p; \
+         then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+xcalc$(EXEEXT): $(xcalc_OBJECTS) $(xcalc_DEPENDENCIES) 
+       @rm -f xcalc$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(xcalc_OBJECTS) $(xcalc_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/actions.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/math.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcalc.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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) '$<'`
+install-appmanDATA: $(appman_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)"
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \
+       done
+
+uninstall-appmanDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appmandir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appmandir)" && rm -f $$files
+install-dist_appdefaultDATA: $(dist_appdefault_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appdefaultdir)" || $(MKDIR_P) "$(DESTDIR)$(appdefaultdir)"
+       @list='$(dist_appdefault_DATA)'; test -n "$(appdefaultdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appdefaultdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appdefaultdir)" || exit $$?; \
+       done
+
+uninstall-dist_appdefaultDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_appdefault_DATA)'; test -n "$(appdefaultdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appdefaultdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appdefaultdir)" && rm -f $$files
+
+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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       set x; \
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       $(am__remove_distdir)
+       test -d "$(distdir)" || mkdir "$(distdir)"
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$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
+       -test -n "$(am__skip_mode_fix)" \
+       || find "$(distdir)" -type d ! -perm -755 \
+               -exec chmod u+rwx,go+rx {} \; -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 $(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-lzma: distdir
+       tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+       $(am__remove_distdir)
+
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+       $(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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+       *.tar.bz2*) \
+         bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.lzma*) \
+         lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+       *.tar.Z*) \
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+       *.shar.gz*) \
+         GZIP=$(GZIP_ENV) gzip -dc $(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)
+       test -d $(distdir)/_build || exit 0; \
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && am__cwd=`pwd` \
+         && $(am__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 \
+         && cd "$$am__cwd" \
+         || exit 1
+       $(am__remove_distdir)
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+       @$(am__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)" "$(DESTDIR)$(appdefaultdir)"; 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)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-appmanDATA install-dist_appdefaultDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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_appdefaultDATA
+
+.MAKE: all install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+       clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
+       dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \
+       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-dist_appdefaultDATA install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+       uninstall-am uninstall-appmanDATA uninstall-binPROGRAMS \
+       uninstall-dist_appdefaultDATA
+
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
+
+.man.$(APP_MAN_SUFFIX):
+       $(AM_V_GEN)$(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/xcalc/README b/xcalc/README
new file mode 100644 (file)
index 0000000..307699e
--- /dev/null
@@ -0,0 +1,26 @@
+xcalc is a scientific calculator X11 client that can emulate a TI-30
+or an HP-10C.
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+        http://lists.freedesktop.org/mailman/listinfo/xorg
+
+Please submit bug reports to the Xorg bugzilla:
+
+        https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+The master development code repository can be found at:
+
+        git://anongit.freedesktop.org/git/xorg/app/xcalc
+
+        http://cgit.freedesktop.org/xorg/app/xcalc
+
+For patch submission instructions, see:
+
+       http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
+For more information on the git code manager, see:
+
+        http://wiki.x.org/wiki/GitPage
+
diff --git a/xcalc/aclocal.m4 b/xcalc/aclocal.m4
new file mode 100644 (file)
index 0000000..1af08a2
--- /dev/null
@@ -0,0 +1,2385 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009  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.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
+[m4_warning([this file was generated for autoconf 2.67.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# serial 1 (pkg-config-0.24)
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# 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])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+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.
+#
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+# only at the first occurence in configure.ac, so if the first place
+# it's called might be skipped (such as if it is within an "if", you
+# have 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_default([$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _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
+       AC_MSG_RESULT([no])
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       m4_default([$4], [AC_MSG_ERROR(
+[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])[]dnl
+        ])
+elif test $pkg_failed = untried; then
+       AC_MSG_RESULT([no])
+       m4_default([$4], [AC_MSG_FAILURE(
+[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 <http://pkg-config.freedesktop.org/>.])[]dnl
+        ])
+else
+       $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+       $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+       $3
+fi[]dnl
+])# PKG_CHECK_MODULES
+
+dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
+dnl
+dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. 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 "Software"),
+dnl to deal in the Software without restriction, including without limitation
+dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
+dnl and/or sell copies of the Software, and to permit persons to whom the
+dnl Software is furnished to do so, subject to the following conditions:
+dnl
+dnl The above copyright notice and this permission notice (including the next
+dnl paragraph) shall be included in all copies or substantial portions of the
+dnl Software.
+dnl
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+dnl DEALINGS IN THE SOFTWARE.
+
+# 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 ensure that this macro is defined, also add:
+# m4_ifndef([XORG_MACROS_VERSION],
+#     [m4_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.
+m4_defun([XORG_MACROS_VERSION],[
+m4_define([vers_have], [1.11.0])
+m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
+m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
+m4_if(m4_cmp(maj_have, maj_needed), 0,,
+    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
+m4_if(m4_version_compare(vers_have, [$1]), -1,
+    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
+m4_undefine([vers_have])
+m4_undefine([maj_have])
+m4_undefine([maj_needed])
+]) # 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])
+       # under Cygwin unix is still defined even with -undef
+       elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+               RAWCPPFLAGS="-undef -ansi"
+               AC_MSG_RESULT([yes, with -ansi])
+       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
+# Added MAN_SUBSTS in version 1.8
+# Added AC_PROG_SED in version 1.8
+
+AC_DEFUN([XORG_MANPAGE_SECTIONS],[
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_SED])
+
+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_MAN_PAGE="X Version 11"
+AC_SUBST([XORG_MAN_PAGE])
+MAN_SUBSTS="\
+       -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xservername__|Xorg|g' \
+       -e 's|__xconfigfile__|xorg.conf|g' \
+       -e 's|__projectroot__|\$(prefix)|g' \
+       -e 's|__apploaddir__|\$(appdefaultdir)|g' \
+       -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
+       -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
+       -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
+       -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
+       -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
+       -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
+AC_SUBST([MAN_SUBSTS])
+
+]) # XORG_MANPAGE_SECTIONS
+
+# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
+# ------------------------
+# Minimum version: 1.7.0
+#
+# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
+# provided by xorg-sgml-doctools, if installed.
+AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
+AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
+XORG_SGML_PATH=
+PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
+    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
+    [m4_ifval([$1],[:],
+        [if test x"$cross_compiling" != x"yes" ; then
+            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
+                          [XORG_SGML_PATH=$prefix/share/sgml])
+         fi])
+    ])
+
+# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
+# the path and the name of the doc stylesheet
+if test "x$XORG_SGML_PATH" != "x" ; then
+   AC_MSG_RESULT([$XORG_SGML_PATH])
+   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
+   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
+else
+   AC_MSG_RESULT([no])
+fi
+
+AC_SUBST(XORG_SGML_PATH)
+AC_SUBST(STYLESHEET_SRCDIR)
+AC_SUBST(XSL_STYLESHEET)
+AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
+]) # XORG_CHECK_SGML_DOCTOOLS
+
+# 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_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
+AC_REQUIRE([XORG_WITH_PS2PDF])
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+
+AC_MSG_CHECKING([whether to build documentation])
+
+if test x$XORG_SGML_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$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
+
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([whether to build text documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([whether to build PDF documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([whether to build PostScript documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([whether to build HTML documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
+# ----------------
+# Minimum version: 1.5.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-xmlto option, it allows maximum flexibilty in making decisions
+# as whether or not to use the xmlto package. When DEFAULT is not specified,
+# --with-xmlto assumes 'auto'.
+#
+# Interface to module:
+# HAVE_XMLTO:  used in makefiles to conditionally generate documentation
+# XMLTO:       returns the path of the xmlto program found
+#              returns the path set by the user in the environment
+# --with-xmlto:        'yes' user instructs the module to use xmlto
+#              'no' user instructs the module not to use xmlto
+#
+# Added in version 1.10.0
+# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
+#                  xmlto for text output requires either lynx, links, or w3m browsers
+#
+# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_XMLTO],[
+AC_ARG_VAR([XMLTO], [Path to xmlto command])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(xmlto,
+       AS_HELP_STRING([--with-xmlto],
+          [Use xmlto to regenerate documentation (default: ]_defopt[)]),
+          [use_xmlto=$withval], [use_xmlto=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_xmlto" = x"auto"; then
+   AC_PATH_PROG([XMLTO], [xmlto])
+   if test "x$XMLTO" = "x"; then
+        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
+       have_xmlto=no
+   else
+        have_xmlto=yes
+   fi
+elif test "x$use_xmlto" = x"yes" ; then
+   AC_PATH_PROG([XMLTO], [xmlto])
+   if test "x$XMLTO" = "x"; then
+        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
+   fi
+   have_xmlto=yes
+elif test "x$use_xmlto" = x"no" ; then
+   if test "x$XMLTO" != "x"; then
+      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
+   fi
+   have_xmlto=no
+else
+   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
+fi
+
+# Test for a minimum version of xmlto, if provided.
+m4_ifval([$1],
+[if test "$have_xmlto" = yes; then
+    # scrape the xmlto version
+    AC_MSG_CHECKING([the xmlto version])
+    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
+    AC_MSG_RESULT([$xmlto_version])
+    AS_VERSION_COMPARE([$xmlto_version], [$1],
+        [if test "x$use_xmlto" = xauto; then
+            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
+            have_xmlto=no
+        else
+            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
+        fi])
+fi])
+
+# Test for the ability of xmlto to generate a text target
+have_xmlto_text=no
+cat > conftest.xml << "EOF"
+EOF
+AS_IF([test "$have_xmlto" = yes],
+      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
+             [have_xmlto_text=yes],
+             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
+rm -f conftest.xml
+AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
+AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
+]) # XORG_WITH_XMLTO
+
+# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
+# ----------------
+# Minimum version: 1.5.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-asciidoc option, it allows maximum flexibilty in making decisions
+# as whether or not to use the asciidoc package. When DEFAULT is not specified,
+# --with-asciidoc assumes 'auto'.
+#
+# Interface to module:
+# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
+# ASCIIDOC:     returns the path of the asciidoc program found
+#               returns the path set by the user in the environment
+# --with-asciidoc: 'yes' user instructs the module to use asciidoc
+#                'no' user instructs the module not to use asciidoc
+#
+# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_ASCIIDOC],[
+AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(asciidoc,
+       AS_HELP_STRING([--with-asciidoc],
+          [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
+          [use_asciidoc=$withval], [use_asciidoc=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_asciidoc" = x"auto"; then
+   AC_PATH_PROG([ASCIIDOC], [asciidoc])
+   if test "x$ASCIIDOC" = "x"; then
+        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
+       have_asciidoc=no
+   else
+        have_asciidoc=yes
+   fi
+elif test "x$use_asciidoc" = x"yes" ; then
+   AC_PATH_PROG([ASCIIDOC], [asciidoc])
+   if test "x$ASCIIDOC" = "x"; then
+        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
+   fi
+   have_asciidoc=yes
+elif test "x$use_asciidoc" = x"no" ; then
+   if test "x$ASCIIDOC" != "x"; then
+      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
+   fi
+   have_asciidoc=no
+else
+   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
+fi
+m4_ifval([$1],
+[if test "$have_asciidoc" = yes; then
+    # scrape the asciidoc version
+    AC_MSG_CHECKING([the asciidoc version])
+    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
+    AC_MSG_RESULT([$asciidoc_version])
+    AS_VERSION_COMPARE([$asciidoc_version], [$1],
+        [if test "x$use_asciidoc" = xauto; then
+            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
+            have_asciidoc=no
+        else
+            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
+        fi])
+fi])
+AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
+]) # XORG_WITH_ASCIIDOC
+
+# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
+# --------------------------------
+# Minimum version: 1.5.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-doxygen option, it allows maximum flexibilty in making decisions
+# as whether or not to use the doxygen package. When DEFAULT is not specified,
+# --with-doxygen assumes 'auto'.
+#
+# Interface to module:
+# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
+# DOXYGEN:      returns the path of the doxygen program found
+#               returns the path set by the user in the environment
+# --with-doxygen: 'yes' user instructs the module to use doxygen
+#                'no' user instructs the module not to use doxygen
+#
+# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_DOXYGEN],[
+AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(doxygen,
+       AS_HELP_STRING([--with-doxygen],
+          [Use doxygen to regenerate documentation (default: ]_defopt[)]),
+          [use_doxygen=$withval], [use_doxygen=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_doxygen" = x"auto"; then
+   AC_PATH_PROG([DOXYGEN], [doxygen])
+   if test "x$DOXYGEN" = "x"; then
+        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
+       have_doxygen=no
+   else
+        have_doxygen=yes
+   fi
+elif test "x$use_doxygen" = x"yes" ; then
+   AC_PATH_PROG([DOXYGEN], [doxygen])
+   if test "x$DOXYGEN" = "x"; then
+        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
+   fi
+   have_doxygen=yes
+elif test "x$use_doxygen" = x"no" ; then
+   if test "x$DOXYGEN" != "x"; then
+      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
+   fi
+   have_doxygen=no
+else
+   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
+fi
+m4_ifval([$1],
+[if test "$have_doxygen" = yes; then
+    # scrape the doxygen version
+    AC_MSG_CHECKING([the doxygen version])
+    doxygen_version=`$DOXYGEN --version 2>/dev/null`
+    AC_MSG_RESULT([$doxygen_version])
+    AS_VERSION_COMPARE([$doxygen_version], [$1],
+        [if test "x$use_doxygen" = xauto; then
+            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
+            have_doxygen=no
+        else
+            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
+        fi])
+fi])
+AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
+]) # XORG_WITH_DOXYGEN
+
+# XORG_WITH_GROFF([DEFAULT])
+# ----------------
+# Minimum version: 1.6.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-groff option, it allows maximum flexibilty in making decisions
+# as whether or not to use the groff package. When DEFAULT is not specified,
+# --with-groff assumes 'auto'.
+#
+# Interface to module:
+# HAVE_GROFF:   used in makefiles to conditionally generate documentation
+# HAVE_GROFF_MM: the memorandum macros (-mm) package
+# HAVE_GROFF_MS: the -ms macros package
+# GROFF:        returns the path of the groff program found
+#               returns the path set by the user in the environment
+# --with-groff:         'yes' user instructs the module to use groff
+#               'no' user instructs the module not to use groff
+#
+# Added in version 1.9.0:
+# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
+#                 pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
+#                 psselect from the psutils package.
+#                 the ghostcript package. Refer to the grohtml man pages
+#
+# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
+#
+# OS and distros often splits groff in a basic and full package, the former
+# having the groff program and the later having devices, fonts and macros
+# Checking for the groff executable is not enough.
+#
+# If macros are missing, we cannot assume that groff is useless, so we don't
+# unset HAVE_GROFF or GROFF env variables.
+# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
+#
+AC_DEFUN([XORG_WITH_GROFF],[
+AC_ARG_VAR([GROFF], [Path to groff command])
+m4_define([_defopt], m4_default([$1], [auto]))
+AC_ARG_WITH(groff,
+       AS_HELP_STRING([--with-groff],
+          [Use groff to regenerate documentation (default: ]_defopt[)]),
+          [use_groff=$withval], [use_groff=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_groff" = x"auto"; then
+   AC_PATH_PROG([GROFF], [groff])
+   if test "x$GROFF" = "x"; then
+        AC_MSG_WARN([groff not found - documentation targets will be skipped])
+       have_groff=no
+   else
+        have_groff=yes
+   fi
+elif test "x$use_groff" = x"yes" ; then
+   AC_PATH_PROG([GROFF], [groff])
+   if test "x$GROFF" = "x"; then
+        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
+   fi
+   have_groff=yes
+elif test "x$use_groff" = x"no" ; then
+   if test "x$GROFF" != "x"; then
+      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
+   fi
+   have_groff=no
+else
+   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
+fi
+
+# We have groff, test for the presence of the macro packages
+if test "x$have_groff" = x"yes"; then
+    AC_MSG_CHECKING([for ${GROFF} -ms macros])
+    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
+        groff_ms_works=yes
+    else
+        groff_ms_works=no
+    fi
+    AC_MSG_RESULT([$groff_ms_works])
+    AC_MSG_CHECKING([for ${GROFF} -mm macros])
+    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
+        groff_mm_works=yes
+    else
+        groff_mm_works=no
+    fi
+    AC_MSG_RESULT([$groff_mm_works])
+fi
+
+# We have groff, test for HTML dependencies, one command per package
+if test "x$have_groff" = x"yes"; then
+   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
+   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
+   AC_PATH_PROG(PSSELECT_PATH, [psselect])
+   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
+      have_groff_html=yes
+   else
+      have_groff_html=no
+      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
+   fi
+fi
+
+# Set Automake conditionals for Makefiles
+AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
+AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
+AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
+AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
+]) # XORG_WITH_GROFF
+
+# XORG_WITH_FOP([DEFAULT])
+# ----------------
+# Minimum version: 1.6.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-fop option, it allows maximum flexibilty in making decisions
+# as whether or not to use the fop package. When DEFAULT is not specified,
+# --with-fop assumes 'auto'.
+#
+# Interface to module:
+# HAVE_FOP:    used in makefiles to conditionally generate documentation
+# FOP:         returns the path of the fop program found
+#              returns the path set by the user in the environment
+# --with-fop:  'yes' user instructs the module to use fop
+#              'no' user instructs the module not to use fop
+#
+# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_FOP],[
+AC_ARG_VAR([FOP], [Path to fop command])
+m4_define([_defopt], m4_default([$1], [auto]))
+AC_ARG_WITH(fop,
+       AS_HELP_STRING([--with-fop],
+          [Use fop to regenerate documentation (default: ]_defopt[)]),
+          [use_fop=$withval], [use_fop=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_fop" = x"auto"; then
+   AC_PATH_PROG([FOP], [fop])
+   if test "x$FOP" = "x"; then
+        AC_MSG_WARN([fop not found - documentation targets will be skipped])
+       have_fop=no
+   else
+        have_fop=yes
+   fi
+elif test "x$use_fop" = x"yes" ; then
+   AC_PATH_PROG([FOP], [fop])
+   if test "x$FOP" = "x"; then
+        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
+   fi
+   have_fop=yes
+elif test "x$use_fop" = x"no" ; then
+   if test "x$FOP" != "x"; then
+      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
+   fi
+   have_fop=no
+else
+   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
+fi
+AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
+]) # XORG_WITH_FOP
+
+# XORG_WITH_PS2PDF([DEFAULT])
+# ----------------
+# Minimum version: 1.6.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
+# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
+# --with-ps2pdf assumes 'auto'.
+#
+# Interface to module:
+# HAVE_PS2PDF:         used in makefiles to conditionally generate documentation
+# PS2PDF:      returns the path of the ps2pdf program found
+#              returns the path set by the user in the environment
+# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
+#               'no' user instructs the module not to use ps2pdf
+#
+# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_PS2PDF],[
+AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
+m4_define([_defopt], m4_default([$1], [auto]))
+AC_ARG_WITH(ps2pdf,
+       AS_HELP_STRING([--with-ps2pdf],
+          [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
+          [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_ps2pdf" = x"auto"; then
+   AC_PATH_PROG([PS2PDF], [ps2pdf])
+   if test "x$PS2PDF" = "x"; then
+        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
+       have_ps2pdf=no
+   else
+        have_ps2pdf=yes
+   fi
+elif test "x$use_ps2pdf" = x"yes" ; then
+   AC_PATH_PROG([PS2PDF], [ps2pdf])
+   if test "x$PS2PDF" = "x"; then
+        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
+   fi
+   have_ps2pdf=yes
+elif test "x$use_ps2pdf" = x"no" ; then
+   if test "x$PS2PDF" != "x"; then
+      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
+   fi
+   have_ps2pdf=no
+else
+   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
+fi
+AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
+]) # XORG_WITH_PS2PDF
+
+# XORG_ENABLE_DOCS (enable_docs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a builder to skip all
+# documentation targets except traditional man pages.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO         --with-xmlto
+# XORG_WITH_ASCIIDOC      --with-asciidoc
+# XORG_WITH_DOXYGEN       --with-doxygen
+# XORG_WITH_FOP           --with-fop
+# XORG_WITH_GROFF         --with-groff
+# XORG_WITH_PS2PDF        --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_DOCS:           used in makefiles to conditionally generate documentation
+# --enable-docs: 'yes' user instructs the module to generate docs
+#               'no' user instructs the module not to generate docs
+# parm1:       specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_DOCS],[
+m4_define([default], m4_default([$1], [yes]))
+AC_ARG_ENABLE(docs,
+       AS_HELP_STRING([--enable-docs],
+          [Enable building the documentation (default: ]default[)]),
+          [build_docs=$enableval], [build_docs=]default)
+m4_undefine([default])
+AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
+AC_MSG_CHECKING([whether to build documentation])
+AC_MSG_RESULT([$build_docs])
+]) # XORG_ENABLE_DOCS
+
+# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# This macro enables a builder to skip all developer documentation.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO         --with-xmlto
+# XORG_WITH_ASCIIDOC      --with-asciidoc
+# XORG_WITH_DOXYGEN       --with-doxygen
+# XORG_WITH_FOP           --with-fop
+# XORG_WITH_GROFF         --with-groff
+# XORG_WITH_PS2PDF        --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_DEVEL_DOCS:   used in makefiles to conditionally generate developer docs
+# --enable-devel-docs: 'yes' user instructs the module to generate developer docs
+#                      'no' user instructs the module not to generate developer docs
+# parm1:               specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
+m4_define([devel_default], m4_default([$1], [yes]))
+AC_ARG_ENABLE(devel-docs,
+       AS_HELP_STRING([--enable-devel-docs],
+          [Enable building the developer documentation (default: ]devel_default[)]),
+          [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
+m4_undefine([devel_default])
+AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
+AC_MSG_CHECKING([whether to build developer documentation])
+AC_MSG_RESULT([$build_devel_docs])
+]) # XORG_ENABLE_DEVEL_DOCS
+
+# XORG_ENABLE_SPECS (enable_specs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# This macro enables a builder to skip all functional specification targets.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO         --with-xmlto
+# XORG_WITH_ASCIIDOC      --with-asciidoc
+# XORG_WITH_DOXYGEN       --with-doxygen
+# XORG_WITH_FOP           --with-fop
+# XORG_WITH_GROFF         --with-groff
+# XORG_WITH_PS2PDF        --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_SPECS:                used in makefiles to conditionally generate specs
+# --enable-specs:      'yes' user instructs the module to generate specs
+#                      'no' user instructs the module not to generate specs
+# parm1:               specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_SPECS],[
+m4_define([spec_default], m4_default([$1], [yes]))
+AC_ARG_ENABLE(specs,
+       AS_HELP_STRING([--enable-specs],
+          [Enable building the specs (default: ]spec_default[)]),
+          [build_specs=$enableval], [build_specs=]spec_default)
+m4_undefine([spec_default])
+AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
+AC_MSG_CHECKING([whether to build functional specifications])
+AC_MSG_RESULT([$build_specs])
+]) # XORG_ENABLE_SPECS
+
+# 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,
+       AS_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],
+               [MALLOC_ZERO_RETURNS_NULL=yes])
+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
+#
+# This macro enables the use of a tool that flags some suspicious and
+# non-portable constructs (likely to be bugs) in C language source code.
+# It will attempt to locate the tool and use appropriate options.
+# There are various lint type tools on different platforms.
+#
+# Interface to module:
+# LINT:                returns the path to the tool found on the platform
+#              or the value set to LINT on the configure cmd line
+#              also an Automake conditional
+# LINT_FLAGS:  an Automake variable with appropriate flags
+#
+# --with-lint: 'yes' user instructs the module to use lint
+#              'no' user instructs the module not to use lint (default)
+#
+# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
+# If the user sets the value of LINT_FLAGS, they are used verbatim.
+#
+AC_DEFUN([XORG_WITH_LINT],[
+
+AC_ARG_VAR([LINT], [Path to a lint-style command])
+AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
+AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
+               [Use a lint-style source code checker (default: disabled)])],
+               [use_lint=$withval], [use_lint=no])
+
+# Obtain platform specific info like program name and options
+# The lint program on FreeBSD and NetBSD is different from the one on Solaris
+case $host_os in
+  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
+       lint_name=splint
+       lint_options="-badflag"
+       ;;
+  *freebsd* | *netbsd*)
+       lint_name=lint
+       lint_options="-u -b"
+       ;;
+  *solaris*)
+       lint_name=lint
+       lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
+       ;;
+esac
+
+# Test for the presence of the program (either guessed by the code or spelled out by the user)
+if test "x$use_lint" = x"yes" ; then
+   AC_PATH_PROG([LINT], [$lint_name])
+   if test "x$LINT" = "x"; then
+        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
+   fi
+elif test "x$use_lint" = x"no" ; then
+   if test "x$LINT" != "x"; then
+      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
+   fi
+else
+   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
+fi
+
+# User supplied flags override default flags
+if test "x$LINT_FLAGS" != "x"; then
+   lint_options=$LINT_FLAGS
+fi
+
+AC_SUBST([LINT_FLAGS],[$lint_options])
+AM_CONDITIONAL(LINT, [test "x$LINT" != x])
+
+]) # 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.
+#
+# Interface to module:
+# LINTLIB              - Automake variable with the name of lint library file to make
+# MAKE_LINT_LIB                - Automake conditional
+#
+# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
+#                        - 'no' user instructs the module not to create a lint library (default)
+
+AC_DEFUN([XORG_LINT_LIBRARY],[
+AC_REQUIRE([XORG_WITH_LINT])
+AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
+       [Create lint library (default: disabled)])],
+       [make_lint_lib=$enableval], [make_lint_lib=no])
+
+if test "x$make_lint_lib" = x"yes" ; then
+   LINTLIB=llib-l$1.ln
+   if test "x$LINT" = "x"; then
+        AC_MSG_ERROR([Cannot make lint library without --with-lint])
+   fi
+elif test "x$make_lint_lib" != x"no" ; then
+   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
+fi
+
+AC_SUBST(LINTLIB)
+AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
+
+]) # XORG_LINT_LIBRARY
+
+# XORG_CWARNFLAGS
+# ---------------
+# Minimum version: 1.2.0
+#
+# Defines CWARNFLAGS to enable C compiler warnings.
+#
+AC_DEFUN([XORG_CWARNFLAGS], [
+AC_REQUIRE([AC_PROG_CC_C99])
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast -Wformat=2"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+AC_SUBST(CWARNFLAGS)
+]) # XORG_CWARNFLAGS
+
+# XORG_STRICT_OPTION
+# -----------------------
+# Minimum version: 1.3.0
+#
+# Add configure option to enable strict compilation
+AC_DEFUN([XORG_STRICT_OPTION], [
+# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
+AC_REQUIRE([AC_PROG_CC_C99])
+AC_REQUIRE([XORG_CWARNFLAGS])
+
+AC_ARG_ENABLE(strict-compilation,
+                         AS_HELP_STRING([--enable-strict-compilation],
+                         [Enable all warnings from compiler and make them errors (default: disabled)]),
+                         [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
+if test "x$STRICT_COMPILE" = "xyes"; then
+       AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+       AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+AC_SUBST([CWARNFLAGS])
+]) # XORG_STRICT_OPTION
+
+# XORG_DEFAULT_OPTIONS
+# --------------------
+# Minimum version: 1.3.0
+#
+# Defines default options for X.Org modules.
+#
+AC_DEFUN([XORG_DEFAULT_OPTIONS], [
+AC_REQUIRE([AC_PROG_INSTALL])
+XORG_CWARNFLAGS
+XORG_STRICT_OPTION
+XORG_RELEASE_VERSION
+XORG_CHANGELOG
+XORG_INSTALL
+XORG_MANPAGE_SECTIONS
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
+    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
+]) # XORG_DEFAULT_OPTIONS
+
+# XORG_INSTALL()
+# ----------------
+# Minimum version: 1.4.0
+#
+# Defines the variable INSTALL_CMD as the command to copy
+# INSTALL from $prefix/share/util-macros.
+#
+AC_DEFUN([XORG_INSTALL], [
+AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
+INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+AC_SUBST([INSTALL_CMD])
+]) # XORG_INSTALL
+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
+# --------------------
+# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+AC_DEFUN([XORG_RELEASE_VERSION],[
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+               [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+               [Major version of this package])
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+               [$PVM],
+               [Minor version of this package])
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+               [$PVP],
+               [Patch version of this package])
+])
+
+# XORG_CHANGELOG()
+# ----------------
+# Minimum version: 1.2.0
+#
+# Defines the variable CHANGELOG_CMD as the command to generate
+# ChangeLog from git.
+#
+#
+AC_DEFUN([XORG_CHANGELOG], [
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+AC_SUBST([CHANGELOG_CMD])
+]) # XORG_CHANGELOG
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11.1], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# 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, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# 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])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+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, 2006, 2009
+# 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 10
+
+# 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], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$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
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    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, 2006, 2008, 2009 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 16
+
+# 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.62])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
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+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
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_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)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+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
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_AM_DEPENDENCIES(OBJC)],
+                 [define([AC_PROG_OBJC],
+                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# 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_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
+                         (and sometimes confusing) to the casual installer],
+      [USE_MAINTAINER_MODE=$enableval],
+      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  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, 2009  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_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.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
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+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, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# 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
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# 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, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _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],
+[m4_foreach_w([_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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# 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
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# 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) 2009  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 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# 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="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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/xcalc/actions.c b/xcalc/actions.c
new file mode 100644 (file)
index 0000000..78c3e36
--- /dev/null
@@ -0,0 +1,474 @@
+/* $XConsortium: actions.c,v 1.9 94/04/17 20:43:30 converse Exp $ */
+/*
+
+Copyright (c) 1989  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+
+/*
+ * actions.c - externally available procedures for xcalc
+ *
+ * Author:  Donna Converse, MIT X Consortium
+ */
+
+#include <X11/Intrinsic.h>
+#include <setjmp.h>
+#include "xcalc.h"
+
+#ifndef IEEE
+#define XCALC_PRE_OP(keynum) { if (pre_op(keynum)) return; \
+                      if (setjmp (env)) {fail_op(); return;}}
+#else
+#define XCALC_PRE_OP(keynum) if (pre_op(keynum)) return;
+#endif
+
+static void add(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void back(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void bell(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void clearit(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void cosine(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void decimal(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void degree(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void digit(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void divide(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void e(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void enter(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void epower(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void equal(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void exchange(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void factorial(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void inverse(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void leftParen(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void logarithm(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void multiply(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void naturalLog(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void factorial(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void negate(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void nop(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void off(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void pi(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void power(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void quit(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void recall(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void reciprocal(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void rightParen(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void roll(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void scientific(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void selection(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void sine(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void square(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void squareRoot(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void store(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void subtract(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void sum(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void tangent(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void tenpower(Widget w, XEvent *e, String *vector, Cardinal *count);
+static void XexchangeY(Widget w, XEvent *e, String *vector, Cardinal *count);
+
+/*
+ *     calculator action table
+ */
+
+XtActionsRec   Actions[] = {
+{"add",                add},           /* addition */
+{"back",       back},          /* HP-specific backspace */
+{"bell",       bell},          /* ring bell */
+{"clear",      clearit},       /* TI-specific clear calculator state */
+{"cosine",     cosine},        /* trigonometric function cosine */
+{"decimal",    decimal},       /* decimal point */
+{"degree",     degree},        /* degree, radian, grad switch */
+{"digit",      digit},         /* numeric key */
+{"divide",     divide},        /* division */
+{"e",          e},             /* the natural number e */
+{"enter",      enter},         /* HP-specific enter */
+{"epower",     epower},        /* e raised to a power */
+{"equal",      equal},         /* TI-specific = */
+{"exchange",   exchange},      /* TI-specific exchange memory and display */
+{"factorial",  factorial},     /* factorial function */
+{"inverse",    inverse},       /* inverse */
+{"leftParen",  leftParen},     /* TI-specific left parenthesis */
+{"logarithm",  logarithm},     /* logarithm base 10 */
+{"multiply",   multiply},      /* multiplication */
+{"naturalLog", naturalLog},    /* natural logarithm base e */
+{"negate",     negate},        /* change sign */
+{"nop",                nop},           /* no operation, rings bell */
+{"off",                off},           /* clear state */
+{"pi",         pi},            /* the number pi */
+{"power",      power},         /* raise to an arbitrary power */
+{"quit",       quit},          /* quit */
+{"recall",     recall},        /* memory recall */
+{"reciprocal",  reciprocal},   /* reciprocal function */
+{"rightParen", rightParen},    /* TI-specific left parenthesis */
+{"roll",       roll},          /* HP-specific roll stack */
+{"scientific", scientific},    /* scientfic notation (EE) */
+{"selection",  selection},     /* copy selection */
+{"sine",       sine},          /* trigonometric function sine */
+{"square",     square},        /* square */
+{"squareRoot", squareRoot},    /* square root */
+{"store",      store},         /* memory store */
+{"subtract",   subtract},      /* subtraction */
+{"sum",                sum},           /* memory summation */
+{"tangent",    tangent},       /* trigonometric function tangent */
+{"tenpower",   tenpower},      /* 10 raised to to an arbitrary power */
+{"XexchangeY", XexchangeY}     /* HP-specific exchange X and Y registers */
+};
+
+int ActionsCount = XtNumber(Actions);
+
+/*ARGSUSED*/
+static void add(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kADD);
+    rpn ? twof(kADD) : twoop(kADD);
+    post_op();
+}
+
+/*ARGSUSED*/
+static void back(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kBKSP);
+    bkspf();
+    post_op();
+}
+
+/*ARGSUSED*/
+static void bell(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    ringbell();
+}
+
+/*ARGSUSED*/
+static void clearit(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kCLR);
+    clearf();
+    post_op();
+}
+   
+/*ARGSUSED*/
+static void cosine(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kCOS);
+    oneop(kCOS);
+    post_op();
+}
+
+/*ARGSUSED*/
+static void decimal(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kDEC);
+    decf();
+    post_op();
+}
+
+/*ARGSUSED*/
+static void degree(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kDRG);
+    drgf();
+    post_op();
+}
+
+/*ARGSUSED*/
+static void digit(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    switch (vector[0][0])
+    {
+      case '1':        XCALC_PRE_OP(kONE); numeric(kONE); break;
+      case '2': XCALC_PRE_OP(kTWO); numeric(kTWO); break;
+      case '3': XCALC_PRE_OP(kTHREE); numeric(kTHREE); break;
+      case '4': XCALC_PRE_OP(kFOUR); numeric(kFOUR); break;
+      case '5': XCALC_PRE_OP(kFIVE); numeric(kFIVE); break;
+      case '6': XCALC_PRE_OP(kSIX); numeric(kSIX); break;
+      case '7': XCALC_PRE_OP(kSEVEN); numeric(kSEVEN); break;
+      case '8': XCALC_PRE_OP(kEIGHT); numeric(kEIGHT); break;
+      case '9': XCALC_PRE_OP(kNINE); numeric(kNINE); break;
+      case '0': XCALC_PRE_OP(kZERO); numeric(kZERO); break;
+    }
+    post_op();
+}
+
+/*ARGSUSED*/
+static void divide(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kDIV);
+    rpn  ? twof(kDIV) : twoop(kDIV);
+    post_op();
+}
+
+/*ARGSUSED*/
+static void e(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kE);
+    oneop(kE);
+    post_op();
+}
+
+/*ARGSUSED*/
+static void enter(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kENTR);
+    entrf();
+    post_op();
+}
+
+/*ARGSUSED*/
+static void epower(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kEXP);
+    oneop(kEXP);
+    post_op();
+}
+
+/*ARGSUSED*/
+static void equal(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kEQU);
+    equf();
+    post_op();
+}
+
+/*ARGSUSED*/
+static void exchange(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kEXC);
+    oneop(kEXC);
+    post_op();
+}
+   
+/*ARGSUSED*/
+static void factorial(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kFACT);
+    oneop(kFACT);
+    post_op();
+}
+
+/*ARGSUSED*/
+static void inverse(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kINV);
+    invf();
+    post_op();
+}
+   
+/*ARGSUSED*/
+static void leftParen(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kLPAR);
+    lparf();
+    post_op();
+}
+   
+/*ARGSUSED*/
+static void logarithm(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kLOG);
+    oneop(kLOG);
+    post_op();
+}
+
+/*ARGSUSED*/
+static void multiply(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kMUL);
+    rpn ? twof(kMUL) : twoop(kMUL);
+    post_op();
+}
+   
+/*ARGSUSED*/
+static void naturalLog(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kLN);
+    oneop(kLN);
+    post_op();
+}
+   
+/*ARGSUSED*/
+static void negate(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kNEG);
+    negf();
+    post_op();
+}
+
+/*ARGSUSED*/
+static void nop(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    ringbell();
+}
+
+/*ARGSUSED*/
+static void off(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kOFF);
+    offf();
+    post_op();
+}
+   
+/*ARGSUSED*/
+static void pi(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kPI);
+    oneop(kPI);
+    post_op();
+}
+   
+/*ARGSUSED*/
+static void power(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kPOW);
+    rpn ? twof(kPOW) : twoop(kPOW);
+    post_op();
+}
+
+/*ARGSUSED*/
+static void quit(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    if (e->type == ClientMessage && e->xclient.data.l[0] != wm_delete_window)
+       ringbell();
+    else
+       Quit();
+}
+
+/*ARGSUSED*/
+static void recall(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kRCL);
+    rpn ? memf(kRCL) : oneop(kRCL);
+    post_op();
+}
+       
+/*ARGSUSED*/
+static void reciprocal(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kRECIP);
+    oneop(kRECIP);
+    post_op();
+}
+   
+/*ARGSUSED*/
+static void rightParen(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kRPAR);
+    rparf();
+    post_op();
+}
+   
+/*ARGSUSED*/
+static void roll(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kROLL);
+    rollf();
+    post_op();
+}
+
+/*ARGSUSED*/
+static void scientific(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kEE);
+    eef();
+    post_op();
+}
+
+/*ARGSUSED*/
+static void selection(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    do_select(((XButtonReleasedEvent *)e)->time);
+}
+
+/*ARGSUSED*/
+static void sine(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kSIN);
+    oneop(kSIN);
+    post_op();
+}
+
+/*ARGSUSED*/
+static void square(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kSQR);
+    oneop(kSQR);
+    post_op();
+}
+
+/*ARGSUSED*/
+static void squareRoot(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kSQRT);
+    oneop(kSQRT);
+    post_op();
+}
+   
+/*ARGSUSED*/
+static void store(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kSTO);
+    rpn ? memf(kSTO) : oneop(kSTO);
+    post_op();
+}
+
+/*ARGSUSED*/
+static void subtract(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kSUB);
+    rpn ? twof(kSUB) : twoop(kSUB);
+    post_op();
+}
+   
+/*ARGSUSED*/
+static void sum(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kSUM);
+    rpn ? memf(kSUM) : oneop(kSUM);
+    post_op();
+}
+   
+/*ARGSUSED*/
+static void tangent(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kTAN);
+    oneop(kTAN);
+    post_op();
+}
+   
+/*ARGSUSED*/
+static void tenpower(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(k10X);
+    oneop(k10X);
+    post_op();
+}
+   
+/*ARGSUSED*/
+static void XexchangeY(Widget w, XEvent *e, String *vector, Cardinal *count)
+{
+    XCALC_PRE_OP(kXXY);
+    twof(kXXY);
+    post_op();
+}
diff --git a/xcalc/app-defaults/XCalc b/xcalc/app-defaults/XCalc
new file mode 100644 (file)
index 0000000..31d553e
--- /dev/null
@@ -0,0 +1,530 @@
+! $XConsortium: XCalc.ad,v 1.13 94/03/03 19:19:32 converse Exp $
+! $XFree86$
+! XCalc application class resource file
+
+XCalc.Title:           Calculator
+XCalc.IconName:                Calc
+XCalc.IconPixmap:      calculator
+
+XCalc*Cursor:          hand2
+XCalc*Font:            8x13
+XCalc*ShapeStyle:      rectangle
+XCalc*Command.horizDistance:   2
+XCalc*Command.vertDistance:    2
+XCalc*Command.width:           40
+XCalc*Command.height:          26
+XCalc*Command.internalWidth:   1
+
+XCalc*bevel.background:                black
+XCalc*bevel.horizDistance:     4
+XCalc*bevel.vertDistance:      2
+
+XCalc*bevel.screen.horizDistance:      6
+XCalc*bevel.screen.vertDistance:       2
+XCalc*bevel.screen.defaultDistance:    0
+
+XCalc*bevel.screen.Label.horizDistance:                4
+XCalc*bevel.screen.Label.vertDistance:         2
+XCalc*bevel.screen.Label.internalHeight:       1
+XCalc*bevel.screen.Label.internalWidth:                1
+XCalc*bevel.screen.LCD.label:                  88888888888
+XCalc*bevel.screen.LCD.fromHoriz:              M
+XCalc*bevel.screen.LCD.horizDistance:          4
+XCalc*bevel.screen.LCD.vertDistance:           2
+XCalc*bevel.screen.INV.fromVert:               LCD
+XCalc*bevel.screen.INV.vertDistance:           4
+XCalc*bevel.screen.DEG.fromHoriz:              INV
+XCalc*bevel.screen.DEG.fromVert:               LCD
+XCalc*bevel.screen.DEG.horizDistance:          1
+XCalc*bevel.screen.RAD.fromHoriz:              DEG
+XCalc*bevel.screen.RAD.fromVert:               LCD
+XCalc*bevel.screen.GRAD.fromHoriz:             RAD
+XCalc*bevel.screen.GRAD.fromVert:              LCD
+XCalc*bevel.screen.P.label:                    ()
+XCalc*bevel.screen.P.fromHoriz:                        GRAD
+XCalc*bevel.screen.P.fromVert:                 LCD
+XCalc*bevel.screen.P.horizDistance:            2
+
+!XCalc*ti.Geometry:    171x252
+XCalc*ti.bevel.screen.LCD.width:               186
+
+XCalc*ti.bevel.screen.LCD.translations:        #replace\n\
+       Ctrl<Key>c:quit()\n\
+       Ctrl<Key>h:clear()\n\
+       None<Key>0:digit(0)\n\
+       None<Key>1:digit(1)\n\
+       None<Key>2:digit(2)\n\
+       None<Key>3:digit(3)\n\
+       None<Key>4:digit(4)\n\
+       None<Key>5:digit(5)\n\
+       None<Key>6:digit(6)\n\
+       None<Key>7:digit(7)\n\
+       None<Key>8:digit(8)\n\
+       None<Key>9:digit(9)\n\
+       <Key>KP_0:digit(0)\n\
+       <Key>KP_1:digit(1)\n\
+       <Key>KP_2:digit(2)\n\
+       <Key>KP_3:digit(3)\n\
+       <Key>KP_4:digit(4)\n\
+       <Key>KP_5:digit(5)\n\
+       <Key>KP_6:digit(6)\n\
+       <Key>KP_7:digit(7)\n\
+       <Key>KP_8:digit(8)\n\
+       <Key>KP_9:digit(9)\n\
+       <Key>KP_Enter:equal()\n\
+       <Key>KP_Equal:equal()\n\
+       <Key>KP_Multiply:multiply()\n\
+       <Key>KP_Add:add()\n\
+       <Key>KP_Subtract:subtract()\n\
+       <Key>KP_Decimal:decimal()\n\
+       <Key>KP_Separator:decimal()\n\
+       <Key>KP_Divide:divide()\n\
+       <Key>KP_Tab:equal()\n\
+       <Key>Clear:clear()\n\
+       :<Key>.:decimal()\n\
+       :<Key>+:add()\n\
+       :<Key>-:subtract()\n\
+       :<Key>*:multiply()\n\
+       :<Key>/:divide()\n\
+       :<Key>(:leftParen()\n\
+       :<Key>):rightParen()\n\
+       :<Key>!:factorial()\n\
+       <Key>e:e()\n\
+       :<Key>^:power()\n\
+       <Key>p:pi()\n\
+       <Key>i:inverse()\n\
+       <Key>s:sine()\n\
+       <Key>c:cosine()\n\
+       <Key>t:tangent()\n\
+       <Key>d:degree()\n\
+       <Key>l:naturalLog()\n\
+       :<Key>=:equal()\n\
+       <Key>n:negate()\n\
+       <Key>r:squareRoot()\n\
+       <Key>space:clear()\n\
+       <Key>q:quit()\n\
+       <Key>Delete:clear()\n\
+       <Key>BackSpace:clear()\n\
+       <Btn1Down>,<Btn1Up>:toggle()selection()\n
+
+XCalc*ti.button1.label:                1/x
+XCalc*ti.button1.translations: #override<Btn1Down>,<Btn1Up>:reciprocal()unset()
+XCalc*ti.button2.label:                x\262
+XCalc*ti.button2.translations: #override<Btn1Down>,<Btn1Up>:square()unset()
+XCalc*ti.button3.font:         -adobe-symbol-*-*-*-*-*-120-*-*-*-*-*-*
+XCalc*ti.button3.label:                \326\140
+XCalc*ti.button3.translations: #override<Btn1Down>,<Btn1Up>:squareRoot()unset()
+XCalc*ti.button4.label:                CE/C
+XCalc*ti.button4.translations: #override<Btn1Down>,<Btn1Up>:clear()unset()
+XCalc*ti.button5.label:                AC
+XCalc*ti.button5.translations: #override<Btn1Down>,<Btn1Up>:off()unset()\n\
+       <Btn3Down>,<Btn3Up>:quit()
+
+XCalc*ti.button6.label:                INV
+XCalc*ti.button6.translations: #override<Btn1Down>,<Btn1Up>:inverse()unset()
+XCalc*ti.button7.label:                sin
+XCalc*ti.button7.translations: #override<Btn1Down>,<Btn1Up>:sine()unset()
+XCalc*ti.button8.label:                cos
+XCalc*ti.button8.translations: #override<Btn1Down>,<Btn1Up>:cosine()unset()
+XCalc*ti.button9.label:                tan
+XCalc*ti.button9.translations: #override<Btn1Down>,<Btn1Up>:tangent()unset()
+XCalc*ti.button10.label:               DRG
+XCalc*ti.button10.translations: #override<Btn1Down>,<Btn1Up>:degree()unset()
+
+XCalc*ti.button11.label:       e
+XCalc*ti.button11.translations: #override<Btn1Down>,<Btn1Up>:e()unset()
+XCalc*ti.button12.label:       EE
+XCalc*ti.button12.translations: #override<Btn1Down>,<Btn1Up>:scientific()unset()
+XCalc*ti.button13.label:       log
+XCalc*ti.button13.translations: #override<Btn1Down>,<Btn1Up>:logarithm()unset()
+XCalc*ti.button14.label:       ln
+XCalc*ti.button14.translations: #override<Btn1Down>,<Btn1Up>:naturalLog()unset()
+XCalc*ti.button15.label:       y^x
+XCalc*ti.button15.translations: #override<Btn1Down>,<Btn1Up>:power()unset()
+
+XCalc*ti.button16.font:                -adobe-symbol-*-*-*-*-*-120-*-*-*-*-*-*
+XCalc*ti.button16.label:       \160
+XCalc*ti.button16.translations: #override<Btn1Down>,<Btn1Up>:pi()unset()
+XCalc*ti.button17.label:       x!
+XCalc*ti.button17.translations: #override<Btn1Down>,<Btn1Up>:factorial()unset()
+XCalc*ti.button18.label:       (
+XCalc*ti.button18.translations: #override<Btn1Down>,<Btn1Up>:leftParen()unset()
+XCalc*ti.button19.label:       )
+XCalc*ti.button19.translations: #override<Btn1Down>,<Btn1Up>:rightParen()unset()
+XCalc*ti.button20.font:                -adobe-symbol-*-*-*-*-*-120-*-*-*-*-*-*
+XCalc*ti.button20.label:       \270
+XCalc*ti.button20.translations: #override<Btn1Down>,<Btn1Up>:divide()unset()
+
+XCalc*ti.button21.label:       STO
+XCalc*ti.button21.translations: #override<Btn1Down>,<Btn1Up>:store()unset()
+XCalc*ti.button22.label:       7
+XCalc*ti.button22.translations: #override<Btn1Down>,<Btn1Up>:digit(7)unset()
+XCalc*ti.button23.label:       8
+XCalc*ti.button23.translations: #override<Btn1Down>,<Btn1Up>:digit(8)unset()
+XCalc*ti.button24.label:       9
+XCalc*ti.button24.translations: #override<Btn1Down>,<Btn1Up>:digit(9)unset()
+XCalc*ti.button25.label:       *
+XCalc*ti.button25.translations: #override<Btn1Down>,<Btn1Up>:multiply()unset()
+
+XCalc*ti.button26.label:       RCL
+XCalc*ti.button26.translations: #override<Btn1Down>,<Btn1Up>:recall()unset()
+XCalc*ti.button27.label:       4
+XCalc*ti.button27.translations: #override<Btn1Down>,<Btn1Up>:digit(4)unset()
+XCalc*ti.button28.label:       5
+XCalc*ti.button28.translations: #override<Btn1Down>,<Btn1Up>:digit(5)unset()
+XCalc*ti.button29.label:       6
+XCalc*ti.button29.translations: #override<Btn1Down>,<Btn1Up>:digit(6)unset()
+XCalc*ti.button30.label:       -
+XCalc*ti.button30.translations: #override<Btn1Down>,<Btn1Up>:subtract()unset()
+
+XCalc*ti.button31.label:       SUM
+XCalc*ti.button31.translations: #override<Btn1Down>,<Btn1Up>:sum()unset()
+XCalc*ti.button32.label:       1
+XCalc*ti.button32.translations: #override<Btn1Down>,<Btn1Up>:digit(1)unset()
+XCalc*ti.button33.label:       2
+XCalc*ti.button33.translations: #override<Btn1Down>,<Btn1Up>:digit(2)unset()
+XCalc*ti.button34.label:       3
+XCalc*ti.button34.translations: #override<Btn1Down>,<Btn1Up>:digit(3)unset()
+XCalc*ti.button35.label:       +
+XCalc*ti.button35.translations: #override<Btn1Down>,<Btn1Up>:add()unset()
+
+XCalc*ti.button36.label:       EXC
+XCalc*ti.button36.translations: #override<Btn1Down>,<Btn1Up>:exchange()unset()
+XCalc*ti.button37.label:       0
+XCalc*ti.button37.translations: #override<Btn1Down>,<Btn1Up>:digit(0)unset()
+XCalc*ti.button38.label:       .
+XCalc*ti.button38.translations: #override<Btn1Down>,<Btn1Up>:decimal()unset()
+XCalc*ti.button39.label:       +/-
+XCalc*ti.button39.translations: #override<Btn1Down>,<Btn1Up>:negate()unset()
+XCalc*ti.button40.label:       =
+XCalc*ti.button40.translations: #override<Btn1Down>,<Btn1Up>:equal()unset()
+
+XCalc*ti.button1.horizDistance:        4       
+XCalc*ti.button1.vertDistance: 12
+XCalc*ti.button1.fromVert:     bevel
+XCalc*ti.button2.fromHoriz:    button1
+XCalc*ti.button2.fromVert:     bevel
+XCalc*ti.button2.vertDistance: 12
+XCalc*ti.button3.fromHoriz:    button2
+XCalc*ti.button3.fromVert:     bevel
+XCalc*ti.button3.vertDistance: 12
+XCalc*ti.button4.fromHoriz:    button3
+XCalc*ti.button4.fromVert:     bevel
+XCalc*ti.button4.vertDistance: 12
+XCalc*ti.button5.fromHoriz:    button4
+XCalc*ti.button5.fromVert:     bevel
+XCalc*ti.button5.vertDistance: 12
+
+XCalc*ti.button6.horizDistance:        4
+XCalc*ti.button6.fromVert:     button1
+XCalc*ti.button7.fromHoriz:    button6
+XCalc*ti.button7.fromVert:     button2
+XCalc*ti.button8.fromHoriz:    button7
+XCalc*ti.button8.fromVert:     button3
+XCalc*ti.button9.fromHoriz:    button8
+XCalc*ti.button9.fromVert:     button4
+XCalc*ti.button10.fromHoriz:   button9
+XCalc*ti.button10.fromVert:    button5
+
+XCalc*ti.button11.horizDistance:       4
+XCalc*ti.button11.fromVert:            button6
+XCalc*ti.button12.fromHoriz:           button11
+XCalc*ti.button12.fromVert:            button7
+XCalc*ti.button13.fromHoriz:           button12
+XCalc*ti.button13.fromVert:            button8
+XCalc*ti.button14.fromHoriz:           button13
+XCalc*ti.button14.fromVert:            button9
+XCalc*ti.button15.fromHoriz:           button14
+XCalc*ti.button15.fromVert:            button10
+
+XCalc*ti.button16.horizDistance:       4
+XCalc*ti.button16.fromVert:            button11
+XCalc*ti.button17.fromHoriz:           button16
+XCalc*ti.button17.fromVert:            button12
+XCalc*ti.button18.fromHoriz:           button17
+XCalc*ti.button18.fromVert:            button13
+XCalc*ti.button19.fromHoriz:           button18
+XCalc*ti.button19.fromVert:            button14
+XCalc*ti.button20.fromHoriz:           button19
+XCalc*ti.button20.fromVert:            button15
+
+XCalc*ti.button21.horizDistance:       4
+XCalc*ti.button21.fromVert:            button16
+XCalc*ti.button22.fromHoriz:           button21
+XCalc*ti.button22.fromVert:            button17
+XCalc*ti.button23.fromHoriz:           button22
+XCalc*ti.button23.fromVert:            button18
+XCalc*ti.button24.fromHoriz:           button23
+XCalc*ti.button24.fromVert:            button19
+XCalc*ti.button25.fromHoriz:           button24
+XCalc*ti.button25.fromVert:            button20
+
+XCalc*ti.button26.horizDistance:       4
+XCalc*ti.button26.fromVert:            button21
+XCalc*ti.button27.fromHoriz:           button26
+XCalc*ti.button27.fromVert:            button22
+XCalc*ti.button28.fromHoriz:           button27
+XCalc*ti.button28.fromVert:            button23
+XCalc*ti.button29.fromHoriz:           button28
+XCalc*ti.button29.fromVert:            button24
+XCalc*ti.button30.fromHoriz:           button29
+XCalc*ti.button30.fromVert:            button25
+
+XCalc*ti.button31.horizDistance:       4
+XCalc*ti.button31.fromVert:            button26
+XCalc*ti.button32.fromHoriz:           button31
+XCalc*ti.button32.fromVert:            button27
+XCalc*ti.button33.fromHoriz:           button32
+XCalc*ti.button33.fromVert:            button28
+XCalc*ti.button34.fromHoriz:           button33
+XCalc*ti.button34.fromVert:            button29
+XCalc*ti.button35.fromHoriz:           button34
+XCalc*ti.button35.fromVert:            button30
+
+XCalc*ti.button36.horizDistance:       4
+XCalc*ti.button36.fromVert:            button31
+XCalc*ti.button37.fromHoriz:           button36
+XCalc*ti.button37.fromVert:            button32
+XCalc*ti.button38.fromHoriz:           button37
+XCalc*ti.button38.fromVert:            button33
+XCalc*ti.button39.fromHoriz:           button38
+XCalc*ti.button39.fromVert:            button34
+XCalc*ti.button40.fromHoriz:           button39
+XCalc*ti.button40.fromVert:            button35
+
+
+!XCalc*hp.Geometry:                    336x164
+XCalc*hp.bevel.screen.LCD.width:       186
+
+XCalc*hp.bevel.screen.LCD.translations:        #replace\n\
+       Ctrl<Key>c:quit()\n\
+       Ctrl<Key>h:back()\n\
+       None<Key>0:digit(0)\n\
+       None<Key>1:digit(1)\n\
+       None<Key>2:digit(2)\n\
+       None<Key>3:digit(3)\n\
+       None<Key>4:digit(4)\n\
+       None<Key>5:digit(5)\n\
+       None<Key>6:digit(6)\n\
+       None<Key>7:digit(7)\n\
+       None<Key>8:digit(8)\n\
+       None<Key>9:digit(9)\n\
+       <Key>KP_0:digit(0)\n\
+       <Key>KP_1:digit(1)\n\
+       <Key>KP_2:digit(2)\n\
+       <Key>KP_3:digit(3)\n\
+       <Key>KP_4:digit(4)\n\
+       <Key>KP_5:digit(5)\n\
+       <Key>KP_6:digit(6)\n\
+       <Key>KP_7:digit(7)\n\
+       <Key>KP_8:digit(8)\n\
+       <Key>KP_9:digit(9)\n\
+       <Key>KP_Enter:enter()\n\
+       <Key>KP_Multiply:multiply()\n\
+       <Key>KP_Add:add()\n\
+       <Key>KP_Subtract:subtract()\n\
+       <Key>KP_Decimal:decimal()\n\
+       <Key>KP_Divide:divide()\n\
+       :<Key>.:decimal()\n\
+       :<Key>+:add()\n\
+       :<Key>-:subtract()\n\
+       :<Key>*:multiply()\n\
+       :<Key>/:divide()\n\
+       :<Key>!:factorial()\n\
+       <Key>e:e()\n\
+       :<Key>^:power()\n\
+       <Key>p:pi()\n\
+       <Key>i:inverse()\n\
+       <Key>s:sine()\n\
+       <Key>c:cosine()\n\
+       <Key>t:tangent()\n\
+       <Key>d:degree()\n\
+       <Key>l:naturalLog()\n\
+       <Key>n:negate()\n\
+       <Key>r:squareRoot()\n\
+       <Key>space:clear()\n\
+       <Key>q:quit()\n\
+       <Key>Delete:back()\n\
+       <Key>Return:enter()\n\
+       <Key>Linefeed:enter()\n\
+       <Key>x:XexchangeY()\n\
+       <Key>BackSpace:back()\n\
+       <Btn1Down>,<Btn1Up>:toggle()selection()\n
+
+XCalc*hp.button1.font:         -adobe-symbol-*-*-*-*-*-120-*-*-*-*-*-*
+XCalc*hp.button1.label:                \326\140
+XCalc*hp.button1.translations: #override<Btn1Down>,<Btn1Up>:squareRoot()unset()
+XCalc*hp.button2.label:                e^x
+XCalc*hp.button2.translations: #override<Btn1Down>,<Btn1Up>:epower()unset()
+XCalc*hp.button3.label:                10^x
+XCalc*hp.button3.translations: #override<Btn1Down>,<Btn1Up>:tenpower()unset()
+XCalc*hp.button4.label:                y^x
+XCalc*hp.button4.translations: #override<Btn1Down>,<Btn1Up>:power()unset()
+XCalc*hp.button5.label:                1/x
+XCalc*hp.button5.translations: #override<Btn1Down>,<Btn1Up>:reciprocal()unset()
+XCalc*hp.button6.label:                CHS
+XCalc*hp.button6.translations: #override<Btn1Down>,<Btn1Up>:negate()unset()
+XCalc*hp.button7.label:                7
+XCalc*hp.button7.translations: #override<Btn1Down>,<Btn1Up>:digit(7)unset()
+XCalc*hp.button8.label:                8
+XCalc*hp.button8.translations: #override<Btn1Down>,<Btn1Up>:digit(8)unset()
+XCalc*hp.button9.label:                9
+XCalc*hp.button9.translations: #override<Btn1Down>,<Btn1Up>:digit(9)unset()
+XCalc*hp.button10.font:                -adobe-symbol-*-*-*-*-*-120-*-*-*-*-*-*
+XCalc*hp.button10.label:       \270
+XCalc*hp.button10.translations: #override<Btn1Down>,<Btn1Up>:divide()unset()
+
+XCalc*hp.button11.label:       x!
+XCalc*hp.button11.translations: #override<Btn1Down>,<Btn1Up>:factorial()unset()
+XCalc*hp.button12.font:                -adobe-symbol-*-*-*-*-*-120-*-*-*-*-*-*
+XCalc*hp.button12.label:       \160
+XCalc*hp.button12.translations: #override<Btn1Down>,<Btn1Up>:pi()unset()
+XCalc*hp.button13.label:       sin
+XCalc*hp.button13.translations: #override<Btn1Down>,<Btn1Up>:sine()unset()
+XCalc*hp.button14.label:       cos
+XCalc*hp.button14.translations: #override<Btn1Down>,<Btn1Up>:cosine()unset()
+XCalc*hp.button15.label:       tan
+XCalc*hp.button15.translations: #override<Btn1Down>,<Btn1Up>:tangent()unset()
+XCalc*hp.button16.label:       EEX
+XCalc*hp.button16.translations: #override<Btn1Down>,<Btn1Up>:scientific()unset()
+XCalc*hp.button17.label:       4
+XCalc*hp.button17.translations: #override<Btn1Down>,<Btn1Up>:digit(4)unset()
+XCalc*hp.button18.label:       5
+XCalc*hp.button18.translations: #override<Btn1Down>,<Btn1Up>:digit(5)unset()
+XCalc*hp.button19.label:       6
+XCalc*hp.button19.translations: #override<Btn1Down>,<Btn1Up>:digit(6)unset()
+XCalc*hp.button20.label:       *
+XCalc*hp.button20.translations: #override<Btn1Down>,<Btn1Up>:multiply()unset()
+
+XCalc*hp.button21.mappedWhenManaged: False
+XCalc*hp.button22.mappedWhenManaged: False
+XCalc*hp.button23.label:       Rv
+XCalc*hp.button23.translations: #override<Btn1Down>,<Btn1Up>:roll()unset()
+XCalc*hp.button24.label:       x:y
+XCalc*hp.button24.translations: #override<Btn1Down>,<Btn1Up>:XexchangeY()unset()
+XCalc*hp.button25.label:       <-
+XCalc*hp.button25.translations: #override<Btn1Down>,<Btn1Up>:back()unset()
+XCalc*hp.button26.label:       E\nN\nT\nE\nR
+XCalc*hp.button26.translations: #override<Btn1Down>,<Btn1Up>:enter()unset()
+XCalc*hp.button27.label:       1
+XCalc*hp.button27.translations: #override<Btn1Down>,<Btn1Up>:digit(1)unset()
+XCalc*hp.button28.label:       2
+XCalc*hp.button28.translations: #override<Btn1Down>,<Btn1Up>:digit(2)unset()
+XCalc*hp.button29.label:       3
+XCalc*hp.button29.translations: #override<Btn1Down>,<Btn1Up>:digit(3)unset()
+XCalc*hp.button30.label:       -
+XCalc*hp.button30.translations: #override<Btn1Down>,<Btn1Up>:subtract()unset()
+
+XCalc*hp.button31.label:       ON
+XCalc*hp.button31.translations: #override<Btn1Down>,<Btn1Up>:off()unset()\n\
+       <Btn3Down>,<Btn3Up>:quit()
+XCalc*hp.button32.label:       DRG
+XCalc*hp.button32.translations: #override<Btn1Down>,<Btn1Up>:degree()unset()
+XCalc*hp.button33.label:       INV
+XCalc*hp.button33.translations: #override<Btn1Down>,<Btn1Up>:inverse()unset()
+XCalc*hp.button34.label:       STO
+XCalc*hp.button34.translations: #override<Btn1Down>,<Btn1Up>:store()unset()
+XCalc*hp.button35.label:       RCL
+XCalc*hp.button35.translations: #override<Btn1Down>,<Btn1Up>:recall()unset()
+XCalc*hp.button36.label:       0
+XCalc*hp.button36.translations: #override<Btn1Down>,<Btn1Up>:digit(0)unset()
+XCalc*hp.button37.label:       .
+XCalc*hp.button37.translations: #override<Btn1Down>,<Btn1Up>:decimal()unset()
+XCalc*hp.button38.label:       SUM
+XCalc*hp.button38.translations: #override<Btn1Down>,<Btn1Up>:sum()unset()
+XCalc*hp.button39.label:       +
+XCalc*hp.button39.translations: #override<Btn1Down>,<Btn1Up>:add()unset()
+
+XCalc*hp.button1.horizDistance:        4
+XCalc*hp.button1.vertDistance: 12
+XCalc*hp.button1.fromVert:     bevel
+XCalc*hp.button2.fromHoriz:    button1
+XCalc*hp.button2.fromVert:     bevel
+XCalc*hp.button2.vertDistance: 12
+XCalc*hp.button3.fromHoriz:    button2
+XCalc*hp.button3.fromVert:     bevel
+XCalc*hp.button3.vertDistance: 12
+XCalc*hp.button4.fromHoriz:    button3
+XCalc*hp.button4.fromVert:     bevel
+XCalc*hp.button4.vertDistance: 12
+XCalc*hp.button5.fromHoriz:    button4
+XCalc*hp.button5.fromVert:     bevel
+XCalc*hp.button5.vertDistance: 12
+XCalc*hp.button6.fromHoriz:    button5
+XCalc*hp.button6.fromVert:     bevel
+XCalc*hp.button6.vertDistance: 12
+XCalc*hp.button7.fromHoriz:    button6
+XCalc*hp.button7.fromVert:     bevel
+XCalc*hp.button7.vertDistance: 12
+XCalc*hp.button8.fromHoriz:    button7
+XCalc*hp.button8.fromVert:     bevel
+XCalc*hp.button8.vertDistance: 12
+XCalc*hp.button9.fromHoriz:    button8
+XCalc*hp.button9.fromVert:     bevel
+XCalc*hp.button9.vertDistance: 12
+XCalc*hp.button10.fromHoriz:   button9
+XCalc*hp.button10.fromVert:    bevel
+XCalc*hp.button10.vertDistance:        12
+
+XCalc*hp.button11.horizDistance:       4
+XCalc*hp.button11.fromVert:            button1
+XCalc*hp.button12.fromHoriz:           button11
+XCalc*hp.button12.fromVert:            button2
+XCalc*hp.button13.fromHoriz:           button12
+XCalc*hp.button13.fromVert:            button3
+XCalc*hp.button14.fromHoriz:           button13
+XCalc*hp.button14.fromVert:            button4
+XCalc*hp.button15.fromHoriz:           button14
+XCalc*hp.button15.fromVert:            button5
+XCalc*hp.button16.fromHoriz:           button15
+XCalc*hp.button16.fromVert:            button6
+XCalc*hp.button17.fromHoriz:           button16
+XCalc*hp.button17.fromVert:            button7
+XCalc*hp.button18.fromHoriz:           button17
+XCalc*hp.button18.fromVert:            button8
+XCalc*hp.button19.fromHoriz:           button18
+XCalc*hp.button19.fromVert:            button9
+XCalc*hp.button20.fromHoriz:           button19
+XCalc*hp.button20.fromVert:            button10
+
+XCalc*hp.button21.horizDistance:       4
+XCalc*hp.button21.fromVert:            button11
+XCalc*hp.button22.fromHoriz:           button21
+XCalc*hp.button22.fromVert:            button12
+XCalc*hp.button23.fromHoriz:           button22
+XCalc*hp.button23.fromVert:            button13
+XCalc*hp.button24.fromHoriz:           button23
+XCalc*hp.button24.fromVert:            button14
+XCalc*hp.button25.fromHoriz:           button24
+XCalc*hp.button25.fromVert:            button15
+XCalc*hp.button26.fromHoriz:           button25
+XCalc*hp.button26.fromVert:            button16
+XCalc*hp.button26.font:                        6x12
+XCalc*hp.button26.height:              56
+XCalc*hp.button27.fromHoriz:           button26
+XCalc*hp.button27.fromVert:            button17
+XCalc*hp.button28.fromHoriz:           button27
+XCalc*hp.button28.fromVert:            button18
+XCalc*hp.button29.fromHoriz:           button28
+XCalc*hp.button29.fromVert:            button19
+XCalc*hp.button30.fromHoriz:           button29
+XCalc*hp.button30.fromVert:            button20
+
+XCalc*hp.button31.horizDistance:       4
+XCalc*hp.button31.fromVert:            button21
+XCalc*hp.button32.fromHoriz:           button31
+XCalc*hp.button32.fromVert:            button22
+XCalc*hp.button33.fromHoriz:           button32
+XCalc*hp.button33.fromVert:            button23
+XCalc*hp.button34.fromHoriz:           button33
+XCalc*hp.button34.fromVert:            button24
+XCalc*hp.button35.fromHoriz:           button34
+XCalc*hp.button35.fromVert:            button25
+XCalc*hp.button36.fromHoriz:           button26
+XCalc*hp.button36.fromVert:            button27
+XCalc*hp.button37.fromHoriz:           button36
+XCalc*hp.button37.fromVert:            button28
+XCalc*hp.button38.fromHoriz:           button37
+XCalc*hp.button38.fromVert:            button29
+XCalc*hp.button39.fromHoriz:           button38
+XCalc*hp.button39.fromVert:            button30
diff --git a/xcalc/app-defaults/XCalc-color b/xcalc/app-defaults/XCalc-color
new file mode 100644 (file)
index 0000000..6b26604
--- /dev/null
@@ -0,0 +1,225 @@
+#include "XCalc"
+
+XCalc*ti.backgroundPixmap:             gray3?foreground=gray70&background=gray85
+XCalc*.bevel.background:               gray80
+XCalc*.bevel.displayList:              foreground gray90;lines -1,0,0,0,0,-1;lines 3,-4,-4,-4,-4,3
+
+XCalc*.bevel.borderColor:              gray60
+XCalc*.bevel.borderWidth:              1
+XCalc*.bevel.vertDistance:             4
+XCalc*.bevel.defaultDistance:          4
+XCalc*.bevel.screen.vertDistance:      4
+XCalc*.bevel.screen.horizDistance:     4
+XCalc*.bevel.screen*left:              chainLeft
+XCalc*.bevel.screen*right:             chainRight
+XCalc*.bevel.screen*top:               chainTop
+XCalc*.bevel.screen*bottom:            chainBottom
+XCalc*.bevel.screen*background:        rgb:9/a/9
+XCalc*.bevel.screen.borderColor:       gray50
+XCalc*.bevel.screen*LCD.foreground:    gray20
+XCalc*.bevel.screen*INV.vertDistance:  2
+
+!      T e x a s   I n s t r u m e n t s   T I - 3 0
+
+XCalc*ti.Command.shapeStyle:           roundedRectangle
+XCalc*ti.Command.displayList:          foreground rgb:a/b/c;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+
+XCalc*ti.Command.borderColor:          rgb:8/9/a
+XCalc*ti.Command.background:           rgb:c/d/e
+XCalc*ti.Command.foreground:           gray5
+
+XCalc*ti.button20.foreground:          gray5
+XCalc*ti.button20.background:          rgb:e/d/c
+XCalc*ti.button20.displayList:         foreground rgb:a/9/8;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+XCalc*ti.button20.borderColor:         rgb:9/8/7
+
+XCalc*ti.button25.foreground:          gray5
+XCalc*ti.button25.background:          rgb:e/d/c
+XCalc*ti.button25.displayList:         foreground rgb:a/9/8;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+XCalc*ti.button25.borderColor:         rgb:9/8/7
+
+XCalc*ti.button30.foreground:          gray5
+XCalc*ti.button30.background:          rgb:e/d/c
+XCalc*ti.button30.displayList:         foreground rgb:a/9/8;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+XCalc*ti.button30.borderColor:         rgb:9/8/7
+
+XCalc*ti.button35.foreground:          gray5
+XCalc*ti.button35.background:          rgb:e/d/c
+XCalc*ti.button35.displayList:         foreground rgb:a/9/8;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+XCalc*ti.button35.borderColor:         rgb:9/8/7
+
+XCalc*ti.button40.foreground:          gray5
+XCalc*ti.button40.background:          rgb:e/d/c
+XCalc*ti.button40.displayList:         foreground rgb:a/9/8;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+XCalc*ti.button40.borderColor:         rgb:9/8/7
+
+
+
+XCalc*ti.button22.background:          gray95
+XCalc*ti.button22.displayList:         foreground gray75;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+XCalc*ti.button22.borderColor:         gray65
+
+XCalc*ti.button23.background:          gray95
+XCalc*ti.button23.displayList:         foreground gray75;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+XCalc*ti.button23.borderColor:         gray65
+
+XCalc*ti.button24.background:          gray95
+XCalc*ti.button24.displayList:         foreground gray75;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+XCalc*ti.button24.borderColor:         gray65
+
+XCalc*ti.button27.background:          gray95
+XCalc*ti.button27.displayList:         foreground gray75;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+XCalc*ti.button27.borderColor:         gray65
+
+XCalc*ti.button28.background:          gray95
+XCalc*ti.button28.displayList:         foreground gray75;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+XCalc*ti.button28.borderColor:         gray65
+
+XCalc*ti.button29.background:          gray95
+XCalc*ti.button29.displayList:         foreground gray75;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+XCalc*ti.button29.borderColor:         gray65
+
+XCalc*ti.button32.background:          gray95
+XCalc*ti.button32.displayList:         foreground gray75;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+XCalc*ti.button32.borderColor:         gray65
+
+XCalc*ti.button33.background:          gray95
+XCalc*ti.button33.displayList:         foreground gray75;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+XCalc*ti.button33.borderColor:         gray65
+
+XCalc*ti.button34.background:          gray95
+XCalc*ti.button34.displayList:         foreground gray75;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+XCalc*ti.button34.borderColor:         gray65
+
+XCalc*ti.button37.background:          gray95
+XCalc*ti.button37.displayList:         foreground gray75;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+XCalc*ti.button37.borderColor:         gray65
+
+XCalc*ti.button38.background:          gray95
+XCalc*ti.button38.displayList:         foreground gray75;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+XCalc*ti.button38.borderColor:         gray65
+
+XCalc*ti.button39.background:          gray95
+XCalc*ti.button39.displayList:         foreground gray75;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+XCalc*ti.button39.borderColor:         gray65
+
+!      H e w l e t t - P a c k a r d   1 0 C
+
+XCalc*hp.Command.shapeStyle:           roundedRectangle
+XCalc*hp.background:   wheat
+
+XCalc*hp.Command.background:           peru
+XCalc*hp.Command.foreground:           white
+
+! Unused buttons.  (Make invisible.)
+XCalc*hp.button21.background:  wheat
+XCalc*hp.button22.background:  wheat
+
+! ON button
+XCalc*hp.button31.background:  goldenrod
+XCalc*hp.button31.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+!XCalc*hp.button31.foreground: white
+
+! SQRT
+XCalc*hp.button1.displayList:  foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! e^x
+XCalc*hp.button2.displayList:  foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! 10^x
+XCalc*hp.button3.displayList:  foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! y^x
+XCalc*hp.button4.displayList:  foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! 1/c
+XCalc*hp.button5.displayList:  foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! CHS
+XCalc*hp.button6.displayList:  foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! x!
+XCalc*hp.button11.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! pi
+XCalc*hp.button12.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! sin
+XCalc*hp.button13.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! cos
+XCalc*hp.button14.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! tan
+XCalc*hp.button15.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! EEX
+XCalc*hp.button16.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! Rv
+XCalc*hp.button23.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! x:y
+XCalc*hp.button24.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! <-
+XCalc*hp.button25.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! ENTER
+XCalc*hp.button26.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! DRG
+XCalc*hp.button32.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! INV
+XCalc*hp.button33.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! STO
+XCalc*hp.button34.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+!RCL
+XCalc*hp.button35.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+
+! "Operator" keys.
+! Divide key
+XCalc*hp.button10.background:  SteelBlue
+XCalc*hp.button10.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! Multiply key
+XCalc*hp.button20.background:  SteelBlue
+XCalc*hp.button20.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! Minus key
+XCalc*hp.button30.background:  SteelBlue
+XCalc*hp.button30.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! SUM
+XCalc*hp.button38.background:  SteelBlue
+XCalc*hp.button38.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! Plus key
+XCalc*hp.button39.background:  SteelBlue
+XCalc*hp.button39.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+
+! "Number" keys.
+! "7"
+XCalc*hp.button7.background:   white
+XCalc*hp.button7.foreground:   black
+XCalc*hp.button7.displayList:  foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! "8"
+XCalc*hp.button8.background:   white
+XCalc*hp.button8.foreground:   black
+XCalc*hp.button8.displayList:  foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! "9"
+XCalc*hp.button9.background:   white
+XCalc*hp.button9.foreground:   black
+XCalc*hp.button9.displayList:  foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! "4"
+XCalc*hp.button17.background:  white
+XCalc*hp.button17.foreground:  black
+XCalc*hp.button17.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! "5"
+XCalc*hp.button18.background:  white
+XCalc*hp.button18.foreground:  black
+XCalc*hp.button18.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! "6"
+XCalc*hp.button19.background:  white
+XCalc*hp.button19.foreground:  black
+XCalc*hp.button19.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! "1"
+XCalc*hp.button27.background:  white
+XCalc*hp.button27.foreground:  black
+XCalc*hp.button27.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! "2"
+XCalc*hp.button28.background:  white
+XCalc*hp.button28.foreground:  black
+XCalc*hp.button28.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! "3"
+XCalc*hp.button29.background:  white
+XCalc*hp.button29.foreground:  black
+XCalc*hp.button29.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! "0"
+XCalc*hp.button36.background:  white
+XCalc*hp.button36.foreground:  black
+XCalc*hp.button36.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
+! "."
+XCalc*hp.button37.background:  white
+XCalc*hp.button37.foreground:  black
+XCalc*hp.button37.displayList: foreground rgb:b/b/b;segments 8,-4,-9,-4,-4,-9,-4,8;draw-arc -14,-14,-4,-4,270,90
diff --git a/xcalc/autogen.sh b/xcalc/autogen.sh
new file mode 100755 (executable)
index 0000000..e81f989
--- /dev/null
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
+
diff --git a/xcalc/config.guess b/xcalc/config.guess
new file mode 100755 (executable)
index 0000000..dc84c68
--- /dev/null
@@ -0,0 +1,1501 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+#   Free Software Foundation, Inc.
+
+timestamp='2009-11-20'
+
+# 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 (context
+# diff format) to <config-patches@gnu.org> and include a 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.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+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 <config-patches@gnu.org>."
+
+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, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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 "$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 ;;
+           sh5el) machine=sh5le-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 -q __ELF__
+               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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+       echo i386-pc-auroraux${UNAME_RELEASE}
+       exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+       eval $set_cc_for_build
+       SUN_ARCH="i386"
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       echo ${SUN_ARCH}-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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:*:[456])
+       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+               IBM_ARCH=rs6000
+       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 <stdlib.h>
+              #include <unistd.h>
+
+              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 -q __LP64__
+           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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       exit ;;
+    i*:CYGWIN*:*)
+       echo ${UNAME_MACHINE}-pc-cygwin
+       exit ;;
+    *: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 ;;
+    *:Interix*:*)
+       case ${UNAME_MACHINE} in
+           x86)
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           authenticamd | genuineintel | EM64T)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+           IA64)
+               echo ia64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+       esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       exit ;;
+    8664:Windows_NT:*)
+       echo x86_64-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*:*:* | x86_64: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 ;;
+    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 -q ld.so.1
+       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+       exit ;;
+    arm*:Linux:*:*)
+       eval $set_cc_for_build
+       if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_EABI__
+       then
+           echo ${UNAME_MACHINE}-unknown-linux-gnu
+       else
+           echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+       fi
+       exit ;;
+    avr32*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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 ;;
+    i*86:Linux:*:*)
+       LIBC=gnu
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+       echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+       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:*:* | mips64:Linux:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #undef CPU
+       #undef ${UNAME_MACHINE}
+       #undef ${UNAME_MACHINE}el
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=${UNAME_MACHINE}el
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       CPU=${UNAME_MACHINE}
+       #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; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-unknown-linux-gnu
+       exit ;;
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-gnu
+       exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+       echo hppa64-unknown-linux-gnu
+       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 ;;
+    ppc64:Linux:*:*)
+       echo powerpc64-unknown-linux-gnu
+       exit ;;
+    ppc:Linux:*:*)
+       echo powerpc-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 ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-gnu
+       exit ;;
+    x86_64:Linux:*:*)
+       echo x86_64-unknown-linux-gnu
+       exit ;;
+    xtensa*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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.[02]*:*)
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-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; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       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; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; 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.[02]*:*)
+       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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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 ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       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 ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-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
+           i386)
+               eval $set_cc_for_build
+               if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+                 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+                     (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+                     grep IS_64BIT_ARCH >/dev/null
+                 then
+                     UNAME_PROCESSOR="x86_64"
+                 fi
+               fi ;;
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/xcalc/config.h.in b/xcalc/config.h.in
new file mode 100644 (file)
index 0000000..7c9cfb1
--- /dev/null
@@ -0,0 +1,64 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* 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 home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
diff --git a/xcalc/config.sub b/xcalc/config.sub
new file mode 100755 (executable)
index 0000000..2a55a50
--- /dev/null
@@ -0,0 +1,1705 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+#   Free Software Foundation, Inc.
+
+timestamp='2009-11-20'
+
+# 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 <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted GNU 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.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# 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 <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-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 | -microblaze)
+               os=
+               basic_machine=$1
+               ;;
+        -bluegene*)
+               os=-cnk
+               ;;
+       -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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | bfin \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fido | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | lm32 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore | mep | metag \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64octeon | mips64octeonel \
+       | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | moxie \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | rx \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | ubicom32 \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | z8k | z80)
+               basic_machine=$basic_machine-unknown
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12 | picochip)
+               # Motorola 68HC11/12.
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64octeon-* | mips64octeonel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | none-* | np1-* | ns16k-* | ns32k-* \
+       | orion-* \
+       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+       | pyramid-* \
+       | romp-* | rs6000-* | rx-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+       | tron-* \
+       | ubicom32-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa*-* \
+       | ymp-* \
+       | z8k-* | z80-*)
+               ;;
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               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
+               ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       bluegene*)
+               basic_machine=powerpc-ibm
+               os=-cnk
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+        cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
+       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
+               ;;
+       cr16)
+               basic_machine=cr16-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
+               ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
+       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
+               ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       m88k-omron*)
+               basic_machine=m88k-omron
+               ;;
+       magnum | m3230)
+               basic_machine=mips-mips
+               os=-sysv
+               ;;
+       merlin)
+               basic_machine=ns32k-utek
+               os=-sysv
+               ;;
+        microblaze)
+               basic_machine=microblaze-xilinx
+               ;;
+       mingw32)
+               basic_machine=i386-pc
+               os=-mingw32
+               ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
+       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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       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
+               ;;
+       tile*)
+               basic_machine=tile-unknown
+               os=-linux-gnu
+               ;;
+       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
+               ;;
+       z80-*-coff)
+               basic_machine=z80-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[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+               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.
+        -auroraux)
+               os=-auroraux
+               ;;
+       -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* | -cnk* | -sunos | -sunos[34]*\
+             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+             | -sym* | -kopensolaris* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* | -aros* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
+             | -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* | -cegcc* \
+             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -linux-newlib* | -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* | -rdos* | -toppers* | -drops* | -es*)
+       # 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
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+       -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
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
+       *-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
+               ;;
+        mep-*)
+               os=-elf
+               ;;
+       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
+                               ;;
+                       -cnk*|-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/xcalc/configure b/xcalc/configure
new file mode 100755 (executable)
index 0000000..e46f125
--- /dev/null
@@ -0,0 +1,6916 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.67 for xcalc 1.0.3.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+        /*)
+          for as_base in sh bash ksh sh5; do
+            # Try only shells that exist, to save several forks.
+            as_shell=$as_dir/$as_base
+            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+          done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+       # neutralization value for shells without unset; and this also
+       # works around shells that cannot unset nonexistent variables.
+       BASH_ENV=/dev/null
+       ENV=/dev/null
+       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+       export CONFIG_SHELL
+       exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='xcalc'
+PACKAGE_TARNAME='xcalc'
+PACKAGE_VERSION='1.0.3'
+PACKAGE_STRING='xcalc 1.0.3'
+PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+appdefaultdir
+APPDEFS_LIBS
+APPDEFS_CFLAGS
+XCALC_LIBS
+XCALC_CFLAGS
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+MAN_SUBSTS
+XORG_MAN_PAGE
+ADMIN_MAN_DIR
+DRIVER_MAN_DIR
+MISC_MAN_DIR
+FILE_MAN_DIR
+LIB_MAN_DIR
+APP_MAN_DIR
+ADMIN_MAN_SUFFIX
+DRIVER_MAN_SUFFIX
+MISC_MAN_SUFFIX
+FILE_MAN_SUFFIX
+LIB_MAN_SUFFIX
+APP_MAN_SUFFIX
+SED
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+INSTALL_CMD
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
+PKG_CONFIG
+CHANGELOG_CMD
+CWARNFLAGS
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_strict_compilation
+enable_silent_rules
+with_appdefaultdir
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR
+XCALC_CFLAGS
+XCALC_LIBS
+APPDEFS_CFLAGS
+APPDEFS_LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=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 ;;
+
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_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'`
+  as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+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
+    $as_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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 xcalc 1.0.3 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/xcalc]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_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 xcalc 1.0.3:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --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
+  --enable-strict-compilation
+                          Enable all warnings from compiler and make them
+                          errors (default: disabled)
+  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-appdefaultdir=<pathname>
+                          specify directory for app-defaults files (default is
+                          autodetected)
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  PKG_CONFIG  path to pkg-config utility
+  PKG_CONFIG_PATH
+              directories to add to pkg-config's search path
+  PKG_CONFIG_LIBDIR
+              path overriding pkg-config's built-in search path
+  XCALC_CFLAGS
+              C compiler flags for XCALC, overriding pkg-config
+  XCALC_LIBS  linker flags for XCALC, overriding pkg-config
+  APPDEFS_CFLAGS
+              C compiler flags for APPDEFS, overriding pkg-config
+  APPDEFS_LIBS
+              linker flags for APPDEFS, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+xcalc configure 1.0.3
+generated by GNU Autoconf 2.67
+
+Copyright (C) 2010 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
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_decl
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_compile
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by xcalc $as_me 1.0.3, which was
+generated by GNU Autoconf 2.67.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append 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
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > 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
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5 ; }
+  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.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_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 $ac_precious_vars; 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,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_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
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_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.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+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.11'
+
+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
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$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'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;;
+esac
+
+# 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".
+      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "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 $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+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='xcalc'
+ VERSION='1.0.3'
+
+
+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"}
+
+# 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 -'
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-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
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$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
+
+
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+
+
+
+
+
+
+
+
+
+
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-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
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+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
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5 ; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM 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.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5 ; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5 ; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5 ; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5 ; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+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
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+  $as_echo_n "(cached) " >&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
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$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
+
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if test "${ac_cv_prog_cc_c99+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+       {
+       case 's': // string
+         str = va_arg (args_copy, const char *);
+         break;
+       case 'd': // int
+         number = va_arg (args_copy, int);
+         break;
+       case 'f': // float
+         fnumber = va_arg (args_copy, double);
+         break;
+       default:
+         break;
+       }
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+         || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5 ; }
+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
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+fi
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${ac_cv_path_SED+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  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_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+
+
+
+
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast -Wformat=2"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default"
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then :
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+
+
+
+# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
+
+
+
+# Check whether --enable-strict-compilation was given.
+if test "${enable_strict_compilation+set}" = set; then :
+  enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval
+else
+  STRICT_COMPILE=no
+fi
+
+if test "x$STRICT_COMPILE" = "xyes"; then
+       ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default"
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then :
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+       ac_fn_c_check_decl "$LINENO" "__INTEL_COMPILER" "ac_cv_have_decl___INTEL_COMPILER" "$ac_includes_default"
+if test "x$ac_cv_have_decl___INTEL_COMPILER" = x""yes; then :
+  INTELCC="yes"
+else
+  INTELCC="no"
+fi
+
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+
+
+
+
+macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
+INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+XORG_MAN_PAGE="X Version 11"
+
+MAN_SUBSTS="\
+       -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xservername__|Xorg|g' \
+       -e 's|__xconfigfile__|xorg.conf|g' \
+       -e 's|__projectroot__|\$(prefix)|g' \
+       -e 's|__apploaddir__|\$(appdefaultdir)|g' \
+       -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
+       -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
+       -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
+       -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
+       -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
+       -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
+
+
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=0;;
+esac
+AM_BACKSLASH='\'
+
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+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
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5 ; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+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
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+  $as_echo_n "(cached) " >&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
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$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
+
+
+
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XCALC" >&5
+$as_echo_n "checking for XCALC... " >&6; }
+
+if test -n "$XCALC_CFLAGS"; then
+    pkg_cv_XCALC_CFLAGS="$XCALC_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xaw7 x11\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xaw7 x11") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XCALC_CFLAGS=`$PKG_CONFIG --cflags "xaw7 x11" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XCALC_LIBS"; then
+    pkg_cv_XCALC_LIBS="$XCALC_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xaw7 x11\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xaw7 x11") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XCALC_LIBS=`$PKG_CONFIG --libs "xaw7 x11" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+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
+               XCALC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xaw7 x11" 2>&1`
+        else
+               XCALC_PKG_ERRORS=`$PKG_CONFIG --print-errors "xaw7 x11" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XCALC_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (xaw7 x11) were not met:
+
+$XCALC_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 XCALC_CFLAGS
+and XCALC_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 XCALC_CFLAGS
+and XCALC_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5 ; }
+else
+       XCALC_CFLAGS=$pkg_cv_XCALC_CFLAGS
+       XCALC_LIBS=$pkg_cv_XCALC_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+XCALC_CFLAGS="$CWARNFLAGS $XCALC_CFLAGS"
+
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for APPDEFS" >&5
+$as_echo_n "checking for APPDEFS... " >&6; }
+
+if test -n "$APPDEFS_CFLAGS"; then
+    pkg_cv_APPDEFS_CFLAGS="$APPDEFS_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xt\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_APPDEFS_CFLAGS=`$PKG_CONFIG --cflags "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$APPDEFS_LIBS"; then
+    pkg_cv_APPDEFS_LIBS="$APPDEFS_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xt\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_APPDEFS_LIBS=`$PKG_CONFIG --libs "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+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
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xt" 2>&1`
+        else
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --print-errors "xt" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$APPDEFS_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (xt) were not met:
+
+$APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5 ; }
+else
+       APPDEFS_CFLAGS=$pkg_cv_APPDEFS_CFLAGS
+       APPDEFS_LIBS=$pkg_cv_APPDEFS_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+
+# Check whether --with-appdefaultdir was given.
+if test "${with_appdefaultdir+set}" = set; then :
+  withval=$with_appdefaultdir; appdefaultdir="$withval"
+else
+  appdefaultdir="${xt_appdefaultdir}"
+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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     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" &&
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $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}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by xcalc $as_me 1.0.3, which was
+generated by GNU Autoconf 2.67.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+xcalc config.status 1.0.3
+configured by $0, generated by GNU Autoconf 2.67,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+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=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  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 || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
+  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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries 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[        ]*=[    ]*/{
+h
+s///
+s/^/:/
+s/[     ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[  ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[      ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #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.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # 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.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5  ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$_am_arg" : 'X\(//\)[^/]' \| \
+        X"$_am_arg" : 'X\(//\)$' \| \
+        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_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=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# 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 || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/xcalc/configure.ac b/xcalc/configure.ac
new file mode 100644 (file)
index 0000000..3009c2d
--- /dev/null
@@ -0,0 +1,56 @@
+
+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(xcalc, [1.0.3],
+       [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xcalc)
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+          [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+XORG_DEFAULT_OPTIONS
+
+AM_CONFIG_HEADER(config.h)
+
+AC_PROG_CC
+AC_PROG_INSTALL
+
+
+PKG_CHECK_MODULES(XCALC, xaw7 x11)
+XCALC_CFLAGS="$CWARNFLAGS $XCALC_CFLAGS"
+AC_SUBST(XCALC_CFLAGS)
+AC_SUBST(XCALC_LIBS)
+
+PKG_CHECK_MODULES(APPDEFS, xt)
+xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+AC_ARG_WITH(appdefaultdir,
+       AC_HELP_STRING([--with-appdefaultdir=<pathname>],
+         [specify directory for app-defaults files (default is autodetected)]),
+       [appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"])
+AC_SUBST(appdefaultdir)
+
+
+AC_OUTPUT([Makefile])
diff --git a/xcalc/depcomp b/xcalc/depcomp
new file mode 100755 (executable)
index 0000000..df8eea7
--- /dev/null
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s,\\\\\\\\,/,g"
+   depmode=msvisualcpp
+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.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    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.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[     ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "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"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${
+              s/^ *//
+              s/ \\*$//
+              s/$/:/
+              p
+            }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # 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 mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $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 "X$1" != 'X--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 "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    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.
+    -arch)
+      eat=yes ;;
+    -*|$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 "X$1" != 'X--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.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::     \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # 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
+  ;;
+
+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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xcalc/install-sh b/xcalc/install-sh
new file mode 100755 (executable)
index 0000000..6781b98
--- /dev/null
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# 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.
+
+nl='
+'
+IFS=" ""       $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+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:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+       shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+       case $mode in
+         *' '* | *'    '* | *'
+'*       | *'*'* | *'?'* | *'['*)
+           echo "$0: invalid mode: $mode" >&2
+           exit 1;;
+       esac
+       shift;;
+
+    -o) chowncmd="$chownprog $2"
+       shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+       shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)        shift
+       break;;
+
+    -*)        echo "$0: invalid option: $1" >&2
+       exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # 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: $dst_arg: Is a directory" >&2
+       exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+       (dirname "$dst") 2>/dev/null ||
+       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+            X"$dst" : 'X\(//\)[^/]' \| \
+            X"$dst" : 'X\(//\)$' \| \
+            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+       echo X"$dst" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+       # Create intermediate dirs using mode 755 as modified by the umask.
+       # This is like FreeBSD 'install' as of 1997-10-28.
+       umask=`umask`
+       case $stripcmd.$umask in
+         # Optimize common cases.
+         *[2367][2367]) mkdir_umask=$umask;;
+         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+         *[0-7])
+           mkdir_umask=`expr $umask + 22 \
+             - $umask % 100 % 40 + $umask % 20 \
+             - $umask % 10 % 4 + $umask % 2
+           `;;
+         *) mkdir_umask=$umask,go-w;;
+       esac
+
+       # With -d, create the new directory with the user-specified mode.
+       # Otherwise, rely on $mkdir_umask.
+       if test -n "$dir_arg"; then
+         mkdir_mode=-m$mode
+       else
+         mkdir_mode=
+       fi
+
+       posix_mkdir=false
+       case $umask in
+         *[123567][0-7][0-7])
+           # POSIX mkdir -p sets u+wx bits regardless of umask, which
+           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+           ;;
+         *)
+           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+           if (umask $mkdir_umask &&
+               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+           then
+             if test -z "$dir_arg" || {
+                  # Check for POSIX incompatibilities with -m.
+                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                  # other-writeable bit of parent directory when it shouldn't.
+                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                  case $ls_ld_tmpdir in
+                    d????-?r-*) different_mode=700;;
+                    d????-?--*) different_mode=755;;
+                    *) false;;
+                  esac &&
+                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                  }
+                }
+             then posix_mkdir=:
+             fi
+             rmdir "$tmpdir/d" "$tmpdir"
+           else
+             # Remove any dirs left behind by ancient mkdir implementations.
+             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+           fi
+           trap '' 0;;
+       esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+       umask $mkdir_umask &&
+       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+       /*) prefix='/';;
+       -*) prefix='./';;
+       *)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+       test -z "$d" && continue
+
+       prefix=$prefix$d
+       if test -d "$prefix"; then
+         prefixes=
+       else
+         if $posix_mkdir; then
+           (umask=$mkdir_umask &&
+            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+           # Don't fail if two instances are running concurrently.
+           test -d "$prefix" || exit 1
+         else
+           case $prefix in
+             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+             *) qprefix=$prefix;;
+           esac
+           prefixes="$prefixes '$qprefix'"
+         fi
+       fi
+       prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+       # Don't fail if two instances are running concurrently.
+       (umask $mkdir_umask &&
+        eval "\$doit_exec \$mkdirprog $prefixes") ||
+         test -d "$dstdir" || exit 1
+       obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # 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
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"    2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+       # Now remove or move aside any old file at destination location.
+       # We try this two ways since rm can't unlink itself on some
+       # systems and the destination file might be busy for other
+       # reasons.  In this case, the final cleanup might fail but the new
+       # file should still install successfully.
+       {
+         test ! -f "$dst" ||
+         $doit $rmcmd -f "$dst" 2>/dev/null ||
+         { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+           { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+         } ||
+         { echo "$0: cannot unlink or rename $dst" >&2
+           (exit 1); exit 1
+         }
+       } &&
+
+       # Now rename the file to the real destination.
+       $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xcalc/math.c b/xcalc/math.c
new file mode 100644 (file)
index 0000000..9719492
--- /dev/null
@@ -0,0 +1,944 @@
+/* $XConsortium: math.c,v 1.17 91/07/25 17:51:34 rws Exp $
+ * $MIT: contrib/programs/xcalc/math.c,v 3.2 1999/12/14 18:53:00 gjcoram Exp$
+ * $XFree86: xc/programs/xcalc/math.c,v 1.5tsi Exp $ 
+ * $XdotOrg: xc/programs/xcalc/math.c,v 1.3 2004/05/23 20:03:49 alanc Exp $
+ *
+ *  math.c  -  mathematics functions for a hand calculator under X
+ *
+ *  Author:    John H. Bradley, University of Pennsylvania
+ *                (bradley@cis.upenn.edu)
+ *                     March, 1987
+ *
+ *  RPN mode added and port to X11 by Mark Rosenstein, MIT Project Athena
+ *
+ *  Modified to be a client of the Xt toolkit and the Athena widget set by
+ *  Donna Converse, MIT X Consortium.  This is all that remains of the 
+ *  original calculator, and it still needs to be rewritten.  The HP
+ *  functionality should be separated from the TI functionality. 
+ *  Beware the HP functions: there are still errors here.
+ *
+ *  Geoffrey Coram fixed most of the HP mode bugs.
+ */
+
+#include "xcalc.h"
+
+#ifdef _CRAY           /* kludge around Cray STDC compiler */
+double (*log_p)() = log;
+#define log ((*log_p))
+double (*exp_p)() = exp;
+#define exp ((*exp_p))
+double (*sqrt_p)() = sqrt;
+#define sqrt ((*sqrt_p))
+double (*log10_p)() = log10;
+#define log10 ((*log10_p))
+double (*atan2_p)() = atan2;
+#define atan2 ((*atan2_p))
+double (*asin_p)() = asin;
+#define asin ((*asin_p))
+double (*acos_p)() = acos;
+#define acos ((*acos_p))
+double (*atan_p)() = atan;
+#define atan ((*atan_p))
+double (*sin_p)() = sin;
+#define sin ((*sin_p))
+double (*cos_p)() = cos;
+#define cos ((*cos_p))
+double (*tan_p)() = tan;
+#define tan ((*tan_p))
+double (*pow_p)() = pow;
+#define pow ((*pow_p))
+#endif /* _CRAY */
+
+#ifndef PI             /* sometimes defined in math.h */
+#define PI          3.14159265358979
+#endif
+#define E           2.71828182845904
+#define MAXDISP     11
+#define DEG 0          /* DRG mode.  used for trig calculations */
+#define RAD 1
+#define GRAD 2
+#define min(a,b) ((a) < (b) ? (a) : (b))
+#define max(a,b) ((a) > (b) ? (a) : (b))
+#define True   1
+#define False   0
+
+#ifndef IEEE
+jmp_buf env;
+#endif
+
+/* This section is all of the state machine that implements the calculator
+ * functions.  Much of it is shared between the infix and rpn modes.
+ */
+
+static int flagINV, flagPAREN, flagM, drgmode; /* display flags */
+
+static double drg2rad=PI/180.0;  /* Conversion factors for trig funcs */
+static double rad2drg=180.0/PI;
+static int entered=1;  /* true if display contains a valid number.
+                          if==2, then use 'dnum', rather than the string
+                          stored in the display.  (for accuracy) 
+                          if==3, then error occurred, only CLR & AC work */
+/* entered seems to be overloaded - dmc */
+static int lift_enabled = 0;   /* for rpn mode only */
+
+static int CLR    =0;  /* CLR clears display.  if 1, clears acc, also */
+static int Dpoint=0;  /* to prevent using decimal pt twice in a # */
+static int clrdisp=1;  /* if true clears display before entering # */
+static int lastop =kCLR;
+static int memop  =kCLR;
+static int exponent=0;
+static double acc =0.0;
+static double dnum=0.0;
+#define XCALC_MEMORY 10
+static double mem[XCALC_MEMORY] = { 0.0 };
+
+static void   DrawDisplay(void);
+static void   PushOp(int op);
+static int    PopOp(void);
+static int    isopempty(void);
+#ifdef DEBUG
+static void   showstack(char *string);
+#endif
+static void   PushNum(double num);
+static double PopNum(void);
+static void   RollNum(int dir);
+static void   ClearStacks(void);
+static int    priority(int op);
+
+/*
+ * The following is to deal with the unfortunate assumption that if errno
+ * is non-zero then an error has occurred.  On some systems (e.g. Ultrix), 
+ * sscanf will call lower level routines that will set errno.
+ */
+
+static void
+parse_double (char *src, char *fmt, double *dp)
+{
+    int olderrno = errno;
+
+    (void) sscanf (src, fmt, dp);
+    errno = olderrno;
+    return;
+}
+
+
+/*********************************/
+int pre_op(int keynum)
+{
+    if (keynum==-1) return(0);
+    errno = 0;                 /* for non-IEEE machines */
+
+    if ( (entered==3) && !(keynum==kCLR || keynum==kOFF)) {
+      if (rpn) {
+       clrdisp++;
+      } else {
+        ringbell();
+        return(1);     /* the intent was probably not to do the operation */
+      }
+    }
+
+    if (keynum != kCLR) CLR=0;
+    return(0);
+}
+
+#ifndef IEEE
+
+/* cannot assign result of setjmp under ANSI C, use global instead */
+static volatile int SignalKind;
+
+void fail_op(void)
+{
+    if (SignalKind == SIGFPE)
+       strcpy(dispstr, "math error");
+    else if (SignalKind == SIGILL)
+       strcpy(dispstr, "illegal operand");
+
+    entered=3;
+    DrawDisplay();
+    return;
+}
+
+/*ARGSUSED*/
+signal_t fperr(int sig)
+{
+#if defined(SYSV) || defined(SVR4) || defined(linux)
+    signal(SIGFPE, fperr);
+#endif
+    SignalKind = sig;
+    longjmp(env,1);
+}
+
+/* for VAX BSD4.3 */
+/*ARGSUSED*/
+signal_t illerr(int sig)
+{
+    /* not reset when caught? */
+    signal(SIGILL, illerr);
+
+    SignalKind = sig;
+    longjmp(env,1);
+}
+
+#endif /* not IEEE */
+
+
+void post_op(void)
+{
+#ifdef DEBUG
+    showstack("\0");
+#endif
+#ifndef IEEE
+    if (errno) {
+        strcpy(dispstr,"error");
+        DrawDisplay();
+        entered=3;
+        errno=0;
+        }
+#endif
+}
+/*-------------------------------------------------------------------------*/
+static void
+DrawDisplay(void)
+{
+    if ((int) strlen(dispstr) > 12) {   /* strip out some decimal digits */
+        char tmp[32];
+        char *estr = index(dispstr,'e');  /* search for exponent part */
+        if (!estr) dispstr[12]='\0';      /* no exp, just trunc. */
+        else {
+            if ((int) strlen(estr) <= 4) 
+                sprintf(tmp,"%.8s",dispstr); /* leftmost 8 chars */
+            else
+                sprintf(tmp,"%.7s",dispstr); /* leftmost 7 chars */
+            strcat (tmp,estr);            /* plus exponent */
+            strcpy (dispstr,tmp);
+            }
+        }
+    draw(dispstr);
+    setflag(XCalc_MEMORY, (flagM));
+    setflag(XCalc_INVERSE, (flagINV));
+    setflag(XCalc_DEGREE, (drgmode==DEG));
+    setflag(XCalc_RADIAN, (drgmode==RAD));
+    setflag(XCalc_GRADAM, (drgmode==GRAD));
+    setflag(XCalc_PAREN, (flagPAREN));
+}
+
+/*-------------------------------------------------------------------------*/
+void
+numeric(int keynum)
+{
+    char       st[2];
+    int                cell = 0;
+
+  flagINV=0;
+
+  if (rpn && (memop == kSTO || memop == kRCL || memop == kSUM)) {
+      switch (keynum) {
+       case kONE:      cell = 1; break;
+       case kTWO:      cell = 2; break;
+       case kTHREE:    cell = 3; break;
+       case kFOUR:     cell = 4; break;
+       case kFIVE:     cell = 5; break;
+       case kSIX:      cell = 6; break;
+       case kSEVEN:    cell = 7; break;
+       case kEIGHT:    cell = 8; break;
+       case kNINE:     cell = 9; break;
+       case kZERO:     cell = 0; break;
+      }
+      switch (memop) {
+      case kSTO:
+       mem[cell] = dnum;
+       lift_enabled = 1;
+       entered = 2;
+       clrdisp++;
+       break;
+      case kRCL:
+       PushNum(dnum);
+       dnum = mem[cell];
+       sprintf(dispstr, "%.8g", dnum);
+       lift_enabled = 1;
+        entered = 1;
+       clrdisp++;
+       break;
+      case kSUM:
+       mem[cell] += dnum;
+       lift_enabled = 1;
+       entered = 2;
+       clrdisp++;
+       break;
+      }
+      memop = kCLR;
+      DrawDisplay();
+      return;
+  }
+
+  if (clrdisp) {
+    dispstr[0]='\0';
+    exponent=Dpoint=0;
+/*    if (rpn && entered==2)
+      PushNum(dnum);
+ */
+    if (rpn & lift_enabled)
+       PushNum(dnum);
+  }
+  if ((int) strlen(dispstr) >= MAXDISP)
+    return;
+    
+    switch (keynum){
+      case kONE:       st[0] = '1'; break;
+      case kTWO:       st[0] = '2'; break;
+      case kTHREE:     st[0] = '3'; break;
+      case kFOUR:      st[0] = '4'; break;
+      case kFIVE:      st[0] = '5'; break;
+      case kSIX:       st[0] = '6'; break;
+      case kSEVEN:     st[0] = '7'; break;
+      case kEIGHT:     st[0] = '8'; break;
+      case kNINE:      st[0] = '9'; break;
+      case kZERO:      st[0] = '0'; break;
+    }
+    st[1] = '\0';
+    strcat(dispstr,st);
+
+  DrawDisplay();
+  if (clrdisp && keynum != kZERO)
+    clrdisp=0; /*no leading 0s*/
+  memop = keynum;
+  entered=1;
+  lift_enabled = 0;
+}
+
+void
+bkspf(void)
+{
+
+  lift_enabled = 0;
+
+  if (! flagINV)
+  {
+      if (entered!=1) {
+         clearf();
+         return;
+      }
+      if (clrdisp)
+         return;
+      if ((int) strlen(dispstr) > 0) {
+#ifndef X_LOCALE
+          const char *dp = localeconv()->decimal_point;
+          size_t dp_len = strlen(dp);
+          size_t ds_len = strlen(dispstr);
+          if (ds_len >= dp_len && strcmp(dispstr + ds_len - dp_len, dp) == 0)
+             Dpoint=0;
+#else
+         if (dispstr[strlen(dispstr)-1] == '.')
+             Dpoint=0;
+#endif   
+         dispstr[strlen(dispstr)-1] = 0;
+      }
+      if (strlen(dispstr) == 0) {
+         strcat(dispstr, "0");
+         clrdisp++;
+      }
+  }
+  else
+  {
+      strcpy(dispstr, "0");
+      dnum = 0.0;
+      clrdisp++;
+      flagINV = 0;
+  }
+  DrawDisplay();
+}
+
+void
+decf(void)
+{
+  flagINV=0;
+  if (clrdisp) {
+      if (rpn && lift_enabled)
+       PushNum(dnum);
+      strcpy(dispstr,"0");
+  }
+  if (!Dpoint) {
+#ifndef X_LOCALE
+    strcat(dispstr, localeconv()->decimal_point);
+#else
+    strcat(dispstr, ".");
+#endif
+    DrawDisplay();
+    Dpoint++;
+  }
+  clrdisp=0;
+  entered=1;
+}
+
+void
+eef(void)
+{
+  flagINV=0;
+  if (clrdisp) {
+      if (rpn && lift_enabled)
+       PushNum(dnum);
+      strcpy(dispstr, rpn ? "1" : "0");
+  }
+  if (!exponent) {
+    strcat(dispstr,"E+");
+    DrawDisplay();
+    exponent=strlen(dispstr)-1;  /* where the '-' goes */
+  }
+  clrdisp=0;
+  entered=1;
+}
+
+void
+clearf(void)
+{
+  flagINV=0;
+  if (CLR && !rpn) { /* clear all */
+    ClearStacks();
+    flagPAREN=0;
+  }
+  CLR++;
+  exponent=Dpoint=0;
+  clrdisp=1;
+  entered=1;
+  strcpy(dispstr,"0");
+  DrawDisplay();
+}
+
+void
+negf(void)
+{
+  flagINV=0;
+  if (exponent) {       /* neg the exponent */
+    if (dispstr[exponent]=='-')
+      dispstr[exponent]='+';
+    else
+      dispstr[exponent]='-';
+    DrawDisplay();
+    return;
+  }
+
+  if (strcmp("0",dispstr)==0)
+    return;                    /* don't neg a zero */
+  if (dispstr[0]=='-')         /* already neg-ed */
+    strcpy(dispstr,dispstr+1);  /* move str left once */
+  else {                       /* not neg-ed.  add a '-' */
+    char tmp[32];
+    sprintf(tmp,"-%s",dispstr);
+    strcpy(dispstr,tmp);
+  }
+  if (entered==2)
+    dnum = -1.0 * dnum;
+  DrawDisplay();
+}
+
+/* Two operand functions for infix calc */
+void
+twoop(int keynum)
+{
+  if (flagINV) {
+    flagINV=0;
+    DrawDisplay();
+  }
+
+  if (!entered) {              /* something like "5+*" */
+    if (!isopempty())
+      (void) PopOp();                  /* replace the prev op */
+    PushOp(keynum);            /* with the new one */
+    return;
+  }
+  
+  if (entered==1)
+    parse_double(dispstr,"%lf",&dnum);
+
+  clrdisp=CLR=1;
+  entered=Dpoint=exponent=0;
+
+  if (!isopempty()) {  /* there was a previous op */
+    lastop=PopOp();   /* get it */
+
+    if (lastop==kLPAR) {  /* put it back */
+      PushOp(kLPAR);
+      PushOp(keynum);
+      PushNum(dnum);
+      return;
+    }
+
+    /* now, if the current op (keynum) is of
+       higher priority than the lastop, the current
+       op and number are just pushed on top 
+       Priorities:  (Y^X) > *,/ > +,- */
+    
+    if (priority(keynum) > priority(lastop)) {
+      PushNum(dnum);
+      PushOp(lastop);
+      PushOp(keynum);
+    } else {  /* execute lastop on lastnum and dnum, push
+              result and current op on stack */
+      acc=PopNum();
+      switch (lastop) { /* perform the operation */
+      case kADD: acc += dnum;  break;
+      case kSUB: acc -= dnum;  break;
+      case kMUL: acc *= dnum;  break;
+      case kDIV: acc /= dnum;  break;
+      case kPOW: acc =  pow(acc,dnum);  break;
+       }
+      PushNum(acc);
+      PushOp(keynum);
+      sprintf(dispstr,"%.8g",acc);
+      DrawDisplay();
+      dnum=acc;
+    }
+  }
+  else { /* op stack is empty, push op and num */
+    PushOp(keynum);
+    PushNum(dnum);
+  } 
+}                      
+
+/* Two operand functions for rpn calc */
+void
+twof(int keynum)
+{
+  if (flagINV) {
+    flagINV=0;
+    DrawDisplay();
+  }
+  if (!entered)
+    return;
+  if (entered==1)
+    parse_double(dispstr, "%lf", &dnum);
+  acc = PopNum();
+  switch(keynum) {
+  case kADD: acc += dnum;  break;
+  case kSUB: acc -= dnum;  break;
+  case kMUL: acc *= dnum;  break;
+  case kDIV: acc /= dnum;  break;
+  case kPOW: acc =  pow(acc,dnum);  break;
+  case kXXY: PushNum(dnum);
+  }
+  sprintf(dispstr, "%.8g", acc);
+  DrawDisplay();
+  clrdisp++;
+  Dpoint = exponent = 0;
+  entered = 2;
+  lift_enabled = 1;
+  dnum = acc;
+}
+
+void
+entrf(void)
+{
+  flagINV=0;
+  if (!entered)
+    return;
+
+  clrdisp=CLR=1;
+  Dpoint=exponent=0;
+
+  if (entered==1)
+    parse_double(dispstr,"%lf",&dnum);
+  entered=2;
+  memop = kENTR;
+  PushNum(dnum);
+  lift_enabled = 0;
+}
+
+void
+equf(void)
+{
+  flagINV=0;
+  if (!entered)
+    return;
+
+  clrdisp=CLR=1;
+  Dpoint=exponent=0;
+
+  if (entered==1)
+    parse_double(dispstr,"%lf",&dnum);
+  entered=2;
+
+  PushNum(dnum);
+
+  while (!isopempty()) {  /* do all pending ops */
+    dnum=PopNum();
+    acc=PopNum();
+    lastop=PopOp();
+    switch (lastop) {
+    case kADD:  acc += dnum;
+               break;
+    case kSUB:  acc -= dnum;
+               break;
+    case kMUL:  acc *= dnum;
+               break;
+    case kDIV:  acc /= dnum;
+               break;
+    case kPOW:  acc = pow(acc,dnum);
+               break;
+    case kLPAR:        flagPAREN--;
+               PushNum(acc);
+               break;
+    }
+    dnum=acc;
+    PushNum(dnum);
+  }
+
+  sprintf(dispstr,"%.8g",dnum);
+  DrawDisplay();
+}
+        
+void
+lparf(void)
+{
+  flagINV=0;
+  PushOp(kLPAR);
+  flagPAREN++;
+  DrawDisplay();
+}
+
+void
+rollf(void)
+{
+  if (!entered)
+    return;
+  if (entered==1)
+    parse_double(dispstr, "%lf", &dnum);
+  entered = 2;
+  lift_enabled = 1;
+  RollNum(flagINV);
+  flagINV=0;
+  clrdisp++;
+  sprintf(dispstr, "%.8g", dnum);
+  DrawDisplay();
+}
+
+void
+rparf(void)
+{
+  flagINV=0;
+  if (!entered)
+    return;
+
+  if (!flagPAREN)
+    return;
+  
+  clrdisp++;
+  Dpoint=exponent=0;
+
+  if (entered==1)
+    parse_double(dispstr,"%lf",&dnum);
+  entered=2;
+
+  PushNum(dnum);
+  while (!isopempty() && (lastop=PopOp())!=kLPAR) {
+    /* do all pending ops, back to left paren */
+    dnum=PopNum();
+    acc=PopNum();
+    switch (lastop) {
+    case kADD:  acc += dnum;
+               break;
+    case kSUB:  acc -= dnum;
+               break;
+    case kMUL:  acc *= dnum;
+               break;
+    case kDIV:  acc /= dnum;
+               break;
+    case kPOW:  acc = pow(acc,dnum);
+               break;
+    }
+    dnum=acc;
+    PushNum(dnum);
+  }
+  (void) PopNum();
+  flagPAREN--;
+  entered=2;
+  sprintf(dispstr,"%.8g",dnum);
+  DrawDisplay();
+}
+
+void
+drgf(void)
+{
+  if (flagINV) {
+    if (entered==1)
+      parse_double(dispstr,"%lf",&dnum);
+    switch (drgmode) {
+    case DEG:  dnum=dnum*PI/180.0;    break;
+    case RAD:  dnum=dnum*200.0/PI;    break;
+    case GRAD: dnum=dnum*90.0/100.0;  break;
+    }
+    entered=2;
+    clrdisp=1;
+    flagINV=0;
+    sprintf(dispstr,"%.8g",dnum);
+  }
+                         
+  flagINV=0;
+  drgmode = (drgmode + 1) % 3;
+  switch (drgmode) {
+  case DEG:  drg2rad=PI / 180.0;
+            rad2drg=180.0 / PI;
+            break;
+  case RAD:  drg2rad=1.0;
+            rad2drg=1.0;
+            break;
+  case GRAD: drg2rad=PI / 200.0;
+            rad2drg=200.0 / PI;
+            break;
+  }
+  DrawDisplay();
+}
+
+void
+invf(void)
+{
+  flagINV = ~flagINV;
+  DrawDisplay();
+}
+
+void
+memf(int keynum)
+{
+    memop = keynum;
+    if (entered==1)
+      parse_double(dispstr,"%lf",&dnum);
+    entered = 2;
+    clrdisp++;
+    lift_enabled = 0;
+}
+
+void
+oneop(int keynum)
+{
+  int i,j;
+  double dtmp;
+
+  if (entered==1)
+    parse_double(dispstr,"%lf",&dnum);
+  entered = 2;
+
+  switch (keynum) {  /* do the actual math fn. */
+  case kE:     if (rpn && memop != kENTR) PushNum(dnum); dnum=E;  break;
+  case kPI:    if (rpn && memop != kENTR) PushNum(dnum); dnum=PI;  break;
+  case kRECIP: dnum=1.0/dnum;  break;
+  case kSQR:   flagINV = !flagINV; /* fall through to */
+  case kSQRT:  if (flagINV) dnum=dnum*dnum;
+              else dnum=sqrt(dnum);
+              break;
+  case k10X:   flagINV = !flagINV; /* fall through to */
+  case kLOG:   if (flagINV) dnum=pow(10.0,dnum);
+              else dnum=log10(dnum);
+              break;
+  case kEXP:   flagINV = !flagINV; /* fall through to */
+  case kLN:    if (flagINV) dnum=exp(dnum);
+              else dnum=log(dnum);
+              break;
+  case kSIN:   if (flagINV) dnum=asin(dnum)*rad2drg;
+              else dnum=sin(dnum*drg2rad);
+              break;
+  case kCOS:   if (flagINV) dnum=acos(dnum)*rad2drg;
+              else dnum=cos(dnum*drg2rad);
+              break;
+  case kTAN:   if (flagINV) dnum=atan(dnum)*rad2drg;
+              else dnum=tan(dnum*drg2rad);
+              break;
+  case kSTO:   mem[0]=dnum;  flagM=!(mem[0]==0.0);  break;
+  case kRCL:   if (rpn && lift_enabled) PushNum(dnum);
+               dnum=mem[0];  flagM=!(mem[0]==0.0);  break;
+  case kSUM:   mem[0]+=dnum; flagM=!(mem[0]==0.0);  break;
+  case kEXC:   dtmp=dnum; dnum=mem[0];  mem[0]=dtmp;
+              flagM=!(mem[0]==0.0);  break;
+  case kFACT:  if (floor(dnum)!=dnum || dnum<0.0 || dnum>500.0) {
+                strcpy(dispstr,"error");
+                entered=3;
+                break;
+              }
+              dtmp = floor(dnum); i = dtmp;
+              for (j=1,dnum=1.0; j<=i; j++) 
+                dnum*=(float) j;
+              break;
+  }
+  
+  if (entered==3) {  /* error */
+    DrawDisplay();
+    return;
+  }
+
+  memop = keynum;
+  entered=2;
+  clrdisp=1;
+  flagINV=0;
+  lift_enabled = 1;
+  sprintf(dispstr,"%.8g",dnum);
+  DrawDisplay();
+}
+
+void
+offf(void)
+{
+  /* full reset */
+  int i;
+  ResetCalc();
+  entered=clrdisp=1;
+  lift_enabled = 0;
+  dnum=mem[0]=0.0;
+  if (rpn)
+      for (i=1; i < XCALC_MEMORY; i++)
+         mem[i]=0.0;
+  exponent=Dpoint=0;
+  DrawDisplay();
+}
+
+
+#define STACKMAX 32
+static int opstack[STACKMAX];
+static int opsp;
+static double numstack[STACKMAX];
+static int numsp;
+
+
+/*******/
+static void
+PushOp(int op)
+/*******/
+{
+  if (opsp==STACKMAX) {strcpy(dispstr,"stack error");  entered=3;}
+  else opstack[opsp++]=op;
+}
+
+/*******/
+static int
+PopOp(void)
+/*******/
+{
+  if (opsp==0) {
+      strcpy(dispstr,"stack error");
+      entered=3;
+      return(kNOP);
+  } else
+    return(opstack[--opsp]);
+}
+
+/*******/
+static int
+isopempty(void)
+/*******/
+{
+  return( opsp ? 0 : 1 );
+}
+
+#ifdef DEBUG
+static void
+showstack(char *string)
+{
+    fprintf(stderr, "%s: %lf %lf %lf\n", string, numstack[0], numstack[1],
+           numstack[2]);
+}
+#endif
+
+/*******/
+static void
+PushNum(double num)
+/*******/
+{
+  if (rpn) {
+      numstack[2] = numstack[1];
+      numstack[1] = numstack[0];
+      numstack[0] = num;
+      return;
+  }
+  if (numsp==STACKMAX) {
+      strcpy(dispstr,"stack error");
+      entered=3;
+  } else
+    numstack[numsp++]=num;
+}
+
+/*******/
+static double
+PopNum(void)
+/*******/
+{
+    if (rpn) {
+       double tmp = numstack[0];
+       numstack[0] = numstack[1];
+       numstack[1] = numstack[2];
+       return(tmp);
+    }
+    if (numsp==0) {
+       strcpy(dispstr,"stack error");
+       entered=3;
+       return 0.0;
+    } else
+      return(numstack[--numsp]);
+}
+
+/*******/
+static void
+RollNum(int dir)
+/*******/
+{
+    double tmp;
+
+    if (dir) {                         /* roll up */
+       tmp         = dnum;
+       dnum        = numstack[2];
+       numstack[2] = numstack[1];
+       numstack[1] = numstack[0];
+       numstack[0] = tmp;
+    } else {                           /* roll down */
+       tmp         = dnum;
+       dnum        = numstack[0];
+       numstack[0] = numstack[1];
+       numstack[1] = numstack[2];
+       numstack[2] = tmp;
+    }
+}
+
+
+/*******/
+static void
+ClearStacks(void)
+/*******/
+{
+    if (rpn)
+      numstack[0] = numstack[1] = numstack[2] = 0.;
+    opsp=numsp=0;
+}
+
+
+/*******/
+static int
+priority(int op)
+/*******/
+{
+    switch (op) {
+        case kPOW: return(2);
+        case kMUL:
+        case kDIV: return(1);
+        case kADD:
+        case kSUB: return(0);
+        }
+    return 0;
+}
+
+
+/********/
+void
+ResetCalc(void)
+/********/
+{
+    flagM=flagINV=flagPAREN=0;  drgmode=DEG;
+    setflag(XCalc_MEMORY, False);
+    setflag(XCalc_INVERSE, False);
+    setflag(XCalc_PAREN, False);
+    setflag(XCalc_RADIAN, False);
+    setflag(XCalc_GRADAM, False);
+    setflag(XCalc_DEGREE, True);
+    strcpy(dispstr,"0");
+    draw(dispstr);
+    ClearStacks();
+    drg2rad=PI/180.0;
+    rad2drg=180.0/PI;
+}
diff --git a/xcalc/missing b/xcalc/missing
new file mode 100755 (executable)
index 0000000..28055d2
--- /dev/null
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# 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=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+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'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  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]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
+# 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).  This is about non-GNU programs, so use $1 not
+# $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 $program 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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if test ! -f y.tab.h; then
+       echo >y.tab.h
+    fi
+    if test ! -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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if test ! -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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit $?
+    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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+       /^@setfilename/{
+         s/.* \([^ ]*\) *$/\1/
+         p
+         q
+       }' $infile`
+      # ... 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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xcalc/xcalc.c b/xcalc/xcalc.c
new file mode 100644 (file)
index 0000000..0796448
--- /dev/null
@@ -0,0 +1,373 @@
+/* $XConsortium: xcalc.c,v 1.16 94/04/17 20:43:31 converse Exp $ */
+/*
+
+Copyright (c) 1989  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86$ */
+
+/*
+ * xcalc.c  -  a hand calculator for the X Window system
+ *
+ *  Original Author:  John H. Bradley, University of Pennsylvania
+ *                     (bradley@cis.upenn.edu)  March, 1987
+ *  RPN mode added and port to X11 by Mark Rosenstein, MIT Project Athena
+ *  Rewritten to be an Xaw and Xt client by Donna Converse, MIT X Consortium
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <signal.h>
+#include <X11/Xatom.h>
+#include <X11/Shell.h>
+#include <X11/Xaw/Cardinals.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Toggle.h>
+#include <X11/cursorfont.h>
+#include "xcalc.h"
+
+static Boolean convert(Widget w, Atom *selection, Atom *target, Atom *type,
+                      XtPointer *value, unsigned long *length, int *format);
+static void create_keypad(Widget parent);
+static void create_display(Widget parent);
+static void create_calculator(Widget shell);
+static void done(Widget w, Atom *selection, Atom *target);
+static void lose(Widget w, Atom *selection);
+static void Syntax(int argc, char **argv);
+
+/*
+ *     global data
+ */
+int    rpn = 0;                /* Reverse Polish Notation (HP mode) flag */
+char   dispstr[LCD_STR_LEN];           /* string to show up in the LCD */
+Atom   wm_delete_window;               /* see ICCCM section 5.2.2 */
+
+/*
+ *     local data 
+ */
+static Display *dpy = NULL;            /* connection to the X server */
+static Widget  toplevel=NULL;          /* top level shell widget */
+static Widget   calculator=NULL;       /* an underlying form widget */
+static Widget  LCD = NULL;             /* liquid crystal display */
+static Widget  ind[6];                 /* mode indicators in the screen */
+static char    selstr[LCD_STR_LEN]; /* storage for selections from the LCD */
+                                       /* checkerboard used in mono mode */
+static XtAppContext xtcontext;         /* Toolkit application context */
+#define check_width 16
+#define check_height 16
+static unsigned char check_bits[] = {
+   0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,
+   0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,
+   0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa};
+
+/*     command line options specific to the application */
+static XrmOptionDescRec Options[] = {
+{"-rpn",       "rpn",          XrmoptionNoArg,         (XtPointer)"on"},
+{"-stipple",   "stipple",      XrmoptionNoArg,         (XtPointer)"on"}
+};
+
+/*     resources specific to the application */
+static struct resources {
+    Boolean    rpn;            /* reverse polish notation (HP mode) */
+    Boolean    stipple;        /* background stipple */
+    Cursor     cursor;
+} appResources;
+
+#define offset(field) XtOffsetOf(struct resources, field)
+static XtResource Resources[] = {
+{"rpn",                "Rpn",          XtRBoolean,     sizeof(Boolean),
+     offset(rpn),      XtRImmediate,   (XtPointer) False},
+{"stipple",    "Stipple",      XtRBoolean,     sizeof(Boolean),
+     offset(stipple),  XtRImmediate,   (XtPointer) False},
+{"cursor",     "Cursor",       XtRCursor,      sizeof(Cursor),
+     offset(cursor),   XtRCursor,      (XtPointer)NULL}
+};
+#undef offset
+
+
+int
+main(int argc, char **argv)
+{
+    Arg                args[3];
+
+    XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
+
+    toplevel = XtAppInitialize(&xtcontext, "XCalc", Options, XtNumber(Options),
+                              &argc, argv, NULL, NULL, 0);
+    if (argc != 1) Syntax(argc, argv);
+    
+    XtSetArg(args[0], XtNinput, True);
+    XtSetValues(toplevel, args, ONE);
+
+    XtGetApplicationResources(toplevel, (XtPointer)&appResources, Resources,
+                             XtNumber(Resources), (ArgList) NULL, ZERO);
+
+    create_calculator(toplevel);
+
+    XtAppAddActions(xtcontext, Actions, ActionsCount);
+
+    XtOverrideTranslations(toplevel, 
+          XtParseTranslationTable("<Message>WM_PROTOCOLS: quit()\n"));
+
+    XtRealizeWidget(toplevel);
+
+    dpy = XtDisplay(toplevel);
+    wm_delete_window = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
+    (void) XSetWMProtocols(dpy, XtWindow(toplevel), &wm_delete_window, 1);
+    XDefineCursor(dpy, XtWindow(toplevel), appResources.cursor);
+
+    if (appResources.stipple || (CellsOfScreen(XtScreen(toplevel)) <= 2))
+    {
+       Screen  *screen = XtScreen(toplevel);
+       Pixmap  backgroundPix;
+
+       backgroundPix = XCreatePixmapFromBitmapData
+           (dpy, XtWindow(toplevel),
+            (char *)check_bits, check_width, check_height,
+            WhitePixelOfScreen(screen), BlackPixelOfScreen(screen),
+            DefaultDepthOfScreen(screen));
+       XtSetArg(args[0], XtNbackgroundPixmap, backgroundPix);
+       XtSetValues(calculator, args, ONE);
+    }
+
+#ifndef IEEE
+    signal(SIGFPE,fperr);
+    signal(SIGILL,illerr);
+#endif
+    ResetCalc();
+    XtAppMainLoop(xtcontext);
+
+    return 0;
+}
+
+static void create_calculator(Widget shell)
+{
+    rpn = appResources.rpn;
+    calculator = XtCreateManagedWidget(rpn ? "hp" : "ti", formWidgetClass,
+                                      shell, (ArgList) NULL, ZERO);
+    create_display(calculator);
+    create_keypad(calculator);
+    XtSetKeyboardFocus(calculator, LCD);
+}
+
+/*
+ *     Do the calculator data display widgets.
+ */
+static void create_display(Widget parent)
+{
+    Widget     bevel, screen;
+    static Arg args[] = {
+       {XtNborderWidth, (XtArgVal)0},
+       {XtNjustify, (XtArgVal)XtJustifyRight}
+    };
+
+    /* the frame surrounding the calculator display */
+    bevel = XtCreateManagedWidget("bevel", formWidgetClass, parent,
+                                 (ArgList) NULL, ZERO);
+
+    /* the screen of the calculator */
+    screen = XtCreateManagedWidget("screen", formWidgetClass, bevel,
+                                  (ArgList) NULL, ZERO);
+
+    /* M - the memory indicator */
+    ind[XCalc_MEMORY] = XtCreateManagedWidget("M", labelWidgetClass, screen,
+                                       args, XtNumber(args));
+
+    /* liquid crystal display */
+    LCD = XtCreateManagedWidget("LCD", toggleWidgetClass, screen, args,
+                               XtNumber(args));
+
+    /* INV - the inverse function indicator */
+    ind[XCalc_INVERSE] = XtCreateManagedWidget("INV", labelWidgetClass, 
+                                        screen, args, XtNumber(args));
+
+    /* DEG - the degrees switch indicator */
+    ind[XCalc_DEGREE] = XtCreateManagedWidget("DEG", labelWidgetClass, screen,
+                                       args, XtNumber(args));
+
+    /* RAD - the radian switch indicator */
+    ind[XCalc_RADIAN] = XtCreateManagedWidget("RAD", labelWidgetClass, screen,
+                                       args, XtNumber(args));
+
+    /* GRAD - the grad switch indicator */
+    ind[XCalc_GRADAM] = XtCreateManagedWidget("GRAD", labelWidgetClass, screen,
+                                       args, XtNumber(args));
+
+    /* () - the parenthesis indicator */
+    ind[XCalc_PAREN] = XtCreateManagedWidget("P", labelWidgetClass, screen,
+                                            args, XtNumber(args));
+}
+
+/*
+ *     Do all the buttons.  The application defaults file will give the
+ *     default button placement, default button labels, and default 
+ *      actions connected to the buttons.  The user can change any of 
+ *      these defaults in an environment-specific resource file.
+ */
+
+static void create_keypad(Widget parent)
+{
+    static char        *Keyboard[] = {
+       "button1", "button2", "button3", "button4", "button5",
+       "button6", "button7", "button8", "button9", "button10",
+       "button11","button12","button13","button14","button15",
+       "button16","button17","button18","button19","button20",
+       "button21","button22","button23","button24","button25",
+       "button26","button27","button28","button29","button30",
+       "button31","button32","button33","button34","button35",
+       "button36","button37","button38","button39","button40"
+       };
+    register int i;
+    int                 n = XtNumber(Keyboard);
+
+    if (appResources.rpn) n--;         /* HP has 39 buttons, TI has 40 */
+
+    for (i=0; i < n; i++)
+       XtCreateManagedWidget(Keyboard[i], commandWidgetClass, parent,
+                             (ArgList) NULL, ZERO);
+}
+
+/*
+ *     Miscellaneous utility routines that interact with the widgets.
+ */
+
+/*
+ *     called by math routines to write to the liquid crystal display.
+ */
+void draw(char *string)
+{
+    Arg        args[1];
+
+    XtSetArg(args[0], XtNlabel, string);
+    XtSetValues(LCD, args, ONE);
+}
+/*
+ *     called by math routines to turn on and off the display indicators.
+ */
+void setflag(int indicator, Boolean on)
+{
+    if (on) XtMapWidget(ind[indicator]);
+    else XtUnmapWidget(ind[indicator]);
+}
+
+/*
+ *     ring the bell.
+ */
+void ringbell(void)
+{
+    XBell(dpy, 0);
+}
+
+/*
+ *     die.
+ */
+void Quit(void)
+{
+    XtDestroyApplicationContext(xtcontext);
+    exit(0);
+}
+
+/*  
+ *     recite and die.
+ */
+static void Syntax(int argc, char **argv)
+{
+    register int i;
+
+    (void) fprintf(stderr, "%s: unknown options:", argv[0]);
+    for (i=1; i <argc; i++)
+       (void) fprintf(stderr, " %s", argv[i]);
+    (void) fprintf(stderr, "\n\n");
+    (void) fprintf(stderr, "Usage:  %s", argv[0]);
+    for (i=0; i < XtNumber(Options); i++)
+       (void) fprintf(stderr, " [%s]", Options[i].option);
+    (void) fprintf(stderr, "\n");
+    XtDestroyApplicationContext(xtcontext);
+    exit(1);
+}
+
+/*    
+ * I use actions on the toggle widget to support selections.  This
+ * means that the user may not do a partial selection of the number
+ * displayed in the `liquid crystal display.'  Copying numbers into
+ * the calculator is also not supported.  So all you can do is copy
+ * the entire number from the calculator display.
+ */
+
+/*ARGSUSED*/
+static Boolean convert(Widget w, Atom *selection, Atom *target, Atom *type,
+                      XtPointer *value, unsigned long *length, int *format)
+{
+    if (*target == XA_STRING)
+    {
+       *type = XA_STRING;
+       *length = strlen(dispstr);
+       strncpy(selstr, dispstr, (int)(*length));
+       *value = selstr;
+       *format = 8;
+       return True;
+    }
+    return False;
+}
+
+/*
+ * called when xcalc loses ownership of the selection.
+ */
+/*ARGSUSED*/
+static void lose(Widget w, Atom *selection)
+{
+    XawToggleUnsetCurrent(LCD);
+}
+
+/*
+ * called when some other client got the selection.
+ */
+/*ARGSUSED*/
+static void done(Widget w, Atom *selection, Atom *target)
+{
+    selstr[0] = '\0';
+}
+
+/*
+ * called by the selection() action routine, in response to user action.
+ */
+void do_select(Time time)
+{
+    Boolean    state;
+    Arg                args[1];
+
+    XtSetArg(args[0], XtNstate, &state);
+    XtGetValues(LCD, args, 1);
+
+    if (state)
+        XtOwnSelection(LCD, XA_PRIMARY, time, convert, lose, done);
+    else
+       selstr[0] = '\0';
+}
diff --git a/xcalc/xcalc.h b/xcalc/xcalc.h
new file mode 100644 (file)
index 0000000..5020bfe
--- /dev/null
@@ -0,0 +1,165 @@
+/* $XConsortium: xcalc.h,v 1.4 94/04/17 20:43:32 converse Exp $ */
+/*
+
+Copyright (c) 1989  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86$ */
+
+/*
+ * xcalc.h - symbolic constants for xcalc
+ *
+ * Author:  Donna Converse, MIT X Consortium
+ */
+
+#ifndef _XCALC_H_
+#define _XCALC_H_
+
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+
+#include <stdio.h>
+#include <X11/Xos.h>
+#include <math.h>
+#include <signal.h>
+#if !defined(IEEE) && defined(SVR4)
+#include <siginfo.h>
+#endif
+#include <setjmp.h>
+#include <errno.h>
+#include <X11/Xlocale.h>
+
+
+#ifdef SIGNALRETURNSINT
+#define signal_t int
+#else
+#define signal_t void
+#endif
+
+#define kRECIP 0       /* reciprocal */
+#define kSQR   1       /* square */
+#define kSQRT  2       /* square root */
+#define kCLR   3       /* clear */
+#define kOFF   4       /* clear and quit */
+#define kINV   5       /* inverse */
+#define kSIN   6       /* sine */
+#define kCOS   7       /* cosine */
+#define kTAN   8       /* tangent */
+#define kDRG   9       /* degree radian grad */
+#define kE     10      /* the natural number e */
+#define kEE    11      /* scientific notation */
+#define kLOG   12      /* logarithm */
+#define kLN    13      /* natural logarithm */
+#define kPOW   14      /* power */
+#define kPI    15      /* pi */
+#define kFACT  16      /* factorial */
+#define kLPAR  17      /* left paren */
+#define kRPAR  18      /* right paren */
+#define kDIV   19      /* division */
+#define kSTO   20      /* store */
+#define kSEVEN 21      /* 7 */
+#define kEIGHT 22      /* 8 */
+#define kNINE  23      /* 9 */
+#define kMUL   24      /* multiplication */
+#define kRCL   25      /* recall */
+#define kFOUR  26      /* 4 */
+#define kFIVE  27      /* 5 */
+#define kSIX   28      /* 6 */
+#define kSUB   29      /* subtraction */
+#define kSUM   30      /* summation */
+#define kONE   31      /* 1 */
+#define kTWO   32      /* 2 */
+#define kTHREE 33      /* 3 */
+#define kADD   34      /* addition */
+#define kEXC   35      /* exchange display and memory */
+#define kZERO  36      /* 0 */
+#define kDEC   37      /* decimal point */
+#define kNEG   38      /* negation */
+#define kEQU   39      /* equals */
+#define kENTR  40      /* enter */
+#define kXXY   41      /* exchange X and Y registers */
+#define kEXP   42      /* exponent */
+#define k10X   43      /* 10 raised to a power */
+#define kROLL  44      /* roll stack */
+#define kNOP   45      /* no operation */
+#define kBKSP  46      /* backspace */
+
+#define XCalc_MEMORY   0       /* memory indicator */
+#define XCalc_INVERSE   1      /* inverse function indicator */
+#define XCalc_DEGREE   2       /* degree indicator */
+#define XCalc_RADIAN   3       /* radian indicator */
+#define XCalc_GRADAM   4       /* grad indicator */
+#define XCalc_PAREN    5       /* parenthesis indicator */
+
+/* actions.c */
+extern XtActionsRec Actions[];
+extern int ActionsCount;
+
+/* math.c */
+extern signal_t fperr(int sig);
+extern signal_t illerr(int sig);
+extern void fail_op(void);
+extern int pre_op(int keynum);
+extern void post_op(void);
+
+extern void numeric(int keynum);
+extern void bkspf(void);
+extern void decf(void);
+extern void eef(void);
+extern void clearf(void);
+extern void negf(void);
+extern void twoop(int keynum);
+extern void twof(int keynum);
+extern void entrf(void);
+extern void equf(void);
+extern void lparf(void);
+extern void rollf(void);
+extern void rparf(void);
+extern void drgf(void);
+extern void invf(void);
+extern void memf(int keynum);
+extern void oneop(int keynum);
+extern void offf(void);
+extern void ResetCalc(void);
+
+#ifndef IEEE
+extern jmp_buf env;
+#endif
+
+/* xcalc.c */
+extern void do_select(Time time);
+extern void draw(char *string);
+extern void Quit(void);
+extern void ringbell(void);
+extern void setflag(int indicator, Boolean on);
+
+extern int rpn;
+#define LCD_STR_LEN    32
+extern char dispstr[LCD_STR_LEN];
+extern Atom wm_delete_window;
+
+#endif
diff --git a/xcalc/xcalc.man b/xcalc/xcalc.man
new file mode 100644 (file)
index 0000000..14d856e
--- /dev/null
@@ -0,0 +1,440 @@
+.\" $XConsortium: xcalc.man,v 1.10 94/04/17 20:43:32 matt Exp $
+.\" $XdotOrg: $
+.\" 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 CONNECTION 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 dealings in this Software without prior written authorization
+.\" from the X Consortium.
+.\"
+.\" $XFree86: xc/programs/xcalc/xcalc.man,v 1.4 2002/10/12 16:06:46 herrb 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
+..
+.TH XCALC 1 __xorgversion__
+.SH NAME
+xcalc \- scientific calculator for X
+.SH SYNOPSIS
+.B xcalc
+[-stipple] [-rpn] [-\fItoolkitoption...\fP]
+.SH DESCRIPTION
+.I xcalc
+is a scientific calculator desktop accessory that can emulate a TI-30
+or an HP-10C.
+.SH OPTIONS
+.PP
+\fIxcalc\fP accepts all of the standard toolkit command line options along
+with two additional options:
+.PP
+.TP 8
+.B \-stipple
+This option indicates that the background of the calculator should be 
+drawn using a stipple of the foreground and background colors.  On monochrome
+displays improves the appearance.
+.PP
+.TP 8
+.B \-rpn
+This option indicates that Reverse Polish Notation should be used.  In this
+mode the calculator will look and behave like an HP-10C.  Without this flag,
+it will emulate a TI-30.
+.SH OPERATION
+.PP
+.I Pointer Usage:
+Operations may be performed with pointer button 1, or in some cases,
+with the keyboard.  
+Many common calculator operations have keyboard accelerators.
+To quit, press pointer button 3 on the AC key of the TI calculator, 
+or the ON key of the HP calculator.
+.PP
+.I Calculator Key Usage (TI mode):
+The numbered keys, the +/- key, and the +, -, *, /, and = keys all do exactly 
+what you would expect them to.  It should be noted that the operators obey
+the standard rules of precedence.  Thus, entering "3+4*5=" results in "23",
+not "35".  The parentheses can be used to override this.  For example, 
+"(1+2+3)*(4+5+6)=" results in "6*15=90".  
+.PP
+The entire number in the calculator display can be selected, in order to
+paste the result of a calculation into text.
+.PP
+The action procedures associated with each function are given below.  These
+are useful if you are interested in defining a custom calculator.
+The action used for all digit keys is \fBdigit(\fIn\fP)\fR, where \fIn\fR
+is the corresponding digit, 0..9.
+.TP 10
+.B 1/x
+Replaces the number in the display with its reciprocal.
+The corresponding action procedure is \fBreciprocal()\fR.
+.TP 10
+.B x^2
+Squares the number in the display.
+The corresponding action procedure is \fBsquare()\fR.
+.TP 10
+.B SQRT
+Takes the square root of the number in the display.
+The corresponding action procedure is \fBsquareRoot()\fR.
+.TP 10
+.B CE/C
+When pressed once, clears the number in the display without clearing the state
+of the machine.  Allows you to re-enter a number if you make a mistake.
+Pressing it twice clears the state, also.
+The corresponding action procedure for TI mode is \fBclear()\fR.
+.TP 10
+.B AC
+Clears the display, the state, and the memory.  Pressing it with the third
+pointer button turns off the calculator, in that it exits the program.
+The action procedure to clear the state is \fBoff()\fR; to quit, \fBquit()\fR.
+.TP 10
+.B INV
+Invert function.  See the individual function keys for details.
+The corresponding action procedure is \fBinverse()\fR.
+.TP 10
+.B sin
+Computes the sine of the number in the display, as interpreted by the current
+DRG mode (see DRG, below).  If inverted, it computes the arcsine.
+The corresponding action procedure is \fBsine()\fR.
+.TP 10
+.B cos
+Computes the cosine, or arccosine when inverted.
+The corresponding action procedure is \fBcosine()\fP.
+.TP 10
+.B tan
+Computes the tangent, or arctangent when inverted.
+The corresponding action procedure is \fBtangent()\fP.
+.TP 10
+.B DRG
+Changes the DRG mode, as indicated by 'DEG', 'RAD', or 'GRAD' at the bottom of
+of the calculator ``liquid crystal'' display.
+When in 'DEG' mode, numbers in the display are taken as being
+degrees.  In 'RAD' mode, numbers are in radians, and in 'GRAD' mode, numbers
+are in grads.  When inverted, the DRG key has a feature of 
+converting degrees to radians to grads and vice-versa.  Example:  put the 
+calculator into 'DEG' mode, and enter "45 INV DRG".  The display should now
+show something along the lines of ".785398", which is 45 degrees converted to
+radians.
+The corresponding action procedure is \fBdegree()\fP.
+.TP 10
+.B e
+The constant 'e'.  (2.7182818...).
+The corresponding action procedure is \fBe()\fR.
+.TP 10
+.B EE
+Used for entering exponential numbers.  For example, to get "-2.3E-4" you'd
+enter "2 . 3 +/- EE 4 +/-".
+The corresponding action procedure is \fBscientific()\fR.
+.TP 10
+.B log
+Calculates the log (base 10) of the number in the display.  When inverted,
+it raises "10.0" to the number in the display.
+For example, entering "3 INV log" should result in "1000".
+The corresponding action procedure is \fBlogarithm()\fP.
+.TP 10
+.B ln
+Calculates the log (base e) of the number in the display.  When inverted, 
+it raises "e" to the number in the display.  For example, entering "e ln"
+should result in "1".
+The corresponding action procedure is \fBnaturalLog()\fR.
+.TP 10
+.B y^x
+Raises the number on the left to the power of the number on the right.  For 
+example "2 y^x 3 =" results in "8", which is 2^3.  For a further example,
+"(1+2+3) y^x (1+2) =" equals "6 y^x 3" which equals "216".
+The corresponding action procedure is \fBpower()\fR.
+.TP 10
+.B PI
+The constant 'pi'.  (3.1415927....)
+The corresponding action procedure is \fBpi()\fR.
+.TP 10
+.B x!
+Computes the factorial of the number in the display.  The number in the display
+must be an integer in the range 0-500, though, depending on your math library,
+it might overflow long before that.
+The corresponding action procedure is \fBfactorial()\fR.
+.TP 10
+.B (
+Left parenthesis.  The corresponding action procedure for TI calculators
+is \fBleftParen()\fR.
+.TP 10
+.B )
+Right parenthesis.  The corresponding action procedure for TI calculators
+is \fBrightParen()\fR.
+.TP 10
+.B /
+Division.  The corresponding action procedure is \fBdivide()\fR.
+.TP 10
+.B *
+Multiplication.  The corresponding action procedure is \fBmultiply()\fR.
+.TP 10
+.B -
+Subtraction.  The corresponding action procedure is \fBsubtract()\fR.
+.TP 10
+.B +
+Addition.  The corresponding action procedure is \fBadd()\fR.
+.TP 10
+.B =
+Perform calculation.  The TI-specific action procedure is \fBequal()\fR.
+.TP 10
+.B STO
+Copies the number in the display to the memory location.
+The corresponding action procedure is \fBstore()\fR.
+.TP 10
+.B RCL
+Copies the number from the memory location to the display.
+The corresponding action procedure is \fBrecall()\fR.
+.TP 10
+.B SUM
+Adds the number in the display to the number in the memory location.
+The corresponding action procedure is \fBsum()\fR.
+.TP 10
+.B EXC
+Swaps the number in the display with the number in the memory location.
+The corresponding action procedure for the TI calculator is \fBexchange()\fR.
+.TP 10
+.B +/-
+Negate; change sign.  The corresponding action procedure is \fBnegate()\fR.
+.TP 10
+.B .
+Decimal point.  The action procedure is \fBdecimal()\fP.
+.sp
+.PP
+.I Calculator Key Usage (RPN mode):
+The number keys, CHS (change sign), +, -, *, /, and ENTR keys all do exactly 
+what you would expect them to do.  Many of the remaining keys are the same as
+in TI mode.  The differences are detailed below.  The action procedure
+for the ENTR key is \fBenter()\fR.
+.sp
+.TP 10
+.B <-
+This is a backspace key that can be used if you make a mistake while entering
+a number.  It will erase digits from the display.  (See BUGS).
+Inverse backspace will clear the X register.
+The corresponding action procedure is \fBback()\fR.
+.TP 10
+.B ON
+Clears the display, the state, and the memory.  Pressing it with the third
+pointer button turns off the calculator, in that it exits the program.
+To clear state, the action procedure is \fBoff\fR; to quit, \fBquit()\fR.
+.TP 10
+.B INV
+Inverts the meaning of the function keys.  This would be the  \fIf\fR key
+on an HP calculator, but \fIxcalc\fR does not display
+multiple legends on each key.  See the individual function keys for details.
+.TP 10
+.B 10^x
+Raises "10.0" to the number in the top of the stack.  
+When inverted, it calculates the log (base 10) of the number in the display.
+The corresponding action procedure is \fBtenpower()\fR.
+.TP 10
+.B e^x
+Raises "e" to the number in the top of the stack.  
+When inverted, it calculates the log (base e) of the number in the display.
+The action procedure is \fBepower()\fR.
+.TP 10
+.B STO
+Copies the number in the top of the stack to a memory location.  There are 10
+memory locations.  The desired memory is specified by following this
+key with a digit key.
+.TP 10
+.B RCL
+Pushes the number from the specified memory location onto the stack.
+.TP 10
+.B SUM
+Adds the number on top of the stack to the number in the specified
+memory location.
+.TP 10
+.B x:y
+Exchanges the numbers in the top two stack positions, the X and Y registers.
+The corresponding action procedure is \fBXexchangeY()\fR.
+.TP 10
+.B R v
+Rolls the stack downward.  When inverted, it rolls the stack upward.
+The corresponding action procedure is \fBroll()\fR.
+.TP 10
+.I blank
+These keys were used for programming functions on the HP-10C.  Their
+functionality has not been duplicated in \fIxcalc\fR.
+.PP
+Finally, there are two additional action procedures:
+\fBbell()\fR, which rings the bell; 
+and \fBselection()\fR, which performs a cut on the
+entire number in the calculator's ``liquid crystal'' display.
+.SH ACCELERATORS
+.PP
+Accelerators are shortcuts for entering commands.  \fIxcalc\fP provides
+some sample keyboard accelerators; also users can customize accelerators.
+The numeric keypad accelerators provided by \fIxcalc\fP
+should be intuitively correct.
+The accelerators defined by \fIxcalc\fP on the main keyboard are given below:
+.PP
+.nf
+.ta .5i 1.0i 1.5i 2.0i 2.5i 3.0i 3.5i 4.0i 4.5i 5.0i 5.5i 6.0i 6.5i 7.0i
+       TI Key  HP Key  Keyboard Accelerator    TI Function     HP Function
+       
+       SQRT    SQRT    r                       squareRoot()    squareRoot()
+       AC      ON      space                   clear()         clear()
+       AC      <-      Delete                  clear()         back()
+       AC      <-      Backspace               clear()         back()
+       AC      <-      Control-H               clear()         back()
+       AC              Clear                   clear()
+       AC      ON      q                       quit()          quit()
+       AC      ON      Control-C               quit()          quit()
+
+       INV     i       i                       inverse()               inverse()
+       sin     s       s                       sine()          sine()
+       cos     c       c                       cosine()                cosine()
+       tan     t       t                       tangent()       tangent()
+       DRG     DRG     d                       degree()                degree()
+
+       e               e                       e()
+       ln      ln      l                       naturalLog()    naturalLog()
+       y^x     y^x     ^                       power()         power()
+
+       PI      PI      p                       pi()            pi()
+       x!      x!      !                       factorial()     factorial()
+       (               (                       leftParen()
+       )               )                       rightParen()
+
+       /       /       /                       divide()                divide()
+       *       *       *                       multiply()      multiply()
+       -       -       -                       subtract()      subtract()
+       +       +       +                       add()           add()
+       =               =                       equal()
+
+       0..9    0..9    0..9                    digit()         digit()
+       .       .       .                       decimal()       decimal()
+       +/-     CHS     n                       negate()                negate()
+
+               x:y     x                                       XexchangeY()
+               ENTR    Return                                  enter()
+               ENTR    Linefeed                                        enter()
+.fi
+.PP
+.SH CUSTOMIZATION
+The application class name is XCalc.
+.PP
+\fIxcalc\fP has an enormous application defaults file which specifies 
+the position, label, and function of each key on the calculator.
+It also gives translations to serve as keyboard accelerators.
+Because these resources are not specified in the source code, you can create
+a customized calculator by writing a private application defaults file,
+using the Athena Command and Form widget resources to specify the size and 
+position of buttons, the label for each button, and the function of 
+each button.
+.PP
+The foreground and background colors of each calculator key can be 
+individually specified.
+For the TI calculator, a classical color resource specification might be:
+.sp
+.br
+XCalc.ti.Command.background:   gray50
+.br
+XCalc.ti.Command.foreground:   white
+.sp
+For each of buttons 20, 25, 30, 35, and 40, specify:
+.br
+XCalc.ti.button20.background:  black
+.br
+XCalc.ti.button20.foreground:  white
+.sp
+For each of buttons 22, 23, 24, 27, 28, 29, 32, 33, 34, 37, 38, and 39:
+.br
+XCalc.ti.button22.background:  white
+.br
+XCalc.ti.button22.foreground:  black
+.SH WIDGET HIERARCHY
+In order to specify resources, it is useful to know the hierarchy of
+the widgets which compose \fIxcalc\fR.  In the notation below,
+indentation indicates hierarchical structure.  The widget class name
+is given first, followed by the widget instance name.
+.nf
+.ta .5i 1.0i 1.5i 2.0i 2.5i 3.0i 3.5i 4.0i 4.5i 5.0i 5.5i 6.0i 6.5i 7.0i
+.sp
+XCalc xcalc
+       Form  ti  \fIor\fR  hp    \fI(the name depends on the mode)\fR
+               Form  bevel
+                       Form  screen
+                               Label  M
+                               Toggle  LCD
+                               Label  INV
+                               Label  DEG
+                               Label  RAD
+                               Label  GRAD
+                               Label  P
+               Command  button1
+               Command  button2
+               Command  button3
+\fIand so on, ...\fR
+               Command  button38
+               Command  button39
+               Command  button40
+.fi
+.SH APPLICATION RESOURCES
+.PP
+.TP 8
+\fBrpn\fR (Class \fBRpn\fR)
+Specifies that the rpn mode should be used.  The default is TI mode.
+.TP 8
+\fBstipple\fR (Class \fBStipple\fR)
+Indicates that the background should be stippled.  The default is ``on''
+for monochrome displays, and ``off'' for color displays.
+.TP 8
+\fBcursor\fR (Class \fBCursor\fR)
+The name of the symbol used to represent the pointer.
+The default is ``hand2''.
+.fi
+.SH COLORS
+If you would like xcalc to use its ti colors, include the following 
+in the #ifdef COLOR section of the file you read with xrdb:
+.sp 1
+*customization:                 -color
+.sp 1
+.br
+This will cause xcalc to pick up the colors in the app-defaults color
+customization file:
+.IR __apploaddir__/XCalc-color .
+.fi
+.SH "SEE ALSO"
+X(__miscmansuffix__), xrdb(1), the Athena Widget Set
+.SH BUGS
+.PP
+HP mode is not completely debugged.  In particular, the stack is
+not handled properly after errors.
+.SH COPYRIGHT
+Copyright 1994 X Consortium
+.br
+See \fIX(__miscmansuffix__)\fP for a full statement of rights and permissions.
+.SH AUTHORS
+John Bradley, University of Pennsylvania
+.br
+Mark Rosenstein, MIT Project Athena
+.br 
+Donna Converse, MIT X Consortium
diff --git a/xclipboard/AUTHORS b/xclipboard/AUTHORS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xclipboard/COPYING b/xclipboard/COPYING
new file mode 100644 (file)
index 0000000..7f33cbf
--- /dev/null
@@ -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/xclipboard/ChangeLog b/xclipboard/ChangeLog
new file mode 100644 (file)
index 0000000..2e6cb38
--- /dev/null
@@ -0,0 +1,318 @@
+commit 96d1fe9241f6b68d52c9b3020dd926319d830558
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Wed Oct 14 22:37:17 2009 -0700
+
+    xclipboard 1.1.0
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit f16c6dd23a132d037e513cd378b2a0e0417ebb8c
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Oct 13 19:58:31 2009 -0700
+
+    Enable #ifdef XKB code to call XkbStdBell() if libxkbfile is found
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 42432a7776c0cc94c6ec5360c1ab74f484328167
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Oct 13 19:51:11 2009 -0700
+
+    Migrate to xorg macros 1.3 & XORG_DEFAULT_OPTIONS
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 458673cf5192f800621bcd2b371eb55be9b5ba50
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Oct 1 14:54:21 2009 -0700
+
+    Add README with pointers to mailing lists, bugzilla, & git
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 7d5f24fd8182ac6650d4080f74237c8f3773acb4
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Mon Jan 12 20:27:18 2009 -0200
+
+    Ansification and compile warning fixes.
+    
+      This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects
+    make distcheck and most gcc 4.3 and sparse warnings.
+
+commit e66bb8c9fb0678cb1086320f931d805491b747f7
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Wed Aug 20 10:32:49 2008 -0400
+
+    xaw8 is gone, use xaw7
+
+commit 9f85f47d7cf25fba98207cc8c0a64b2bfc494c14
+Author: Stanislav Maslovski <stanislav.maslovski@gmail.com>
+Date:   Wed Jul 16 14:35:49 2008 -0400
+
+    Fix UTF-8 support.
+    
+      * use XA_UTF8_STRING defined in <X11/Xmu/Atoms.h>.
+      * add "*international: true" to fallback resources like xedit does.
+      * get rid of a separate InsertClipboardUtf8() and rewrite InsertClipboard()
+        to support proper conversion from UTF-8 with fallbacks to CTEXT or STRING
+        in case of errors.
+      * add COMPOUND_TEXT to the list of supported targets and unify
+        the conversion code for UTF-8, CTEXT and STRING in ConvertSelection().
+        Use a proper default for target TEXT.
+    
+    Signed-off-by: James Cloos <cloos@jhcloos.com>
+
+commit f7f9265623762bfa06cec5273de11d2ec55d4917
+Author: Stanislav Maslovski <stanislav.maslovski@gmail.com>
+Date:   Fri Jul 11 09:37:45 2008 -0400
+
+    Add UTF-8 support.
+    
+    While reading manuals on X selections, xt and xaw I have
+    added support of UTF-8 to xclipboard.
+    
+    As is seen from the patch I use “UTF8_STRING” atom
+    in the negotiation of the selection type. There are
+    other possibilities and it seems that there is no
+    real standard on this, right? I have checked that
+    UTF8_STRING works with both GTK+ and QT apps.
+    
+    In addition to the patch to enable correct display
+    of international texts in xaw widgets one has to define
+    
+    *international: true
+    
+    in one’s XRM.
+    
+    And enough rich set of bitmap fonts must be also installed.
+    
+    From bug 16671.
+    
+    Signed-off-by: James Cloos <cloos@jhcloos.com>
+
+commit aecddb8eae77fd36acdca88bb7080b875274d47c
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Fri May 16 14:17:52 2008 +0200
+
+    $(builddir) is the current directory
+    
+    Apparently automake doesn't always export the builddir variable.
+    This fixes my previous commit.
+
+commit 0013b5aa18798da38e7eb64b8bbb96f16268a474
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Sun Apr 20 19:12:08 2008 +0200
+
+    Fix build with builddir != srcdir
+
+commit 4cd445822a3cc48cde7102cecacc54f6daabe25b
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Sun Apr 20 19:05:17 2008 +0200
+
+    Use AM_CFLAGS instead of {xclipboard,xcutsel}_CFLAGS and remove AM_PROG_CC_C_O
+
+commit 6422151ddd39e50621df2ec4d5c9b52a189b378b
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Thu Mar 27 20:25:18 2008 -0700
+
+    Added missing AM_PROG_CC_C_O
+
+commit 43c7eeef9be867511c2c4ee82aa05ffc925efa65
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Thu Mar 27 20:07:36 2008 -0700
+
+    Build fix for file systems that are not case sensitive
+
+commit 22d6a8b72a1e52c7554e50fd250519d5a79e2816
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Dec 6 16:37:10 2007 -0500
+
+    Replace static ChangeLog with dist-hook to generate from git log
+
+commit 8587904b2dd914fa0a52f1246cd09b50a252054d
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Mon Sep 3 05:51:16 2007 -0400
+
+    Add *~ to .gitignore to skip patch/emacs droppings
+
+commit c543ac48d51df1f3fc7a85daf962d632cf5be07d
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Aug 23 19:24:40 2007 -0400
+
+    Rename .cvsignore to .gitignore
+
+commit 9d2fff958be21935020a443b3fb56bd2d41cd789
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 21 02:29:48 2005 +0000
+
+    Update package version for X11R7 release.
+
+commit 63db9d62f56a1429bdc6865337cea064e1c3e55c
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Dec 19 16:22:42 2005 +0000
+
+    Stub COPYING files
+
+commit 3c1e6ab769aaf446951641b560d31f45870c3520
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:24:05 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+commit d1c1ebd46e0931bbffb10f3d8d06b18fc1233910
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 7 16:17:58 2005 +0000
+
+    Change to use the app-defaults default dir configured in libXt.
+
+commit 0481b59715f074a1c105afee876cd62960e124a1
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 6 22:48:19 2005 +0000
+
+    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit 1a7a14e9b097a3fae172d25fa654af72929b7890
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Dec 3 05:49:18 2005 +0000
+
+    Update package version number for X11R7 RC3 release.
+
+commit 21a312bea06be1dda2d64076a87d6ad1324e01d9
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Nov 28 22:01:40 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 0245cfa0e04fd73aae23db52f7c424d5c07644f6
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Mon Nov 21 10:34:58 2005 +0000
+
+    Another pass at .cvsignores for apps.
+
+commit 75a9ef36c20f318b8da281febf584ce15c10ef35
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Sun Nov 20 22:08:51 2005 +0000
+
+    Add/improve .cvsignore files for apps.
+
+commit bbb7e9adb403e7896af68944941ca9229b4bfa3e
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:47:52 2005 +0000
+
+    Update package version number for RC1 release.
+
+commit 1f5bb8da77add50c72b721d8d63e25d25f99b19e
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Oct 18 00:32:54 2005 +0000
+
+    Change default install dir for app-default files from
+        $(sysconfdir)/X11/app-defaults to $(libdir)/X11/app-defaults to match
+        the monolith & allow localization
+
+commit 8b5c18ad03870baac75724ee8e674511548ca25d
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Oct 17 23:56:21 2005 +0000
+
+    Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to
+        work better with BSD make
+
+commit 19e2998cd3c424c25aa3780f12da517453428f83
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Fri Oct 14 00:25:43 2005 +0000
+
+    Use sed to fill in variables in man page
+
+commit c440a0452b998073b2dec8bf8278eca8136675be
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Aug 1 20:25:29 2005 +0000
+
+    Install man pages to section 1 instead of section m (Patch from Donnie
+        Berkholz)
+
+commit 5578b4284a0dcfea32cea8dae3992fe509249f84
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Jul 29 21:22:31 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 ed3b3927eccbcf03debd34572285176074bec03b
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Jul 26 15:44:01 2005 +0000
+
+    Replace more GNU make-ism's with more portable macros
+
+commit 9caece10b7a09796331f5e6c02696bfb212b2e11
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed Jul 20 19:31:51 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 fdc0992af4020cb5230a64058281b6e5aed0d3a1
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Sun Jul 17 20:11:02 2005 +0000
+
+    fix rules to work with non-GNU make and outside of $srcdir
+
+commit e0a326f3bd7889da2352a1e534871a64b693545a
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Wed Jul 6 17:30:20 2005 +0000
+
+    Build system for xclipboard and xcutsel
+
+commit 85a4962bf0afd349b3260f68fb29aa06b0117f57
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 19:54:39 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+commit 146e4cdd54a23384e879fc814ded63d0d790ba1f
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:35:00 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit 6269527e0703627ca9e0316c82c2159a1c7114f1
+Author: Egbert Eich <eich@suse.de>
+Date:   Wed Mar 3 12:12:55 2004 +0000
+
+    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit 538cb471c6767c367fcd1955cf3eac8a8b043c31
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:36:16 2004 +0000
+
+    readding XFree86's cvs IDs
+
+commit 52bd64ce38b07c7609434b72b35127b2324a0f73
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 09:23:58 2004 +0000
+
+    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit 94abf1754b04b1e6382fe0287b1e7eb2ce6ffdf3
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:29:03 2003 +0000
+
+    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit 63371815b3f48cb8d4793e6a520d2fc4350c5f1f
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:58 2003 +0000
+
+    XFree86 4.3.0.1
+
+commit 729ceb19417c61603e659b2eb82d2e02fa388365
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 15:54:53 2003 +0000
+
+    R6.6 is the Xorg base-line
diff --git a/xclipboard/INSTALL b/xclipboard/INSTALL
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xclipboard/Makefile.am b/xclipboard/Makefile.am
new file mode 100644 (file)
index 0000000..42967dc
--- /dev/null
@@ -0,0 +1,95 @@
+# 
+#  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 = xclipboard xcutsel
+
+AM_CFLAGS = $(CWARNFLAGS) $(XCLIPBOARD_CFLAGS)
+
+# xclipboard
+
+xclipboard_LDADD = $(XCLIPBOARD_LIBS)
+
+xclipboard_SOURCES =   \
+        xclipboard.c
+
+# xcutsel
+
+xcutsel_LDADD = $(XCLIPBOARD_LIBS)
+
+xcutsel_SOURCES =      \
+        xcutsel.c
+
+# man pages
+
+appman_PRE = \
+        xclipboard.man \
+        xcutsel.man
+
+# App default files  (*.ad)
+
+DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
+
+appdefaultdir = @appdefaultdir@
+
+dist_appdefault_DATA = \
+        app-defaults/XClipboard
+
+
+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):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+EXTRA_DIST += ChangeLog
+MAINTAINERCLEANFILES = ChangeLog
+
+.PHONY: ChangeLog
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog
diff --git a/xclipboard/Makefile.in b/xclipboard/Makefile.in
new file mode 100644 (file)
index 0000000..908cebe
--- /dev/null
@@ -0,0 +1,813 @@
+# Makefile.in generated by automake 1.11 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = xclipboard$(EXEEXT) xcutsel$(EXEEXT)
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(dist_appdefault_DATA) \
+       $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+       $(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \
+       ChangeLog INSTALL NEWS config.guess config.sub depcomp \
+       install-sh missing
+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 config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" \
+       "$(DESTDIR)$(appdefaultdir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_xclipboard_OBJECTS = xclipboard.$(OBJEXT)
+xclipboard_OBJECTS = $(am_xclipboard_OBJECTS)
+am__DEPENDENCIES_1 =
+xclipboard_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_xcutsel_OBJECTS = xcutsel.$(OBJEXT)
+xcutsel_OBJECTS = $(am_xcutsel_OBJECTS)
+xcutsel_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(xclipboard_SOURCES) $(xcutsel_SOURCES)
+DIST_SOURCES = $(xclipboard_SOURCES) $(xcutsel_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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+DATA = $(appman_DATA) $(dist_appdefault_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
+ACLOCAL = @ACLOCAL@
+ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
+ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPDEFS_CFLAGS = @APPDEFS_CFLAGS@
+APPDEFS_LIBS = @APPDEFS_LIBS@
+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@
+CHANGELOG_CMD = @CHANGELOG_CMD@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
+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@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+GREP = @GREP@
+INSTALL = @INSTALL@
+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@
+MAKEINFO = @MAKEINFO@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+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@
+XCLIPBOARD_CFLAGS = @XCLIPBOARD_CFLAGS@
+XCLIPBOARD_LIBS = @XCLIPBOARD_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+appdefaultdir = @appdefaultdir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+distcleancheck_listfiles = @distcleancheck_listfiles@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CFLAGS = $(CWARNFLAGS) $(XCLIPBOARD_CFLAGS)
+
+# xclipboard
+xclipboard_LDADD = $(XCLIPBOARD_LIBS)
+xclipboard_SOURCES = \
+        xclipboard.c
+
+
+# xcutsel
+xcutsel_LDADD = $(XCLIPBOARD_LIBS)
+xcutsel_SOURCES = \
+        xcutsel.c
+
+
+# man pages
+appman_PRE = \
+        xclipboard.man \
+        xcutsel.man
+
+
+# App default files  (*.ad)
+DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
+dist_appdefault_DATA = \
+        app-defaults/XClipboard
+
+appmandir = $(APP_MAN_DIR)
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+EXTRA_DIST = $(appman_PRE) ChangeLog
+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
+MAINTAINERCLEANFILES = ChangeLog
+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'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+       $(am__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)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+       @if test ! -f $@; then \
+         rm -f stamp-h1; \
+         $(MAKE) $(AM_MAKEFLAGS) 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) 
+       ($(am__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)'; test -n "$(bindir)" || list=; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p; \
+         then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+xclipboard$(EXEEXT): $(xclipboard_OBJECTS) $(xclipboard_DEPENDENCIES) 
+       @rm -f xclipboard$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(xclipboard_OBJECTS) $(xclipboard_LDADD) $(LIBS)
+xcutsel$(EXEEXT): $(xcutsel_OBJECTS) $(xcutsel_DEPENDENCIES) 
+       @rm -f xcutsel$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(xcutsel_OBJECTS) $(xcutsel_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xclipboard.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcutsel.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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) '$<'`
+install-appmanDATA: $(appman_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)"
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \
+       done
+
+uninstall-appmanDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appmandir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appmandir)" && rm -f $$files
+install-dist_appdefaultDATA: $(dist_appdefault_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appdefaultdir)" || $(MKDIR_P) "$(DESTDIR)$(appdefaultdir)"
+       @list='$(dist_appdefault_DATA)'; test -n "$(appdefaultdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appdefaultdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appdefaultdir)" || exit $$?; \
+       done
+
+uninstall-dist_appdefaultDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_appdefault_DATA)'; test -n "$(appdefaultdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appdefaultdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appdefaultdir)" && rm -f $$files
+
+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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       set x; \
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       $(am__remove_distdir)
+       test -d "$(distdir)" || mkdir "$(distdir)"
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$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
+       -test -n "$(am__skip_mode_fix)" \
+       || 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 $(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-lzma: distdir
+       tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+       $(am__remove_distdir)
+
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+       $(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.lzma*) \
+         unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(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)
+       test -d $(distdir)/_build || exit 0; \
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && am__cwd=`pwd` \
+         && $(am__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 \
+         && cd "$$am__cwd" \
+         || exit 1
+       $(am__remove_distdir)
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+       @$(am__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)" "$(DESTDIR)$(appdefaultdir)"; 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)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-appmanDATA install-dist_appdefaultDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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_appdefaultDATA
+
+.MAKE: all install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+       clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
+       dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \
+       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-dist_appdefaultDATA install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+       uninstall-am uninstall-appmanDATA uninstall-binPROGRAMS \
+       uninstall-dist_appdefaultDATA
+
+
+.man.$(APP_MAN_SUFFIX):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+.PHONY: ChangeLog
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+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/xclipboard/NEWS b/xclipboard/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xclipboard/README b/xclipboard/README
new file mode 100644 (file)
index 0000000..e45828c
--- /dev/null
@@ -0,0 +1,28 @@
+xclipboard is used to collect and display text selections that are
+sent to the CLIPBOARD by other clients.  It is typically used to save
+CLIPBOARD selections for later use.  It stores each CLIPBOARD
+selection as a separate string, each of which can be selected.
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+        http://lists.freedesktop.org/mailman/listinfo/xorg
+
+Please submit bug reports to the Xorg bugzilla:
+
+        https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+The master development code repository can be found at:
+
+        git://anongit.freedesktop.org/git/xorg/app/xclipboard
+
+        http://cgit.freedesktop.org/xorg/app/xclipboard
+
+For patch submission instructions, see:
+
+       http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
+For more information on the git code manager, see:
+
+        http://wiki.x.org/wiki/GitPage
+
diff --git a/xclipboard/aclocal.m4 b/xclipboard/aclocal.m4
new file mode 100644 (file)
index 0000000..684599f
--- /dev/null
@@ -0,0 +1,1766 @@
+# generated automatically by aclocal 1.11 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009  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.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
+[m4_warning([this file was generated for autoconf 2.63.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# 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, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# 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])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+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, 2006, 2009
+# 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 10
+
+# 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], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$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
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    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, 2006, 2008, 2009 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 16
+
+# 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.62])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
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+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
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_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)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+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
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_AM_DEPENDENCIES(OBJC)],
+                 [define([AC_PROG_OBJC],
+                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# 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_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
+                         (and sometimes confusing) to the casual installer],
+      [USE_MAINTAINER_MODE=$enableval],
+      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  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, 2009  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_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.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
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+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, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# 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
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# 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, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _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],
+[m4_foreach_w([_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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# 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
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# 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) 2009  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 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# 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="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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
+
+dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
+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 ensure that this macro is defined, also add:
+# m4_ifndef([XORG_MACROS_VERSION],
+#     [m4_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.
+m4_defun([XORG_MACROS_VERSION],[
+m4_define([vers_have], [1.3.0])
+m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
+m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
+m4_if(m4_cmp(maj_have, maj_needed), 0,,
+    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
+m4_if(m4_version_compare(vers_have, [$1]), -1,
+    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
+m4_undefine([vers_have])
+m4_undefine([maj_have])
+m4_undefine([maj_needed])
+]) # 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])
+       # under Cygwin unix is still defined even with -undef
+       elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+               RAWCPPFLAGS="-undef -ansi"
+               AC_MSG_RESULT([yes, with -ansi])
+       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],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+
+if test x"$cross_compiling" = x"yes" ; then
+  HAVE_DEFS_ENT=no
+else
+  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+fi
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+AC_PATH_PROG(PS2PDF, ps2pdf)
+
+AC_MSG_CHECKING([Whether to build documentation])
+
+if test x$HAVE_DEFS_ENT != 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 && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([Whether to build text documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([Whether to build PDF documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([Whether to build PostScript documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([Whether to build HTML documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# 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,
+       AS_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, [AS_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, [AS_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
+
+# XORG_CWARNFLAGS
+# ---------------
+# Minimum version: 1.2.0
+#
+# Defines CWARNFLAGS to enable C compiler warnings.
+#
+AC_DEFUN([XORG_CWARNFLAGS], [
+AC_REQUIRE([AC_PROG_CC])
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+AC_SUBST(CWARNFLAGS)
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+]) # XORG_CWARNFLAGS
+
+# XORG_STRICT_OPTION
+# -----------------------
+# Minimum version: 1.3.0
+#
+# Add configure option to enable strict compilation
+AC_DEFUN([XORG_STRICT_OPTION], [
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CC_C99])
+AC_REQUIRE([XORG_CWARNFLAGS])
+
+AC_ARG_ENABLE(strict-compilation,
+                         AS_HELP_STRING([--enable-strict-compilation],
+                         [Enable all warnings from compiler and make them errors (default: disabled)]),
+                         [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
+if test "x$STRICT_COMPILE" = "xyes"; then
+       AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+       AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+AC_SUBST([CWARNFLAGS])
+]) # XORG_STRICT_OPTION
+
+# XORG_DEFAULT_OPTIONS
+# --------------------
+# Minimum version: 1.3.0
+#
+# Defines default options for X.Org modules.
+#
+AC_DEFUN([XORG_DEFAULT_OPTIONS], [
+XORG_CWARNFLAGS
+XORG_STRICT_OPTION
+XORG_RELEASE_VERSION
+XORG_CHANGELOG
+XORG_MANPAGE_SECTIONS
+]) # XORG_DEFAULT_OPTIONS
+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.  Also
+# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+AC_DEFUN([XORG_RELEASE_VERSION],[
+       AC_ARG_WITH(release-version,
+                       AS_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
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+               [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+               [Major version of this package])
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+               [$PVM],
+               [Minor version of this package])
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+               [$PVP],
+               [Patch version of this package])
+])
+
+# XORG_CHANGELOG()
+# ----------------
+# Minimum version: 1.2.0
+#
+# Defines the variable CHANGELOG_CMD as the command to generate
+# ChangeLog from git.
+#
+# Arrange that distcleancheck ignores ChangeLog left over by distclean.
+#
+AC_DEFUN([XORG_CHANGELOG], [
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
+mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+AC_SUBST([CHANGELOG_CMD])
+AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
+]) # XORG_CHANGELOG
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# 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 "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _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 --print-errors "$2" 2>&1`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       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 <http://pkg-config.freedesktop.org/>.])],
+               [$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
+
diff --git a/xclipboard/app-defaults/XClipboard b/xclipboard/app-defaults/XClipboard
new file mode 100644 (file)
index 0000000..7e3b1d2
--- /dev/null
@@ -0,0 +1,126 @@
+! $Xorg: XClipboard.ad,v 1.3 2000/08/17 19:54:12 cpqbld Exp $
+*Command*Font:         -*-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-1
+*Label*Font:   -*-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-1
+*Text*Font:    -*-courier-medium-r-normal--*-120-*-*-*-*-iso8859-1
+
+*quit.label:                   Quit
+*quit.top:                     ChainTop
+*quit.bottom:                  ChainTop
+*quit.left:                    ChainLeft
+*quit.right:                   ChainLeft
+*quit.translations:            #override \n\
+                               <Btn1Down>,<Btn1Up>:Quit() unset()
+
+*delete.label:                         Delete
+*delete.fromHoriz:             quit
+*delete.top:                   ChainTop
+*delete.bottom:                        ChainTop
+*delete.left:                  ChainLeft
+*delete.right:                 ChainLeft
+*delete.translations:          #override \n\
+                               <Btn1Down>,<Btn1Up>:DeleteClip() unset()
+
+*new.label:                    New
+*new.fromHoriz:                delete
+*new.top:                      ChainTop
+*new.bottom:                   ChainTop
+*new.left:                     ChainLeft
+*new.right:                    ChainLeft
+*new.translations:             #override \n\
+                               <Btn1Down>,<Btn1Up>:NewClip() unset()
+
+*save.label:                   Save
+*save.fromHoriz:               new
+*save.top:                     ChainTop
+*save.bottom:                  ChainTop
+*save.left:                    ChainLeft
+*save.right:                   ChainLeft
+*save.translations:            #override \n\
+                               <Btn1Down>,<Btn1Up>:Save() unset()
+
+*next.label:                   Next
+*next.fromHoriz:               save
+*next.top:                     ChainTop
+*next.bottom:                  ChainTop
+*next.left:                    ChainLeft
+*next.right:                   ChainLeft
+*next.translations:            #override \n\
+                               <Btn1Down>,<Btn1Up>:NextClip() unset()
+
+*prev.label:                   Prev
+*prev.fromHoriz:               next
+*prev.top:                     ChainTop
+*prev.bottom:                  ChainTop
+*prev.left:                    ChainLeft
+*prev.right:                   ChainLeft
+*prev.translations:            #override \n\
+                               <Btn1Down>,<Btn1Up>:PrevClip() unset()
+
+*index.fromHoriz:              prev
+*index.top:                    ChainTop
+*index.bottom:                 ChainTop
+*index.left:                   ChainLeft
+*index.right:                  ChainLeft
+*index.resizable:              true
+
+*text.scrollVertical:                  WhenNeeded
+*text.scrollHorizontal:        WhenNeeded
+*text.autoFill:                on
+
+*text.fromVert:                quit
+*text.top:                     ChainTop
+*text.bottom:                  ChainBottom
+*text.left:                    ChainLeft
+*text.right:                   ChainRight
+*text.resizable:               true
+*text.width:                   300
+
+XClipboard.geometry:           300x200
+*ShapeStyle:                   oval
+XClipboard.baseTranslations: #augment\n\
+                       <Message>WM_PROTOCOLS: WMProtocols()\n
+*TransientShell.baseTranslations: #augment\n\
+                       <Message>WM_PROTOCOLS: WMProtocols()\n
+
+*fileDialog.label:                     Save to file:
+*fileDialogShell.allowShellResize:     true
+*fileDialogShell.title:                        File Save
+
+*fileDialog*accept.label:              Accept
+*fileDialog*accept.translations:       #override\
+                       <BtnUp>: AcceptSave() unset()
+*fileDialog*value.translations:        #override\
+                       <Key>Return: AcceptSave() \n\
+                       Ctrl<Key>S: no-op(ring-bell) \n\
+                       Ctrl<Key>R: no-op(ring-bell) \n\
+                       Ctrl<Key>M: no-op(ring-bell) \n\
+                       Ctrl<Key>J: no-op(ring-bell) \n\
+                       Meta<Key>I: no-op(ring-bell)
+*fileDialog*value.baseTranslations:    #override\
+                       <Key>Return: AcceptSave() \n\
+                       Ctrl<Key>S: no-op(ring-bell) \n\
+                       Ctrl<Key>R: no-op(ring-bell) \n\
+                       Ctrl<Key>M: no-op(ring-bell) \n\
+                       Ctrl<Key>J: no-op(ring-bell) \n\
+                       Meta<Key>I: no-op(ring-bell)
+
+*fileDialog*cancel.label:              Cancel
+*fileDialog*cancel.translations:       #override\
+                       <BtnUp>:CancelSave() unset()
+
+*failDialog*Label.resizable:           true
+*failDialog.label:                     Can't write file
+*failDialogShell.title:                        Error
+*failDialogShell.allowShellResize:     true
+
+*failDialog*continue.label:            Continue
+*failDialog*continue.translations:     #override\
+                       <BtnUp>:FailContinue() unset()
+
+*failDialog*value.translations:        #override\
+                       <Key>Return: FailContinue() \n\
+                       Ctrl<Key>S: no-op(ring-bell) \n\
+                       Ctrl<Key>R: no-op(ring-bell) \n\
+                       Ctrl<Key>M: no-op(ring-bell) \n\
+                       Ctrl<Key>J: no-op(ring-bell) \n\
+                       Meta<Key>I: no-op(ring-bell)
diff --git a/xclipboard/config.guess b/xclipboard/config.guess
new file mode 100755 (executable)
index 0000000..da83314
--- /dev/null
@@ -0,0 +1,1561 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
+
+timestamp='2009-04-27'
+
+# 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 <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+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, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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 "$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 ;;
+           sh5el) machine=sh5le-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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    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.*:* | i86xen:SunOS:5.*:*)
+       eval $set_cc_for_build
+       SUN_ARCH="i386"
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       echo ${SUN_ARCH}-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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:*:[456])
+       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+               IBM_ARCH=rs6000
+       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 <stdlib.h>
+              #include <unistd.h>
+
+              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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       exit ;;
+    i*:CYGWIN*:*)
+       echo ${UNAME_MACHINE}-pc-cygwin
+       exit ;;
+    *: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 ;;
+    *:Interix*:[3456]*)
+       case ${UNAME_MACHINE} in
+           x86)
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           EM64T | authenticamd | genuineintel)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+           IA64)
+               echo ia64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+       esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       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*:*:* | x86_64: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:*:*)
+       eval $set_cc_for_build
+       if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_EABI__
+       then
+           echo ${UNAME_MACHINE}-unknown-linux-gnu
+       else
+           echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+       fi
+       exit ;;
+    avr32*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-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 ;;
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-gnu
+       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 ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-gnu
+       exit ;;
+    x86_64:Linux:*:*)
+       echo x86_64-unknown-linux-gnu
+       exit ;;
+    xtensa*:Linux:*:*)
+       echo ${UNAME_MACHINE}-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 ;;
+         "")
+               # 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 <features.h>
+       #ifdef __ELF__
+       # ifdef __GLIBC__
+       #  if __GLIBC__ >= 2
+       LIBC=gnu
+       #  else
+       LIBC=gnulibc1
+       #  endif
+       # else
+       LIBC=gnulibc1
+       # endif
+       #else
+       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+       LIBC=gnu
+       #else
+       LIBC=gnuaout
+       #endif
+       #endif
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^LIBC/{
+               s: ::g
+               p
+           }'`"
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-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; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       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; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; 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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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 ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       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 ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-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
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/xclipboard/config.h.in b/xclipboard/config.h.in
new file mode 100644 (file)
index 0000000..9f7e71d
--- /dev/null
@@ -0,0 +1,64 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* 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
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to use libxkbfile calls like XKBStdBell() */
+#undef XKB
diff --git a/xclipboard/config.sub b/xclipboard/config.sub
new file mode 100755 (executable)
index 0000000..a39437d
--- /dev/null
@@ -0,0 +1,1686 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
+
+timestamp='2009-04-17'
+
+# 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 <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | bfin \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fido | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | lm32 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore | mep | metag \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64octeon | mips64octeonel \
+       | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | moxie \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | z8k | z80)
+               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)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64octeon-* | mips64octeonel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | 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[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+       | tron-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa*-* \
+       | ymp-* \
+       | z8k-* | z80-*)
+               ;;
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               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
+               ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+        cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
+       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
+               ;;
+       cr16)
+               basic_machine=cr16-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
+               ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
+       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
+               ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       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
+               ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
+       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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       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
+               ;;
+       tile*)
+               basic_machine=tile-unknown
+               os=-linux-gnu
+               ;;
+       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
+               ;;
+       z80-*-coff)
+               basic_machine=z80-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[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+               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* \
+             | -kopensolaris* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* | -aros* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
+             | -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* | -cegcc* \
+             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -linux-newlib* | -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* | -rdos* | -toppers* | -drops*)
+       # 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
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+       -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
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
+       *-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
+               ;;
+        mep-*)
+               os=-elf
+               ;;
+       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/xclipboard/configure b/xclipboard/configure
new file mode 100755 (executable)
index 0000000..7c625fb
--- /dev/null
@@ -0,0 +1,6886 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.63 for xclipboard 1.1.0.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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 ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&    (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    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=.
+  case $as_dir in
+        /*)
+          for as_base in sh bash ksh sh5; do
+            as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+          done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+        # Try only shells that exist, to save several forks.
+        if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+               { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+              as_have_required=yes
+              if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+       do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+       done
+       export CONFIG_SHELL
+       exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell bug-autoconf@gnu.org about your system,
+  echo including any error possibly output before this message.
+  echo This can help us improve future autoconf versions.
+  echo Configuration will now proceed without shell functions.
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# 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`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='xclipboard'
+PACKAGE_TARNAME='xclipboard'
+PACKAGE_VERSION='1.1.0'
+PACKAGE_STRING='xclipboard 1.1.0'
+PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+appdefaultdir
+APPDEFS_LIBS
+APPDEFS_CFLAGS
+XCLIPBOARD_LIBS
+XCLIPBOARD_CFLAGS
+PKG_CONFIG
+ADMIN_MAN_DIR
+DRIVER_MAN_DIR
+MISC_MAN_DIR
+FILE_MAN_DIR
+LIB_MAN_DIR
+APP_MAN_DIR
+ADMIN_MAN_SUFFIX
+DRIVER_MAN_SUFFIX
+MISC_MAN_SUFFIX
+FILE_MAN_SUFFIX
+LIB_MAN_SUFFIX
+APP_MAN_SUFFIX
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+distcleancheck_listfiles
+CHANGELOG_CMD
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+CWARNFLAGS
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_silent_rules
+enable_strict_compilation
+with_release_version
+with_appdefaultdir
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+PKG_CONFIG
+XCLIPBOARD_CFLAGS
+XCLIPBOARD_LIBS
+APPDEFS_CFLAGS
+APPDEFS_LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)   ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=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 ;;
+
+  -*) { $as_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 &&
+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_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'`
+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+   { (exit 1); exit 1; }; } ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+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
+    $as_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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 xclipboard 1.1.0 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/xclipboard]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_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 xclipboard 1.1.0:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --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
+  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')
+  --enable-strict-compilation
+                          Enable all warnings from compiler and make them
+                          errors (default: disabled)
+
+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
+  --with-appdefaultdir=<pathname>
+                          specify directory for app-defaults files (default is
+                          autodetected)
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  PKG_CONFIG  path to pkg-config utility
+  XCLIPBOARD_CFLAGS
+              C compiler flags for XCLIPBOARD, overriding pkg-config
+  XCLIPBOARD_LIBS
+              linker flags for XCLIPBOARD, overriding pkg-config
+  APPDEFS_CFLAGS
+              C compiler flags for APPDEFS, overriding pkg-config
+  APPDEFS_LIBS
+              linker flags for APPDEFS, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+xclipboard configure 1.1.0
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 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
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by xclipboard $as_me 1.1.0, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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=.
+  $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&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_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=`$as_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_arg'"
+      ;;
+    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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+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,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r 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 -f -r conftest* 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 an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test -r "$ac_site_file"; then
+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_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
+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_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 $ac_precious_vars; 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,)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_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
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_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
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_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.11'
+
+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
+  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$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'
+
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5
+$as_echo "$as_me: error: unsafe absolute working directory name" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5
+$as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+
+# 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".
+      { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+$as_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
+   { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+$as_echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "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 $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# 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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+done
+IFS=$as_save_IFS
+
+fi
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+# test whether we have cygpath
+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='xclipboard'
+ VERSION='1.1.0'
+
+
+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"}
+
+# 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 -'
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-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
+
+  { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$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
+
+
+
+# Require xorg-macros 1.3 or later: XORG_DEFAULT_OPTIONS
+
+
+
+
+
+
+
+
+
+
+
+
+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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+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
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_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.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_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.out.dSYM 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.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+$as_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
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&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'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_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
+       { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_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
+$as_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
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+$as_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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then
+  $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+$as_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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       CFLAGS=""
+      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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=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 <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+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 this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-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=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&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
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$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.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$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'
+
+
+
+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
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&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
+
+
+{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+  $as_echo_n "(cached) " >&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 <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+   { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if test "${ac_cv_prog_cc_c99+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=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 <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+       {
+       case 's': // string
+         str = va_arg (args_copy, const char *);
+         break;
+       case 'd': // int
+         number = va_arg (args_copy, int);
+         break;
+       case 'f': // float
+         fnumber = va_arg (args_copy, double);
+         break;
+       default:
+         break;
+       }
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+         || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c99=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    { $as_echo "$as_me:$LINENO: checking whether __SUNPRO_C is declared" >&5
+$as_echo_n "checking whether __SUNPRO_C is declared... " >&6; }
+if test "${ac_cv_have_decl___SUNPRO_C+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __SUNPRO_C
+  (void) __SUNPRO_C;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl___SUNPRO_C=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl___SUNPRO_C=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___SUNPRO_C" >&5
+$as_echo "$ac_cv_have_decl___SUNPRO_C" >&6; }
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=0;;
+esac
+AM_BACKSLASH='\'
+
+
+
+
+
+
+
+# Check whether --enable-strict-compilation was given.
+if test "${enable_strict_compilation+set}" = set; then
+  enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval
+else
+  STRICT_COMPILE=no
+fi
+
+if test "x$STRICT_COMPILE" = "xyes"; then
+       { $as_echo "$as_me:$LINENO: checking whether __SUNPRO_C is declared" >&5
+$as_echo_n "checking whether __SUNPRO_C is declared... " >&6; }
+if test "${ac_cv_have_decl___SUNPRO_C+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __SUNPRO_C
+  (void) __SUNPRO_C;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl___SUNPRO_C=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl___SUNPRO_C=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___SUNPRO_C" >&5
+$as_echo "$ac_cv_have_decl___SUNPRO_C" >&6; }
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+       { $as_echo "$as_me:$LINENO: checking whether __INTEL_COMPILER is declared" >&5
+$as_echo_n "checking whether __INTEL_COMPILER is declared... " >&6; }
+if test "${ac_cv_have_decl___INTEL_COMPILER+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __INTEL_COMPILER
+  (void) __INTEL_COMPILER;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl___INTEL_COMPILER=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl___INTEL_COMPILER=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___INTEL_COMPILER" >&5
+$as_echo "$ac_cv_have_decl___INTEL_COMPILER" >&6; }
+if test "x$ac_cv_have_decl___INTEL_COMPILER" = x""yes; then
+  INTELCC="yes"
+else
+  INTELCC="no"
+fi
+
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+
+
+
+
+# Check whether --with-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"
+               { $as_echo "$as_me:$LINENO: Building with package name set to $PACKAGE" >&5
+$as_echo "$as_me: Building with package name set to $PACKAGE" >&6;}
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
+mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+
+distcleancheck_listfiles='find . -type f ! -name ChangeLog -print'
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+if test -n "$PKG_CONFIG" && \
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xkbfile\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xkbfile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  XKBPKG="xkbfile"
+else
+  XKBPKG=""
+fi
+if test x$XKBPKG = xxkbfile ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define XKB 1
+_ACEOF
+
+fi
+
+pkg_failed=no
+{ $as_echo "$as_me:$LINENO: checking for XCLIPBOARD" >&5
+$as_echo_n "checking for XCLIPBOARD... " >&6; }
+
+if test -n "$XCLIPBOARD_CFLAGS"; then
+    pkg_cv_XCLIPBOARD_CFLAGS="$XCLIPBOARD_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xaw7 xmu xt x11 \${XKBPKG}\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xaw7 xmu xt x11 ${XKBPKG}") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_XCLIPBOARD_CFLAGS=`$PKG_CONFIG --cflags "xaw7 xmu xt x11 ${XKBPKG}" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XCLIPBOARD_LIBS"; then
+    pkg_cv_XCLIPBOARD_LIBS="$XCLIPBOARD_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xaw7 xmu xt x11 \${XKBPKG}\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xaw7 xmu xt x11 ${XKBPKG}") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_XCLIPBOARD_LIBS=`$PKG_CONFIG --libs "xaw7 xmu xt x11 ${XKBPKG}" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               XCLIPBOARD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xaw7 xmu xt x11 ${XKBPKG}" 2>&1`
+        else
+               XCLIPBOARD_PKG_ERRORS=`$PKG_CONFIG --print-errors "xaw7 xmu xt x11 ${XKBPKG}" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XCLIPBOARD_PKG_ERRORS" >&5
+
+       { { $as_echo "$as_me:$LINENO: error: Package requirements (xaw7 xmu xt x11 ${XKBPKG}) were not met:
+
+$XCLIPBOARD_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 XCLIPBOARD_CFLAGS
+and XCLIPBOARD_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&5
+$as_echo "$as_me: error: Package requirements (xaw7 xmu xt x11 ${XKBPKG}) were not met:
+
+$XCLIPBOARD_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 XCLIPBOARD_CFLAGS
+and XCLIPBOARD_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
+       { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_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 XCLIPBOARD_CFLAGS
+and XCLIPBOARD_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&5
+$as_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 XCLIPBOARD_CFLAGS
+and XCLIPBOARD_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+else
+       XCLIPBOARD_CFLAGS=$pkg_cv_XCLIPBOARD_CFLAGS
+       XCLIPBOARD_LIBS=$pkg_cv_XCLIPBOARD_LIBS
+        { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       :
+fi
+
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:$LINENO: checking for APPDEFS" >&5
+$as_echo_n "checking for APPDEFS... " >&6; }
+
+if test -n "$APPDEFS_CFLAGS"; then
+    pkg_cv_APPDEFS_CFLAGS="$APPDEFS_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_APPDEFS_CFLAGS=`$PKG_CONFIG --cflags "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$APPDEFS_LIBS"; then
+    pkg_cv_APPDEFS_LIBS="$APPDEFS_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_APPDEFS_LIBS=`$PKG_CONFIG --libs "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xt" 2>&1`
+        else
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --print-errors "xt" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$APPDEFS_PKG_ERRORS" >&5
+
+       { { $as_echo "$as_me:$LINENO: error: Package requirements (xt) were not met:
+
+$APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&5
+$as_echo "$as_me: error: Package requirements (xt) were not met:
+
+$APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_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
+       { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&5
+$as_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+else
+       APPDEFS_CFLAGS=$pkg_cv_APPDEFS_CFLAGS
+       APPDEFS_LIBS=$pkg_cv_APPDEFS_LIBS
+        { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       :
+fi
+xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+
+# Check whether --with-appdefaultdir was given.
+if test "${with_appdefaultdir+set}" = set; then
+  withval=$with_appdefaultdir; appdefaultdir="$withval"
+else
+  appdefaultdir="${xt_appdefaultdir}"
+fi
+
+
+
+
+
+
+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 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"
+               { $as_echo "$as_me:$LINENO: Building with package name set to $PACKAGE" >&5
+$as_echo "$as_me: Building with package name set to $PACKAGE" >&6;}
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
+mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+
+distcleancheck_listfiles='find . -type f ! -name ChangeLog -print'
+
+
+
+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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     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" &&
+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+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_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_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
+  { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_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
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_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_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $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 || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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 ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by xclipboard $as_me 1.1.0, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet, --silent
+                   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 <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+xclipboard config.status 1.1.0
+configured by $0, generated by GNU Autoconf 2.63,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+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
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { $as_echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { $as_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"
+     ac_need_defaults=false ;;
+
+  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 || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr='\r'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+   { (exit 1); exit 1; }; }
+_ACEOF
+
+# 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
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #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.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
+$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
+   { (exit 1); exit 1; }; }
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      ac_file_inputs="$ac_file_inputs '$ac_f'"
+    done
+
+    # 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.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+       || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
+$as_echo "$as_me: error: could not create -" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$_am_arg" : 'X\(//\)[^/]' \| \
+        X"$_am_arg" : 'X\(//\)$' \| \
+        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_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=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+
+# 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
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/xclipboard/configure.ac b/xclipboard/configure.ac
new file mode 100644 (file)
index 0000000..090ed0f
--- /dev/null
@@ -0,0 +1,62 @@
+
+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(xclipboard, [1.1.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xclipboard)
+AM_INIT_AUTOMAKE([dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros 1.3 or later: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+         [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+
+AM_CONFIG_HEADER(config.h)
+
+AC_PROG_CC
+AC_PROG_INSTALL
+
+XORG_DEFAULT_OPTIONS
+
+# Checks for pkg-config packages
+PKG_CHECK_EXISTS([xkbfile], [XKBPKG="xkbfile"], [XKBPKG=""])
+if test x$XKBPKG = xxkbfile ; then
+    AC_DEFINE([XKB], [1], [Define to use libxkbfile calls like XKBStdBell()])
+fi
+PKG_CHECK_MODULES(XCLIPBOARD, [xaw7 xmu xt x11 ${XKBPKG}])
+AC_SUBST(XCLIPBOARD_CFLAGS)
+AC_SUBST(XCLIPBOARD_LIBS)
+
+PKG_CHECK_MODULES(APPDEFS, xt)
+xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+AC_ARG_WITH(appdefaultdir,
+       AC_HELP_STRING([--with-appdefaultdir=<pathname>],
+         [specify directory for app-defaults files (default is autodetected)]),
+       [appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"])
+AC_SUBST(appdefaultdir)
+
+XORG_MANPAGE_SECTIONS
+XORG_RELEASE_VERSION
+XORG_CHANGELOG
+
+AC_OUTPUT([Makefile])
diff --git a/xclipboard/depcomp b/xclipboard/depcomp
new file mode 100755 (executable)
index 0000000..df8eea7
--- /dev/null
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s,\\\\\\\\,/,g"
+   depmode=msvisualcpp
+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.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    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.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[     ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "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"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${
+              s/^ *//
+              s/ \\*$//
+              s/$/:/
+              p
+            }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # 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 mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $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 "X$1" != 'X--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 "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    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.
+    -arch)
+      eat=yes ;;
+    -*|$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 "X$1" != 'X--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.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::     \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # 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
+  ;;
+
+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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xclipboard/install-sh b/xclipboard/install-sh
new file mode 100755 (executable)
index 0000000..6781b98
--- /dev/null
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# 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.
+
+nl='
+'
+IFS=" ""       $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+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:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+       shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+       case $mode in
+         *' '* | *'    '* | *'
+'*       | *'*'* | *'?'* | *'['*)
+           echo "$0: invalid mode: $mode" >&2
+           exit 1;;
+       esac
+       shift;;
+
+    -o) chowncmd="$chownprog $2"
+       shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+       shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)        shift
+       break;;
+
+    -*)        echo "$0: invalid option: $1" >&2
+       exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # 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: $dst_arg: Is a directory" >&2
+       exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+       (dirname "$dst") 2>/dev/null ||
+       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+            X"$dst" : 'X\(//\)[^/]' \| \
+            X"$dst" : 'X\(//\)$' \| \
+            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+       echo X"$dst" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+       # Create intermediate dirs using mode 755 as modified by the umask.
+       # This is like FreeBSD 'install' as of 1997-10-28.
+       umask=`umask`
+       case $stripcmd.$umask in
+         # Optimize common cases.
+         *[2367][2367]) mkdir_umask=$umask;;
+         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+         *[0-7])
+           mkdir_umask=`expr $umask + 22 \
+             - $umask % 100 % 40 + $umask % 20 \
+             - $umask % 10 % 4 + $umask % 2
+           `;;
+         *) mkdir_umask=$umask,go-w;;
+       esac
+
+       # With -d, create the new directory with the user-specified mode.
+       # Otherwise, rely on $mkdir_umask.
+       if test -n "$dir_arg"; then
+         mkdir_mode=-m$mode
+       else
+         mkdir_mode=
+       fi
+
+       posix_mkdir=false
+       case $umask in
+         *[123567][0-7][0-7])
+           # POSIX mkdir -p sets u+wx bits regardless of umask, which
+           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+           ;;
+         *)
+           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+           if (umask $mkdir_umask &&
+               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+           then
+             if test -z "$dir_arg" || {
+                  # Check for POSIX incompatibilities with -m.
+                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                  # other-writeable bit of parent directory when it shouldn't.
+                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                  case $ls_ld_tmpdir in
+                    d????-?r-*) different_mode=700;;
+                    d????-?--*) different_mode=755;;
+                    *) false;;
+                  esac &&
+                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                  }
+                }
+             then posix_mkdir=:
+             fi
+             rmdir "$tmpdir/d" "$tmpdir"
+           else
+             # Remove any dirs left behind by ancient mkdir implementations.
+             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+           fi
+           trap '' 0;;
+       esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+       umask $mkdir_umask &&
+       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+       /*) prefix='/';;
+       -*) prefix='./';;
+       *)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+       test -z "$d" && continue
+
+       prefix=$prefix$d
+       if test -d "$prefix"; then
+         prefixes=
+       else
+         if $posix_mkdir; then
+           (umask=$mkdir_umask &&
+            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+           # Don't fail if two instances are running concurrently.
+           test -d "$prefix" || exit 1
+         else
+           case $prefix in
+             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+             *) qprefix=$prefix;;
+           esac
+           prefixes="$prefixes '$qprefix'"
+         fi
+       fi
+       prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+       # Don't fail if two instances are running concurrently.
+       (umask $mkdir_umask &&
+        eval "\$doit_exec \$mkdirprog $prefixes") ||
+         test -d "$dstdir" || exit 1
+       obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # 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
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"    2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+       # Now remove or move aside any old file at destination location.
+       # We try this two ways since rm can't unlink itself on some
+       # systems and the destination file might be busy for other
+       # reasons.  In this case, the final cleanup might fail but the new
+       # file should still install successfully.
+       {
+         test ! -f "$dst" ||
+         $doit $rmcmd -f "$dst" 2>/dev/null ||
+         { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+           { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+         } ||
+         { echo "$0: cannot unlink or rename $dst" >&2
+           (exit 1); exit 1
+         }
+       } &&
+
+       # Now rename the file to the real destination.
+       $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xclipboard/missing b/xclipboard/missing
new file mode 100755 (executable)
index 0000000..28055d2
--- /dev/null
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# 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=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+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'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  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]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
+# 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).  This is about non-GNU programs, so use $1 not
+# $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 $program 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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if test ! -f y.tab.h; then
+       echo >y.tab.h
+    fi
+    if test ! -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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if test ! -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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit $?
+    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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+       /^@setfilename/{
+         s/.* \([^ ]*\) *$/\1/
+         p
+         q
+       }' $infile`
+      # ... 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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xclipboard/xclipboard.c b/xclipboard/xclipboard.c
new file mode 100644 (file)
index 0000000..77494cd
--- /dev/null
@@ -0,0 +1,757 @@
+/*
+ * $Xorg: xclipboard.c,v 1.4 2001/02/09 02:05:38 xorgcvs 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.
+ * *
+ * Author:  Ralph Swick, DEC/Project Athena
+ * Updated for R4:  Chris D. Peterson,  MIT X Consortium.
+ * Reauthored by: Keith Packard, MIT X Consortium.
+ * UTF-8 and CTEXT support: Stanislav Maslovski <stanislav.maslovski@gmail.com>
+ */
+/* $XFree86: xc/programs/xclipboard/xclipboard.c,v 1.8tsi Exp $ */
+
+#include <stdio.h>
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Xatom.h>
+
+#include <X11/Xmu/Atoms.h>
+#include <X11/Xmu/StdSel.h>
+
+#include <X11/Shell.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Dialog.h>
+#include <X11/Xaw/Cardinals.h>
+#include <X11/IntrinsicP.h>
+#include <X11/Xaw/TextP.h>
+#include <X11/Xfuncs.h>
+
+#ifdef XKB
+#include <X11/extensions/XKBbells.h>
+#endif
+
+#include <stdlib.h>
+
+#define Command commandWidgetClass
+#define Label  labelWidgetClass
+#define Text    asciiTextWidgetClass
+
+#define INFINITY 10000000      /* pretty big, huh? */
+
+typedef struct _Clip {
+    struct _Clip    *next, *prev;
+    char           *clip;
+    char           *filename;
+    int                    avail;
+} ClipRec, *ClipPtr;
+
+static Atom wm_delete_window;
+static Atom wm_protocols;
+
+static void EraseTextWidget ( void );
+static void NewCurrentClipContents ( char *data, int len );
+
+static String fallback_resources[] = {
+    "*international: true",
+    NULL
+};
+
+static long 
+TextLength(Widget w)
+{
+    return XawTextSourceScan (XawTextGetSource (w),
+                             (XawTextPosition) 0,
+                             XawstAll, XawsdRight, 1, TRUE);
+}
+
+static void
+SaveClip(Widget w, ClipPtr clip)
+{
+    Arg            args[1];
+    char    *data;
+    int            len;
+    Widget  source;
+
+    source = XawTextGetSource (w);
+    XtSetArg (args[0], XtNstring, &data);
+    XtGetValues (source, args, 1);
+    len = strlen (data);
+    if (len >= clip->avail)
+    {
+       if (clip->clip)
+           free (clip->clip);
+       clip->clip = malloc (len + 1);
+       if (!clip->clip)
+           clip->avail = 0;
+       else
+           clip->avail = len + 1;
+    }
+    if (clip->avail)
+    {
+       strcpy (clip->clip, data);
+    }
+}
+
+static void
+RestoreClip(Widget w, ClipPtr clip)
+{
+    Arg            args[1];
+    Widget  source;
+
+    source = XawTextGetSource (w);
+    XtSetArg (args[0], XtNstring, clip->clip);
+    XtSetValues (source, args, 1);
+}
+
+/*ARGSUSED*/
+static ClipPtr 
+NewClip(Widget w, ClipPtr old)
+{
+    ClipPtr newClip;
+
+    newClip = (ClipPtr) malloc (sizeof (ClipRec));
+    if (!newClip)
+       return newClip;
+    newClip->clip = NULL;
+    newClip->avail = 0;
+    newClip->prev = old;
+    newClip->next = NULL;
+    newClip->filename = NULL;
+    if (old)
+    {
+       newClip->next = old->next;
+       old->next = newClip;
+    }
+    return newClip;
+}
+
+/*ARGSUSED*/
+static void
+DeleteClip(Widget w, ClipPtr clip)
+{
+    if (clip->prev)
+       clip->prev->next = clip->next;
+    if (clip->next)
+       clip->next->prev = clip->prev;
+    if (clip->clip)
+       free (clip->clip);
+    free ((char *) clip);
+}
+
+static ClipPtr currentClip;
+static Widget  top;
+static Widget  text, nextButton, prevButton, indexLabel;
+static Widget  fileDialog, fileDialogShell;
+static Widget  failDialog, failDialogShell;
+
+static int
+IndexCurrentClip (void)
+{
+    int        i = 0;
+    ClipPtr clip;
+
+    for (clip = currentClip; clip; clip = clip->prev)
+       i++;
+    return i;
+}
+
+static void
+set_button_state (void)
+{
+    Boolean prevvalid, nextvalid;
+    Arg arg;
+    char labelString[10];
+
+    prevvalid = currentClip->prev != NULL;
+    nextvalid = currentClip->next != NULL;
+    XtSetArg (arg, XtNsensitive, prevvalid);
+    XtSetValues (prevButton, &arg, ONE);
+    XtSetArg (arg, XtNsensitive, nextvalid);
+    XtSetValues (nextButton, &arg, ONE);
+    sprintf (labelString, "%d", IndexCurrentClip ());
+    XtSetArg (arg, XtNlabel, labelString);
+    XtSetValues (indexLabel, &arg, ONE);
+}
+
+/* ARGSUSED */
+static void
+NextCurrentClip(Widget w, XEvent *ev, String *parms, Cardinal *np)
+{
+    if (currentClip->next)
+    {
+       SaveClip (text, currentClip);
+       currentClip = currentClip->next;
+       RestoreClip (text, currentClip);
+       set_button_state ();
+    }
+}
+
+/* ARGSUSED */
+static void
+PrevCurrentClip(Widget w, XEvent *ev, String *parms, Cardinal *np)
+{
+    if (currentClip->prev)
+    {
+       SaveClip (text, currentClip);
+       currentClip = currentClip->prev;
+       RestoreClip (text, currentClip);
+       set_button_state ();
+    }
+}
+
+/* ARGSUSED */
+static void
+DeleteCurrentClip(Widget w, XEvent *ev, String *parms, Cardinal *np)
+{
+    ClipPtr newCurrent;
+
+    if (currentClip->prev)
+       newCurrent = currentClip->prev;
+    else
+       newCurrent = currentClip->next;
+    if (newCurrent)
+    {
+       DeleteClip (text, currentClip);
+       currentClip = newCurrent;
+       RestoreClip (text, currentClip);
+    }
+    else
+       EraseTextWidget ();
+    set_button_state ();
+}
+
+/* ARGSUSED */
+static void
+Quit(Widget w, XEvent *ev, String *parms, Cardinal *np)
+{
+    XtCloseDisplay  (XtDisplay (text));
+    exit (0);
+}
+
+static void
+CenterWidgetAtPoint(Widget w, int x, int y)
+{
+    Arg        args[2];
+    Dimension  width, height;
+
+    XtSetArg(args[0], XtNwidth, &width);
+    XtSetArg(args[1], XtNheight, &height);
+    XtGetValues (w, args, 2);
+    x = x - (int) width / 2;
+    y = y - (int) height / 2;
+    if (x < 0)
+       x = 0;
+    else {
+       int scr_width = WidthOfScreen (XtScreen(w));
+       if (x + (int)width > scr_width)
+           x = scr_width - width;
+    }
+    if (y < 0)
+       y = 0;
+    else {
+       int scr_height = HeightOfScreen (XtScreen(w));
+       if (y + (int)height > scr_height)
+           y = scr_height - height;
+    }
+    XtSetArg(args[0], XtNx, x);
+    XtSetArg(args[1], XtNy, y);
+    XtSetValues (w, args, 2);
+}
+
+static void
+CenterWidgetOnEvent(Widget w, XEvent *e)
+{
+    CenterWidgetAtPoint (w, e->xbutton.x_root, e->xbutton.y_root);
+}
+
+static void
+CenterWidgetOnWidget(Widget w, Widget wT)
+{
+    Position   rootX, rootY;
+    Dimension  width, height;
+    Arg                args[2];
+
+    XtSetArg (args[0], XtNwidth, &width);
+    XtSetArg (args[1], XtNheight, &height);
+    XtGetValues (wT, args, 2);
+    XtTranslateCoords (wT, (Position) width/2, (Position) height/2, &rootX, &rootY);
+    CenterWidgetAtPoint (w, (int) rootX, (int) rootY);
+}
+
+/*ARGSUSED*/
+static void
+SaveToFile(Widget w, XEvent *e, String *argv, Cardinal *argc)
+{
+    Arg            args[1];
+    char    *filename;
+
+    filename = "clipboard";
+    if (currentClip->filename)
+       filename = currentClip->filename;
+    XtSetArg(args[0], XtNvalue, filename);
+    XtSetValues (fileDialog, args, 1);
+    CenterWidgetOnEvent (fileDialogShell, e);
+    XtPopup (fileDialogShell, XtGrabNone);
+}
+
+/*ARGSUSED*/
+static void
+AcceptSaveFile(Widget w, XEvent *e, String *argv, Cardinal *argc)
+{
+    char    *filename;
+    Boolean success;
+    Arg            args[1];
+
+    filename = XawDialogGetValueString (fileDialog);
+    success = XawAsciiSaveAsFile (XawTextGetSource (text), filename);
+    XtPopdown (fileDialogShell);
+    if (!success)
+    {
+       char    failMessage[1024];
+
+       sprintf (failMessage, "Can't open file \"%s\"", filename);
+       XtSetArg (args[0], XtNlabel, failMessage);
+       XtSetValues (failDialog, args, 1);
+       CenterWidgetOnEvent (failDialogShell, e);
+       XtPopup (failDialogShell, XtGrabNone);
+    }
+    else
+    {
+       if (currentClip->filename)
+           free (currentClip->filename);
+       currentClip->filename = malloc (strlen (filename) + 1);
+       if (currentClip->filename)
+           strcpy (currentClip->filename, filename);
+    }
+}
+
+/* ARGSUSED */
+static void
+CancelSaveFile(Widget w, XEvent *ev, String *parms, Cardinal *np)
+{
+    XtPopdown (fileDialogShell);
+}
+
+/* ARGSUSED */
+static void
+FailContinue(Widget w, XEvent *ev, String *parms, Cardinal *np)
+{
+    XtPopdown (failDialogShell);
+}
+
+/*ARGSUSED*/
+static void 
+WMProtocols(Widget w, XEvent *ev, String *params, Cardinal *n)
+{
+    if (ev->type == ClientMessage &&
+       ev->xclient.message_type == wm_protocols &&
+       ev->xclient.data.l[0] == (long) wm_delete_window) {
+       while (w && !XtIsShell(w))
+           w = XtParent(w);
+       if (w == top)
+           Quit(w, ev, params, n);
+       else if (w == fileDialogShell)
+           CancelSaveFile(w, ev, params, n);
+       else if (w == failDialogShell)
+           FailContinue(w, ev, params, n);
+    }
+}
+
+/* ARGUSED */
+static void
+NewCurrentClip(Widget w, XEvent *ev, String *parms, Cardinal *np)
+{
+    NewCurrentClipContents ("", 0);
+}
+
+static void
+NewCurrentClipContents(char *data, int len)
+{
+    XawTextBlock textBlock;
+
+    SaveClip (text, currentClip);
+
+    /* append new clips at the end */
+    while (currentClip && currentClip->next)
+       currentClip = currentClip->next;
+    /* any trailing clips with no text get overwritten */
+    if (strlen (currentClip->clip) != 0)
+       currentClip = NewClip (text, currentClip);
+    
+    textBlock.ptr = data;
+    textBlock.firstPos = 0;
+    textBlock.length = len;
+    textBlock.format = FMT8BIT;
+    if (XawTextReplace(text, 0, TextLength (text), &textBlock)) {
+#ifdef XKB
+       XkbStdBell(XtDisplay(text), XtWindow(text), 0, XkbBI_Info);
+#else
+       XBell( XtDisplay(text), 0);
+#endif
+    }
+    set_button_state ();
+}
+
+static void
+EraseTextWidget(void)
+{
+    XawTextBlock block;
+
+    block.ptr = "";
+    block.length = 0;
+    block.firstPos = 0;
+    block.format = FMT8BIT;
+
+    XawTextReplace(text, 0, INFINITY, &block);
+    /* If this fails, too bad. */
+}
+
+
+static XtActionsRec xclipboard_actions[] = {
+    { "NewClip",       NewCurrentClip }, 
+    { "NextClip",      NextCurrentClip },
+    { "PrevClip",      PrevCurrentClip },
+    { "DeleteClip",    DeleteCurrentClip },
+    { "Save",          SaveToFile },
+    { "AcceptSave",    AcceptSaveFile },
+    { "CancelSave",    CancelSaveFile },
+    { "FailContinue",  FailContinue },
+    { "Quit",          Quit },
+    { "WMProtocols",   WMProtocols }
+};
+
+static XrmOptionDescRec table[] = {
+    {"-w",         "wrap",             XrmoptionNoArg,  "on"},
+/*    {"-nw",      "wrap",             XrmoptionNoArg,  "False"} */
+};
+
+static Boolean ConvertSelection ( Widget w, Atom *selection, Atom *target, 
+                                 Atom *type, XtPointer *value, 
+                                 unsigned long *length, int *format );
+static void LoseSelection ( Widget w, Atom *selection );
+
+static Atom    ManagerAtom, ClipboardAtom;
+
+/*ARGSUSED*/
+static void 
+InsertClipboard(Widget w, XtPointer client_data, Atom *selection, 
+               Atom *type, XtPointer value, unsigned long *length, 
+               int *format)
+{
+    Display *d = XtDisplay(w);
+    Atom target = (Atom)client_data;
+    Boolean convert_failed = (*type == XT_CONVERT_FAIL);
+
+    if (!convert_failed)
+    {
+       char **list;
+       int i, ret, count;
+
+       XTextProperty prop;
+       prop.value = value;
+       prop.nitems = *length;
+       prop.format = *format;
+       prop.encoding = *type;
+       ret = XmbTextPropertyToTextList(d, &prop, &list, &count);
+       if (ret >= Success)
+       {
+           /* manuals say something about multiple strings in a disjoint
+           text selection (?), it should be harmless to get them all */
+           for (i = 0; i < count; i++)
+               NewCurrentClipContents(list[i], strlen(list[i]));
+           XFreeStringList(list);
+       } else
+           convert_failed = True;
+       XFree(value);
+    }
+
+    if (convert_failed) {
+       /* if UTF8_STRING failed try COMPOUND_TEXT */
+       if (target == XA_UTF8_STRING(d))
+       {
+           XtGetSelectionValue(w, *selection, XA_COMPOUND_TEXT(d),
+                               InsertClipboard,
+                               (XtPointer)(XA_COMPOUND_TEXT(d)),
+                               CurrentTime);
+           return;
+       }
+       /* if COMPOUND_TEXT failed try STRING */
+       else if (target == XA_COMPOUND_TEXT(d))
+       {
+           XtGetSelectionValue(w, *selection, XA_STRING,
+                               InsertClipboard,
+                               NULL,
+                               CurrentTime);
+           return;
+       }
+       /* all conversions failed */
+       else
+       {
+           Arg arg;
+           XtSetArg (arg, XtNlabel, "CLIPBOARD selection conversion failed");
+           XtSetValues (failDialog, &arg, 1);
+           CenterWidgetOnWidget (failDialogShell, text);
+           XtPopup (failDialogShell, XtGrabNone);
+#ifdef XKB
+           XkbStdBell (d, XtWindow(w), 0, XkbBI_MinorError);
+#else
+           XBell (d, 0);
+#endif
+       }
+    }
+    
+    XtOwnSelection(top, ClipboardAtom, CurrentTime,
+                  ConvertSelection, LoseSelection, NULL);
+}
+
+static Boolean 
+ConvertSelection(Widget w, Atom *selection, Atom *target,
+                Atom *type, XtPointer *value, unsigned long *length, 
+                int *format)
+{
+    Display* d = XtDisplay(w);
+    XSelectionRequestEvent* req =
+       XtGetSelectionRequest(w, *selection, (XtRequestId)NULL);
+
+    if (*target == XA_TARGETS(d)) {
+       Atom* targetP;
+       Atom* std_targets;
+       unsigned long std_length;
+       XmuConvertStandardSelection(w, req->time, selection, target, type,
+                                   (XPointer*)&std_targets, &std_length,
+                                   format);
+       *value = XtMalloc(sizeof(Atom)*(std_length + 7));
+       targetP = *(Atom**)value;
+       *targetP++ = XA_STRING;
+       *targetP++ = XA_TEXT(d);
+       *targetP++ = XA_UTF8_STRING(d);
+       *targetP++ = XA_COMPOUND_TEXT(d);
+       *targetP++ = XA_LENGTH(d);
+       *targetP++ = XA_LIST_LENGTH(d);
+       *targetP++ = XA_CHARACTER_POSITION(d);
+       *length = std_length + (targetP - (*(Atom **) value));
+       memmove( (char*)targetP, (char*)std_targets, sizeof(Atom)*std_length);
+       XtFree((char*)std_targets);
+       *type = XA_ATOM;
+       *format = 32;
+       return True;
+    }
+
+    if (*target == XA_LIST_LENGTH(d) ||
+       *target == XA_LENGTH(d))
+    {
+       long * temp;
+       
+       temp = (long *) XtMalloc(sizeof(long));
+       if (*target == XA_LIST_LENGTH(d))
+         *temp = 1L;
+       else                    /* *target == XA_LENGTH(d) */
+         *temp = (long) TextLength (text);
+       
+       *value = (XPointer) temp;
+       *type = XA_INTEGER;
+       *length = 1L;
+       *format = 32;
+       return True;
+    }
+    
+    if (*target == XA_CHARACTER_POSITION(d))
+    {
+       long * temp;
+       
+       temp = (long *) XtMalloc(2 * sizeof(long));
+       temp[0] = (long) 0;
+       temp[1] = TextLength (text);
+       *value = (XPointer) temp;
+       *type = XA_SPAN(d);
+       *length = 2L;
+       *format = 32;
+       return True;
+    }
+    
+    if (*target == XA_STRING ||
+       *target == XA_TEXT(d) ||
+       *target == XA_UTF8_STRING(d) ||
+       *target == XA_COMPOUND_TEXT(d))
+    {
+       Arg args[1];
+       Widget source;
+       XTextProperty prop;
+       int ret, style = XStdICCTextStyle; /* a safe default for TEXT */
+       char *data;
+
+       source = XawTextGetSource (text);
+       XtSetArg (args[0], XtNstring, &data);
+       XtGetValues (source, args, 1);
+
+       if (*target == XA_UTF8_STRING(d))
+           style = XUTF8StringStyle;
+       else if (*target == XA_COMPOUND_TEXT(d))
+           style = XCompoundTextStyle;
+       else if (*target == XA_STRING)
+           style = XStringStyle;
+
+       ret = XmbTextListToTextProperty (d, &data, 1, style, &prop);
+       if (ret >= Success) {
+           *length = prop.nitems;
+           *value = prop.value;
+           *type = prop.encoding;
+           *format = prop.format;
+           return True;
+       } else
+           return False;
+    }
+
+    if (XmuConvertStandardSelection(w, req->time, selection, target, type,
+                                   (XPointer *) value, length, format))
+       return True;
+
+    return False;
+}
+
+static void 
+LoseSelection(Widget w, Atom *selection)
+{
+    Display *d = XtDisplay(w);
+    XtGetSelectionValue(w, *selection, XA_UTF8_STRING(d), InsertClipboard,
+                       (XtPointer)(XA_UTF8_STRING(d)), CurrentTime);
+}
+
+/*ARGSUSED*/
+static Boolean 
+RefuseSelection(Widget w, Atom *selection, Atom *target,
+               Atom *type, XtPointer *value, unsigned long *length, 
+               int *format)
+{
+    return False;
+}
+
+/*ARGSUSED*/
+static void 
+LoseManager(Widget w, Atom *selection)
+{
+    XtError("another clipboard has taken over control\n");
+}
+
+typedef struct {
+  Boolean wrap;
+} ResourceData, *ResourceDataPtr;
+
+static ResourceData userOptions;
+
+#define Offset(field) XtOffsetOf(ResourceData, field)
+
+static XtResource resources[] = {
+  {"wrap", "Wrap", XtRBoolean, sizeof(Boolean),
+     Offset(wrap), XtRImmediate, (XtPointer)False}
+};
+
+#undef Offset
+
+int
+main(int argc, char *argv[])
+{
+    Arg args[4];
+    Cardinal n;
+    XtAppContext xtcontext;
+    Widget parent;
+
+    XtSetLanguageProc(NULL, NULL, NULL);
+
+    top = XtAppInitialize( &xtcontext, "XClipboard", table, XtNumber(table),
+                         &argc, argv, fallback_resources, NULL, 0);
+
+    XtGetApplicationResources(top, (XtPointer)&userOptions, resources, 
+                             XtNumber(resources), NULL, 0);
+
+    XtAppAddActions (xtcontext,
+                    xclipboard_actions, XtNumber (xclipboard_actions));
+    /* CLIPBOARD_MANAGER is a non-standard mechanism */
+    ManagerAtom = XInternAtom(XtDisplay(top), "CLIPBOARD_MANAGER", False);
+    ClipboardAtom = XA_CLIPBOARD(XtDisplay(top));
+    if (XGetSelectionOwner(XtDisplay(top), ManagerAtom))
+       XtError("another clipboard is already running\n");
+
+    parent = XtCreateManagedWidget("form", formWidgetClass, top, NULL, ZERO);
+    (void) XtCreateManagedWidget("quit", Command, parent, NULL, ZERO);
+    (void) XtCreateManagedWidget("delete", Command, parent, NULL, ZERO);
+    (void) XtCreateManagedWidget("new", Command, parent, NULL, ZERO);
+    (void) XtCreateManagedWidget("save", Command, parent, NULL, ZERO);
+    nextButton = XtCreateManagedWidget("next", Command, parent, NULL, ZERO);
+    prevButton = XtCreateManagedWidget("prev", Command, parent, NULL, ZERO);
+    indexLabel = XtCreateManagedWidget("index", Label, parent, NULL, ZERO);
+
+    n=0;
+    XtSetArg(args[n], XtNtype, XawAsciiString); n++;
+    XtSetArg(args[n], XtNeditType, XawtextEdit); n++;
+    if (userOptions.wrap) {
+       XtSetArg(args[n], XtNwrap, XawtextWrapWord); n++;
+       XtSetArg(args[n], XtNscrollHorizontal, False); n++;
+    }
+
+    text = XtCreateManagedWidget( "text", Text, parent, args, n);
+    
+    currentClip = NewClip (text, (ClipPtr) 0);
+
+    set_button_state ();
+
+    fileDialogShell = XtCreatePopupShell("fileDialogShell",
+                                        transientShellWidgetClass,
+                                        top, NULL, ZERO);
+    fileDialog = XtCreateManagedWidget ("fileDialog", dialogWidgetClass,
+                                       fileDialogShell, NULL, ZERO);
+    XawDialogAddButton(fileDialog, "accept", NULL, NULL);
+    XawDialogAddButton(fileDialog, "cancel", NULL, NULL);
+
+    failDialogShell = XtCreatePopupShell("failDialogShell",
+                                        transientShellWidgetClass,
+                                        top, NULL, ZERO);
+    failDialog = XtCreateManagedWidget ("failDialog", dialogWidgetClass,
+                                       failDialogShell, NULL, ZERO);
+    XawDialogAddButton (failDialog, "continue", NULL, NULL);
+
+    XtRealizeWidget(top);
+    XtRealizeWidget(fileDialogShell);
+    XtRealizeWidget(failDialogShell);
+    XtOwnSelection(top, ManagerAtom, CurrentTime,
+                  RefuseSelection, LoseManager, NULL);
+    if (XGetSelectionOwner (XtDisplay(top), ClipboardAtom)) {
+       LoseSelection (top, &ClipboardAtom);
+    } else {
+       XtOwnSelection(top, ClipboardAtom, CurrentTime,
+                      ConvertSelection, LoseSelection, NULL);
+    }
+    wm_delete_window = XInternAtom(XtDisplay(top), "WM_DELETE_WINDOW", False);
+    wm_protocols = XInternAtom(XtDisplay(top), "WM_PROTOCOLS", False);
+    (void) XSetWMProtocols(XtDisplay(top), XtWindow(top), &wm_delete_window,1);
+    (void) XSetWMProtocols(XtDisplay(top), XtWindow(fileDialogShell),
+                          &wm_delete_window,1);
+    (void) XSetWMProtocols(XtDisplay(top), XtWindow(failDialogShell),
+                          &wm_delete_window,1);
+    XtAppMainLoop(xtcontext);
+    exit(0);
+}
diff --git a/xclipboard/xclipboard.man b/xclipboard/xclipboard.man
new file mode 100644 (file)
index 0000000..83fa613
--- /dev/null
@@ -0,0 +1,153 @@
+.\" $Xorg: xclipboard.man,v 1.4 2001/02/09 02:05:39 xorgcvs Exp $
+.\" Copyright 1988, 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.
+.\"
+.\" $XFree86: xc/programs/xclipboard/xclipboard.man,v 1.8 2001/12/14 20:01:16 dawes Exp $
+.\"
+.TH XCLIPBOARD 1 __xorgversion__
+.SH NAME
+xclipboard \- X clipboard client
+.SH SYNOPSIS
+\fBxclipboard\fP [ \fI\-toolkitoption\fP ... ] [ \fB\-w\fP ]
+[ \fB\-nw\fP ]
+.SH DESCRIPTION
+The \fIxclipboard\fP program is used to collect and display text selections 
+that are sent to the CLIPBOARD by other clients.  It is typically used to
+save CLIPBOARD selections for later use.  It stores each CLIPBOARD selection
+as a separate string, each of which can be selected.  Each time CLIPBOARD
+is asserted by another application, \fIxclipboard\fP transfers the contents
+of that selection to a new buffer and displays it in the text window.
+Buffers are never automatically deleted, so you'll want to use the delete
+button to get rid of useless items.
+.PP
+Since \fIxclipboard\fP uses a Text Widget to display the contents of the
+clipboard, text sent to the CLIPBOARD may be re-selected for use in other
+applications.  \fIxclipboard\fP also responds to requests for the CLIPBOARD
+selection from other clients by sending the entire contents of the currently
+displayed buffer.
+.PP
+An \fIxclipboard\fP window has the following buttons across the top:
+.TP 8
+.I quit
+When this button is pressed, \fIxclipboard\fP exits.
+.TP 8
+.I delete
+When this button is pressed, the current buffer is deleted and the
+next one displayed.
+.TP 8
+.I new
+Creates a new buffer with no contents.  Useful in constructing a new
+CLIPBOARD selection by hand.
+.TP 8
+.I save
+Displays a File Save dialog box.
+Pressing the Accept button saves the currently
+displayed buffer to the file specified in the text field.
+.TP 8
+.I next
+Displays the next buffer in the list.
+.TP 8
+.I previous
+Displays the previous buffer.
+.SH OPTIONS
+The \fIxclipboard\fP program accepts all of the standard X Toolkit command 
+line options as well as the following:
+.TP 8
+.B \-w
+This option indicates that lines of text that are too long to be displayed on
+one line in the clipboard should wrap around to the following lines.
+.TP 8
+.B \-nw
+This option indicates that long lines of text should not wrap around.  This
+is the default behavior.
+.SH WIDGETS
+In order to specify resources, it is useful to know the hierarchy of
+the widgets which compose \fIxclipboard\fR.  In the notation below,
+indentation indicates hierarchical structure.  The widget class name
+is given first, followed by the widget instance name.
+.sp
+.nf
+.TA .5i 1.0i 1.5i
+.ta .5i 1.0i 1.5i
+XClipboard  xclipboard
+       Form  form
+               Command  Quit
+               Command  delete
+               Command  new
+               Command  Save
+               Command  next
+               Command  prev
+               Label  index
+               Text  text
+       TransientShell  fileDialogShell
+               Dialog  fileDialog
+                       Label  label
+                       Command  accept
+                       Command  cancel
+                       Text value
+       TransientShell  failDialogShell
+               Dialog  failDialog
+                       Label  label
+                       Command  continue
+.fi
+.sp
+.SH SENDING/RETRIEVING CLIPBOARD CONTENTS
+Text is copied to the clipboard whenever a client asserts ownership of the
+\fBCLIPBOARD\fP selection.  Text is copied from the clipboard whenever a
+client requests the contents of the \fBCLIPBOARD\fP selection.  Examples of
+event bindings that a user may wish to include in a resource configuration
+file to use the clipboard are:
+.sp
+.nf
+.TA .5i
+.ta .5i 3.0i
+*VT100.Translations: #override \\
+       <Btn3Up>:       select-end(CLIPBOARD) \\n\\
+       <Btn2Up>:       insert-selection(PRIMARY,CLIPBOARD) \\n\\
+       <Btn2Down>:     ignore ()
+
+.fi
+.sp
+.SH "SEE ALSO"
+X(__miscmansuffix__), xcutsel(1), xterm(1), individual client documentation for how to make a 
+selection and send it to the CLIPBOARD.
+.SH ENVIRONMENT
+.PP
+.TP 8
+.B DISPLAY
+to get the default host and display number.
+.TP 8
+.B XENVIRONMENT
+to get the name of a resource file that overrides the global resources
+stored in the RESOURCE_MANAGER property.
+.SH FILES
+.TP
+.I __apploaddir__/XClipboard
+specifies required resources
+.SH AUTHOR
+Ralph R. Swick, DEC/MIT Project Athena
+.br
+Chris D. Peterson, MIT X Consortium
+.br
+Keith Packard, MIT X Consortium
diff --git a/xclipboard/xcutsel.c b/xclipboard/xcutsel.c
new file mode 100644 (file)
index 0000000..609b83d
--- /dev/null
@@ -0,0 +1,313 @@
+/*
+ * $Xorg: xcutsel.c,v 1.4 2001/02/09 02:05:39 xorgcvs 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.
+ * *
+ * Author:  Ralph Swick, DEC/Project Athena
+ */
+/* $XFree86: xc/programs/xclipboard/xcutsel.c,v 1.7 2001/04/01 14:00:19 tsi Exp $ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Xatom.h>
+
+#include <X11/Xmu/Atoms.h>
+#include <X11/Xmu/StdSel.h>
+
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Box.h>
+#include <X11/Xaw/Cardinals.h>
+#include <X11/Xfuncs.h>
+
+#ifdef XKB
+#include <X11/extensions/XKBbells.h>
+#endif
+
+static XrmOptionDescRec optionDesc[] = {
+    {"-selection", "selection",        XrmoptionSepArg, NULL},
+    {"-select",    "selection",        XrmoptionSepArg, NULL},
+    {"-sel",      "selection", XrmoptionSepArg, NULL},
+    {"-s",        "selection", XrmoptionSepArg, NULL},
+    {"-cutbuffer", "cutBuffer",        XrmoptionSepArg, NULL},
+};
+
+typedef struct {
+    String  selection_name;
+    int            buffer;
+    Atom    selection;
+    char*   value;
+    int     length;
+} OptionsRec;
+
+static OptionsRec options;
+
+#define Offset(field) XtOffsetOf(OptionsRec, field)
+
+static XtResource resources[] = {
+    {"selection", "Selection", XtRString, sizeof(String),
+       Offset(selection_name), XtRString, "PRIMARY"},
+    {"cutBuffer", "CutBuffer", XtRInt, sizeof(int),
+       Offset(buffer), XtRImmediate, (XtPointer)0},
+};
+
+#undef Offset
+
+typedef struct {
+    Widget button;
+    Boolean is_on;
+} ButtonState;
+
+static ButtonState state;
+
+static void
+Syntax(char *call)
+{
+    fprintf (stderr, "usage:  %s [-selection name] [-cutbuffer number]\n", 
+            call);
+    exit (1);
+}
+
+
+static void 
+StoreBuffer(Widget w, XtPointer client_data, Atom *selection, Atom *type, 
+           XtPointer value, unsigned long *length, int *format)
+{
+
+    if (*type == 0 || *type == XT_CONVERT_FAIL || *length == 0) {
+#ifdef XKB
+       XkbStdBell( XtDisplay(w), XtWindow(w), 0, XkbBI_MinorError );
+#else
+       XBell( XtDisplay(w), 0 );
+#endif
+       return;
+    }
+
+    XStoreBuffer( XtDisplay(w), (char*)value, (int)(*length),
+                 options.buffer );
+   
+    XtFree(value);
+}
+
+
+static Boolean 
+ConvertSelection(Widget w, Atom *selection, Atom *target,
+                Atom *type, XtPointer *value, unsigned long *length, 
+                int *format)
+{
+    Display* d = XtDisplay(w);
+    XSelectionRequestEvent* req =
+       XtGetSelectionRequest(w, *selection, (XtRequestId)NULL);
+       
+    if (*target == XA_TARGETS(d)) {
+       Atom* targetP;
+       Atom* std_targets;
+       unsigned long std_length;
+       XmuConvertStandardSelection(w, req->time, selection, target, type,
+                                   (XPointer*)&std_targets, &std_length,
+                                   format);
+       *value = XtMalloc(sizeof(Atom)*(std_length + 4));
+       targetP = *(Atom**)value;
+       *length = std_length + 4;
+       *targetP++ = XA_STRING;
+       *targetP++ = XA_TEXT(d);
+       *targetP++ = XA_LENGTH(d);
+       *targetP++ = XA_LIST_LENGTH(d);
+/*
+       *targetP++ = XA_CHARACTER_POSITION(d);
+*/
+       memmove( (char*)targetP, (char*)std_targets, sizeof(Atom)*std_length);
+       XtFree((char*)std_targets);
+       *type = XA_ATOM;
+       *format = 32;
+       return True;
+    }
+    if (*target == XA_STRING || *target == XA_TEXT(d)) {
+       *type = XA_STRING;
+       *value = XtMalloc((Cardinal) options.length);
+       memmove( (char *) *value, options.value, options.length);
+       *length = options.length;
+       *format = 8;
+       return True;
+    }
+    if (*target == XA_LIST_LENGTH(d)) {
+       long *temp = (long *) XtMalloc (sizeof(long));
+       *temp = 1L;
+       *value = (XtPointer) temp;
+       *type = XA_INTEGER;
+       *length = 1;
+       *format = 32;
+       return True;
+    }
+    if (*target == XA_LENGTH(d)) {
+       long *temp = (long *) XtMalloc (sizeof(long));
+       *temp = options.length;
+       *value = (XtPointer) temp;
+       *type = XA_INTEGER;
+       *length = 1;
+       *format = 32;
+       return True;
+    }
+#ifdef notdef
+    if (*target == XA_CHARACTER_POSITION(d)) {
+       long *temp = (long *) XtMalloc (2 * sizeof(long));
+       temp[0] = ctx->text.s.left + 1;
+       temp[1] = ctx->text.s.right;
+       *value = (XtPointer) temp;
+       *type = XA_SPAN(d);
+       *length = 2;
+       *format = 32;
+       return True;
+    }
+#endif /* notdef */
+    if (XmuConvertStandardSelection(w, req->time, selection, target, type,
+                                   (XPointer *)value, length, format))
+       return True;
+
+    /* else */
+    return False;
+}
+
+
+static void 
+SetButton(ButtonState *state, Boolean on)
+{
+    if (state->is_on != on) {
+       Arg args[2];
+       Pixel fg, bg;
+       XtSetArg( args[0], XtNforeground, &fg );
+       XtSetArg( args[1], XtNbackground, &bg );
+       XtGetValues( state->button, args, TWO );
+       args[0].value = (XtArgVal)bg;
+       args[1].value = (XtArgVal)fg;
+       XtSetValues( state->button, args, TWO );
+       state->is_on = on;
+    }
+}
+
+
+static void 
+LoseSelection(Widget w, Atom *selection)
+{
+    if (options.value) {
+       XFree( options.value );
+       options.value = NULL;
+    }
+    SetButton(&state, False);
+}
+
+
+/* ARGSUSED */
+static void 
+Quit(Widget w, XtPointer closure, XtPointer callData)
+{
+    XtCloseDisplay( XtDisplay(w) );
+    exit(0);
+}
+
+
+/* ARGSUSED */
+static void 
+GetSelection(Widget w, XtPointer closure, XtPointer callData)
+{
+    XtGetSelectionValue(w, options.selection, XA_STRING,
+                       StoreBuffer, NULL,
+                       XtLastTimestampProcessed(XtDisplay(w)));
+}
+
+
+/* ARGSUSED */
+static void 
+GetBuffer(Widget w, XtPointer closure, XtPointer callData)
+{
+    if (options.value) XFree( options.value );
+    options.value =
+       XFetchBuffer(XtDisplay(w), &options.length, options.buffer);
+    if (options.value != NULL) {
+       if (XtOwnSelection(w, options.selection,
+                          XtLastTimestampProcessed(XtDisplay(w)),
+                          ConvertSelection, LoseSelection, NULL))
+           SetButton((ButtonState*)closure, True);
+    }
+}
+
+
+int 
+main(int argc, char *argv[])
+{
+    char label[100];
+    Widget box, button;
+    XtAppContext appcon;
+    Widget shell;
+    XrmDatabase rdb;
+
+    XtSetLanguageProc(NULL, NULL, NULL);
+
+    shell =
+       XtAppInitialize( &appcon, "XCutsel", optionDesc, XtNumber(optionDesc),
+                        &argc, argv, NULL, NULL, 0 );
+    rdb = XtDatabase(XtDisplay(shell));
+
+    if (argc != 1) Syntax(argv[0]);
+
+    XtGetApplicationResources( shell, (XtPointer)&options,
+                              resources, XtNumber(resources),
+                              NULL, ZERO );
+
+    options.value = NULL;
+    XmuInternStrings( XtDisplay(shell), &options.selection_name, ONE,
+                     &options.selection );
+
+    box = XtCreateManagedWidget("box", boxWidgetClass, shell, NULL, ZERO);
+
+    button =
+       XtCreateManagedWidget("quit", commandWidgetClass, box, NULL, ZERO);
+       XtAddCallback( button, XtNcallback, Quit, NULL );
+
+    /* %%% hack alert... */
+    sprintf(label, "*label:copy %s to %d",
+           options.selection_name,
+           options.buffer);
+    XrmPutLineResource( &rdb, label );
+
+    button =
+       XtCreateManagedWidget("sel-cut", commandWidgetClass, box, NULL, ZERO);
+       XtAddCallback( button, XtNcallback, GetSelection, NULL );
+
+    sprintf(label, "*label:copy %d to %s",
+           options.buffer,
+           options.selection_name);
+    XrmPutLineResource( &rdb, label );
+
+    button =
+       XtCreateManagedWidget("cut-sel", commandWidgetClass, box, NULL, ZERO);
+       XtAddCallback( button, XtNcallback, GetBuffer, (XtPointer)&state );
+       state.button = button;
+       state.is_on = False;
+   
+    XtRealizeWidget(shell);
+    XtAppMainLoop(appcon);
+    exit(0);
+}
diff --git a/xclipboard/xcutsel.man b/xclipboard/xcutsel.man
new file mode 100644 (file)
index 0000000..ac8a983
--- /dev/null
@@ -0,0 +1,108 @@
+.\" $Xorg: xcutsel.man,v 1.4 2001/02/09 02:05:39 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.
+.\"
+.\" $XFree86: xc/programs/xclipboard/xcutsel.man,v 1.7 2001/01/27 18:21:09 dawes Exp $
+.\"
+.TH XCUTSEL 1 __xorgversion__
+.SH NAME
+xcutsel - interchange between cut buffer and selection
+.SH SYNOPSIS
+\fBxcutsel\fP [ \fI-toolkitoption\fP ...] [-selection \fIselection\fP] [-cutbuffer \fInumber\fP]
+.SH DESCRIPTION
+The \fIxcutsel\fP program is used to copy the current selection into a
+cut buffer and to make a selection that contains the current contents of
+the cut buffer.  It acts as a bridge between applications that don't support
+selections and those that do.
+.PP
+By default, \fIxcutsel\fP will use the selection named PRIMARY and the cut
+buffer CUT_BUFFER0.  Either or both of these can be overridden by command
+line arguments or by resources.
+.PP
+An \fIxcutsel\fP window has the following buttons:
+.TP 8
+.I "    quit"
+When this button is pressed, \fIxcutsel\fP exits.  Any selections held by
+\fIxcutsel\fP are automatically released.
+.TP 8
+.I "    copy PRIMARY to 0"
+When this button is pressed, \fIxcutsel\fP copies the current selection into
+the cut buffer.
+.TP 8
+.I "    copy 0 to PRIMARY"
+When this button is pressed, \fIxcutsel\fP converts the current contents of
+the cut buffer into the selection.
+.PP
+The button labels reflect the selection and cutbuffer selected by
+command line options or through the resource database.
+.PP
+When the ``copy 0 to PRIMARY'' button is activated, the button will
+remain inverted as long as \fIxcutsel\fP remains the owner of the
+selection.  This serves to remind you which client owns the current
+selection.  Note that the value of the selection remains constant;
+if the cutbuffer is changed, you must again activate the copy button
+to retrieve the new value when desired.
+.SH OPTIONS
+.I Xcutsel
+accepts all of the standard X Toolkit command line options as well as the
+following:
+.TP 8
+.B \-selection \fIname\fP
+This option specifies the name of the selection to use.  The default is
+PRIMARY.  The only supported abbreviations for this option are ``-select'',
+``-sel'' and ``-s'', as the standard toolkit option ``-selectionTimeout'' has a
+similar name.
+.TP 8
+.B \-cutbuffer \fInumber\fP
+This option specifies the cut buffer to use.  The default is cut buffer 0.
+.SH X DEFAULTS
+This program accepts all of the standard X Toolkit resource names and classes
+as well as:
+.TP 8
+.B "selection (\fPclass\fB Selection)"
+This resource specifies the name of the selection to use.  The default is
+PRIMARY.
+.TP 8
+.B "cutBuffer (\fPclass\fB CutBuffer)"
+This resource specifies the number of the cut buffer to use.  The default is 0.
+.SH WIDGET NAMES
+The following instance names may be used when user configuration of the
+labels in them is desired:
+.TP 8
+.B "sel-cut (\fPclass\fB Command)"
+This is the ``copy SELECTION to BUFFER'' button.
+.TP 8
+.B "cut-sel (\fPclass\fB Command)"
+This is the ``copy BUFFER to SELECTION'' button.
+.TP 8
+.B "quit (\fPclass\fB Command)"
+This is the ``quit'' button.
+.SH "SEE ALSO"
+X(__miscmansuffix__), xclipboard(1), xterm(1), text widget documentation, individual client 
+documentation for how to make a selection.
+.SH BUGS
+There is no way to change the name of the selection or the number of the
+cut buffer while the program is running.
+.SH AUTHOR
+Ralph R. Swick, DEC/MIT Project Athena
diff --git a/xclock/AUTHORS b/xclock/AUTHORS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xclock/COPYING b/xclock/COPYING
new file mode 100644 (file)
index 0000000..af99eee
--- /dev/null
@@ -0,0 +1,78 @@
+Copyright 1987, 1988, 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 1987, 1988 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.
+
+    ------------------------------------------------------------
+
+Copyright 2004 Sun Microsystems, Inc.
+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. Neither the name of Sun Microsystems, Inc. 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 "AS IS," without a warranty of any kind.
+
+ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
+SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES OR
+LIABILITIES  SUFFERED BY LICENSEE AS A RESULT OF  OR RELATING TO USE,
+MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR ITS DERIVATIVES.
+IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE,
+PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
+INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE
+THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE
+SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
diff --git a/xclock/ChangeLog b/xclock/ChangeLog
new file mode 100644 (file)
index 0000000..bfe00f1
--- /dev/null
@@ -0,0 +1,432 @@
+commit 779dd2f2af9a65f96b741c2692d7055bf5970969
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Sep 21 21:05:16 2009 -0700
+
+    xclock 1.0.4
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit b88a85d9021d2e895205ecbe393786d989302cd8
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Sep 21 20:59:48 2009 -0700
+
+    Fill in COPYING file
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 1a1c157c7abccc03a37c26e63ad923fd7dfecc5c
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Sep 21 20:54:04 2009 -0700
+
+    Migrate to xorg macros 1.3 & XORG_DEFAULT_OPTIONS
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 8b1af8f1ef0d7cce970a05fe36b7e8e63aa18068
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Sep 21 20:51:06 2009 -0700
+
+    Trim trailing whitespaces
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit ce8173a20046c9c21ccfcea45daa0647905c1714
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Sep 21 20:47:35 2009 -0700
+
+    Add pointers to mailing list, bugzilla, wiki & git repo to README
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 82d76c4efcae92709aa07ec9e653f73076f43ebf
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Jan 13 16:26:42 2009 -0200
+
+    Ansification and compile warning fixes.
+    
+      This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects
+    make distcheck and all gcc 4.3 and sparse warnings.
+
+commit 48663cb8af72ea5e0528a341a7dc8865aa84fad2
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Wed Aug 20 10:32:49 2008 -0400
+
+    xaw8 is gone, use xaw7
+
+commit 2d43b9d1c3e3632176fccdb5017b6e196b05b37a
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Fri May 16 14:23:54 2008 +0200
+
+    $(builddir) is the current directory
+    
+    Apparently automake doesn't always export the builddir variable.
+    This fixes my previous commit.
+
+commit 7b16b32d15ea105a3ff77468cea8364193bbdf3c
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Sun Apr 20 19:46:18 2008 +0200
+
+    Fix build with builddir != srcdir
+
+commit 7a6eb7af07301afa6024368544174765d9df0088
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Thu Mar 27 20:07:39 2008 -0700
+
+    Build fix for file systems that are not case sensitive
+
+commit f149891aea012ace76e63a08fe5ad19a47d9cd52
+Author: Matthieu Herrb <matthieu@bluenote.herrb.net>
+Date:   Sat Mar 8 22:16:23 2008 +0100
+
+    Makefile.am: nuke RCS Id
+
+commit 8c6739ba1179337c7f8fa25680871e0813ef5181
+Author: vdb128 <vdb128@picaros.org>
+Date:   Thu Dec 20 16:08:28 2007 -0800
+
+    X.Org Bug 13537: bugs in UTF-8 handling and regularized tick updating
+    
+    X.Org Bugzilla #13537 <https://bugs.freedesktop.org/show_bug.cgi?id=13537>
+    Patch #12964 <https://bugs.freedesktop.org/attachment.cgi?id=12964&action=view>
+
+commit 870ebb6762f63c6587ee75aba50ee93257fa610b
+Author: Todd C. Miller <Todd.Miller@courtesan.com>
+Date:   Mon Oct 22 21:14:03 2007 +0200
+
+    Fix logic inversion in geometry computation in -norender -digital mode.
+
+commit 1ea56dd7d67cef80f364fafcf985fb4a6846109d
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Aug 6 15:37:11 2007 -0700
+
+    Version bump: 1.0.3
+
+commit 0c458e28ff7a3f85c0041ac0f01791853c6bdf28
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Aug 6 15:36:57 2007 -0700
+
+    Replace static changelog with dist-hook to generate from git log
+
+commit c94628bef06ea76be371eb0dc8b60bdf0e0009e9
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Aug 6 15:32:20 2007 -0700
+
+    Fix cast to clear sparse warning: Using plain integer as NULL pointer
+
+commit 6f845b1d5516864e143113ca074e98b7be194adb
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Aug 6 15:25:57 2007 -0700
+
+    Change xclock_CFLAGS to AM_CFLAGS to make automake-1.10 happier
+    
+    Clears warning message:
+    Makefile.am:28: compiling `Clock.c' with per-target flags requires `AM_PROG_CC_C_O' in `configure.ac'
+
+commit a450fbb0f93f8bcdaabfb623fe49ddbb12468287
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Wed Jun 13 14:45:51 2007 -0700
+
+    Man page: add missing options to synopsis section
+
+commit 8476e5fbddafc171903470000e86a68f66dc3958
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Wed Jun 13 14:37:39 2007 -0700
+
+    Don't segfault if unable to load a usable fontset
+
+commit 41503ac2d7c84502074b3b6528478fe017060ef7
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Jun 12 19:19:32 2007 -0700
+
+    Add pointer to Xft/fontconfig font name format to man page
+
+commit 300afc5784cec539a1a9d2babb9f73056aee52cd
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Jun 12 19:13:23 2007 -0700
+
+    X.Org Bug 10775: xclock does not set _NET_WM_PID
+    
+    X.Org Bugzilla #10775: <https://bugs.freedesktop.org/show_bug.cgi?id=10775>
+
+commit 861edc2009b8224d9acf77b9703a9fdb7d4903cc
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri May 18 13:57:47 2007 -0700
+
+    renamed: .cvsignore -> .gitignore
+
+commit 38e77edd7c3cf9a3f8895e92e46debd0467ecc68
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri May 18 13:57:15 2007 -0700
+
+    Make use of iconv() conditional on configure.ac finding it in libc or libiconv
+
+commit 4abb71337d740fdcca30f4f2f57b769b7f422c13
+Author: Osamu Sayama <osamu.sayama@sun.com>
+Date:   Fri May 18 13:27:56 2007 -0700
+
+    Sun bug 6518500: Use iconv() to convert other charsets to UTF8
+    
+    <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6518500>
+
+commit d335cefbbe5d23c410f8e8b7af0692559b649e67
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed Apr 26 23:37:10 2006 +0000
+
+    Bump to 1.0.2
+
+commit a5fd7d91172970d75b1aeaa729125dbbc56615f7
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Wed Mar 29 02:10:49 2006 +0000
+
+    Bug #6420 <https://bugs.freedesktop.org/show_bug.cgi?id=6420> Patch #5103
+        <https://bugs.freedesktop.org/attachment.cgi?id=5103> xclock code
+        contains wrong "ifdef RENDER" (Kirill Belokurov)
+
+commit 57647f74642e672bc7082aed84141b456659e464
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 21 02:29:48 2005 +0000
+
+    Update package version for X11R7 release.
+
+commit cf4d35d1fe4750a81e6842216bf69cbc2b0616aa
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Dec 19 16:22:42 2005 +0000
+
+    Stub COPYING files
+
+commit 21b8bde3c5d7c2d0c53a5abacc59ef0dad28b9cc
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:24:05 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+commit 9d2ba2917eea02a77d1e50d74f7449166067d7dd
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 7 16:17:59 2005 +0000
+
+    Change to use the app-defaults default dir configured in libXt.
+
+commit 2b26c5434f06ee68349b41f332ff46b21bafd557
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 6 22:48:19 2005 +0000
+
+    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit 5a833cc25b6913ae41bd2c0263cff2bc9b63f28d
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Dec 6 16:26:51 2005 +0000
+
+    Bugzilla #5251 <https://bugs.freedesktop.org/show_bug.cgi?id=5251> xclock
+        -digital only shows "20" (Egmont Koblinger)
+
+commit 78df2d5bdd53a2dd2febf18ce6c2c9d9e3e4f5f7
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Dec 3 05:49:18 2005 +0000
+
+    Update package version number for X11R7 RC3 release.
+
+commit b7954fdcf2ad3298ad2b514d9e5336a9d87c9f22
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Nov 28 22:01:40 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 c76fe7d3b795e61aff81672ea2ddd00fae1bd71e
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Mon Nov 21 10:34:58 2005 +0000
+
+    Another pass at .cvsignores for apps.
+
+commit 269b92bf81d7216e147ca9b95013da6bcfaf5c57
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Sun Nov 20 22:08:51 2005 +0000
+
+    Add/improve .cvsignore files for apps.
+
+commit 5b899caf3dd80e85e61d02796c87f2328f6083d4
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:47:52 2005 +0000
+
+    Update package version number for RC1 release.
+
+commit 9524650fad38958f6be53a65a809a77b4b0c3f12
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Oct 18 00:32:53 2005 +0000
+
+    Change default install dir for app-default files from
+        $(sysconfdir)/X11/app-defaults to $(libdir)/X11/app-defaults to match
+        the monolith & allow localization
+
+commit 648d403d9f57c10c4f6f8906eb365793adc34fcd
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Oct 17 23:56:21 2005 +0000
+
+    Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to
+        work better with BSD make
+
+commit 3a45db6788aa23de00379fa73acd9737c6f95ba8
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Fri Oct 14 00:25:43 2005 +0000
+
+    Use sed to fill in variables in man page
+
+commit 9be5366a9bd5b307fd046309ca500a5ad962a167
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Thu Oct 13 20:11:00 2005 +0000
+
+    Fix app-default files to install under the same names as in the monolith
+        instead of their short names used only for 14-character filename length
+        limited ancient filesystems
+
+commit 81149c1a3710d53869bb92f1e4175a479c4204d6
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Aug 1 20:25:29 2005 +0000
+
+    Install man pages to section 1 instead of section m (Patch from Donnie
+        Berkholz)
+
+commit e152093bd0a4b8e10282fcd7cbdefdf9204f1e32
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Jul 29 21:22:31 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 44223cac61092b5d53ecfcd3816dc3bf113b774d
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Jul 28 15:57:12 2005 +0000
+
+    Fix distcheck for remaining apps
+
+commit aec9ed75f66e67e9d9d69f04c40867577bcfdf21
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Jul 26 15:44:02 2005 +0000
+
+    Replace more GNU make-ism's with more portable macros
+
+commit ae8ef7b8f5bdd1c53e0f6cb1e1fb1e58333b27a6
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Sat Jul 23 16:04:41 2005 +0000
+
+    Get rid of DEP_{CFLAGS,LIBS}. This is what was intended, but had a bug in
+        rev 1.2
+
+commit 05bce260dae5db93c178061d411b46b06e0c5e11
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Sat Jul 23 15:57:38 2005 +0000
+
+    use the DEP_{CFLAGS,LIBS} that were computed in XCLOCK_{CFLAGS,LIBS}
+
+commit fe29c745207c2076cd711a23d1dbae033a192143
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed Jul 20 19:31:52 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 575ef4d780ef152a889ee475e4875923c5244589
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sat Jul 16 17:31:45 2005 +0000
+
+    Add #include "config.h" for modularization Accept autoconf HAVE_STRLCPY as
+        alias for HAS_STRLCAT
+
+commit a4bcc238c730ebadb8c3c67763771bfbefed0879
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sat Jul 16 17:16:05 2005 +0000
+
+    Fix app-defaults rule in Makefile.am to work with non-GNU make Add checks
+        for strlcat, xkb, xft2, render, xkb Add --with-* options for XKB &
+        Xft2/Render (enabled by default)
+
+commit 80d8b6affb2ee823cf18a368ab33535cb1cf1721
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Fri Jul 1 17:55:48 2005 +0000
+
+    Build system for xclock
+
+commit ca43036f8cdd456ebff29860fd514248b3699bcf
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sat Oct 30 20:33:44 2004 +0000
+
+    Add -d flag for compilers like the Sun C compilers that produce dependency
+        lists themselves. To use with the Sun compilers, add to host.def: #
+        define UseCCMakeDepend YES # define DependFlags -cc $(CC) -d -xM (Sun
+        bug id #4245688 - fix by Alan Coopersmith)
+    Add Solaris to the platforms on which mprotect is run to set execute
+        permissions when necessary. (Sun bug id #6175128 - fix by Alan
+        Coopersmith)
+    Internationalize digital output (Sun bug id #4119396 - fix by Steve
+        Swales), add -bgpixmap option to set XPM file as background (originally
+        from STSF project version of xclock by Alan Coopersmith)
+    xc/programs/xmodmap/handle.c,pf.c xmodmap was printing line numbers which
+        are one too low in error messages (Xorg bugzilla #1739, Sun bug id
+        4637857 - fix by Sam Lau)
+
+commit 3f3b1fbe531e0c1ab3b74396bf4e78db861c8bbc
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 19:54:39 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+commit 850f3f26301d2768b92d0d1de38e0cef467761c0
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:35:01 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit 4227756d219279272400b4ffc7e77ace44adc600
+Author: Egbert Eich <eich@suse.de>
+Date:   Wed Mar 3 12:12:55 2004 +0000
+
+    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit 61f5ea4644b373e3f8cc7c71d9f4d658707eff9a
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:36:16 2004 +0000
+
+    readding XFree86's cvs IDs
+
+commit fc5273bdfb2e6c21f305e9de872efa46b81c3910
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 09:23:58 2004 +0000
+
+    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit 5be867cc0e6745ddac1736441a0cc5e11dd6a523
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Jan 29 08:09:03 2004 +0000
+
+    Importing vendor version xf86-012804-2330 on Thu Jan 29 00:06:33 PST 2004
+
+commit fd1ae903363dc0a1de353a594ab3524f0abcb0e0
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:29:03 2003 +0000
+
+    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit c69802c0f421772f1b11e462e1b553e1638afc6f
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:29:03 2003 +0000
+
+    Initial revision
+
+commit f994ad01956aa98c99d6efd85df83fc59493c6ff
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:58 2003 +0000
+
+    XFree86 4.3.0.1
+
+commit 7fa20e0899cf53cbb6d386d0688127df8b6fb0c7
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 15:54:53 2003 +0000
+
+    R6.6 is the Xorg base-line
diff --git a/xclock/Clock.c b/xclock/Clock.c
new file mode 100644 (file)
index 0000000..cbb0e42
--- /dev/null
@@ -0,0 +1,2263 @@
+/* $Xorg: Clock.c,v 1.4 2001/02/09 02:05:39 xorgcvs Exp $ */
+/* $XdotOrg: xc/programs/xclock/Clock.c,v 1.3 2004/10/30 20:33:44 alanc Exp $ */
+
+/***********************************************************
+
+Copyright 1987, 1988, 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, 1988 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.
+
+******************************************************************/
+/*
+ * Copyright 2004 Sun Microsystems, Inc.
+ * 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. Neither the name of Sun Microsystems, Inc. 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 "AS IS," without a warranty of any kind.
+ *
+ * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
+ * SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES OR
+ * LIABILITIES  SUFFERED BY LICENSEE AS A RESULT OF  OR RELATING TO USE,
+ * MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR ITS DERIVATIVES.
+ * IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE,
+ * PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
+ * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE
+ * THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE
+ * SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * Authors:  I18N - Steve Swales - March 2000
+ *          bgpixmap - Alan Coopersmith (as part of STSF project) - Sept. 2001
+ */
+/* $XFree86: xc/programs/xclock/Clock.c,v 3.25 2003/07/04 16:24:30 eich Exp $ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <X11/Xlib.h>
+#include <X11/StringDefs.h>
+#include <X11/IntrinsicP.h>
+#include "ClockP.h"
+#include <X11/Xosdefs.h>
+#include <stdio.h>
+#include <X11/Xos.h>
+#include <X11/Xaw/XawInit.h>
+#if !defined(NO_I18N) && defined(HAVE_ICONV)
+#include <iconv.h>
+#include <langinfo.h>
+#include <errno.h>
+#include <limits.h>
+#endif
+
+#if defined(XawVersion) && (XawVersion >= 7000002L)
+#define USE_XAW_PIXMAP_CVT
+#else
+#include <X11/xpm.h>
+#endif
+
+#include <time.h>
+#define Time_t time_t
+
+#ifdef XKB
+#include <X11/extensions/XKBbells.h>
+#endif
+
+#ifndef NO_I18N
+#include <stdlib.h> /* for getenv() */
+#include <locale.h>
+extern Boolean no_locale; /* if True, use old (unlocalized) behaviour */
+#endif
+
+
+/* Private Definitions */
+
+#define VERTICES_IN_HANDS      6       /* to draw triangle */
+#define PI                     3.14159265358979
+#define TWOPI                  (2. * PI)
+
+#define MINOR_TICK_FRACT       95
+#define SECOND_HAND_FRACT      90
+#define MINUTE_HAND_FRACT      70
+#define HOUR_HAND_FRACT                40
+#define HAND_WIDTH_FRACT       7
+#define SECOND_WIDTH_FRACT     5
+#define SECOND_HAND_TIME       30
+
+#define ANALOG_SIZE_DEFAULT    164
+
+#define max(a, b) ((a) > (b) ? (a) : (b))
+#define min(a, b) ((a) < (b) ? (a) : (b))
+/* #define abs(a) ((a) < 0 ? -(a) : (a)) */
+
+
+/* Initialization of defaults */
+
+#define offset(field) XtOffsetOf(ClockRec, clock.field)
+#define goffset(field) XtOffsetOf(WidgetRec, core.field)
+
+static XtResource resources[] = {
+    {XtNwidth, XtCWidth, XtRDimension, sizeof(Dimension),
+       goffset(width), XtRImmediate, (XtPointer) 0},
+    {XtNheight, XtCHeight, XtRDimension, sizeof(Dimension),
+       goffset(height), XtRImmediate, (XtPointer) 0},
+    {XtNupdate, XtCInterval, XtRInt, sizeof(int),
+        offset(update), XtRImmediate, (XtPointer) 60 },
+#ifndef XRENDER
+    {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
+        offset(fgpixel), XtRString, XtDefaultForeground},
+#endif
+    {XtNhand, XtCForeground, XtRPixel, sizeof(Pixel),
+        offset(Hdpixel), XtRString, XtDefaultForeground},
+    {XtNhighlight, XtCForeground, XtRPixel, sizeof(Pixel),
+        offset(Hipixel), XtRString, XtDefaultForeground},
+    {XtNutime, XtCBoolean, XtRBoolean, sizeof(Boolean),
+       offset(utime), XtRImmediate, (XtPointer) FALSE},
+    {XtNanalog, XtCBoolean, XtRBoolean, sizeof(Boolean),
+        offset(analog), XtRImmediate, (XtPointer) TRUE},
+    {XtNtwentyfour, XtCBoolean, XtRBoolean, sizeof(Boolean),
+        offset(twentyfour), XtRImmediate, (XtPointer) TRUE},
+    {XtNbrief, XtCBoolean, XtRBoolean, sizeof(Boolean),
+        offset(brief), XtRImmediate, (XtPointer) FALSE},
+    {XtNstrftime, XtCString, XtRString, sizeof(String),
+        offset(strftime), XtRString, ""},
+    {XtNchime, XtCBoolean, XtRBoolean, sizeof(Boolean),
+       offset(chime), XtRImmediate, (XtPointer) FALSE },
+    {XtNpadding, XtCMargin, XtRInt, sizeof(int),
+        offset(padding), XtRImmediate, (XtPointer) 8},
+    {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *),
+        offset(font), XtRString, XtDefaultFont},
+#ifndef NO_I18N
+     {XtNfontSet, XtCFontSet, XtRFontSet, sizeof(XFontSet),
+        offset(fontSet), XtRString, XtDefaultFontSet},
+#endif
+    {XtNbackingStore, XtCBackingStore, XtRBackingStore, sizeof (int),
+       offset (backing_store), XtRString, "default"},
+#ifdef XRENDER
+    {XtNrender, XtCBoolean, XtRBoolean, sizeof(Boolean),
+       offset(render), XtRImmediate, (XtPointer) TRUE },
+    {XtNbuffer, XtCBoolean, XtRBoolean, sizeof(Boolean),
+       offset(buffer), XtRImmediate, (XtPointer) TRUE },
+    {XtNsharp, XtCBoolean, XtRBoolean, sizeof(Boolean),
+       offset(sharp), XtRImmediate, (XtPointer) FALSE },
+    {XtNforeground, XtCForeground, XtRXftColor, sizeof(XftColor),
+        offset(fg_color), XtRString, XtDefaultForeground},
+    {XtNhourColor, XtCForeground, XtRXftColor, sizeof(XftColor),
+       offset(hour_color), XtRString, XtDefaultForeground},
+    {XtNminuteColor, XtCForeground, XtRXftColor, sizeof(XftColor),
+       offset(min_color), XtRString, XtDefaultForeground},
+    {XtNsecondColor, XtCForeground, XtRXftColor, sizeof(XftColor),
+       offset(sec_color), XtRString, XtDefaultForeground},
+    {XtNmajorColor, XtCForeground, XtRXftColor, sizeof(XftColor),
+       offset(major_color), XtRString, XtDefaultForeground},
+    {XtNminorColor, XtCForeground, XtRXftColor, sizeof(XftColor),
+       offset(minor_color), XtRString, XtDefaultForeground},
+    {XtNface, XtCFace, XtRXftFont, sizeof (XftFont *),
+       offset (face), XtRString, ""},
+#endif
+};
+
+#undef offset
+#undef goffset
+
+static void ClassInitialize ( void );
+static void Initialize ( Widget request, Widget new, ArgList args,
+                        Cardinal *num_args );
+static void Realize ( Widget gw, XtValueMask *valueMask,
+                     XSetWindowAttributes *attrs );
+static void Destroy ( Widget gw );
+static void Resize ( Widget gw );
+static void Redisplay ( Widget gw, XEvent *event, Region region );
+static void clock_tic ( XtPointer client_data, XtIntervalId *id );
+static void erase_hands ( ClockWidget w, struct tm *tm );
+static void ClockAngle ( int tick_units, double *sinp, double *cosp );
+static void DrawLine ( ClockWidget w, Dimension blank_length,
+                      Dimension length, int tick_units );
+static void DrawHand ( ClockWidget w, Dimension length, Dimension width,
+                      int tick_units );
+static void DrawSecond ( ClockWidget w, Dimension length, Dimension width,
+                        Dimension offset, int tick_units );
+static void SetSeg ( ClockWidget w, int x1, int y1, int x2, int y2 );
+static void DrawClockFace ( ClockWidget w );
+static int clock_round ( double x );
+static Boolean SetValues ( Widget gcurrent, Widget grequest, Widget gnew,
+                          ArgList args, Cardinal *num_args );
+#if !defined(NO_I18N) && defined(HAVE_ICONV)
+static char *clock_to_utf8(const char *str, int in_len);
+#endif
+
+ClockClassRec clockClassRec = {
+    { /* core fields */
+    /* superclass              */      (WidgetClass) &simpleClassRec,
+    /* class_name              */      "Clock",
+    /* widget_size             */      sizeof(ClockRec),
+    /* class_initialize                */      ClassInitialize,
+    /* class_part_initialize   */      NULL,
+    /* class_inited            */      FALSE,
+    /* initialize              */      Initialize,
+    /* initialize_hook         */      NULL,
+    /* realize                 */      Realize,
+    /* actions                 */      NULL,
+    /* num_actions             */      0,
+    /* resources               */      resources,
+    /* resource_count          */      XtNumber(resources),
+    /* xrm_class               */      NULLQUARK,
+    /* compress_motion         */      TRUE,
+    /* compress_exposure       */      XtExposeCompressMaximal,
+    /* compress_enterleave     */      TRUE,
+    /* visible_interest                */      FALSE,
+    /* destroy                 */      Destroy,
+    /* resize                  */      Resize,
+    /* expose                  */      Redisplay,
+    /* set_values              */      SetValues,
+    /* set_values_hook         */      NULL,
+    /* set_values_almost       */      XtInheritSetValuesAlmost,
+    /* get_values_hook         */      NULL,
+    /* accept_focus            */      NULL,
+    /* version                 */      XtVersion,
+    /* callback_private                */      NULL,
+    /* tm_table                        */      NULL,
+    /* query_geometry           */     XtInheritQueryGeometry,
+    /* display_accelerator      */     XtInheritDisplayAccelerator,
+    /* extension                */     NULL
+    },
+    { /* simple fields */
+    /* change_sensitive         */      XtInheritChangeSensitive
+    },
+    { /* clock fields */
+    /* ignore                   */      0
+    }
+};
+
+WidgetClass clockWidgetClass = (WidgetClass) &clockClassRec;
+
+/****************************************************************
+ *
+ * Private Procedures
+ *
+ ****************************************************************/
+#ifndef USE_XAW_PIXMAP_CVT
+static void CvtStringToPixmap(
+    XrmValue*           args,
+    Cardinal*           num_args,
+    XrmValuePtr         fromVal,
+    XrmValuePtr         toVal
+    )
+{
+    static Pixmap      pmap;
+    Pixmap shapemask;
+    char *name = (char *)fromVal->addr;
+    Screen *screen;
+    Display *dpy;
+
+    if (*num_args != 1)
+     XtErrorMsg("wrongParameters","cvtStringToPixmap","XtToolkitError",
+             "String to pixmap conversion needs screen argument",
+              (String *)NULL, (Cardinal *)NULL);
+
+    if (strcmp(name, "None") == 0) {
+        pmap = None;
+    } else {
+       screen = *((Screen **) args[0].addr);
+       dpy = DisplayOfScreen(screen);
+
+       XpmReadFileToPixmap(dpy, RootWindowOfScreen(screen), name, &pmap,
+         &shapemask, NULL);
+    }
+
+    (*toVal).size = sizeof(Pixmap);
+    (*toVal).addr = (XPointer) &pmap ;
+}
+#endif
+
+#ifdef XRENDER
+static XtConvertArgRec xftColorConvertArgs[] = {
+    {XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.screen),
+     sizeof(Screen *)},
+    {XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.colormap),
+     sizeof(Colormap)}
+};
+
+#define        donestr(type, value, tstr) \
+       {                                                       \
+           if (toVal->addr != NULL) {                          \
+               if (toVal->size < sizeof(type)) {               \
+                   toVal->size = sizeof(type);                 \
+                   XtDisplayStringConversionWarning(dpy,       \
+                       (char*) fromVal->addr, tstr);           \
+                   return False;                               \
+               }                                               \
+               *(type*)(toVal->addr) = (value);                \
+           }                                                   \
+           else {                                              \
+               static type static_val;                         \
+               static_val = (value);                           \
+               toVal->addr = (XPointer)&static_val;            \
+           }                                                   \
+           toVal->size = sizeof(type);                         \
+           return True;                                        \
+       }
+
+static void
+XmuFreeXftColor (XtAppContext app, XrmValuePtr toVal, XtPointer closure,
+                XrmValuePtr args, Cardinal *num_args)
+{
+    Screen     *screen;
+    Colormap   colormap;
+    XftColor   *color;
+
+    if (*num_args != 2)
+    {
+       XtAppErrorMsg (app,
+                      "freeXftColor", "wrongParameters",
+                      "XtToolkitError",
+                      "Freeing an XftColor requires screen and colormap arguments",
+                      (String *) NULL, (Cardinal *)NULL);
+       return;
+    }
+
+    screen = *((Screen **) args[0].addr);
+    colormap = *((Colormap *) args[1].addr);
+    color = (XftColor *) toVal->addr;
+    XftColorFree (DisplayOfScreen (screen),
+                 DefaultVisual (DisplayOfScreen (screen),
+                                XScreenNumberOfScreen (screen)),
+                 colormap, color);
+}
+
+static Boolean
+XmuCvtStringToXftColor(Display *dpy,
+                      XrmValue *args, Cardinal *num_args,
+                      XrmValue *fromVal, XrmValue *toVal,
+                      XtPointer *converter_data)
+{
+    char           *spec;
+    XRenderColor    renderColor;
+    XftColor       xftColor;
+    Screen         *screen;
+    Colormap       colormap;
+
+    if (*num_args != 2)
+    {
+       XtAppErrorMsg (XtDisplayToApplicationContext (dpy),
+                      "cvtStringToXftColor", "wrongParameters",
+                      "XtToolkitError",
+                      "String to render color conversion needs screen and colormap arguments",
+                      (String *) NULL, (Cardinal *)NULL);
+       return False;
+    }
+
+    screen = *((Screen **) args[0].addr);
+    colormap = *((Colormap *) args[1].addr);
+
+    spec = (char *) fromVal->addr;
+    if (strcasecmp (spec, XtDefaultForeground) == 0)
+    {
+       renderColor.red = 0;
+       renderColor.green = 0;
+       renderColor.blue = 0;
+       renderColor.alpha = 0xffff;
+    }
+    else if (strcasecmp (spec, XtDefaultBackground) == 0)
+    {
+       renderColor.red = 0xffff;
+       renderColor.green = 0xffff;
+       renderColor.blue = 0xffff;
+       renderColor.alpha = 0xffff;
+    }
+    else if (!XRenderParseColor (dpy, spec, &renderColor))
+       return False;
+    if (!XftColorAllocValue (dpy,
+                            DefaultVisual (dpy,
+                                           XScreenNumberOfScreen (screen)),
+                            colormap,
+                            &renderColor,
+                            &xftColor))
+       return False;
+
+    donestr (XftColor, xftColor, XtRXftColor);
+}
+
+static void
+XmuFreeXftFont (XtAppContext app, XrmValuePtr toVal, XtPointer closure,
+               XrmValuePtr args, Cardinal *num_args)
+{
+    Screen  *screen;
+    XftFont *font;
+
+    if (*num_args != 1)
+    {
+       XtAppErrorMsg (app,
+                      "freeXftFont", "wrongParameters",
+                      "XtToolkitError",
+                      "Freeing an XftFont requires screen argument",
+                      (String *) NULL, (Cardinal *)NULL);
+       return;
+    }
+
+    screen = *((Screen **) args[0].addr);
+    font = *((XftFont **) toVal->addr);
+    if (font)
+       XftFontClose (DisplayOfScreen (screen), font);
+}
+
+static Boolean
+XmuCvtStringToXftFont(Display *dpy,
+                     XrmValue *args, Cardinal *num_args,
+                     XrmValue *fromVal, XrmValue *toVal,
+                     XtPointer *converter_data)
+{
+    char    *name;
+    XftFont *font;
+    Screen  *screen;
+
+    if (*num_args != 1)
+    {
+       XtAppErrorMsg (XtDisplayToApplicationContext (dpy),
+                      "cvtStringToXftFont", "wrongParameters",
+                      "XtToolkitError",
+                      "String to XftFont conversion needs screen argument",
+                      (String *) NULL, (Cardinal *)NULL);
+       return False;
+    }
+
+    screen = *((Screen **) args[0].addr);
+    name = (char *) fromVal->addr;
+
+    font = XftFontOpenName (dpy,
+                           XScreenNumberOfScreen (screen),
+                           name);
+    if (font)
+    {
+       donestr (XftFont *, font, XtRXftFont);
+    }
+    XtDisplayStringConversionWarning(dpy, (char *) fromVal->addr, XtRXftFont);
+    return False;
+}
+
+static XtConvertArgRec xftFontConvertArgs[] = {
+    {XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.screen),
+     sizeof(Screen *)},
+};
+
+#endif
+
+static void
+ClassInitialize(void)
+{
+#ifdef USE_XAW_PIXMAP_CVT
+    XawInitializeWidgetSet();
+#else
+    static XtConvertArgRec scrnConvertArg[] = {
+       {XtBaseOffset, (XtPointer) XtOffset(Widget, core.screen),
+        sizeof(Screen *)}
+    };
+    XtAddConverter( XtRString, XtRPixmap, CvtStringToPixmap,
+                   scrnConvertArg, XtNumber(scrnConvertArg));
+#endif
+    XtAddConverter( XtRString, XtRBackingStore, XmuCvtStringToBackingStore,
+                   NULL, 0 );
+#ifdef XRENDER
+    XtSetTypeConverter (XtRString, XtRXftColor,
+                       XmuCvtStringToXftColor,
+                       xftColorConvertArgs, XtNumber(xftColorConvertArgs),
+                       XtCacheByDisplay, XmuFreeXftColor);
+    XtSetTypeConverter (XtRString, XtRXftFont,
+                       XmuCvtStringToXftFont,
+                       xftFontConvertArgs, XtNumber(xftFontConvertArgs),
+                       XtCacheByDisplay, XmuFreeXftFont);
+#endif
+}
+
+static char *
+TimeString (ClockWidget w, struct tm *tm)
+{
+   if (w->clock.brief)
+   {
+      if (w->clock.twentyfour)
+      {
+         static char brief[6];
+         sprintf (brief, "%02d:%02d", tm->tm_hour, tm->tm_min);
+         return brief;
+      }
+      else
+      {
+        static char brief[9];
+        int hour = tm->tm_hour % 12;
+        if (!hour) hour = 12;
+        sprintf (brief, "%02d:%02d %cM", hour, tm->tm_min,
+           tm->tm_hour >= 12 ? 'P' : 'A');
+        return brief;
+      }
+   }
+   else if (w->clock.utime)
+   {
+      static char utime[35];
+      Time_t tsec;
+      tsec = time(NULL);
+      sprintf (utime, "%10lu seconds since Epoch", (unsigned long)tsec);
+      return utime;
+   } else if (*w->clock.strftime) {
+     /*Note: this code is probably excessively paranoid
+       about buffer overflow.  The extra size 10 padding
+       is also meant as a further guard against programmer
+       error, although it is a little controversial*/
+     static char ctime[STRFTIME_BUFF_SIZE+10];
+     ctime[0] = ctime[STRFTIME_BUFF_SIZE] = '\0';
+     if (0 < strftime (ctime, STRFTIME_BUFF_SIZE-1,w->clock.strftime, tm)) {
+       ctime[STRFTIME_BUFF_SIZE-1] = '\0';
+       return ctime;
+     } else {
+       return asctime (tm);
+     }
+   }
+   else if (w->clock.twentyfour)
+      return asctime (tm);
+   else
+   {
+      static char long12[28];
+      strftime(long12, sizeof long12, "%a %b %d %I:%M:%S %p %Y", tm);
+      return long12;
+   }
+}
+
+/* ARGSUSED */
+static void
+Initialize (Widget request, Widget new, ArgList args, Cardinal *num_args)
+{
+    ClockWidget w = (ClockWidget)new;
+    XtGCMask           valuemask;
+    XGCValues  myXGCV;
+    int min_height, min_width;
+
+    valuemask = GCForeground | GCBackground | GCFont | GCLineWidth;
+    if (w->clock.font != NULL)
+        myXGCV.font = w->clock.font->fid;
+    else
+        valuemask &= ~GCFont;  /* use server default font */
+
+    min_width = min_height = ANALOG_SIZE_DEFAULT;
+    if(!w->clock.analog) {
+       char *str;
+       struct tm tm;
+       Time_t time_value;
+       int len;
+
+#ifndef NO_I18N
+       w->clock.utf8 = False;
+
+       if (!no_locale) {
+          char *time_locale = setlocale(LC_TIME, NULL);
+
+          if (strstr(time_locale, "UTF-8") || strstr(time_locale, "utf8")) {
+              w->clock.utf8 = True;
+          }
+
+          /*
+           * initialize time format from CFTIME if set, otherwise
+           * default to "%c".  This emulates ascftime, but we use
+           * strftime so we can limit the string buffer size to
+           * avoid possible buffer overflow.
+           */
+          if ((w->clock.strftime == NULL) || (w->clock.strftime[0] == 0)) {
+              w->clock.strftime = getenv("CFTIME");
+              if (w->clock.strftime == NULL) {
+                  w->clock.strftime = "%c";
+              }
+          }
+       }
+#endif /* NO_I18N */
+
+       (void) time(&time_value);
+       tm = *localtime(&time_value);
+       str = TimeString (w, &tm);
+       len = strlen(str);
+       if (len && str[len - 1] == '\n') str[--len] = '\0';
+
+#ifdef XRENDER
+       if (w->clock.render)
+       {
+       XGlyphInfo  extents;
+#ifndef NO_I18N
+# ifdef HAVE_ICONV
+       char *utf8_str;
+# endif
+       if (w->clock.utf8)
+           XftTextExtentsUtf8 (XtDisplay (w), w->clock.face,
+                               (FcChar8 *) str, len, &extents);
+# ifdef HAVE_ICONV
+       else if ((utf8_str = clock_to_utf8(str, len)) != NULL) {
+               XftTextExtentsUtf8 (XtDisplay (w), w->clock.face,
+                       (FcChar8 *)utf8_str, strlen(utf8_str), &extents);
+               free(utf8_str);
+       }
+# endif
+       else
+#endif
+           XftTextExtents8 (XtDisplay (w), w->clock.face,
+                            (FcChar8 *) str, len, &extents);
+       min_width = extents.xOff + 2 * w->clock.padding;
+       min_height = w->clock.face->ascent + w->clock.face->descent +
+                    2 * w->clock.padding;
+        /*fprintf(stderr, "render min_width %i\n", min_width);*/
+       }
+       else
+#endif
+       { /* not XRENDER block */
+#ifndef NO_I18N
+        if (!no_locale) {
+          XFontSetExtents *fse;
+
+          if(w->clock.fontSet == NULL) {
+              char **missing, *default_str;
+              int n_missing;
+              w->clock.fontSet = XCreateFontSet( XtDisplay(w),
+                XtDefaultFontSet,
+                &missing,
+                &n_missing,
+                &default_str);
+          }
+          if (w->clock.fontSet != NULL) {
+              /* don't free this... it's freed with the XFontSet. */
+              fse = XExtentsOfFontSet(w->clock.fontSet);
+
+              min_width = XmbTextEscapement(w->clock.fontSet,str,len) +
+                2 * w->clock.padding;
+              min_height = fse->max_logical_extent.height +
+                3 * w->clock.padding;
+              /*fprintf(stderr, "fontset min_width %i\n", min_width);*/
+          } else {
+              no_locale = True;
+          }
+        }
+
+        if (no_locale)
+#endif /* NO_I18N */
+        {
+          if (w->clock.font == NULL)
+              w->clock.font = XQueryFont( XtDisplay(w),
+                                          XGContextFromGC(
+                                           DefaultGCOfScreen(XtScreen(w))) );
+          min_width = XTextWidth(w->clock.font, str, len) +
+              2 * w->clock.padding;
+          min_height = w->clock.font->ascent +
+              w->clock.font->descent + 2 * w->clock.padding;
+          /*fprintf(stderr, "font min_width %i\n", min_width);*/
+        }
+       } /* not XRENDER block */
+    }
+    if (w->core.width == 0)
+       w->core.width = min_width;
+    if (w->core.height == 0)
+       w->core.height = min_height;
+
+    myXGCV.foreground = ClockFgPixel (w);
+    myXGCV.background = w->core.background_pixel;
+    if (w->clock.font != NULL)
+       myXGCV.font = w->clock.font->fid;
+    else
+       valuemask &= ~GCFont;   /* use server default font */
+    myXGCV.line_width = 0;
+    w->clock.myGC = XtGetGC((Widget)w, valuemask, &myXGCV);
+
+    valuemask = GCForeground | GCLineWidth | GCGraphicsExposures;
+    myXGCV.foreground = w->core.background_pixel;
+    if (w->core.background_pixmap != XtUnspecifiedPixmap) {
+       myXGCV.tile = w->core.background_pixmap;
+       myXGCV.fill_style = FillTiled;
+       valuemask |= (GCTile | GCFillStyle);
+    }
+    myXGCV.graphics_exposures = False;
+    w->clock.EraseGC = XtGetGC((Widget)w, valuemask, &myXGCV);
+    valuemask &= ~(GCTile | GCFillStyle);
+
+    myXGCV.foreground = w->clock.Hipixel;
+    w->clock.HighGC = XtGetGC((Widget)w, valuemask, &myXGCV);
+
+    valuemask = GCForeground;
+    myXGCV.foreground = w->clock.Hdpixel;
+    w->clock.HandGC = XtGetGC((Widget)w, valuemask, &myXGCV);
+
+    /* make invalid update's use a default */
+    /*if (w->clock.update <= 0) w->clock.update = 60;*/
+    w->clock.show_second_hand = (abs(w->clock.update) <= SECOND_HAND_TIME);
+    w->clock.numseg = 0;
+    w->clock.interval_id = 0;
+    memset (&w->clock.otm, '\0', sizeof (w->clock.otm));
+#ifdef XRENDER
+    {
+       int major, minor;
+
+       if (XRenderQueryVersion (XtDisplay (w), &major, &minor) &&
+           (major > 0 ||
+            (major == 0 && minor >= 4)))
+       {
+           w->clock.can_polygon = True;
+       }
+       else
+           w->clock.can_polygon = False;
+    }
+    w->clock.pixmap = 0;
+    w->clock.draw = NULL;
+    w->clock.damage.x = 0;
+    w->clock.damage.y = 0;
+    w->clock.damage.height = 0;
+    w->clock.damage.width = 0;
+#endif
+}
+
+#ifdef XRENDER
+static void
+RenderPrepare (ClockWidget  w, XftColor *color)
+{
+    if (!w->clock.draw)
+    {
+       Drawable    d = XtWindow (w);
+       if (w->clock.buffer)
+       {
+           if (!w->clock.pixmap)
+           {
+               Arg arg[1];
+               w->clock.pixmap = XCreatePixmap (XtDisplay (w), d,
+                                                w->core.width,
+                                                w->core.height,
+                                                w->core.depth);
+               arg[0].name = XtNbackgroundPixmap;
+               arg[0].value = 0;
+               XtSetValues ((Widget) w, arg, 1);
+           }
+           d = w->clock.pixmap;
+       }
+
+       w->clock.draw = XftDrawCreate (XtDisplay (w), d,
+                                      DefaultVisual (XtDisplay (w),
+                                                     DefaultScreen(XtDisplay (w))),
+                                      w->core.colormap);
+       w->clock.picture = XftDrawPicture (w->clock.draw);
+    }
+    if (color)
+       w->clock.fill_picture = XftDrawSrcPicture (w->clock.draw, color);
+}
+
+static void
+RenderClip (ClockWidget w)
+{
+    Region     r;
+    Drawable   d;
+
+    RenderPrepare (w, NULL);
+    if (w->clock.buffer)
+       d = w->clock.pixmap;
+    else
+       d = XtWindow (w);
+    XFillRectangle (XtDisplay (w), d, w->clock.EraseGC,
+                   w->clock.damage.x,
+                   w->clock.damage.y,
+                   w->clock.damage.width,
+                   w->clock.damage.height);
+    r = XCreateRegion ();
+    XUnionRectWithRegion (&w->clock.damage,
+                         r, r);
+    XftDrawSetClip (w->clock.draw, r);
+    XDestroyRegion (r);
+}
+
+static void
+RenderTextBounds (ClockWidget w, char *str, int off, int len,
+                 XRectangle *bounds, int *xp, int *yp)
+{
+    XGlyphInfo  head, tail;
+    int            x, y;
+
+#ifndef NO_I18N
+# ifdef HAVE_ICONV
+    char *utf8_str;
+# endif
+    if (w->clock.utf8)
+    {
+       XftTextExtentsUtf8 (XtDisplay (w), w->clock.face,
+                           (FcChar8 *) str, off, &head);
+       XftTextExtentsUtf8 (XtDisplay (w), w->clock.face,
+                           (FcChar8 *) str + off, len - off, &tail);
+    }
+# ifdef HAVE_ICONV
+    else if ((utf8_str = clock_to_utf8(str, off)) != NULL)
+    {
+       XftTextExtentsUtf8 (XtDisplay (w), w->clock.face,
+                           (FcChar8 *)utf8_str, strlen(utf8_str), &head);
+       free(utf8_str);
+       if ((utf8_str = clock_to_utf8(str+off, len-off)) != NULL) {
+         XftTextExtentsUtf8 (XtDisplay (w), w->clock.face,
+                             (FcChar8 *)utf8_str, strlen(utf8_str), &tail);
+         free(utf8_str);
+       } else
+         goto fallback;
+    }
+# endif
+    else
+#endif
+    {
+    fallback:
+       XftTextExtents8 (XtDisplay (w), w->clock.face, (FcChar8 *) str,
+                        off, &head);
+       XftTextExtents8 (XtDisplay (w), w->clock.face, (FcChar8 *) str + off,
+                        len - off, &tail);
+    }
+
+    /*
+     * Compute position of tail
+     */
+    x = w->clock.padding + head.xOff;
+    y = w->clock.face->ascent + w->clock.padding + head.yOff;
+    /*
+     * Compute bounds of tail, pad a bit as the bounds aren't exact
+     */
+    bounds->x = x - tail.x - 1;
+    bounds->y = y - tail.y - 1;
+    bounds->width = tail.width + 2;
+    bounds->height = tail.height + 2;
+    if (xp) *xp = x;
+    if (yp) *yp = y;
+}
+
+static void
+RenderUpdateRectBounds (XRectangle *damage, XRectangle *bounds)
+{
+    int            x1 = bounds->x;
+    int            y1 = bounds->y;
+    int            x2 = bounds->x + bounds->width;
+    int            y2 = bounds->y + bounds->height;
+    int            d_x1 = damage->x;
+    int            d_y1 = damage->y;
+    int            d_x2 = damage->x + damage->width;
+    int            d_y2 = damage->y + damage->height;
+
+    if (x1 == x2)
+    {
+       x1 = d_x1;
+       x2 = d_x2;
+    }
+    else
+    {
+       if (d_x1 < x1) x1 = d_x1;
+       if (d_x2 > x2) x2 = d_x2;
+    }
+    if (y1 == y2)
+    {
+       y1 = d_y1;
+       y2 = d_y2;
+    }
+    else
+    {
+       if (d_y1 < y1) y1 = d_y1;
+       if (d_y2 > y2) y2 = d_y2;
+    }
+
+    bounds->x = x1;
+    bounds->y = y1;
+    bounds->width = x2 - x1;
+    bounds->height = y2 - y1;
+}
+
+static Boolean
+RenderRectIn (XRectangle *rect, XRectangle *bounds)
+{
+    int            x1 = bounds->x;
+    int            y1 = bounds->y;
+    int            x2 = bounds->x + bounds->width;
+    int            y2 = bounds->y + bounds->height;
+    int            r_x1 = rect->x;
+    int            r_y1 = rect->y;
+    int            r_x2 = rect->x + rect->width;
+    int            r_y2 = rect->y + rect->height;
+
+    return r_x1 < x2 && x1 < r_x2 && r_y1 < y2 && y1 < r_y2;
+}
+
+#define LINE_WIDTH  0.01
+#include <math.h>
+
+#define XCoord(x,w) ((x) * (w)->clock.x_scale + (w)->clock.x_off)
+#define YCoord(y,w) ((y) * (w)->clock.y_scale + (w)->clock.y_off)
+
+static void
+RenderUpdateBounds (XPointDouble *points, int npoints, XRectangle *bounds)
+{
+    int            x1 = bounds->x;
+    int            y1 = bounds->y;
+    int            x2 = bounds->x + bounds->width;
+    int            y2 = bounds->y + bounds->height;
+
+    while (npoints--)
+    {
+       int         r_x1 = points[0].x;
+       int         r_y1 = points[0].y;
+       int         r_x2 = points[0].x + 1;
+       int         r_y2 = points[0].y + 1;
+
+       if (x1 == x2)
+           x2 = x1 = r_x1;
+       if (y1 == y2)
+           y2 = y1 = r_y1;
+       if (r_x1 < x1) x1 = r_x1;
+       if (r_y1 < y1) y1 = r_y1;
+       if (r_x2 > x2) x2 = r_x2;
+       if (r_y2 > y2) y2 = r_y2;
+       points++;
+    }
+    bounds->x = x1;
+    bounds->y = y1;
+    bounds->width = x2 - x1;
+    bounds->height = y2 - y1;
+}
+
+static Boolean
+RenderCheckBounds (XPointDouble *points, int npoints, XRectangle *bounds)
+{
+    int            x1 = bounds->x;
+    int            y1 = bounds->y;
+    int            x2 = bounds->x + bounds->width;
+    int            y2 = bounds->y + bounds->height;
+
+    while (npoints--)
+    {
+       if (x1 <= points->x && points->x <= x2 &&
+           y1 <= points->y && points->y <= y2)
+           return True;
+       points++;
+    }
+    return False;
+}
+
+static void
+RenderUpdate (ClockWidget w)
+{
+    if (w->clock.buffer && w->clock.pixmap)
+    {
+       XCopyArea (XtDisplay (w), w->clock.pixmap,
+                  XtWindow (w), w->clock.EraseGC,
+                  w->clock.damage.x, w->clock.damage.y,
+                  w->clock.damage.width, w->clock.damage.height,
+                  w->clock.damage.x, w->clock.damage.y);
+    }
+}
+
+static void
+RenderResetBounds (XRectangle *bounds)
+{
+    bounds->x = 0;
+    bounds->y = 0;
+    bounds->width = 0;
+    bounds->height = 0;
+}
+
+static void
+RenderLine (ClockWidget w, XDouble x1, XDouble y1, XDouble x2, XDouble y2,
+           XftColor *color,
+           Boolean draw)
+{
+    XPointDouble    poly[4];
+    XDouble        dx = (x2 - x1);
+    XDouble        dy = (y2 - y1);
+    XDouble        len = sqrt (dx*dx + dy*dy);
+    XDouble        ldx = (LINE_WIDTH/2.0) * dy / len;
+    XDouble        ldy = (LINE_WIDTH/2.0) * dx / len;
+
+    poly[0].x = XCoord (x1 + ldx, w);
+    poly[0].y = YCoord (y1 - ldy, w);
+
+    poly[1].x = XCoord (x2 + ldx, w);
+    poly[1].y = YCoord (y2 - ldy, w);
+
+    poly[2].x = XCoord (x2 - ldx, w);
+    poly[2].y = YCoord (y2 + ldy, w);
+
+    poly[3].x = XCoord (x1 - ldx, w);
+    poly[3].y = YCoord (y1 + ldy, w);
+
+    RenderUpdateBounds (poly, 4, &w->clock.damage);
+    if (draw)
+    {
+       if (RenderCheckBounds (poly, 4, &w->clock.damage))
+       {
+           RenderPrepare (w, color);
+           XRenderCompositeDoublePoly (XtDisplay (w),
+                                       PictOpOver,
+                                       w->clock.fill_picture,
+                                       w->clock.picture,
+                                       w->clock.mask_format,
+                                       0, 0, 0, 0, poly, 4, EvenOddRule);
+       }
+    }
+    else
+       RenderUpdateBounds (poly, 4, &w->clock.damage);
+}
+
+static void
+RenderRotate (ClockWidget w, XPointDouble *out, double x, double y, double s, double c)
+{
+    out->x = XCoord (x * c - y * s, w);
+    out->y = YCoord (y * c + x * s, w);
+}
+
+static void
+RenderHand (ClockWidget w, int tick_units, int size, XftColor *color,
+           Boolean draw)
+{
+    double         c, s;
+    XPointDouble    poly[3];
+    double         outer_x;
+    double         inner_y;
+
+    ClockAngle (tick_units, &c, &s);
+    s = -s;
+
+    /* compute raw positions */
+    outer_x = size / 100.0;
+    inner_y = HAND_WIDTH_FRACT / 100.0;
+
+    /* rotate them into position */
+    RenderRotate (w, &poly[0], outer_x, 0.0, s, c);
+    RenderRotate (w, &poly[1], -inner_y, inner_y, s, c);
+    RenderRotate (w, &poly[2], -inner_y, -inner_y, s, c);
+
+    if (draw)
+    {
+       if (RenderCheckBounds (poly, 3, &w->clock.damage))
+       {
+           RenderPrepare (w, color);
+           XRenderCompositeDoublePoly (XtDisplay (w),
+                                       PictOpOver,
+                                       w->clock.fill_picture,
+                                       w->clock.picture,
+                                       w->clock.mask_format,
+                                       0, 0, 0, 0, poly, 3, EvenOddRule);
+       }
+    }
+    RenderUpdateBounds (poly, 3, &w->clock.damage);
+}
+
+static void
+RenderHands (ClockWidget w, struct tm *tm, Boolean draw)
+{
+    RenderHand (w, tm->tm_hour * 300 + tm->tm_min*5, HOUR_HAND_FRACT, &w->clock.hour_color, draw);
+    RenderHand (w, tm->tm_min * 60 + tm->tm_sec, MINUTE_HAND_FRACT, &w->clock.min_color, draw);
+}
+
+static void
+RenderSec (ClockWidget w, struct tm *tm, Boolean draw)
+{
+    double         c, s;
+    XPointDouble    poly[10];
+    double         inner_x, middle_x, outer_x, far_x;
+    double         middle_y;
+    double         line_y;
+
+    ClockAngle (tm->tm_sec * 60, &c, &s);
+
+    s = -s;
+
+    /*
+     * Compute raw positions
+     */
+    line_y = LINE_WIDTH;
+    inner_x = (MINUTE_HAND_FRACT / 100.0);
+    middle_x = ((SECOND_HAND_FRACT + MINUTE_HAND_FRACT) / 200.0);
+    outer_x = (SECOND_HAND_FRACT / 100.0);
+    far_x = (MINOR_TICK_FRACT / 100.0);
+    middle_y = (SECOND_WIDTH_FRACT / 100.0);
+
+    /*
+     * Rotate them into position
+     */
+    RenderRotate (w, &poly[0], -line_y, line_y, s, c);
+    RenderRotate (w, &poly[1], inner_x, line_y, s, c);
+    RenderRotate (w, &poly[2], middle_x, middle_y, s, c);
+    RenderRotate (w, &poly[3], outer_x, line_y, s, c);
+    RenderRotate (w, &poly[4], far_x, line_y, s, c);
+    RenderRotate (w, &poly[5], far_x, -line_y, s, c);
+    RenderRotate (w, &poly[6], outer_x, -line_y, s, c);
+    RenderRotate (w, &poly[7], middle_x, -middle_y, s, c);
+    RenderRotate (w, &poly[8], inner_x, -line_y, s, c);
+    RenderRotate (w, &poly[9], -line_y, -line_y, s, c);
+
+    if (draw)
+    {
+       if (RenderCheckBounds (poly, 10, &w->clock.damage))
+       {
+           RenderPrepare (w, &w->clock.sec_color);
+           XRenderCompositeDoublePoly (XtDisplay (w),
+                                       PictOpOver,
+                                       w->clock.fill_picture,
+                                       w->clock.picture,
+                                       w->clock.mask_format,
+                                       0, 0, 0, 0, poly, 10, EvenOddRule);
+       }
+    }
+    else
+    {
+       RenderUpdateBounds (poly, 10, &w->clock.damage);
+    }
+}
+
+#endif
+
+static void
+Realize(Widget gw, XtValueMask *valueMask, XSetWindowAttributes *attrs)
+{
+     ClockWidget       w = (ClockWidget) gw;
+#ifdef notdef
+     *valueMask |= CWBitGravity;
+     attrs->bit_gravity = ForgetGravity;
+#endif
+     switch (w->clock.backing_store) {
+     case Always:
+     case NotUseful:
+     case WhenMapped:
+       *valueMask |=CWBackingStore;
+       attrs->backing_store = w->clock.backing_store;
+       break;
+     }
+     (*clockWidgetClass->core_class.superclass->core_class.realize)
+        (gw, valueMask, attrs);
+     Resize(gw);
+}
+
+static void
+Destroy(Widget gw)
+{
+     ClockWidget w = (ClockWidget) gw;
+     if (w->clock.interval_id) XtRemoveTimeOut (w->clock.interval_id);
+#ifdef XRENDER
+    if (w->clock.picture)
+       XRenderFreePicture (XtDisplay(w), w->clock.picture);
+    if (w->clock.fill_picture)
+       XRenderFreePicture (XtDisplay(w), w->clock.fill_picture);
+#endif
+     XtReleaseGC (gw, w->clock.myGC);
+     XtReleaseGC (gw, w->clock.HighGC);
+     XtReleaseGC (gw, w->clock.HandGC);
+     XtReleaseGC (gw, w->clock.EraseGC);
+}
+
+static void
+Resize(Widget gw)
+{
+    ClockWidget w = (ClockWidget) gw;
+    /* don't do this computation if window hasn't been realized yet. */
+    if (XtIsRealized(gw) && w->clock.analog) {
+       /* need signed value since Dimension is unsigned */
+       int radius = ((int) min(w->core.width, w->core.height) - (int) (2 * w->clock.padding)) / 2;
+        w->clock.radius = (Dimension) max (radius, 1);
+
+        w->clock.second_hand_length = (int)(SECOND_HAND_FRACT * w->clock.radius) / 100;
+        w->clock.minute_hand_length = (int)(MINUTE_HAND_FRACT * w->clock.radius) / 100;
+        w->clock.hour_hand_length = (int)(HOUR_HAND_FRACT * w->clock.radius) / 100;
+        w->clock.hand_width = (int)(HAND_WIDTH_FRACT * w->clock.radius) / 100;
+        w->clock.second_hand_width = (int)(SECOND_WIDTH_FRACT * w->clock.radius) / 100;
+
+        w->clock.centerX = w->core.width / 2;
+        w->clock.centerY = w->core.height / 2;
+    }
+#ifdef XRENDER
+    w->clock.x_scale = 0.45 * w->core.width;
+    w->clock.y_scale = 0.45 * w->core.height;
+    w->clock.x_off = 0.5 * w->core.width;
+    w->clock.y_off = 0.5 * w->core.height;
+    if (w->clock.pixmap)
+    {
+       XFreePixmap (XtDisplay (w), w->clock.pixmap);
+       w->clock.pixmap = 0;
+       if (w->clock.draw)
+       {
+           XftDrawDestroy (w->clock.draw);
+           w->clock.draw = NULL;
+       }
+       w->clock.picture = 0;
+    }
+#endif
+}
+
+/* ARGSUSED */
+static void
+Redisplay(Widget gw, XEvent *event, Region region)
+{
+    ClockWidget w = (ClockWidget) gw;
+    if (w->clock.analog) {
+#ifdef XRENDER
+       if (w->clock.render && w->clock.can_polygon)
+           XClipBox (region, &w->clock.damage);
+       else
+#endif
+       {
+           if (w->clock.numseg != 0)
+               erase_hands (w, (struct tm *) 0);
+           DrawClockFace(w);
+       }
+    } else {
+#ifdef XRENDER
+       if (w->clock.render)
+           XClipBox (region, &w->clock.damage);
+#endif
+       w->clock.prev_time_string[0] = '\0';
+    }
+    clock_tic((XtPointer)w, (XtIntervalId *)NULL);
+}
+
+/* Choose the update times for well-defined clock states.
+ *
+ * For example, in HH:MM:SS notation the last number rolls over
+ * every 60 seconds and has at most 60 display states.  The sequence
+ * depends on its initial value t0 and the update period u, e.g.
+ *
+ *   u (s)  d (s)  ti (s)                    m (states)  l (s)
+ *    2      2     {0,2, .. 58}              30            60
+ *    7      1     {0,7, .. 56,3, .. 53}     60           420
+ *   15     15     {0,15,30,45}               4            60
+ *   45     15     {0,45,30,15}               4           180
+ *   53      1     {0,53,46, .. 4,57, .. 7}  60          3180
+ *   58      2     {0,58,56, .. 2}           30          1740
+ *   60     60     {0}                        1            60
+ *
+ * u=  update period in seconds,
+ * ti= time at update i from the reference, HH:MM:00 or HH:00:00,
+ * n=  the roll over time, the modulus, 60 s or 3600 s,
+ * m=  the sequence length, the order of u in the modulo n group Z/nZ,
+ * l=  the total sequence duration =m*u.
+ * d=  gcd(n,u) the greatest common divisor
+ *
+ * The time t(i) determines the clock state.  It follows from
+ *
+ *   t(i)=t(i-1)+u mod n  <=>  t(i)=t(0)+i*u mod n
+ *
+ * which defines a { t(0) .. t(m-1) } sequence of m unique elements.
+ * Hence, u generates a subgroup U={k*u mod n : k in Z} of Z/nZ so
+ * its order m divides n.  This m satisfies
+ *
+ *   t(m)=t(0)  <=>  m*u mod n = 0  <=>  m*u = r*n  <=>  m=n/d, r=u/d
+ *
+ * where d divides n and u.  Choosing
+ *
+ *   d=gcd(n,u)  <=>  n/d and u/d are coprime  =>  m=n/d is minimum
+ *
+ * thus gives the order.  Furthermore, the greatest common divisor d is
+ * also the minimum value generator of the set U.  Assume a generator e
+ * where
+ *
+ *   e|{n,u}  <=>  Ai,Ej: i*u mod n = j*e  <=>  j=f(i)=(i*u mod n)/e
+ *
+ * such that f maps i to m=ord(u) unique values of j.  Its properties are
+ *
+ *   j=i*u/e mod n/e   ==>  0<=j<n/e
+ *
+ *   ord(u/e, mod n/e)=n/e/gcd(n/e,u/e)=n/d=m  ==>  J={j=f(i)}, |J|=m
+ *
+ *   ord(e)=n/gcd(n,e)=n/e
+ *
+ * from wich follows
+ *
+ *   e=d  ==>  f: I={0,..,m-1} -> J={0,..,m-1}: j=i*r mod m is bijective
+ *        ==>  D={k*d mod n : k in Z} = U.
+ *
+ * Any value e below d is no generator since it yields a non contiguous
+ * J such that an l=0..n/e-1 exists not in J with l*e not in U.
+ *
+ * The update sequence t(i) could be followed using the algorithm:
+ *
+ *   1. restore the expected value into t(i),
+ *   2. calculate the next timeout t(i+1)=t(i)+u mod n,
+ *   3. verify that the current tc(i) is between t(i)..t(i+1),
+ *   4. calculate the time to wait w=t(i+1)-tc(i) mod n,
+ *   5. store t(i+1),
+ *
+ * which implements state tracking.  This approach doesn't work well
+ * since the set timeout w does not guarantee a next call at time
+ * t(i+1), e.g. due to progam sleeps, time adjustments, and leap
+ * seconds.  A robust method should only rely on the current time
+ * tc(i) to identify t(i).  The derivation above shows 2 options:
+ *
+ *   1.  n={60,3600} and round to a multiple of d,
+ *       but if d<u then the sequence is not guaranteed.
+ *   2.  choose n large and round to a multiple of u,
+ *       but then the sequence resets at roll-over.
+ *
+ * The code below implements (2) with n this year's duration in seconds
+ * and using local time year's start as epoch.
+ */
+static unsigned long
+waittime(int update, struct timeval *tv, struct tm *tm)
+{
+  int twait;
+  long twaitms;
+  unsigned long retval;
+
+  if(update>0) {
+    long tcur;
+    int trem;
+
+    tcur=tm->tm_sec+60*(tm->tm_min+60*(tm->tm_hour+24*tm->tm_yday));
+    /* ti=floor(tcur/u)*u, w=u-(tcur-ti), and tcur-ti==tcur % u */
+    trem=tcur % update;
+    twait=update-trem;
+  } else {
+    twait=-update;
+  }
+
+  if(tv->tv_usec>0) {
+    long usec;
+    twait--;
+    usec=1000000-tv->tv_usec;
+    twaitms=(usec+999)/1000;  /* must round up to avoid zero retval */
+  } else {
+    twaitms=0;
+  }
+
+  retval=(unsigned long)labs(twaitms+1000*twait);
+  return retval;
+}
+
+/* ARGSUSED */
+static void
+clock_tic(XtPointer client_data, XtIntervalId *id)
+{
+        ClockWidget w = (ClockWidget)client_data;
+       struct tm tm;
+       Time_t  time_value;
+       struct timeval  tv;
+       char    *time_ptr;
+        register Display *dpy = XtDisplay(w);
+        register Window win = XtWindow(w);
+
+       X_GETTIMEOFDAY (&tv);
+       time_value = tv.tv_sec;
+       tm = *localtime(&time_value);
+       if (w->clock.update && (id || !w->clock.interval_id))
+           w->clock.interval_id =
+               XtAppAddTimeOut( XtWidgetToApplicationContext( (Widget) w),
+                                waittime(w->clock.update, &tv, &tm),
+                                clock_tic, (XtPointer)w );
+       /*
+        * Beep on the half hour; double-beep on the hour.
+        */
+       if (w->clock.chime == TRUE) {
+           if (w->clock.beeped && (tm.tm_min != 30) &&
+               (tm.tm_min != 0))
+             w->clock.beeped = FALSE;
+           if (((tm.tm_min == 30) || (tm.tm_min == 0))
+               && (!w->clock.beeped)) {
+               w->clock.beeped = TRUE;
+#ifdef XKB
+               if (tm.tm_min==0) {
+                   XkbStdBell(dpy,win,50,XkbBI_ClockChimeHour);
+                   XkbStdBell(dpy,win,50,XkbBI_RepeatingLastBell);
+               }
+               else {
+                   XkbStdBell(dpy,win,50,XkbBI_ClockChimeHalf);
+               }
+#else
+               XBell(dpy, 50);
+               if (tm.tm_min == 0)
+                 XBell(dpy, 50);
+#endif
+           }
+       }
+       if( w->clock.analog == FALSE ) {
+           int clear_from = w->core.width;
+           int i, len, prev_len;
+
+           time_ptr = TimeString (w, &tm);
+           len = strlen (time_ptr);
+           if (len && time_ptr[len - 1] == '\n') time_ptr[--len] = '\0';
+           prev_len = strlen (w->clock.prev_time_string);
+           for (i = 0; ((i < len) && (i < prev_len) &&
+                        (w->clock.prev_time_string[i] == time_ptr[i])); i++);
+
+#ifdef XRENDER
+           if (w->clock.render)
+           {
+               XRectangle  old_tail, new_tail, head;
+               int         x, y;
+#if !defined(NO_I18N) && defined(HAVE_ICONV)
+               char *utf8_str;
+#endif
+
+               RenderTextBounds (w, w->clock.prev_time_string, i, prev_len,
+                                 &old_tail, NULL, NULL);
+               RenderUpdateRectBounds (&old_tail, &w->clock.damage);
+               RenderTextBounds (w, time_ptr, i, len,
+                                 &new_tail, NULL, NULL);
+               RenderUpdateRectBounds (&new_tail, &w->clock.damage);
+
+               while (i)
+               {
+                   RenderTextBounds (w, time_ptr, 0, i, &head, NULL, NULL);
+                   if (!RenderRectIn (&head, &w->clock.damage))
+                       break;
+                   i--;
+               }
+               RenderTextBounds (w, time_ptr, i, len, &new_tail, &x, &y);
+               RenderClip (w);
+               RenderPrepare (w, NULL);
+#ifndef NO_I18N
+               if (w->clock.utf8) {
+                   XftDrawStringUtf8 (w->clock.draw,
+                                   &w->clock.fg_color,
+                                   w->clock.face,
+                                   x, y,
+                                   (FcChar8 *) time_ptr + i, len - i);
+
+               }
+# ifdef HAVE_ICONV
+               else if ((utf8_str =
+                   clock_to_utf8(time_ptr + i, len - i)) != NULL) {
+                       XftDrawStringUtf8 (w->clock.draw,
+                                   &w->clock.fg_color,
+                                   w->clock.face,
+                                   x, y,
+                                   (FcChar8 *)utf8_str, strlen(utf8_str) );
+                   free(utf8_str);
+               }
+# endif
+               else
+#endif
+               {
+                   XftDrawString8 (w->clock.draw,
+                                   &w->clock.fg_color,
+                                   w->clock.face,
+                                   x, y,
+                                   (FcChar8 *) time_ptr + i, len - i);
+               }
+               RenderUpdate (w);
+               RenderResetBounds (&w->clock.damage);
+           }
+           else
+#endif
+#ifndef NO_I18N
+           if(!no_locale) {
+               if(0 < len) {
+                   XFontSetExtents *fse
+                     = XExtentsOfFontSet(w->clock.fontSet);
+
+                   XmbDrawImageString(dpy,win,w->clock.fontSet,w->clock.myGC,
+                                      (2+w->clock.padding +
+                                       (i?XmbTextEscapement(w->clock.fontSet,
+                                                            time_ptr,i):0)),
+                                      2+w->clock.padding+fse->max_logical_extent.height,
+                                      time_ptr+i,len-i
+                       );
+                   /*
+                    * Clear any left over bits
+                    */
+                   clear_from = XmbTextEscapement (w->clock.fontSet,time_ptr,
+                                                   len) + 2+w->clock.padding;
+               }
+           } else
+#endif /* NO_I18N */
+           {
+               XDrawImageString (dpy, win, w->clock.myGC,
+                                 (1+w->clock.padding +
+                                  XTextWidth (w->clock.font, time_ptr, i)),
+                                 w->clock.font->ascent+w->clock.padding,
+                                 time_ptr + i, len - i);
+               /*
+                * Clear any left over bits
+                */
+               clear_from = XTextWidth (w->clock.font, time_ptr, len)
+                            + 2 + w->clock.padding;
+           }
+           if (clear_from < (int)w->core.width)
+               XClearArea (dpy, win,
+                   clear_from, 0, w->core.width - clear_from, w->core.height,
+                   False);
+#if defined(HAS_STRLCAT) || defined(HAVE_STRLCPY)
+           strlcpy (w->clock.prev_time_string+i, time_ptr+i,
+                    sizeof(w->clock.prev_time_string)-i);
+#else
+           strncpy (w->clock.prev_time_string+i, time_ptr+i,
+                    sizeof(w->clock.prev_time_string)-i);
+           w->clock.prev_time_string[sizeof(w->clock.prev_time_string)-1] = 0;
+#endif
+       } else {
+                       /*
+                        * The second (or minute) hand is sec (or min)
+                        * sixtieths around the clock face. The hour hand is
+                        * (hour + min/60) twelfths of the way around the
+                        * clock-face.  The derivation is left as an excercise
+                        * for the reader.
+                        */
+
+                       /*
+                        * 12 hour clock.
+                        */
+                       if(tm.tm_hour >= 12)
+                               tm.tm_hour -= 12;
+
+#ifdef XRENDER
+                       if (w->clock.render && w->clock.can_polygon)
+                       {
+                           w->clock.mask_format = XRenderFindStandardFormat (XtDisplay (w),
+                                                                             w->clock.sharp ?
+                                                                             PictStandardA1 :
+                                                                             PictStandardA8);
+                           /*
+                            * Compute repaint area
+                            */
+                           if (tm.tm_min != w->clock.otm.tm_min ||
+                               tm.tm_hour != w->clock.otm.tm_hour ||
+                               tm.tm_sec != w->clock.otm.tm_sec)
+                           {
+                               RenderHands (w, &w->clock.otm, False);
+                               RenderHands (w, &tm, False);
+                           }
+                           if (w->clock.show_second_hand &&
+                               tm.tm_sec != w->clock.otm.tm_sec)
+                           {
+                               RenderSec (w, &w->clock.otm, False);
+                               RenderSec (w, &tm, False);
+                           }
+                           if (w->clock.damage.width &&
+                               w->clock.damage.height)
+                           {
+                               RenderClip (w);
+                               DrawClockFace (w);
+                               RenderHands (w, &tm, True);
+                               if (w->clock.show_second_hand == TRUE)
+                                   RenderSec (w, &tm, True);
+                           }
+                           w->clock.otm = tm;
+                           RenderUpdate (w);
+                           RenderResetBounds (&w->clock.damage);
+                           return;
+                       }
+#endif
+
+                       erase_hands (w, &tm);
+
+                   if (w->clock.numseg == 0 ||
+                       tm.tm_min != w->clock.otm.tm_min ||
+                       tm.tm_hour != w->clock.otm.tm_hour) {
+                           w->clock.segbuffptr = w->clock.segbuff;
+                           w->clock.numseg = 0;
+                           /*
+                            * Calculate the hour hand, fill it in with its
+                            * color and then outline it.  Next, do the same
+                            * with the minute hand.  This is a cheap hidden
+                            * line algorithm.
+                            */
+                           DrawHand(w,
+                               w->clock.minute_hand_length, w->clock.hand_width,
+                               tm.tm_min * 60
+                           );
+                           if(w->clock.Hdpixel != w->core.background_pixel)
+                               XFillPolygon( dpy,
+                                   win, w->clock.HandGC,
+                                   w->clock.segbuff, VERTICES_IN_HANDS,
+                                   Convex, CoordModeOrigin
+                               );
+                           XDrawLines( dpy,
+                               win, w->clock.HighGC,
+                               w->clock.segbuff, VERTICES_IN_HANDS,
+                                      CoordModeOrigin);
+                           w->clock.hour = w->clock.segbuffptr;
+                           DrawHand(w,
+                               w->clock.hour_hand_length, w->clock.hand_width,
+                               tm.tm_hour * 300 + tm.tm_min * 5
+                           );
+                           if(w->clock.Hdpixel != w->core.background_pixel) {
+                             XFillPolygon(dpy,
+                                          win, w->clock.HandGC,
+                                          w->clock.hour,
+                                          VERTICES_IN_HANDS,
+                                          Convex, CoordModeOrigin
+                                          );
+                           }
+                           XDrawLines( dpy,
+                                      win, w->clock.HighGC,
+                                      w->clock.hour, VERTICES_IN_HANDS,
+                                      CoordModeOrigin );
+
+                           w->clock.sec = w->clock.segbuffptr;
+                   }
+                   if (w->clock.show_second_hand == TRUE) {
+                           w->clock.segbuffptr = w->clock.sec;
+                           DrawSecond(w,
+                               w->clock.second_hand_length - 2,
+                               w->clock.second_hand_width,
+                               w->clock.minute_hand_length + 2,
+                               tm.tm_sec * 60
+                           );
+                           if(w->clock.Hdpixel != w->core.background_pixel)
+                               XFillPolygon( dpy,
+                                   win, w->clock.HandGC,
+                                   w->clock.sec,
+                                   VERTICES_IN_HANDS -2,
+                                   Convex, CoordModeOrigin
+                           );
+                           XDrawLines( dpy,
+                                      win, w->clock.HighGC,
+                                      w->clock.sec,
+                                      VERTICES_IN_HANDS-1,
+                                      CoordModeOrigin
+                                       );
+
+                       }
+                       w->clock.otm = tm;
+               }
+}
+
+static void
+erase_hands(ClockWidget w, struct tm *tm)
+{
+    /*
+     * Erase old hands.
+     */
+    if(w->clock.numseg > 0) {
+       Display *dpy;
+       Window  win;
+
+       dpy = XtDisplay (w);
+       win = XtWindow (w);
+       if (w->clock.show_second_hand == TRUE) {
+           XDrawLines(dpy, win,
+               w->clock.EraseGC,
+               w->clock.sec,
+               VERTICES_IN_HANDS-1,
+               CoordModeOrigin);
+           if(w->clock.Hdpixel != w->core.background_pixel) {
+               XFillPolygon(dpy,
+                       win, w->clock.EraseGC,
+                       w->clock.sec,
+                       VERTICES_IN_HANDS-2,
+                       Convex, CoordModeOrigin
+                       );
+           }
+       }
+       if(!tm || tm->tm_min != w->clock.otm.tm_min ||
+                 tm->tm_hour != w->clock.otm.tm_hour)
+       {
+           XDrawLines( dpy, win,
+                       w->clock.EraseGC,
+                       w->clock.segbuff,
+                       VERTICES_IN_HANDS,
+                       CoordModeOrigin);
+           XDrawLines( dpy, win,
+                       w->clock.EraseGC,
+                       w->clock.hour,
+                       VERTICES_IN_HANDS,
+                       CoordModeOrigin);
+           if(w->clock.Hdpixel != w->core.background_pixel) {
+               XFillPolygon( dpy, win,
+                             w->clock.EraseGC,
+                             w->clock.segbuff, VERTICES_IN_HANDS,
+                             Convex, CoordModeOrigin);
+               XFillPolygon( dpy, win,
+                             w->clock.EraseGC,
+                             w->clock.hour,
+                             VERTICES_IN_HANDS,
+                             Convex, CoordModeOrigin);
+           }
+       }
+    }
+}
+
+static float const Sines[] = {
+0.000000, 0.001745, 0.003490, 0.005235, 0.006981, 0.008726, 0.010471, 0.012217,
+0.013962, 0.015707, 0.017452, 0.019197, 0.020942, 0.022687, 0.024432, 0.026176,
+0.027921, 0.029666, 0.031410, 0.033155, 0.034899, 0.036643, 0.038387, 0.040131,
+0.041875, 0.043619, 0.045362, 0.047106, 0.048849, 0.050592, 0.052335, 0.054078,
+0.055821, 0.057564, 0.059306, 0.061048, 0.062790, 0.064532, 0.066273, 0.068015,
+0.069756, 0.071497, 0.073238, 0.074978, 0.076719, 0.078459, 0.080198, 0.081938,
+0.083677, 0.085416, 0.087155, 0.088894, 0.090632, 0.092370, 0.094108, 0.095845,
+0.097582, 0.099319, 0.101056, 0.102792, 0.104528, 0.106264, 0.107999, 0.109734,
+0.111468, 0.113203, 0.114937, 0.116670, 0.118403, 0.120136, 0.121869, 0.123601,
+0.125333, 0.127064, 0.128795, 0.130526, 0.132256, 0.133986, 0.135715, 0.137444,
+0.139173, 0.140901, 0.142628, 0.144356, 0.146083, 0.147809, 0.149535, 0.151260,
+0.152985, 0.154710, 0.156434, 0.158158, 0.159881, 0.161603, 0.163325, 0.165047,
+0.166768, 0.168489, 0.170209, 0.171929, 0.173648, 0.175366, 0.177084, 0.178802,
+0.180519, 0.182235, 0.183951, 0.185666, 0.187381, 0.189095, 0.190808, 0.192521,
+0.194234, 0.195946, 0.197657, 0.199367, 0.201077, 0.202787, 0.204496, 0.206204,
+0.207911, 0.209618, 0.211324, 0.213030, 0.214735, 0.216439, 0.218143, 0.219846,
+0.221548, 0.223250, 0.224951, 0.226651, 0.228350, 0.230049, 0.231747, 0.233445,
+0.235142, 0.236838, 0.238533, 0.240228, 0.241921, 0.243615, 0.245307, 0.246999,
+0.248689, 0.250380, 0.252069, 0.253757, 0.255445, 0.257132, 0.258819, 0.260504,
+0.262189, 0.263873, 0.265556, 0.267238, 0.268919, 0.270600, 0.272280, 0.273959,
+0.275637, 0.277314, 0.278991, 0.280666, 0.282341, 0.284015, 0.285688, 0.287360,
+0.289031, 0.290702, 0.292371, 0.294040, 0.295708, 0.297374, 0.299040, 0.300705,
+0.302369, 0.304033, 0.305695, 0.307356, 0.309016, 0.310676, 0.312334, 0.313992,
+0.315649, 0.317304, 0.318959, 0.320612, 0.322265, 0.323917, 0.325568, 0.327217,
+0.328866, 0.330514, 0.332161, 0.333806, 0.335451, 0.337095, 0.338737, 0.340379,
+0.342020, 0.343659, 0.345298, 0.346935, 0.348572, 0.350207, 0.351841, 0.353474,
+0.355106, 0.356737, 0.358367, 0.359996, 0.361624, 0.363251, 0.364876, 0.366501,
+0.368124, 0.369746, 0.371367, 0.372987, 0.374606, 0.376224, 0.377840, 0.379456,
+0.381070, 0.382683, 0.384295, 0.385906, 0.387515, 0.389123, 0.390731, 0.392337,
+0.393941, 0.395545, 0.397147, 0.398749, 0.400349, 0.401947, 0.403545, 0.405141,
+0.406736, 0.408330, 0.409923, 0.411514, 0.413104, 0.414693, 0.416280, 0.417867,
+0.419452, 0.421035, 0.422618, 0.424199, 0.425779, 0.427357, 0.428935, 0.430511,
+0.432085, 0.433659, 0.435231, 0.436801, 0.438371, 0.439939, 0.441505, 0.443071,
+0.444635, 0.446197, 0.447759, 0.449318, 0.450877, 0.452434, 0.453990, 0.455544,
+0.457097, 0.458649, 0.460199, 0.461748, 0.463296, 0.464842, 0.466386, 0.467929,
+0.469471, 0.471011, 0.472550, 0.474088, 0.475624, 0.477158, 0.478691, 0.480223,
+0.481753, 0.483282, 0.484809, 0.486335, 0.487859, 0.489382, 0.490903, 0.492423,
+0.493941, 0.495458, 0.496973, 0.498487, 0.499999, 0.501510, 0.503019, 0.504527,
+0.506033, 0.507538, 0.509041, 0.510542, 0.512042, 0.513541, 0.515038, 0.516533,
+0.518027, 0.519519, 0.521009, 0.522498, 0.523985, 0.525471, 0.526955, 0.528438,
+0.529919, 0.531398, 0.532876, 0.534352, 0.535826, 0.537299, 0.538770, 0.540240,
+0.541708, 0.543174, 0.544639, 0.546101, 0.547563, 0.549022, 0.550480, 0.551936,
+0.553391, 0.554844, 0.556295, 0.557745, 0.559192, 0.560638, 0.562083, 0.563526,
+0.564967, 0.566406, 0.567843, 0.569279, 0.570713, 0.572145, 0.573576, 0.575005,
+0.576432, 0.577857, 0.579281, 0.580702, 0.582122, 0.583541, 0.584957, 0.586372,
+0.587785, 0.589196, 0.590605, 0.592013, 0.593418, 0.594822, 0.596224, 0.597625,
+0.599023, 0.600420, 0.601815, 0.603207, 0.604599, 0.605988, 0.607375, 0.608761,
+0.610145, 0.611527, 0.612907, 0.614285, 0.615661, 0.617035, 0.618408, 0.619779,
+0.621147, 0.622514, 0.623879, 0.625242, 0.626603, 0.627963, 0.629320, 0.630675,
+0.632029, 0.633380, 0.634730, 0.636078, 0.637423, 0.638767, 0.640109, 0.641449,
+0.642787, 0.644123, 0.645457, 0.646789, 0.648119, 0.649448, 0.650774, 0.652098,
+0.653420, 0.654740, 0.656059, 0.657375, 0.658689, 0.660001, 0.661311, 0.662620,
+0.663926, 0.665230, 0.666532, 0.667832, 0.669130, 0.670426, 0.671720, 0.673012,
+0.674302, 0.675590, 0.676875, 0.678159, 0.679441, 0.680720, 0.681998, 0.683273,
+0.684547, 0.685818, 0.687087, 0.688354, 0.689619, 0.690882, 0.692143, 0.693401,
+0.694658, 0.695912, 0.697165, 0.698415, 0.699663, 0.700909, 0.702153, 0.703394,
+0.704634, 0.705871, 0.707106,
+};
+static float const Cosines[] = {
+1.000000, 0.999998, 0.999993, 0.999986, 0.999975, 0.999961, 0.999945, 0.999925,
+0.999902, 0.999876, 0.999847, 0.999815, 0.999780, 0.999742, 0.999701, 0.999657,
+0.999610, 0.999559, 0.999506, 0.999450, 0.999390, 0.999328, 0.999262, 0.999194,
+0.999122, 0.999048, 0.998970, 0.998889, 0.998806, 0.998719, 0.998629, 0.998536,
+0.998440, 0.998341, 0.998239, 0.998134, 0.998026, 0.997915, 0.997801, 0.997684,
+0.997564, 0.997440, 0.997314, 0.997185, 0.997052, 0.996917, 0.996778, 0.996637,
+0.996492, 0.996345, 0.996194, 0.996041, 0.995884, 0.995724, 0.995561, 0.995396,
+0.995227, 0.995055, 0.994880, 0.994702, 0.994521, 0.994337, 0.994150, 0.993960,
+0.993767, 0.993571, 0.993372, 0.993170, 0.992965, 0.992757, 0.992546, 0.992331,
+0.992114, 0.991894, 0.991671, 0.991444, 0.991215, 0.990983, 0.990747, 0.990509,
+0.990268, 0.990023, 0.989776, 0.989525, 0.989272, 0.989015, 0.988756, 0.988493,
+0.988228, 0.987959, 0.987688, 0.987413, 0.987136, 0.986855, 0.986572, 0.986285,
+0.985996, 0.985703, 0.985407, 0.985109, 0.984807, 0.984503, 0.984195, 0.983885,
+0.983571, 0.983254, 0.982935, 0.982612, 0.982287, 0.981958, 0.981627, 0.981292,
+0.980955, 0.980614, 0.980271, 0.979924, 0.979575, 0.979222, 0.978867, 0.978508,
+0.978147, 0.977783, 0.977415, 0.977045, 0.976672, 0.976296, 0.975916, 0.975534,
+0.975149, 0.974761, 0.974370, 0.973975, 0.973578, 0.973178, 0.972775, 0.972369,
+0.971961, 0.971549, 0.971134, 0.970716, 0.970295, 0.969872, 0.969445, 0.969015,
+0.968583, 0.968147, 0.967709, 0.967267, 0.966823, 0.966376, 0.965925, 0.965472,
+0.965016, 0.964557, 0.964095, 0.963630, 0.963162, 0.962691, 0.962217, 0.961741,
+0.961261, 0.960779, 0.960293, 0.959805, 0.959313, 0.958819, 0.958322, 0.957822,
+0.957319, 0.956813, 0.956304, 0.955793, 0.955278, 0.954760, 0.954240, 0.953716,
+0.953190, 0.952661, 0.952129, 0.951594, 0.951056, 0.950515, 0.949972, 0.949425,
+0.948876, 0.948323, 0.947768, 0.947210, 0.946649, 0.946085, 0.945518, 0.944948,
+0.944376, 0.943800, 0.943222, 0.942641, 0.942057, 0.941470, 0.940880, 0.940288,
+0.939692, 0.939094, 0.938493, 0.937888, 0.937281, 0.936672, 0.936059, 0.935444,
+0.934825, 0.934204, 0.933580, 0.932953, 0.932323, 0.931691, 0.931055, 0.930417,
+0.929776, 0.929132, 0.928485, 0.927836, 0.927183, 0.926528, 0.925870, 0.925209,
+0.924546, 0.923879, 0.923210, 0.922538, 0.921863, 0.921185, 0.920504, 0.919821,
+0.919135, 0.918446, 0.917754, 0.917060, 0.916362, 0.915662, 0.914959, 0.914253,
+0.913545, 0.912834, 0.912120, 0.911403, 0.910683, 0.909961, 0.909236, 0.908508,
+0.907777, 0.907044, 0.906307, 0.905568, 0.904827, 0.904082, 0.903335, 0.902585,
+0.901832, 0.901077, 0.900318, 0.899557, 0.898794, 0.898027, 0.897258, 0.896486,
+0.895711, 0.894934, 0.894154, 0.893371, 0.892585, 0.891797, 0.891006, 0.890212,
+0.889416, 0.888617, 0.887815, 0.887010, 0.886203, 0.885393, 0.884580, 0.883765,
+0.882947, 0.882126, 0.881303, 0.880477, 0.879648, 0.878817, 0.877982, 0.877146,
+0.876306, 0.875464, 0.874619, 0.873772, 0.872922, 0.872069, 0.871213, 0.870355,
+0.869494, 0.868631, 0.867765, 0.866896, 0.866025, 0.865151, 0.864274, 0.863395,
+0.862513, 0.861629, 0.860742, 0.859852, 0.858959, 0.858064, 0.857167, 0.856267,
+0.855364, 0.854458, 0.853550, 0.852640, 0.851726, 0.850811, 0.849892, 0.848971,
+0.848048, 0.847121, 0.846193, 0.845261, 0.844327, 0.843391, 0.842452, 0.841510,
+0.840566, 0.839619, 0.838670, 0.837718, 0.836764, 0.835807, 0.834847, 0.833885,
+0.832921, 0.831954, 0.830984, 0.830012, 0.829037, 0.828060, 0.827080, 0.826098,
+0.825113, 0.824126, 0.823136, 0.822144, 0.821149, 0.820151, 0.819152, 0.818149,
+0.817144, 0.816137, 0.815127, 0.814115, 0.813100, 0.812083, 0.811063, 0.810041,
+0.809016, 0.807989, 0.806960, 0.805928, 0.804893, 0.803856, 0.802817, 0.801775,
+0.800731, 0.799684, 0.798635, 0.797583, 0.796529, 0.795473, 0.794414, 0.793353,
+0.792289, 0.791223, 0.790155, 0.789084, 0.788010, 0.786935, 0.785856, 0.784776,
+0.783693, 0.782608, 0.781520, 0.780430, 0.779337, 0.778243, 0.777145, 0.776046,
+0.774944, 0.773840, 0.772733, 0.771624, 0.770513, 0.769399, 0.768283, 0.767165,
+0.766044, 0.764921, 0.763796, 0.762668, 0.761538, 0.760405, 0.759271, 0.758134,
+0.756995, 0.755853, 0.754709, 0.753563, 0.752414, 0.751264, 0.750111, 0.748955,
+0.747798, 0.746638, 0.745475, 0.744311, 0.743144, 0.741975, 0.740804, 0.739631,
+0.738455, 0.737277, 0.736097, 0.734914, 0.733729, 0.732542, 0.731353, 0.730162,
+0.728968, 0.727772, 0.726574, 0.725374, 0.724171, 0.722967, 0.721760, 0.720551,
+0.719339, 0.718126, 0.716910, 0.715692, 0.714472, 0.713250, 0.712026, 0.710799,
+0.709570, 0.708339, 0.707106,
+};
+
+static void
+ClockAngle(int tick_units, double *sinp, double *cosp)
+{
+    int reduced, upper;
+
+    reduced = tick_units % 450;
+    upper = tick_units / 450;
+    if (upper & 1)
+       reduced = 450 - reduced;
+    if ((upper + 1) & 2) {
+       *sinp = Cosines[reduced];
+       *cosp = Sines[reduced];
+    } else {
+       *sinp = Sines[reduced];
+       *cosp = Cosines[reduced];
+    }
+    if (upper >= 2 && upper < 6)
+       *cosp = -*cosp;
+    if (upper >= 4)
+       *sinp = -*sinp;
+}
+
+/*
+ * DrawLine - Draws a line.
+ *
+ * blank_length is the distance from the center which the line begins.
+ * length is the maximum length of the hand.
+ * Tick_units is a number between zero and 12*60 indicating
+ * how far around the circle (clockwise) from high noon.
+ *
+ * The blank_length feature is because I wanted to draw tick-marks around the
+ * circle (for seconds).  The obvious means of drawing lines from the center
+ * to the perimeter, then erasing all but the outside most pixels doesn't
+ * work because of round-off error (sigh).
+ */
+static void
+DrawLine(ClockWidget w, Dimension blank_length, Dimension length,
+        int tick_units)
+{
+       double dblank_length = (double)blank_length, dlength = (double)length;
+       double cosangle, sinangle;
+       int cx = w->clock.centerX, cy = w->clock.centerY, x1, y1, x2, y2;
+
+       /*
+        *  Angles are measured from 12 o'clock, clockwise increasing.
+        *  Since in X, +x is to the right and +y is downward:
+        *
+        *      x = x0 + r * sin(theta)
+        *      y = y0 - r * cos(theta)
+        *
+        */
+       ClockAngle(tick_units, &sinangle, &cosangle);
+
+       /* break this out so that stupid compilers can cope */
+       x1 = cx + (int)(dblank_length * sinangle);
+       y1 = cy - (int)(dblank_length * cosangle);
+       x2 = cx + (int)(dlength * sinangle);
+       y2 = cy - (int)(dlength * cosangle);
+       SetSeg(w, x1, y1, x2, y2);
+}
+
+/*
+ * DrawHand - Draws a hand.
+ *
+ * length is the maximum length of the hand.
+ * width is the half-width of the hand.
+ * Tick_units is a number between zero and 12*60 indicating
+ * how far around the circle (clockwise) from high noon.
+ *
+ */
+static void
+DrawHand(ClockWidget w, Dimension length, Dimension width, int tick_units)
+{
+
+       double cosangle, sinangle;
+       register double ws, wc;
+       Position x, y, x1, y1, x2, y2;
+
+       /*
+        *  Angles are measured from 12 o'clock, clockwise increasing.
+        *  Since in X, +x is to the right and +y is downward:
+        *
+        *      x = x0 + r * sin(theta)
+        *      y = y0 - r * cos(theta)
+        *
+        */
+       ClockAngle(tick_units, &sinangle, &cosangle);
+       /*
+        * Order of points when drawing the hand.
+        *
+        *              1,4
+        *              / \
+        *             /   \
+        *            /     \
+        *          2 ------- 3
+        */
+       wc = width * cosangle;
+       ws = width * sinangle;
+       SetSeg(w,
+              x = w->clock.centerX + clock_round(length * sinangle),
+              y = w->clock.centerY - clock_round(length * cosangle),
+              x1 = w->clock.centerX - clock_round(ws + wc),
+              y1 = w->clock.centerY + clock_round(wc - ws));  /* 1 ---- 2 */
+       /* 2 */
+       SetSeg(w, x1, y1,
+              x2 = w->clock.centerX - clock_round(ws - wc),
+              y2 = w->clock.centerY + clock_round(wc + ws));  /* 2 ----- 3 */
+
+       SetSeg(w, x2, y2, x, y);        /* 3 ----- 1(4) */
+}
+
+/*
+ * DrawSecond - Draws the second hand (diamond).
+ *
+ * length is the maximum length of the hand.
+ * width is the half-width of the hand.
+ * offset is direct distance from center to tail end.
+ * Tick_units is a number between zero and 12*60 indicating
+ * how far around the circle (clockwise) from high noon.
+ *
+ */
+static void
+DrawSecond(ClockWidget w, Dimension length, Dimension width,
+          Dimension offset, int tick_units)
+{
+
+       double cosangle, sinangle;
+       register double ms, mc, ws, wc;
+       register int mid;
+       Position x, y;
+
+       /*
+        *  Angles are measured from 12 o'clock, clockwise increasing.
+        *  Since in X, +x is to the right and +y is downward:
+        *
+        *      x = x0 + r * sin(theta)
+        *      y = y0 - r * cos(theta)
+        *
+        */
+       ClockAngle(tick_units, &sinangle, &cosangle);
+       /*
+        * Order of points when drawing the hand.
+        *
+        *              1,5
+        *              / \
+        *             /   \
+        *            /     \
+        *          2<       >4
+        *            \     /
+        *             \   /
+        *              \ /
+        *      -        3
+        *      |
+        *      |
+        *   offset
+        *      |
+        *      |
+        *      -        + center
+        */
+
+       mid = (int) (length + offset) / 2;
+       mc = mid * cosangle;
+       ms = mid * sinangle;
+       wc = width * cosangle;
+       ws = width * sinangle;
+       /*1 ---- 2 */
+       SetSeg(w,
+              x = w->clock.centerX + clock_round(length * sinangle),
+              y = w->clock.centerY - clock_round(length * cosangle),
+              w->clock.centerX + clock_round(ms - wc),
+              w->clock.centerY - clock_round(mc + ws) );
+       SetSeg(w, w->clock.centerX + clock_round(offset *sinangle),
+              w->clock.centerY - clock_round(offset * cosangle), /* 2-----3 */
+              w->clock.centerX + clock_round(ms + wc),
+              w->clock.centerY - clock_round(mc - ws));
+       w->clock.segbuffptr->x = x;
+       w->clock.segbuffptr++->y = y;
+       w->clock.numseg ++;
+}
+
+static void
+SetSeg(ClockWidget w, int x1, int y1, int x2, int y2)
+{
+       w->clock.segbuffptr->x = x1;
+       w->clock.segbuffptr++->y = y1;
+       w->clock.segbuffptr->x = x2;
+       w->clock.segbuffptr++->y = y2;
+       w->clock.numseg += 2;
+}
+
+/*
+ *  Draw the clock face (every fifth tick-mark is longer
+ *  than the others).
+ */
+static void
+DrawClockFace(ClockWidget w)
+{
+       register int i;
+       register int delta = (int)(w->clock.radius - w->clock.second_hand_length) / 3;
+
+       w->clock.segbuffptr = w->clock.segbuff;
+       w->clock.numseg = 0;
+       for (i = 0; i < 60; i++)
+       {
+#ifdef XRENDER
+           if (w->clock.render && w->clock.can_polygon)
+           {
+               double  s, c;
+               XDouble x1, y1, x2, y2;
+               XftColor        *color;
+               ClockAngle (i * 60, &s, &c);
+               x1 = c;
+               y1 = s;
+               if (i % 5)
+               {
+                   x2 = c * (MINOR_TICK_FRACT / 100.0);
+                   y2 = s * (MINOR_TICK_FRACT / 100.0);
+                   color = &w->clock.minor_color;
+               }
+               else
+               {
+                   x2 = c * (SECOND_HAND_FRACT / 100.0);
+                   y2 = s * (SECOND_HAND_FRACT / 100.0);
+                   color = &w->clock.major_color;
+               }
+               RenderLine (w, x1, y1, x2, y2, color, True);
+           }
+           else
+#endif
+           {
+               DrawLine(w, ( (i % 5) == 0 ?
+                            w->clock.second_hand_length :
+                            (w->clock.radius - delta) ),
+                        w->clock.radius, i * 60);
+           }
+       }
+#ifdef XRENDER
+       if (w->clock.render && w->clock.can_polygon)
+           return;
+#endif
+       /*
+        * Go ahead and draw it.
+        */
+       XDrawSegments(XtDisplay(w), XtWindow(w),
+                     w->clock.myGC, (XSegment *) &(w->clock.segbuff[0]),
+                     w->clock.numseg/2);
+
+       w->clock.segbuffptr = w->clock.segbuff;
+       w->clock.numseg = 0;
+}
+
+static int
+clock_round(double x)
+{
+       return(x >= 0.0 ? (int)(x + .5) : (int)(x - .5));
+}
+
+#ifdef XRENDER
+static Boolean
+sameColor (XftColor *old, XftColor *new)
+{
+    if (old->color.red != new->color.red) return False;
+    if (old->color.green != new->color.green) return False;
+    if (old->color.blue != new->color.blue) return False;
+    if (old->color.alpha != new->color.alpha) return False;
+    return True;
+}
+#endif
+
+/* ARGSUSED */
+static Boolean
+SetValues(Widget gcurrent, Widget grequest, Widget gnew,
+         ArgList args, Cardinal *num_args)
+{
+      ClockWidget current = (ClockWidget) gcurrent;
+      ClockWidget new = (ClockWidget) gnew;
+      Boolean redisplay = FALSE;
+      XtGCMask valuemask;
+      XGCValues        myXGCV;
+
+      /* first check for changes to clock-specific resources.  We'll accept all
+         the changes, but may need to do some computations first. */
+
+      if (new->clock.update != current->clock.update) {
+         if (current->clock.interval_id)
+             XtRemoveTimeOut (current->clock.interval_id);
+         if (new->clock.update && XtIsRealized( (Widget) new))
+             new->clock.interval_id = XtAppAddTimeOut(
+                                         XtWidgetToApplicationContext(gnew),
+                                        abs(new->clock.update)*1000,
+                                        clock_tic, (XtPointer)gnew);
+
+         new->clock.show_second_hand =(abs(new->clock.update) <= SECOND_HAND_TIME);
+         if (new->clock.show_second_hand != current->clock.show_second_hand)
+           redisplay = TRUE;
+      }
+
+      if (new->clock.padding != current->clock.padding)
+          redisplay = TRUE;
+
+      if (new->clock.analog != current->clock.analog)
+          redisplay = TRUE;
+
+       if (new->clock.font != current->clock.font)
+          redisplay = TRUE;
+
+#ifndef NO_I18N
+       if (new->clock.fontSet != current->clock.fontSet)
+          redisplay = TRUE;
+#endif
+
+      if ((ClockFgPixel(new) != ClockFgPixel (current))
+          || (new->core.background_pixel != current->core.background_pixel)) {
+          valuemask = GCForeground | GCBackground | GCFont | GCLineWidth;
+         myXGCV.foreground = ClockFgPixel (new);
+         myXGCV.background = new->core.background_pixel;
+          myXGCV.font = new->clock.font->fid;
+         myXGCV.line_width = 0;
+         XtReleaseGC (gcurrent, current->clock.myGC);
+         new->clock.myGC = XtGetGC(gcurrent, valuemask, &myXGCV);
+         redisplay = TRUE;
+          }
+
+      if (new->clock.Hipixel != current->clock.Hipixel) {
+          valuemask = GCForeground | GCLineWidth;
+         myXGCV.foreground = new->clock.Hipixel;
+          myXGCV.font = new->clock.font->fid;
+         myXGCV.line_width = 0;
+         XtReleaseGC (gcurrent, current->clock.HighGC);
+         new->clock.HighGC = XtGetGC((Widget)gcurrent, valuemask, &myXGCV);
+         redisplay = TRUE;
+          }
+
+      if (new->clock.Hdpixel != current->clock.Hdpixel) {
+          valuemask = GCForeground;
+         myXGCV.foreground = new->clock.Hdpixel;
+         XtReleaseGC (gcurrent, current->clock.HandGC);
+         new->clock.HandGC = XtGetGC((Widget)gcurrent, valuemask, &myXGCV);
+         redisplay = TRUE;
+          }
+
+      if (new->core.background_pixel != current->core.background_pixel) {
+          valuemask = GCForeground | GCLineWidth | GCGraphicsExposures;
+         myXGCV.foreground = new->core.background_pixel;
+         myXGCV.line_width = 0;
+         myXGCV.graphics_exposures = False;
+         XtReleaseGC (gcurrent, current->clock.EraseGC);
+         new->clock.EraseGC = XtGetGC((Widget)gcurrent, valuemask, &myXGCV);
+         redisplay = TRUE;
+         }
+#ifdef XRENDER
+     if (new->clock.face != current->clock.face)
+       redisplay = TRUE;
+     if (!sameColor (&new->clock.hour_color, &current->clock.fg_color) ||
+        !sameColor (&new->clock.hour_color, &current->clock.hour_color) ||
+        !sameColor (&new->clock.min_color, &current->clock.min_color) ||
+        !sameColor (&new->clock.sec_color, &current->clock.sec_color) ||
+        !sameColor (&new->clock.major_color, &current->clock.major_color) ||
+        !sameColor (&new->clock.minor_color, &current->clock.minor_color))
+       redisplay = True;
+    if (new->clock.sharp != current->clock.sharp)
+       redisplay = True;
+    if (new->clock.render != current->clock.render)
+       redisplay = True;
+    if (new->clock.buffer != current->clock.buffer)
+    {
+       if (new->clock.pixmap)
+       {
+           XFreePixmap (XtDisplay (new), new->clock.pixmap);
+           new->clock.pixmap = 0;
+       }
+       if (new->clock.draw)
+       {
+           XftDrawDestroy (new->clock.draw);
+           new->clock.draw = NULL;
+       }
+       new->clock.picture = 0;
+    }
+#endif
+     return (redisplay);
+
+}
+
+#if !defined(NO_I18N) && defined(HAVE_ICONV)
+static char *
+clock_to_utf8(const char *str, int in_len)
+{
+    iconv_t cd;
+    char *buf;
+    size_t buf_size;
+    size_t ileft, oleft;
+    const char *inptr;
+    char *outptr;
+    size_t ret;
+    const char *code_set = nl_langinfo(CODESET);
+
+    if (str == NULL ||code_set == NULL || strcasecmp(code_set, "646") == 0)
+       return NULL;
+
+    if (strcasecmp(code_set, "UTF-8") == 0)
+       return strdup(str);
+
+    cd = iconv_open("UTF-8", code_set);
+    if (cd == (iconv_t)-1)
+       return NULL;
+
+    buf_size = MB_LEN_MAX * (in_len + 1);
+    if ((buf = malloc(buf_size)) == NULL) {
+       (void) iconv_close(cd);
+       return NULL;
+    }
+
+    inptr = str;
+    ileft = in_len;
+    outptr = buf;
+    oleft = buf_size;
+
+    ret = iconv(cd, &inptr, &ileft, &outptr, &oleft);
+    if (ret == (size_t)(-1) || oleft == 0 ) {
+        free(buf);
+        buf = NULL;
+    } else
+       *outptr = '\0';
+
+    (void) iconv_close(cd);
+    return buf;
+}
+#endif
diff --git a/xclock/Clock.h b/xclock/Clock.h
new file mode 100644 (file)
index 0000000..560d3d4
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+* $Xorg: Clock.h,v 1.4 2001/02/09 02:05:39 xorgcvs Exp $
+*/
+
+
+/***********************************************************
+
+Copyright 1987, 1988, 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, 1988 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/xclock/Clock.h,v 1.11 2002/10/17 01:00:01 dawes Exp $ */
+
+#ifndef _XawClock_h
+#define _XawClock_h
+
+/***********************************************************************
+ *
+ * Clock Widget
+ *
+ ***********************************************************************/
+
+#include <X11/Xmu/Converters.h>
+
+/* Parameters:
+
+ Name               Class              RepType         Default Value
+ ----               -----              -------         -------------
+ twentyfour         Boolean            Boolean         True
+ analog                     Boolean            Boolean         True
+ background         Background         Pixel           white
+ backingStore       BackingStore       BackingStore    default
+ border                     BorderColor        Pixel           Black
+ borderWidth        BorderWidth        Dimension       1
+ chime              Boolean            Boolean         False
+ destroyCallback     Callback          Pointer         NULL
+ font               Font               XFontStruct*    fixed
+ foreground         Foreground         Pixel           black
+ hand               Foreground         Pixel           black
+ height                     Height             Dimension       164
+ highlight          Foreground         Pixel           black
+ mappedWhenManaged   MappedWhenManaged Boolean         True
+ padding            Margin             int             8
+ utime              Boolean            Boolean         False
+ update                     Interval           int             60 (seconds)
+ width              Width              Dimension       164
+ x                  Position           Position        0
+ y                  Position           Position        0
+
+*/
+
+/* Resource names used to the clock widget */
+
+               /* color of hands */
+#define XtNhand "hands"
+
+
+               /* Boolean: 24-hour if TRUE */
+#define XtNtwentyfour "twentyfour"
+
+               /* Boolean: digital if FALSE */
+#define XtNanalog "analog"
+
+               /* Boolean: only hour/minute if TRUE */
+#define XtNbrief  "brief"
+
+                /* String: will be used as format arg to
+                   "strftime" if not empty string */
+#define XtNstrftime "strftime"
+
+               /* Boolean: show seconds since Epoch if TRUE */
+#define XtNutime  "utime"
+
+               /* Boolean:  */
+#define XtNchime "chime"
+
+               /* Int: amount of space around outside of clock */
+#define XtNpadding "padding"
+
+               /* Boolean: use Render extension if TRUE */
+#define XtNrender "render"
+
+               /* Boolean: use backing pixmap for double buffering */
+#define XtNbuffer "buffer"
+
+               /* RenderColor: colors for various clock elements */
+#define XtNhourColor "hourColor"
+#define XtNminuteColor "minuteColor"
+#define XtNsecondColor "secondColor"
+#define XtNmajorColor "majorColor"
+#define XtNminorColor "minorColor"
+
+#define XtRXftColor "XftColor"
+
+#define XtNface "face"
+#define XtCFace "Face"
+#define XtRXftFont "XftFont"
+
+               /* Boolean: use sharp rendering for Render polygons */
+#define XtNsharp "sharp"
+#define XtCSharp "Sharp"
+
+typedef struct _ClockRec *ClockWidget;  /* completely defined in ClockP.h */
+typedef struct _ClockClassRec *ClockWidgetClass;  /* completely defined in ClockP.h */
+
+extern WidgetClass clockWidgetClass;
+
+#endif /* _XawClock_h */
+/* DON'T ADD STUFF AFTER THIS #endif */
diff --git a/xclock/ClockP.h b/xclock/ClockP.h
new file mode 100644 (file)
index 0000000..f8c84ee
--- /dev/null
@@ -0,0 +1,170 @@
+/*
+* $Xorg: ClockP.h,v 1.4 2001/02/09 02:05:39 xorgcvs Exp $
+*/
+
+
+/***********************************************************
+
+Copyright 1987, 1988, 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, 1988 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/xclock/ClockP.h,v 1.11 2002/10/17 01:00:01 dawes Exp $ */
+
+#ifndef _XawClockP_h
+#define _XawClockP_h
+
+#include <X11/Xos.h>           /* Needed for struct tm. */
+#include "Clock.h"
+#include <X11/Xaw/SimpleP.h>
+#ifdef XRENDER
+#include <X11/Xft/Xft.h>
+#include <X11/extensions/Xrender.h>
+#endif
+
+#define SEG_BUFF_SIZE          128
+#ifdef NO_I18N
+#define ASCII_TIME_BUFLEN      32      /* big enough for 26 plus slop */
+#define STRFTIME_BUFF_SIZE      100     /* buffer for "strftime" option */
+#else
+#define STRFTIME_BUFF_SIZE     256     /* should handle any locale */
+#endif
+
+
+
+/* New fields for the clock widget instance record */
+typedef struct {
+#ifndef RENDER
+        Pixel  fgpixel;        /* color index for text */
+#endif
+        Pixel  Hipixel;        /* color index for Highlighting */
+        Pixel  Hdpixel;        /* color index for hands */
+        XFontStruct    *font;  /* font for text */
+        GC     myGC;           /* pointer to GraphicsContext */
+        GC     EraseGC;        /* eraser GC */
+        GC     HandGC;         /* Hand GC */
+        GC     HighGC;         /* Highlighting GC */
+/* start of graph stuff */
+        int    update;         /* update period in second */
+        Dimension radius;              /* radius factor */
+        int    backing_store;  /* backing store type */
+        Boolean chime;
+        Boolean beeped;
+        Boolean analog;
+        Boolean brief;
+        Boolean twentyfour;
+        Boolean utime;
+         String strftime;
+        Boolean show_second_hand;
+        Dimension second_hand_length;
+        Dimension minute_hand_length;
+        Dimension hour_hand_length;
+        Dimension hand_width;
+        Dimension second_hand_width;
+        Position centerX;
+        Position centerY;
+        int    numseg;
+        int    padding;
+        XPoint segbuff[SEG_BUFF_SIZE];
+        XPoint *segbuffptr;
+        XPoint *hour, *sec;
+        struct tm  otm ;
+        XtIntervalId interval_id;
+        char prev_time_string[STRFTIME_BUFF_SIZE];
+#ifndef NO_I18N
+        XFontSet fontSet;     /* font set for localized text */
+        Boolean        utf8;
+#endif
+#ifdef XRENDER
+        XftColor       fg_color;
+        XftColor       hour_color;
+        XftColor       min_color;
+        XftColor       sec_color;
+        XftColor       major_color;
+        XftColor       minor_color;
+        XftFont        *face;
+        XRenderPictFormat  *mask_format;
+
+        Boolean    render;
+        Boolean    sharp;
+        Boolean    can_polygon;
+        Boolean    buffer;
+        XftDraw    *draw;
+        Picture    picture;
+        Picture    fill_picture;
+        Pixmap     pixmap;
+        XRectangle damage;
+        XDouble    x_scale;
+        XDouble    x_off;
+        XDouble    y_scale;
+        XDouble    y_off;
+#endif
+   } ClockPart;
+
+#ifdef XRENDER
+#define ClockFgPixel(c)        ((c)->clock.fg_color.pixel)
+#else
+#define ClockFgPixel(c)        ((c)->clock.fgpixel)
+#endif
+
+/* Full instance record declaration */
+typedef struct _ClockRec {
+   CorePart core;
+   SimplePart simple;
+   ClockPart clock;
+   } ClockRec;
+
+/* New fields for the Clock widget class record */
+typedef struct {int dummy;} ClockClassPart;
+
+/* Full class record declaration. */
+typedef struct _ClockClassRec {
+   CoreClassPart core_class;
+   SimpleClassPart simple_class;
+   ClockClassPart clock_class;
+   } ClockClassRec;
+
+/* Class pointer. */
+extern ClockClassRec clockClassRec;
+
+#endif /* _XawClockP_h */
diff --git a/xclock/INSTALL b/xclock/INSTALL
new file mode 100644 (file)
index 0000000..2550dab
--- /dev/null
@@ -0,0 +1,302 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+
+   This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+   Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package.  The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.
+
+     Running `configure' might take a while.  While running, it prints
+     some messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+  6. Often, you can also type `make uninstall' to remove the installed
+     files again.
+
+Compilers and Options
+=====================
+
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+   You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you can use GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory.  After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+   On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor.  Like
+this:
+
+     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CPP="gcc -E" CXXCPP="g++ -E"
+
+   This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+   By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+   Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Particular systems
+==================
+
+   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+     ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
+a workaround.  If GNU CC is not installed, it is therefore recommended
+to try
+
+     ./configure CC="cc"
+
+and if that doesn't work, try
+
+     ./configure CC="cc -nodtk"
+
+   On Solaris, don't put `/usr/ucb' early in your `PATH'.  This
+directory contains several dysfunctional programs; working variants of
+these programs are available in `/usr/bin'.  So, if you need `/usr/ucb'
+in your `PATH', put it _after_ `/usr/bin'.
+
+   On Haiku, software installed for all users goes in `/boot/common',
+not `/usr/local'.  It is recommended to use the following options:
+
+     ./configure --prefix=/boot/common
+
+Specifying the System Type
+==========================
+
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS
+     KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+   Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug.  Until the bug is fixed you can use this workaround:
+
+     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+   `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+     Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+     Print a summary of the options unique to this package's
+     `configure', and exit.  The `short' variant lists options used
+     only in the top level, while the `recursive' variant lists options
+     also present in any nested packages.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+     Use DIR as the installation prefix.  *Note Installation Names::
+     for more details, including other options available for fine-tuning
+     the installation locations.
+
+`--no-create'
+`-n'
+     Run the configure checks, but stop before creating any output
+     files.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/xclock/Makefile.am b/xclock/Makefile.am
new file mode 100644 (file)
index 0000000..b2367b7
--- /dev/null
@@ -0,0 +1,91 @@
+#
+#  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 = xclock
+
+AM_CFLAGS = $(CWARNFLAGS) $(XCLOCK_CFLAGS)
+xclock_LDADD = $(XCLOCK_LIBS)
+
+xclock_SOURCES =       \
+        Clock.c \
+        Clock.h \
+        ClockP.h \
+        xclock.c
+
+appman_PRE = \
+        xclock.man
+
+# App default files  (*.ad)
+
+DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
+
+appdefaultdir = @appdefaultdir@
+
+dist_appdefault_DATA = \
+        app-defaults/XClock-color \
+        app-defaults/XClock
+
+EXTRA_DIST = \
+       ChangeLog \
+       clmask.bit \
+       clock.bit
+
+CLEANFILES = $(APPDEFAULTFILES)
+
+appmandir = $(APP_MAN_DIR)
+
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+
+EXTRA_DIST += $(appman_PRE)
+CLEANFILES += $(appman_DATA)
+
+MAINTAINERCLEANFILES=ChangeLog
+
+.PHONY: ChangeLog
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: 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) < $< > $@
diff --git a/xclock/Makefile.in b/xclock/Makefile.in
new file mode 100644 (file)
index 0000000..59049ba
--- /dev/null
@@ -0,0 +1,816 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = xclock$(EXEEXT)
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(dist_appdefault_DATA) \
+       $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+       $(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \
+       ChangeLog INSTALL NEWS config.guess config.sub depcomp \
+       install-sh missing
+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 config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" \
+       "$(DESTDIR)$(appdefaultdir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_xclock_OBJECTS = Clock.$(OBJEXT) xclock.$(OBJEXT)
+xclock_OBJECTS = $(am_xclock_OBJECTS)
+am__DEPENDENCIES_1 =
+xclock_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(xclock_SOURCES)
+DIST_SOURCES = $(xclock_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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+DATA = $(appman_DATA) $(dist_appdefault_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@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPDEFS_CFLAGS = @APPDEFS_CFLAGS@
+APPDEFS_LIBS = @APPDEFS_LIBS@
+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@
+CHANGELOG_CMD = @CHANGELOG_CMD@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
+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@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_CMD = @INSTALL_CMD@
+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@
+MAKEINFO = @MAKEINFO@
+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'
+
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+SED = sed
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XAW_CFLAGS = @XAW_CFLAGS@
+XAW_LIBS = @XAW_LIBS@
+XCLOCK_CFLAGS = @XCLOCK_CFLAGS@
+XCLOCK_LIBS = @XCLOCK_LIBS@
+XCLOCK_X11_CFLAGS = @XCLOCK_X11_CFLAGS@
+XCLOCK_X11_LIBS = @XCLOCK_X11_LIBS@
+XCLOCK_XMU_CFLAGS = @XCLOCK_XMU_CFLAGS@
+XCLOCK_XMU_LIBS = @XCLOCK_XMU_LIBS@
+XFT_CFLAGS = @XFT_CFLAGS@
+XFT_LIBS = @XFT_LIBS@
+XKB_CFLAGS = @XKB_CFLAGS@
+XKB_LIBS = @XKB_LIBS@
+XORG_MAN_PAGE = @XORG_MAN_PAGE@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+appdefaultdir = @appdefaultdir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CFLAGS = $(CWARNFLAGS) $(XCLOCK_CFLAGS)
+xclock_LDADD = $(XCLOCK_LIBS)
+xclock_SOURCES = \
+        Clock.c \
+        Clock.h \
+        ClockP.h \
+        xclock.c
+
+appman_PRE = \
+        xclock.man
+
+
+# App default files  (*.ad)
+DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
+dist_appdefault_DATA = \
+        app-defaults/XClock-color \
+        app-defaults/XClock
+
+EXTRA_DIST = ChangeLog clmask.bit clock.bit $(appman_PRE)
+CLEANFILES = $(APPDEFAULTFILES) $(appman_DATA)
+appmandir = $(APP_MAN_DIR)
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+MAINTAINERCLEANFILES = ChangeLog
+
+# Strings to replace in man pages
+XORGRELSTRING = @PACKAGE_STRING@
+XORGMANNAME = X Version 11
+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'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+       $(am__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)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+       @if test ! -f $@; then \
+         rm -f stamp-h1; \
+         $(MAKE) $(AM_MAKEFLAGS) 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) 
+       ($(am__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)'; test -n "$(bindir)" || list=; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p; \
+         then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+xclock$(EXEEXT): $(xclock_OBJECTS) $(xclock_DEPENDENCIES) 
+       @rm -f xclock$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(xclock_OBJECTS) $(xclock_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Clock.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xclock.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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) '$<'`
+install-appmanDATA: $(appman_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)"
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \
+       done
+
+uninstall-appmanDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appmandir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appmandir)" && rm -f $$files
+install-dist_appdefaultDATA: $(dist_appdefault_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appdefaultdir)" || $(MKDIR_P) "$(DESTDIR)$(appdefaultdir)"
+       @list='$(dist_appdefault_DATA)'; test -n "$(appdefaultdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appdefaultdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appdefaultdir)" || exit $$?; \
+       done
+
+uninstall-dist_appdefaultDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_appdefault_DATA)'; test -n "$(appdefaultdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appdefaultdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appdefaultdir)" && rm -f $$files
+
+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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       set x; \
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       $(am__remove_distdir)
+       test -d "$(distdir)" || mkdir "$(distdir)"
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$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
+       -test -n "$(am__skip_mode_fix)" \
+       || find "$(distdir)" -type d ! -perm -755 \
+               -exec chmod u+rwx,go+rx {} \; -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 $(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-lzma: distdir
+       tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+       $(am__remove_distdir)
+
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+       $(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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+       *.tar.bz2*) \
+         bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.lzma*) \
+         lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+       *.tar.Z*) \
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+       *.shar.gz*) \
+         GZIP=$(GZIP_ENV) gzip -dc $(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)
+       test -d $(distdir)/_build || exit 0; \
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && am__cwd=`pwd` \
+         && $(am__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 \
+         && cd "$$am__cwd" \
+         || exit 1
+       $(am__remove_distdir)
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+       @$(am__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)" "$(DESTDIR)$(appdefaultdir)"; 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)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-appmanDATA install-dist_appdefaultDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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_appdefaultDATA
+
+.MAKE: all install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+       clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
+       dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \
+       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-dist_appdefaultDATA install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+       uninstall-am uninstall-appmanDATA uninstall-binPROGRAMS \
+       uninstall-dist_appdefaultDATA
+
+
+.PHONY: ChangeLog
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog
+
+.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/xclock/NEWS b/xclock/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xclock/README b/xclock/README
new file mode 100644 (file)
index 0000000..ffbbb59
--- /dev/null
@@ -0,0 +1,27 @@
+xclock is the classic X Window System clock utility.  It displays
+the time in analog or digital form, continuously updated at a
+frequency which may be specified by the user.
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+        http://lists.freedesktop.org/mailman/listinfo/xorg
+
+Please submit bug reports to the Xorg bugzilla:
+
+        https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+The master development code repository can be found at:
+
+        git://anongit.freedesktop.org/git/xorg/app/xclock
+
+        http://cgit.freedesktop.org/xorg/app/xclock
+
+For patch submission instructions, see:
+
+       http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
+For more information on the git code manager, see:
+
+        http://wiki.x.org/wiki/GitPage
+
diff --git a/xclock/aclocal.m4 b/xclock/aclocal.m4
new file mode 100644 (file)
index 0000000..1af08a2
--- /dev/null
@@ -0,0 +1,2385 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009  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.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
+[m4_warning([this file was generated for autoconf 2.67.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# serial 1 (pkg-config-0.24)
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# 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])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+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.
+#
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+# only at the first occurence in configure.ac, so if the first place
+# it's called might be skipped (such as if it is within an "if", you
+# have 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_default([$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _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
+       AC_MSG_RESULT([no])
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       m4_default([$4], [AC_MSG_ERROR(
+[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])[]dnl
+        ])
+elif test $pkg_failed = untried; then
+       AC_MSG_RESULT([no])
+       m4_default([$4], [AC_MSG_FAILURE(
+[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 <http://pkg-config.freedesktop.org/>.])[]dnl
+        ])
+else
+       $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+       $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+       $3
+fi[]dnl
+])# PKG_CHECK_MODULES
+
+dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
+dnl
+dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. 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 "Software"),
+dnl to deal in the Software without restriction, including without limitation
+dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
+dnl and/or sell copies of the Software, and to permit persons to whom the
+dnl Software is furnished to do so, subject to the following conditions:
+dnl
+dnl The above copyright notice and this permission notice (including the next
+dnl paragraph) shall be included in all copies or substantial portions of the
+dnl Software.
+dnl
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+dnl DEALINGS IN THE SOFTWARE.
+
+# 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 ensure that this macro is defined, also add:
+# m4_ifndef([XORG_MACROS_VERSION],
+#     [m4_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.
+m4_defun([XORG_MACROS_VERSION],[
+m4_define([vers_have], [1.11.0])
+m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
+m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
+m4_if(m4_cmp(maj_have, maj_needed), 0,,
+    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
+m4_if(m4_version_compare(vers_have, [$1]), -1,
+    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
+m4_undefine([vers_have])
+m4_undefine([maj_have])
+m4_undefine([maj_needed])
+]) # 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])
+       # under Cygwin unix is still defined even with -undef
+       elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+               RAWCPPFLAGS="-undef -ansi"
+               AC_MSG_RESULT([yes, with -ansi])
+       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
+# Added MAN_SUBSTS in version 1.8
+# Added AC_PROG_SED in version 1.8
+
+AC_DEFUN([XORG_MANPAGE_SECTIONS],[
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_SED])
+
+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_MAN_PAGE="X Version 11"
+AC_SUBST([XORG_MAN_PAGE])
+MAN_SUBSTS="\
+       -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xservername__|Xorg|g' \
+       -e 's|__xconfigfile__|xorg.conf|g' \
+       -e 's|__projectroot__|\$(prefix)|g' \
+       -e 's|__apploaddir__|\$(appdefaultdir)|g' \
+       -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
+       -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
+       -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
+       -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
+       -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
+       -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
+AC_SUBST([MAN_SUBSTS])
+
+]) # XORG_MANPAGE_SECTIONS
+
+# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
+# ------------------------
+# Minimum version: 1.7.0
+#
+# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
+# provided by xorg-sgml-doctools, if installed.
+AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
+AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
+XORG_SGML_PATH=
+PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
+    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
+    [m4_ifval([$1],[:],
+        [if test x"$cross_compiling" != x"yes" ; then
+            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
+                          [XORG_SGML_PATH=$prefix/share/sgml])
+         fi])
+    ])
+
+# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
+# the path and the name of the doc stylesheet
+if test "x$XORG_SGML_PATH" != "x" ; then
+   AC_MSG_RESULT([$XORG_SGML_PATH])
+   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
+   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
+else
+   AC_MSG_RESULT([no])
+fi
+
+AC_SUBST(XORG_SGML_PATH)
+AC_SUBST(STYLESHEET_SRCDIR)
+AC_SUBST(XSL_STYLESHEET)
+AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
+]) # XORG_CHECK_SGML_DOCTOOLS
+
+# 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_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
+AC_REQUIRE([XORG_WITH_PS2PDF])
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+
+AC_MSG_CHECKING([whether to build documentation])
+
+if test x$XORG_SGML_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$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
+
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([whether to build text documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([whether to build PDF documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([whether to build PostScript documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([whether to build HTML documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
+# ----------------
+# Minimum version: 1.5.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-xmlto option, it allows maximum flexibilty in making decisions
+# as whether or not to use the xmlto package. When DEFAULT is not specified,
+# --with-xmlto assumes 'auto'.
+#
+# Interface to module:
+# HAVE_XMLTO:  used in makefiles to conditionally generate documentation
+# XMLTO:       returns the path of the xmlto program found
+#              returns the path set by the user in the environment
+# --with-xmlto:        'yes' user instructs the module to use xmlto
+#              'no' user instructs the module not to use xmlto
+#
+# Added in version 1.10.0
+# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
+#                  xmlto for text output requires either lynx, links, or w3m browsers
+#
+# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_XMLTO],[
+AC_ARG_VAR([XMLTO], [Path to xmlto command])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(xmlto,
+       AS_HELP_STRING([--with-xmlto],
+          [Use xmlto to regenerate documentation (default: ]_defopt[)]),
+          [use_xmlto=$withval], [use_xmlto=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_xmlto" = x"auto"; then
+   AC_PATH_PROG([XMLTO], [xmlto])
+   if test "x$XMLTO" = "x"; then
+        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
+       have_xmlto=no
+   else
+        have_xmlto=yes
+   fi
+elif test "x$use_xmlto" = x"yes" ; then
+   AC_PATH_PROG([XMLTO], [xmlto])
+   if test "x$XMLTO" = "x"; then
+        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
+   fi
+   have_xmlto=yes
+elif test "x$use_xmlto" = x"no" ; then
+   if test "x$XMLTO" != "x"; then
+      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
+   fi
+   have_xmlto=no
+else
+   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
+fi
+
+# Test for a minimum version of xmlto, if provided.
+m4_ifval([$1],
+[if test "$have_xmlto" = yes; then
+    # scrape the xmlto version
+    AC_MSG_CHECKING([the xmlto version])
+    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
+    AC_MSG_RESULT([$xmlto_version])
+    AS_VERSION_COMPARE([$xmlto_version], [$1],
+        [if test "x$use_xmlto" = xauto; then
+            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
+            have_xmlto=no
+        else
+            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
+        fi])
+fi])
+
+# Test for the ability of xmlto to generate a text target
+have_xmlto_text=no
+cat > conftest.xml << "EOF"
+EOF
+AS_IF([test "$have_xmlto" = yes],
+      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
+             [have_xmlto_text=yes],
+             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
+rm -f conftest.xml
+AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
+AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
+]) # XORG_WITH_XMLTO
+
+# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
+# ----------------
+# Minimum version: 1.5.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-asciidoc option, it allows maximum flexibilty in making decisions
+# as whether or not to use the asciidoc package. When DEFAULT is not specified,
+# --with-asciidoc assumes 'auto'.
+#
+# Interface to module:
+# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
+# ASCIIDOC:     returns the path of the asciidoc program found
+#               returns the path set by the user in the environment
+# --with-asciidoc: 'yes' user instructs the module to use asciidoc
+#                'no' user instructs the module not to use asciidoc
+#
+# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_ASCIIDOC],[
+AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(asciidoc,
+       AS_HELP_STRING([--with-asciidoc],
+          [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
+          [use_asciidoc=$withval], [use_asciidoc=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_asciidoc" = x"auto"; then
+   AC_PATH_PROG([ASCIIDOC], [asciidoc])
+   if test "x$ASCIIDOC" = "x"; then
+        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
+       have_asciidoc=no
+   else
+        have_asciidoc=yes
+   fi
+elif test "x$use_asciidoc" = x"yes" ; then
+   AC_PATH_PROG([ASCIIDOC], [asciidoc])
+   if test "x$ASCIIDOC" = "x"; then
+        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
+   fi
+   have_asciidoc=yes
+elif test "x$use_asciidoc" = x"no" ; then
+   if test "x$ASCIIDOC" != "x"; then
+      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
+   fi
+   have_asciidoc=no
+else
+   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
+fi
+m4_ifval([$1],
+[if test "$have_asciidoc" = yes; then
+    # scrape the asciidoc version
+    AC_MSG_CHECKING([the asciidoc version])
+    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
+    AC_MSG_RESULT([$asciidoc_version])
+    AS_VERSION_COMPARE([$asciidoc_version], [$1],
+        [if test "x$use_asciidoc" = xauto; then
+            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
+            have_asciidoc=no
+        else
+            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
+        fi])
+fi])
+AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
+]) # XORG_WITH_ASCIIDOC
+
+# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
+# --------------------------------
+# Minimum version: 1.5.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-doxygen option, it allows maximum flexibilty in making decisions
+# as whether or not to use the doxygen package. When DEFAULT is not specified,
+# --with-doxygen assumes 'auto'.
+#
+# Interface to module:
+# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
+# DOXYGEN:      returns the path of the doxygen program found
+#               returns the path set by the user in the environment
+# --with-doxygen: 'yes' user instructs the module to use doxygen
+#                'no' user instructs the module not to use doxygen
+#
+# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_DOXYGEN],[
+AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(doxygen,
+       AS_HELP_STRING([--with-doxygen],
+          [Use doxygen to regenerate documentation (default: ]_defopt[)]),
+          [use_doxygen=$withval], [use_doxygen=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_doxygen" = x"auto"; then
+   AC_PATH_PROG([DOXYGEN], [doxygen])
+   if test "x$DOXYGEN" = "x"; then
+        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
+       have_doxygen=no
+   else
+        have_doxygen=yes
+   fi
+elif test "x$use_doxygen" = x"yes" ; then
+   AC_PATH_PROG([DOXYGEN], [doxygen])
+   if test "x$DOXYGEN" = "x"; then
+        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
+   fi
+   have_doxygen=yes
+elif test "x$use_doxygen" = x"no" ; then
+   if test "x$DOXYGEN" != "x"; then
+      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
+   fi
+   have_doxygen=no
+else
+   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
+fi
+m4_ifval([$1],
+[if test "$have_doxygen" = yes; then
+    # scrape the doxygen version
+    AC_MSG_CHECKING([the doxygen version])
+    doxygen_version=`$DOXYGEN --version 2>/dev/null`
+    AC_MSG_RESULT([$doxygen_version])
+    AS_VERSION_COMPARE([$doxygen_version], [$1],
+        [if test "x$use_doxygen" = xauto; then
+            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
+            have_doxygen=no
+        else
+            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
+        fi])
+fi])
+AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
+]) # XORG_WITH_DOXYGEN
+
+# XORG_WITH_GROFF([DEFAULT])
+# ----------------
+# Minimum version: 1.6.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-groff option, it allows maximum flexibilty in making decisions
+# as whether or not to use the groff package. When DEFAULT is not specified,
+# --with-groff assumes 'auto'.
+#
+# Interface to module:
+# HAVE_GROFF:   used in makefiles to conditionally generate documentation
+# HAVE_GROFF_MM: the memorandum macros (-mm) package
+# HAVE_GROFF_MS: the -ms macros package
+# GROFF:        returns the path of the groff program found
+#               returns the path set by the user in the environment
+# --with-groff:         'yes' user instructs the module to use groff
+#               'no' user instructs the module not to use groff
+#
+# Added in version 1.9.0:
+# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
+#                 pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
+#                 psselect from the psutils package.
+#                 the ghostcript package. Refer to the grohtml man pages
+#
+# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
+#
+# OS and distros often splits groff in a basic and full package, the former
+# having the groff program and the later having devices, fonts and macros
+# Checking for the groff executable is not enough.
+#
+# If macros are missing, we cannot assume that groff is useless, so we don't
+# unset HAVE_GROFF or GROFF env variables.
+# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
+#
+AC_DEFUN([XORG_WITH_GROFF],[
+AC_ARG_VAR([GROFF], [Path to groff command])
+m4_define([_defopt], m4_default([$1], [auto]))
+AC_ARG_WITH(groff,
+       AS_HELP_STRING([--with-groff],
+          [Use groff to regenerate documentation (default: ]_defopt[)]),
+          [use_groff=$withval], [use_groff=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_groff" = x"auto"; then
+   AC_PATH_PROG([GROFF], [groff])
+   if test "x$GROFF" = "x"; then
+        AC_MSG_WARN([groff not found - documentation targets will be skipped])
+       have_groff=no
+   else
+        have_groff=yes
+   fi
+elif test "x$use_groff" = x"yes" ; then
+   AC_PATH_PROG([GROFF], [groff])
+   if test "x$GROFF" = "x"; then
+        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
+   fi
+   have_groff=yes
+elif test "x$use_groff" = x"no" ; then
+   if test "x$GROFF" != "x"; then
+      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
+   fi
+   have_groff=no
+else
+   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
+fi
+
+# We have groff, test for the presence of the macro packages
+if test "x$have_groff" = x"yes"; then
+    AC_MSG_CHECKING([for ${GROFF} -ms macros])
+    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
+        groff_ms_works=yes
+    else
+        groff_ms_works=no
+    fi
+    AC_MSG_RESULT([$groff_ms_works])
+    AC_MSG_CHECKING([for ${GROFF} -mm macros])
+    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
+        groff_mm_works=yes
+    else
+        groff_mm_works=no
+    fi
+    AC_MSG_RESULT([$groff_mm_works])
+fi
+
+# We have groff, test for HTML dependencies, one command per package
+if test "x$have_groff" = x"yes"; then
+   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
+   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
+   AC_PATH_PROG(PSSELECT_PATH, [psselect])
+   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
+      have_groff_html=yes
+   else
+      have_groff_html=no
+      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
+   fi
+fi
+
+# Set Automake conditionals for Makefiles
+AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
+AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
+AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
+AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
+]) # XORG_WITH_GROFF
+
+# XORG_WITH_FOP([DEFAULT])
+# ----------------
+# Minimum version: 1.6.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-fop option, it allows maximum flexibilty in making decisions
+# as whether or not to use the fop package. When DEFAULT is not specified,
+# --with-fop assumes 'auto'.
+#
+# Interface to module:
+# HAVE_FOP:    used in makefiles to conditionally generate documentation
+# FOP:         returns the path of the fop program found
+#              returns the path set by the user in the environment
+# --with-fop:  'yes' user instructs the module to use fop
+#              'no' user instructs the module not to use fop
+#
+# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_FOP],[
+AC_ARG_VAR([FOP], [Path to fop command])
+m4_define([_defopt], m4_default([$1], [auto]))
+AC_ARG_WITH(fop,
+       AS_HELP_STRING([--with-fop],
+          [Use fop to regenerate documentation (default: ]_defopt[)]),
+          [use_fop=$withval], [use_fop=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_fop" = x"auto"; then
+   AC_PATH_PROG([FOP], [fop])
+   if test "x$FOP" = "x"; then
+        AC_MSG_WARN([fop not found - documentation targets will be skipped])
+       have_fop=no
+   else
+        have_fop=yes
+   fi
+elif test "x$use_fop" = x"yes" ; then
+   AC_PATH_PROG([FOP], [fop])
+   if test "x$FOP" = "x"; then
+        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
+   fi
+   have_fop=yes
+elif test "x$use_fop" = x"no" ; then
+   if test "x$FOP" != "x"; then
+      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
+   fi
+   have_fop=no
+else
+   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
+fi
+AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
+]) # XORG_WITH_FOP
+
+# XORG_WITH_PS2PDF([DEFAULT])
+# ----------------
+# Minimum version: 1.6.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
+# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
+# --with-ps2pdf assumes 'auto'.
+#
+# Interface to module:
+# HAVE_PS2PDF:         used in makefiles to conditionally generate documentation
+# PS2PDF:      returns the path of the ps2pdf program found
+#              returns the path set by the user in the environment
+# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
+#               'no' user instructs the module not to use ps2pdf
+#
+# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_PS2PDF],[
+AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
+m4_define([_defopt], m4_default([$1], [auto]))
+AC_ARG_WITH(ps2pdf,
+       AS_HELP_STRING([--with-ps2pdf],
+          [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
+          [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_ps2pdf" = x"auto"; then
+   AC_PATH_PROG([PS2PDF], [ps2pdf])
+   if test "x$PS2PDF" = "x"; then
+        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
+       have_ps2pdf=no
+   else
+        have_ps2pdf=yes
+   fi
+elif test "x$use_ps2pdf" = x"yes" ; then
+   AC_PATH_PROG([PS2PDF], [ps2pdf])
+   if test "x$PS2PDF" = "x"; then
+        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
+   fi
+   have_ps2pdf=yes
+elif test "x$use_ps2pdf" = x"no" ; then
+   if test "x$PS2PDF" != "x"; then
+      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
+   fi
+   have_ps2pdf=no
+else
+   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
+fi
+AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
+]) # XORG_WITH_PS2PDF
+
+# XORG_ENABLE_DOCS (enable_docs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a builder to skip all
+# documentation targets except traditional man pages.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO         --with-xmlto
+# XORG_WITH_ASCIIDOC      --with-asciidoc
+# XORG_WITH_DOXYGEN       --with-doxygen
+# XORG_WITH_FOP           --with-fop
+# XORG_WITH_GROFF         --with-groff
+# XORG_WITH_PS2PDF        --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_DOCS:           used in makefiles to conditionally generate documentation
+# --enable-docs: 'yes' user instructs the module to generate docs
+#               'no' user instructs the module not to generate docs
+# parm1:       specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_DOCS],[
+m4_define([default], m4_default([$1], [yes]))
+AC_ARG_ENABLE(docs,
+       AS_HELP_STRING([--enable-docs],
+          [Enable building the documentation (default: ]default[)]),
+          [build_docs=$enableval], [build_docs=]default)
+m4_undefine([default])
+AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
+AC_MSG_CHECKING([whether to build documentation])
+AC_MSG_RESULT([$build_docs])
+]) # XORG_ENABLE_DOCS
+
+# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# This macro enables a builder to skip all developer documentation.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO         --with-xmlto
+# XORG_WITH_ASCIIDOC      --with-asciidoc
+# XORG_WITH_DOXYGEN       --with-doxygen
+# XORG_WITH_FOP           --with-fop
+# XORG_WITH_GROFF         --with-groff
+# XORG_WITH_PS2PDF        --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_DEVEL_DOCS:   used in makefiles to conditionally generate developer docs
+# --enable-devel-docs: 'yes' user instructs the module to generate developer docs
+#                      'no' user instructs the module not to generate developer docs
+# parm1:               specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
+m4_define([devel_default], m4_default([$1], [yes]))
+AC_ARG_ENABLE(devel-docs,
+       AS_HELP_STRING([--enable-devel-docs],
+          [Enable building the developer documentation (default: ]devel_default[)]),
+          [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
+m4_undefine([devel_default])
+AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
+AC_MSG_CHECKING([whether to build developer documentation])
+AC_MSG_RESULT([$build_devel_docs])
+]) # XORG_ENABLE_DEVEL_DOCS
+
+# XORG_ENABLE_SPECS (enable_specs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# This macro enables a builder to skip all functional specification targets.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO         --with-xmlto
+# XORG_WITH_ASCIIDOC      --with-asciidoc
+# XORG_WITH_DOXYGEN       --with-doxygen
+# XORG_WITH_FOP           --with-fop
+# XORG_WITH_GROFF         --with-groff
+# XORG_WITH_PS2PDF        --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_SPECS:                used in makefiles to conditionally generate specs
+# --enable-specs:      'yes' user instructs the module to generate specs
+#                      'no' user instructs the module not to generate specs
+# parm1:               specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_SPECS],[
+m4_define([spec_default], m4_default([$1], [yes]))
+AC_ARG_ENABLE(specs,
+       AS_HELP_STRING([--enable-specs],
+          [Enable building the specs (default: ]spec_default[)]),
+          [build_specs=$enableval], [build_specs=]spec_default)
+m4_undefine([spec_default])
+AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
+AC_MSG_CHECKING([whether to build functional specifications])
+AC_MSG_RESULT([$build_specs])
+]) # XORG_ENABLE_SPECS
+
+# 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,
+       AS_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],
+               [MALLOC_ZERO_RETURNS_NULL=yes])
+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
+#
+# This macro enables the use of a tool that flags some suspicious and
+# non-portable constructs (likely to be bugs) in C language source code.
+# It will attempt to locate the tool and use appropriate options.
+# There are various lint type tools on different platforms.
+#
+# Interface to module:
+# LINT:                returns the path to the tool found on the platform
+#              or the value set to LINT on the configure cmd line
+#              also an Automake conditional
+# LINT_FLAGS:  an Automake variable with appropriate flags
+#
+# --with-lint: 'yes' user instructs the module to use lint
+#              'no' user instructs the module not to use lint (default)
+#
+# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
+# If the user sets the value of LINT_FLAGS, they are used verbatim.
+#
+AC_DEFUN([XORG_WITH_LINT],[
+
+AC_ARG_VAR([LINT], [Path to a lint-style command])
+AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
+AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
+               [Use a lint-style source code checker (default: disabled)])],
+               [use_lint=$withval], [use_lint=no])
+
+# Obtain platform specific info like program name and options
+# The lint program on FreeBSD and NetBSD is different from the one on Solaris
+case $host_os in
+  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
+       lint_name=splint
+       lint_options="-badflag"
+       ;;
+  *freebsd* | *netbsd*)
+       lint_name=lint
+       lint_options="-u -b"
+       ;;
+  *solaris*)
+       lint_name=lint
+       lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
+       ;;
+esac
+
+# Test for the presence of the program (either guessed by the code or spelled out by the user)
+if test "x$use_lint" = x"yes" ; then
+   AC_PATH_PROG([LINT], [$lint_name])
+   if test "x$LINT" = "x"; then
+        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
+   fi
+elif test "x$use_lint" = x"no" ; then
+   if test "x$LINT" != "x"; then
+      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
+   fi
+else
+   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
+fi
+
+# User supplied flags override default flags
+if test "x$LINT_FLAGS" != "x"; then
+   lint_options=$LINT_FLAGS
+fi
+
+AC_SUBST([LINT_FLAGS],[$lint_options])
+AM_CONDITIONAL(LINT, [test "x$LINT" != x])
+
+]) # 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.
+#
+# Interface to module:
+# LINTLIB              - Automake variable with the name of lint library file to make
+# MAKE_LINT_LIB                - Automake conditional
+#
+# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
+#                        - 'no' user instructs the module not to create a lint library (default)
+
+AC_DEFUN([XORG_LINT_LIBRARY],[
+AC_REQUIRE([XORG_WITH_LINT])
+AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
+       [Create lint library (default: disabled)])],
+       [make_lint_lib=$enableval], [make_lint_lib=no])
+
+if test "x$make_lint_lib" = x"yes" ; then
+   LINTLIB=llib-l$1.ln
+   if test "x$LINT" = "x"; then
+        AC_MSG_ERROR([Cannot make lint library without --with-lint])
+   fi
+elif test "x$make_lint_lib" != x"no" ; then
+   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
+fi
+
+AC_SUBST(LINTLIB)
+AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
+
+]) # XORG_LINT_LIBRARY
+
+# XORG_CWARNFLAGS
+# ---------------
+# Minimum version: 1.2.0
+#
+# Defines CWARNFLAGS to enable C compiler warnings.
+#
+AC_DEFUN([XORG_CWARNFLAGS], [
+AC_REQUIRE([AC_PROG_CC_C99])
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast -Wformat=2"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+AC_SUBST(CWARNFLAGS)
+]) # XORG_CWARNFLAGS
+
+# XORG_STRICT_OPTION
+# -----------------------
+# Minimum version: 1.3.0
+#
+# Add configure option to enable strict compilation
+AC_DEFUN([XORG_STRICT_OPTION], [
+# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
+AC_REQUIRE([AC_PROG_CC_C99])
+AC_REQUIRE([XORG_CWARNFLAGS])
+
+AC_ARG_ENABLE(strict-compilation,
+                         AS_HELP_STRING([--enable-strict-compilation],
+                         [Enable all warnings from compiler and make them errors (default: disabled)]),
+                         [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
+if test "x$STRICT_COMPILE" = "xyes"; then
+       AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+       AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+AC_SUBST([CWARNFLAGS])
+]) # XORG_STRICT_OPTION
+
+# XORG_DEFAULT_OPTIONS
+# --------------------
+# Minimum version: 1.3.0
+#
+# Defines default options for X.Org modules.
+#
+AC_DEFUN([XORG_DEFAULT_OPTIONS], [
+AC_REQUIRE([AC_PROG_INSTALL])
+XORG_CWARNFLAGS
+XORG_STRICT_OPTION
+XORG_RELEASE_VERSION
+XORG_CHANGELOG
+XORG_INSTALL
+XORG_MANPAGE_SECTIONS
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
+    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
+]) # XORG_DEFAULT_OPTIONS
+
+# XORG_INSTALL()
+# ----------------
+# Minimum version: 1.4.0
+#
+# Defines the variable INSTALL_CMD as the command to copy
+# INSTALL from $prefix/share/util-macros.
+#
+AC_DEFUN([XORG_INSTALL], [
+AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
+INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+AC_SUBST([INSTALL_CMD])
+]) # XORG_INSTALL
+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
+# --------------------
+# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+AC_DEFUN([XORG_RELEASE_VERSION],[
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+               [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+               [Major version of this package])
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+               [$PVM],
+               [Minor version of this package])
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+               [$PVP],
+               [Patch version of this package])
+])
+
+# XORG_CHANGELOG()
+# ----------------
+# Minimum version: 1.2.0
+#
+# Defines the variable CHANGELOG_CMD as the command to generate
+# ChangeLog from git.
+#
+#
+AC_DEFUN([XORG_CHANGELOG], [
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+AC_SUBST([CHANGELOG_CMD])
+]) # XORG_CHANGELOG
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11.1], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# 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, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# 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])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+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, 2006, 2009
+# 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 10
+
+# 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], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$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
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    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, 2006, 2008, 2009 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 16
+
+# 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.62])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
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+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
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_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)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+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
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_AM_DEPENDENCIES(OBJC)],
+                 [define([AC_PROG_OBJC],
+                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# 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_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
+                         (and sometimes confusing) to the casual installer],
+      [USE_MAINTAINER_MODE=$enableval],
+      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  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, 2009  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_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.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
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+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, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# 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
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# 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, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _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],
+[m4_foreach_w([_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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# 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
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# 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) 2009  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 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# 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="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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/xclock/app-defaults/XClock b/xclock/app-defaults/XClock
new file mode 100644 (file)
index 0000000..971ae2d
--- /dev/null
@@ -0,0 +1 @@
+XClock.input: false
diff --git a/xclock/app-defaults/XClock-color b/xclock/app-defaults/XClock-color
new file mode 100644 (file)
index 0000000..ec857f6
--- /dev/null
@@ -0,0 +1,10 @@
+! $XFree86$
+
+#include "XClock"
+
+XClock.Clock.hourColor:                rgba:7f/00/00/c0
+XClock.Clock.minuteColor:      rgba:00/7f/7f/c0
+XClock.Clock.secondColor:      rgba:00/00/ff/80
+XClock.Clock.majorColor:       rgba:7f/00/00/c0
+XClock.Clock.minorColor:       rgba:00/7f/7f/c0
+
diff --git a/xclock/clmask.bit b/xclock/clmask.bit
new file mode 100644 (file)
index 0000000..afeb014
--- /dev/null
@@ -0,0 +1,27 @@
+#define clock_mask_width 48
+#define clock_mask_height 48
+static unsigned char clock_mask_bits[] = {
+   0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00,
+   0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00,
+   0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00,
+   0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x1f, 0x00,
+   0x00, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7f, 0x00,
+   0x80, 0xff, 0xff, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x01,
+   0xe0, 0xff, 0xff, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x03,
+   0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07,
+   0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f,
+   0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f,
+   0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f,
+   0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f,
+   0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f,
+   0xfc, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f,
+   0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07,
+   0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x03,
+   0xe0, 0xff, 0xff, 0xff, 0xff, 0x01, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x01,
+   0x80, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7f, 0x00,
+   0x00, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x1f, 0x00,
+   0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00,
+   0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00,
+   0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00,
+   0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00};
diff --git a/xclock/clock.bit b/xclock/clock.bit
new file mode 100644 (file)
index 0000000..5e9ab18
--- /dev/null
@@ -0,0 +1,29 @@
+#define clock_width 48
+#define clock_height 48
+#define clock_x_hot -1
+#define clock_y_hot -1
+static unsigned char clock_bits[] = {
+   0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00,
+   0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00,
+   0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00,
+   0x00, 0xf8, 0x87, 0xf1, 0x0f, 0x00, 0x00, 0xfc, 0x80, 0x81, 0x1f, 0x00,
+   0x00, 0x3e, 0x80, 0x01, 0x3e, 0x00, 0x00, 0x9f, 0x01, 0xc0, 0x7c, 0x00,
+   0x80, 0x8f, 0x01, 0xc0, 0xf8, 0x00, 0xc0, 0x07, 0x00, 0x00, 0xf0, 0x01,
+   0xe0, 0x03, 0x00, 0x00, 0xe0, 0x03, 0xe0, 0x01, 0x00, 0x00, 0xc0, 0x03,
+   0xf0, 0x00, 0x00, 0x40, 0x80, 0x07, 0xf0, 0x06, 0x00, 0xe0, 0xb0, 0x07,
+   0x78, 0x06, 0x00, 0xf0, 0x30, 0x0f, 0x78, 0x00, 0x00, 0x78, 0x00, 0x0f,
+   0x78, 0x00, 0x00, 0x3c, 0x00, 0x0f, 0x3c, 0x00, 0x00, 0x1e, 0x00, 0x1e,
+   0x3c, 0x00, 0x00, 0x0f, 0x00, 0x1e, 0x3c, 0x00, 0x80, 0x07, 0x00, 0x1e,
+   0x3c, 0x00, 0xc0, 0x03, 0x00, 0x7e, 0xfc, 0x01, 0xc0, 0x03, 0xc0, 0x7f,
+   0xfc, 0x01, 0x80, 0x07, 0xc0, 0x7f, 0x3c, 0x00, 0x00, 0x0f, 0x00, 0x7e,
+   0x3c, 0x00, 0x00, 0x1e, 0x00, 0x1e, 0x3c, 0x00, 0x00, 0x1c, 0x00, 0x1e,
+   0x7c, 0x00, 0x00, 0x08, 0x00, 0x0f, 0x78, 0x00, 0x00, 0x00, 0x00, 0x0f,
+   0x78, 0x06, 0x00, 0x00, 0x30, 0x0f, 0xf0, 0x06, 0x00, 0x00, 0xb0, 0x07,
+   0xf0, 0x00, 0x00, 0x00, 0x80, 0x07, 0xe0, 0x01, 0x00, 0x00, 0xc0, 0x03,
+   0xe0, 0x03, 0x00, 0x00, 0xe0, 0x01, 0xc0, 0x07, 0x00, 0x00, 0xf0, 0x01,
+   0x80, 0x8f, 0x01, 0xc0, 0xf8, 0x00, 0x00, 0x9f, 0x01, 0xc0, 0x7c, 0x00,
+   0x00, 0x3e, 0x80, 0x01, 0x3e, 0x00, 0x00, 0xfc, 0x80, 0x81, 0x1f, 0x00,
+   0x00, 0xf8, 0x87, 0xf1, 0x0f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00,
+   0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00,
+   0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00,
+   0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x00};
diff --git a/xclock/config.guess b/xclock/config.guess
new file mode 100755 (executable)
index 0000000..da83314
--- /dev/null
@@ -0,0 +1,1561 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
+
+timestamp='2009-04-27'
+
+# 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 <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+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, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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 "$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 ;;
+           sh5el) machine=sh5le-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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    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.*:* | i86xen:SunOS:5.*:*)
+       eval $set_cc_for_build
+       SUN_ARCH="i386"
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       echo ${SUN_ARCH}-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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:*:[456])
+       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+               IBM_ARCH=rs6000
+       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 <stdlib.h>
+              #include <unistd.h>
+
+              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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       exit ;;
+    i*:CYGWIN*:*)
+       echo ${UNAME_MACHINE}-pc-cygwin
+       exit ;;
+    *: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 ;;
+    *:Interix*:[3456]*)
+       case ${UNAME_MACHINE} in
+           x86)
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           EM64T | authenticamd | genuineintel)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+           IA64)
+               echo ia64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+       esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       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*:*:* | x86_64: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:*:*)
+       eval $set_cc_for_build
+       if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_EABI__
+       then
+           echo ${UNAME_MACHINE}-unknown-linux-gnu
+       else
+           echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+       fi
+       exit ;;
+    avr32*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-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 ;;
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-gnu
+       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 ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-gnu
+       exit ;;
+    x86_64:Linux:*:*)
+       echo x86_64-unknown-linux-gnu
+       exit ;;
+    xtensa*:Linux:*:*)
+       echo ${UNAME_MACHINE}-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 ;;
+         "")
+               # 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 <features.h>
+       #ifdef __ELF__
+       # ifdef __GLIBC__
+       #  if __GLIBC__ >= 2
+       LIBC=gnu
+       #  else
+       LIBC=gnulibc1
+       #  endif
+       # else
+       LIBC=gnulibc1
+       # endif
+       #else
+       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+       LIBC=gnu
+       #else
+       LIBC=gnuaout
+       #endif
+       #endif
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^LIBC/{
+               s: ::g
+               p
+           }'`"
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-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; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       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; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; 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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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 ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       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 ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-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
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/xclock/config.h.in b/xclock/config.h.in
new file mode 100644 (file)
index 0000000..40490ac
--- /dev/null
@@ -0,0 +1,82 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the `getpid' function. */
+#undef HAVE_GETPID
+
+/* Define to 1 if iconv() is available. */
+#undef HAVE_ICONV
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strlcpy' function. */
+#undef HAVE_STRLCPY
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* 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 home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to use Xft2 library */
+#undef XFREE86_FT2
+
+/* Define to use XkbStdBell */
+#undef XKB
+
+/* Define to use X Render Extension */
+#undef XRENDER
diff --git a/xclock/config.sub b/xclock/config.sub
new file mode 100755 (executable)
index 0000000..a39437d
--- /dev/null
@@ -0,0 +1,1686 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
+
+timestamp='2009-04-17'
+
+# 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 <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | bfin \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fido | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | lm32 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore | mep | metag \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64octeon | mips64octeonel \
+       | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | moxie \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | z8k | z80)
+               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)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64octeon-* | mips64octeonel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | 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[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+       | tron-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa*-* \
+       | ymp-* \
+       | z8k-* | z80-*)
+               ;;
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               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
+               ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+        cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
+       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
+               ;;
+       cr16)
+               basic_machine=cr16-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
+               ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
+       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
+               ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       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
+               ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
+       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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       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
+               ;;
+       tile*)
+               basic_machine=tile-unknown
+               os=-linux-gnu
+               ;;
+       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
+               ;;
+       z80-*-coff)
+               basic_machine=z80-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[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+               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* \
+             | -kopensolaris* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* | -aros* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
+             | -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* | -cegcc* \
+             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -linux-newlib* | -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* | -rdos* | -toppers* | -drops*)
+       # 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
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+       -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
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
+       *-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
+               ;;
+        mep-*)
+               os=-elf
+               ;;
+       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/xclock/configure b/xclock/configure
new file mode 100755 (executable)
index 0000000..a44e8c4
--- /dev/null
@@ -0,0 +1,6911 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.67 for xclock 1.0.4.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+        /*)
+          for as_base in sh bash ksh sh5; do
+            # Try only shells that exist, to save several forks.
+            as_shell=$as_dir/$as_base
+            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+          done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+       # neutralization value for shells without unset; and this also
+       # works around shells that cannot unset nonexistent variables.
+       BASH_ENV=/dev/null
+       ENV=/dev/null
+       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+       export CONFIG_SHELL
+       exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='xclock'
+PACKAGE_TARNAME='xclock'
+PACKAGE_VERSION='1.0.4'
+PACKAGE_STRING='xclock 1.0.4'
+PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+appdefaultdir
+APPDEFS_LIBS
+APPDEFS_CFLAGS
+XCLOCK_LIBS
+XCLOCK_CFLAGS
+XKB_LIBS
+XKB_CFLAGS
+XFT_LIBS
+XFT_CFLAGS
+XAW_LIBS
+XAW_CFLAGS
+XCLOCK_XMU_LIBS
+XCLOCK_XMU_CFLAGS
+XCLOCK_X11_LIBS
+XCLOCK_X11_CFLAGS
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+MAN_SUBSTS
+XORG_MAN_PAGE
+ADMIN_MAN_DIR
+DRIVER_MAN_DIR
+MISC_MAN_DIR
+FILE_MAN_DIR
+LIB_MAN_DIR
+APP_MAN_DIR
+ADMIN_MAN_SUFFIX
+DRIVER_MAN_SUFFIX
+MISC_MAN_SUFFIX
+FILE_MAN_SUFFIX
+LIB_MAN_SUFFIX
+APP_MAN_SUFFIX
+SED
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+INSTALL_CMD
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
+PKG_CONFIG
+CHANGELOG_CMD
+CWARNFLAGS
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_strict_compilation
+enable_silent_rules
+with_xft
+with_xkb
+with_appdefaultdir
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR
+XCLOCK_X11_CFLAGS
+XCLOCK_X11_LIBS
+XCLOCK_XMU_CFLAGS
+XCLOCK_XMU_LIBS
+XAW_CFLAGS
+XAW_LIBS
+XFT_CFLAGS
+XFT_LIBS
+XKB_CFLAGS
+XKB_LIBS
+APPDEFS_CFLAGS
+APPDEFS_LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=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 ;;
+
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_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'`
+  as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+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
+    $as_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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 xclock 1.0.4 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/xclock]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_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 xclock 1.0.4:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --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
+  --enable-strict-compilation
+                          Enable all warnings from compiler and make them
+                          errors (default: disabled)
+  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-xft              Use Xft2 and Xrender for rendering (Default is YES)
+  --with-xkb              Use XKB to sound bells (Default is YES)
+  --with-appdefaultdir=<pathname>
+                          specify directory for app-defaults files (default is
+                          autodetected)
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  PKG_CONFIG  path to pkg-config utility
+  PKG_CONFIG_PATH
+              directories to add to pkg-config's search path
+  PKG_CONFIG_LIBDIR
+              path overriding pkg-config's built-in search path
+  XCLOCK_X11_CFLAGS
+              C compiler flags for XCLOCK_X11, overriding pkg-config
+  XCLOCK_X11_LIBS
+              linker flags for XCLOCK_X11, overriding pkg-config
+  XCLOCK_XMU_CFLAGS
+              C compiler flags for XCLOCK_XMU, overriding pkg-config
+  XCLOCK_XMU_LIBS
+              linker flags for XCLOCK_XMU, overriding pkg-config
+  XAW_CFLAGS  C compiler flags for XAW, overriding pkg-config
+  XAW_LIBS    linker flags for XAW, overriding pkg-config
+  XFT_CFLAGS  C compiler flags for XFT, overriding pkg-config
+  XFT_LIBS    linker flags for XFT, overriding pkg-config
+  XKB_CFLAGS  C compiler flags for XKB, overriding pkg-config
+  XKB_LIBS    linker flags for XKB, overriding pkg-config
+  APPDEFS_CFLAGS
+              C compiler flags for APPDEFS, overriding pkg-config
+  APPDEFS_LIBS
+              linker flags for APPDEFS, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+xclock configure 1.0.4
+generated by GNU Autoconf 2.67
+
+Copyright (C) 2010 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
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_decl
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* 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_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_func
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by xclock $as_me 1.0.4, which was
+generated by GNU Autoconf 2.67.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append 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
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > 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
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5 ; }
+  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.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_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 $ac_precious_vars; 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,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_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
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_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.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+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.11'
+
+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
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$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'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;;
+esac
+
+# 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".
+      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "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 $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+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='xclock'
+ VERSION='1.0.4'
+
+
+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"}
+
+# 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 -'
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-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
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$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
+
+
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+
+
+
+
+
+
+
+
+
+
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+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
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5 ; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM 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.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5 ; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5 ; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5 ; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5 ; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+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
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-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=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+  $as_echo_n "(cached) " >&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
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$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
+
+
+
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if test "${ac_cv_prog_cc_c99+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+       {
+       case 's': // string
+         str = va_arg (args_copy, const char *);
+         break;
+       case 'd': // int
+         number = va_arg (args_copy, int);
+         break;
+       case 'f': // float
+         fnumber = va_arg (args_copy, double);
+         break;
+       default:
+         break;
+       }
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+         || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5 ; }
+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
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+fi
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${ac_cv_path_SED+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  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_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+
+
+
+
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast -Wformat=2"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default"
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then :
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+
+
+
+# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
+
+
+
+# Check whether --enable-strict-compilation was given.
+if test "${enable_strict_compilation+set}" = set; then :
+  enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval
+else
+  STRICT_COMPILE=no
+fi
+
+if test "x$STRICT_COMPILE" = "xyes"; then
+       ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default"
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then :
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+       ac_fn_c_check_decl "$LINENO" "__INTEL_COMPILER" "ac_cv_have_decl___INTEL_COMPILER" "$ac_includes_default"
+if test "x$ac_cv_have_decl___INTEL_COMPILER" = x""yes; then :
+  INTELCC="yes"
+else
+  INTELCC="no"
+fi
+
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+
+
+
+
+macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
+INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+XORG_MAN_PAGE="X Version 11"
+
+MAN_SUBSTS="\
+       -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xservername__|Xorg|g' \
+       -e 's|__xconfigfile__|xorg.conf|g' \
+       -e 's|__projectroot__|\$(prefix)|g' \
+       -e 's|__apploaddir__|\$(appdefaultdir)|g' \
+       -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
+       -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
+       -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
+       -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
+       -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
+       -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
+
+
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=0;;
+esac
+AM_BACKSLASH='\'
+
+
+
+for ac_func in strlcpy getpid
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing iconv" >&5
+$as_echo_n "checking for library containing iconv... " >&6; }
+if test "${ac_cv_search_iconv+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char iconv ();
+int
+main ()
+{
+return iconv ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' iconv; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_iconv=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if test "${ac_cv_search_iconv+set}" = set; then :
+  break
+fi
+done
+if test "${ac_cv_search_iconv+set}" = set; then :
+
+else
+  ac_cv_search_iconv=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_iconv" >&5
+$as_echo "$ac_cv_search_iconv" >&6; }
+ac_res=$ac_cv_search_iconv
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_ICONV 1" >>confdefs.h
+
+fi
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XCLOCK_X11" >&5
+$as_echo_n "checking for XCLOCK_X11... " >&6; }
+
+if test -n "$XCLOCK_X11_CFLAGS"; then
+    pkg_cv_XCLOCK_X11_CFLAGS="$XCLOCK_X11_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "x11") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XCLOCK_X11_CFLAGS=`$PKG_CONFIG --cflags "x11" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XCLOCK_X11_LIBS"; then
+    pkg_cv_XCLOCK_X11_LIBS="$XCLOCK_X11_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "x11") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XCLOCK_X11_LIBS=`$PKG_CONFIG --libs "x11" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+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
+               XCLOCK_X11_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "x11" 2>&1`
+        else
+               XCLOCK_X11_PKG_ERRORS=`$PKG_CONFIG --print-errors "x11" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XCLOCK_X11_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (x11) were not met:
+
+$XCLOCK_X11_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 XCLOCK_X11_CFLAGS
+and XCLOCK_X11_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 XCLOCK_X11_CFLAGS
+and XCLOCK_X11_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5 ; }
+else
+       XCLOCK_X11_CFLAGS=$pkg_cv_XCLOCK_X11_CFLAGS
+       XCLOCK_X11_LIBS=$pkg_cv_XCLOCK_X11_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XCLOCK_XMU" >&5
+$as_echo_n "checking for XCLOCK_XMU... " >&6; }
+
+if test -n "$XCLOCK_XMU_CFLAGS"; then
+    pkg_cv_XCLOCK_XMU_CFLAGS="$XCLOCK_XMU_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xmu\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xmu") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XCLOCK_XMU_CFLAGS=`$PKG_CONFIG --cflags "xmu" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XCLOCK_XMU_LIBS"; then
+    pkg_cv_XCLOCK_XMU_LIBS="$XCLOCK_XMU_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xmu\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xmu") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XCLOCK_XMU_LIBS=`$PKG_CONFIG --libs "xmu" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+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
+               XCLOCK_XMU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xmu" 2>&1`
+        else
+               XCLOCK_XMU_PKG_ERRORS=`$PKG_CONFIG --print-errors "xmu" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XCLOCK_XMU_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (xmu) were not met:
+
+$XCLOCK_XMU_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 XCLOCK_XMU_CFLAGS
+and XCLOCK_XMU_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 XCLOCK_XMU_CFLAGS
+and XCLOCK_XMU_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5 ; }
+else
+       XCLOCK_XMU_CFLAGS=$pkg_cv_XCLOCK_XMU_CFLAGS
+       XCLOCK_XMU_LIBS=$pkg_cv_XCLOCK_XMU_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XAW" >&5
+$as_echo_n "checking for XAW... " >&6; }
+
+if test -n "$XAW_CFLAGS"; then
+    pkg_cv_XAW_CFLAGS="$XAW_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xaw7\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xaw7") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XAW_CFLAGS=`$PKG_CONFIG --cflags "xaw7" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XAW_LIBS"; then
+    pkg_cv_XAW_LIBS="$XAW_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xaw7\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xaw7") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XAW_LIBS=`$PKG_CONFIG --libs "xaw7" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+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
+               XAW_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xaw7" 2>&1`
+        else
+               XAW_PKG_ERRORS=`$PKG_CONFIG --print-errors "xaw7" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XAW_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (xaw7) were not met:
+
+$XAW_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 XAW_CFLAGS
+and XAW_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 XAW_CFLAGS
+and XAW_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5 ; }
+else
+       XAW_CFLAGS=$pkg_cv_XAW_CFLAGS
+       XAW_LIBS=$pkg_cv_XAW_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+XCLOCK_CFLAGS="$XCLOCK_X11_CFLAGS $XAW_CFLAGS $XCLOCK_XMU_CFLAGS"
+XCLOCK_LIBS="$XCLOCK_X11_LIBS $XAW_LIBS $XCLOCK_XMU_LIBS"
+
+
+# Check whether --with-xft was given.
+if test "${with_xft+set}" = set; then :
+  withval=$with_xft; use_xft="$withval"
+else
+  use_xft="try"
+fi
+
+if test x$use_xft != xno ; then
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XFT" >&5
+$as_echo_n "checking for XFT... " >&6; }
+
+if test -n "$XFT_CFLAGS"; then
+    pkg_cv_XFT_CFLAGS="$XFT_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xrender xft\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xrender xft") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XFT_CFLAGS=`$PKG_CONFIG --cflags "xrender xft" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XFT_LIBS"; then
+    pkg_cv_XFT_LIBS="$XFT_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xrender xft\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xrender xft") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XFT_LIBS=`$PKG_CONFIG --libs "xrender xft" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+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
+               XFT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xrender xft" 2>&1`
+        else
+               XFT_PKG_ERRORS=`$PKG_CONFIG --print-errors "xrender xft" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XFT_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (xrender xft) were not met:
+
+$XFT_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 XFT_CFLAGS
+and XFT_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 XFT_CFLAGS
+and XFT_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5 ; }
+else
+       XFT_CFLAGS=$pkg_cv_XFT_CFLAGS
+       XFT_LIBS=$pkg_cv_XFT_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sqrt" >&5
+$as_echo_n "checking for library containing sqrt... " >&6; }
+if test "${ac_cv_search_sqrt+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sqrt ();
+int
+main ()
+{
+return sqrt ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' m; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_sqrt=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if test "${ac_cv_search_sqrt+set}" = set; then :
+  break
+fi
+done
+if test "${ac_cv_search_sqrt+set}" = set; then :
+
+else
+  ac_cv_search_sqrt=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sqrt" >&5
+$as_echo "$ac_cv_search_sqrt" >&6; }
+ac_res=$ac_cv_search_sqrt
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+       XCLOCK_CFLAGS="$XCLOCK_CFLAGS $XFT_CFLAGS"
+       XCLOCK_LIBS="$XCLOCK_LIBS $XFT_LIBS"
+
+$as_echo "#define XRENDER 1" >>confdefs.h
+
+
+$as_echo "#define XFREE86_FT2 1" >>confdefs.h
+
+fi
+
+
+# Check whether --with-xkb was given.
+if test "${with_xkb+set}" = set; then :
+  withval=$with_xkb; use_xkb="$withval"
+else
+  use_xkb="try"
+fi
+
+if test x$use_xkb != xno ; then
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XKB" >&5
+$as_echo_n "checking for XKB... " >&6; }
+
+if test -n "$XKB_CFLAGS"; then
+    pkg_cv_XKB_CFLAGS="$XKB_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xkbfile\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xkbfile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XKB_CFLAGS=`$PKG_CONFIG --cflags "xkbfile" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XKB_LIBS"; then
+    pkg_cv_XKB_LIBS="$XKB_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xkbfile\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xkbfile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XKB_LIBS=`$PKG_CONFIG --libs "xkbfile" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+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
+               XKB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xkbfile" 2>&1`
+        else
+               XKB_PKG_ERRORS=`$PKG_CONFIG --print-errors "xkbfile" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XKB_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (xkbfile) were not met:
+
+$XKB_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 XKB_CFLAGS
+and XKB_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 XKB_CFLAGS
+and XKB_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5 ; }
+else
+       XKB_CFLAGS=$pkg_cv_XKB_CFLAGS
+       XKB_LIBS=$pkg_cv_XKB_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+       XCLOCK_CFLAGS="$XCLOCK_CFLAGS $XKB_CFLAGS"
+       XCLOCK_LIBS="$XCLOCK_LIBS $XKB_LIBS"
+
+$as_echo "#define XKB 1" >>confdefs.h
+
+fi
+
+
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for APPDEFS" >&5
+$as_echo_n "checking for APPDEFS... " >&6; }
+
+if test -n "$APPDEFS_CFLAGS"; then
+    pkg_cv_APPDEFS_CFLAGS="$APPDEFS_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xt\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_APPDEFS_CFLAGS=`$PKG_CONFIG --cflags "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$APPDEFS_LIBS"; then
+    pkg_cv_APPDEFS_LIBS="$APPDEFS_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xt\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_APPDEFS_LIBS=`$PKG_CONFIG --libs "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+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
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xt" 2>&1`
+        else
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --print-errors "xt" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$APPDEFS_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (xt) were not met:
+
+$APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5 ; }
+else
+       APPDEFS_CFLAGS=$pkg_cv_APPDEFS_CFLAGS
+       APPDEFS_LIBS=$pkg_cv_APPDEFS_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+
+# Check whether --with-appdefaultdir was given.
+if test "${with_appdefaultdir+set}" = set; then :
+  withval=$with_appdefaultdir; appdefaultdir="$withval"
+else
+  appdefaultdir="${xt_appdefaultdir}"
+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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     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" &&
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $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}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by xclock $as_me 1.0.4, which was
+generated by GNU Autoconf 2.67.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+xclock config.status 1.0.4
+configured by $0, generated by GNU Autoconf 2.67,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+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=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  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 || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
+  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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries 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[        ]*=[    ]*/{
+h
+s///
+s/^/:/
+s/[     ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[  ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[      ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #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.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # 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.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5  ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$_am_arg" : 'X\(//\)[^/]' \| \
+        X"$_am_arg" : 'X\(//\)$' \| \
+        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_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=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# 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 || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/xclock/configure.ac b/xclock/configure.ac
new file mode 100644 (file)
index 0000000..7b7d137
--- /dev/null
@@ -0,0 +1,82 @@
+
+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(xclock,[1.0.4], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xclock)
+AM_INIT_AUTOMAKE([dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+
+AM_CONFIG_HEADER(config.h)
+
+AC_PROG_CC
+AC_PROG_INSTALL
+
+XORG_DEFAULT_OPTIONS
+
+AC_CHECK_FUNCS([strlcpy getpid])
+
+AC_SEARCH_LIBS([iconv], [iconv],
+       [AC_DEFINE(HAVE_ICONV, 1, [Define to 1 if iconv() is available.])])
+
+dnl Required dependencies
+PKG_CHECK_MODULES(XCLOCK_X11, x11)
+PKG_CHECK_MODULES(XCLOCK_XMU, xmu) 
+PKG_CHECK_MODULES(XAW, xaw7)
+XCLOCK_CFLAGS="$XCLOCK_X11_CFLAGS $XAW_CFLAGS $XCLOCK_XMU_CFLAGS"
+XCLOCK_LIBS="$XCLOCK_X11_LIBS $XAW_LIBS $XCLOCK_XMU_LIBS"
+
+dnl Optional dependencies
+AC_ARG_WITH(xft, AC_HELP_STRING([--with-xft],[Use Xft2 and Xrender for rendering (Default is YES)]),use_xft="$withval",use_xft="try")
+if test x$use_xft != xno ; then
+       PKG_CHECK_MODULES(XFT, [xrender xft])
+       AC_SEARCH_LIBS(sqrt, [m])
+       XCLOCK_CFLAGS="$XCLOCK_CFLAGS $XFT_CFLAGS"
+       XCLOCK_LIBS="$XCLOCK_LIBS $XFT_LIBS"
+       AC_DEFINE([XRENDER],1,[Define to use X Render Extension])
+       AC_DEFINE([XFREE86_FT2],1,[Define to use Xft2 library])
+fi
+
+AC_ARG_WITH(xkb, AC_HELP_STRING([--with-xkb],[Use XKB to sound bells (Default is YES)]),use_xkb="$withval",use_xkb="try")
+if test x$use_xkb != xno ; then
+       PKG_CHECK_MODULES(XKB, xkbfile)
+       XCLOCK_CFLAGS="$XCLOCK_CFLAGS $XKB_CFLAGS"
+       XCLOCK_LIBS="$XCLOCK_LIBS $XKB_LIBS"
+       AC_DEFINE([XKB],1,[Define to use XkbStdBell])
+fi
+
+AC_SUBST(XCLOCK_CFLAGS)
+AC_SUBST(XCLOCK_LIBS)
+
+PKG_CHECK_MODULES(APPDEFS, xt)
+xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+AC_ARG_WITH(appdefaultdir,
+       AC_HELP_STRING([--with-appdefaultdir=<pathname>],
+         [specify directory for app-defaults files (default is autodetected)]),
+       [appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"])
+AC_SUBST(appdefaultdir)
+
+AC_OUTPUT([Makefile])
diff --git a/xclock/depcomp b/xclock/depcomp
new file mode 100755 (executable)
index 0000000..df8eea7
--- /dev/null
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s,\\\\\\\\,/,g"
+   depmode=msvisualcpp
+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.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    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.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[     ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "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"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${
+              s/^ *//
+              s/ \\*$//
+              s/$/:/
+              p
+            }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # 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 mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $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 "X$1" != 'X--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 "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    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.
+    -arch)
+      eat=yes ;;
+    -*|$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 "X$1" != 'X--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.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::     \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # 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
+  ;;
+
+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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xclock/install-sh b/xclock/install-sh
new file mode 100755 (executable)
index 0000000..6781b98
--- /dev/null
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# 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.
+
+nl='
+'
+IFS=" ""       $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+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:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+       shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+       case $mode in
+         *' '* | *'    '* | *'
+'*       | *'*'* | *'?'* | *'['*)
+           echo "$0: invalid mode: $mode" >&2
+           exit 1;;
+       esac
+       shift;;
+
+    -o) chowncmd="$chownprog $2"
+       shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+       shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)        shift
+       break;;
+
+    -*)        echo "$0: invalid option: $1" >&2
+       exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # 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: $dst_arg: Is a directory" >&2
+       exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+       (dirname "$dst") 2>/dev/null ||
+       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+            X"$dst" : 'X\(//\)[^/]' \| \
+            X"$dst" : 'X\(//\)$' \| \
+            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+       echo X"$dst" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+       # Create intermediate dirs using mode 755 as modified by the umask.
+       # This is like FreeBSD 'install' as of 1997-10-28.
+       umask=`umask`
+       case $stripcmd.$umask in
+         # Optimize common cases.
+         *[2367][2367]) mkdir_umask=$umask;;
+         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+         *[0-7])
+           mkdir_umask=`expr $umask + 22 \
+             - $umask % 100 % 40 + $umask % 20 \
+             - $umask % 10 % 4 + $umask % 2
+           `;;
+         *) mkdir_umask=$umask,go-w;;
+       esac
+
+       # With -d, create the new directory with the user-specified mode.
+       # Otherwise, rely on $mkdir_umask.
+       if test -n "$dir_arg"; then
+         mkdir_mode=-m$mode
+       else
+         mkdir_mode=
+       fi
+
+       posix_mkdir=false
+       case $umask in
+         *[123567][0-7][0-7])
+           # POSIX mkdir -p sets u+wx bits regardless of umask, which
+           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+           ;;
+         *)
+           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+           if (umask $mkdir_umask &&
+               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+           then
+             if test -z "$dir_arg" || {
+                  # Check for POSIX incompatibilities with -m.
+                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                  # other-writeable bit of parent directory when it shouldn't.
+                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                  case $ls_ld_tmpdir in
+                    d????-?r-*) different_mode=700;;
+                    d????-?--*) different_mode=755;;
+                    *) false;;
+                  esac &&
+                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                  }
+                }
+             then posix_mkdir=:
+             fi
+             rmdir "$tmpdir/d" "$tmpdir"
+           else
+             # Remove any dirs left behind by ancient mkdir implementations.
+             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+           fi
+           trap '' 0;;
+       esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+       umask $mkdir_umask &&
+       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+       /*) prefix='/';;
+       -*) prefix='./';;
+       *)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+       test -z "$d" && continue
+
+       prefix=$prefix$d
+       if test -d "$prefix"; then
+         prefixes=
+       else
+         if $posix_mkdir; then
+           (umask=$mkdir_umask &&
+            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+           # Don't fail if two instances are running concurrently.
+           test -d "$prefix" || exit 1
+         else
+           case $prefix in
+             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+             *) qprefix=$prefix;;
+           esac
+           prefixes="$prefixes '$qprefix'"
+         fi
+       fi
+       prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+       # Don't fail if two instances are running concurrently.
+       (umask $mkdir_umask &&
+        eval "\$doit_exec \$mkdirprog $prefixes") ||
+         test -d "$dstdir" || exit 1
+       obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # 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
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"    2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+       # Now remove or move aside any old file at destination location.
+       # We try this two ways since rm can't unlink itself on some
+       # systems and the destination file might be busy for other
+       # reasons.  In this case, the final cleanup might fail but the new
+       # file should still install successfully.
+       {
+         test ! -f "$dst" ||
+         $doit $rmcmd -f "$dst" 2>/dev/null ||
+         { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+           { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+         } ||
+         { echo "$0: cannot unlink or rename $dst" >&2
+           (exit 1); exit 1
+         }
+       } &&
+
+       # Now rename the file to the real destination.
+       $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xclock/missing b/xclock/missing
new file mode 100755 (executable)
index 0000000..28055d2
--- /dev/null
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# 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=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+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'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  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]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
+# 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).  This is about non-GNU programs, so use $1 not
+# $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 $program 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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if test ! -f y.tab.h; then
+       echo >y.tab.h
+    fi
+    if test ! -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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if test ! -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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit $?
+    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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+       /^@setfilename/{
+         s/.* \([^ ]*\) *$/\1/
+         p
+         q
+       }' $infile`
+      # ... 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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xclock/xclock.c b/xclock/xclock.c
new file mode 100644 (file)
index 0000000..6b80ad0
--- /dev/null
@@ -0,0 +1,228 @@
+/* $Xorg: xclock.c,v 1.4 2001/02/09 02:05:39 xorgcvs Exp $ */
+/* $XdotOrg: $ */
+
+/*
+ * xclock --  Hacked from Tony Della Fera's much hacked clock program.
+ *
+ * "-strftime" option added by George Belotsky, Open Light Software Inc.
+ */
+
+/*
+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: xclock.c,v 1.16 2002/10/21 13:33:08 alanh Exp $ */
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <X11/Xatom.h>
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Shell.h>
+#include "Clock.h"
+#include <X11/Xaw/Cardinals.h>
+#include "clock.bit"
+#include "clmask.bit"
+
+#ifdef XKB
+#include <X11/extensions/XKBbells.h>
+#endif
+
+#ifndef NO_I18N
+#include <locale.h> /* for setlocale() */
+Boolean no_locale = True; /* if True, use old behavior */
+#endif
+
+#ifdef HAVE_GETPID
+# include <unistd.h>
+#endif
+
+/* Command line options table.  Only resources are entered here...there is a
+   pass over the remaining options after XtParseCommand is let loose. */
+
+static XrmOptionDescRec options[] = {
+{"-chime",     "*clock.chime",         XrmoptionNoArg,         "TRUE"},
+{"-hd",                "*clock.hands",         XrmoptionSepArg,        NULL},
+{"-hands",     "*clock.hands",         XrmoptionSepArg,        NULL},
+{"-hl",                "*clock.highlight",     XrmoptionSepArg,        NULL},
+{"-highlight", "*clock.highlight",     XrmoptionSepArg,        NULL},
+{"-update",    "*clock.update",        XrmoptionSepArg,        NULL},
+{"-padding",   "*clock.padding",       XrmoptionSepArg,        NULL},
+{"-d",         "*clock.analog",        XrmoptionNoArg,         "FALSE"},
+{"-digital",   "*clock.analog",        XrmoptionNoArg,         "FALSE"},
+{"-analog",    "*clock.analog",        XrmoptionNoArg,         "TRUE"},
+{"-twelve",    "*clock.twentyfour",    XrmoptionNoArg,         "FALSE"},
+{"-twentyfour",        "*clock.twentyfour",    XrmoptionNoArg,         "TRUE"},
+{"-brief",     "*clock.brief",         XrmoptionNoArg,         "TRUE"},
+{"-utime",     "*clock.utime",         XrmoptionNoArg,         "TRUE"},
+{"-strftime",  "*clock.strftime",      XrmoptionSepArg,        NULL},
+#ifdef XRENDER
+{"-face",      "*clock.face",          XrmoptionSepArg,        NULL},
+{"-render",    "*clock.render",        XrmoptionNoArg,         "TRUE"},
+{"-norender",  "*clock.render",        XrmoptionNoArg,         "FALSE"},
+{"-sharp",     "*clock.sharp",         XrmoptionNoArg,         "TRUE"},
+#endif
+};
+
+static void quit ( Widget w, XEvent *event, String *params,
+                  Cardinal *num_params );
+
+static XtActionsRec xclock_actions[] = {
+    { "quit",  quit },
+};
+
+static Atom wm_delete_window;
+
+/*
+ * Report the syntax for calling xclock.
+ */
+static void
+Syntax(char *call)
+{
+       (void) printf ("Usage: %s [-analog] [-bw <pixels>] [-digital] [-brief]\n", call);
+       (void) printf ("       [-utime] [-strftime <fmt-str>]\n");
+       (void) printf ("       [-fg <color>] [-bg <color>] [-hd <color>]\n");
+       (void) printf ("       [-hl <color>] [-bd <color>]\n");
+       (void) printf ("       [-fn <font_name>] [-help] [-padding <pixels>]\n");
+       (void) printf ("       [-rv] [-update <seconds>] [-display displayname]\n");
+#ifdef XRENDER
+       (void) printf ("       [-[no]render] [-face <face name>] [-sharp]\n");
+#endif
+       (void) printf ("       [-geometry geom] [-twelve] [-twentyfour]\n\n");
+       exit(1);
+}
+
+static void
+die(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    XCloseDisplay(XtDisplayOfObject(w));
+    exit(0);
+}
+
+static void
+quit(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    Arg arg;
+
+    if (event->type == ClientMessage &&
+       event->xclient.data.l[0] != wm_delete_window) {
+#ifdef XKB
+       XkbStdBell(XtDisplay(w), XtWindow(w), 0, XkbBI_MinorError);
+#else
+       XBell (XtDisplay(w), 0);
+#endif
+    } else {
+       /* resign from the session */
+       XtSetArg(arg, XtNjoinSession, False);
+       XtSetValues(w, &arg, ONE);
+       die(w, NULL, NULL);
+    }
+}
+
+static void
+save(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    XtCheckpointToken token = (XtCheckpointToken) call_data;
+    /* we have nothing to save */
+    token->save_success = True;
+}
+
+int
+main(int argc, char *argv[])
+{
+    Widget toplevel;
+    Arg arg;
+    Pixmap icon_pixmap = None;
+    XtAppContext app_con;
+
+#ifndef NO_I18N
+    char *locale_name = setlocale(LC_ALL,"");
+    XtSetLanguageProc ( NULL, NULL, NULL );
+
+    if(!locale_name || 0 == strcmp(locale_name,"C")) {
+       no_locale = True;
+    }
+    else {
+       no_locale = False;
+    }
+#endif
+
+    toplevel = XtOpenApplication(&app_con, "XClock",
+                                options, XtNumber(options), &argc, argv, NULL,
+                                sessionShellWidgetClass, NULL, ZERO);
+    if (argc != 1) Syntax(argv[0]);
+    XtAddCallback(toplevel, XtNdieCallback, die, NULL);
+    XtAddCallback(toplevel, XtNsaveCallback, save, NULL);
+    XtAppAddActions (app_con, xclock_actions, XtNumber(xclock_actions));
+
+    /*
+     * This is a hack so that wm_delete_window will do something useful
+     * in this single-window application.
+     */
+    XtOverrideTranslations(toplevel,
+                   XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()"));
+
+    XtSetArg(arg, XtNiconPixmap, &icon_pixmap);
+    XtGetValues(toplevel, &arg, ONE);
+
+    if (icon_pixmap == None) {
+       arg.value = (XtArgVal)XCreateBitmapFromData(XtDisplay(toplevel),
+                                      XtScreen(toplevel)->root,
+                                      (char *)clock_bits, clock_width, clock_height);
+       XtSetValues (toplevel, &arg, ONE);
+    }
+
+    XtSetArg(arg, XtNiconMask, &icon_pixmap);
+    XtGetValues(toplevel, &arg, ONE);
+    if (icon_pixmap == None) {
+       arg.value = (XtArgVal)XCreateBitmapFromData(XtDisplay(toplevel),
+                                      XtScreen(toplevel)->root,
+                                      (char *)clock_mask_bits, clock_mask_width,
+                                      clock_mask_height);
+       XtSetValues (toplevel, &arg, ONE);
+    }
+
+    XtCreateManagedWidget ("clock", clockWidgetClass, toplevel, NULL, ZERO);
+    XtRealizeWidget (toplevel);
+    wm_delete_window = XInternAtom (XtDisplay(toplevel), "WM_DELETE_WINDOW",
+                                   False);
+    (void) XSetWMProtocols (XtDisplay(toplevel), XtWindow(toplevel),
+                           &wm_delete_window, 1);
+
+#ifdef HAVE_GETPID
+    {
+       pid_t pid = getpid();
+       XChangeProperty(XtDisplay(toplevel), XtWindow(toplevel),
+                       XInternAtom(XtDisplay(toplevel), "_NET_WM_PID", False),
+                       XA_CARDINAL, 32, PropModeReplace,
+                       (unsigned char *) &pid, 1);
+    }
+#endif
+
+    XtAppMainLoop (app_con);
+    exit(0);
+}
diff --git a/xclock/xclock.man b/xclock/xclock.man
new file mode 100644 (file)
index 0000000..1aa65b2
--- /dev/null
@@ -0,0 +1,273 @@
+.\" $Xorg: xclock.man,v 1.4 2001/02/09 02:05:39 xorgcvs Exp $
+.\" Copyright 1988, 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.
+.\"
+.\" $XFree86: xc/programs/xclock/xclock.man,v 1.15 2003/07/04 16:24:30 eich Exp $
+.\"
+.TH XCLOCK 1 __xorgversion__
+.SH NAME
+xclock \- analog / digital clock for X
+.SH SYNOPSIS
+.ta 8n
+\fBxclock\fP [ \fB\-help\fP ] [ \fB\-analog\fP | \fB\-digital\fP ]
+[ \fB\-brief\fP ] [ \fB\-chime\fP ] [ \fB\-hd\fP \fIcolor\fP ]
+[ \fB\-hl\fP \fIcolor\fP ] [ \fB\-update\fP \fIseconds\fP ]
+[ \fB\-strftime\fP \fIformat\fP ]
+[ \fB\-twelve\fP | \fB-twentyfour\fP | \fB-utime\fP ]
+[ \fB\-padding\fP \fInumber\fP ]
+[ \fB\-norender\fP ]
+[ \fB\-render\fP ]
+[ \fB\-sharp\fP ]
+[ \fB\-face\fP \fIpattern\fP ]
+.SH DESCRIPTION
+The
+.I xclock
+program displays the time in analog or digital form.  The time is continuously
+updated at a frequency which may be specified by the user.
+.SH OPTIONS
+.I Xclock
+accepts all of the standard X Toolkit command line options along with the
+additional options listed below:
+.TP 8
+.B \-help
+This option indicates that a brief summary of the allowed options should be
+printed on the standard error.
+.TP 8
+.B \-analog
+This option indicates that a conventional 12 hour clock face with tick marks
+and hands should be used.  This is the default.
+.TP 8
+\fB\-digital\fP or \fB\-d\fP
+This option indicates that a 24 hour digital clock should be used.
+.TP 8
+\fB\-brief\fP
+This option indicates that the digital clock should only display the hours
+and minutes fields.  The default is to show the full time and date information.
+.TP 8
+\fB\-utime\fP
+This option indicates that a digital clock should display seconds since
+the Epoch (in format '970012340 seconds since Epoch' instead of a standard
+24-hour time.
+.TP 8
+.B \-strftime \fIformat\fP
+This option allows an strftime(3) format string to be specified for the
+digital clock's display.
+.TP 8
+.B \-twelve
+This option indicates that a digital clock should display the time in
+twelve hour format.
+.TP 8
+.B \-twentyfour
+This option indicates that a digital clock should display the time in
+twenty-four hour format.  This is the default when a digital clock is used.
+.TP 8
+.B \-chime
+This option indicates that the clock should chime
+once on the half hour and twice on the hour.
+.TP 8
+\fB\-hands\fP \fIcolor\fP (or \fB\-hd\fP \fIcolor\fP)
+This option specifies the color of the hands on an analog clock.  The default
+is \fIblack\fP.
+This option is effectively ignored when Xrender is in use.
+.TP 8
+\fB\-highlight\fP \fIcolor\fP (or \fB\-hl\fP \fIcolor\fP)
+This option specifies the color of the edges of the hands on an analog clock,
+and is only useful on color displays.  The default is \fIblack\fP.
+This option is effectively ignored when Xrender is in use.
+.TP 8
+.B \-update \fIseconds\fP
+This option specifies the frequency in seconds at which \fIxclock\fP
+should update its display.  If the clock is obscured and then exposed,
+it will be updated immediately.  A value of 30 seconds or less will enable a
+second hand on an analog clock.  The default is 60 seconds.
+.TP 8
+.B \-padding \fInumber\fP
+This option specifies the width in pixels of the padding
+between the window border and clock text or picture.  The default is 10
+on a digital clock and 8 on an analog clock.
+.TP 8
+.B \-render
+This option tells \fIxclock\fP to use the Xrender extension to draw an
+anti-aliased face. This is the default if \fIxclock\fP has been
+compiled with Xrender support.
+Note that the color selection options and resources used when Xrender is
+in effect differ from the standard options.
+.TP 8
+.B \-norender
+This option turns off the use of Xrender to draw the clock.
+.TP 8
+.B \-sharp
+This option tells \fIxclock\fP to use sharper edges when drawn using
+the Xrender extension.
+.TP 8
+.B \-face \fIpattern\fP
+This option specifies the font to use in digital mode when the
+Xrender extension is used.  Patterns are specified using the
+fontconfig face format described in the
+.I Font Names
+section of
+.IR fonts.conf (__filemansuffix__).
+.SH X DEFAULTS
+This program uses the
+.I Clock
+widget.  It understands all of the core resource names and classes as well as:
+.PP
+.TP 8
+.B width (\fPclass\fB Width)
+Specifies the width of the clock.  The default for analog clocks is 164
+pixels; the default for digital clocks is whatever is needed to hold the
+clock when displayed in the chosen font.
+.TP 8
+.B height (\fPclass\fB Height)
+Specifies the height of the clock.  The default for analog clocks is 164
+pixels; the default for digital clocks is whatever is needed to hold the
+clock when displayed in the chosen font.
+.TP 8
+.B update (\fPclass\fB Interval)
+Specifies the frequency in seconds at which the time should be redisplayed.
+.TP 8
+.B foreground (\fPclass\fB Foreground)
+Specifies the color for the tick marks. The default depends on whether
+\fIreverseVideo\fP is specified.  If \fIreverseVideo\fP is specified
+the default is \fIlwhite\fP, otherwise the default is \fIblack\fP.
+
+.TP 8
+.B hands (\fPclass\fB Foreground)
+Specifies the color of the insides of the clock's hands. The default
+depends on whether
+\fIreverseVideo\fP is specified.  If \fIreverseVideo\fP is specified
+the default is \fIlwhite\fP, otherwise the default is \fIblack\fP.
+Note that this resource is not used when Xrender is in effect.
+.TP 8
+.B highlight (\fPclass\fB Foreground)
+Specifies the color used to highlight the clock's hands. The default is
+ depends on whether
+\fIreverseVideo\fP is specified.  If \fIreverseVideo\fP is specified
+the default is \fIlwhite\fP, otherwise the default is \fIblack\fP.
+Note that this resource is not used when Xrender is in effect.
+.TP 8
+.B analog (\fPclass\fB Boolean)
+Specifies whether or not an analog clock should be used instead of a digital
+one.  The default is True.
+.TP 8
+.B twentyfour (\fPclass\fB Boolean)
+Specifies whether or not a digital clock should display the time in
+twenty-four hour format.  The default is True.
+.TP 8
+.B chime (\fPclass\fB Boolean)
+Specifies whether or not a bell should be rung on the hour and half hour.
+.TP 8
+.B padding (\fPclass\fB Margin)
+Specifies the amount of internal padding in pixels to be used.  The default is
+8.
+.TP 8
+.B font (\fPclass\fB Font)
+Specifies the font to be used for the digital clock.  Note that variable width
+fonts currently will not always display correctly.
+This font is only used when Xrender is not in effect.
+.TP 8
+.B render (\fPclass\fB Boolean)
+Specifies whether or not the Xrender extension should be used for the
+display. The default is True if \fIxclock\fP has been compiled with
+Xrender support.
+.PP
+When Xrender is in effect, the following additional resources are
+understood:
+.PP
+.TP 8
+.B face (\fPclass\fB FaceName)
+Specify the pattern for the font to be used for the digital clock when
+Xrender is used.   Patterns are specified using the fontconfig face format
+described in the
+.I Font Names
+section of
+.IR fonts.conf (__filemansuffix__).
+.TP 8
+.B sharp (\fPclass\fB Boolean)
+Specifies if sharp edges should be used when rendering the clock.
+The default is False.
+.TP 8
+.B buffer (\fPclass\fB Boolean)
+Specifies that the updates of the image are drawn to a pixmap before copied
+into the window instead drawing them into the window directly.
+.PP
+The defaults of the following color resources depend on whether
+\fIreverseVideo\fP is specified.
+If \fIreverseVideo\fP is specified the default is \fIlwhite\fP,
+otherwise the default is \fIblack\fP.
+.TP 8
+.B hourColor (\fPclass\fB Foreground)
+The color of the hour hand.
+.TP 8
+.B minuteColor (\fPclass\fB Foreground)
+The color of the minute hand.
+.TP 8
+.B secondColor (\fPclass\fB Foreground)
+The color of the second hand.
+.TP 8
+.B majorColor (\fPclass\fB Foreground)
+The color of the major scale ticks (i. e. each five minutes).
+.TP 8
+.B minorColor (\fPclass\fB Foreground)
+The color of the minor scale ticks (between major ticks).
+.SH WIDGETS
+In order to specify resources, it is useful to know the hierarchy of
+the widgets which compose \fIxclock\fR.  In the notation below,
+indentation indicates hierarchical structure.  The widget class name
+is given first, followed by the widget instance name.
+.sp
+.nf
+.\".TA .5i
+.ta .5i
+XClock  xclock
+       Clock  clock
+.fi
+.sp
+.SH ENVIRONMENT
+.PP
+.TP 8
+.B DISPLAY
+to get the default host and display number.
+.TP 8
+.B XENVIRONMENT
+to get the name of a resource file that overrides the global resources
+stored in the RESOURCE_MANAGER property.
+.SH FILES
+.TP
+.I __apploaddir__/XClock
+specifies required resources
+.SH "SEE ALSO"
+X(__miscmansuffix__), xrdb(1), time(3C), fonts.conf (__filemansuffix__).
+.SH BUGS
+.I Xclock
+believes the system clock.
+.PP
+When in digital mode, the string should be centered automatically.
+.SH AUTHORS
+Tony Della Fera (MIT-Athena, DEC)
+.br
+Dave Mankins (MIT-Athena, BBN)
+.br
+Ed Moy (UC Berkeley)
+
diff --git a/xconsole/AUTHORS b/xconsole/AUTHORS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xconsole/COPYING b/xconsole/COPYING
new file mode 100644 (file)
index 0000000..7f33cbf
--- /dev/null
@@ -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/xconsole/ChangeLog b/xconsole/ChangeLog
new file mode 100644 (file)
index 0000000..505127b
--- /dev/null
@@ -0,0 +1,396 @@
+commit cda9968cea772dbc94b50d791a5be62203ae9ddf
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Aug 20 18:58:33 2007 -0700
+
+    Version bump: 1.0.3
+
+configure.ac
+
+commit 9eee6c49bd6f57d51c517a6703cac2f29732231a
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Aug 20 18:54:22 2007 -0700
+
+    Add *~ to .gitignore to skip patch/emacs droppings
+
+.gitignore
+
+commit d1e90da451da71d7d362236c5709d9931ab7b9d1
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Aug 20 18:53:41 2007 -0700
+
+    Replace xconsole_CFLAGS with AM_CFLAGS to make automake-1.10 happier
+
+Makefile.am
+
+commit 3d4f2f96fc661095ce615928e6b586784f5d35e5
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Sun Jul 30 18:42:08 2006 +0200
+
+    Check if openpty() is available and use it if it is.
+
+configure.ac
+xconsole.c
+
+commit 5bdbbecf51e3a73c6660498f8598f0731b43a703
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Sun Jul 30 16:31:03 2006 +0200
+
+    Remove ChangeLog, replace with a rule that generates it using git-log
+
+ChangeLog
+Makefile.am
+
+commit c8a026e7c8457cd726f8f6fbd74ade325a9f486e
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Sun Jul 30 16:29:10 2006 +0200
+
+    rename .cvsignore -> .gitignore
+
+.cvsignore
+.gitignore
+
+commit 86e5d9ca5836d4ad02faa1a5f9c0db239464bde1
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed Apr 26 23:38:08 2006 +0000
+
+    Bump to 1.0.2
+
+ChangeLog
+configure.ac
+
+commit 219ef4e86f05e7a473e399c5188efdb7f16f31f1
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Sat Mar 18 18:31:08 2006 +0000
+
+    Avoid potential underflow if read() returns -1. Coverity CID 414
+
+ChangeLog
+xconsole.c
+
+commit 950d308b3230e7e89d307fd95abb983e44987665
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 21 02:29:49 2005 +0000
+
+    Update package version for X11R7 release.
+
+ChangeLog
+configure.ac
+
+commit f3755877004e49e96f26b120e0716f6673dc738b
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Dec 19 16:22:42 2005 +0000
+
+    Stub COPYING files
+
+COPYING
+
+commit a87b4d1f07448fde9b4f7ecad965210a339caaa5
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:24:05 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+ChangeLog
+configure.ac
+
+commit d82f94100bd454d3298c6548173827a67cb4d7ad
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 7 16:17:59 2005 +0000
+
+    Change to use the app-defaults default dir configured in libXt.
+
+ChangeLog
+Makefile.am
+configure.ac
+
+commit c681eac9a17d8d3f16efa2a992b02972cfa71926
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 6 22:48:20 2005 +0000
+
+    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+ChangeLog
+Makefile.am
+
+commit 406fdcbe2e0b7f6af37c6d6965f85adfa8bb3aa6
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Dec 3 05:49:18 2005 +0000
+
+    Update package version number for X11R7 RC3 release.
+
+ChangeLog
+configure.ac
+
+commit 81d992f635798580d71fc79abf9df2a825f125e0
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Nov 28 22:01:40 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)
+
+Makefile.am
+
+commit 61eac81e62e1b9b141ce7aaf3fd778ad1f9d7924
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Mon Nov 21 10:34:59 2005 +0000
+
+    Another pass at .cvsignores for apps.
+
+.cvsignore
+
+commit 68ea4cb352cc528736914c7d328df024164e0e60
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Sun Nov 20 22:08:51 2005 +0000
+
+    Add/improve .cvsignore files for apps.
+
+.cvsignore
+
+commit 630bdf36e17b8f125f8aa0cabf41c75e650ac973
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Nov 9 21:09:20 2005 +0000
+
+    Update package version number for X11R7 RC2 release.
+
+ChangeLog
+configure.ac
+
+commit 31dbed9163fd4384dc5dc81f426ce82176587dd2
+Author: Kean Johnson <kean@armory.com>
+Date:   Tue Nov 8 06:33:31 2005 +0000
+
+    See ChangeLog entry 2005-11-07 for details.
+
+xconsole.c
+
+commit 0710398b397c5f8b09b6216bd18e84337fb4efdb
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:47:52 2005 +0000
+
+    Update package version number for RC1 release.
+
+ChangeLog
+configure.ac
+
+commit 34924fc44be47d2d58c701485b4e1b6fad28c21d
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Oct 18 00:32:55 2005 +0000
+
+    Change default install dir for app-default files from
+        $(sysconfdir)/X11/app-defaults to $(libdir)/X11/app-defaults to match
+        the monolith & allow localization
+
+Makefile.am
+
+commit 324e3c08212f7dbe8b08f7d9028f2e775cbc73c1
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Oct 17 23:56:21 2005 +0000
+
+    Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to
+        work better with BSD make
+
+Makefile.am
+
+commit ad9813ed3ad1d8adb562ac9b279c18753249786f
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Fri Oct 14 00:25:43 2005 +0000
+
+    Use sed to fill in variables in man page
+
+Makefile.am
+configure.ac
+
+commit f8ca981b964aaa3c59eab661ce35efb7d7085020
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Wed Aug 17 21:03:23 2005 +0000
+
+    Bugzilla #4130 <https://bugs.freedesktop.org/show_bug.cgi?id=4130>
+        xconsole: non-ascii characters don't show up (Samuel Thibault)
+
+xconsole.c
+
+commit 05a718f11fc97f1e34cf927fd8762f8251356dcb
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Aug 1 20:25:29 2005 +0000
+
+    Install man pages to section 1 instead of section m (Patch from Donnie
+        Berkholz)
+
+Makefile.am
+
+commit c0ecb99582a714c95282f1187c0f39acee640779
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Jul 29 21:22:31 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
+
+configure.ac
+
+commit b23b1f35930ed0d10fef42a23f88a2dacd29d91c
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Wed Jul 27 00:15:46 2005 +0000
+
+    Fix xconsole build break on AIX caused by removal of ptyx defines.
+
+xconsole.c
+
+commit b471e2609662c2ec83d26ee32a7900e528f67f75
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Jul 26 15:44:02 2005 +0000
+
+    Replace more GNU make-ism's with more portable macros
+
+Makefile.am
+
+commit e656ddba66cda7432279cd10ac5a450e8b2c342c
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed Jul 20 19:31:52 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.
+
+Makefile.am
+configure.ac
+
+commit 171e31464fc9d4f39403931b1126c3e2cf52b84e
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Sun Jul 17 21:11:32 2005 +0000
+
+    fix rules to work with non-GNU make.
+
+Makefile.am
+
+commit 6fa7b824f077a0c04eb678c8736cda077232a084
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Thu Jul 7 23:08:22 2005 +0000
+
+    - Build system for xconsole
+    - Remove include of "../xterm/ptyx" from xc/programs/xconsole/xconsole.c
+
+AUTHORS
+COPYING
+ChangeLog
+INSTALL
+Makefile.am
+NEWS
+README
+autogen.sh
+configure.ac
+xconsole.c
+
+commit b38b9a7731430359f10ba74706fc6d4c786d2d36
+Author: Egbert Eich <eich@suse.de>
+Date:   Mon Oct 18 14:21:46 2004 +0000
+
+    Made handling of DevelDrivers for x86-64 more conformant to other
+        platforms.
+    Compress all font encodings (Stefan Dirsch).
+    Fixed warnings.
+    Turn on forwarding XNSpotLocation event to XIM server in OffTheSpot and
+        Root mode (bugzilla #1580, James Su).
+    Added another compose key combination for the Euro symbol (Stefan Dirsch).
+    Added support for UTF-8 in ja_JP, ko_KR and zh_TW locales (Mike Fabian).
+    Changed default encoding for ru from KOI8-R to ISO8859-5 (Mike Fabian).
+        This is the encoding that is also used by glibc. We may break other
+        libcs - lets see who complains.
+    Added explanation for DESTDIR to install to a different directory than /.
+    Added some early bailouts to atiprobe if PCI structure pointer is NULL to
+        prevent sig11.
+    XV support doesn't depend on 2D acceleration any more. This patch removes
+        this limitation from the NSC driver. This is a patch that I have
+        committed to XFree86 a while ago but never ported over to X.Org.
+        Matthieu Herrb contributed some build fixes.
+    Fixing SetDPMSTimers() so that DPMS*Time == 0 disables the appropriate
+        timer. This takes advantage of the fact that TimerSet() with a timeout
+        argument 0 behaves like TimerCanel().
+    Use /dev/xconsole (named pipe) or devpts for system logger (Werner Fink).
+    Create missing links for backward compatibility to XFree86 (Stefan Dirsch).
+    Changed comment to mention xorg.
+    Changed cursor for the 'kill' action from XC_draped_box to XC_Pirate. If
+        you don't like it we can change it back (original author unkown).
+    Added 'pic' to the man page rendering command pipeline (Werner Fink).
+    Added missing return value (Stefan Dirsch, Roland Mainz)
+
+xconsole.c
+
+commit 7da0d180d6852916e5dca44842ee88e7d8429e6e
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 19:54:41 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+XConsole.ad
+xconsole.c
+xconsole.man
+
+commit 0b03eedd1839ec360b2bb7c0b4b9592cd53cfda5
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:35:01 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+XConsole.ad
+xconsole.c
+xconsole.man
+
+commit 2ec4fa572aba38d9e01205a2b440f6fcf29b796e
+Author: Egbert Eich <eich@suse.de>
+Date:   Wed Mar 3 12:12:55 2004 +0000
+
+    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+XConsole.ad
+xconsole.c
+xconsole.man
+
+commit 798ad4a31ca485e2b04a2a623b1fc96f3860d11f
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:36:16 2004 +0000
+
+    readding XFree86's cvs IDs
+
+XConsole.ad
+xconsole.c
+xconsole.man
+
+commit 297a4fba84512347e1f65d5c9eca649c24271067
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 09:23:58 2004 +0000
+
+    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+XConsole.ad
+xconsole.c
+xconsole.man
+
+commit b53d3aeeedd692ef010a3ec5961079aee7d47fb3
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:29:03 2003 +0000
+
+    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+xconsole.c
+
+commit 2b2c62b3be8dd36d3231a2ad18d8b212e81695d1
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:58 2003 +0000
+
+    XFree86 4.3.0.1
+
+XConsole.ad
+xconsole.c
+xconsole.man
+
+commit 593922e4e9e9bdcb9bd2b66493b91023d8f0984b
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 15:54:53 2003 +0000
+
+    R6.6 is the Xorg base-line
diff --git a/xconsole/INSTALL b/xconsole/INSTALL
new file mode 100644 (file)
index 0000000..23e5f25
--- /dev/null
@@ -0,0 +1,236 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
+Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+These are generic installation instructions.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  (Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.)
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.  If you're
+     using `csh' on an old version of System V, you might need to type
+     `sh ./configure' instead to prevent `csh' from trying to execute
+     `configure' itself.
+
+     Running `configure' takes awhile.  While running, it prints some
+     messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+Compilers and Options
+=====================
+
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about.  Run `./configure --help' for
+details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory.  After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
+
+Installation Names
+==================
+
+By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+There may be some features `configure' cannot figure out automatically,
+but needs to determine by the type of machine the package will run on.
+Usually, assuming the package is built to be run on the _same_
+architectures, `configure' can figure that out, but if it prints a
+message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).  Here is a another example:
+
+     /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
+configuration-related scripts to be executed by `/bin/bash'.
+
+`configure' Invocation
+======================
+
+`configure' recognizes the following options to control how it operates.
+
+`--help'
+`-h'
+     Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/xconsole/Makefile.am b/xconsole/Makefile.am
new file mode 100644 (file)
index 0000000..0ff760f
--- /dev/null
@@ -0,0 +1,89 @@
+# 
+#  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 = xconsole
+
+AM_CFLAGS = $(XCONSOLE_CFLAGS)
+xconsole_LDADD = $(XCONSOLE_LIBS)
+
+xconsole_SOURCES =     \
+        xconsole.c
+
+appman_PRE = \
+        xconsole.man
+
+# App default files  (*.ad)
+
+appdefaultdir = @appdefaultdir@
+
+
+APPDEFAULTFILES = \
+        XConsole
+
+SUFFIXES = .ad
+
+.ad:
+       cp $< $@
+
+appdefault_DATA = $(APPDEFAULTFILES)
+
+EXTRA_DIST = $(APPDEFAULTFILES:%=%.ad)
+
+CLEANFILES = $(APPDEFAULTFILES)
+
+
+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) < $< > $@
+
+.PHONY: ChangeLog
+
+ChangeLog:
+       GIT_DIR=${srcdir}/.git git-log --name-only > ChangeLog
+
+dist-hook: ChangeLog
diff --git a/xconsole/Makefile.in b/xconsole/Makefile.in
new file mode 100644 (file)
index 0000000..7eeeda0
--- /dev/null
@@ -0,0 +1,695 @@
+# 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 = xconsole$(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 \
+       mkinstalldirs
+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 = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appdefaultdir)" \
+       "$(DESTDIR)$(appmandir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_xconsole_OBJECTS = xconsole.$(OBJEXT)
+xconsole_OBJECTS = $(am_xconsole_OBJECTS)
+am__DEPENDENCIES_1 =
+xconsole_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 = $(xconsole_SOURCES)
+DIST_SOURCES = $(xconsole_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|^.*/||'`;
+appdefaultDATA_INSTALL = $(INSTALL_DATA)
+appmanDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(appdefault_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@
+APPDEFS_CFLAGS = @APPDEFS_CFLAGS@
+APPDEFS_LIBS = @APPDEFS_LIBS@
+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@
+CPP = @CPP@
+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@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+GREP = @GREP@
+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@
+TMP_XAW_CFLAGS = @TMP_XAW_CFLAGS@
+TMP_XAW_LIBS = @TMP_XAW_LIBS@
+VERSION = @VERSION@
+XAW_USE_XPRINT_FALSE = @XAW_USE_XPRINT_FALSE@
+XAW_USE_XPRINT_TRUE = @XAW_USE_XPRINT_TRUE@
+XCONSOLE_CFLAGS = @XCONSOLE_CFLAGS@
+XCONSOLE_LIBS = @XCONSOLE_LIBS@
+ac_ct_CC = @ac_ct_CC@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+
+# App default files  (*.ad)
+appdefaultdir = @appdefaultdir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+AM_CFLAGS = $(XCONSOLE_CFLAGS)
+xconsole_LDADD = $(XCONSOLE_LIBS)
+xconsole_SOURCES = \
+        xconsole.c
+
+appman_PRE = \
+        xconsole.man
+
+APPDEFAULTFILES = \
+        XConsole
+
+SUFFIXES = .ad .$(APP_MAN_SUFFIX) .man
+appdefault_DATA = $(APPDEFAULTFILES)
+EXTRA_DIST = $(APPDEFAULTFILES:%=%.ad) $(appman_PRE)
+CLEANFILES = $(APPDEFAULTFILES) $(appman_DATA)
+appmandir = $(APP_MAN_DIR)
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+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'
+
+all: config.h
+       $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .ad .$(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)
+xconsole$(EXEEXT): $(xconsole_OBJECTS) $(xconsole_DEPENDENCIES) 
+       @rm -f xconsole$(EXEEXT)
+       $(LINK) $(xconsole_LDFLAGS) $(xconsole_OBJECTS) $(xconsole_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xconsole.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) '$<'`
+uninstall-info-am:
+install-appdefaultDATA: $(appdefault_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appdefaultdir)" || $(mkdir_p) "$(DESTDIR)$(appdefaultdir)"
+       @list='$(appdefault_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(appdefaultDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(appdefaultdir)/$$f'"; \
+         $(appdefaultDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(appdefaultdir)/$$f"; \
+       done
+
+uninstall-appdefaultDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appdefault_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(appdefaultdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(appdefaultdir)/$$f"; \
+       done
+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)$(appdefaultdir)" "$(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-appdefaultDATA 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-appdefaultDATA 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-appdefaultDATA 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-appdefaultDATA uninstall-appmanDATA \
+       uninstall-binPROGRAMS uninstall-info-am
+
+
+.ad:
+       cp $< $@
+
+.man.$(APP_MAN_SUFFIX):
+       sed $(MAN_SUBSTS) < $< > $@
+
+.PHONY: ChangeLog
+
+ChangeLog:
+       GIT_DIR=${srcdir}/.git git-log --name-only > 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/xconsole/NEWS b/xconsole/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xconsole/README b/xconsole/README
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xconsole/XConsole.ad b/xconsole/XConsole.ad
new file mode 100644 (file)
index 0000000..c3407d4
--- /dev/null
@@ -0,0 +1,28 @@
+! $Xorg: XConsole.ad,v 1.3 2000/08/17 19:54:13 cpqbld Exp $
+!
+!
+!
+!
+! $XFree86: xc/programs/xconsole/XConsole.ad,v 1.2 2000/03/31 22:55:55 dawes Exp $
+
+*allowShellResize:             true
+XConsole.translations:         #override\
+       <MapNotify>:            Deiconified()   \n\
+       <UnmapNotify>:          Iconified()     \n\
+       <Message>WM_PROTOCOLS:  Quit()
+XConsole.baseTranslations:             #override\
+       <MapNotify>:            Deiconified()   \n\
+       <UnmapNotify>:          Iconified()     \n\
+       <Message>WM_PROTOCOLS:  Quit()
+*text.translations:            #override\
+       Ctrl<KeyPress>C:        Clear() \n\
+       <KeyPress>Clear:        Clear()
+*text.baseTranslations:                #override\
+       Ctrl<KeyPress>C:        Clear() \n\
+       <KeyPress>Clear:        Clear()
+*text.scrollVertical:          Always
+*text.scrollHorizontal:                Never
+*text.width:                   400
+*text.height:                  70
+*text.allowResize:             true
+*editType:                     read
diff --git a/xconsole/aclocal.m4 b/xconsole/aclocal.m4
new file mode 100644 (file)
index 0000000..ee27fa0
--- /dev/null
@@ -0,0 +1,1599 @@
+# 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 <scott@netsplit.com>.
+#
+# 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 <http://pkg-config.freedesktop.org/>.])],
+               [$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 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 
+
+# XAW_CHECK_XPRINT_SUPPORT()
+# --------------------------
+# Adds --enable/disable-xprint and selects the appropriate version of the Xaw 
+# library. If neither --enable-xprint nor --disable-xprint are given, 
+# the presence of an Xaw with Xprint support will be auto detected
+
+AC_DEFUN([XAW_CHECK_XPRINT_SUPPORT],[
+       AC_ARG_ENABLE(xprint, AC_HELP_STRING([--enable-xprint], [Enable XPrint support]),
+                       [use_xprint=$enableval],[use_xprint=auto])
+       if test "x$use_xprint" = "xyes"; then
+               TMP_CHECK1=xaw8
+               TMP_CHECK2=
+               xaw_use_xprint=yes
+       elif test "x$use_xprint" = "xno"; then
+               TMP_CHECK1=xaw7
+               TMP_CHECK2=
+               xaw_use_xprint=no
+       else
+               TMP_CHECK1=xaw8
+               TMP_CHECK2=xaw7
+               xaw_use_xprint=yes
+       fi
+
+       PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK1, success=yes, success=no)
+       if [[ ! -z $TMP_CHECK2 ]] ; then
+               if test $success = no ; then
+                       PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK2, success=yes, success=no)
+                       xaw_use_xprint=no
+               fi
+       fi
+
+       if test "x$success" = "xyes"; then
+               $1_CFLAGS=$TMP_XAW_CFLAGS
+               $1_LIBS=$TMP_XAW_LIBS
+
+               AM_CONDITIONAL([XAW_USE_XPRINT], [test "x$xaw_use_xprint" = "xyes"])
+       else
+               AC_MSG_ERROR([No suitable version of Xaw found])
+       fi
+])
+
+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.5
+       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],[
+XORG_SGML_PATH=$prefix/share/sgml
+HAVE_DEFS_ENT=
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+AC_PATH_PROG(PS2PDF, ps2pdf)
+
+AC_MSG_CHECKING([Whether to build documentation])
+
+if test x$HAVE_DEFS_ENT != 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 && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+XORG_SGML_PATH=$prefix/share/sgml
+HAVE_DEFS_ENT=
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([Whether to build text documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([Whether to build PDF documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([Whether to build PostScript documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([Whether to build HTML documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# 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.  Also
+# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+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
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+               [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+               [Major version of this package])
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+               [$PVM],
+               [Minor version of this package])
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+               [$PVP],
+               [Patch version of this package])
+])
+
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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/xconsole/config.guess b/xconsole/config.guess
new file mode 100755 (executable)
index 0000000..0f0fe71
--- /dev/null
@@ -0,0 +1,1516 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
+
+timestamp='2007-03-06'
+
+# 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 <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+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 "$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 ;;
+           sh5el) machine=sh5le-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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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 <stdlib.h>
+              #include <unistd.h>
+
+              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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       exit ;;
+    i*:CYGWIN*:*)
+       echo ${UNAME_MACHINE}-pc-cygwin
+       exit ;;
+    *: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 ;;
+    *:Interix*:[3456]*)
+       case ${UNAME_MACHINE} in
+           x86) 
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           EM64T | authenticamd)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+       esac ;;
+    [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*:*:* | x86_64: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 ;;
+    avr32*: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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-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 ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-gnu
+       exit ;;
+    x86_64:Linux:*:*)
+       echo x86_64-unknown-linux-gnu
+       exit ;;
+    xtensa:Linux:*:*)
+       echo xtensa-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 <features.h>
+       #ifdef __ELF__
+       # ifdef __GLIBC__
+       #  if __GLIBC__ >= 2
+       LIBC=gnu
+       #  else
+       LIBC=gnulibc1
+       #  endif
+       # else
+       LIBC=gnulibc1
+       # endif
+       #else
+       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+       LIBC=gnu
+       #else
+       LIBC=gnuaout
+       #endif
+       #endif
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^LIBC/{
+               s: ::g
+               p
+           }'`"
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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 ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-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
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/xconsole/config.h.in b/xconsole/config.h.in
new file mode 100644 (file)
index 0000000..ed84c7e
--- /dev/null
@@ -0,0 +1,70 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the 'openpty' function. */
+#undef HAS_OPENPTY
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <pty.h> header file. */
+#undef HAVE_PTY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the <util.h> header file. */
+#undef HAVE_UTIL_H
+
+/* 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
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
diff --git a/xconsole/config.sub b/xconsole/config.sub
new file mode 100755 (executable)
index 0000000..5defff6
--- /dev/null
@@ -0,0 +1,1622 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
+
+timestamp='2007-01-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., 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 <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+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-newlib* | 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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | bfin \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fido | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore | mep \
+       | 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 \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xc16x | xscale | xscalee[bl] | 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)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | m32c-* | 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-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | 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-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tron-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | 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
+               ;;
+       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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       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 | sparcv9v)
+               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* | -solidbsd* \
+             | -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-newlib* | -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* | -rdos* | -toppers* | -drops*)
+       # 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
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
+       *-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
+               ;;
+        mep-*)
+               os=-elf
+               ;;
+       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/xconsole/configure b/xconsole/configure
new file mode 100755 (executable)
index 0000000..c458173
--- /dev/null
@@ -0,0 +1,6433 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.61 for xconsole 1.0.3.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+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) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&    (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    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=.
+  case $as_dir in
+        /*)
+          for as_base in sh bash ksh sh5; do
+            as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+          done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+        # Try only shells that exist, to save several forks.
+        if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+               { ("$as_shell") 2> /dev/null <<\_ASEOF
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+              as_have_required=yes
+              if { "$as_shell" 2> /dev/null <<\_ASEOF
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf@gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+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$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+       case $1 in
+        -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# 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`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='xconsole'
+PACKAGE_TARNAME='xconsole'
+PACKAGE_VERSION='1.0.3'
+PACKAGE_STRING='xconsole 1.0.3'
+PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+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
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+CYGPATH_W
+PACKAGE
+VERSION
+ACLOCAL
+AUTOCONF
+AUTOMAKE
+AUTOHEADER
+MAKEINFO
+install_sh
+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
+TMP_XAW_CFLAGS
+TMP_XAW_LIBS
+XAW_USE_XPRINT_TRUE
+XAW_USE_XPRINT_FALSE
+XCONSOLE_CFLAGS
+XCONSOLE_LIBS
+APPDEFS_CFLAGS
+APPDEFS_LIBS
+appdefaultdir
+CPP
+GREP
+EGREP
+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=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+PKG_CONFIG
+TMP_XAW_CFLAGS
+TMP_XAW_LIBS
+APPDEFS_CFLAGS
+APPDEFS_LIBS
+CPP'
+
+
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)   ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$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 ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -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'`
+    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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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'`
+    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; }; }
+    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 directory names.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { echo "$as_me: error: Working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$0" ||
+$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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 xconsole 1.0.3 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR          info documentation [DATAROOTDIR/info]
+  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR           man documentation [DATAROOTDIR/man]
+  --docdir=DIR           documentation root [DATAROOTDIR/doc/xconsole]
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
+_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 xconsole 1.0.3:";;
+   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
+  --enable-xprint         Enable XPrint 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<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  PKG_CONFIG  path to pkg-config utility
+  TMP_XAW_CFLAGS
+              C compiler flags for TMP_XAW, overriding pkg-config
+  TMP_XAW_LIBS
+              linker flags for TMP_XAW, overriding pkg-config
+  APPDEFS_CFLAGS
+              C compiler flags for APPDEFS, overriding pkg-config
+  APPDEFS_LIBS
+              linker flags for APPDEFS, overriding pkg-config
+  CPP         C preprocessor
+
+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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" || continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+xconsole configure 1.0.3
+generated by GNU Autoconf 2.61
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 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
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by xconsole $as_me 1.0.3, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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
+IFS=$as_save_IFS
+
+} >&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_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_arg'"
+      ;;
+    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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+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,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r 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 -f -r conftest* 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 -n "$CONFIG_SITE"; then
+  set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+  set x "$ac_default_prefix/share/config.site" \
+       "$ac_default_prefix/etc/config.site"
+fi
+shift
+for ac_site_file
+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 $ac_precious_vars; 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
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    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 -f 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$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='xconsole'
+ VERSION='1.0.3'
+
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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.exe
+  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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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.exe
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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[^ ]*//'`
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
+  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
+
+# Check that 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'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 that 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 { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 | *.map | *.inf | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+    *) 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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; 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 core 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
+{ 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
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       CFLAGS=""
+      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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+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 ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_c89=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 <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+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 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+  ;;
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+  ;;
+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
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+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
+
+       # Check whether --enable-xprint was given.
+if test "${enable_xprint+set}" = set; then
+  enableval=$enable_xprint; use_xprint=$enableval
+else
+  use_xprint=auto
+fi
+
+       if test "x$use_xprint" = "xyes"; then
+               TMP_CHECK1=xaw8
+               TMP_CHECK2=
+               xaw_use_xprint=yes
+       elif test "x$use_xprint" = "xno"; then
+               TMP_CHECK1=xaw7
+               TMP_CHECK2=
+               xaw_use_xprint=no
+       else
+               TMP_CHECK1=xaw8
+               TMP_CHECK2=xaw7
+               xaw_use_xprint=yes
+       fi
+
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for TMP_XAW" >&5
+echo $ECHO_N "checking for TMP_XAW... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$TMP_XAW_CFLAGS"; then
+        pkg_cv_TMP_XAW_CFLAGS="$TMP_XAW_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK1\"") >&5
+  ($PKG_CONFIG --exists --print-errors "$TMP_CHECK1") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_TMP_XAW_CFLAGS=`$PKG_CONFIG --cflags "$TMP_CHECK1" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$TMP_XAW_LIBS"; then
+        pkg_cv_TMP_XAW_LIBS="$TMP_XAW_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK1\"") >&5
+  ($PKG_CONFIG --exists --print-errors "$TMP_CHECK1") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_TMP_XAW_LIBS=`$PKG_CONFIG --libs "$TMP_CHECK1" 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
+               TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$TMP_CHECK1"`
+        else
+               TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$TMP_CHECK1"`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$TMP_XAW_PKG_ERRORS" >&5
+
+       { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+                success=no
+elif test $pkg_failed = untried; then
+       success=no
+else
+       TMP_XAW_CFLAGS=$pkg_cv_TMP_XAW_CFLAGS
+       TMP_XAW_LIBS=$pkg_cv_TMP_XAW_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       success=yes
+fi
+       if [ ! -z $TMP_CHECK2 ] ; then
+               if test $success = no ; then
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for TMP_XAW" >&5
+echo $ECHO_N "checking for TMP_XAW... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$TMP_XAW_CFLAGS"; then
+        pkg_cv_TMP_XAW_CFLAGS="$TMP_XAW_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK2\"") >&5
+  ($PKG_CONFIG --exists --print-errors "$TMP_CHECK2") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_TMP_XAW_CFLAGS=`$PKG_CONFIG --cflags "$TMP_CHECK2" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$TMP_XAW_LIBS"; then
+        pkg_cv_TMP_XAW_LIBS="$TMP_XAW_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK2\"") >&5
+  ($PKG_CONFIG --exists --print-errors "$TMP_CHECK2") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_TMP_XAW_LIBS=`$PKG_CONFIG --libs "$TMP_CHECK2" 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
+               TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$TMP_CHECK2"`
+        else
+               TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$TMP_CHECK2"`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$TMP_XAW_PKG_ERRORS" >&5
+
+       { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+                success=no
+elif test $pkg_failed = untried; then
+       success=no
+else
+       TMP_XAW_CFLAGS=$pkg_cv_TMP_XAW_CFLAGS
+       TMP_XAW_LIBS=$pkg_cv_TMP_XAW_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       success=yes
+fi
+                       xaw_use_xprint=no
+               fi
+       fi
+
+       if test "x$success" = "xyes"; then
+               XCONSOLE_CFLAGS=$TMP_XAW_CFLAGS
+               XCONSOLE_LIBS=$TMP_XAW_LIBS
+
+
+
+if test "x$xaw_use_xprint" = "xyes"; then
+  XAW_USE_XPRINT_TRUE=
+  XAW_USE_XPRINT_FALSE='#'
+else
+  XAW_USE_XPRINT_TRUE='#'
+  XAW_USE_XPRINT_FALSE=
+fi
+
+       else
+               { { echo "$as_me:$LINENO: error: No suitable version of Xaw found" >&5
+echo "$as_me: error: No suitable version of Xaw found" >&2;}
+   { (exit 1); exit 1; }; }
+       fi
+
+
+
+
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for APPDEFS" >&5
+echo $ECHO_N "checking for APPDEFS... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$APPDEFS_CFLAGS"; then
+        pkg_cv_APPDEFS_CFLAGS="$APPDEFS_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_APPDEFS_CFLAGS=`$PKG_CONFIG --cflags "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$APPDEFS_LIBS"; then
+        pkg_cv_APPDEFS_LIBS="$APPDEFS_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_APPDEFS_LIBS=`$PKG_CONFIG --libs "xt" 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
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xt"`
+        else
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xt"`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$APPDEFS_PKG_ERRORS" >&5
+
+       { { echo "$as_me:$LINENO: error: Package requirements (xt) were not met:
+
+$APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_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 (xt) were not met:
+
+$APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+       APPDEFS_CFLAGS=$pkg_cv_APPDEFS_CFLAGS
+       APPDEFS_LIBS=$pkg_cv_APPDEFS_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       :
+fi
+appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+
+
+
+{ echo "$as_me:$LINENO: checking for library containing openpty" >&5
+echo $ECHO_N "checking for library containing openpty... $ECHO_C" >&6; }
+if test "${ac_cv_search_openpty+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_func_search_save_LIBS=$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 GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char openpty ();
+int
+main ()
+{
+return openpty ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' util; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_search_openpty=$ac_res
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext
+  if test "${ac_cv_search_openpty+set}" = set; then
+  break
+fi
+done
+if test "${ac_cv_search_openpty+set}" = set; then
+  :
+else
+  ac_cv_search_openpty=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_search_openpty" >&5
+echo "${ECHO_T}$ac_cv_search_openpty" >&6; }
+ac_res=$ac_cv_search_openpty
+if test "$ac_res" != no; then
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+{ echo "$as_me:$LINENO: checking for openpty" >&5
+echo $ECHO_N "checking for openpty... $ECHO_C" >&6; }
+if test "${ac_cv_func_openpty+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 openpty to an innocuous variant, in case <limits.h> declares openpty.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define openpty innocuous_openpty
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char openpty (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef openpty
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char openpty ();
+/* 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_openpty || defined __stub___openpty
+choke me
+#endif
+
+int
+main ()
+{
+return openpty ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_func_openpty=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_func_openpty=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_func_openpty" >&5
+echo "${ECHO_T}$ac_cv_func_openpty" >&6; }
+if test $ac_cv_func_openpty = yes; then
+  HAS_OPENPTY="yes"
+fi
+
+if test "x$HAS_OPENPTY" = "xyes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAS_OPENPTY 1
+_ACEOF
+
+       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
+{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 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); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 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); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 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); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 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); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&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
+
+
+{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_GREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+    # Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_GREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_EGREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+    # Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_EGREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+
+   fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
+if test "${ac_cv_header_stdc+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 <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+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.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+for ac_header in util.h pty.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 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); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ---------------------------------------------------------------------- ##
+## Report this to https://bugs.freedesktop.org/enter_bug.cgi?product=xorg ##
+## ---------------------------------------------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ break
+fi
+
+done
+
+fi
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/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_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { 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=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_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; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ 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
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+
+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 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
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     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 "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+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_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$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 "${XAW_USE_XPRINT_TRUE}" && test -z "${XAW_USE_XPRINT_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"XAW_USE_XPRINT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"XAW_USE_XPRINT\" 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+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) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+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$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+       case $1 in
+        -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by xconsole $as_me 1.0.3, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+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 and configuration settings, 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 <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+xconsole config.status 1.0.3
+configured by $0, generated by GNU Autoconf 2.61,
+  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2006 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+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
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --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;;
+  --he | --h)
+    # Conflict between --help and --header
+    { 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 ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { 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"
+     ac_need_defaults=false ;;
+
+  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 CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  CONFIG_SHELL=$SHELL
+  export CONFIG_SHELL
+  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) { { 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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+#
+# Set up the sed scripts for 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
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+CYGPATH_W!$CYGPATH_W$ac_delim
+PACKAGE!$PACKAGE$ac_delim
+VERSION!$VERSION$ac_delim
+ACLOCAL!$ACLOCAL$ac_delim
+AUTOCONF!$AUTOCONF$ac_delim
+AUTOMAKE!$AUTOMAKE$ac_delim
+AUTOHEADER!$AUTOHEADER$ac_delim
+MAKEINFO!$MAKEINFO$ac_delim
+install_sh!$install_sh$ac_delim
+STRIP!$STRIP$ac_delim
+INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
+mkdir_p!$mkdir_p$ac_delim
+AWK!$AWK$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+am__leading_dot!$am__leading_dot$ac_delim
+AMTAR!$AMTAR$ac_delim
+am__tar!$am__tar$ac_delim
+am__untar!$am__untar$ac_delim
+MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
+MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
+MAINT!$MAINT$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+DEPDIR!$DEPDIR$ac_delim
+am__include!$am__include$ac_delim
+am__quote!$am__quote$ac_delim
+AMDEP_TRUE!$AMDEP_TRUE$ac_delim
+AMDEP_FALSE!$AMDEP_FALSE$ac_delim
+AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
+CCDEPMODE!$CCDEPMODE$ac_delim
+am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
+am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
+PKG_CONFIG!$PKG_CONFIG$ac_delim
+TMP_XAW_CFLAGS!$TMP_XAW_CFLAGS$ac_delim
+TMP_XAW_LIBS!$TMP_XAW_LIBS$ac_delim
+XAW_USE_XPRINT_TRUE!$XAW_USE_XPRINT_TRUE$ac_delim
+XAW_USE_XPRINT_FALSE!$XAW_USE_XPRINT_FALSE$ac_delim
+XCONSOLE_CFLAGS!$XCONSOLE_CFLAGS$ac_delim
+XCONSOLE_LIBS!$XCONSOLE_LIBS$ac_delim
+APPDEFS_CFLAGS!$APPDEFS_CFLAGS$ac_delim
+APPDEFS_LIBS!$APPDEFS_LIBS$ac_delim
+appdefaultdir!$appdefaultdir$ac_delim
+CPP!$CPP$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+host_os!$host_os$ac_delim
+APP_MAN_SUFFIX!$APP_MAN_SUFFIX$ac_delim
+LIB_MAN_SUFFIX!$LIB_MAN_SUFFIX$ac_delim
+FILE_MAN_SUFFIX!$FILE_MAN_SUFFIX$ac_delim
+MISC_MAN_SUFFIX!$MISC_MAN_SUFFIX$ac_delim
+DRIVER_MAN_SUFFIX!$DRIVER_MAN_SUFFIX$ac_delim
+ADMIN_MAN_SUFFIX!$ADMIN_MAN_SUFFIX$ac_delim
+APP_MAN_DIR!$APP_MAN_DIR$ac_delim
+LIB_MAN_DIR!$LIB_MAN_DIR$ac_delim
+FILE_MAN_DIR!$FILE_MAN_DIR$ac_delim
+MISC_MAN_DIR!$MISC_MAN_DIR$ac_delim
+DRIVER_MAN_DIR!$DRIVER_MAN_DIR$ac_delim
+ADMIN_MAN_DIR!$ADMIN_MAN_DIR$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 15; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_ACEOF
+
+
+# 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
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      ac_file_inputs="$ac_file_inputs $ac_f"
+    done
+
+    # 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.  */
+    configure_input="Generated from "`IFS=:
+         echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    fi
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin";;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$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'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+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&@top_builddir@&$ac_top_builddir_sub&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out"; rm -f "$tmp/out";;
+  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
+  esac
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+_ACEOF
+
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status.  If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless.  But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([  #]*\\)[^        ]*\\([  ]*'
+ac_dB='\\)[     (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
+
+uniq confdefs.h |
+  sed -n '
+       t rset
+       :rset
+       s/^[     ]*#[    ]*define[       ][      ]*//
+       t ok
+       d
+       :ok
+       s/[\\&,]/\\&/g
+       s/^\('"$ac_word_re"'\)\(([^()]*)\)[      ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+       s/^\('"$ac_word_re"'\)[  ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+  ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then replace #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.
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[    #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is:         sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is:        sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be:    sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
+do
+  # Write a here document:
+    cat >>$CONFIG_STATUS <<_ACEOF
+    # First, check the format of the line:
+    cat >"\$tmp/defines.sed" <<\\CEOF
+/^[     ]*#[    ]*undef[        ][      ]*$ac_word_re[  ]*\$/b def
+/^[     ]*#[    ]*define[       ][      ]*$ac_word_re[(         ]/b def
+b
+:def
+_ACEOF
+  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+  grep . conftest.tail >/dev/null || break
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines conftest.tail
+
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
+cat >>$CONFIG_STATUS <<\_ACEOF
+  if test x"$ac_file" != x-; then
+    echo "/* $configure_input  */" >"$tmp/config.h"
+    cat "$ac_result" >>"$tmp/config.h"
+    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
+      rm -f $ac_file
+      mv "$tmp/config.h" $ac_file
+    fi
+  else
+    echo "/* $configure_input  */"
+    cat "$ac_result"
+  fi
+  rm -f "$tmp/out12"
+# 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" >`$as_dirname -- $ac_file ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X$ac_file : 'X\(//\)[^/]' \| \
+        X$ac_file : 'X\(//\)$' \| \
+        X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
+echo X$ac_file |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) 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=`$as_dirname -- "$mf" ||
+$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=`$as_dirname -- "$file" ||
+$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'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$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'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (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/xconsole/configure.ac b/xconsole/configure.ac
new file mode 100644 (file)
index 0000000..7b5f858
--- /dev/null
@@ -0,0 +1,54 @@
+
+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(xconsole,[1.0.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xconsole)
+AM_INIT_AUTOMAKE([dist-bzip2])
+AM_MAINTAINER_MODE
+
+AM_CONFIG_HEADER(config.h)
+
+AC_PROG_CC
+AC_PROG_INSTALL
+
+# Checks for pkg-config packages
+XAW_CHECK_XPRINT_SUPPORT(XCONSOLE)
+AC_SUBST(XCONSOLE_CFLAGS)
+AC_SUBST(XCONSOLE_LIBS)
+
+PKG_CHECK_MODULES(APPDEFS, xt)
+appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+AC_SUBST(appdefaultdir)
+
+AC_SEARCH_LIBS(openpty, [util])
+AC_CHECK_FUNC(openpty, [HAS_OPENPTY="yes"])
+if test "x$HAS_OPENPTY" = "xyes" ; then
+       AC_DEFINE([HAS_OPENPTY], 1, 
+               [Define to 1 if you have the 'openpty' function.])
+       AC_CHECK_HEADERS([util.h pty.h], [break])
+fi
+
+XORG_MANPAGE_SECTIONS
+XORG_RELEASE_VERSION
+
+AC_OUTPUT([Makefile])
diff --git a/xconsole/depcomp b/xconsole/depcomp
new file mode 100755 (executable)
index 0000000..04701da
--- /dev/null
@@ -0,0 +1,530 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2005-07-09.11
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+gcc)
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+  sed -e 's/^[^:]*: / /' \
+      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+  tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'.  On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like `#:fec' to the end of the
+    # dependency line.
+    tr ' ' '
+' < "$tmpdepfile" \
+    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+    tr '
+' ' ' >> $depfile
+    echo >> $depfile
+
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' '
+' < "$tmpdepfile" \
+   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+   >> $depfile
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+aix)
+  # The C for AIX Compiler uses -M and outputs the dependencies
+  # in a .u file.  In older versions, this file always lives in the
+  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # start of each line; $object doesn't have directory information.
+  # Version 6 uses the directory in both cases.
+  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+  tmpdepfile="$stripped.u"
+  if test "$libtool" = yes; then
+    "$@" -Wc,-M
+  else
+    "$@" -M
+  fi
+  stat=$?
+
+  if test -f "$tmpdepfile"; then :
+  else
+    stripped=`echo "$stripped" | sed 's,^.*/,,'`
+    tmpdepfile="$stripped.u"
+  fi
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+
+  if test -f "$tmpdepfile"; then
+    outname="$stripped.o"
+    # Each line is of the form `foo.o: dependent.h'.
+    # Do two passes, one to just change these to
+    # `$object: dependent.h' and one to simply `dependent.h:'.
+    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+icc)
+  # Intel's C compiler understands `-MD -MF file'.  However on
+  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+  # ICC 7.0 will fill foo.d with something like
+  #    foo.o: sub/foo.c
+  #    foo.o: sub/foo.h
+  # which is wrong.  We want:
+  #    sub/foo.o: sub/foo.c
+  #    sub/foo.o: sub/foo.h
+  #    sub/foo.c:
+  #    sub/foo.h:
+  # ICC 7.1 will output
+  #    foo.o: sub/foo.c sub/foo.h
+  # and will wrap long lines using \ :
+  #    foo.o: sub/foo.c ... \
+  #     sub/foo.h ... \
+  #     ...
+
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Do two passes, one to just change these to
+  # `$object: dependent.h' and one to simply `dependent.h:'.
+  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+    sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+   # dependencies in `foo.d' instead, so we check for that too.
+   # Subdirectories are respected.
+   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+   test "x$dir" = "x$object" && dir=
+   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+   if test "$libtool" = yes; then
+      # With Tru64 cc, shared objects can also be used to make a
+      # static library.  This mecanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in in $dir.libs/$base.o.d and
+      # in $dir$base.o.d.  We have to check for both files, because
+      # one of the two compilations can be disabled.  We should prefer
+      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+      # automatically cleaned when .libs/ is deleted, while ignoring
+      # the former would cause a distcleancheck panic.
+      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
+      tmpdepfile2=$dir$base.o.d          # libtool 1.5
+      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
+      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
+      "$@" -Wc,-MD
+   else
+      tmpdepfile1=$dir$base.o.d
+      tmpdepfile2=$dir$base.d
+      tmpdepfile3=$dir$base.d
+      tmpdepfile4=$dir$base.d
+      "$@" -MD
+   fi
+
+   stat=$?
+   if test $stat -eq 0; then :
+   else
+      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+      exit $stat
+   fi
+
+   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+   do
+     test -f "$tmpdepfile" && break
+   done
+   if test -f "$tmpdepfile"; then
+      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+      # That's a tab and a space in the [].
+      sed -e 's,^.*\.[a-z]*:[   ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+   else
+      echo "#dummy" > "$depfile"
+   fi
+   rm -f "$tmpdepfile"
+   ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  # Require at least two characters before searching for `:'
+  # in the target name.  This is to cope with DOS-style filenames:
+  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  "$@" $dashmflag |
+    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # Remove any Libtool call
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no
+  for arg in "$@"; do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    # Strip any option that makedepend may not understand.  Remove
+    # the object too, otherwise makedepend will parse it as a source file.
+    -*|$object)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix="`echo $object | sed 's/^.*\././'`"
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  "$@" -E |
+    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+    sed '$ s: \\$::' > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o,
+  # because we must use -o when running libtool.
+  "$@" || exit $?
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::   \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/xconsole/install-sh b/xconsole/install-sh
new file mode 100755 (executable)
index 0000000..4d4a951
--- /dev/null
@@ -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/xconsole/missing b/xconsole/missing
new file mode 100755 (executable)
index 0000000..894e786
--- /dev/null
@@ -0,0 +1,360 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2005-06-08.21
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
+#   Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try \`$0 --help' for more information"
+  exit 1
+fi
+
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+  configure_ac=configure.ac
+else
+  configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case "$1" in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  # Exit code 63 means version mismatch.  This often happens
+  # when the user try to use an ancient version of a tool on
+  # a file that requires a minimum version.  In this case we
+  # we should proceed has if the program had been absent, or
+  # if --run hadn't been passed.
+  if test $? = 63; then
+    run=:
+    msg="probably too old"
+  fi
+  ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+  aclocal      touch file \`aclocal.m4'
+  autoconf     touch file \`configure'
+  autoheader   touch file \`config.h.in'
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Now exit if we have it, but it failed.  Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case "$1" in
+  lex|yacc)
+    # Not GNU programs, they don't have --version.
+    ;;
+
+  tar)
+    if test -n "$run"; then
+       echo 1>&2 "ERROR: \`tar' requires --run"
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       exit 1
+    fi
+    ;;
+
+  *)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       # Could not run --version or --help.  This is probably someone
+       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # $TOOL exists and not knowing $TOOL uses missing.
+       exit 1
+    fi
+    ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+  aclocal*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
+         to install the \`Automake' and \`Perl' packages.  Grab them from
+         any GNU archive site."
+    touch aclocal.m4
+    ;;
+
+  autoconf)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`${configure_ac}'.  You might want to install the
+         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+         archive site."
+    touch configure
+    ;;
+
+  autoheader)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site."
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z "$files" && files="config.h"
+    touch_files=
+    for f in $files; do
+      case "$f" in
+      *:*) touch_files="$touch_files "`echo "$f" |
+                                      sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files="$touch_files $f.in";;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site."
+    find . -type f -name Makefile.am -print |
+          sed 's/\.am$/.in/' |
+          while read f; do touch "$f"; done
+    ;;
+
+  autom4te)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1' as part of \`Autoconf' from any GNU
+         archive site."
+
+    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo "#! /bin/sh"
+       echo "# Created by GNU Automake missing as a replacement of"
+       echo "#  $ $@"
+       echo "exit 0"
+       chmod +x $file
+       exit 1
+    fi
+    ;;
+
+  bison|yacc)
+    echo 1>&2 "\
+WARNING: \`$1' $msg.  You should only need it if
+         you modified a \`.y' file.  You may need the \`Bison' package
+         in order for those modifications to take effect.  You can get
+         \`Bison' from any GNU archive site."
+    rm -f y.tab.c y.tab.h
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+       case "$LASTARG" in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if [ -f "$SRCFILE" ]; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if [ -f "$SRCFILE" ]; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if [ ! -f y.tab.h ]; then
+       echo >y.tab.h
+    fi
+    if [ ! -f y.tab.c ]; then
+       echo 'main() { return 0; }' >y.tab.c
+    fi
+    ;;
+
+  lex|flex)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.l' file.  You may need the \`Flex' package
+         in order for those modifications to take effect.  You can get
+         \`Flex' from any GNU archive site."
+    rm -f lex.yy.c
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+       case "$LASTARG" in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if [ -f "$SRCFILE" ]; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if [ ! -f lex.yy.c ]; then
+       echo 'main() { return 0; }' >lex.yy.c
+    fi
+    ;;
+
+  help2man)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+        you modified a dependency of a manual page.  You may need the
+        \`Help2man' package in order for those modifications to take
+        effect.  You can get \`Help2man' from any GNU archive site."
+
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+       file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+    fi
+    if [ -f "$file" ]; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit 1
+    fi
+    ;;
+
+  makeinfo)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.texi' or \`.texinfo' file, or any other file
+         indirectly affecting the aspect of the manual.  The spurious
+         call might also be the consequence of using a buggy \`make' (AIX,
+         DU, IRIX).  You might want to install the \`Texinfo' package or
+         the \`GNU make' package.  Grab either from any GNU archive site."
+    # The file to touch is that specified with -o ...
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+      # ... or it is derived from the source name (dir/f.texi becomes f.info)
+      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+    fi
+    # If the file does not exist, the user really needs makeinfo;
+    # let's fail without touching anything.
+    test -f $file || exit 1
+    touch $file
+    ;;
+
+  tar)
+    shift
+
+    # We have already tried tar in the generic part.
+    # Look for gnutar/gtar before invocation to avoid ugly error
+    # messages.
+    if (gnutar --version > /dev/null 2>&1); then
+       gnutar "$@" && exit 0
+    fi
+    if (gtar --version > /dev/null 2>&1); then
+       gtar "$@" && exit 0
+    fi
+    firstarg="$1"
+    if shift; then
+       case "$firstarg" in
+       *o*)
+           firstarg=`echo "$firstarg" | sed s/o//`
+           tar "$firstarg" "$@" && exit 0
+           ;;
+       esac
+       case "$firstarg" in
+       *h*)
+           firstarg=`echo "$firstarg" | sed s/h//`
+           tar "$firstarg" "$@" && exit 0
+           ;;
+       esac
+    fi
+
+    echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         You may want to install GNU tar or Free paxutils, or check the
+         command line arguments."
+    exit 1
+    ;;
+
+  *)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.  Check the \`README' file,
+         it often tells you about the needed prerequisites for installing
+         this package.  You may also peek at any GNU archive site, in case
+         some other package would contain this missing \`$1' program."
+    exit 1
+    ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/xconsole/xconsole.c b/xconsole/xconsole.c
new file mode 100644 (file)
index 0000000..ec7ccea
--- /dev/null
@@ -0,0 +1,1031 @@
+/*
+ * $Xorg: xconsole.c,v 1.5 2001/02/09 02:05:40 xorgcvs Exp $
+ *
+Copyright 1990, 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:  Keith Packard, MIT X Consortium
+ */
+
+/* $XFree86: xc/programs/xconsole/xconsole.c,v 3.31tsi Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Xatom.h>
+
+#include <X11/Xmu/Atoms.h>
+#include <X11/Xmu/StdSel.h>
+#include <X11/Xmu/SysUtil.h>
+
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Dialog.h>
+#include <X11/Xaw/Cardinals.h>
+#include <X11/Xaw/Paned.h>
+#include <X11/Xaw/Box.h>
+
+extern char *_XawTextGetSTRING(TextWidget ctx, XawTextPosition left,
+                              XawTextPosition right);
+
+#include <X11/Xos.h>
+#include <X11/Xfuncs.h>
+#include <sys/stat.h>
+#ifndef _POSIX_SOURCE
+#define _POSIX_SOURCE
+#include <stdio.h>
+#undef _POSIX_SOURCE
+#else
+#include <stdio.h>
+#endif
+#include <X11/Shell.h>
+#include <ctype.h>
+#include <stdlib.h>
+#ifdef HAS_OPENPTY
+# ifdef HAS_UTIL_H
+#  include <util.h>
+# endif
+# ifdef HAS_PTY_H
+#  include <pty.h>
+# endif
+#endif
+
+/* Fix ISC brain damage.  When using gcc fdopen isn't declared in <stdio.h>. */
+#if defined(ISC) && __STDC__ && !defined(ISC30)
+extern FILE *fdopen(int, char const *);
+#endif
+
+static void inputReady(XtPointer w, int *source, XtInputId *id);
+static long TextLength(Widget w);
+static void TextReplace(Widget w, int start, int end, XawTextBlock *block);
+static void TextAppend(Widget w, char *s, int len);
+static void TextInsert(Widget w, char *s, int len);
+static Bool ExceededMaxLines(Widget w);
+static void ScrollLine(Widget w);
+
+static Widget          top, text;
+
+static XtInputId       input_id;
+
+static FILE            *input;
+static Boolean         regularFile = FALSE;
+
+static Boolean         notified;
+static Boolean         iconified;
+
+static Atom            wm_delete_window;
+static Atom            mit_console;
+
+#define MIT_CONSOLE_LEN 12
+#define MIT_CONSOLE "MIT_CONSOLE_"
+static char            mit_console_name[255 + MIT_CONSOLE_LEN + 1] = MIT_CONSOLE;
+
+static struct _app_resources {
+    char    *file;
+    Boolean stripNonprint;
+    Boolean notify;
+    Boolean daemon;
+    Boolean verbose;
+    Boolean exitOnFail;
+    int     saveLines;
+} app_resources;
+
+#define Offset(field) XtOffsetOf(struct _app_resources, field)
+
+static XtResource  resources[] = {
+    {"file",   "File",     XtRString,  sizeof (char *),
+       Offset (file),  XtRString,  "console" },
+    {"notify", "Notify",   XtRBoolean, sizeof (Boolean),
+       Offset (notify), XtRImmediate, (XtPointer)True },
+    {"stripNonprint",  "StripNonprint",    XtRBoolean, sizeof (Boolean),
+       Offset (stripNonprint), XtRImmediate, (XtPointer)True },
+    {"daemon",         "Daemon",           XtRBoolean, sizeof (Boolean),
+       Offset (daemon), XtRImmediate, (XtPointer)False},
+    {"verbose",                "Verbose",          XtRBoolean, sizeof (Boolean),
+       Offset (verbose),XtRImmediate, (XtPointer)False},
+    {"exitOnFail",     "ExitOnFail",    XtRBoolean,    sizeof (Boolean),
+       Offset (exitOnFail),XtRImmediate, (XtPointer)False},
+    {"saveLines",      "SaveLines",    XtRInt, sizeof (int),
+       Offset (saveLines), XtRImmediate, (XtPointer) 0 },
+};
+
+#undef Offset
+
+static XrmOptionDescRec options[] = {
+    {"-file",          "*file",                XrmoptionSepArg,        NULL},
+    {"-notify",                "*notify",              XrmoptionNoArg,         "TRUE"},
+    {"-nonotify",      "*notify",              XrmoptionNoArg,         "FALSE"},
+    {"-daemon",                "*daemon",              XrmoptionNoArg,         "TRUE"},
+    {"-verbose",       "*verbose",             XrmoptionNoArg,         "TRUE"},
+    {"-exitOnFail",    "*exitOnFail",          XrmoptionNoArg,         "TRUE"},
+    {"-saveLines",     "*saveLines",           XrmoptionSepArg,        NULL},
+};
+
+#ifdef ultrix
+#define USE_FILE
+#define FILE_NAME "/dev/xcons"
+#endif
+
+#ifdef __UNIXOS2__
+#define USE_FILE
+#define FILE_NAME "/dev/console$"
+#define INCL_DOSFILEMGR
+#define INCL_DOSDEVIOCTL
+#include <os2.h>
+#endif
+
+#ifdef linux
+#define USE_FILE
+#define FILE_NAME      "/dev/xconsole"
+# if defined (__GLIBC__) && ((__GLIBC__ > 2) || (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1))
+/*
+ * Linux distribution based on glibc 2.1 and higher should use
+ * devpts. This is the fallback if open file FILE_NAME fails.
+ * <werner@suse.de>
+ */
+#  define USE_PTS 
+# endif
+#endif
+
+#if defined(_AIX)
+#  define USE_PTS
+#endif
+
+#if !defined (USE_FILE) || defined (linux)
+# include <sys/ioctl.h>
+# ifdef hpux
+#  include <termios.h>
+# endif
+# if defined (SVR4) || defined (USE_PTS)
+#  include <termios.h>
+#  include <sys/stropts.h>             /* for I_PUSH */
+#  ifdef sun
+#   include <sys/strredir.h>
+#  endif
+# endif
+# if defined(TIOCCONS) || defined(SRIOCSREDIR) || defined(Lynx)
+#  define USE_PTY
+static int  tty_fd, pty_fd;
+static char ttydev[64], ptydev[64];
+# endif
+#endif
+
+#if (defined(SVR4) && !defined(sun)) || (defined(SYSV) && defined(i386))
+#define USE_OSM
+#include <signal.h>
+#endif
+
+#ifdef USE_PTY
+static int get_pty(int *pty, int *tty, char *ttydev, char *ptydev);
+#endif
+
+#ifdef USE_OSM
+static FILE *osm_pipe(void);
+static int child_pid;
+#endif
+
+/* Copied from xterm/ptyx.h */
+#ifndef PTYCHAR1
+#ifdef __hpux
+#define PTYCHAR1        "zyxwvutsrqp"
+#else   /* !__hpux */
+#ifdef __UNIXOS2__
+#define PTYCHAR1        "pq"
+#else
+#define PTYCHAR1        "pqrstuvwxyzPQRSTUVWXYZ"
+#endif  /* !__UNIXOS2__ */
+#endif  /* !__hpux */
+#endif  /* !PTYCHAR1 */
+
+#ifndef PTYCHAR2
+#ifdef __hpux
+#define PTYCHAR2        "fedcba9876543210"
+#else   /* !__hpux */
+#ifdef __FreeBSD__
+#define PTYCHAR2        "0123456789abcdefghijklmnopqrstuv"
+#else /* !__FreeBSD__ */
+#define PTYCHAR2        "0123456789abcdef"
+#endif /* !__FreeBSD__ */
+#endif  /* !__hpux */
+#endif  /* !PTYCHAR2 */
+
+#ifdef Lynx
+static void
+RestoreConsole(void)
+{
+    int fd;
+    if ((fd = open("/dev/con", O_RDONLY)) >= 0)
+       newconsole(fd);
+}
+#endif
+
+static void
+OpenConsole(void)
+{
+    input = 0;
+    if (app_resources.file)
+    {
+       if (!strcmp (app_resources.file, "console"))
+       {
+           /* must be owner and have read/write permission */
+#if !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(Lynx) && !defined(__UNIXOS2__)
+           struct stat sbuf;
+# if !defined (linux)
+           if (!stat("/dev/console", &sbuf) &&
+               (sbuf.st_uid == getuid()) &&
+               !access("/dev/console", R_OK|W_OK))
+# endif
+#endif
+           {
+#ifdef USE_FILE
+# ifdef linux
+               if (!stat(FILE_NAME, &sbuf))
+# endif
+               input = fopen (FILE_NAME, "r");
+# ifdef __UNIXOS2__
+               if (input)
+               {
+                   ULONG arg = 1,arglen;
+                   APIRET rc;
+                   if ((rc=DosDevIOCtl(fileno(input), 0x76,0x4d,
+                       &arg, sizeof(arg), &arglen,
+                       NULL, 0, NULL)) != 0)
+                   {
+                       fclose(input);
+                       input = 0;
+                   }
+               }
+# endif
+#endif
+               
+#ifdef USE_PTY
+               if (!input && get_pty (&pty_fd, &tty_fd, ttydev, ptydev) == 0)
+               {
+# ifdef TIOCCONS
+                   int on = 1;
+                   if (ioctl (tty_fd, TIOCCONS, (char *) &on) != -1)
+                       input = fdopen (pty_fd, "r");
+# else
+#  ifndef Lynx
+                   int consfd = open("/dev/console", O_RDONLY);
+                   if (consfd >= 0)
+                   {
+                       if (ioctl(consfd, SRIOCSREDIR, tty_fd) != -1)
+                           input = fdopen (pty_fd, "r");
+                       close(consfd);
+                   }
+#  else
+                   if (newconsole(tty_fd) < 0)
+                       perror("newconsole");
+                   else
+                   {
+                       input = fdopen (pty_fd, "r");
+                       atexit(RestoreConsole);
+                   }
+#  endif
+# endif
+               }
+#endif /* USE_PTY */
+           }
+#ifdef USE_OSM
+           /* Don't have to be owner of /dev/console when using /dev/osm. */
+           if (!input)
+               input = osm_pipe();
+#endif
+           if (input && app_resources.verbose)
+           {
+               char    *hostname;
+               TextAppend (text, "Console log for ", 16);
+               hostname = mit_console_name + MIT_CONSOLE_LEN;
+               TextAppend (text, hostname, strlen (hostname));
+               TextAppend (text, "\n", 1);
+           }
+       }
+       else
+       {
+           struct stat sbuf;
+
+           regularFile = FALSE;
+           if (access(app_resources.file, R_OK) == 0)
+           {
+               input = fopen (app_resources.file, "r");
+               if (input)
+                   if (!stat(app_resources.file, &sbuf) &&
+                       S_ISREG( sbuf.st_mode ) )
+                       regularFile = TRUE;
+           }
+       }
+       if (!input)
+       {
+           if (app_resources.exitOnFail)
+               exit(0);
+           TextAppend (text, "Couldn't open ", 14);
+           TextAppend (text, app_resources.file, strlen (app_resources.file));
+           TextAppend (text, "\n", 1);
+       }
+    }
+    else
+       input = stdin;
+
+    if (input)
+    {
+       input_id = XtAddInput (fileno (input), (XtPointer) XtInputReadMask,
+                              inputReady, (XtPointer) text);
+    }
+}
+
+static void
+CloseConsole (void)
+{
+    if (input)
+    {
+       XtRemoveInput (input_id);
+       fclose (input);
+    }
+#ifdef USE_PTY
+    close (tty_fd);
+#endif
+}
+
+#ifdef USE_OSM
+static void
+KillChild(int sig)
+{
+    if (child_pid > 0)
+       kill(child_pid, SIGTERM);
+    _exit(0);
+}
+#endif
+
+/*ARGSUSED*/
+static void
+Quit(Widget widget, XEvent *event, String *params, Cardinal *num_params)
+{
+#ifdef USE_OSM
+    if (child_pid > 0)
+       kill(child_pid, SIGTERM);
+#endif
+    exit (0);
+}
+
+#ifdef USE_OSM
+static int (*ioerror)(Display *);
+
+static int
+IOError(Display *dpy)
+{
+    if (child_pid > 0)
+       kill(child_pid, SIGTERM);
+    return (*ioerror)(dpy);
+}
+#endif
+
+static void
+Notify(void)
+{
+    Arg            arglist[1];
+    char    *oldName;
+    char    *newName;
+
+    if (!iconified || !app_resources.notify || notified)
+       return;
+    XtSetArg (arglist[0], XtNiconName, &oldName);
+    XtGetValues (top, arglist, 1);
+    newName = malloc (strlen (oldName) + 3);
+    if (!newName)
+       return;
+    sprintf (newName, "%s *", oldName);
+    XtSetArg (arglist[0], XtNiconName, newName);
+    XtSetValues (top, arglist, 1);
+    free (newName);
+    notified = True;
+}
+
+/*ARGSUSED*/
+static void
+Deiconified(Widget widget, XEvent *event, String *params, Cardinal *num_params)
+{
+    Arg            arglist[1];
+    char    *oldName;
+    char    *newName;
+    int            oldlen;
+
+    iconified = False;
+    if (!app_resources.notify || !notified)
+       return;
+    XtSetArg (arglist[0], XtNiconName, &oldName);
+    XtGetValues (top, arglist, 1);
+    oldlen = strlen (oldName);
+    if (oldlen >= 2)
+    {
+       newName = malloc (oldlen - 1);
+       if (!newName)
+           return;
+       strncpy (newName, oldName, oldlen - 2);
+       newName[oldlen - 2] = '\0';
+       XtSetArg (arglist[0], XtNiconName, newName);
+       XtSetValues (top, arglist, 1);
+       free (newName);
+    }
+    notified = False;
+}
+
+/*ARGSUSED*/
+static void
+Iconified(Widget widget, XEvent *event, String *params, Cardinal *num_params)
+{
+    iconified = True;
+}
+
+/*ARGSUSED*/
+static void
+Clear(Widget widget, XEvent *event, String *params, Cardinal *num_params)
+{
+    long           last;
+    XawTextBlock    block;
+
+    last = TextLength (text);
+    block.ptr = "";
+    block.firstPos = 0;
+    block.length = 0;
+    block.format = FMT8BIT;
+    TextReplace (text, 0, last, &block);
+}
+
+static XtActionsRec actions[] = {
+    { "Quit",          Quit },
+    { "Iconified",     Iconified },
+    { "Deiconified",   Deiconified },
+    { "Clear",         Clear },
+};
+
+static void
+stripNonprint(char *b)
+{
+    char    *c;
+
+    c = b;
+    while (*b)
+    {
+       if (isprint (*b) || (isspace (*b) && *b != '\r'))
+       {
+           if (c != b)
+               *c = *b;
+           ++c;
+       }
+       ++b;
+    }
+    *c = '\0';
+}
+
+static void
+inputReady(XtPointer w, int *source, XtInputId *id)
+{
+    char    buffer[1025];
+    int            n;
+
+    n = read (*source, buffer, sizeof (buffer) - 1);
+    if (n <= 0)
+    {
+       if (app_resources.file && regularFile && n == 0)
+       {
+           if (XPending(XtDisplay(w)))
+               return;
+
+           sleep(1);
+           return;
+       }
+
+       fclose (input);
+       XtRemoveInput (*id);
+
+       /* try to reopen if pipe; this can be caused by syslog restart */
+       if (app_resources.file && !regularFile && n == 0)
+       {
+           OpenConsole();
+       }
+    } else {
+       Notify();
+       buffer[n] = '\0';
+       if (app_resources.stripNonprint)
+       {
+           stripNonprint (buffer);
+           n = strlen (buffer);
+       }
+       
+       TextAppend ((Widget) text, buffer, n);
+    }
+}
+
+static Boolean
+ConvertSelection(Widget w, Atom *selection, Atom *target, Atom *type,
+                XtPointer *value, unsigned long *length, int *format)
+{
+    Display* d = XtDisplay(w);
+    XSelectionRequestEvent* req =
+       XtGetSelectionRequest(w, *selection, (XtRequestId)NULL);
+
+    if (*target == XA_TARGETS(d))
+    {
+       Atom* targetP;
+       Atom* std_targets;
+       unsigned long std_length;
+       XmuConvertStandardSelection(w, req->time, selection, target, type,
+                                   (XPointer *)&std_targets, &std_length,
+                                   format);
+       *value = (XtPointer)XtMalloc(sizeof(Atom)*(std_length + 5));
+       targetP = *(Atom**)value;
+       *targetP++ = XA_STRING;
+       *targetP++ = XA_TEXT(d);
+       *targetP++ = XA_LENGTH(d);
+       *targetP++ = XA_LIST_LENGTH(d);
+       *targetP++ = XA_CHARACTER_POSITION(d);
+       *length = std_length + (targetP - (*(Atom **) value));
+       memmove( (char*)targetP, (char*)std_targets, sizeof(Atom)*std_length);
+       XtFree((char*)std_targets);
+       *type = XA_ATOM;
+       *format = 32;
+       return True;
+    }
+
+    if (*target == XA_LIST_LENGTH(d) ||
+       *target == XA_LENGTH(d))
+    {
+       long * temp;
+
+       temp = (long *) XtMalloc(sizeof(long));
+       if (*target == XA_LIST_LENGTH(d))
+         *temp = 1L;
+       else                    /* *target == XA_LENGTH(d) */
+         *temp = (long) TextLength (text);
+
+       *value = (XtPointer) temp;
+       *type = XA_INTEGER;
+       *length = 1L;
+       *format = 32;
+       return True;
+    }
+
+    if (*target == XA_CHARACTER_POSITION(d))
+    {
+       long * temp;
+
+       temp = (long *) XtMalloc(2 * sizeof(long));
+       temp[0] = (long) 0;
+       temp[1] = TextLength (text);
+       *value = (XtPointer) temp;
+       *type = XA_SPAN(d);
+       *length = 2L;
+       *format = 32;
+       return True;
+    }
+
+    if (*target == XA_STRING ||
+      *target == XA_TEXT(d) ||
+      *target == XA_COMPOUND_TEXT(d))
+    {
+       if (*target == XA_COMPOUND_TEXT(d))
+           *type = *target;
+       else
+           *type = XA_STRING;
+       *length = TextLength (text);
+       *value = (XtPointer)_XawTextGetSTRING((TextWidget) text, 0, *length);
+       *format = 8;
+       /*
+        * Drop our connection to the file; the new console program
+        * will open as soon as it receives the selection contents; there
+        * is a small window where console output will not be redirected,
+        * but I see no way of avoiding that without having two programs
+        * attempt to redirect console output at the same time, which seems
+        * worse
+        */
+       CloseConsole ();
+       return True;
+    }
+
+    if (XmuConvertStandardSelection(w, req->time, selection, target, type,
+                                   (XPointer *)value, length, format))
+       return True;
+
+    return False;
+}
+
+static void
+LoseSelection(Widget w, Atom *selection)
+{
+    Quit (w, (XEvent*)NULL, (String*)NULL, (Cardinal*)NULL);
+}
+
+/*ARGSUSED*/
+static void
+InsertSelection(Widget w, XtPointer client_data, Atom *selection, Atom *type,
+               XtPointer value, unsigned long *length, int *format)
+{
+    if (*type != XT_CONVERT_FAIL)
+       TextInsert (text, (char *) value, *length);
+    XtOwnSelection(top, mit_console, CurrentTime,
+                  ConvertSelection, LoseSelection, NULL);
+    OpenConsole ();
+}
+
+int
+main(int argc, char *argv[])
+{
+    Arg arglist[10];
+    Cardinal num_args;
+
+    XtSetLanguageProc(NULL,NULL,NULL);
+    top = XtInitialize ("xconsole", "XConsole", options, XtNumber (options),
+                       &argc, argv);
+    XtGetApplicationResources (top, (XtPointer)&app_resources, resources,
+                              XtNumber (resources), NULL, 0);
+
+    if (app_resources.daemon)
+       if (fork ()) exit (0);
+    XtAddActions (actions, XtNumber (actions));
+
+    text = XtCreateManagedWidget ("text", asciiTextWidgetClass,
+                                 top, NULL, 0);
+
+    XtRealizeWidget (top);
+    num_args = 0;
+    XtSetArg(arglist[num_args], XtNiconic, &iconified); num_args++;
+    XtGetValues(top, arglist, num_args);
+    if (iconified)
+       Iconified((Widget)NULL, (XEvent*)NULL, (String*)NULL, (Cardinal*)NULL);
+    else
+       Deiconified((Widget)NULL,(XEvent*)NULL,(String*)NULL,(Cardinal*)NULL);
+    wm_delete_window = XInternAtom(XtDisplay(top), "WM_DELETE_WINDOW",
+                                  False);
+    (void) XSetWMProtocols (XtDisplay(top), XtWindow(top),
+                            &wm_delete_window, 1);
+
+    XmuGetHostname (mit_console_name + MIT_CONSOLE_LEN, 255);
+
+    mit_console = XInternAtom(XtDisplay(top), mit_console_name, False);
+
+    if (XGetSelectionOwner (XtDisplay (top), mit_console))
+    {
+       XtGetSelectionValue(top, mit_console, XA_STRING, InsertSelection,
+                           NULL, CurrentTime);
+    }
+    else
+    {
+       XtOwnSelection(top, mit_console, CurrentTime,
+                      ConvertSelection, LoseSelection, NULL);
+       OpenConsole ();
+    }
+#ifdef USE_OSM
+    ioerror = XSetIOErrorHandler(IOError);
+#endif
+    XtMainLoop ();
+    return 0;
+}
+
+static long
+TextLength(Widget w)
+{
+    return XawTextSourceScan (XawTextGetSource (w),
+                             (XawTextPosition) 0,
+                             XawstAll, XawsdRight, 1, TRUE);
+}
+
+static void
+TextReplace(Widget w, int start, int end, XawTextBlock *block)
+{
+    Arg                    arg;
+    Widget         source;
+    XawTextEditType edit_mode;
+
+    source = XawTextGetSource (w);
+    XtSetArg (arg, XtNeditType, &edit_mode);
+    XtGetValues (source, &arg, ONE);
+    XtSetArg (arg, XtNeditType, XawtextEdit);
+    XtSetValues (source, &arg, ONE);
+    XawTextReplace (w, start, end, block);
+    XtSetArg (arg, XtNeditType, edit_mode);
+    XtSetValues (source, &arg, ONE);
+}
+
+static void
+TextAppend(Widget w, char *s, int len)
+{
+    long           last, current;
+    XawTextBlock    block;
+
+    current = XawTextGetInsertionPoint (w);
+    last = TextLength (w);
+    block.ptr = s;
+    block.firstPos = 0;
+    block.length = len;
+    block.format = FMT8BIT;
+    /*
+     * If saveLines is 1, just replace the entire contents of the widget
+     * each time, so the test in ExceededMaxLines() isn't fooled.
+     */
+    if (app_resources.saveLines == 1)
+       TextReplace (w, 0, last, &block);
+    else
+       TextReplace (w, last, last, &block);
+    if (current == last)
+       XawTextSetInsertionPoint (w, last + block.length);
+    if (ExceededMaxLines(w))
+       ScrollLine(w);
+}
+
+static void
+TextInsert(Widget w, char *s, int len)
+{
+    XawTextBlock    block;
+    long           current;
+
+    current = XawTextGetInsertionPoint (w);
+    block.ptr = s;
+    block.firstPos = 0;
+    block.length = len;
+    block.format = FMT8BIT;
+    TextReplace (w, 0, 0, &block);
+    if (current == 0)
+       XawTextSetInsertionPoint (w, len);
+    if (ExceededMaxLines(w))
+       ScrollLine(w);
+}
+
+static Bool
+ExceededMaxLines(Widget w)
+{
+    XawTextPosition end_of_last_line;
+    Bool retval = False;
+
+    if (app_resources.saveLines > 0)
+    {
+    /*
+     * XawTextSourceScan() will return the end of the widget if it cannot
+     * find what it is searching for.
+     */
+       end_of_last_line = XawTextSourceScan (XawTextGetSource (w),
+                                             (XawTextPosition) 0,
+                                             XawstEOL, XawsdRight,
+                                             app_resources.saveLines, TRUE);
+       if (TextLength(w) > end_of_last_line)
+           retval = True;
+       else
+           retval = False;
+    }
+    else
+       retval = False;
+    return retval;
+}
+
+static void
+ScrollLine(Widget w)
+{
+    XawTextPosition firstnewline;
+    XawTextBlock    block;
+
+    /*
+     * This is pretty inefficient but should work well enough unless the
+     * console device is getting totally spammed.  Generally, new lines
+     * only come in one at a time anyway.
+     */
+    firstnewline = XawTextSourceScan (XawTextGetSource (w),
+                                     (XawTextPosition) 0,
+                                     XawstEOL, XawsdRight, 1, TRUE);
+    block.ptr = "";
+    block.firstPos = 0;
+    block.length = 0;
+    block.format = FMT8BIT;
+    TextReplace (w, 0, firstnewline, &block);
+}
+
+#ifdef USE_PTY
+/*
+ * This function opens up a pty master and stuffs its value into pty.
+ * If it finds one, it returns a value of 0.  If it does not find one,
+ * it returns a value of !0.  This routine is designed to be re-entrant,
+ * so that if a pty master is found and later, we find that the slave
+ * has problems, we can re-enter this function and get another one.
+ */
+
+static int
+get_pty(int *pty, int *tty, char *ttydev, char *ptydev)
+{
+#ifdef HAS_OPENPTY
+       if (openpty(pty, tty, NULL, NULL, NULL) == -1) {
+               return 1;
+       }
+       return 0;
+#elif defined (SVR4) || defined (USE_PTS)
+#if defined (_AIX)
+       if ((*pty = open ("/dev/ptc", O_RDWR)) < 0)
+#else
+       if ((*pty = open ("/dev/ptmx", O_RDWR)) < 0)
+#endif
+           return 1;
+       grantpt(*pty);
+       unlockpt(*pty);
+       strcpy(ttydev, (char *)ptsname(*pty));
+       if ((*tty = open(ttydev, O_RDWR)) >= 0)
+       {
+           (void)ioctl(*tty, I_PUSH, "ttcompat");
+           return 0;
+       }
+       if (*pty >= 0)
+           close (*pty);
+#else /* !SVR4, need lots of code */
+#ifdef USE_GET_PSEUDOTTY
+       if ((*pty = getpseudotty (&ttydev, &ptydev)) >= 0 &&
+           (*tty = open (ttydev, O_RDWR)) >= 0)
+           return 0;
+       if (*pty >= 0)
+           close (*pty);
+#else
+       static int devindex, letter = 0;
+
+#if defined(umips) && defined (SYSTYPE_SYSV)
+       struct stat fstat_buf;
+
+       *pty = open ("/dev/ptc", O_RDWR);
+       if (*pty < 0 || (fstat (*pty, &fstat_buf)) < 0)
+       {
+         return(1);
+       }
+       sprintf (ttydev, "/dev/ttyq%d", minor(fstat_buf.st_rdev));
+       sprintf (ptydev, "/dev/ptyq%d", minor(fstat_buf.st_rdev));
+       if ((*tty = open (ttydev, O_RDWR)) >= 0)
+       {
+           /* got one! */
+           return(0);
+       }
+       close (*pty);
+#else /* not (umips && SYSTYPE_SYSV) */
+#ifdef CRAY
+       for (; devindex < 256; devindex++) {
+           sprintf (ttydev, "/dev/ttyp%03d", devindex);
+           sprintf (ptydev, "/dev/pty/%03d", devindex);
+
+           if ((*pty = open (ptydev, O_RDWR)) >= 0 &&
+               (*tty = open (ttydev, O_RDWR)) >= 0)
+           {
+               /*
+                * We need to set things up for our next entry
+                * into this function!
+                */
+               (void) devindex++;
+               return(0);
+           }
+           if (*pty >= 0)
+               close (*pty);
+       }
+#else /* !CRAY */
+#ifdef sgi
+       {
+           char *slave;
+           slave = _getpty (pty, O_RDWR, 0622, 0);
+           if ((*tty = open (slave, O_RDWR)) != -1)
+               return 0;
+       }
+#else
+       strcpy (ttydev, "/dev/ttyxx");
+       strcpy (ptydev, "/dev/ptyxx");
+       while (PTYCHAR1[letter]) {
+           ttydev [strlen(ttydev) - 2]  = ptydev [strlen(ptydev) - 2] =
+                   PTYCHAR1 [letter];
+
+           while (PTYCHAR2[devindex]) {
+               ttydev [strlen(ttydev) - 1] = ptydev [strlen(ptydev) - 1] =
+                       PTYCHAR2 [devindex];
+               if ((*pty = open (ptydev, O_RDWR)) >= 0 &&
+                   (*tty = open (ttydev, O_RDWR)) >= 0)
+               {
+                       /*
+                        * We need to set things up for our next entry
+                        * into this function!
+                        */
+                       (void) devindex++;
+                       return(0);
+               }
+               if (*pty >= 0)
+                   close (*pty);
+               devindex++;
+           }
+           devindex = 0;
+           (void) letter++;
+       }
+#endif /* sgi else not sgi */
+#endif /* CRAY else not CRAY */
+#endif /* umips && SYSTYPE_SYSV */
+#endif /* USE_GET_PSEUDOTTY */
+#endif /* SVR4 */
+       /*
+        * We were unable to allocate a pty master!  Return an error
+        * condition and let our caller terminate cleanly.
+        */
+       return(1);
+}
+#endif
+
+#ifdef USE_OSM
+/*
+ * On SYSV386 there is a special device, /dev/osm, where system messages
+ * are sent.  Problem is that we can't perform a select(2) on this device.
+ * So this routine creates a streams-pty where one end reads the device and
+ * sends the output to xconsole.
+ */
+
+#ifdef SCO325
+#define        OSM_DEVICE      "/dev/error"
+#else
+#ifdef __UNIXWARE__
+#define OSM_DEVICE     "/dev/osm2"
+#define NO_READAHEAD
+#else
+#define        OSM_DEVICE      "/dev/osm"
+#endif
+#endif
+
+#ifdef ISC
+#define NO_READAHEAD
+#endif
+
+static FILE *
+osm_pipe(void)
+{
+    int tty;
+    char ttydev[64];
+
+    if (access(OSM_DEVICE, R_OK) < 0)
+       return NULL;
+#if defined (_AIX)
+    if ((tty = open("/dev/ptc", O_RDWR)) < 0)
+#else      
+    if ((tty = open("/dev/ptmx", O_RDWR)) < 0)
+#endif
+       return NULL;
+
+    grantpt(tty);
+    unlockpt(tty);
+    strcpy(ttydev, (char *)ptsname(tty));
+
+    if ((child_pid = fork()) == 0)
+    {
+       int pty, osm, nbytes, skip;
+       char cbuf[128];
+
+       skip = 0;
+#ifndef NO_READAHEAD
+       osm = open(OSM_DEVICE, O_RDONLY);
+       if (osm >= 0)
+       {
+           while ((nbytes = read(osm, cbuf, sizeof(cbuf))) > 0)
+               skip += nbytes;
+           close(osm);
+       }
+#endif
+       pty = open(ttydev, O_RDWR);
+       if (pty < 0)
+           exit(1);
+       osm = open(OSM_DEVICE, O_RDONLY);
+       if (osm < 0)
+           exit(1);
+       for (nbytes = 0; skip > 0 && nbytes >= 0; skip -= nbytes)
+       {
+           nbytes = skip;
+           if (nbytes > sizeof(cbuf))
+               nbytes = sizeof(cbuf);
+           nbytes = read(osm, cbuf, nbytes);
+       }
+       while ((nbytes = read(osm, cbuf, sizeof(cbuf))) >= 0)
+           write(pty, cbuf, nbytes);
+       exit(0);
+    }
+    signal(SIGHUP, KillChild);
+    signal(SIGINT, KillChild);
+    signal(SIGTERM, KillChild);
+    return fdopen(tty, "r");
+}
+#endif  /* USE_OSM */
diff --git a/xconsole/xconsole.man b/xconsole/xconsole.man
new file mode 100644 (file)
index 0000000..8642cd8
--- /dev/null
@@ -0,0 +1,117 @@
+.\" $Xorg: xconsole.man,v 1.4 2001/02/09 02:05:40 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
+.\" dealing in this Software without prior written authorization from the
+.\" The Open Group.
+.\"
+.\" $XFree86: xc/programs/xconsole/xconsole.man,v 1.9 2002/10/12 16:06:47 herrb Exp $
+.\"
+.TH XCONSOLE 1 __xorgversion__
+.SH NAME
+xconsole \- monitor system console messages with X
+.SH SYNOPSIS
+.ta 8n
+\fBxconsole\fP [-\fItoolkitoption\fP ...] [-file \fIfile-name\fP]
+[-notify] [-stripNonprint] [-daemon] [-verbose] [-exitOnFail]
+.SH DESCRIPTION
+The
+.I xconsole
+program displays messages which are usually sent to /dev/console.
+.SH OPTIONS
+.I Xconsole
+accepts all of the standard X Toolkit command line options along with the
+additional options listed below:
+.TP 8
+.B \-file \fIfile-name\fP
+To monitor some other device, use this option to specify the device name.
+This does not work on regular files as they are always ready to be read from.
+.TP 8
+.B \-notify \-nonotify
+When new data are received from the console and the notify option is set,
+the icon name of the application has " *" appended, so that it is evident
+even when the application is iconified.  \-notify is the default.
+.TP 8
+.B \-daemon
+This option causes
+.I xconsole
+to place itself in the background, using fork/exit.
+.TP 8
+.B \-verbose
+When set, this option directs
+.I xconsole
+to display an informative message in the first line of the text buffer.
+.TP 8
+.B \-exitOnFail
+When set, this option directs
+.I xconsole
+to exit when it is unable to redirect the console output.
+.TP 8
+.B \-saveLines \fIcount\fP
+When set,
+.I xconsole
+only preserves
+.I count
+lines of message history instead of growing the text buffer without bound
+(a
+.I count
+of zero \- the default \- is treated as placing no limit on the history).
+.SH X DEFAULTS
+This program uses the
+.I Athena Text
+widget, look in the
+.I Athena Widget Set
+documentation for controlling it.
+.PP
+.I Xconsole
+otherwise accepts resources of the same names as the command-line options
+(without the leading dash).  "file" is a string type, "saveLines" an
+integer, and the remaining options are booleans.
+.SH WIDGETS
+In order to specify resources, it is useful to know the hierarchy of
+the widgets which compose \fIxconsole\fR.  In the notation below,
+indentation indicates hierarchical structure.  The widget class name
+is given first, followed by the widget instance name.
+.sp
+.nf
+.TA .5i
+.ta .5i
+XConsole  xconsole
+       XConsole  text
+.fi
+.sp
+.SH ENVIRONMENT
+.PP
+.TP 8
+.B DISPLAY
+to get the default host and display number.
+.TP 8
+.B XENVIRONMENT
+to get the name of a resource file that overrides the global resources
+stored in the RESOURCE_MANAGER property.
+.SH FILES
+.TP
+.I __apploaddir__/XConsole
+specifies required resources
+.SH "SEE ALSO"
+X(__miscmansuffix__), xrdb(1), Athena Text widget
+.SH AUTHOR
+Keith Packard (MIT X Consortium)
diff --git a/xcursorgen/AUTHORS b/xcursorgen/AUTHORS
new file mode 100755 (executable)
index 0000000..f9cc057
--- /dev/null
@@ -0,0 +1,2 @@
+Original authors:
+       Manish Singh
diff --git a/xcursorgen/COPYING b/xcursorgen/COPYING
new file mode 100755 (executable)
index 0000000..0243ddf
--- /dev/null
@@ -0,0 +1,19 @@
+Copyright (C) 2002 Manish Singh
+
+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 Manish Singh not be used in
+advertising or publicity pertaining to distribution of the software without
+specific, written prior permission.  Manish Singh makes no
+representations about the suitability of this software for any purpose.  It
+is provided "as is" without express or implied warranty.
+
+MANISH SINGH DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL MANISH SINGH 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.
diff --git a/xcursorgen/ChangeLog b/xcursorgen/ChangeLog
new file mode 100755 (executable)
index 0000000..d3baf91
--- /dev/null
@@ -0,0 +1,381 @@
+commit bd5c027d923351ea8ef541a6d5092ba9e8661f6c
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Thu Sep 23 19:41:07 2010 -0700
+
+    xcursorgen 1.0.4
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit b848ae7bbd9d328fa8115707153a92414b302753
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Thu Sep 23 19:38:42 2010 -0700
+
+    config: Remove unnecessary calls from configure.ac
+    
+    AC_PROG_CC & AC_PROG_INSTALL are provided by XORG_DEFAULT_OPTIONS now
+    PKG_CONFIG_MODULES handles AC_SUBST of the CFLAGS & LIBS variables
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 4768df2f3051a92dc351a4072d2232ffd9304eb0
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Tue Jul 20 18:45:18 2010 -0400
+
+    config: update AC_PREREQ statement to 2.60
+    
+    Unrelated to the previous patches, the new value simply reflects
+    the reality that the minimum level for autoconf to configure
+    all x.org modules is 2.60 dated June 2006.
+    
+    ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit be56a72e4afc0ba6599fb862f2b527fa49afbf82
+Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+Date:   Sun Aug 8 21:45:54 2010 -0500
+
+    Use AC_PROG_SED and MAN_SUBSTS in macros-1.8
+    
+    Tested-by: Gaetan Nadon <memsize@videotron.ca>
+    Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+
+commit 0aa3f45edaddd3deef9845ed290518ebb91e22c0
+Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+Date:   Sun Aug 8 21:45:53 2010 -0500
+
+    Remove INSTALL from git
+    
+    The INSTALL file is added to the tarball by XORG_INSTALL.
+    
+    Tested-by: Gaetan Nadon <memsize@videotron.ca>
+    Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+
+commit 9e7c41e0e16183110cd7b28d012a0bb69aed4655
+Author: Cody Maloney <cmaloney@theoreticalchaos.com>
+Date:   Sun Mar 14 00:07:23 2010 -0800
+
+    Upgraded to work with libpng14
+    
+    setjmp(png_ptr->jmpbuf) is depreceated so removed it and changed the
+    configure.ac version number to accept libpng12 or libpng14
+    
+    Signed-off-by: Cody Maloney <cmaloney@theoreticalchaos.com>
+    Tested-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 194d9a4353dbf0b4c1d2895e60966bbc4429c54d
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Nov 26 09:19:53 2009 -0500
+
+    Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES
+    
+    Now that the INSTALL file is generated.
+    Allows running make maintainer-clean.
+
+commit a8cd9706d08c02a947db00f391dc753a7d8167e0
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Wed Oct 28 14:09:08 2009 -0400
+
+    INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206
+    
+    Add missing INSTALL file. Use standard GNU file on building tarball
+    README may have been updated
+    Remove AUTHORS file as it is empty and no content available yet.
+    Remove NEWS file as it is empty and no content available yet.
+
+commit 763593472fd31103f63afa90d4405643d90fc79e
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Mon Oct 26 22:08:38 2009 -0400
+
+    Makefile.am: ChangeLog not required: EXTRA_DIST or *CLEANFILES #24432
+    
+    ChangeLog filename is known to Automake and requires no further
+    coding in the makefile.
+
+commit 821f55410152bfa8b7e8e3c9ee809e1835db9e2f
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Oct 22 12:34:15 2009 -0400
+
+    .gitignore: use common defaults with custom section # 24239
+    
+    Using common defaults will reduce errors and maintenance.
+    Only the very small or inexistent custom section need periodic maintenance
+    when the structure of the component changes. Do not edit defaults.
+
+commit db68e86e2d2d058e178598a46f6237f9762e4fd3
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Sep 27 16:02:01 2009 -0400
+
+    Makefile.am: do not include autogen.sh in distribution #24183
+    
+    This is a private build script that should not be distributed
+
+commit 32dc0bbbd067bfe27f506a510da3c5344964ee23
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Oct 16 17:41:51 2009 -0700
+
+    xcursorgen 1.0.3
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 47428dfabe933239919dfb4a51a9187ad4e2cb48
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Oct 16 17:41:20 2009 -0700
+
+    Migrate to xorg macros 1.3 & XORG_DEFAULT_OPTIONS
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 334aca2e5ab6d046659fdd60b16b0109aa0fe441
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Oct 1 14:54:22 2009 -0700
+
+    Add README with pointers to mailing lists, bugzilla, & git
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit c4c3d77ea9a89b2c5c23518b5cf235d4f7e017bf
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Mon Jan 19 20:40:12 2009 -0200
+
+    Ansification and compile warning fixes.
+    
+      This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects
+    make distcheck and all gcc 4.3 and sparse warnings.
+
+commit 5aca565a857da642bc3f9dc89e88bfa3c1b13f11
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Aug 20 18:14:28 2007 -0700
+
+    Version bump: 1.0.2
+
+commit ea7f29dd3104c23f2533e45395852202dc588d36
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Aug 20 18:11:58 2007 -0700
+
+    Set version string in man page
+
+commit bdbbaa94ea75511dd7f5dd8573b6772dab56e55e
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Aug 20 17:52:25 2007 -0700
+
+    Use strdup instead of malloc/strlen/strcpy
+
+commit e5c1a83c1b8f71615d2fe724456bc044d9799efa
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Aug 20 17:48:19 2007 -0700
+
+    Correct help flag in usage message (-?, not -h)
+
+commit a6cc06762ae726765db2d5f76ce8f9464fb6dab8
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Aug 20 17:46:28 2007 -0700
+
+    Add options/flags to man page & other man page cleanups
+
+commit 3392d92ac031ac5796a1ebce816366c25f10e18a
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Aug 20 16:42:23 2007 -0700
+
+    Remove unused AC_TYPE_SIGNAL from configure.ac
+
+commit c2c7f8b3f8301f3f47af514627631acdb5aae109
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Aug 20 16:40:19 2007 -0700
+
+    Use PACKAGE_VERSION for --version output
+
+commit fb4fc37392c441e5e970ac68fc366758dac4a560
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Aug 20 16:35:42 2007 -0700
+
+    Replace static ChangeLog with dist-hook to generate from git log
+
+commit 1dc83c571d81288ea3eea6032a3c3f8880b77442
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Aug 20 15:16:02 2007 -0700
+
+    Change xcursorgen_CFLAGS to AM_CFLAGS to make automake-1.10 happier
+
+commit 50d163d5ec3a5ab6d9defe883f6b96aec5e7c481
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Dec 12 15:46:57 2006 -0800
+
+    Coverity #624: RESOURCE_LEAK: Returned without freeing storage "fp"
+
+commit c7b1efdc8ee552b97e43ff985b531cc8f0d155a0
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Dec 12 15:38:56 2006 -0800
+
+    renamed: .cvsignore -> .gitignore
+
+commit 92171a05977622f2233bbd9fa63408fd85d637de
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Dec 12 15:33:55 2006 -0800
+
+    Coverity #621: RESOURCE_LEAK: Returned without freeing storage "curr"
+    
+    free(curr) in error path when second malloc fails.
+
+commit bf8160df027e3c4335e8473cf7aae8c1d21546cf
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Fri May 19 18:33:36 2006 +0000
+
+    Bump to 1.0.1
+
+commit c3eb5d737f8281a3c7ffaf592c443d41a47f5c40
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Apr 3 22:06:24 2006 +0000
+
+    Bug #3270: Fix rounding errors.
+
+commit b7b26fefc1b334672e84a16c8caf5edd2b85f294
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:24:05 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+commit ab065281c8875bba88c2b9adb492a9977ea39ed0
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 6 22:48:20 2005 +0000
+
+    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit ae1b20a0473e596754eae33bab0fedeb692f381b
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Dec 3 05:49:19 2005 +0000
+
+    Update package version number for X11R7 RC3 release.
+
+commit 46218fc220339a616694ea0310a173d50ef7bf12
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Nov 28 22:01:40 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 f3a8d8e594e16f9c9b9b89215eb297232da936e0
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Mon Nov 21 10:34:59 2005 +0000
+
+    Another pass at .cvsignores for apps.
+
+commit 21e0bf931f260b7c1dbc4724b2698a1cd1143e79
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Sun Nov 20 22:08:51 2005 +0000
+
+    Add/improve .cvsignore files for apps.
+
+commit 15664a0e83dad641da695c6b35965c08e8b6935d
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sat Nov 12 17:52:00 2005 +0000
+
+    Bug #5021 <https://bugs.freedesktop.org/show_bug.cgi?id=5021> Patch #3786
+        <https://bugs.freedesktop.org/attachment.cgi?id=3786> xcursorgen
+        installs manpages into 'man1' instead of 'man1x'
+
+commit 0c9649fc7598ac601f4bc67253c7caf3ae1bd04b
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Nov 9 21:09:20 2005 +0000
+
+    Update package version number for X11R7 RC2 release.
+
+commit 4ef9256645536bc4200f4611014176de65231bde
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Thu Oct 20 23:28:50 2005 +0000
+
+    Update ChangeLog for last fix, including attribution: Fix spelling of
+        man1_MANS so the manpage gets installed. (Bill Crawford)
+
+commit e1aafb476b2fd87b5c8d998f78a268b218db95db
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Thu Oct 20 23:20:13 2005 +0000
+
+    Fix spelling of man1_MANS so the manpage gets installed.
+
+commit 0075a0d8b02c0bf069cb28d569341be0efabd831
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Jul 29 21:22:31 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 d1e8b882f87ed8f6e335daff461ea1427f92c8c9
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sat Jul 9 23:36:22 2005 +0000
+
+    Add .cvsignore files
+
+commit 36faf2957f84e050486a9ca187f22c82867e383d
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Wed Jul 6 05:39:42 2005 +0000
+
+    Set version to 1.0.
+
+commit 74a7675c0608d7e1b9a22263b907ce7804bb3250
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Wed Jul 6 05:35:51 2005 +0000
+
+    Add xcursorgen build system.
+
+commit a750fa933a7d54c971badb401a23fcd020da315b
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Fri Dec 3 22:21:22 2004 +0000
+
+    Check malloc return values.
+
+commit 4b9f8a6bb5e2bd7129339264aab23f3818ff4952
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 19:54:41 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+commit 67c2de8d39f56345bd5a5b40b8bd93a5a6aac9de
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:35:01 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit 11ad36a7b30edcab5d75fc3b96ab6f5b28295ac5
+Author: Egbert Eich <eich@suse.de>
+Date:   Wed Mar 3 12:12:55 2004 +0000
+
+    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit a72ceed75bbb818736df95fc0756e40469416bb1
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:36:16 2004 +0000
+
+    readding XFree86's cvs IDs
+
+commit 3a6cb640d6a1a86e8586d998f97538df0cca6e14
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 09:23:58 2004 +0000
+
+    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit 7c4674de0645c6deab515b153f86520967bd0a4f
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:29:04 2003 +0000
+
+    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit b3bfcbc826cc3316c1068724633897abb11d8118
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:58 2003 +0000
+
+    XFree86 4.3.0.1
+
+commit 439e6e965ce471e53cd740549743fea761c46dda
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:48:58 2003 +0000
+
+    Initial revision
diff --git a/xcursorgen/INSTALL b/xcursorgen/INSTALL
new file mode 100755 (executable)
index 0000000..8b82ade
--- /dev/null
@@ -0,0 +1,291 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008 Free Software Foundation, Inc.
+
+   This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+   Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package.  The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.
+
+     Running `configure' might take a while.  While running, it prints
+     some messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+  6. Often, you can also type `make uninstall' to remove the installed
+     files again.
+
+Compilers and Options
+=====================
+
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+   You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you can use GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory.  After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+   On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor.  Like
+this:
+
+     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CPP="gcc -E" CXXCPP="g++ -E"
+
+   This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+   By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+   Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Particular systems
+==================
+
+   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+     ./configure CC="cc -Ae"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
+a workaround.  If GNU CC is not installed, it is therefore recommended
+to try
+
+     ./configure CC="cc"
+
+and if that doesn't work, try
+
+     ./configure CC="cc -nodtk"
+
+Specifying the System Type
+==========================
+
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+   Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug.  Until the bug is fixed you can use this workaround:
+
+     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+   `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+     Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+     Print a summary of the options unique to this package's
+     `configure', and exit.  The `short' variant lists options used
+     only in the top level, while the `recursive' variant lists options
+     also present in any nested packages.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+     Use DIR as the installation prefix.  *Note Installation Names::
+     for more details, including other options available for fine-tuning
+     the installation locations.
+
+`--no-create'
+`-n'
+     Run the configure checks, but stop before creating any output
+     files.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/xcursorgen/Makefile.am b/xcursorgen/Makefile.am
new file mode 100755 (executable)
index 0000000..75e7a33
--- /dev/null
@@ -0,0 +1,33 @@
+bin_PROGRAMS = xcursorgen
+
+xcursorgen_SOURCES = xcursorgen.c
+
+AM_CFLAGS = $(CWARNFLAGS) $(XCURSORGEN_CFLAGS)
+
+xcursorgen_LDADD = $(XCURSORGEN_LIBS)
+
+appmandir = $(APP_MAN_DIR)
+
+appman_PRE = xcursorgen.man
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+
+EXTRA_DIST = $(appman_PRE) autogen.sh
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+CLEANFILES = $(appman_DATA)
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
+
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
+
+SUFFIXES = .$(APP_MAN_SUFFIX) .man
+
+.man.$(APP_MAN_SUFFIX):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
diff --git a/xcursorgen/Makefile.in b/xcursorgen/Makefile.in
new file mode 100755 (executable)
index 0000000..527e33d
--- /dev/null
@@ -0,0 +1,730 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = xcursorgen$(EXEEXT)
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+       $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL \
+       config.guess config.sub depcomp install-sh missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_xcursorgen_OBJECTS = xcursorgen.$(OBJEXT)
+xcursorgen_OBJECTS = $(am_xcursorgen_OBJECTS)
+am__DEPENDENCIES_1 =
+xcursorgen_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(xcursorgen_SOURCES)
+DIST_SOURCES = $(xcursorgen_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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+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@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+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@
+CHANGELOG_CMD = @CHANGELOG_CMD@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
+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@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_CMD = @INSTALL_CMD@
+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@
+MAKEINFO = @MAKEINFO@
+MAN_SUBSTS = @MAN_SUBSTS@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XCURSORGEN_CFLAGS = @XCURSORGEN_CFLAGS@
+XCURSORGEN_LIBS = @XCURSORGEN_LIBS@
+XORG_MAN_PAGE = @XORG_MAN_PAGE@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__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@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+xcursorgen_SOURCES = xcursorgen.c
+AM_CFLAGS = $(CWARNFLAGS) $(XCURSORGEN_CFLAGS)
+xcursorgen_LDADD = $(XCURSORGEN_LIBS)
+appmandir = $(APP_MAN_DIR)
+appman_PRE = xcursorgen.man
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+EXTRA_DIST = $(appman_PRE) autogen.sh
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+CLEANFILES = $(appman_DATA)
+
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
+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) --foreign'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign 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)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+       @if test ! -f $@; then \
+         rm -f stamp-h1; \
+         $(MAKE) $(AM_MAKEFLAGS) 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) 
+       ($(am__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)'; test -n "$(bindir)" || list=; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p; \
+         then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+xcursorgen$(EXEEXT): $(xcursorgen_OBJECTS) $(xcursorgen_DEPENDENCIES) 
+       @rm -f xcursorgen$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(xcursorgen_OBJECTS) $(xcursorgen_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcursorgen.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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) '$<'`
+install-appmanDATA: $(appman_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)"
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \
+       done
+
+uninstall-appmanDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appmandir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appmandir)" && rm -f $$files
+
+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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       set x; \
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       $(am__remove_distdir)
+       test -d "$(distdir)" || mkdir "$(distdir)"
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$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
+       -test -n "$(am__skip_mode_fix)" \
+       || find "$(distdir)" -type d ! -perm -755 \
+               -exec chmod u+rwx,go+rx {} \; -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 $(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-lzma: distdir
+       tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+       $(am__remove_distdir)
+
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+       $(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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+       *.tar.bz2*) \
+         bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.lzma*) \
+         lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+       *.tar.Z*) \
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+       *.shar.gz*) \
+         GZIP=$(GZIP_ENV) gzip -dc $(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)
+       test -d $(distdir)/_build || exit 0; \
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && am__cwd=`pwd` \
+         && $(am__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 \
+         && cd "$$am__cwd" \
+         || exit 1
+       $(am__remove_distdir)
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+       @$(am__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)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-appmanDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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
+
+.MAKE: all install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+       clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
+       dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \
+       dist-zip distcheck distclean distclean-compile \
+       distclean-generic distclean-hdr distclean-tags distcleancheck \
+       distdir distuninstallcheck dvi dvi-am html html-am info \
+       info-am install install-am install-appmanDATA \
+       install-binPROGRAMS install-data install-data-am install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+       tags uninstall uninstall-am uninstall-appmanDATA \
+       uninstall-binPROGRAMS
+
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
+
+.man.$(APP_MAN_SUFFIX):
+       $(AM_V_GEN)$(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/xcursorgen/NEWS b/xcursorgen/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xcursorgen/README b/xcursorgen/README
new file mode 100755 (executable)
index 0000000..6e46f96
--- /dev/null
@@ -0,0 +1,25 @@
+xcursorgen prepares X11 cursor sets for use with libXcursor.
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+        http://lists.freedesktop.org/mailman/listinfo/xorg
+
+Please submit bug reports to the Xorg bugzilla:
+
+        https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+The master development code repository can be found at:
+
+        git://anongit.freedesktop.org/git/xorg/app/xcursorgen
+
+        http://cgit.freedesktop.org/xorg/app/xcursorgen
+
+For patch submission instructions, see:
+
+       http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
+For more information on the git code manager, see:
+
+        http://wiki.x.org/wiki/GitPage
+
diff --git a/xcursorgen/aclocal.m4 b/xcursorgen/aclocal.m4
new file mode 100755 (executable)
index 0000000..6be78d7
--- /dev/null
@@ -0,0 +1,2365 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009  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.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
+[m4_warning([this file was generated for autoconf 2.68.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11.1], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# 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, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# 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])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+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, 2006, 2009
+# 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 10
+
+# 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], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$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
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    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, 2006, 2008, 2009 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 16
+
+# 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.62])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
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+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
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_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)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+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
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_AM_DEPENDENCIES(OBJC)],
+                 [define([AC_PROG_OBJC],
+                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# 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_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
+                         (and sometimes confusing) to the casual installer],
+      [USE_MAINTAINER_MODE=$enableval],
+      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  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, 2009  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_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.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
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+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, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# 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
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# 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, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _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],
+[m4_foreach_w([_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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# 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
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# 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) 2009  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 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# 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="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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
+
+dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
+dnl
+dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. 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 "Software"),
+dnl to deal in the Software without restriction, including without limitation
+dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
+dnl and/or sell copies of the Software, and to permit persons to whom the
+dnl Software is furnished to do so, subject to the following conditions:
+dnl
+dnl The above copyright notice and this permission notice (including the next
+dnl paragraph) shall be included in all copies or substantial portions of the
+dnl Software.
+dnl
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+dnl DEALINGS IN THE SOFTWARE.
+
+# 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 ensure that this macro is defined, also add:
+# m4_ifndef([XORG_MACROS_VERSION],
+#     [m4_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.
+m4_defun([XORG_MACROS_VERSION],[
+m4_define([vers_have], [1.10.1])
+m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
+m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
+m4_if(m4_cmp(maj_have, maj_needed), 0,,
+    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
+m4_if(m4_version_compare(vers_have, [$1]), -1,
+    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
+m4_undefine([vers_have])
+m4_undefine([maj_have])
+m4_undefine([maj_needed])
+]) # 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])
+       # under Cygwin unix is still defined even with -undef
+       elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+               RAWCPPFLAGS="-undef -ansi"
+               AC_MSG_RESULT([yes, with -ansi])
+       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
+# Added MAN_SUBSTS in version 1.8
+# Added AC_PROG_SED in version 1.8
+
+AC_DEFUN([XORG_MANPAGE_SECTIONS],[
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_SED])
+
+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_MAN_PAGE="X Version 11"
+AC_SUBST([XORG_MAN_PAGE])
+MAN_SUBSTS="\
+       -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xservername__|Xorg|g' \
+       -e 's|__xconfigfile__|xorg.conf|g' \
+       -e 's|__projectroot__|\$(prefix)|g' \
+       -e 's|__apploaddir__|\$(appdefaultdir)|g' \
+       -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
+       -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
+       -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
+       -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
+       -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
+       -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
+AC_SUBST([MAN_SUBSTS])
+
+]) # XORG_MANPAGE_SECTIONS
+
+# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
+# ------------------------
+# Minimum version: 1.7.0
+#
+# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
+# provided by xorg-sgml-doctools, if installed.
+AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
+AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
+XORG_SGML_PATH=
+PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
+    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
+    [m4_ifval([$1],[:],
+        [if test x"$cross_compiling" != x"yes" ; then
+            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
+                          [XORG_SGML_PATH=$prefix/share/sgml])
+         fi])
+    ])
+
+# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
+# the path and the name of the doc stylesheet
+if test "x$XORG_SGML_PATH" != "x" ; then
+   AC_MSG_RESULT([$XORG_SGML_PATH])
+   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
+   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
+else
+   AC_MSG_RESULT([no])
+fi
+
+AC_SUBST(XORG_SGML_PATH)
+AC_SUBST(STYLESHEET_SRCDIR)
+AC_SUBST(XSL_STYLESHEET)
+AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
+]) # XORG_CHECK_SGML_DOCTOOLS
+
+# 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_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
+AC_REQUIRE([XORG_WITH_PS2PDF])
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+
+AC_MSG_CHECKING([whether to build documentation])
+
+if test x$XORG_SGML_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$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
+
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([whether to build text documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([whether to build PDF documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([whether to build PostScript documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([whether to build HTML documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# XORG_WITH_XMLTO([MIN-VERSION])
+# ----------------
+# Minimum version: 1.5.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-xmlto option, it allows maximum flexibilty in making decisions
+# as whether or not to use the xmlto package.
+#
+# Interface to module:
+# HAVE_XMLTO:  used in makefiles to conditionally generate documentation
+# XMLTO:       returns the path of the xmlto program found
+#              returns the path set by the user in the environment
+# --with-xmlto:        'yes' user instructs the module to use xmlto
+#              'no' user instructs the module not to use xmlto
+#
+# Added in version 1.10.0
+# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
+#                  xmlto for text output requires either lynx, links, or w3m browsers
+#
+# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_XMLTO],[
+AC_ARG_VAR([XMLTO], [Path to xmlto command])
+AC_ARG_WITH(xmlto,
+       AS_HELP_STRING([--with-xmlto],
+          [Use xmlto to regenerate documentation (default: yes, if installed)]),
+          [use_xmlto=$withval], [use_xmlto=auto])
+
+if test "x$use_xmlto" = x"auto"; then
+   AC_PATH_PROG([XMLTO], [xmlto])
+   if test "x$XMLTO" = "x"; then
+        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
+       have_xmlto=no
+   else
+        have_xmlto=yes
+   fi
+elif test "x$use_xmlto" = x"yes" ; then
+   AC_PATH_PROG([XMLTO], [xmlto])
+   if test "x$XMLTO" = "x"; then
+        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
+   fi
+   have_xmlto=yes
+elif test "x$use_xmlto" = x"no" ; then
+   if test "x$XMLTO" != "x"; then
+      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
+   fi
+   have_xmlto=no
+else
+   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
+fi
+
+# Test for a minimum version of xmlto, if provided.
+m4_ifval([$1],
+[if test "$have_xmlto" = yes; then
+    # scrape the xmlto version
+    AC_MSG_CHECKING([the xmlto version])
+    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
+    AC_MSG_RESULT([$xmlto_version])
+    AS_VERSION_COMPARE([$xmlto_version], [$1],
+        [if test "x$use_xmlto" = xauto; then
+            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
+            have_xmlto=no
+        else
+            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
+        fi])
+fi])
+
+# Test for the ability of xmlto to generate a text target
+have_xmlto_text=no
+cat > conftest.xml << "EOF"
+EOF
+AS_IF([test "$have_xmlto" = yes],
+      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
+             [have_xmlto_text=yes],
+             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
+rm -f conftest.xml
+AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
+AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
+]) # XORG_WITH_XMLTO
+
+# XORG_WITH_ASCIIDOC([MIN-VERSION])
+# ----------------
+# Minimum version: 1.5.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-asciidoc option, it allows maximum flexibilty in making decisions
+# as whether or not to use the asciidoc package.
+#
+# Interface to module:
+# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
+# ASCIIDOC:     returns the path of the asciidoc program found
+#               returns the path set by the user in the environment
+# --with-asciidoc: 'yes' user instructs the module to use asciidoc
+#                'no' user instructs the module not to use asciidoc
+#
+# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_ASCIIDOC],[
+AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
+AC_ARG_WITH(asciidoc,
+       AS_HELP_STRING([--with-asciidoc],
+          [Use asciidoc to regenerate documentation (default: yes, if installed)]),
+          [use_asciidoc=$withval], [use_asciidoc=auto])
+
+if test "x$use_asciidoc" = x"auto"; then
+   AC_PATH_PROG([ASCIIDOC], [asciidoc])
+   if test "x$ASCIIDOC" = "x"; then
+        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
+       have_asciidoc=no
+   else
+        have_asciidoc=yes
+   fi
+elif test "x$use_asciidoc" = x"yes" ; then
+   AC_PATH_PROG([ASCIIDOC], [asciidoc])
+   if test "x$ASCIIDOC" = "x"; then
+        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
+   fi
+   have_asciidoc=yes
+elif test "x$use_asciidoc" = x"no" ; then
+   if test "x$ASCIIDOC" != "x"; then
+      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
+   fi
+   have_asciidoc=no
+else
+   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
+fi
+m4_ifval([$1],
+[if test "$have_asciidoc" = yes; then
+    # scrape the asciidoc version
+    AC_MSG_CHECKING([the asciidoc version])
+    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
+    AC_MSG_RESULT([$asciidoc_version])
+    AS_VERSION_COMPARE([$asciidoc_version], [$1],
+        [if test "x$use_asciidoc" = xauto; then
+            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
+            have_asciidoc=no
+        else
+            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
+        fi])
+fi])
+AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
+]) # XORG_WITH_ASCIIDOC
+
+# XORG_WITH_DOXYGEN([MIN-VERSION])
+# --------------------------------
+# Minimum version: 1.5.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-doxygen option, it allows maximum flexibilty in making decisions
+# as whether or not to use the doxygen package.
+#
+# Interface to module:
+# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
+# DOXYGEN:      returns the path of the doxygen program found
+#               returns the path set by the user in the environment
+# --with-doxygen: 'yes' user instructs the module to use doxygen
+#                'no' user instructs the module not to use doxygen
+#
+# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_DOXYGEN],[
+AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
+AC_ARG_WITH(doxygen,
+       AS_HELP_STRING([--with-doxygen],
+          [Use doxygen to regenerate documentation (default: yes, if installed)]),
+          [use_doxygen=$withval], [use_doxygen=auto])
+
+if test "x$use_doxygen" = x"auto"; then
+   AC_PATH_PROG([DOXYGEN], [doxygen])
+   if test "x$DOXYGEN" = "x"; then
+        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
+       have_doxygen=no
+   else
+        have_doxygen=yes
+   fi
+elif test "x$use_doxygen" = x"yes" ; then
+   AC_PATH_PROG([DOXYGEN], [doxygen])
+   if test "x$DOXYGEN" = "x"; then
+        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
+   fi
+   have_doxygen=yes
+elif test "x$use_doxygen" = x"no" ; then
+   if test "x$DOXYGEN" != "x"; then
+      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
+   fi
+   have_doxygen=no
+else
+   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
+fi
+m4_ifval([$1],
+[if test "$have_doxygen" = yes; then
+    # scrape the doxygen version
+    AC_MSG_CHECKING([the doxygen version])
+    doxygen_version=`$DOXYGEN --version 2>/dev/null`
+    AC_MSG_RESULT([$doxygen_version])
+    AS_VERSION_COMPARE([$doxygen_version], [$1],
+        [if test "x$use_doxygen" = xauto; then
+            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
+            have_doxygen=no
+        else
+            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
+        fi])
+fi])
+AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
+]) # XORG_WITH_DOXYGEN
+
+# XORG_WITH_GROFF
+# ----------------
+# Minimum version: 1.6.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-groff option, it allows maximum flexibilty in making decisions
+# as whether or not to use the groff package.
+#
+# Interface to module:
+# HAVE_GROFF:   used in makefiles to conditionally generate documentation
+# HAVE_GROFF_MM: the memorandum macros (-mm) package
+# HAVE_GROFF_MS: the -ms macros package
+# GROFF:        returns the path of the groff program found
+#               returns the path set by the user in the environment
+# --with-groff:         'yes' user instructs the module to use groff
+#               'no' user instructs the module not to use groff
+#
+# Added in version 1.9.0:
+# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
+#                 pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
+#                 psselect from the psutils package.
+#                 the ghostcript package. Refer to the grohtml man pages
+#
+# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
+#
+# OS and distros often splits groff in a basic and full package, the former
+# having the groff program and the later having devices, fonts and macros
+# Checking for the groff executable is not enough.
+#
+# If macros are missing, we cannot assume that groff is useless, so we don't
+# unset HAVE_GROFF or GROFF env variables.
+# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
+#
+AC_DEFUN([XORG_WITH_GROFF],[
+AC_ARG_VAR([GROFF], [Path to groff command])
+AC_ARG_WITH(groff,
+       AS_HELP_STRING([--with-groff],
+          [Use groff to regenerate documentation (default: yes, if installed)]),
+          [use_groff=$withval], [use_groff=auto])
+
+if test "x$use_groff" = x"auto"; then
+   AC_PATH_PROG([GROFF], [groff])
+   if test "x$GROFF" = "x"; then
+        AC_MSG_WARN([groff not found - documentation targets will be skipped])
+       have_groff=no
+   else
+        have_groff=yes
+   fi
+elif test "x$use_groff" = x"yes" ; then
+   AC_PATH_PROG([GROFF], [groff])
+   if test "x$GROFF" = "x"; then
+        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
+   fi
+   have_groff=yes
+elif test "x$use_groff" = x"no" ; then
+   if test "x$GROFF" != "x"; then
+      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
+   fi
+   have_groff=no
+else
+   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
+fi
+
+# We have groff, test for the presence of the macro packages
+if test "x$have_groff" = x"yes"; then
+    AC_MSG_CHECKING([for ${GROFF} -ms macros])
+    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
+        groff_ms_works=yes
+    else
+        groff_ms_works=no
+    fi
+    AC_MSG_RESULT([$groff_ms_works])
+    AC_MSG_CHECKING([for ${GROFF} -mm macros])
+    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
+        groff_mm_works=yes
+    else
+        groff_mm_works=no
+    fi
+    AC_MSG_RESULT([$groff_mm_works])
+fi
+
+# We have groff, test for HTML dependencies, one command per package
+if test "x$have_groff" = x"yes"; then
+   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
+   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
+   AC_PATH_PROG(PSSELECT_PATH, [psselect])
+   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
+      have_groff_html=yes
+   else
+      have_groff_html=no
+      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
+   fi
+fi
+
+# Set Automake conditionals for Makefiles
+AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
+AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
+AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
+AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
+]) # XORG_WITH_GROFF
+
+# XORG_WITH_FOP
+# ----------------
+# Minimum version: 1.6.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-fop option, it allows maximum flexibilty in making decisions
+# as whether or not to use the fop package.
+#
+# Interface to module:
+# HAVE_FOP:    used in makefiles to conditionally generate documentation
+# FOP:         returns the path of the fop program found
+#              returns the path set by the user in the environment
+# --with-fop:  'yes' user instructs the module to use fop
+#              'no' user instructs the module not to use fop
+#
+# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_FOP],[
+AC_ARG_VAR([FOP], [Path to fop command])
+AC_ARG_WITH(fop,
+       AS_HELP_STRING([--with-fop],
+          [Use fop to regenerate documentation (default: yes, if installed)]),
+          [use_fop=$withval], [use_fop=auto])
+
+if test "x$use_fop" = x"auto"; then
+   AC_PATH_PROG([FOP], [fop])
+   if test "x$FOP" = "x"; then
+        AC_MSG_WARN([fop not found - documentation targets will be skipped])
+       have_fop=no
+   else
+        have_fop=yes
+   fi
+elif test "x$use_fop" = x"yes" ; then
+   AC_PATH_PROG([FOP], [fop])
+   if test "x$FOP" = "x"; then
+        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
+   fi
+   have_fop=yes
+elif test "x$use_fop" = x"no" ; then
+   if test "x$FOP" != "x"; then
+      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
+   fi
+   have_fop=no
+else
+   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
+fi
+AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
+]) # XORG_WITH_FOP
+
+# XORG_WITH_PS2PDF
+# ----------------
+# Minimum version: 1.6.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
+# as whether or not to use the ps2pdf package.
+#
+# Interface to module:
+# HAVE_PS2PDF:         used in makefiles to conditionally generate documentation
+# PS2PDF:      returns the path of the ps2pdf program found
+#              returns the path set by the user in the environment
+# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
+#               'no' user instructs the module not to use ps2pdf
+#
+# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_PS2PDF],[
+AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
+AC_ARG_WITH(ps2pdf,
+       AS_HELP_STRING([--with-ps2pdf],
+          [Use ps2pdf to regenerate documentation (default: yes, if installed)]),
+          [use_ps2pdf=$withval], [use_ps2pdf=auto])
+
+if test "x$use_ps2pdf" = x"auto"; then
+   AC_PATH_PROG([PS2PDF], [ps2pdf])
+   if test "x$PS2PDF" = "x"; then
+        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
+       have_ps2pdf=no
+   else
+        have_ps2pdf=yes
+   fi
+elif test "x$use_ps2pdf" = x"yes" ; then
+   AC_PATH_PROG([PS2PDF], [ps2pdf])
+   if test "x$PS2PDF" = "x"; then
+        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
+   fi
+   have_ps2pdf=yes
+elif test "x$use_ps2pdf" = x"no" ; then
+   if test "x$PS2PDF" != "x"; then
+      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
+   fi
+   have_ps2pdf=no
+else
+   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
+fi
+AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
+]) # XORG_WITH_PS2PDF
+
+# XORG_ENABLE_DOCS (enable_docs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a builder to skip all
+# documentation targets except traditional man pages.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO         --with-xmlto
+# XORG_WITH_ASCIIDOC      --with-asciidoc
+# XORG_WITH_DOXYGEN       --with-doxygen
+# XORG_WITH_FOP           --with-fop
+# XORG_WITH_GROFF         --with-groff
+# XORG_WITH_PS2PDF        --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_DOCS:           used in makefiles to conditionally generate documentation
+# --enable-docs: 'yes' user instructs the module to generate docs
+#               'no' user instructs the module not to generate docs
+# parm1:       specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_DOCS],[
+default=$1
+if test "x$default" = x ; then
+  default="yes"
+fi
+AC_ARG_ENABLE(docs,
+       AS_HELP_STRING([--enable-docs],
+          [Enable building the documentation (default: yes)]),
+          [build_docs=$enableval], [build_docs=$default])
+AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
+AC_MSG_CHECKING([whether to build documentation])
+AC_MSG_RESULT([$build_docs])
+]) # XORG_ENABLE_DOCS
+
+# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# This macro enables a builder to skip all developer documentation.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO         --with-xmlto
+# XORG_WITH_ASCIIDOC      --with-asciidoc
+# XORG_WITH_DOXYGEN       --with-doxygen
+# XORG_WITH_FOP           --with-fop
+# XORG_WITH_GROFF         --with-groff
+# XORG_WITH_PS2PDF        --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_DEVEL_DOCS:   used in makefiles to conditionally generate developer docs
+# --enable-devel-docs: 'yes' user instructs the module to generate developer docs
+#                      'no' user instructs the module not to generate developer docs
+# parm1:               specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
+devel_default=$1
+if test "x$devel_default" = x ; then
+  devel_default="yes"
+fi
+AC_ARG_ENABLE(devel-docs,
+       AS_HELP_STRING([--enable-devel-docs],
+          [Enable building the developer documentation (default: yes)]),
+          [build_devel_docs=$enableval], [build_devel_docs=$devel_default])
+AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
+AC_MSG_CHECKING([whether to build developer documentation])
+AC_MSG_RESULT([$build_devel_docs])
+]) # XORG_ENABLE_DEVEL_DOCS
+
+# XORG_ENABLE_SPECS (enable_specs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# This macro enables a builder to skip all functional specification targets.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO         --with-xmlto
+# XORG_WITH_ASCIIDOC      --with-asciidoc
+# XORG_WITH_DOXYGEN       --with-doxygen
+# XORG_WITH_FOP           --with-fop
+# XORG_WITH_GROFF         --with-groff
+# XORG_WITH_PS2PDF        --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_SPECS:                used in makefiles to conditionally generate specs
+# --enable-specs:      'yes' user instructs the module to generate specs
+#                      'no' user instructs the module not to generate specs
+# parm1:               specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_SPECS],[
+spec_default=$1
+if test "x$spec_default" = x ; then
+  spec_default="yes"
+fi
+AC_ARG_ENABLE(specs,
+       AS_HELP_STRING([--enable-specs],
+          [Enable building the specs (default: yes)]),
+          [build_specs=$enableval], [build_specs=$spec_default])
+AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
+AC_MSG_CHECKING([whether to build functional specifications])
+AC_MSG_RESULT([$build_specs])
+]) # XORG_ENABLE_SPECS
+
+# 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,
+       AS_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],
+               [MALLOC_ZERO_RETURNS_NULL=yes])
+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
+#
+# This macro enables the use of a tool that flags some suspicious and
+# non-portable constructs (likely to be bugs) in C language source code.
+# It will attempt to locate the tool and use appropriate options.
+# There are various lint type tools on different platforms.
+#
+# Interface to module:
+# LINT:                returns the path to the tool found on the platform
+#              or the value set to LINT on the configure cmd line
+#              also an Automake conditional
+# LINT_FLAGS:  an Automake variable with appropriate flags
+#
+# --with-lint: 'yes' user instructs the module to use lint
+#              'no' user instructs the module not to use lint (default)
+#
+# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
+# If the user sets the value of LINT_FLAGS, they are used verbatim.
+#
+AC_DEFUN([XORG_WITH_LINT],[
+
+AC_ARG_VAR([LINT], [Path to a lint-style command])
+AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
+AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
+               [Use a lint-style source code checker (default: disabled)])],
+               [use_lint=$withval], [use_lint=no])
+
+# Obtain platform specific info like program name and options
+# The lint program on FreeBSD and NetBSD is different from the one on Solaris
+case $host_os in
+  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
+       lint_name=splint
+       lint_options="-badflag"
+       ;;
+  *freebsd* | *netbsd*)
+       lint_name=lint
+       lint_options="-u -b"
+       ;;
+  *solaris*)
+       lint_name=lint
+       lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
+       ;;
+esac
+
+# Test for the presence of the program (either guessed by the code or spelled out by the user)
+if test "x$use_lint" = x"yes" ; then
+   AC_PATH_PROG([LINT], [$lint_name])
+   if test "x$LINT" = "x"; then
+        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
+   fi
+elif test "x$use_lint" = x"no" ; then
+   if test "x$LINT" != "x"; then
+      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
+   fi
+else
+   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
+fi
+
+# User supplied flags override default flags
+if test "x$LINT_FLAGS" != "x"; then
+   lint_options=$LINT_FLAGS
+fi
+
+AC_SUBST([LINT_FLAGS],[$lint_options])
+AM_CONDITIONAL(LINT, [test "x$LINT" != x])
+
+]) # 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.
+#
+# Interface to module:
+# LINTLIB              - Automake variable with the name of lint library file to make
+# MAKE_LINT_LIB                - Automake conditional
+#
+# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
+#                        - 'no' user instructs the module not to create a lint library (default)
+
+AC_DEFUN([XORG_LINT_LIBRARY],[
+AC_REQUIRE([XORG_WITH_LINT])
+AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
+       [Create lint library (default: disabled)])],
+       [make_lint_lib=$enableval], [make_lint_lib=no])
+
+if test "x$make_lint_lib" = x"yes" ; then
+   LINTLIB=llib-l$1.ln
+   if test "x$LINT" = "x"; then
+        AC_MSG_ERROR([Cannot make lint library without --with-lint])
+   fi
+elif test "x$make_lint_lib" != x"no" ; then
+   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
+fi
+
+AC_SUBST(LINTLIB)
+AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
+
+]) # XORG_LINT_LIBRARY
+
+# XORG_CWARNFLAGS
+# ---------------
+# Minimum version: 1.2.0
+#
+# Defines CWARNFLAGS to enable C compiler warnings.
+#
+AC_DEFUN([XORG_CWARNFLAGS], [
+AC_REQUIRE([AC_PROG_CC_C99])
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast -Wformat=2"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+AC_SUBST(CWARNFLAGS)
+]) # XORG_CWARNFLAGS
+
+# XORG_STRICT_OPTION
+# -----------------------
+# Minimum version: 1.3.0
+#
+# Add configure option to enable strict compilation
+AC_DEFUN([XORG_STRICT_OPTION], [
+# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
+AC_REQUIRE([AC_PROG_CC_C99])
+AC_REQUIRE([XORG_CWARNFLAGS])
+
+AC_ARG_ENABLE(strict-compilation,
+                         AS_HELP_STRING([--enable-strict-compilation],
+                         [Enable all warnings from compiler and make them errors (default: disabled)]),
+                         [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
+if test "x$STRICT_COMPILE" = "xyes"; then
+       AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+       AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+AC_SUBST([CWARNFLAGS])
+]) # XORG_STRICT_OPTION
+
+# XORG_DEFAULT_OPTIONS
+# --------------------
+# Minimum version: 1.3.0
+#
+# Defines default options for X.Org modules.
+#
+AC_DEFUN([XORG_DEFAULT_OPTIONS], [
+AC_REQUIRE([AC_PROG_INSTALL])
+XORG_CWARNFLAGS
+XORG_STRICT_OPTION
+XORG_RELEASE_VERSION
+XORG_CHANGELOG
+XORG_INSTALL
+XORG_MANPAGE_SECTIONS
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
+    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
+]) # XORG_DEFAULT_OPTIONS
+
+# XORG_INSTALL()
+# ----------------
+# Minimum version: 1.4.0
+#
+# Defines the variable INSTALL_CMD as the command to copy
+# INSTALL from $prefix/share/util-macros.
+#
+AC_DEFUN([XORG_INSTALL], [
+AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
+INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+AC_SUBST([INSTALL_CMD])
+]) # XORG_INSTALL
+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
+# --------------------
+# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+AC_DEFUN([XORG_RELEASE_VERSION],[
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+               [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+               [Major version of this package])
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+               [$PVM],
+               [Minor version of this package])
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+               [$PVP],
+               [Patch version of this package])
+])
+
+# XORG_CHANGELOG()
+# ----------------
+# Minimum version: 1.2.0
+#
+# Defines the variable CHANGELOG_CMD as the command to generate
+# ChangeLog from git.
+#
+#
+AC_DEFUN([XORG_CHANGELOG], [
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+AC_SUBST([CHANGELOG_CMD])
+]) # XORG_CHANGELOG
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# 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 "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _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 --print-errors "$2" 2>&1`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       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 <http://pkg-config.freedesktop.org/>.])],
+               [$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
+
diff --git a/xcursorgen/autogen.sh b/xcursorgen/autogen.sh
new file mode 100755 (executable)
index 0000000..e81f989
--- /dev/null
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure --enable-maintainer-mode "$@"
+
diff --git a/xcursorgen/config.guess b/xcursorgen/config.guess
new file mode 100755 (executable)
index 0000000..2852378
--- /dev/null
@@ -0,0 +1,1505 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+#   Free Software Foundation, Inc.
+
+timestamp='2010-08-21'
+
+# 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 (context
+# diff format) to <config-patches@gnu.org> and include a 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.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+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 <config-patches@gnu.org>."
+
+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, 2006, 2007, 2008, 2009, 2010 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' HUP INT TERM
+
+# 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" HUP INT PIPE TERM ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$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 ;;
+           sh5el) machine=sh5le-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 -q __ELF__
+               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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+       echo i386-pc-auroraux${UNAME_RELEASE}
+       exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+       eval $set_cc_for_build
+       SUN_ARCH="i386"
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       echo ${SUN_ARCH}-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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:*:[4567])
+       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 <stdlib.h>
+              #include <unistd.h>
+
+              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 -q __LP64__
+           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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       exit ;;
+    i*:CYGWIN*:*)
+       echo ${UNAME_MACHINE}-pc-cygwin
+       exit ;;
+    *: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 ;;
+    *:Interix*:*)
+       case ${UNAME_MACHINE} in
+           x86)
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           authenticamd | genuineintel | EM64T)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+           IA64)
+               echo ia64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+       esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       exit ;;
+    8664:Windows_NT:*)
+       echo x86_64-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*:*:* | x86_64: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 ;;
+    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 -q ld.so.1
+       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+       exit ;;
+    arm*:Linux:*:*)
+       eval $set_cc_for_build
+       if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_EABI__
+       then
+           echo ${UNAME_MACHINE}-unknown-linux-gnu
+       else
+           echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+       fi
+       exit ;;
+    avr32*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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 ;;
+    i*86:Linux:*:*)
+       LIBC=gnu
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+       echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+       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:*:* | mips64:Linux:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #undef CPU
+       #undef ${UNAME_MACHINE}
+       #undef ${UNAME_MACHINE}el
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=${UNAME_MACHINE}el
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       CPU=${UNAME_MACHINE}
+       #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; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-unknown-linux-gnu
+       exit ;;
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-gnu
+       exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+       echo hppa64-unknown-linux-gnu
+       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 ;;
+    ppc64:Linux:*:*)
+       echo powerpc64-unknown-linux-gnu
+       exit ;;
+    ppc:Linux:*:*)
+       echo powerpc-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 ;;
+    tile*:Linux:*:*)
+       echo ${UNAME_MACHINE}-tilera-linux-gnu
+       exit ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-gnu
+       exit ;;
+    x86_64:Linux:*:*)
+       echo x86_64-unknown-linux-gnu
+       exit ;;
+    xtensa*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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.[02]*:*)
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-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; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       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; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; 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.[02]*:*)
+       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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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 ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       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 ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-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
+           i386)
+               eval $set_cc_for_build
+               if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+                 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+                     (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+                     grep IS_64BIT_ARCH >/dev/null
+                 then
+                     UNAME_PROCESSOR="x86_64"
+                 fi
+               fi ;;
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/xcursorgen/config.h.in b/xcursorgen/config.h.in
new file mode 100755 (executable)
index 0000000..7c9cfb1
--- /dev/null
@@ -0,0 +1,64 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* 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 home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
diff --git a/xcursorgen/config.sub b/xcursorgen/config.sub
new file mode 100755 (executable)
index 0000000..320e303
--- /dev/null
@@ -0,0 +1,1739 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+#   Free Software Foundation, Inc.
+
+timestamp='2010-09-11'
+
+# 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 <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted GNU 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.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# 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 <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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-android* | linux-dietlibc | linux-newlib* | \
+  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-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 | -microblaze)
+               os=
+               basic_machine=$1
+               ;;
+        -bluegene*)
+               os=-cnk
+               ;;
+       -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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | bfin \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fido | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | lm32 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore | mep | metag \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64octeon | mips64octeonel \
+       | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | moxie \
+       | mt \
+       | msp430 \
+       | nds32 | nds32le | nds32be \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | rx \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+       | ubicom32 \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | z8k | z80)
+               basic_machine=$basic_machine-unknown
+               ;;
+       c54x)
+               basic_machine=tic54x-unknown
+               ;;
+       c55x)
+               basic_machine=tic55x-unknown
+               ;;
+       c6x)
+               basic_machine=tic6x-unknown
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12 | picochip)
+               # Motorola 68HC11/12.
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* \
+       | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64octeon-* | mips64octeonel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nds32-* | nds32le-* | nds32be-* \
+       | nios-* | nios2-* \
+       | none-* | np1-* | ns16k-* | ns32k-* \
+       | orion-* \
+       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+       | pyramid-* \
+       | romp-* | rs6000-* | rx-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tile-* | tilegx-* \
+       | tron-* \
+       | ubicom32-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa*-* \
+       | ymp-* \
+       | z8k-* | z80-*)
+               ;;
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               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
+               ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       bluegene*)
+               basic_machine=powerpc-ibm
+               os=-cnk
+               ;;
+       c54x-*)
+               basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c55x-*)
+               basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c6x-*)
+               basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+        cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
+       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
+               ;;
+       cr16)
+               basic_machine=cr16-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
+               ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
+       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
+               ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       m88k-omron*)
+               basic_machine=m88k-omron
+               ;;
+       magnum | m3230)
+               basic_machine=mips-mips
+               os=-sysv
+               ;;
+       merlin)
+               basic_machine=ns32k-utek
+               os=-sysv
+               ;;
+        microblaze)
+               basic_machine=microblaze-xilinx
+               ;;
+       mingw32)
+               basic_machine=i386-pc
+               os=-mingw32
+               ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
+       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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+        neo-tandem)
+               basic_machine=neo-tandem
+               ;;
+        nse-tandem)
+               basic_machine=nse-tandem
+               ;;
+       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
+               ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       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
+               ;;
+        # This must be matched before tile*.
+        tilegx*)
+               basic_machine=tilegx-unknown
+               os=-linux-gnu
+               ;;
+       tile*)
+               basic_machine=tile-unknown
+               os=-linux-gnu
+               ;;
+       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
+               ;;
+       z80-*-coff)
+               basic_machine=z80-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[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+               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.
+        -auroraux)
+               os=-auroraux
+               ;;
+       -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* | -cnk* | -sunos | -sunos[34]*\
+             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+             | -sym* | -kopensolaris* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* | -aros* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
+             | -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* | -cegcc* \
+             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -linux-android* \
+             | -linux-newlib* | -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* | -rdos* | -toppers* | -drops* | -es*)
+       # 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
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+        -nacl*)
+               ;;
+       -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
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
+       *-acorn)
+               os=-riscix1.2
+               ;;
+       arm*-rebel)
+               os=-linux
+               ;;
+       arm*-semi)
+               os=-aout
+               ;;
+        c4x-* | tic4x-*)
+               os=-coff
+               ;;
+       tic54x-*)
+               os=-coff
+               ;;
+       tic55x-*)
+               os=-coff
+               ;;
+       tic6x-*)
+               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
+               ;;
+        mep-*)
+               os=-elf
+               ;;
+       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
+                               ;;
+                       -cnk*|-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/xcursorgen/configure b/xcursorgen/configure
new file mode 100755 (executable)
index 0000000..db19231
--- /dev/null
@@ -0,0 +1,6133 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.68 for xcursorgen 1.0.4.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+        /*)
+          for as_base in sh bash ksh sh5; do
+            # Try only shells that exist, to save several forks.
+            as_shell=$as_dir/$as_base
+            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+          done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+       # neutralization value for shells without unset; and this also
+       # works around shells that cannot unset nonexistent variables.
+       # Preserve -v and -x to the replacement shell.
+       BASH_ENV=/dev/null
+       ENV=/dev/null
+       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+       export CONFIG_SHELL
+       case $- in # ((((
+         *v*x* | *x*v* ) as_opts=-vx ;;
+         *v* ) as_opts=-v ;;
+         *x* ) as_opts=-x ;;
+         * ) as_opts= ;;
+       esac
+       exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='xcursorgen'
+PACKAGE_TARNAME='xcursorgen'
+PACKAGE_VERSION='1.0.4'
+PACKAGE_STRING='xcursorgen 1.0.4'
+PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+XCURSORGEN_LIBS
+XCURSORGEN_CFLAGS
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+MAN_SUBSTS
+XORG_MAN_PAGE
+ADMIN_MAN_DIR
+DRIVER_MAN_DIR
+MISC_MAN_DIR
+FILE_MAN_DIR
+LIB_MAN_DIR
+APP_MAN_DIR
+ADMIN_MAN_SUFFIX
+DRIVER_MAN_SUFFIX
+MISC_MAN_SUFFIX
+FILE_MAN_SUFFIX
+LIB_MAN_SUFFIX
+APP_MAN_SUFFIX
+SED
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+INSTALL_CMD
+PKG_CONFIG
+CHANGELOG_CMD
+CWARNFLAGS
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_strict_compilation
+enable_silent_rules
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+PKG_CONFIG
+XCURSORGEN_CFLAGS
+XCURSORGEN_LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=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 ;;
+
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_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'`
+  as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+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
+    $as_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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 xcursorgen 1.0.4 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/xcursorgen]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_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 xcursorgen 1.0.4:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --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
+  --enable-strict-compilation
+                          Enable all warnings from compiler and make them
+                          errors (default: disabled)
+  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  PKG_CONFIG  path to pkg-config utility
+  XCURSORGEN_CFLAGS
+              C compiler flags for XCURSORGEN, overriding pkg-config
+  XCURSORGEN_LIBS
+              linker flags for XCURSORGEN, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+xcursorgen configure 1.0.4
+generated by GNU Autoconf 2.68
+
+Copyright (C) 2010 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
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by xcursorgen $as_me 1.0.4, which was
+generated by GNU Autoconf 2.68.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append 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
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > 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
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+  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.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_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 $ac_precious_vars; 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,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_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
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_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.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+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.11'
+
+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
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$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'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# 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".
+      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "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 $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if ${ac_cv_path_mkdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+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='xcursorgen'
+ VERSION='1.0.4'
+
+
+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"}
+
+# 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 -'
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-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
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$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
+
+
+
+# Require xorg-macros 1.8 or later: XORG_MANPAGE_SECTIONS
+
+
+
+
+
+
+
+
+
+
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-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
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+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
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM 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.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+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
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&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
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$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
+
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if ${ac_cv_prog_cc_c99+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+       {
+       case 's': // string
+         str = va_arg (args_copy, const char *);
+         break;
+       case 'd': // int
+         number = va_arg (args_copy, int);
+         break;
+       case 'f': // float
+         fnumber = va_arg (args_copy, double);
+         break;
+       default:
+         break;
+       }
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+         || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+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
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  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_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+
+
+
+
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast -Wformat=2"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default"
+if test "x$ac_cv_have_decl___SUNPRO_C" = xyes; then :
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+
+
+
+# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
+
+
+
+# Check whether --enable-strict-compilation was given.
+if test "${enable_strict_compilation+set}" = set; then :
+  enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval
+else
+  STRICT_COMPILE=no
+fi
+
+if test "x$STRICT_COMPILE" = "xyes"; then
+       ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default"
+if test "x$ac_cv_have_decl___SUNPRO_C" = xyes; then :
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+       ac_fn_c_check_decl "$LINENO" "__INTEL_COMPILER" "ac_cv_have_decl___INTEL_COMPILER" "$ac_includes_default"
+if test "x$ac_cv_have_decl___INTEL_COMPILER" = xyes; then :
+  INTELCC="yes"
+else
+  INTELCC="no"
+fi
+
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+
+
+
+
+macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
+INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+XORG_MAN_PAGE="X Version 11"
+
+MAN_SUBSTS="\
+       -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xservername__|Xorg|g' \
+       -e 's|__xconfigfile__|xorg.conf|g' \
+       -e 's|__projectroot__|\$(prefix)|g' \
+       -e 's|__apploaddir__|\$(appdefaultdir)|g' \
+       -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
+       -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
+       -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
+       -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
+       -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
+       -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
+
+
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=0;;
+esac
+AM_BACKSLASH='\'
+
+
+
+# Checks for pkg-config packages
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XCURSORGEN" >&5
+$as_echo_n "checking for XCURSORGEN... " >&6; }
+
+if test -n "$XCURSORGEN_CFLAGS"; then
+    pkg_cv_XCURSORGEN_CFLAGS="$XCURSORGEN_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xcursor libpng >= 1.2.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "x11 xcursor libpng >= 1.2.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XCURSORGEN_CFLAGS=`$PKG_CONFIG --cflags "x11 xcursor libpng >= 1.2.0" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XCURSORGEN_LIBS"; then
+    pkg_cv_XCURSORGEN_LIBS="$XCURSORGEN_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xcursor libpng >= 1.2.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "x11 xcursor libpng >= 1.2.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XCURSORGEN_LIBS=`$PKG_CONFIG --libs "x11 xcursor libpng >= 1.2.0" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               XCURSORGEN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "x11 xcursor libpng >= 1.2.0" 2>&1`
+        else
+               XCURSORGEN_PKG_ERRORS=`$PKG_CONFIG --print-errors "x11 xcursor libpng >= 1.2.0" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XCURSORGEN_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (x11 xcursor libpng >= 1.2.0) were not met:
+
+$XCURSORGEN_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 XCURSORGEN_CFLAGS
+and XCURSORGEN_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 XCURSORGEN_CFLAGS
+and XCURSORGEN_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+       XCURSORGEN_CFLAGS=$pkg_cv_XCURSORGEN_CFLAGS
+       XCURSORGEN_LIBS=$pkg_cv_XCURSORGEN_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+       cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+         mv -f confcache "$cache_file"$$ &&
+         mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+         mv -f confcache "$cache_file" ;;
+       esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $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}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by xcursorgen $as_me 1.0.4, which was
+generated by GNU Autoconf 2.68.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+xcursorgen config.status 1.0.4
+configured by $0, generated by GNU Autoconf 2.68,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+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=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  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 || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp= ac_tmp=
+  trap 'exit_status=$?
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries 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[        ]*=[    ]*/{
+h
+s///
+s/^/:/
+s/[     ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[  ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[      ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #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.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$ac_tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # 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.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$ac_tmp/stdin"
+  case $ac_file in
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$ac_tmp/config.h" "$ac_file" \
+       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$_am_arg" : 'X\(//\)[^/]' \| \
+        X"$_am_arg" : 'X\(//\)$' \| \
+        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_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=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# 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 || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/xcursorgen/configure.ac b/xcursorgen/configure.ac
new file mode 100755 (executable)
index 0000000..a7d082b
--- /dev/null
@@ -0,0 +1,23 @@
+# $XdotOrg: app/xcursorgen/configure.ac,v 1.7 2005/12/15 00:24:05 kem Exp $
+
+AC_PREREQ([2.60])
+AC_INIT([xcursorgen],
+       [1.0.4],
+       [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
+       [xcursorgen])
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros 1.8 or later: XORG_MANPAGE_SECTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+         [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.8)
+
+AM_CONFIG_HEADER(config.h)
+
+XORG_DEFAULT_OPTIONS
+
+# Checks for pkg-config packages
+PKG_CHECK_MODULES(XCURSORGEN, x11 xcursor libpng >= 1.2.0)
+
+AC_OUTPUT([Makefile])
diff --git a/xcursorgen/depcomp b/xcursorgen/depcomp
new file mode 100755 (executable)
index 0000000..df8eea7
--- /dev/null
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s,\\\\\\\\,/,g"
+   depmode=msvisualcpp
+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.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    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.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[     ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "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"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${
+              s/^ *//
+              s/ \\*$//
+              s/$/:/
+              p
+            }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # 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 mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $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 "X$1" != 'X--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 "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    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.
+    -arch)
+      eat=yes ;;
+    -*|$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 "X$1" != 'X--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.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::     \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # 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
+  ;;
+
+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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xcursorgen/install-sh b/xcursorgen/install-sh
new file mode 100755 (executable)
index 0000000..6781b98
--- /dev/null
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# 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.
+
+nl='
+'
+IFS=" ""       $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+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:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+       shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+       case $mode in
+         *' '* | *'    '* | *'
+'*       | *'*'* | *'?'* | *'['*)
+           echo "$0: invalid mode: $mode" >&2
+           exit 1;;
+       esac
+       shift;;
+
+    -o) chowncmd="$chownprog $2"
+       shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+       shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)        shift
+       break;;
+
+    -*)        echo "$0: invalid option: $1" >&2
+       exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # 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: $dst_arg: Is a directory" >&2
+       exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+       (dirname "$dst") 2>/dev/null ||
+       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+            X"$dst" : 'X\(//\)[^/]' \| \
+            X"$dst" : 'X\(//\)$' \| \
+            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+       echo X"$dst" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+       # Create intermediate dirs using mode 755 as modified by the umask.
+       # This is like FreeBSD 'install' as of 1997-10-28.
+       umask=`umask`
+       case $stripcmd.$umask in
+         # Optimize common cases.
+         *[2367][2367]) mkdir_umask=$umask;;
+         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+         *[0-7])
+           mkdir_umask=`expr $umask + 22 \
+             - $umask % 100 % 40 + $umask % 20 \
+             - $umask % 10 % 4 + $umask % 2
+           `;;
+         *) mkdir_umask=$umask,go-w;;
+       esac
+
+       # With -d, create the new directory with the user-specified mode.
+       # Otherwise, rely on $mkdir_umask.
+       if test -n "$dir_arg"; then
+         mkdir_mode=-m$mode
+       else
+         mkdir_mode=
+       fi
+
+       posix_mkdir=false
+       case $umask in
+         *[123567][0-7][0-7])
+           # POSIX mkdir -p sets u+wx bits regardless of umask, which
+           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+           ;;
+         *)
+           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+           if (umask $mkdir_umask &&
+               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+           then
+             if test -z "$dir_arg" || {
+                  # Check for POSIX incompatibilities with -m.
+                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                  # other-writeable bit of parent directory when it shouldn't.
+                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                  case $ls_ld_tmpdir in
+                    d????-?r-*) different_mode=700;;
+                    d????-?--*) different_mode=755;;
+                    *) false;;
+                  esac &&
+                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                  }
+                }
+             then posix_mkdir=:
+             fi
+             rmdir "$tmpdir/d" "$tmpdir"
+           else
+             # Remove any dirs left behind by ancient mkdir implementations.
+             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+           fi
+           trap '' 0;;
+       esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+       umask $mkdir_umask &&
+       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+       /*) prefix='/';;
+       -*) prefix='./';;
+       *)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+       test -z "$d" && continue
+
+       prefix=$prefix$d
+       if test -d "$prefix"; then
+         prefixes=
+       else
+         if $posix_mkdir; then
+           (umask=$mkdir_umask &&
+            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+           # Don't fail if two instances are running concurrently.
+           test -d "$prefix" || exit 1
+         else
+           case $prefix in
+             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+             *) qprefix=$prefix;;
+           esac
+           prefixes="$prefixes '$qprefix'"
+         fi
+       fi
+       prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+       # Don't fail if two instances are running concurrently.
+       (umask $mkdir_umask &&
+        eval "\$doit_exec \$mkdirprog $prefixes") ||
+         test -d "$dstdir" || exit 1
+       obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # 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
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"    2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+       # Now remove or move aside any old file at destination location.
+       # We try this two ways since rm can't unlink itself on some
+       # systems and the destination file might be busy for other
+       # reasons.  In this case, the final cleanup might fail but the new
+       # file should still install successfully.
+       {
+         test ! -f "$dst" ||
+         $doit $rmcmd -f "$dst" 2>/dev/null ||
+         { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+           { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+         } ||
+         { echo "$0: cannot unlink or rename $dst" >&2
+           (exit 1); exit 1
+         }
+       } &&
+
+       # Now rename the file to the real destination.
+       $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xcursorgen/missing b/xcursorgen/missing
new file mode 100755 (executable)
index 0000000..28055d2
--- /dev/null
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# 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=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+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'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  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]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
+# 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).  This is about non-GNU programs, so use $1 not
+# $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 $program 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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if test ! -f y.tab.h; then
+       echo >y.tab.h
+    fi
+    if test ! -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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if test ! -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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit $?
+    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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+       /^@setfilename/{
+         s/.* \([^ ]*\) *$/\1/
+         p
+         q
+       }' $infile`
+      # ... 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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xcursorgen/xcursorgen.c b/xcursorgen/xcursorgen.c
new file mode 100755 (executable)
index 0000000..daae18b
--- /dev/null
@@ -0,0 +1,440 @@
+/* $XFree86: xc/programs/xcursorgen/xcursorgen.c,v 1.8 2002/11/23 02:33:20 keithp Exp $ */
+/*
+ * xcursorgen.c
+ *
+ * Copyright (C) 2002 Manish Singh
+ *
+ * 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 Manish Singh not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission.  Manish Singh makes no
+ * representations about the suitability of this software for any purpose.  It
+ * is provided "as is" without express or implied warranty.
+ *
+ * MANISH SINGH DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL MANISH SINGH 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 "config.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Xcursor/Xcursor.h>
+
+#include <png.h>
+
+struct flist
+{
+  int size;
+  int xhot, yhot;
+  char *pngfile;
+  int delay;
+  struct flist *next;
+};
+
+static void
+usage (char *name)
+{
+  fprintf (stderr, "usage: %s [-V] [--version] [-?] [--help] [-p <dir>] [--prefix <dir>] [CONFIG [OUT]]\n",
+          name);
+
+  fprintf (stderr, "Generate an Xcursor file from a series of PNG images\n");
+  fprintf (stderr, "\n");
+  fprintf (stderr, "  -V, --version      display the version number and exit\n");
+  fprintf (stderr, "  -?, --help         display this message and exit\n");
+  fprintf (stderr, "  -p, --prefix <dir> find cursor images in <dir>\n");
+  fprintf (stderr, "\n");
+  fprintf (stderr, "With no CONFIG, or when CONFIG is -, read standard input. "
+                  "Same with OUT and\n");
+  fprintf (stderr, "standard output.\n");
+}
+
+static int
+read_config_file (char *config, struct flist **list)
+{
+  FILE *fp;
+  char line[4096], pngfile[4000];
+  int size, xhot, yhot, delay;
+  struct flist *start = NULL, *end = NULL, *curr;
+  int count = 0;
+
+  if (strcmp (config, "-") != 0)
+    {
+      fp = fopen (config, "r");
+      if (!fp)
+       {
+         *list = NULL;
+          return 0;
+       }
+    }
+  else
+    fp = stdin;
+
+  while (fgets (line, sizeof (line), fp) != NULL)
+    {
+      if (line[0] == '#')
+       continue;
+
+      switch (sscanf (line, "%d %d %d %3999s %d", &size, &xhot, &yhot, pngfile, &delay))
+      {
+      case 4:
+       delay = 50;
+       break;
+      case 5:
+       break;
+      default:
+       {
+         fprintf (stderr, "Bad config file data!\n");
+         fclose (fp);
+         return 0;
+       }
+      }
+
+      curr = malloc (sizeof (struct flist));
+      if (curr == NULL)
+       {
+          fprintf (stderr, "malloc() failed\n");
+         fclose (fp);
+          return 0;
+       }
+
+      curr->size = size;
+      curr->xhot = xhot;
+      curr->yhot = yhot;
+
+      curr->delay = delay;
+
+      curr->pngfile = strdup (pngfile);
+      if (curr->pngfile == NULL)
+       {
+          fprintf (stderr, "strdup() failed\n");
+         fclose (fp);
+         free(curr);
+          return 0;
+       }
+
+      curr->next = NULL;
+
+      if (start)
+       {
+         end->next = curr;
+          end = curr;
+       }
+      else
+       {
+         start = curr; 
+          end = curr;
+        }
+
+      count++;
+    }
+
+  fclose (fp);
+
+  *list = start;
+  return count;
+}
+
+#define div_255(x) (((x) + 0x80 + (((x) + 0x80) >> 8)) >> 8)
+
+static void
+premultiply_data (png_structp png, png_row_infop row_info, png_bytep data)
+{
+  int i;
+
+  for (i = 0; i < row_info->rowbytes; i += 4)
+    {
+       unsigned char  *base = &data[i];
+       unsigned char  blue = base[0];
+       unsigned char  green = base[1];
+       unsigned char  red = base[2];
+       unsigned char  alpha = base[3];
+       XcursorPixel   p;
+
+        red = div_255((unsigned)red * (unsigned)alpha);
+       green = div_255((unsigned)green * (unsigned)alpha);
+       blue = div_255((unsigned)blue * (unsigned)alpha);
+       p = (alpha << 24) | (red << 16) | (green << 8) | (blue << 0);
+       memcpy (base, &p, sizeof (XcursorPixel));
+    }
+}
+
+static XcursorImage *
+load_image (struct flist *list, char *prefix)
+{
+  XcursorImage *image;
+  png_structp png;
+  png_infop info;
+  png_bytepp rows;
+  FILE *fp;
+  int i;
+  png_uint_32 width, height;
+  int depth, color, interlace;
+  char *file;
+
+  png = png_create_read_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+  if (png == NULL)
+    return NULL;
+
+  info = png_create_info_struct (png);
+  if (info == NULL)
+    {
+      png_destroy_read_struct (&png, NULL, NULL);
+      return NULL;
+    }
+
+  if (setjmp (png_jmpbuf(png)))
+    {
+      png_destroy_read_struct (&png, &info, NULL);
+      return NULL;
+    }
+
+  if (prefix)
+    {
+      file = malloc (strlen (prefix) + 1 + strlen (list->pngfile) + 1);
+      if (file == NULL)
+       {
+          fprintf (stderr, "malloc() failed\n");
+         png_destroy_read_struct (&png, &info, NULL);
+          return NULL;
+       }
+      strcpy (file, prefix);
+      strcat (file, "/");
+      strcat (file, list->pngfile);
+    }
+  else
+    file = list->pngfile;
+  fp = fopen (file, "rb");
+  if (prefix)
+    free (file);
+
+  if (fp == NULL)
+    {
+      png_destroy_read_struct (&png, &info, NULL);
+      return NULL;
+    }
+
+  png_init_io (png, fp);
+  png_read_info (png, info);
+  png_get_IHDR (png, info, &width, &height, &depth, &color, &interlace,
+               NULL, NULL);
+
+  /* TODO: More needs to be done here maybe */
+
+  if (color == PNG_COLOR_TYPE_PALETTE && depth <= 8)
+    png_set_expand (png);
+
+  if (color == PNG_COLOR_TYPE_GRAY && depth < 8)
+    png_set_expand (png);
+
+  if (png_get_valid (png, info, PNG_INFO_tRNS))
+    png_set_expand (png);
+
+  if (depth == 16)
+    png_set_strip_16 (png);
+
+  if (depth < 8)
+    png_set_packing (png);
+
+  if (color == PNG_COLOR_TYPE_GRAY || color == PNG_COLOR_TYPE_GRAY_ALPHA)
+    png_set_gray_to_rgb (png);
+
+  if (interlace != PNG_INTERLACE_NONE)
+    png_set_interlace_handling (png);
+
+  png_set_bgr (png);
+  png_set_filler (png, 255, PNG_FILLER_AFTER);
+
+  png_set_read_user_transform_fn (png, premultiply_data);
+
+  png_read_update_info (png, info);
+
+  image = XcursorImageCreate (width, height);
+
+  image->size = list->size;
+  image->xhot = list->xhot;
+  image->yhot = list->yhot;
+  image->delay = list->delay;
+
+  rows = malloc (sizeof (png_bytep) * height);
+  if (rows == NULL)
+    {
+      fclose (fp);
+      png_destroy_read_struct (&png, &info, NULL);
+      return NULL;
+    }
+  
+  for (i = 0; i < height; i++)
+    rows[i] = (png_bytep) (image->pixels + i * width);
+
+  png_read_image (png, rows);
+  png_read_end (png, info);
+
+  free (rows);
+  fclose (fp);
+  png_destroy_read_struct (&png, &info, NULL);
+
+  return image;
+}
+
+static int
+write_cursors (int count, struct flist *list, char *filename, char *prefix)
+{
+  XcursorImages *cimages;
+  XcursorImage *image;
+  int i;
+  FILE *fp;
+  int ret;
+
+  if (strcmp (filename, "-") != 0)
+    {
+      fp = fopen (filename, "wb");
+      if (!fp)
+        return 1;
+    }
+  else
+    fp = stdout;
+
+  cimages = XcursorImagesCreate (count);
+
+  cimages->nimage = count;
+
+  for (i = 0; i < count; i++, list = list->next)
+    {
+      image = load_image (list, prefix);
+      if (image == NULL)
+       {
+         fprintf (stderr, "PNG error while reading %s!\n", list->pngfile);
+         fclose(fp);
+         return 1;
+       }
+
+      cimages->images[i] = image;
+    }
+
+  ret = XcursorFileSaveImages (fp, cimages);
+
+  fclose (fp);
+
+  return ret ? 0 : 1;
+}
+
+static int
+check_image (char *image)
+{
+  unsigned int width, height;
+  unsigned char *data;
+  int x_hot, y_hot;
+  XImage ximage;
+  unsigned char hash[XCURSOR_BITMAP_HASH_SIZE];
+  int i;
+
+  if (XReadBitmapFileData (image, &width, &height, &data, &x_hot, &y_hot) != BitmapSuccess)
+  {
+    fprintf (stderr, "Can't open bitmap file \"%s\"\n", image);
+    return 1;
+  }
+  ximage.height = height;
+  ximage.width = width;
+  ximage.depth = 1;
+  ximage.bits_per_pixel = 1;
+  ximage.xoffset = 0;
+  ximage.format = XYPixmap;
+  ximage.data = (char *)data;
+  ximage.byte_order = LSBFirst;
+  ximage.bitmap_unit = 8;
+  ximage.bitmap_bit_order = LSBFirst;
+  ximage.bitmap_pad = 8;
+  ximage.bytes_per_line = (width+7)/8;
+  XcursorImageHash (&ximage, hash);
+  printf ("%s: ", image);
+  for (i = 0; i < XCURSOR_BITMAP_HASH_SIZE; i++)
+    printf ("%02x", hash[i]);
+  printf ("\n");
+  return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+  struct flist *list;
+  int count;
+  char *in = NULL, *out = NULL;
+  char *prefix = NULL;
+  int i;
+
+  for (i = 1; i < argc; i++)
+    {
+      if (strcmp (argv[i], "-V") == 0 || strcmp (argv[i], "--version") == 0)
+        {
+          printf ("xcursorgen version %s\n", PACKAGE_VERSION);
+          return 0;
+        }
+
+      if (strcmp (argv[i], "-?") == 0 || strcmp (argv[i], "--help") == 0)
+        {
+          usage (argv[0]);
+          return 0;
+        }
+      if (strcmp (argv[i], "-image") == 0)
+        {
+         int i = 2;
+         int ret = 0;
+         while (argv[i])
+         {
+           if (check_image (argv[i]))
+             ret = i;
+           i++;
+         }
+         return ret;
+       }
+      if (strcmp (argv[i], "-p") == 0 || strcmp (argv[i], "--prefix") == 0)
+        {
+         i++;
+         if (argv[i] == NULL)
+           {
+             usage (argv[0]);
+             return 1;
+           }
+         prefix = argv[i];
+         continue;
+        }
+
+      if (!in)
+       in = argv[i];
+      else if (!out)
+       out = argv[i];
+      else
+      {
+       usage (argv[0]);
+       return 1;
+      }
+    }
+
+  if (!in)
+    in = "-";
+  if (!out)
+    out = "-";
+
+  count = read_config_file (in, &list);
+  if (count == 0)
+    {
+      fprintf (stderr, "Error reading config file!\n");
+      return 1;
+    }
+
+  return write_cursors (count, list, out, prefix);
+}
diff --git a/xcursorgen/xcursorgen.man b/xcursorgen/xcursorgen.man
new file mode 100755 (executable)
index 0000000..df41d14
--- /dev/null
@@ -0,0 +1,64 @@
+.\"
+.\" Copyright 2002 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.
+.\"
+.\"
+.\" $XFree86: xc/programs/xcursorgen/xcursorgen.man,v 1.1 2002/09/03 06:48:28 keithp Exp $
+.\"
+.TH XCURSORGEN __appmansuffix__ __vendorversion__
+.SH NAME
+xcursorgen \- create an X cursor file from a collection of PNG images
+.SH SYNOPSIS
+.B "xcursorgen"
+[ \fB\-V\fP ] [ \fB\-\-version\fP ] [ \fB\-?\fP ] [ \fB\-\-help\fP ]
+[ \fB\-p\fP \fIdir\fP ] [ \fB\-\-prefix\fP \fIdir\fP ]
+.RI "[ " config-file
+.RI "[ " output-file " ] ]"
+.SH DESCRIPTION
+Xcursorgen reads the \fIconfig-file\fP to find the list of cursor images along
+with their hotspot and nominal size information.  Xcursorgen converts all of
+the images to Xcursor format and writes them to the \fIoutput-file\fP.
+.P
+Each line in the config file is of the form:
+.br
+<size> <xhot> <yhot> <filename> <ms-delay>
+.br
+.P
+Multiple images with the same <size> are used to create animated cursors,
+the <ms-delay> value on each line indicates how long each image should be
+displayed before switching to the next.  <ms-delay> can be elided for static
+cursors.
+.P
+If \fIconfig-file\fP is not specified, or is specified as "-",
+standard input is used for the configuration file.
+If \fIoutput-file\fP is not specified, or is specified as "-",
+standard output is used for the output file.
+.SH OPTIONS
+.TP 8
+.BR \-V ", " \-\-version
+Display the version number and exit.
+.TP 8
+.BR \-? ", " \-\-help
+Display the usage message and exit.
+.TP 8
+.BR "\-p \fIdir\fP" ", " "\-\-prefix \fIdir\fP"
+Find cursor images in the directory specified by \fIdir\fP.   If not specified,
+the current directory is used.
+.SH "SEE ALSO"
+Xcursor(__libmansuffix__)
diff --git a/xditview/AUTHORS b/xditview/AUTHORS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xditview/COPYING b/xditview/COPYING
new file mode 100644 (file)
index 0000000..7f33cbf
--- /dev/null
@@ -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/xditview/ChangeLog b/xditview/ChangeLog
new file mode 100644 (file)
index 0000000..f782e91
--- /dev/null
@@ -0,0 +1,31 @@
+2005-12-20  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * configure.ac:
+       Update package version for X11R7 release.
+
+2005-12-14  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * configure.ac:
+       Update package version number for final X11R7 release candidate.
+
+2005-12-07  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * Makefile.am:
+       * configure.ac:
+       Change to use the app-defaults default dir configured in libXt.
+
+2005-12-06  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * Makefile.am:
+       Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+2005-12-03  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * configure.ac:
+       Update package version number for X11R7 RC3 release.
+
+2005-10-18  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * configure.ac:
+       Update package version number for RC1 release.
+
diff --git a/xditview/Dvi.c b/xditview/Dvi.c
new file mode 100644 (file)
index 0000000..75d127f
--- /dev/null
@@ -0,0 +1,559 @@
+/* $XConsortium: Dvi.c,v 1.21 94/04/17 20:43:34 keith Exp $ */
+/* $XdotOrg: $ */
+/*
+
+Copyright (c) 1991  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86: xc/programs/xditview/Dvi.c,v 1.3 2001/08/01 00:45:03 tsi Exp $ */
+
+
+/*
+ * Dvi.c - Dvi display widget
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#define XtStrlen(s)    ((s) ? strlen(s) : 0)
+
+  /* The following are defined for the reader's convenience.  Any
+     Xt..Field macro in this code just refers to some field in
+     one of the substructures of the WidgetRec.  */
+
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <X11/Xmu/Converters.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <ctype.h>
+#include "DviP.h"
+
+/****************************************************************
+ *
+ * Full class record constant
+ *
+ ****************************************************************/
+
+/* Private Data */
+/* Note: default_font_map was too long a token for some machines...
+ *       therefor it has been split in to and assigned to resources
+ *       in the ClassInitialize routine.
+ */
+static char default_font_map_1[] =  "\
+R      -*-times-medium-r-normal--*-*-*-*-*-*-iso8859-1\n\
+I      -*-times-medium-i-normal--*-*-*-*-*-*-iso8859-1\n\
+B      -*-times-bold-r-normal--*-*-*-*-*-*-iso8859-1\n\
+F      -*-times-bold-i-normal--*-*-*-*-*-*-iso8859-1\n\
+TR     -*-times-medium-r-normal--*-*-*-*-*-*-iso8859-1\n\
+TI     -*-times-medium-i-normal--*-*-*-*-*-*-iso8859-1\n\
+TB     -*-times-bold-r-normal--*-*-*-*-*-*-iso8859-1\n\
+TF     -*-times-bold-i-normal--*-*-*-*-*-*-iso8859-1\n\
+BI     -*-times-bold-i-normal--*-*-*-*-*-*-iso8859-1\n\
+C      -*-courier-medium-r-normal--*-*-*-*-*-*-iso8859-1\n\
+CO     -*-courier-medium-o-normal--*-*-*-*-*-*-iso8859-1\n\
+CB     -*-courier-bold-r-normal--*-*-*-*-*-*-iso8859-1\n\
+CF     -*-courier-bold-o-normal--*-*-*-*-*-*-iso8859-1\n\
+H      -*-helvetica-medium-r-normal--*-*-*-*-*-*-iso8859-1\n\
+HO     -*-helvetica-medium-o-normal--*-*-*-*-*-*-iso8859-1\n\
+HB     -*-helvetica-bold-r-normal--*-*-*-*-*-*-iso8859-1\n\
+HF     -*-helvetica-bold-o-normal--*-*-*-*-*-*-iso8859-1\n\
+";
+static char default_font_map_2[] =  "\
+N      -*-new century schoolbook-medium-r-normal--*-*-*-*-*-*-iso8859-1\n\
+NI     -*-new century schoolbook-medium-i-normal--*-*-*-*-*-*-iso8859-1\n\
+NB     -*-new century schoolbook-bold-r-normal--*-*-*-*-*-*-iso8859-1\n\
+NF     -*-new century schoolbook-bold-i-normal--*-*-*-*-*-*-iso8859-1\n\
+A      -*-charter-medium-r-normal--*-*-*-*-*-*-iso8859-1\n\
+AI     -*-charter-medium-i-normal--*-*-*-*-*-*-iso8859-1\n\
+AB     -*-charter-bold-r-normal--*-*-*-*-*-*-iso8859-1\n\
+AF     -*-charter-bold-i-normal--*-*-*-*-*-*-iso8859-1\n\
+S      -*-symbol-medium-r-normal--*-*-*-*-*-*-adobe-fontspecific\n\
+S2     -*-symbol-medium-r-normal--*-*-*-*-*-*-adobe-fontspecific\n\
+";
+
+#define offset(field) XtOffsetOf(DviRec, field)
+
+static XtResource resources[] = { 
+       {XtNfontMap, XtCFontMap, XtRString, sizeof (char *),
+        offset(dvi.font_map_string), XtRString, NULL /* set in code */},
+       {XtNforeground, XtCForeground, XtRPixel, sizeof (unsigned long),
+        offset(dvi.foreground), XtRString, XtDefaultForeground},
+       {XtNpageNumber, XtCPageNumber, XtRInt, sizeof (int),
+        offset(dvi.requested_page), XtRImmediate, (XtPointer) 1},
+       {XtNlastPageNumber, XtCLastPageNumber, XtRInt, sizeof (int),
+        offset (dvi.last_page), XtRImmediate, (XtPointer) 0},
+       {XtNfile, XtCFile, XtRFile, sizeof (FILE *),
+        offset (dvi.file), XtRFile, (char *) 0},
+       {XtNseek, XtCSeek, XtRBoolean, sizeof (Boolean),
+        offset(dvi.seek), XtRImmediate, (XtPointer) False},
+       {XtNfont, XtCFont, XtRFontStruct, sizeof (XFontStruct *),
+        offset(dvi.default_font), XtRString, XtDefaultFont},
+       {XtNbackingStore, XtCBackingStore, XtRBackingStore, sizeof (int),
+        offset(dvi.backing_store), XtRString, "default"},
+       {XtNnoPolyText, XtCNoPolyText, XtRBoolean, sizeof (Boolean),
+        offset(dvi.noPolyText), XtRImmediate, (XtPointer) False},
+       {XtNscreenResolution, XtCScreenResolution, XtRInt, sizeof (int),
+        offset(dvi.screen_resolution), XtRImmediate, (XtPointer) 75},
+       {XtNpageWidth, XtCPageWidth, XtRFloat, sizeof (float),
+        offset(dvi.page_width), XtRString, "8.5"},
+       {XtNpageHeight, XtCPageHeight, XtRFloat, sizeof (float),
+        offset(dvi.page_height), XtRString, "11"},
+       {XtNsizeScale, XtCSizeScale, XtRInt, sizeof (int),
+        offset(dvi.size_scale_set), XtRImmediate, (XtPointer) 0},
+};
+
+#undef offset
+
+static void            ClassInitialize(void);
+static void            Initialize(Widget, Widget, ArgList, Cardinal *);
+static void            Realize(Widget, XtValueMask *, XSetWindowAttributes *);
+static void            Destroy(Widget);
+static void            Redisplay(Widget, XEvent *, Region);
+static Boolean         SetValues(Widget, Widget, Widget, ArgList , Cardinal *);
+static Boolean         SetValuesHook(Widget, ArgList, Cardinal *);
+static XtGeometryResult        QueryGeometry(Widget,
+                                     XtWidgetGeometry *, XtWidgetGeometry *);
+static void            RequestDesiredSize(DviWidget);
+static void            ShowDvi(DviWidget);
+static void            CloseFile(DviWidget);
+static void            OpenFile(DviWidget);
+
+#define SuperClass ((SimpleWidgetClass)&simpleClassRec)
+
+DviClassRec dviClassRec = {
+{
+       (WidgetClass) SuperClass,       /* superclass             */    
+       "Dvi",                          /* class_name             */
+       sizeof(DviRec),                 /* size                   */
+       ClassInitialize,                /* class_initialize       */
+       NULL,                           /* class_part_initialize  */
+       FALSE,                          /* class_inited           */
+       Initialize,                     /* initialize             */
+       NULL,                           /* initialize_hook        */
+       Realize,                        /* realize                */
+       NULL,                           /* actions                */
+       0,                              /* num_actions            */
+       resources,                      /* resources              */
+       XtNumber(resources),            /* resource_count         */
+       NULLQUARK,                      /* xrm_class              */
+       FALSE,                          /* compress_motion        */
+       XtExposeCompressMaximal,        /* compress_exposure      */
+       TRUE,                           /* compress_enterleave    */
+       FALSE,                          /* visible_interest       */
+       Destroy,                        /* destroy                */
+       NULL,                           /* resize                 */
+       Redisplay,                      /* expose                 */
+       SetValues,                      /* set_values             */
+       SetValuesHook,                  /* set_values_hook        */
+       XtInheritSetValuesAlmost,       /* set_values_almost      */
+       NULL,                           /* get_values_hook        */
+       NULL,                           /* accept_focus           */
+       XtVersion,                      /* version                */
+       NULL,                           /* callback_private       */
+       0,                              /* tm_table               */
+       QueryGeometry,                  /* query_geometry         */
+       XtInheritDisplayAccelerator,    /* display_accelerator    */
+       NULL,                           /* extension              */
+},  /* CoreClass fields initialization */
+{
+    XtInheritChangeSensitive           /* change_sensitive     */
+},  /* SimpleClass fields initialization */
+{
+    0,                                     /* field not used    */
+},  /* DviClass fields initialization */
+};
+
+WidgetClass dviWidgetClass = (WidgetClass) &dviClassRec;
+
+static void
+ClassInitialize (void)
+{
+  int len1 = strlen(default_font_map_1);
+  int len2 = strlen(default_font_map_2);
+  char *dfm = XtMalloc(len1 + len2 + 1);
+  char *ptr = dfm;
+  strcpy(ptr, default_font_map_1); ptr += len1;
+  strcpy(ptr, default_font_map_2); 
+  resources[0].default_addr = dfm;
+
+  XtAddConverter( XtRString, XtRBackingStore, XmuCvtStringToBackingStore,
+                NULL, 0 );
+}
+
+/****************************************************************
+ *
+ * Private Procedures
+ *
+ ****************************************************************/
+
+/* ARGSUSED */
+static void
+Initialize(request, new, args, num_args)
+       Widget request, new;
+       ArgList args;
+       Cardinal *num_args;
+{
+    DviWidget  dw = (DviWidget) new;
+
+    dw->dvi.tmpFile = 0;
+    dw->dvi.readingTmp = 0;
+    dw->dvi.ungot = 0;
+    dw->dvi.normal_GC = 0;
+    dw->dvi.file_map = 0;
+    dw->dvi.fonts = 0;
+    dw->dvi.font_map = 0;
+    dw->dvi.current_page = 0;
+    dw->dvi.font_size = 0;
+    dw->dvi.font_number = 0;
+    dw->dvi.device_resolution = 0;
+    dw->dvi.line_width = 0;
+    dw->dvi.line_style = 0;
+    dw->dvi.font = 0;
+    dw->dvi.display_enable = 0;
+    dw->dvi.scale = 0.0;
+    dw->dvi.state = 0;
+    dw->dvi.cache.index = 0;
+    dw->dvi.cache.font = 0; 
+    dw->dvi.size_scale = 0;
+    dw->dvi.size_scale_set = 0;
+    RequestDesiredSize (dw);
+}
+
+static void
+Realize(w, valueMask, attrs)
+       Widget                  w;
+       XtValueMask             *valueMask;
+       XSetWindowAttributes    *attrs;
+{
+    DviWidget  dw = (DviWidget) w;
+    XGCValues  values;
+
+    if (dw->dvi.backing_store != Always + WhenMapped + NotUseful) {
+       attrs->backing_store = dw->dvi.backing_store;
+       *valueMask |= CWBackingStore;
+    }
+    XtCreateWindow (w, (unsigned)InputOutput, (Visual *) CopyFromParent,
+                   *valueMask, attrs);
+    values.foreground = dw->dvi.foreground;
+    dw->dvi.normal_GC = XCreateGC (XtDisplay (w), XtWindow (w),
+                                   GCForeground, &values);
+#ifdef USE_XFT
+    {
+       int             scr;
+       Visual          *visual;
+       Colormap        cmap;
+       XRenderColor    black;
+
+       scr = XScreenNumberOfScreen (dw->core.screen);
+       visual = DefaultVisual (XtDisplay (w), scr);
+       cmap = DefaultColormap (XtDisplay (w), scr);
+       dw->dvi.draw = XftDrawCreate (XtDisplay (w), XtWindow (w), 
+                                     visual, cmap);
+
+       black.red = black.green = black.blue = 0;
+       black.alpha = 0xffff;
+       XftColorAllocValue (XtDisplay (w), visual, cmap,
+                           &black, &dw->dvi.black);
+       dw->dvi.default_font = XftFontOpenName (XtDisplay (w),
+                                               scr,
+                                               "serif-12");
+    }
+#endif
+    if (dw->dvi.file)
+       OpenFile (dw);
+    ParseFontMap (dw);
+}
+
+static void
+Destroy(w)
+       Widget w;
+{
+       DviWidget       dw = (DviWidget) w;
+
+       XFreeGC (XtDisplay (w), dw->dvi.normal_GC);
+       DestroyFontMap (dw->dvi.font_map);
+       DestroyFileMap (dw->dvi.file_map);
+}
+
+/*
+ * Repaint the widget window
+ */
+
+/* ARGSUSED */
+static void
+Redisplay(w, event, region)
+       Widget w;
+       XEvent *event;
+       Region region;
+{
+       DviWidget       dw = (DviWidget) w;
+#ifndef USE_XFT
+       XRectangle      extents;
+#endif
+       
+#ifdef USE_XFT
+       XClearArea (XtDisplay (dw),
+                   XtWindow (dw),
+                   0, 0, 0, 0, False);
+       dw->dvi.extents.x1 = 0;
+       dw->dvi.extents.y1 = 0;
+       dw->dvi.extents.x2 = dw->core.width;
+       dw->dvi.extents.y2 = dw->core.height;
+#else
+       XClipBox (region, &extents);
+       dw->dvi.extents.x1 = extents.x;
+       dw->dvi.extents.y1 = extents.y;
+       dw->dvi.extents.x2 = extents.x + extents.width;
+       dw->dvi.extents.y2 = extents.y + extents.height;
+#endif
+       ShowDvi (dw);
+}
+
+static void
+RequestDesiredSize (dw)
+    DviWidget  dw;
+{
+    XtWidgetGeometry   req, rep;
+
+    dw->dvi.desired_width = dw->dvi.page_width *
+                                dw->dvi.screen_resolution;
+    dw->dvi.desired_height = dw->dvi.page_height *
+                                 dw->dvi.screen_resolution;
+    req.request_mode = CWWidth|CWHeight;
+    req.width = dw->dvi.desired_width;
+    req.height = dw->dvi.desired_height;
+    XtMakeGeometryRequest ((Widget) dw, &req, &rep);
+}
+
+/*
+ * Set specified arguments into widget
+ */
+/* ARGSUSED */
+static Boolean
+SetValues (wcurrent, wrequest, wnew, args, num_args)
+       Widget wcurrent, wrequest, wnew;
+       ArgList args;
+       Cardinal *num_args;
+{
+    DviWidget  current = (DviWidget) wcurrent;
+    DviWidget  request = (DviWidget) wrequest;
+    DviWidget  new     = (DviWidget) wnew;
+    Boolean    redisplay = FALSE;
+    char       *new_map;
+    int                cur, req;
+
+    req = request->dvi.requested_page;
+    cur = current->dvi.requested_page;
+    if (cur != req) {
+           if (req < 1)
+               req = 1;
+           if (request->dvi.file)
+           {
+               if (current->dvi.last_page != 0 &&
+                   req > current->dvi.last_page)
+                       req = current->dvi.last_page;
+           }
+           if (cur != req)
+               redisplay = TRUE;
+           new->dvi.requested_page = req;
+    }
+    
+    if (current->dvi.font_map_string != request->dvi.font_map_string) {
+           new_map = XtMalloc (strlen (request->dvi.font_map_string) + 1);
+           if (new_map) {
+                   redisplay = TRUE;
+                   strcpy (new_map, request->dvi.font_map_string);
+                   new->dvi.font_map_string = new_map;
+                   if (current->dvi.font_map_string)
+                           XtFree (current->dvi.font_map_string);
+                   current->dvi.font_map_string = 0;
+                   ParseFontMap (new);
+           }
+    }
+    if (current->dvi.screen_resolution != request->dvi.screen_resolution)
+    {
+       ResetFonts (new);
+       new->dvi.line_width = -1;
+    }
+    if (request->dvi.device_resolution)
+       new->dvi.scale = ((double) request->dvi.screen_resolution) /
+                            ((double) request->dvi.device_resolution);
+    if (current->dvi.page_width !=  request->dvi.page_width ||
+       current->dvi.page_height != request->dvi.page_height ||
+       current->dvi.screen_resolution != request->dvi.screen_resolution)
+    {
+       RequestDesiredSize (new);
+       redisplay = TRUE;
+    }
+    return redisplay;
+}
+
+/*
+ * use the set_values_hook entry to check when
+ * the file is set
+ */
+
+static Boolean
+SetValuesHook (widget, args, num_argsp)
+       Widget          widget;
+       ArgList         args;
+       Cardinal        *num_argsp;
+{
+       DviWidget       dw = (DviWidget) widget;
+       Cardinal        i;
+
+       for (i = 0; i < *num_argsp; i++) {
+               if (!strcmp (args[i].name, XtNfile)) {
+                       CloseFile (dw);
+                       OpenFile (dw);
+                       return TRUE;
+               }
+       }
+       return FALSE;
+}
+
+static void
+CloseFile (dw)
+       DviWidget       dw;
+{
+    if (dw->dvi.tmpFile)
+       fclose (dw->dvi.tmpFile);
+    ForgetPagePositions (dw);
+}
+
+static void
+OpenFile (dw)
+       DviWidget       dw;
+{
+    char       tmpName[sizeof ("/tmp/dviXXXXXX")];
+#ifdef HAS_MKSTEMP
+    int fd;
+#endif
+
+    dw->dvi.tmpFile = 0;
+    if (!dw->dvi.seek) {
+       strcpy (tmpName, "/tmp/dviXXXXXX");
+#ifndef HAS_MKSTEMP
+       mktemp (tmpName);
+       dw->dvi.tmpFile = fopen (tmpName, "w+");
+#else
+       fd = mkstemp(tmpName);
+       dw->dvi.tmpFile = fdopen(fd, "w+");
+#endif
+       unlink (tmpName);
+    }
+    if (dw->dvi.requested_page < 1)
+       dw->dvi.requested_page = 1;
+    dw->dvi.last_page = 0;
+}
+
+static XtGeometryResult
+QueryGeometry (w, request, geometry_return)
+       Widget                  w;
+       XtWidgetGeometry        *request, *geometry_return;
+{
+       XtGeometryResult        ret;
+       DviWidget               dw = (DviWidget) w;
+
+       ret = XtGeometryYes;
+       if ((int)request->width < dw->dvi.desired_width
+           || (int)request->height < dw->dvi.desired_height)
+               ret = XtGeometryAlmost;
+       geometry_return->width = dw->dvi.desired_width;
+       geometry_return->height = dw->dvi.desired_height;
+       geometry_return->request_mode = CWWidth|CWHeight;
+       return ret;
+}
+
+void
+SetDeviceResolution (dw, resolution)
+       DviWidget   dw;
+       int         resolution;
+{
+    if (resolution != dw->dvi.device_resolution) {
+       dw->dvi.device_resolution = resolution;
+       dw->dvi.scale = ((double)  dw->dvi.screen_resolution) /
+                       ((double) resolution);
+    }
+}
+
+static void
+ShowDvi (dw)
+       DviWidget       dw;
+{
+       int     i;
+       long    file_position;
+
+       if (!dw->dvi.file) 
+         return;
+
+       if (dw->dvi.requested_page < 1)
+               dw->dvi.requested_page = 1;
+
+       if (dw->dvi.last_page != 0 && dw->dvi.requested_page > dw->dvi.last_page)
+               dw->dvi.requested_page = dw->dvi.last_page;
+
+       file_position = SearchPagePosition (dw, dw->dvi.requested_page);
+       if (file_position != -1) {
+               FileSeek(dw, file_position);
+               dw->dvi.current_page = dw->dvi.requested_page;
+       } else {
+               for (i=dw->dvi.requested_page; i > 0; i--) {
+                       file_position = SearchPagePosition (dw, i);
+                       if (file_position != -1)
+                               break;
+               }
+               if (file_position == -1)
+                       file_position = 0;
+               FileSeek (dw, file_position);
+
+               dw->dvi.current_page = i;
+               
+               dw->dvi.display_enable = 0;
+               while (dw->dvi.current_page != dw->dvi.requested_page) {
+                       dw->dvi.current_page = ParseInput (dw);
+                       /*
+                        * at EOF, seek back to the begining of this page.
+                        */
+                       if (feof (dw->dvi.file)) {
+                               file_position = SearchPagePosition (dw,
+                                               dw->dvi.current_page);
+                               if (file_position != -1)
+                                       FileSeek (dw, file_position);
+                               break;
+                       }
+               }
+       }
+       
+       dw->dvi.display_enable = 1;
+       ParseInput (dw);
+       if (dw->dvi.last_page && dw->dvi.requested_page > dw->dvi.last_page)
+               dw->dvi.requested_page = dw->dvi.last_page;
+}
diff --git a/xditview/Dvi.h b/xditview/Dvi.h
new file mode 100644 (file)
index 0000000..95311fa
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+* $XConsortium: Dvi.h,v 1.5 91/07/25 21:33:53 keith Exp $
+*/
+/* $XFree86$ */
+
+#ifndef _XtDvi_h
+#define _XtDvi_h
+
+/***********************************************************************
+ *
+ * Dvi Widget
+ *
+ ***********************************************************************/
+
+/* Parameters:
+
+ Name               Class              RepType         Default Value
+ ----               -----              -------         -------------
+ background         Background         pixel           White
+ foreground         Foreground         Pixel           Black
+ fontMap            FontMap            char *          ...
+ pageNumber         PageNumber         int             1
+*/
+
+#define XtNfontMap     "fontMap"
+#define XtNpageNumber  "pageNumber"
+#define XtNlastPageNumber   "lastPageNumber"
+#define XtNnoPolyText  "noPolyText"
+#define XtNseek                "seek"
+#define XtNscreenResolution "screenResolution"
+#define XtNpageWidth   "pageWidth"
+#define XtNpageHeight  "pageHeight"
+#define XtNsizeScale   "sizeScale"
+
+#define XtCFontMap     "FontMap"
+#define XtCPageNumber  "PageNumber"
+#define XtCLastPageNumber   "LastPageNumber"
+#define XtCNoPolyText  "NoPolyText"
+#define XtCSeek                "Seek"
+#define XtCScreenResolution "ScreenResolution"
+#define XtCPageWidth   "PageWidth"
+#define XtCPageHeight  "PageHeight"
+#define XtCSizeScale   "SizeScale"
+
+typedef struct _DviRec *DviWidget;  /* completely defined in DviPrivate.h */
+typedef struct _DviClassRec *DviWidgetClass;    /* completely defined in DviPrivate.h */
+
+extern WidgetClass dviWidgetClass;
+
+#endif /* _XtDvi_h */
+/* DON'T ADD STUFF AFTER THIS #endif */
diff --git a/xditview/DviChar.c b/xditview/DviChar.c
new file mode 100644 (file)
index 0000000..3718c74
--- /dev/null
@@ -0,0 +1,678 @@
+/* $XConsortium: DviChar.c,v 1.7 91/07/31 00:39:31 keith Exp $ */
+
+/*
+ * DviChar.c
+ *
+ * Map DVI (ditrof output) character names to
+ * font indexes and back
+ */
+/* $XFree86$ */
+
+# include   <X11/Intrinsic.h>
+# include   "DviChar.h"
+
+# define allocHash()   ((DviCharNameHash *) XtMalloc (sizeof (DviCharNameHash)))
+
+struct map_list {
+       struct map_list *next;
+       DviCharNameMap  *map;
+};
+
+static struct map_list *world;
+
+static int     standard_maps_loaded = 0;
+static void    load_standard_maps (void);
+static int     hash_name (char *name);
+static void    dispose_hash(DviCharNameMap *map);
+static void    compute_hash(DviCharNameMap *map);
+
+DviCharNameMap *
+DviFindMap (encoding)
+       char    *encoding;
+{
+       struct map_list *m;
+
+       if (!standard_maps_loaded)
+               load_standard_maps ();
+       for (m = world; m; m=m->next)
+               if (!strcmp (m->map->encoding, encoding))
+                       return m->map;
+       return 0;
+}
+
+void
+DviRegisterMap (map)
+       DviCharNameMap  *map;
+{
+       struct map_list *m;
+
+       if (!standard_maps_loaded)
+               load_standard_maps ();
+       for (m = world; m; m = m->next)
+               if (!strcmp (m->map->encoding, map->encoding))
+                       break;
+       if (!m) {
+               m = (struct map_list *) XtMalloc (sizeof *m);
+               m->next = world;
+               world = m;
+       }
+       dispose_hash (map);
+       m->map = map;
+       compute_hash (map);
+}
+
+static void
+dispose_hash (map)
+       DviCharNameMap  *map;
+{
+       DviCharNameHash **buckets;
+       DviCharNameHash *h, *next;
+       int             i;
+
+       buckets = map->buckets;
+       for (i = 0; i < DVI_HASH_SIZE; i++) {
+               for (h = buckets[i]; h; h=next) {
+                       next = h->next;
+                       XtFree ((char *) h);
+               }
+       }
+}
+
+static int
+hash_name (name)
+       char    *name;
+{
+       int     i = 0;
+
+       while (*name)
+               i = (i << 1) ^ *name++;
+       if (i < 0)
+               i = -i;
+       return i;
+}
+
+static void
+compute_hash (map)
+       DviCharNameMap  *map;
+{
+       DviCharNameHash **buckets;
+       int             c, s, i;
+       DviCharNameHash *h;
+
+       buckets = map->buckets;
+       for (i = 0; i < DVI_HASH_SIZE; i++)
+               buckets[i] = 0;
+       for (c = 0; c < DVI_MAP_SIZE; c++)
+               for (s = 0; s < DVI_MAX_SYNONYMS; s++) {
+                       if (!map->dvi_names[c][s])
+                               break;
+                       i = hash_name (map->dvi_names[c][s]) % DVI_HASH_SIZE;
+                       h = allocHash ();
+                       h->next = buckets[i];
+                       buckets[i] = h;
+                       h->name = map->dvi_names[c][s];
+                       h->position = c;
+               }
+       
+}
+
+int
+DviCharIndex (map, name)
+       DviCharNameMap  *map;
+       char            *name;
+{
+       int             i;
+       DviCharNameHash *h;
+
+       i = hash_name (name) % DVI_HASH_SIZE;
+       for (h = map->buckets[i]; h; h=h->next)
+               if (!strcmp (h->name, name))
+                       return h->position;
+       return -1;
+}
+
+static DviCharNameMap ISO8859_1_map = {
+       "iso8859-1",
+       0,
+{
+{      0,              /* 0 */},
+{      0,              /* 1 */},
+{      0,              /* 2 */},
+{      0,              /* 3 */},
+{      0,              /* 4 */},
+{      0,              /* 5 */},
+{      0,              /* 6 */},
+{      0,              /* 7 */},
+{      0,              /* 8 */},
+{      0,              /* 9 */},
+{      0,              /* 10 */},
+{      0,              /* 11 */},
+{      0,              /* 12 */},
+{      0,              /* 13 */},
+{      0,              /* 14 */},
+{      0,              /* 15 */},
+{      0,              /* 16 */},
+{      0,              /* 17 */},
+{      0,              /* 18 */},
+{      0,              /* 19 */},
+{      0,              /* 20 */},
+{      0,              /* 21 */},
+{      0,              /* 22 */},
+{      0,              /* 23 */},
+{      0,              /* 24 */},
+{      0,              /* 25 */},
+{      0,              /* 26 */},
+{      0,              /* 27 */},
+{      0,              /* 28 */},
+{      0,              /* 29 */},
+{      0,              /* 30 */},
+{      0,              /* 31 */},
+{      0,              /* 32 */},
+{      "!",            /* 33 */},
+{      "\"",           /* 34 */},
+{      "#",            /* 35 */},
+{      "$",            /* 36 */},
+{      "%",            /* 37 */},
+{      "&",            /* 38 */},
+{      "'",            /* 39 */},
+{      "(",            /* 40 */},
+{      ")",            /* 41 */},
+{      "*",            /* 42 */},
+{      "+",            /* 43 */},
+{      ",",            /* 44 */},
+{      "-","\\-",      /* 45 */},
+{      ".",            /* 46 */},
+{      "/","sl",       /* 47 */},
+{      "0",            /* 48 */},
+{      "1",            /* 49 */},
+{      "2",            /* 50 */},
+{      "3",            /* 51 */},
+{      "4",            /* 52 */},
+{      "5",            /* 53 */},
+{      "6",            /* 54 */},
+{      "7",            /* 55 */},
+{      "8",            /* 56 */},
+{      "9",            /* 57 */},
+{      ":",            /* 58 */},
+{      ";",            /* 59 */},
+{      "<",            /* 60 */},
+{      "=","eq",       /* 61 */},
+{      ">",            /* 62 */},
+{      "?",            /* 63 */},
+{      "@",            /* 64 */},
+{      "A",            /* 65 */},
+{      "B",            /* 66 */},
+{      "C",            /* 67 */},
+{      "D",            /* 68 */},
+{      "E",            /* 69 */},
+{      "F",            /* 70 */},
+{      "G",            /* 71 */},
+{      "H",            /* 72 */},
+{      "I",            /* 73 */},
+{      "J",            /* 74 */},
+{      "K",            /* 75 */},
+{      "L",            /* 76 */},
+{      "M",            /* 77 */},
+{      "N",            /* 78 */},
+{      "O",            /* 79 */},
+{      "P",            /* 80 */},
+{      "Q",            /* 81 */},
+{      "R",            /* 82 */},
+{      "S",            /* 83 */},
+{      "T",            /* 84 */},
+{      "U",            /* 85 */},
+{      "V",            /* 86 */},
+{      "W",            /* 87 */},
+{      "X",            /* 88 */},
+{      "Y",            /* 89 */},
+{      "Z",            /* 90 */},
+{      "[",            /* 91 */},
+{      "\\",           /* 92 */},
+{      "]",            /* 93 */},
+{      "a^",           /* 94 */},
+{      "_","ru","ul",  /* 95 */},
+{      "`",            /* 96 */},
+{      "a",            /* 97 */},
+{      "b",            /* 98 */},
+{      "c",            /* 99 */},
+{      "d",            /* 100 */},
+{      "e",            /* 101 */},
+{      "f",            /* 102 */},
+{      "g",            /* 103 */},
+{      "h",            /* 104 */},
+{      "i",            /* 105 */},
+{      "j",            /* 106 */},
+{      "k",            /* 107 */},
+{      "l",            /* 108 */},
+{      "m",            /* 109 */},
+{      "n",            /* 110 */},
+{      "o",            /* 111 */},
+{      "p",            /* 112 */},
+{      "q",            /* 113 */},
+{      "r",            /* 114 */},
+{      "s",            /* 115 */},
+{      "t",            /* 116 */},
+{      "u",            /* 117 */},
+{      "v",            /* 118 */},
+{      "w",            /* 119 */},
+{      "x",            /* 120 */},
+{      "y",            /* 121 */},
+{      "z",            /* 122 */},
+{      "{",            /* 123 */},
+{      "|","or"        /* 124 */},
+{      "}",            /* 125 */},
+{      "a~","ap"       /* 126 */},
+{      0,              /* 127 */},
+{      0,              /* 128 */},
+{      0,              /* 129 */},
+{      0,              /* 130 */},
+{      0,              /* 131 */},
+{      0,              /* 132 */},
+{      0,              /* 133 */},
+{      0,              /* 134 */},
+{      0,              /* 135 */},
+{      0,              /* 136 */},
+{      0,              /* 137 */},
+{      0,              /* 138 */},
+{      0,              /* 139 */},
+{      0,              /* 140 */},
+{      0,              /* 141 */},
+{      0,              /* 142 */},
+{      0,              /* 143 */},
+{      0,              /* 144 */},
+{      0,              /* 145 */},
+{      0,              /* 146 */},
+{      0,              /* 147 */},
+{      0,              /* 148 */},
+{      0,              /* 149 */},
+{      0,              /* 150 */},
+{      0,              /* 151 */},
+{      0,              /* 152 */},
+{      0,              /* 153 */},
+{      0,              /* 154 */},
+{      0,              /* 155 */},
+{      0,              /* 156 */},
+{      0,              /* 157 */},
+{      0,              /* 158 */},
+{      0,              /* 159 */},
+{      0,              /* 160 */},
+{      "I!",           /* 161 */},
+{      "ct",           /* 162 */},
+{      "po",           /* 163 */},
+{      "cu",           /* 164 */},
+{      "$J",           /* 165 */},
+{      0,              /* 166 */},
+{      "sc",           /* 167 */},
+{      0,              /* 168 */},
+{      "co",           /* 169 */},
+{      0,              /* 170 */},
+{      "d<",           /* 171 */},
+{      "no",           /* 172 */},
+{      "hy",           /* 173 */},
+{      "rg",           /* 174 */},
+{      "ma",           /* 175 */},
+{      "de",           /* 176 */},
+{      "+-",           /* 177 */},
+{      0,              /* 178 */},
+{      0,              /* 179 */},
+{      "aa",           /* 180 */},
+{      "*m",           /* 181 */},
+{      "pp",           /* 182 */},
+{      0,              /* 183 */},
+{      "cd",           /* 184 */},
+{      0,              /* 185 */},
+{      0,              /* 186 */},
+{      "d>",           /* 187 */},
+{      "14",           /* 188 */},
+{      "12",           /* 189 */},
+{      "34",           /* 190 */},
+{      "I?",           /* 191 */},
+{      0,              /* 192 */},
+{      0,              /* 193 */},
+{      0,              /* 194 */},
+{      0,              /* 195 */},
+{      0,              /* 196 */},
+{      0,              /* 197 */},
+{      "AE",           /* 198 */},
+{      0,              /* 199 */},
+{      0,              /* 200 */},
+{      0,              /* 201 */},
+{      0,              /* 202 */},
+{      0,              /* 203 */},
+{      0,              /* 204 */},
+{      0,              /* 205 */},
+{      0,              /* 206 */},
+{      0,              /* 207 */},
+{      0,              /* 208 */},
+{      0,              /* 209 */},
+{      0,              /* 210 */},
+{      0,              /* 211 */},
+{      0,              /* 212 */},
+{      0,              /* 213 */},
+{      0,              /* 214 */},
+{      "mu",           /* 215 */},
+{      "O/",           /* 216 */},
+{      0,              /* 217 */},
+{      0,              /* 218 */},
+{      0,              /* 219 */},
+{      0,              /* 220 */},
+{      0,              /* 221 */},
+{      0,              /* 222 */},
+{      "ss",           /* 223 */},
+{      0,              /* 224 */},
+{      0,              /* 225 */},
+{      0,              /* 226 */},
+{      0,              /* 227 */},
+{      0,              /* 228 */},
+{      0,              /* 229 */},
+{      "ae",           /* 230 */},
+{      0,              /* 231 */},
+{      0,              /* 232 */},
+{      0,              /* 233 */},
+{      0,              /* 234 */},
+{      0,              /* 235 */},
+{      0,              /* 236 */},
+{      0,              /* 237 */},
+{      0,              /* 238 */},
+{      0,              /* 239 */},
+{      0,              /* 240 */},
+{      0,              /* 241 */},
+{      0,              /* 242 */},
+{      0,              /* 243 */},
+{      0,              /* 244 */},
+{      0,              /* 245 */},
+{      0,              /* 246 */},
+{      0,              /* 247 */},
+{      0,              /* 248 */},
+{      0,              /* 249 */},
+{      0,              /* 250 */},
+{      0,              /* 251 */},
+{      0,              /* 252 */},
+{      0,              /* 253 */},
+{      0,              /* 254 */},
+{      0,              /* 255 */},
+},
+{
+{   "fi",          "fi",   },
+{   "fl",          "fl",   },
+{   "ff",          "ff",   },
+{   "Fi",          "ffi",   },
+{   "Fl",          "ffl",   },
+{   0,             0,      },
+}
+};
+
+static DviCharNameMap Adobe_Symbol_map = {
+       "adobe-fontspecific",
+       1,
+{
+{      0,              /* 0 */},
+{      0,              /* 1 */},
+{      0,              /* 2 */},
+{      0,              /* 3 */},
+{      0,              /* 4 */},
+{      0,              /* 5 */},
+{      0,              /* 6 */},
+{      0,              /* 7 */},
+{      0,              /* 8 */},
+{      0,              /* 9 */},
+{      0,              /* 10 */},
+{      0,              /* 11 */},
+{      0,              /* 12 */},
+{      0,              /* 13 */},
+{      0,              /* 14 */},
+{      0,              /* 15 */},
+{      0,              /* 16 */},
+{      0,              /* 17 */},
+{      0,              /* 18 */},
+{      0,              /* 19 */},
+{      0,              /* 20 */},
+{      0,              /* 21 */},
+{      0,              /* 22 */},
+{      0,              /* 23 */},
+{      0,              /* 24 */},
+{      0,              /* 25 */},
+{      0,              /* 26 */},
+{      0,              /* 27 */},
+{      0,              /* 28 */},
+{      0,              /* 29 */},
+{      0,              /* 30 */},
+{      0,              /* 31 */},
+{      0,              /* 32 */},
+{      "!",            /* 33 */},
+{      "fa",           /* 34 */},
+{      "#",            /* 35 */},
+{      "te",           /* 36 */},
+{      "%",            /* 37 */},
+{      "&",            /* 38 */},
+{      "cm",           /* 39 */},
+{      "(",            /* 40 */},
+{      ")",            /* 41 */},
+{      "**",           /* 42 */},
+{      "+","pl",       /* 43 */},
+{      ",",            /* 44 */},
+{      "-","mi","\\-", /* 45 */},
+{      ".",            /* 46 */},
+{      "/","sl",       /* 47 */},
+{      "0",            /* 48 */},
+{      "1",            /* 49 */},
+{      "2",            /* 50 */},
+{      "3",            /* 51 */},
+{      "4",            /* 52 */},
+{      "5",            /* 53 */},
+{      "6",            /* 54 */},
+{      "7",            /* 55 */},
+{      "8",            /* 56 */},
+{      "9",            /* 57 */},
+{      ":",            /* 58 */},
+{      ";",            /* 59 */},
+{      "<",            /* 60 */},
+{      "=","eq",       /* 61 */},
+{      ">",            /* 62 */},
+{      "?",            /* 63 */},
+{      "=~",           /* 64 */},
+{      "*A",           /* 65 */},
+{      "*B",           /* 66 */},
+{      "*C",           /* 67 */},
+{      "*D",           /* 68 */},
+{      "*E",           /* 69 */},
+{      "*F",           /* 70 */},
+{      "*G",           /* 71 */},
+{      "*Y",           /* 72 */},
+{      "*I",           /* 73 */},
+{      0,              /* 74 */},
+{      "*K",           /* 75 */},
+{      "*L",           /* 76 */},
+{      "*M",           /* 77 */},
+{      "*N",           /* 78 */},
+{      "*O",           /* 79 */},
+{      "*P",           /* 80 */},
+{      "*H",           /* 81 */},
+{      "*R",           /* 82 */},
+{      "*S",           /* 83 */},
+{      "*T",           /* 84 */},
+{      "*U",           /* 85 */},
+{      "ts",           /* 86 */},
+{      "*W",           /* 87 */},
+{      "*C",           /* 88 */},
+{      "*Q",           /* 89 */},
+{      "*Z",           /* 90 */},
+{      "[",            /* 91 */},
+{      "tf",           /* 92 */},
+{      "]",            /* 93 */},
+{      "bt",           /* 94 */},
+{      "ul",           /* 95 */},
+{      "rn",           /* 96 */},
+{      "*a",           /* 97 */},
+{      "*b",           /* 98 */},
+{      "*x",           /* 99 */},
+{      "*d",           /* 100 */},
+{      "*e",           /* 101 */},
+{      "*f",           /* 102 */},
+{      "*g",           /* 103 */},
+{      "*y",           /* 104 */},
+{      "*i",           /* 105 */},
+{      0,              /* 106 */},
+{      "*k",           /* 107 */},
+{      "*l",           /* 108 */},
+{      "*m",           /* 109 */},
+{      "*n",           /* 110 */},
+{      "*o",           /* 111 */},
+{      "*p",           /* 112 */},
+{      "*h",           /* 113 */},
+{      "*r",           /* 114 */},
+{      "*s",           /* 115 */},
+{      "*t",           /* 116 */},
+{      "*u",           /* 117 */},
+{      0,              /* 118 */},
+{      "*w",           /* 119 */},
+{      "*c",           /* 120 */},
+{      "*q",           /* 121 */},
+{      "*z",           /* 122 */},
+{      "{",            /* 123 */},
+{      "|",            /* 124 */},
+{      "}",            /* 125 */},
+{      "a~","ap",      /* 126 */},
+{      0,              /* 127 */},
+{      0,              /* 128 */},
+{      0,              /* 129 */},
+{      0,              /* 130 */},
+{      0,              /* 131 */},
+{      0,              /* 132 */},
+{      0,              /* 133 */},
+{      0,              /* 134 */},
+{      0,              /* 135 */},
+{      0,              /* 136 */},
+{      0,              /* 137 */},
+{      0,              /* 138 */},
+{      0,              /* 139 */},
+{      0,              /* 140 */},
+{      0,              /* 141 */},
+{      0,              /* 142 */},
+{      0,              /* 143 */},
+{      0,              /* 144 */},
+{      0,              /* 145 */},
+{      0,              /* 146 */},
+{      0,              /* 147 */},
+{      0,              /* 148 */},
+{      0,              /* 149 */},
+{      0,              /* 150 */},
+{      0,              /* 151 */},
+{      0,              /* 152 */},
+{      0,              /* 153 */},
+{      0,              /* 154 */},
+{      0,              /* 155 */},
+{      0,              /* 156 */},
+{      0,              /* 157 */},
+{      0,              /* 158 */},
+{      0,              /* 159 */},
+{      0,              /* 160 */},
+{      0,              /* 161 */},
+{      "fm","mt",      /* 162 */},
+{      "<=",           /* 163 */},
+{      "/","sl"        /* 164 */},
+{      "if",           /* 165 */},
+{      0,              /* 166 */},
+{      "Cc",           /* 167 */},
+{      "Cd",           /* 168 */},
+{      "Ch",           /* 169 */},
+{      "Cs",           /* 170 */},
+{      "<>",           /* 171 */},
+{      "<-",           /* 172 */},
+{      "ua",           /* 173 */},
+{      "->",           /* 174 */},
+{      "da",           /* 175 */},
+{      "de",           /* 176 */},
+{      "+-",           /* 177 */},
+{      "sd",           /* 178 */},
+{      ">=",           /* 179 */},
+{      "mu",           /* 180 */},
+{      "pt",           /* 181 */},
+{      "pd",           /* 182 */},
+{      "bu",           /* 183 */},
+{      "di",           /* 184 */},
+{      "!=",           /* 185 */},
+{      "==",           /* 186 */},
+{      "~=",           /* 187 */},
+{      "..",           /* 188 */},
+{      "br",           /* 189 */},
+{      "em",           /* 190 */},
+{      "cr",           /* 191 */},
+{      "al",           /* 192 */},
+{      0,              /* 193 */},
+{      0,              /* 194 */},
+{      0,              /* 195 */},
+{      "ax",           /* 196 */},
+{      "a+",           /* 197 */},
+{      "es",           /* 198 */},
+{      "ca",           /* 199 */},
+{      "cu",           /* 200 */},
+{      "sp",           /* 201 */},
+{      "ip",           /* 202 */},
+{      "!s",           /* 203 */},
+{      "sb",           /* 204 */},
+{      "ib",           /* 205 */},
+{      "mo",           /* 206 */},
+{      "!m",           /* 207 */},
+{      "ag",           /* 208 */},
+{      "gr",           /* 209 */},
+{      0,              /* 210 */},
+{      0,              /* 211 */},
+{      0,              /* 212 */},
+{      0,              /* 213 */},
+{      "sr",           /* 214 */},
+{      "m.",           /* 215 */},
+{      "no",           /* 216 */},
+{      "an",           /* 217 */},
+{      "lo",           /* 218 */},
+{      "io",           /* 219 */},
+{      "<:",           /* 220 */},
+{      "u=",           /* 221 */},
+{      ":>",           /* 222 */},
+{      "d=",           /* 223 */},
+{      "dm",           /* 224 */},
+{      "L<",           /* 225 */},
+{      "rg",           /* 226 */},
+{      "co",           /* 227 */},
+{      "tm",           /* 228 */},
+{      0,              /* 229 */},
+{      0,              /* 230 */},
+{      0,              /* 231 */},
+{      0,              /* 232 */},
+{      "lc",           /* 233 */},
+{      0,              /* 234 */},
+{      "lf",           /* 235 */},
+{      "lt",           /* 236 */},
+{      "lk",           /* 237 */},
+{      "lb",           /* 238 */},
+{      "bv",           /* 239 */},
+{      "AL",           /* 240 */},
+{      "R>",           /* 241 */},
+{      "is",           /* 242 */},
+{      0,              /* 243 */},
+{      0,              /* 244 */},
+{      0,              /* 245 */},
+{      0,              /* 246 */},
+{      0,              /* 247 */},
+{      0,              /* 248 */},
+{      "rc",           /* 249 */},
+{      0,              /* 250 */},
+{      "rf",           /* 251 */},
+{      "rt",           /* 252 */},
+{      "rk",           /* 253 */},
+{      "rb",           /* 254 */},
+{      0,              /* 255 */},
+},
+{
+{      0,          0   },
+}
+};
+
+static void
+load_standard_maps ()
+{
+       standard_maps_loaded = 1;
+       DviRegisterMap (&ISO8859_1_map);
+       DviRegisterMap (&Adobe_Symbol_map);
+}
+
diff --git a/xditview/DviChar.h b/xditview/DviChar.h
new file mode 100644 (file)
index 0000000..1097f6a
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * DviChar.h
+ *
+ * descriptions for mapping dvi names to
+ * font indexes and back.  Dvi fonts are all
+ * 256 elements (actually only 256-32 are usable).
+ *
+ * The encoding names are taken from X -
+ * case insensitive, a dash seperating the
+ * CharSetRegistry from the CharSetEncoding
+ */
+/* $XFree86$ */
+
+#ifndef _DVICHAR_H_
+#define _DVICHAR_H_
+
+#include "Dvi.h"
+
+# define DVI_MAX_SYNONYMS      10
+# define DVI_MAP_SIZE          256
+# define DVI_HASH_SIZE         256
+# define DVI_MAX_LIGATURES     16
+
+typedef struct _dviCharNameHash {
+       struct _dviCharNameHash *next;
+       char                    *name;
+       int                     position;
+} DviCharNameHash;
+
+typedef struct _dviCharNameMap {
+    char               *encoding;
+    int                        special;
+    char               *dvi_names[DVI_MAP_SIZE][DVI_MAX_SYNONYMS];
+    char               *ligatures[DVI_MAX_LIGATURES][2];
+    DviCharNameHash    *buckets[DVI_HASH_SIZE];
+} DviCharNameMap;
+
+extern DviCharNameMap  *DviFindMap (char *);
+extern void            DviRegisterMap (DviCharNameMap *);
+#ifdef NOTDEF
+extern char            *DviCharName (DviCharNameMap *, int, int);
+#else
+#define DviCharName(map,index,synonym) ((map)->dvi_names[index][synonym])
+#endif
+extern int             DviCharIndex (DviCharNameMap *, char *);
+extern unsigned char   *DviCharIsLigature (DviCharNameMap *, char *);
+extern void            ResetFonts (DviWidget);
+
+#endif
diff --git a/xditview/DviP.h b/xditview/DviP.h
new file mode 100644 (file)
index 0000000..2ead024
--- /dev/null
@@ -0,0 +1,293 @@
+/*
+ * $XConsortium: DviP.h,v 1.10 92/02/11 01:27:15 keith Exp $
+ */
+/* $XFree86: xc/programs/xditview/DviP.h,v 1.4 2001/08/01 00:45:03 tsi Exp $ */
+
+/* 
+ * DviP.h - Private definitions for Dvi widget
+ */
+
+#ifndef _XtDviP_h
+#define _XtDviP_h
+
+#ifdef USE_XFT
+#include <X11/Xft/Xft.h>
+#endif
+
+#include "Dvi.h"
+#include <X11/Xaw/SimpleP.h>
+#include "DviChar.h"
+
+/***********************************************************************
+ *
+ * Dvi Widget Private Data
+ *
+ ***********************************************************************/
+
+/************************************
+ *
+ *  Class structure
+ *
+ ***********************************/
+
+/*
+ * New fields for the Dvi widget class record
+ */
+
+typedef struct _DviClass {
+       int             makes_compiler_happy;  /* not used */
+} DviClassPart;
+
+/*
+ * Full class record declaration
+ */
+
+typedef struct _DviClassRec {
+    CoreClassPart      core_class;
+    SimpleClassPart    simple_class;
+    DviClassPart       command_class;
+} DviClassRec;
+
+extern DviClassRec dviClassRec;
+
+/***************************************
+ *
+ *  Instance (widget) structure 
+ *
+ **************************************/
+
+/*
+ * a list of fonts we've used for this widget
+ */
+
+typedef struct _dviFontSizeList {
+       struct _dviFontSizeList *next;
+       int                     size;
+       char                    *x_name;
+#ifdef USE_XFT
+       XftFont                 *font;
+       Bool                    core;
+#else
+       XFontStruct             *font;
+#endif
+       int                     doesnt_exist;
+} DviFontSizeList;
+
+typedef struct _dviFontList {
+       struct _dviFontList     *next;
+       char                    *dvi_name;
+       char                    *x_name;
+       int                     dvi_number;
+       Boolean                 initialized;
+       Boolean                 scalable;
+       DviFontSizeList         *sizes;
+       DviCharNameMap          *char_map;
+} DviFontList;
+
+typedef struct _dviFontMap {
+       struct _dviFontMap      *next;
+       char                    *dvi_name;
+       char                    *x_name;
+} DviFontMap;
+
+#define DVI_TEXT_CACHE_SIZE    256
+#define DVI_CHAR_CACHE_SIZE    1024
+
+#ifdef USE_XFT
+typedef struct _dviTextItem {
+       char            *chars;
+       int             nchars;
+       int             x;
+       XftFont         *font;
+} DviTextItem;
+#endif
+
+typedef struct _dviCharCache {
+#ifdef USE_XFT
+       DviTextItem     cache[DVI_TEXT_CACHE_SIZE];
+#else
+       XTextItem       cache[DVI_TEXT_CACHE_SIZE];
+#endif
+       char            char_cache[DVI_CHAR_CACHE_SIZE];
+       int             index;
+       int             max;
+       int             char_index;
+       int             font_size;
+       int             font_number;
+#ifdef USE_XFT
+       XftFont         *font;
+#else
+       XFontStruct     *font;
+#endif
+       int             start_x, start_y;
+       int             x, y;
+} DviCharCache;
+
+typedef struct _dviState {
+       struct _dviState        *next;
+       int                     font_size;
+       int                     font_bound;
+       int                     font_number;
+       int                     line_style;
+       int                     line_width;
+       int                     x;
+       int                     y;
+} DviState;
+
+typedef struct _dviFileMap {
+       struct _dviFileMap      *next;
+       long                    position;
+       int                     page_number;
+} DviFileMap;
+
+/*
+ * New fields for the Dvi widget record
+ */
+
+typedef struct {
+       /*
+        * resource specifiable items
+        */
+       char            *font_map_string;
+       unsigned long   foreground;
+       int             requested_page;
+       int             last_page;
+       FILE            *file;
+       Boolean         seek;           /* file is "seekable" */
+#ifdef USE_XFT
+       XftFont         *default_font;
+#else
+       XFontStruct     *default_font;
+#endif
+       int             backing_store;
+       Boolean         noPolyText;
+       int             screen_resolution;
+       float           page_width;
+       float           page_height;
+       int             size_scale_set;
+       /*
+        * private state
+        */
+       FILE            *tmpFile;       /* used when reading stdin */
+       char            readingTmp;     /* reading now from tmp */
+       char            ungot;          /* have ungetc'd a char */
+       GC              normal_GC;
+#ifdef USE_XFT
+       XftDraw         *draw;
+       XftColor        black;
+#endif
+       DviFileMap      *file_map;
+       DviFontList     *fonts;
+       DviFontMap      *font_map;
+       int             current_page;
+       int             font_size;
+       int             font_number;
+       int             device_resolution;
+       int             line_width;
+       int             line_style;
+       int             desired_width;
+       int             desired_height;
+       int             size_scale;     /* font size scale */
+#ifdef USE_XFT
+       XftFont         *font;
+#else
+       XFontStruct     *font;
+#endif
+       int             display_enable;
+       double          scale;          /* device coordinates to pixels */
+       struct ExposedExtents {
+           int x1, y1, x2, y2;
+       }               extents;
+       DviState        *state;
+       DviCharCache    cache;
+} DviPart;
+
+extern int             DviGetAndPut(DviWidget, int *);
+
+#define DviGetIn(dw,cp)\
+    (dw->dvi.tmpFile ? (\
+       DviGetAndPut (dw, cp) \
+    ) :\
+       (*cp = getc (dw->dvi.file))\
+)
+
+#define DviGetC(dw, cp)\
+    (dw->dvi.readingTmp ? (\
+       ((*cp = getc (dw->dvi.tmpFile)) == EOF) ? (\
+           fseek (dw->dvi.tmpFile, 0l, 2),\
+           (dw->dvi.readingTmp = 0),\
+           DviGetIn (dw,cp)\
+       ) : (\
+           *cp\
+       )\
+    ) : (\
+       DviGetIn(dw,cp)\
+    )\
+)
+
+#define DviUngetC(dw, c)\
+    (dw->dvi.readingTmp ? (\
+       ungetc (c, dw->dvi.tmpFile)\
+    ) : ( \
+       (dw->dvi.ungot = 1),\
+       ungetc (c, dw->dvi.file)))
+
+#define ToX(dw,device)             ((int) ((device) * (dw)->dvi.scale + 0.5))
+#define ToDevice(dw,x)             ((int) ((x) / (dw)->dvi.scale + 0.5))
+#define SizeScale(dw)              ((dw)->dvi.size_scale ? (dw)->dvi.size_scale : 4)
+#define FontSizeInPixels(dw,size)   ((int) ((size) * (dw)->dvi.screen_resolution / (SizeScale(dw) * 72)))
+#define FontSizeInDevice(dw,size)   ((int) ((size) * (dw)->dvi.device_resolution / (SizeScale(dw) * 72)))
+
+/*
+ * Full widget declaration
+ */
+
+typedef struct _DviRec {
+    CorePart   core;
+    SimplePart simple;
+    DviPart    dvi;
+} DviRec;
+
+/* draw.c */
+extern void            HorizontalMove(DviWidget, int);
+extern void            HorizontalGoto(DviWidget, int);
+extern void            VerticalMove(DviWidget, int);
+extern void            VerticalGoto(DviWidget, int);
+extern void            FlushCharCache(DviWidget);
+extern void            SetGCForDraw(DviWidget);
+extern void            DrawLine(DviWidget, int, int);
+extern void            DrawCircle(DviWidget, int);
+extern void            DrawEllipse(DviWidget, int, int);
+extern void            DrawArc(DviWidget, int, int, int, int);
+extern void            DrawSpline(DviWidget, char *, int);
+
+/* font.c */
+extern void            ParseFontMap(DviWidget);
+extern void            DestroyFontMap(DviFontMap *);
+extern void            SetFontPosition(DviWidget, int, char *, char *);
+#ifdef USE_XFT
+extern XftFont *       QueryFont(DviWidget, int, int);
+#else
+extern XFontStruct *   QueryFont(DviWidget, int, int);
+#endif
+extern DviCharNameMap *        QueryFontMap(DviWidget, int);
+
+/* lex.c */
+extern char *          GetLine(DviWidget, char *, int);
+extern char *          GetWord(DviWidget, char *, int);
+extern int             GetNumber(DviWidget);
+
+/* page.c */
+extern void            DestroyFileMap(DviFileMap *);
+extern void            ForgetPagePositions(DviWidget);
+extern void            RememberPagePosition(DviWidget, int);
+extern long            SearchPagePosition(DviWidget, int);
+extern void            FileSeek(DviWidget, long);
+
+/* parse.c */
+extern int             ParseInput(DviWidget);
+
+/* Dvi.c */
+extern void            SetDeviceResolution(DviWidget, int);
+
+#endif /* _XtDviP_h */
diff --git a/xditview/INSTALL b/xditview/INSTALL
new file mode 100644 (file)
index 0000000..23e5f25
--- /dev/null
@@ -0,0 +1,236 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
+Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+These are generic installation instructions.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  (Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.)
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.  If you're
+     using `csh' on an old version of System V, you might need to type
+     `sh ./configure' instead to prevent `csh' from trying to execute
+     `configure' itself.
+
+     Running `configure' takes awhile.  While running, it prints some
+     messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+Compilers and Options
+=====================
+
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about.  Run `./configure --help' for
+details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory.  After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
+
+Installation Names
+==================
+
+By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+There may be some features `configure' cannot figure out automatically,
+but needs to determine by the type of machine the package will run on.
+Usually, assuming the package is built to be run on the _same_
+architectures, `configure' can figure that out, but if it prints a
+message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).  Here is a another example:
+
+     /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
+configuration-related scripts to be executed by `/bin/bash'.
+
+`configure' Invocation
+======================
+
+`configure' recognizes the following options to control how it operates.
+
+`--help'
+`-h'
+     Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/xditview/Makefile.am b/xditview/Makefile.am
new file mode 100644 (file)
index 0000000..d57f012
--- /dev/null
@@ -0,0 +1,99 @@
+# 
+#  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 = xditview
+
+xditview_CFLAGS = $(XDITVIEW_CFLAGS)
+xditview_LDADD = $(XDITVIEW_LIBS) -lm
+
+xditview_SOURCES =     \
+        draw.c \
+        Dvi.c \
+        DviChar.c \
+        DviChar.h \
+        Dvi.h \
+        DviP.h \
+        font.c \
+        lex.c \
+        Menu.h \
+        page.c \
+        parse.c \
+        xditview.c \
+        XFontName.c \
+        XFontName.h
+
+appman_PRE = \
+        xditview.man
+
+# App default files  (*.ad)
+
+appdefaultdir = @appdefaultdir@
+
+APPDEFAULTFILES = \
+        Xditview \
+        Xditview-chrtr
+
+# Bitmaps referenced at runtime
+bitmapdir = $(includedir)/X11/bitmaps
+dist_bitmap_DATA = ldblarrow rdblarrow
+
+SUFFIXES = .ad
+
+.ad:
+       cp $< $@
+
+appdefault_DATA = $(APPDEFAULTFILES)
+
+EXTRA_DIST = $(APPDEFAULTFILES:%=%.ad) xdit.bm xdit_mask.bm
+
+CLEANFILES = $(APPDEFAULTFILES)
+
+
+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/xditview/Makefile.in b/xditview/Makefile.in
new file mode 100644 (file)
index 0000000..163c395
--- /dev/null
@@ -0,0 +1,860 @@
+# 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 = xditview$(EXEEXT)
+DIST_COMMON = README $(am__configure_deps) $(dist_bitmap_DATA) \
+       $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+       $(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \
+       ChangeLog INSTALL NEWS compile config.guess config.sub depcomp \
+       install-sh missing mkinstalldirs
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno configure.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appdefaultdir)" \
+       "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(bitmapdir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_xditview_OBJECTS = xditview-draw.$(OBJEXT) xditview-Dvi.$(OBJEXT) \
+       xditview-DviChar.$(OBJEXT) xditview-font.$(OBJEXT) \
+       xditview-lex.$(OBJEXT) xditview-page.$(OBJEXT) \
+       xditview-parse.$(OBJEXT) xditview-xditview.$(OBJEXT) \
+       xditview-XFontName.$(OBJEXT)
+xditview_OBJECTS = $(am_xditview_OBJECTS)
+am__DEPENDENCIES_1 =
+xditview_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 = $(xditview_SOURCES)
+DIST_SOURCES = $(xditview_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|^.*/||'`;
+appdefaultDATA_INSTALL = $(INSTALL_DATA)
+appmanDATA_INSTALL = $(INSTALL_DATA)
+dist_bitmapDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(appdefault_DATA) $(appman_DATA) $(dist_bitmap_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@
+APPDEFS_CFLAGS = @APPDEFS_CFLAGS@
+APPDEFS_LIBS = @APPDEFS_LIBS@
+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@
+TMP_XAW_CFLAGS = @TMP_XAW_CFLAGS@
+TMP_XAW_LIBS = @TMP_XAW_LIBS@
+VERSION = @VERSION@
+XAW_USE_XPRINT_FALSE = @XAW_USE_XPRINT_FALSE@
+XAW_USE_XPRINT_TRUE = @XAW_USE_XPRINT_TRUE@
+XDITVIEW_CFLAGS = @XDITVIEW_CFLAGS@
+XDITVIEW_LIBS = @XDITVIEW_LIBS@
+ac_ct_CC = @ac_ct_CC@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+
+# App default files  (*.ad)
+appdefaultdir = @appdefaultdir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+xditview_CFLAGS = $(XDITVIEW_CFLAGS)
+xditview_LDADD = $(XDITVIEW_LIBS) -lm
+xditview_SOURCES = \
+        draw.c \
+        Dvi.c \
+        DviChar.c \
+        DviChar.h \
+        Dvi.h \
+        DviP.h \
+        font.c \
+        lex.c \
+        Menu.h \
+        page.c \
+        parse.c \
+        xditview.c \
+        XFontName.c \
+        XFontName.h
+
+appman_PRE = \
+        xditview.man
+
+APPDEFAULTFILES = \
+        Xditview \
+        Xditview-chrtr
+
+
+# Bitmaps referenced at runtime
+bitmapdir = $(includedir)/X11/bitmaps
+dist_bitmap_DATA = ldblarrow rdblarrow
+SUFFIXES = .ad .$(APP_MAN_SUFFIX) .man
+appdefault_DATA = $(APPDEFAULTFILES)
+EXTRA_DIST = $(APPDEFAULTFILES:%=%.ad) xdit.bm xdit_mask.bm \
+       $(appman_PRE)
+CLEANFILES = $(APPDEFAULTFILES) $(appman_DATA)
+appmandir = $(APP_MAN_DIR)
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+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'
+
+all: config.h
+       $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .ad .$(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)
+xditview$(EXEEXT): $(xditview_OBJECTS) $(xditview_DEPENDENCIES) 
+       @rm -f xditview$(EXEEXT)
+       $(LINK) $(xditview_LDFLAGS) $(xditview_OBJECTS) $(xditview_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xditview-Dvi.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xditview-DviChar.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xditview-XFontName.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xditview-draw.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xditview-font.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xditview-lex.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xditview-page.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xditview-parse.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xditview-xditview.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) '$<'`
+
+xditview-draw.o: draw.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xditview_CFLAGS) $(CFLAGS) -MT xditview-draw.o -MD -MP -MF "$(DEPDIR)/xditview-draw.Tpo" -c -o xditview-draw.o `test -f 'draw.c' || echo '$(srcdir)/'`draw.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xditview-draw.Tpo" "$(DEPDIR)/xditview-draw.Po"; else rm -f "$(DEPDIR)/xditview-draw.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='draw.c' object='xditview-draw.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) $(xditview_CFLAGS) $(CFLAGS) -c -o xditview-draw.o `test -f 'draw.c' || echo '$(srcdir)/'`draw.c
+
+xditview-draw.obj: draw.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xditview_CFLAGS) $(CFLAGS) -MT xditview-draw.obj -MD -MP -MF "$(DEPDIR)/xditview-draw.Tpo" -c -o xditview-draw.obj `if test -f 'draw.c'; then $(CYGPATH_W) 'draw.c'; else $(CYGPATH_W) '$(srcdir)/draw.c'; fi`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xditview-draw.Tpo" "$(DEPDIR)/xditview-draw.Po"; else rm -f "$(DEPDIR)/xditview-draw.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='draw.c' object='xditview-draw.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) $(xditview_CFLAGS) $(CFLAGS) -c -o xditview-draw.obj `if test -f 'draw.c'; then $(CYGPATH_W) 'draw.c'; else $(CYGPATH_W) '$(srcdir)/draw.c'; fi`
+
+xditview-Dvi.o: Dvi.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xditview_CFLAGS) $(CFLAGS) -MT xditview-Dvi.o -MD -MP -MF "$(DEPDIR)/xditview-Dvi.Tpo" -c -o xditview-Dvi.o `test -f 'Dvi.c' || echo '$(srcdir)/'`Dvi.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xditview-Dvi.Tpo" "$(DEPDIR)/xditview-Dvi.Po"; else rm -f "$(DEPDIR)/xditview-Dvi.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Dvi.c' object='xditview-Dvi.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) $(xditview_CFLAGS) $(CFLAGS) -c -o xditview-Dvi.o `test -f 'Dvi.c' || echo '$(srcdir)/'`Dvi.c
+
+xditview-Dvi.obj: Dvi.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xditview_CFLAGS) $(CFLAGS) -MT xditview-Dvi.obj -MD -MP -MF "$(DEPDIR)/xditview-Dvi.Tpo" -c -o xditview-Dvi.obj `if test -f 'Dvi.c'; then $(CYGPATH_W) 'Dvi.c'; else $(CYGPATH_W) '$(srcdir)/Dvi.c'; fi`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xditview-Dvi.Tpo" "$(DEPDIR)/xditview-Dvi.Po"; else rm -f "$(DEPDIR)/xditview-Dvi.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='Dvi.c' object='xditview-Dvi.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) $(xditview_CFLAGS) $(CFLAGS) -c -o xditview-Dvi.obj `if test -f 'Dvi.c'; then $(CYGPATH_W) 'Dvi.c'; else $(CYGPATH_W) '$(srcdir)/Dvi.c'; fi`
+
+xditview-DviChar.o: DviChar.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xditview_CFLAGS) $(CFLAGS) -MT xditview-DviChar.o -MD -MP -MF "$(DEPDIR)/xditview-DviChar.Tpo" -c -o xditview-DviChar.o `test -f 'DviChar.c' || echo '$(srcdir)/'`DviChar.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xditview-DviChar.Tpo" "$(DEPDIR)/xditview-DviChar.Po"; else rm -f "$(DEPDIR)/xditview-DviChar.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='DviChar.c' object='xditview-DviChar.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) $(xditview_CFLAGS) $(CFLAGS) -c -o xditview-DviChar.o `test -f 'DviChar.c' || echo '$(srcdir)/'`DviChar.c
+
+xditview-DviChar.obj: DviChar.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xditview_CFLAGS) $(CFLAGS) -MT xditview-DviChar.obj -MD -MP -MF "$(DEPDIR)/xditview-DviChar.Tpo" -c -o xditview-DviChar.obj `if test -f 'DviChar.c'; then $(CYGPATH_W) 'DviChar.c'; else $(CYGPATH_W) '$(srcdir)/DviChar.c'; fi`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xditview-DviChar.Tpo" "$(DEPDIR)/xditview-DviChar.Po"; else rm -f "$(DEPDIR)/xditview-DviChar.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='DviChar.c' object='xditview-DviChar.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) $(xditview_CFLAGS) $(CFLAGS) -c -o xditview-DviChar.obj `if test -f 'DviChar.c'; then $(CYGPATH_W) 'DviChar.c'; else $(CYGPATH_W) '$(srcdir)/DviChar.c'; fi`
+
+xditview-font.o: font.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xditview_CFLAGS) $(CFLAGS) -MT xditview-font.o -MD -MP -MF "$(DEPDIR)/xditview-font.Tpo" -c -o xditview-font.o `test -f 'font.c' || echo '$(srcdir)/'`font.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xditview-font.Tpo" "$(DEPDIR)/xditview-font.Po"; else rm -f "$(DEPDIR)/xditview-font.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='font.c' object='xditview-font.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) $(xditview_CFLAGS) $(CFLAGS) -c -o xditview-font.o `test -f 'font.c' || echo '$(srcdir)/'`font.c
+
+xditview-font.obj: font.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xditview_CFLAGS) $(CFLAGS) -MT xditview-font.obj -MD -MP -MF "$(DEPDIR)/xditview-font.Tpo" -c -o xditview-font.obj `if test -f 'font.c'; then $(CYGPATH_W) 'font.c'; else $(CYGPATH_W) '$(srcdir)/font.c'; fi`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xditview-font.Tpo" "$(DEPDIR)/xditview-font.Po"; else rm -f "$(DEPDIR)/xditview-font.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='font.c' object='xditview-font.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) $(xditview_CFLAGS) $(CFLAGS) -c -o xditview-font.obj `if test -f 'font.c'; then $(CYGPATH_W) 'font.c'; else $(CYGPATH_W) '$(srcdir)/font.c'; fi`
+
+xditview-lex.o: lex.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xditview_CFLAGS) $(CFLAGS) -MT xditview-lex.o -MD -MP -MF "$(DEPDIR)/xditview-lex.Tpo" -c -o xditview-lex.o `test -f 'lex.c' || echo '$(srcdir)/'`lex.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xditview-lex.Tpo" "$(DEPDIR)/xditview-lex.Po"; else rm -f "$(DEPDIR)/xditview-lex.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lex.c' object='xditview-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) $(xditview_CFLAGS) $(CFLAGS) -c -o xditview-lex.o `test -f 'lex.c' || echo '$(srcdir)/'`lex.c
+
+xditview-lex.obj: lex.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xditview_CFLAGS) $(CFLAGS) -MT xditview-lex.obj -MD -MP -MF "$(DEPDIR)/xditview-lex.Tpo" -c -o xditview-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)/xditview-lex.Tpo" "$(DEPDIR)/xditview-lex.Po"; else rm -f "$(DEPDIR)/xditview-lex.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lex.c' object='xditview-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) $(xditview_CFLAGS) $(CFLAGS) -c -o xditview-lex.obj `if test -f 'lex.c'; then $(CYGPATH_W) 'lex.c'; else $(CYGPATH_W) '$(srcdir)/lex.c'; fi`
+
+xditview-page.o: page.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xditview_CFLAGS) $(CFLAGS) -MT xditview-page.o -MD -MP -MF "$(DEPDIR)/xditview-page.Tpo" -c -o xditview-page.o `test -f 'page.c' || echo '$(srcdir)/'`page.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xditview-page.Tpo" "$(DEPDIR)/xditview-page.Po"; else rm -f "$(DEPDIR)/xditview-page.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='page.c' object='xditview-page.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) $(xditview_CFLAGS) $(CFLAGS) -c -o xditview-page.o `test -f 'page.c' || echo '$(srcdir)/'`page.c
+
+xditview-page.obj: page.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xditview_CFLAGS) $(CFLAGS) -MT xditview-page.obj -MD -MP -MF "$(DEPDIR)/xditview-page.Tpo" -c -o xditview-page.obj `if test -f 'page.c'; then $(CYGPATH_W) 'page.c'; else $(CYGPATH_W) '$(srcdir)/page.c'; fi`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xditview-page.Tpo" "$(DEPDIR)/xditview-page.Po"; else rm -f "$(DEPDIR)/xditview-page.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='page.c' object='xditview-page.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) $(xditview_CFLAGS) $(CFLAGS) -c -o xditview-page.obj `if test -f 'page.c'; then $(CYGPATH_W) 'page.c'; else $(CYGPATH_W) '$(srcdir)/page.c'; fi`
+
+xditview-parse.o: parse.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xditview_CFLAGS) $(CFLAGS) -MT xditview-parse.o -MD -MP -MF "$(DEPDIR)/xditview-parse.Tpo" -c -o xditview-parse.o `test -f 'parse.c' || echo '$(srcdir)/'`parse.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xditview-parse.Tpo" "$(DEPDIR)/xditview-parse.Po"; else rm -f "$(DEPDIR)/xditview-parse.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='parse.c' object='xditview-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) $(xditview_CFLAGS) $(CFLAGS) -c -o xditview-parse.o `test -f 'parse.c' || echo '$(srcdir)/'`parse.c
+
+xditview-parse.obj: parse.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xditview_CFLAGS) $(CFLAGS) -MT xditview-parse.obj -MD -MP -MF "$(DEPDIR)/xditview-parse.Tpo" -c -o xditview-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)/xditview-parse.Tpo" "$(DEPDIR)/xditview-parse.Po"; else rm -f "$(DEPDIR)/xditview-parse.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='parse.c' object='xditview-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) $(xditview_CFLAGS) $(CFLAGS) -c -o xditview-parse.obj `if test -f 'parse.c'; then $(CYGPATH_W) 'parse.c'; else $(CYGPATH_W) '$(srcdir)/parse.c'; fi`
+
+xditview-xditview.o: xditview.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xditview_CFLAGS) $(CFLAGS) -MT xditview-xditview.o -MD -MP -MF "$(DEPDIR)/xditview-xditview.Tpo" -c -o xditview-xditview.o `test -f 'xditview.c' || echo '$(srcdir)/'`xditview.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xditview-xditview.Tpo" "$(DEPDIR)/xditview-xditview.Po"; else rm -f "$(DEPDIR)/xditview-xditview.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='xditview.c' object='xditview-xditview.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) $(xditview_CFLAGS) $(CFLAGS) -c -o xditview-xditview.o `test -f 'xditview.c' || echo '$(srcdir)/'`xditview.c
+
+xditview-xditview.obj: xditview.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xditview_CFLAGS) $(CFLAGS) -MT xditview-xditview.obj -MD -MP -MF "$(DEPDIR)/xditview-xditview.Tpo" -c -o xditview-xditview.obj `if test -f 'xditview.c'; then $(CYGPATH_W) 'xditview.c'; else $(CYGPATH_W) '$(srcdir)/xditview.c'; fi`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xditview-xditview.Tpo" "$(DEPDIR)/xditview-xditview.Po"; else rm -f "$(DEPDIR)/xditview-xditview.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='xditview.c' object='xditview-xditview.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) $(xditview_CFLAGS) $(CFLAGS) -c -o xditview-xditview.obj `if test -f 'xditview.c'; then $(CYGPATH_W) 'xditview.c'; else $(CYGPATH_W) '$(srcdir)/xditview.c'; fi`
+
+xditview-XFontName.o: XFontName.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xditview_CFLAGS) $(CFLAGS) -MT xditview-XFontName.o -MD -MP -MF "$(DEPDIR)/xditview-XFontName.Tpo" -c -o xditview-XFontName.o `test -f 'XFontName.c' || echo '$(srcdir)/'`XFontName.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xditview-XFontName.Tpo" "$(DEPDIR)/xditview-XFontName.Po"; else rm -f "$(DEPDIR)/xditview-XFontName.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='XFontName.c' object='xditview-XFontName.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) $(xditview_CFLAGS) $(CFLAGS) -c -o xditview-XFontName.o `test -f 'XFontName.c' || echo '$(srcdir)/'`XFontName.c
+
+xditview-XFontName.obj: XFontName.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xditview_CFLAGS) $(CFLAGS) -MT xditview-XFontName.obj -MD -MP -MF "$(DEPDIR)/xditview-XFontName.Tpo" -c -o xditview-XFontName.obj `if test -f 'XFontName.c'; then $(CYGPATH_W) 'XFontName.c'; else $(CYGPATH_W) '$(srcdir)/XFontName.c'; fi`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xditview-XFontName.Tpo" "$(DEPDIR)/xditview-XFontName.Po"; else rm -f "$(DEPDIR)/xditview-XFontName.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='XFontName.c' object='xditview-XFontName.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) $(xditview_CFLAGS) $(CFLAGS) -c -o xditview-XFontName.obj `if test -f 'XFontName.c'; then $(CYGPATH_W) 'XFontName.c'; else $(CYGPATH_W) '$(srcdir)/XFontName.c'; fi`
+uninstall-info-am:
+install-appdefaultDATA: $(appdefault_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appdefaultdir)" || $(mkdir_p) "$(DESTDIR)$(appdefaultdir)"
+       @list='$(appdefault_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(appdefaultDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(appdefaultdir)/$$f'"; \
+         $(appdefaultDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(appdefaultdir)/$$f"; \
+       done
+
+uninstall-appdefaultDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appdefault_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(appdefaultdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(appdefaultdir)/$$f"; \
+       done
+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
+install-dist_bitmapDATA: $(dist_bitmap_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(bitmapdir)" || $(mkdir_p) "$(DESTDIR)$(bitmapdir)"
+       @list='$(dist_bitmap_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(dist_bitmapDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(bitmapdir)/$$f'"; \
+         $(dist_bitmapDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(bitmapdir)/$$f"; \
+       done
+
+uninstall-dist_bitmapDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_bitmap_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(bitmapdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(bitmapdir)/$$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)$(appdefaultdir)" "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(bitmapdir)"; 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-appdefaultDATA install-appmanDATA \
+       install-dist_bitmapDATA
+
+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-appdefaultDATA uninstall-appmanDATA \
+       uninstall-binPROGRAMS uninstall-dist_bitmapDATA \
+       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-appdefaultDATA install-appmanDATA install-binPROGRAMS \
+       install-data install-data-am install-dist_bitmapDATA \
+       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-appdefaultDATA \
+       uninstall-appmanDATA uninstall-binPROGRAMS \
+       uninstall-dist_bitmapDATA uninstall-info-am
+
+
+.ad:
+       cp $< $@
+
+.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/xditview/Menu.h b/xditview/Menu.h
new file mode 100644 (file)
index 0000000..c306b27
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * $XConsortium: Menu.h,v 1.2 89/07/21 14:22:10 jim Exp $
+ */
+
+#ifndef _XtMenu_h
+#define _XtMenu_h
+
+/***********************************************************************
+ *
+ * Menu Widget
+ *
+ ***********************************************************************/
+
+/* Parameters:
+
+ Name               Class              RepType         Default Value
+ ----               -----              -------         -------------
+ background         Background         pixel           White
+ border                     BorderColor        pixel           Black
+ borderWidth        BorderWidth        int             1
+ height                     Height             int             120
+ mappedWhenManaged   MappedWhenManaged Boolean         True
+ reverseVideo       ReverseVideo       Boolean         False
+ width              Width              int             120
+ x                  Position           int             0
+ y                  Position           int             0
+
+*/
+
+#define XtNmenuEntries         "menuEntries"
+#define XtNhorizontalPadding   "horizontalPadding"
+#define XtNverticalPadding     "verticalPadding"
+#define XtNselection           "Selection"
+
+#define XtCMenuEntries         "MenuEntries"
+#define XtCPadding             "Padding"
+#define XtCSelection           "Selection"
+
+typedef struct _MenuRec *MenuWidget;  /* completely defined in MenuPrivate.h */
+typedef struct _MenuClassRec *MenuWidgetClass;    /* completely defined in MenuPrivate.h */
+
+extern WidgetClass menuWidgetClass;
+
+extern Widget  XawMenuCreate ();
+#endif /* _XtMenu_h */
+/* DON'T ADD STUFF AFTER THIS #endif */
diff --git a/xditview/NEWS b/xditview/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xditview/README b/xditview/README
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xditview/XFontName.c b/xditview/XFontName.c
new file mode 100644 (file)
index 0000000..b8d1a09
--- /dev/null
@@ -0,0 +1,262 @@
+/* $XFree86: xc/programs/xditview/XFontName.c,v 1.2 2001/08/01 00:45:03 tsi Exp $ */
+/*
+ * XFontName.c
+ *
+ * build/parse X Font name strings
+ */
+
+# include      <X11/Xlib.h>
+# include      <X11/Intrinsic.h>
+# include      "XFontName.h"
+#include       <ctype.h>
+
+static char *
+extractStringField (
+       char            *name,
+       char            *buffer,
+       int             size,
+       unsigned int    *attrp,
+       unsigned int    bit)
+{
+       char    *buf = buffer;
+
+       if (!*name)
+               return 0;
+       while (*name && *name != '-' && size > 0) {
+               *buf++ = *name++;
+               --size;
+       }
+       if (size <= 0)
+               return 0;
+       *buf = '\0';
+       if (buffer[0] != '*' || buffer[1] != '\0')
+               *attrp |= bit;
+       if (*name == '-')
+               return name+1;
+       return name;
+}
+
+static char *
+extractUnsignedField (
+       char            *name,
+       unsigned int    *result,
+       unsigned int    *attrp,
+       unsigned int    bit)
+{
+       char            buf[256];
+       char            *c;
+       unsigned int    i;
+
+       name = extractStringField (name, buf, sizeof (buf), attrp, bit);
+       if (!name)
+               return 0;
+       if (!(*attrp & bit))
+               return name;
+       i = 0;
+       for (c = buf; *c; c++) {
+               if (!isdigit (*c))
+                       return 0;
+               i = i * 10 + (*c - '0');
+       }
+       *result = i;
+       return name;
+}
+
+Bool
+XParseFontName (fontNameString, fontName, fontNameAttributes)
+       XFontNameString fontNameString;
+       XFontName       *fontName;
+       unsigned int    *fontNameAttributes;
+{
+       char            *name = fontNameString;
+       XFontName       temp;
+       unsigned int    attributes = 0;
+
+#define GetString(field,bit)\
+       if (!(name = extractStringField \
+               (name, temp.field, sizeof (temp.field),\
+               &attributes, bit))) \
+               return False;
+
+#define GetUnsigned(field,bit)\
+       if (!(name = extractUnsignedField \
+               (name, &temp.field, \
+               &attributes, bit))) \
+               return False;
+
+       GetString (Registry, FontNameRegistry)
+       GetString (Foundry, FontNameFoundry)
+       GetString (FamilyName, FontNameFamilyName)
+       GetString (WeightName, FontNameWeightName)
+       GetString (Slant, FontNameSlant)
+       GetString (SetwidthName, FontNameSetwidthName)
+       GetString (AddStyleName, FontNameAddStyleName)
+       GetUnsigned (PixelSize, FontNamePixelSize)
+       GetUnsigned (PointSize, FontNamePointSize)
+       GetUnsigned (ResolutionX, FontNameResolutionX)
+       GetUnsigned (ResolutionY, FontNameResolutionY)
+       GetString (Spacing, FontNameSpacing)
+       GetUnsigned (AverageWidth, FontNameAverageWidth)
+       GetString (CharSetRegistry, FontNameCharSetRegistry)
+       if (!*name) {
+               temp.CharSetEncoding[0] = '\0';
+               attributes |= FontNameCharSetEncoding;
+       } else {
+               GetString (CharSetEncoding, FontNameCharSetEncoding)
+       }
+       *fontName = temp;
+       *fontNameAttributes = attributes;
+       return True;
+}
+
+static char *
+utoa (
+       unsigned int    u,
+       char            *s,
+       int             size)
+{
+       char    *t;
+
+       t = s + size;
+       *--t = '\0';
+       do
+               *--t = (u % 10) + '0';
+       while (u /= 10);
+       return t;
+}
+
+Bool
+XFormatFontName (fontName, fontNameAttributes, fontNameString)
+       XFontName       *fontName;
+       unsigned int    fontNameAttributes;
+       XFontNameString fontNameString;
+{
+       XFontNameString tmp;
+       char            *name = tmp, *f;
+       int             left = sizeof (tmp) - 1;
+       char            number[32];
+
+#define PutString(field, bit)\
+       f = (fontNameAttributes & bit) ? \
+               fontName->field \
+               : "*"; \
+       if ((left -= strlen (f)) < 0) \
+               return False; \
+       while (*f) \
+               if ((*name++ = *f++) == '-') \
+                       return False; 
+#define PutHyphen()\
+       if (--left < 0) \
+               return False; \
+       *name++ = '-';
+
+#define PutUnsigned(field, bit) \
+       f = (fontNameAttributes & bit) ? \
+               utoa (fontName->field, number, sizeof (number)) \
+               : "*"; \
+       if ((left -= strlen (f)) < 0) \
+               return False; \
+       while (*f) \
+               *name++ = *f++;
+
+       PutString (Registry, FontNameRegistry)
+       PutHyphen ();
+       PutString (Foundry, FontNameFoundry)
+       PutHyphen ();
+       PutString (FamilyName, FontNameFamilyName)
+       PutHyphen ();
+       PutString (WeightName, FontNameWeightName)
+       PutHyphen ();
+       PutString (Slant, FontNameSlant)
+       PutHyphen ();
+       PutString (SetwidthName, FontNameSetwidthName)
+       PutHyphen ();
+       PutString (AddStyleName, FontNameAddStyleName)
+       PutHyphen ();
+       PutUnsigned (PixelSize, FontNamePixelSize)
+       PutHyphen ();
+       PutUnsigned (PointSize, FontNamePointSize)
+       PutHyphen ();
+       PutUnsigned (ResolutionX, FontNameResolutionX)
+       PutHyphen ();
+       PutUnsigned (ResolutionY, FontNameResolutionY)
+       PutHyphen ();
+       PutString (Spacing, FontNameSpacing)
+       PutHyphen ();
+       PutUnsigned (AverageWidth, FontNameAverageWidth)
+       PutHyphen ();
+       PutString (CharSetRegistry, FontNameCharSetRegistry)
+       PutHyphen ();
+       PutString (CharSetEncoding, FontNameCharSetEncoding)
+       *name = '\0';
+       strcpy (fontNameString, tmp);
+       return True;
+}
+
+#if 0
+Bool
+XCompareFontName (
+       XFontName       *name1,
+       XFontName       *name2,
+       unsigned int    fontNameAttributes)
+{
+#define CompareString(field,bit) \
+       if (fontNameAttributes & bit) \
+               if (strcmp (name1->field, name2->field)) \
+                       return False;
+
+#define CompareUnsigned(field,bit) \
+       if (fontNameAttributes & bit) \
+               if (name1->field != name2->field) \
+                       return False;
+
+       CompareString (Registry, FontNameRegistry)
+       CompareString (Foundry, FontNameFoundry)
+       CompareString (FamilyName, FontNameFamilyName)
+       CompareString (WeightName, FontNameWeightName)
+       CompareString (Slant, FontNameSlant)
+       CompareString (SetwidthName, FontNameSetwidthName)
+       CompareString (AddStyleName, FontNameAddStyleName)
+       CompareUnsigned (PixelSize, FontNamePixelSize)
+       CompareUnsigned (PointSize, FontNamePointSize)
+       CompareUnsigned (ResolutionX, FontNameResolutionX)
+       CompareUnsigned (ResolutionY, FontNameResolutionY)
+       CompareString (Spacing, FontNameSpacing)
+       CompareUnsigned (AverageWidth, FontNameAverageWidth)
+       CompareString (CharSetRegistry, FontNameCharSetRegistry)
+       CompareString (CharSetEncoding, FontNameCharSetEncoding)
+       return True;
+}
+
+Bool
+XCopyFontName (
+       XFontName       *name1,
+       XFontName       *name2,
+       unsigned int    fontNameAttributes)
+{
+#define CopyString(field,bit) \
+       if (fontNameAttributes & bit) \
+               strcpy (name2->field, name1->field);
+
+#define CopyUnsigned(field,bit) \
+       if (fontNameAttributes & bit) \
+               name2->field = name1->field;
+
+       CopyString (Registry, FontNameRegistry)
+       CopyString (Foundry, FontNameFoundry)
+       CopyString (FamilyName, FontNameFamilyName)
+       CopyString (WeightName, FontNameWeightName)
+       CopyString (Slant, FontNameSlant)
+       CopyString (SetwidthName, FontNameSetwidthName)
+       CopyString (AddStyleName, FontNameAddStyleName)
+       CopyUnsigned (PixelSize, FontNamePixelSize)
+       CopyUnsigned (PointSize, FontNamePointSize)
+       CopyUnsigned (ResolutionX, FontNameResolutionX)
+       CopyUnsigned (ResolutionY, FontNameResolutionY)
+       CopyString (Spacing, FontNameSpacing)
+       CopyUnsigned (AverageWidth, FontNameAverageWidth)
+       CopyString (CharSetRegistry, FontNameCharSetRegistry)
+       CopyString (CharSetEncoding, FontNameCharSetEncoding)
+       return True;
+}
+#endif
diff --git a/xditview/XFontName.h b/xditview/XFontName.h
new file mode 100644 (file)
index 0000000..b75ed9e
--- /dev/null
@@ -0,0 +1,55 @@
+/* $XFree86$ */
+
+#ifndef _XFONTNAME_H_
+#define _XFONTNAME_H_
+
+typedef struct _xFontName {
+       char            Registry[256];
+       char            Foundry[256];
+       char            FamilyName[256];
+       char            WeightName[256];
+       char            Slant[3];
+       char            SetwidthName[256];
+       char            AddStyleName[256];
+       unsigned int    PixelSize;
+       unsigned int    PointSize;
+       unsigned int    ResolutionX;
+       unsigned int    ResolutionY;
+       char            Spacing[2];
+       unsigned int    AverageWidth;
+       char            CharSetRegistry[256];
+       char            CharSetEncoding[256];
+} XFontName;
+
+#define FontNameRegistry       (1<<0)
+#define FontNameFoundry                (1<<1)
+#define FontNameFamilyName     (1<<2)
+#define FontNameWeightName     (1<<3)
+#define FontNameSlant          (1<<4)
+#define FontNameSetwidthName   (1<<5)
+#define FontNameAddStyleName   (1<<6)
+#define FontNamePixelSize      (1<<7)
+#define FontNamePointSize      (1<<8)
+#define FontNameResolutionX    (1<<9)
+#define FontNameResolutionY    (1<<10)
+#define FontNameSpacing                (1<<11)
+#define FontNameAverageWidth   (1<<12)
+#define FontNameCharSetRegistry        (1<<13)
+#define FontNameCharSetEncoding        (1<<14)
+
+#define SlantRoman             "R"
+#define SlantItalic            "I"
+#define SlantOblique           "O"
+#define SlantReverseItalic     "RI"
+#define SlantReverseOblique    "RO"
+
+#define SpacingMonoSpaced      "M"
+#define SpacingProportional    "P"
+#define SpacingCharacterCell   "C"
+
+typedef char   XFontNameString[256];
+
+extern Bool    XParseFontName(XFontNameString, XFontName *, unsigned int *);
+extern Bool    XFormatFontName(XFontName *, unsigned int, XFontNameString);
+
+#endif
diff --git a/xditview/Xditview-chrtr.ad b/xditview/Xditview-chrtr.ad
new file mode 100644 (file)
index 0000000..345c190
--- /dev/null
@@ -0,0 +1,25 @@
+#include "Xditview"
+*Dvi.fontMap:\
+R      -*-charter-medium-r-normal--*-*-*-*-*-*-iso8859-1\n\
+I      -*-charter-medium-i-normal--*-*-*-*-*-*-iso8859-1\n\
+B      -*-charter-bold-r-normal--*-*-*-*-*-*-iso8859-1\n\
+F      -*-charter-bold-i-normal--*-*-*-*-*-*-iso8859-1\n\
+BI     -*-charter-bold-i-normal--*-*-*-*-*-*-iso8859-1\n\
+C      -*-courier-medium-r-normal--*-*-*-*-*-*-iso8859-1\n\
+CO     -*-courier-medium-o-normal--*-*-*-*-*-*-iso8859-1\n\
+CB     -*-courier-bold-r-normal--*-*-*-*-*-*-iso8859-1\n\
+CF     -*-courier-bold-o-normal--*-*-*-*-*-*-iso8859-1\n\
+H      -*-helvetica-medium-r-normal--*-*-*-*-*-*-iso8859-1\n\
+HO     -*-helvetica-medium-o-normal--*-*-*-*-*-*-iso8859-1\n\
+HB     -*-helvetica-bold-r-normal--*-*-*-*-*-*-iso8859-1\n\
+HF     -*-helvetica-bold-o-normal--*-*-*-*-*-*-iso8859-1\n\
+N      -*-new century schoolbook-medium-r-normal--*-*-*-*-*-*-iso8859-1\n\
+NI     -*-new century schoolbook-medium-i-normal--*-*-*-*-*-*-iso8859-1\n\
+NB     -*-new century schoolbook-bold-r-normal--*-*-*-*-*-*-iso8859-1\n\
+NF     -*-new century schoolbook-bold-i-normal--*-*-*-*-*-*-iso8859-1\n\
+A      -*-charter-medium-r-normal--*-*-*-*-*-*-iso8859-1\n\
+AI     -*-charter-medium-i-normal--*-*-*-*-*-*-iso8859-1\n\
+AB     -*-charter-bold-r-normal--*-*-*-*-*-*-iso8859-1\n\
+AF     -*-charter-bold-i-normal--*-*-*-*-*-*-iso8859-1\n\
+S      -*-symbol-medium-r-normal--*-*-*-*-*-*-adobe-fontspecific\n\
+S2     -*-symbol-medium-r-normal--*-*-*-*-*-*-adobe-fontspecific\n
diff --git a/xditview/Xditview.ad b/xditview/Xditview.ad
new file mode 100644 (file)
index 0000000..e20734d
--- /dev/null
@@ -0,0 +1,96 @@
+Xditview.geometry: 600x800
+*MenuButton*Font:      -*-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-1
+*SimpleMenu*Font:      -*-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-1
+*Text*Font:    -*-courier-medium-r-normal--*-120-*-*-*-*-iso8859-1
+
+*paned.allowResize:            true
+*paned.?.showGrip:             false
+*paned.?.skipAdjust:           false
+*paned.form.porthole.width:    600
+*paned.form.porthole.height:   800
+*paned.label.skipAdjust:       true
+
+*MenuButton.shapeStyle: oval
+*Command.shapeStyle: oval
+
+*fileMenuButton.label:         File
+*fileMenuButton.leftBitmap:    menu12
+*fileMenuButton.menuName:      fileMenu
+
+*fileMenu.openFile.label:      Open File
+*fileMenu.revisitFile.label:   Reopen File
+*fileMenu.setResolution.label: Set Screen Resolution
+*fileMenu.quit.label:          Quit
+
+*prevButton.bitmap:            ldblarrow
+*prevButton.internalHeight:    0
+*prevButton.Translations:      #override <BtnUp>: PreviousPage() unset()
+
+*pageNumber.translations: #override\
+     Ctrl<Key>J:    SetPageNumber()\n\
+     Ctrl<Key>M:    SetPageNumber()\n\
+     <Key>Linefeed: SetPageNumber()\n\
+     <Key>Return:   SetPageNumber()\n\
+     Ctrl<Key>O:    Noop()\n\
+     Meta<Key>I:    Noop()\n\
+     Ctrl<Key>N:    Noop()\n\
+     Ctrl<Key>P:    Noop()\n\
+     Ctrl<Key>Z:    Noop()\n\
+     Meta<Key>Z:    Noop()\n\
+     <Key>space:    NextPage()\n\
+     Ctrl<Key>v:    NextPage()\n\
+     Meta<Key>v:    PreviousPage()\n\
+     <Key>Next:            NextPage()\n\
+     <Key>Prior:    PreviousPage()\n\
+     <Key>Find:            OpenFile()
+*pageNumber*editType:  edit
+
+*nextButton.bitmap:            rdblarrow
+*nextButton.internalHeight:    0
+*nextButton.translations:      #override <BtnUp>: NextPage() unset()
+
+*viewport.allowResize: false
+*viewport.forceBars:   true
+*viewport.allowHoriz: true
+*viewport.allowVert: true
+
+*dvi.translations: #augment \
+       <Btn1Down>:     XawPositionSimpleMenu(popupMenu) MenuPopup(popupMenu)\n\
+       Ctrl<Key>v:     NextPage()\n\
+       Meta<Key>v:     PreviousPage()\n\
+       <Key>space:     NextPage()\n\
+       <Key>Next:      NextPage()\n\
+       <Key>Prior:     PreviousPage()\n\
+       <Key>Find:      OpenFile()
+*dvi.baseTranslations: #augment \
+       <Btn1Down>:     XawPositionSimpleMenu(popupMenu) MenuPopup(popupMenu)\n\
+       <Key>space:     NextPage()\n\
+       Ctrl<Key>v:     NextPage()\n\
+       Meta<Key>v:     PreviousPage()\n\
+       <Key>Next:      NextPage()\n\
+       <Key>Prior:     PreviousPage()\n\
+       <Key>Find:      OpenFile()
+*popupMenu.nextPage.label:     Next Page
+*popupMenu.previousPage.label: Previous Page
+*popupMenu.setResolution.label:        Set Screen Resolution
+*popupMenu.openFile.label:     Open File
+*popupMenu.revisitFile.label:  Reopen File
+*popupMenu.quit.label:         Quit
+
+*promptShell.allowShellResize: true
+*promptShell.promptDialog.value.translations: #override\
+       <Key>Return: Accept()
+*promptShell.promptDialog.value.baseTranslations: #override\
+       <Key>Return: Accept()
+
+*promptShell.promptDialog.accept.label: Accept
+*promptShell.promptDialog.accept.translations: #override\
+       <BtnUp>: Accept() unset()
+*promptShell.promptDialog.accept.baseTranslations: #override \
+       <BtnUp>: Accept() unset()
+
+*promptShell.promptDialog.cancel.label: Cancel
+*promptShell.promptDialog.cancel.translations: #override \
+       <BtnUp>: Cancel() unset()
+*promptShell.promptDialog.cancel.baseTranslations: #override \
+       <BtnUp>: Cancel() unset()
diff --git a/xditview/aclocal.m4 b/xditview/aclocal.m4
new file mode 100644 (file)
index 0000000..103df10
--- /dev/null
@@ -0,0 +1,1581 @@
+# 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 <scott@netsplit.com>.
+#
+# 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 <http://www.freedesktop.org/software/pkgconfig>.])],
+               [$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 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 
+
+# XAW_CHECK_XPRINT_SUPPORT()
+# --------------------------
+# Adds --enable/disable-xprint and selects the appropriate version of the Xaw 
+# library. If neither --enable-xprint nor --disable-xprint are given, 
+# the presence of an Xaw with Xprint support will be auto detected
+
+AC_DEFUN([XAW_CHECK_XPRINT_SUPPORT],[
+       AC_ARG_ENABLE(xprint, AC_HELP_STRING([--enable-xprint], [Enable XPrint support]),
+                       [use_xprint=$enableval],[use_xprint=auto])
+       if test "x$use_xprint" = "xyes"; then
+               TMP_CHECK1=xaw8
+               TMP_CHECK2=
+               xaw_use_xprint=yes
+       elif test "x$use_xprint" = "xno"; then
+               TMP_CHECK1=xaw7
+               TMP_CHECK2=
+               xaw_use_xprint=no
+       else
+               TMP_CHECK1=xaw8
+               TMP_CHECK2=xaw7
+               xaw_use_xprint=yes
+       fi
+
+       PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK1, success=yes, success=no)
+       if [[ ! -z $TMP_CHECK2 ]] ; then
+               if test $success = no ; then
+                       PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK2, success=yes, success=no)
+                       xaw_use_xprint=no
+               fi
+       fi
+
+       if test "x$success" = "xyes"; then
+               $1_CFLAGS=$TMP_XAW_CFLAGS
+               $1_LIBS=$TMP_XAW_LIBS
+
+               AM_CONDITIONAL([XAW_USE_XPRINT], [test "x$xaw_use_xprint" = "xyes"])
+       else
+               AC_MSG_ERROR([No suitable version of Xaw found])
+       fi
+])
+
+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.2
+       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],[
+XORG_SGML_PATH=$prefix/share/sgml
+HAVE_DEFS_ENT=
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+AC_PATH_PROG(PS2PDF, ps2pdf)
+
+AC_MSG_CHECKING([Whether to build documentation])
+
+if test x$HAVE_DEFS_ENT != 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 && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+XORG_SGML_PATH=$prefix/share/sgml
+HAVE_DEFS_ENT=
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([Whether to build text documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([Whether to build PDF documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([Whether to build PostScript documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([Whether to build HTML documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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/xditview/compile b/xditview/compile
new file mode 100755 (executable)
index 0000000..1b1d232
--- /dev/null
@@ -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 <tromey@cygnus.com>.
+#
+# 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 <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+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 <bug-automake@gnu.org>.
+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/xditview/config.guess b/xditview/config.guess
new file mode 100755 (executable)
index 0000000..396482d
--- /dev/null
@@ -0,0 +1,1500 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
+
+timestamp='2006-07-02'
+
+# 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 <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+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 "$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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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 <stdlib.h>
+              #include <unistd.h>
+
+              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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       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*:[3456]*)
+       echo i586-pc-interix${UNAME_RELEASE}
+       exit ;;
+    EM64T:Interix*:[3456]*)
+       echo x86_64-unknown-interix${UNAME_RELEASE}
+       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*:*:* | x86_64: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 ;;
+    avr32*: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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-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 ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-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 <features.h>
+       #ifdef __ELF__
+       # ifdef __GLIBC__
+       #  if __GLIBC__ >= 2
+       LIBC=gnu
+       #  else
+       LIBC=gnulibc1
+       #  endif
+       # else
+       LIBC=gnulibc1
+       # endif
+       #else
+       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+       LIBC=gnu
+       #else
+       LIBC=gnuaout
+       #endif
+       #endif
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^LIBC/{
+               s: ::g
+               p
+           }'`"
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/xditview/config.h.in b/xditview/config.h.in
new file mode 100644 (file)
index 0000000..424aa8e
--- /dev/null
@@ -0,0 +1,25 @@
+/* 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
diff --git a/xditview/config.sub b/xditview/config.sub
new file mode 100755 (executable)
index 0000000..387c18d
--- /dev/null
@@ -0,0 +1,1608 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
+
+timestamp='2006-07-02'
+
+# 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 <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+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-newlib* | 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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | 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 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | 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 \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | 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 | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xscale | xscalee[bl] | 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)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | 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-* \
+       | m32c-* | 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-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | 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-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | 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-*)
+               ;;
+       # 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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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 | sparcv9v)
+               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* | -solidbsd* \
+             | -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-newlib* | -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* | -rdos* | -toppers*)
+       # 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
+        spu-*)
+               os=-elf
+               ;;
+       *-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/xditview/configure b/xditview/configure
new file mode 100755 (executable)
index 0000000..6962fb7
--- /dev/null
@@ -0,0 +1,5498 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.61 for xditview 1.0.1.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+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) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&    (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    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=.
+  case $as_dir in
+        /*)
+          for as_base in sh bash ksh sh5; do
+            as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+          done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+        # Try only shells that exist, to save several forks.
+        if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+               { ("$as_shell") 2> /dev/null <<\_ASEOF
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+              as_have_required=yes
+              if { "$as_shell" 2> /dev/null <<\_ASEOF
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf@gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+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$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+       case $1 in
+        -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# 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`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='xditview'
+PACKAGE_TARNAME='xditview'
+PACKAGE_VERSION='1.0.1'
+PACKAGE_STRING='xditview 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
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+CYGPATH_W
+PACKAGE
+VERSION
+ACLOCAL
+AUTOCONF
+AUTOMAKE
+AUTOHEADER
+MAKEINFO
+install_sh
+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
+TMP_XAW_CFLAGS
+TMP_XAW_LIBS
+XAW_USE_XPRINT_TRUE
+XAW_USE_XPRINT_FALSE
+XDITVIEW_CFLAGS
+XDITVIEW_LIBS
+APPDEFS_CFLAGS
+APPDEFS_LIBS
+appdefaultdir
+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=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+PKG_CONFIG
+TMP_XAW_CFLAGS
+TMP_XAW_LIBS
+APPDEFS_CFLAGS
+APPDEFS_LIBS'
+
+
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)   ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$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 ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -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'`
+    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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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'`
+    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; }; }
+    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 directory names.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { echo "$as_me: error: Working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$0" ||
+$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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 xditview 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR          info documentation [DATAROOTDIR/info]
+  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR           man documentation [DATAROOTDIR/man]
+  --docdir=DIR           documentation root [DATAROOTDIR/doc/xditview]
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
+_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 xditview 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 build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-xprint         Enable XPrint 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<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  PKG_CONFIG  path to pkg-config utility
+  TMP_XAW_CFLAGS
+              C compiler flags for TMP_XAW, overriding pkg-config
+  TMP_XAW_LIBS
+              linker flags for TMP_XAW, overriding pkg-config
+  APPDEFS_CFLAGS
+              C compiler flags for APPDEFS, overriding pkg-config
+  APPDEFS_LIBS
+              linker flags for APPDEFS, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" || continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+xditview configure 1.0.1
+generated by GNU Autoconf 2.61
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 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
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by xditview $as_me 1.0.1, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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
+IFS=$as_save_IFS
+
+} >&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_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_arg'"
+      ;;
+    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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+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,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r 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 -f -r conftest* 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 -n "$CONFIG_SITE"; then
+  set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+  set x "$ac_default_prefix/share/config.site" \
+       "$ac_default_prefix/etc/config.site"
+fi
+shift
+for ac_site_file
+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 $ac_precious_vars; 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
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    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 -f 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$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='xditview'
+ 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"}
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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.exe
+  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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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.exe
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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[^ ]*//'`
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
+  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
+
+# Check that 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'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 that 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 { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 | *.map | *.inf | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+    *) 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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; 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 core 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
+{ 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
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       CFLAGS=""
+      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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+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 ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_c89=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 <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+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 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    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 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 <limits.h> declares mkstemp.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define mkstemp innocuous_mkstemp
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char mkstemp (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef mkstemp
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+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
+#endif
+
+int
+main ()
+{
+return mkstemp ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+  ;;
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+  ;;
+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
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+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
+
+       # Check whether --enable-xprint was given.
+if test "${enable_xprint+set}" = set; then
+  enableval=$enable_xprint; use_xprint=$enableval
+else
+  use_xprint=auto
+fi
+
+       if test "x$use_xprint" = "xyes"; then
+               TMP_CHECK1=xaw8
+               TMP_CHECK2=
+               xaw_use_xprint=yes
+       elif test "x$use_xprint" = "xno"; then
+               TMP_CHECK1=xaw7
+               TMP_CHECK2=
+               xaw_use_xprint=no
+       else
+               TMP_CHECK1=xaw8
+               TMP_CHECK2=xaw7
+               xaw_use_xprint=yes
+       fi
+
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for TMP_XAW" >&5
+echo $ECHO_N "checking for TMP_XAW... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$TMP_XAW_CFLAGS"; then
+        pkg_cv_TMP_XAW_CFLAGS="$TMP_XAW_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK1\"") >&5
+  ($PKG_CONFIG --exists --print-errors "$TMP_CHECK1") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_TMP_XAW_CFLAGS=`$PKG_CONFIG --cflags "$TMP_CHECK1" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$TMP_XAW_LIBS"; then
+        pkg_cv_TMP_XAW_LIBS="$TMP_XAW_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK1\"") >&5
+  ($PKG_CONFIG --exists --print-errors "$TMP_CHECK1") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_TMP_XAW_LIBS=`$PKG_CONFIG --libs "$TMP_CHECK1" 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
+               TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$TMP_CHECK1"`
+        else
+               TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$TMP_CHECK1"`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$TMP_XAW_PKG_ERRORS" >&5
+
+       { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+                success=no
+elif test $pkg_failed = untried; then
+       success=no
+else
+       TMP_XAW_CFLAGS=$pkg_cv_TMP_XAW_CFLAGS
+       TMP_XAW_LIBS=$pkg_cv_TMP_XAW_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       success=yes
+fi
+       if [ ! -z $TMP_CHECK2 ] ; then
+               if test $success = no ; then
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for TMP_XAW" >&5
+echo $ECHO_N "checking for TMP_XAW... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$TMP_XAW_CFLAGS"; then
+        pkg_cv_TMP_XAW_CFLAGS="$TMP_XAW_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK2\"") >&5
+  ($PKG_CONFIG --exists --print-errors "$TMP_CHECK2") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_TMP_XAW_CFLAGS=`$PKG_CONFIG --cflags "$TMP_CHECK2" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$TMP_XAW_LIBS"; then
+        pkg_cv_TMP_XAW_LIBS="$TMP_XAW_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK2\"") >&5
+  ($PKG_CONFIG --exists --print-errors "$TMP_CHECK2") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_TMP_XAW_LIBS=`$PKG_CONFIG --libs "$TMP_CHECK2" 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
+               TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$TMP_CHECK2"`
+        else
+               TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$TMP_CHECK2"`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$TMP_XAW_PKG_ERRORS" >&5
+
+       { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+                success=no
+elif test $pkg_failed = untried; then
+       success=no
+else
+       TMP_XAW_CFLAGS=$pkg_cv_TMP_XAW_CFLAGS
+       TMP_XAW_LIBS=$pkg_cv_TMP_XAW_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       success=yes
+fi
+                       xaw_use_xprint=no
+               fi
+       fi
+
+       if test "x$success" = "xyes"; then
+               XDITVIEW_CFLAGS=$TMP_XAW_CFLAGS
+               XDITVIEW_LIBS=$TMP_XAW_LIBS
+
+
+
+if test "x$xaw_use_xprint" = "xyes"; then
+  XAW_USE_XPRINT_TRUE=
+  XAW_USE_XPRINT_FALSE='#'
+else
+  XAW_USE_XPRINT_TRUE='#'
+  XAW_USE_XPRINT_FALSE=
+fi
+
+       else
+               { { echo "$as_me:$LINENO: error: No suitable version of Xaw found" >&5
+echo "$as_me: error: No suitable version of Xaw found" >&2;}
+   { (exit 1); exit 1; }; }
+       fi
+
+
+
+
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for APPDEFS" >&5
+echo $ECHO_N "checking for APPDEFS... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$APPDEFS_CFLAGS"; then
+        pkg_cv_APPDEFS_CFLAGS="$APPDEFS_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_APPDEFS_CFLAGS=`$PKG_CONFIG --cflags "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$APPDEFS_LIBS"; then
+        pkg_cv_APPDEFS_LIBS="$APPDEFS_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_APPDEFS_LIBS=`$PKG_CONFIG --libs "xt" 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
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xt"`
+        else
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xt"`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$APPDEFS_PKG_ERRORS" >&5
+
+       { { echo "$as_me:$LINENO: error: Package requirements (xt) were not met:
+
+$APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_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 (xt) were not met:
+
+$APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+       APPDEFS_CFLAGS=$pkg_cv_APPDEFS_CFLAGS
+       APPDEFS_LIBS=$pkg_cv_APPDEFS_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       :
+fi
+appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/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_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { 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=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_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; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ 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
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+
+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 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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     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 "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+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_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$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 "${XAW_USE_XPRINT_TRUE}" && test -z "${XAW_USE_XPRINT_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"XAW_USE_XPRINT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"XAW_USE_XPRINT\" 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+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) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+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$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+       case $1 in
+        -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by xditview $as_me 1.0.1, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+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 and configuration settings, 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 <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+xditview config.status 1.0.1
+configured by $0, generated by GNU Autoconf 2.61,
+  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2006 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+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
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --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;;
+  --he | --h)
+    # Conflict between --help and --header
+    { 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 ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { 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"
+     ac_need_defaults=false ;;
+
+  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 CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  CONFIG_SHELL=$SHELL
+  export CONFIG_SHELL
+  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) { { 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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+#
+# Set up the sed scripts for 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
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+CYGPATH_W!$CYGPATH_W$ac_delim
+PACKAGE!$PACKAGE$ac_delim
+VERSION!$VERSION$ac_delim
+ACLOCAL!$ACLOCAL$ac_delim
+AUTOCONF!$AUTOCONF$ac_delim
+AUTOMAKE!$AUTOMAKE$ac_delim
+AUTOHEADER!$AUTOHEADER$ac_delim
+MAKEINFO!$MAKEINFO$ac_delim
+install_sh!$install_sh$ac_delim
+STRIP!$STRIP$ac_delim
+INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
+mkdir_p!$mkdir_p$ac_delim
+AWK!$AWK$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+am__leading_dot!$am__leading_dot$ac_delim
+AMTAR!$AMTAR$ac_delim
+am__tar!$am__tar$ac_delim
+am__untar!$am__untar$ac_delim
+MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
+MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
+MAINT!$MAINT$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+DEPDIR!$DEPDIR$ac_delim
+am__include!$am__include$ac_delim
+am__quote!$am__quote$ac_delim
+AMDEP_TRUE!$AMDEP_TRUE$ac_delim
+AMDEP_FALSE!$AMDEP_FALSE$ac_delim
+AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
+CCDEPMODE!$CCDEPMODE$ac_delim
+am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
+am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
+PKG_CONFIG!$PKG_CONFIG$ac_delim
+TMP_XAW_CFLAGS!$TMP_XAW_CFLAGS$ac_delim
+TMP_XAW_LIBS!$TMP_XAW_LIBS$ac_delim
+XAW_USE_XPRINT_TRUE!$XAW_USE_XPRINT_TRUE$ac_delim
+XAW_USE_XPRINT_FALSE!$XAW_USE_XPRINT_FALSE$ac_delim
+XDITVIEW_CFLAGS!$XDITVIEW_CFLAGS$ac_delim
+XDITVIEW_LIBS!$XDITVIEW_LIBS$ac_delim
+APPDEFS_CFLAGS!$APPDEFS_CFLAGS$ac_delim
+APPDEFS_LIBS!$APPDEFS_LIBS$ac_delim
+appdefaultdir!$appdefaultdir$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+host_os!$host_os$ac_delim
+APP_MAN_SUFFIX!$APP_MAN_SUFFIX$ac_delim
+LIB_MAN_SUFFIX!$LIB_MAN_SUFFIX$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+FILE_MAN_SUFFIX!$FILE_MAN_SUFFIX$ac_delim
+MISC_MAN_SUFFIX!$MISC_MAN_SUFFIX$ac_delim
+DRIVER_MAN_SUFFIX!$DRIVER_MAN_SUFFIX$ac_delim
+ADMIN_MAN_SUFFIX!$ADMIN_MAN_SUFFIX$ac_delim
+APP_MAN_DIR!$APP_MAN_DIR$ac_delim
+LIB_MAN_DIR!$LIB_MAN_DIR$ac_delim
+FILE_MAN_DIR!$FILE_MAN_DIR$ac_delim
+MISC_MAN_DIR!$MISC_MAN_DIR$ac_delim
+DRIVER_MAN_DIR!$DRIVER_MAN_DIR$ac_delim
+ADMIN_MAN_DIR!$ADMIN_MAN_DIR$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 12; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_ACEOF
+
+
+# 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
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      ac_file_inputs="$ac_file_inputs $ac_f"
+    done
+
+    # 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.  */
+    configure_input="Generated from "`IFS=:
+         echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    fi
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin";;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$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'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+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&@top_builddir@&$ac_top_builddir_sub&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out"; rm -f "$tmp/out";;
+  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
+  esac
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+_ACEOF
+
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status.  If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless.  But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([  #]*\\)[^        ]*\\([  ]*'
+ac_dB='\\)[     (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
+
+uniq confdefs.h |
+  sed -n '
+       t rset
+       :rset
+       s/^[     ]*#[    ]*define[       ][      ]*//
+       t ok
+       d
+       :ok
+       s/[\\&,]/\\&/g
+       s/^\('"$ac_word_re"'\)\(([^()]*)\)[      ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+       s/^\('"$ac_word_re"'\)[  ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+  ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then replace #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.
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[    #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is:         sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is:        sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be:    sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
+do
+  # Write a here document:
+    cat >>$CONFIG_STATUS <<_ACEOF
+    # First, check the format of the line:
+    cat >"\$tmp/defines.sed" <<\\CEOF
+/^[     ]*#[    ]*undef[        ][      ]*$ac_word_re[  ]*\$/b def
+/^[     ]*#[    ]*define[       ][      ]*$ac_word_re[(         ]/b def
+b
+:def
+_ACEOF
+  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+  grep . conftest.tail >/dev/null || break
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines conftest.tail
+
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
+cat >>$CONFIG_STATUS <<\_ACEOF
+  if test x"$ac_file" != x-; then
+    echo "/* $configure_input  */" >"$tmp/config.h"
+    cat "$ac_result" >>"$tmp/config.h"
+    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
+      rm -f $ac_file
+      mv "$tmp/config.h" $ac_file
+    fi
+  else
+    echo "/* $configure_input  */"
+    cat "$ac_result"
+  fi
+  rm -f "$tmp/out12"
+# 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" >`$as_dirname -- $ac_file ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X$ac_file : 'X\(//\)[^/]' \| \
+        X$ac_file : 'X\(//\)$' \| \
+        X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
+echo X$ac_file |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) 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=`$as_dirname -- "$mf" ||
+$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=`$as_dirname -- "$file" ||
+$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'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$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'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (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/xditview/configure.ac b/xditview/configure.ac
new file mode 100644 (file)
index 0000000..186df29
--- /dev/null
@@ -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(xditview,[1.0.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xditview)
+AM_INIT_AUTOMAKE([dist-bzip2])
+AM_MAINTAINER_MODE
+
+AM_CONFIG_HEADER(config.h)
+
+AC_PROG_CC
+AC_PROG_INSTALL
+
+AC_CHECK_FUNC([mkstemp], 
+   AC_DEFINE(HAS_MKSTEMP,1,[Define to 1 if you have the `mkstemp' function.]))
+
+# Checks for pkg-config packages
+XAW_CHECK_XPRINT_SUPPORT(XDITVIEW)
+AC_SUBST(XDITVIEW_CFLAGS)
+AC_SUBST(XDITVIEW_LIBS)
+
+PKG_CHECK_MODULES(APPDEFS, xt)
+appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+AC_SUBST(appdefaultdir)
+
+XORG_MANPAGE_SECTIONS
+XORG_RELEASE_VERSION
+
+AC_OUTPUT([Makefile])
diff --git a/xditview/depcomp b/xditview/depcomp
new file mode 100755 (executable)
index 0000000..04701da
--- /dev/null
@@ -0,0 +1,530 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2005-07-09.11
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+gcc)
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+  sed -e 's/^[^:]*: / /' \
+      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+  tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'.  On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like `#:fec' to the end of the
+    # dependency line.
+    tr ' ' '
+' < "$tmpdepfile" \
+    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+    tr '
+' ' ' >> $depfile
+    echo >> $depfile
+
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' '
+' < "$tmpdepfile" \
+   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+   >> $depfile
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+aix)
+  # The C for AIX Compiler uses -M and outputs the dependencies
+  # in a .u file.  In older versions, this file always lives in the
+  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # start of each line; $object doesn't have directory information.
+  # Version 6 uses the directory in both cases.
+  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+  tmpdepfile="$stripped.u"
+  if test "$libtool" = yes; then
+    "$@" -Wc,-M
+  else
+    "$@" -M
+  fi
+  stat=$?
+
+  if test -f "$tmpdepfile"; then :
+  else
+    stripped=`echo "$stripped" | sed 's,^.*/,,'`
+    tmpdepfile="$stripped.u"
+  fi
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+
+  if test -f "$tmpdepfile"; then
+    outname="$stripped.o"
+    # Each line is of the form `foo.o: dependent.h'.
+    # Do two passes, one to just change these to
+    # `$object: dependent.h' and one to simply `dependent.h:'.
+    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+icc)
+  # Intel's C compiler understands `-MD -MF file'.  However on
+  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+  # ICC 7.0 will fill foo.d with something like
+  #    foo.o: sub/foo.c
+  #    foo.o: sub/foo.h
+  # which is wrong.  We want:
+  #    sub/foo.o: sub/foo.c
+  #    sub/foo.o: sub/foo.h
+  #    sub/foo.c:
+  #    sub/foo.h:
+  # ICC 7.1 will output
+  #    foo.o: sub/foo.c sub/foo.h
+  # and will wrap long lines using \ :
+  #    foo.o: sub/foo.c ... \
+  #     sub/foo.h ... \
+  #     ...
+
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Do two passes, one to just change these to
+  # `$object: dependent.h' and one to simply `dependent.h:'.
+  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+    sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+   # dependencies in `foo.d' instead, so we check for that too.
+   # Subdirectories are respected.
+   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+   test "x$dir" = "x$object" && dir=
+   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+   if test "$libtool" = yes; then
+      # With Tru64 cc, shared objects can also be used to make a
+      # static library.  This mecanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in in $dir.libs/$base.o.d and
+      # in $dir$base.o.d.  We have to check for both files, because
+      # one of the two compilations can be disabled.  We should prefer
+      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+      # automatically cleaned when .libs/ is deleted, while ignoring
+      # the former would cause a distcleancheck panic.
+      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
+      tmpdepfile2=$dir$base.o.d          # libtool 1.5
+      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
+      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
+      "$@" -Wc,-MD
+   else
+      tmpdepfile1=$dir$base.o.d
+      tmpdepfile2=$dir$base.d
+      tmpdepfile3=$dir$base.d
+      tmpdepfile4=$dir$base.d
+      "$@" -MD
+   fi
+
+   stat=$?
+   if test $stat -eq 0; then :
+   else
+      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+      exit $stat
+   fi
+
+   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+   do
+     test -f "$tmpdepfile" && break
+   done
+   if test -f "$tmpdepfile"; then
+      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+      # That's a tab and a space in the [].
+      sed -e 's,^.*\.[a-z]*:[   ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+   else
+      echo "#dummy" > "$depfile"
+   fi
+   rm -f "$tmpdepfile"
+   ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  # Require at least two characters before searching for `:'
+  # in the target name.  This is to cope with DOS-style filenames:
+  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  "$@" $dashmflag |
+    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # Remove any Libtool call
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no
+  for arg in "$@"; do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    # Strip any option that makedepend may not understand.  Remove
+    # the object too, otherwise makedepend will parse it as a source file.
+    -*|$object)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix="`echo $object | sed 's/^.*\././'`"
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  "$@" -E |
+    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+    sed '$ s: \\$::' > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o,
+  # because we must use -o when running libtool.
+  "$@" || exit $?
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::   \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/xditview/draw.c b/xditview/draw.c
new file mode 100644 (file)
index 0000000..78b707f
--- /dev/null
@@ -0,0 +1,546 @@
+/*
+ * $XConsortium: draw.c,v 1.8 94/04/17 20:43:35 gildea Exp $
+ * $XFree86: xc/programs/xditview/draw.c,v 1.4 2001/08/01 00:45:03 tsi Exp $
+ *
+Copyright (c) 1991  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
+CONNECTION 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 dealings
+in this Software without prior written authorization from the X Consortium.
+ *
+ */
+
+/*
+ * draw.c
+ *
+ * accept dvi function calls and translate to X
+ */
+
+/*
+  Support for ditroff drawing commands added: lines, circles, ellipses,
+  arcs and splines.  Splines are approximated as short lines by iterating
+  a simple approximation algorithm.  This seems good enough for previewing.
+
+  David Evans <dre@cs.nott.ac.uk>, 14th March, 1990
+*/
+
+#include <X11/Xos.h>
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <math.h>
+#include "DviP.h"
+#include <stdlib.h>
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846264338327950
+#endif
+
+/*     the following are for use in the spline approximation algorithm */
+
+typedef struct Point {
+    double     x;
+    double     y;
+    struct Point       *next;
+} Point;
+
+#define        ITERATIONS      10      /* iterations to approximate spline */
+
+#define        midx(p,q)       ((p->x + q->x) / 2)     /* mid x point on pq */
+#define        midy(p,q)       ((p->y + q->y) / 2)     /* mid y point on pq */
+
+#define        length(p,q)     sqrt(((q->x - p->x)*(q->x - p->x)) \
+                            + ((q->y - p->y)*(q->y - p->y))) /* length of pq */
+
+Point  *spline = (Point *)NULL;        /* head of spline linked list */
+
+static void    ApproxSpline(int n);
+static void    DeletePoint(Point *p);
+static void    DrawSplineSegments(DviWidget dw);
+static int     GetSpline(char *s);
+static void    InsertPoint(Point *p, Point *q);
+static void    LineApprox(Point *p1, Point *p2, Point *p3);
+static Point * MakePoint(double x, double y);
+
+void
+HorizontalMove(dw, delta)
+       DviWidget       dw;
+       int             delta;
+{
+    dw->dvi.state->x += delta;
+}
+
+void
+HorizontalGoto(dw, NewPosition)
+       DviWidget       dw;
+       int             NewPosition;
+{
+    dw->dvi.state->x = NewPosition;
+}
+
+void
+VerticalMove(dw, delta)
+       DviWidget       dw;
+       int             delta;
+{
+    dw->dvi.state->y += delta;
+}
+
+void
+VerticalGoto(dw, NewPosition)
+       DviWidget       dw;
+       int             NewPosition;
+{
+    dw->dvi.state->y = NewPosition;
+}
+
+#ifdef USE_XFT
+static void
+DrawText (DviWidget dw)
+{
+    int            i;
+    XftFont *font;
+
+    font = dw->dvi.cache.font;
+    for (i = 0; i <= dw->dvi.cache.index; i++)
+    {
+       if (dw->dvi.cache.cache[i].font)
+           font = dw->dvi.cache.cache[i].font;
+       XftDrawString8 (dw->dvi.draw, &dw->dvi.black,
+                       font,
+                       dw->dvi.cache.cache[i].x,
+                       dw->dvi.cache.start_y,
+                       (unsigned char *) dw->dvi.cache.cache[i].chars,
+                       dw->dvi.cache.cache[i].nchars);
+    }
+}
+#endif
+
+void
+FlushCharCache (dw)
+       DviWidget       dw;
+{
+    int            xx, yx;
+
+    xx = ToX(dw, dw->dvi.state->x);
+    yx = ToX(dw, dw->dvi.state->y);
+    if (dw->dvi.cache.char_index != 0)
+    {
+#ifdef USE_XFT
+       DrawText (dw);
+#else
+       XDrawText (XtDisplay (dw), XtWindow (dw), dw->dvi.normal_GC,
+                   dw->dvi.cache.start_x, dw->dvi.cache.start_y,
+                   dw->dvi.cache.cache, dw->dvi.cache.index + 1);
+#endif
+    }
+    dw->dvi.cache.index = 0;
+    dw->dvi.cache.max = DVI_TEXT_CACHE_SIZE;
+    if (dw->dvi.noPolyText)
+       dw->dvi.cache.max = 1;
+    dw->dvi.cache.char_index = 0;
+    dw->dvi.cache.cache[0].nchars = 0;
+    dw->dvi.cache.start_x = dw->dvi.cache.x = xx;
+    dw->dvi.cache.start_y = dw->dvi.cache.y = yx;
+}
+
+#if 0
+void
+ClearPage (DviWidget dw)
+{
+    if (dw->dvi.display_enable)
+       XClearWindow (XtDisplay (dw), XtWindow (dw));
+}
+#endif
+
+void
+SetGCForDraw (dw)
+    DviWidget  dw;
+{
+    int        lw;
+    if (dw->dvi.state->line_style != dw->dvi.line_style ||
+       dw->dvi.state->line_width != dw->dvi.line_width)
+    {
+       lw = ToX(dw, dw->dvi.state->line_width);
+       if (lw <= 1)
+           lw = 0;
+       XSetLineAttributes (XtDisplay (dw), dw->dvi.normal_GC,
+                           lw, LineSolid, CapButt, JoinMiter);
+       dw->dvi.line_style = dw->dvi.state->line_style;
+       dw->dvi.line_width = dw->dvi.state->line_width;
+    }
+}
+
+void
+DrawLine (dw, x, y)
+    DviWidget  dw;
+    int                x, y;
+{
+    if (dw->dvi.display_enable)
+       XDrawLine (XtDisplay (dw), XtWindow (dw), dw->dvi.normal_GC,
+                  ToX(dw, dw->dvi.state->x), ToX(dw, dw->dvi.state->y),
+                  ToX(dw, dw->dvi.state->x + x), ToX(dw,dw->dvi.state->y + y));
+    dw->dvi.state->x += x;
+    dw->dvi.state->y += y;
+}
+
+void
+DrawCircle (dw, diameter)
+       DviWidget       dw;
+       int             diameter;
+{
+    if (dw->dvi.display_enable)
+       XDrawArc (XtDisplay (dw), XtWindow (dw), dw->dvi.normal_GC,
+                 ToX(dw, dw->dvi.state->x),
+                 ToX(dw, dw->dvi.state->y - (diameter / 2)),
+                 ToX(dw, diameter), ToX(dw, diameter), 0, 360 * 64);
+    dw->dvi.state->x += diameter;
+}
+
+void
+DrawEllipse (dw, a, b)
+       DviWidget       dw;
+       int             a, b;
+{
+    if (dw->dvi.display_enable)
+       XDrawArc (XtDisplay (dw), XtWindow (dw), dw->dvi.normal_GC,
+                 ToX(dw, dw->dvi.state->x), ToX(dw, dw->dvi.state->y - (b / 2)),
+                 ToX(dw,a), ToX(dw,b), 0, 360 * 64);
+    dw->dvi.state->x += a;
+}
+
+
+/*     Convert angle in degrees to 64ths of a degree */
+
+static int
+ConvertAngle(int theta)
+{
+    return(theta * 64);
+}
+
+void
+DrawArc (dw, x0, y0, x1, y1)
+       DviWidget       dw;
+       int             x0, y0, x1, y1;
+{
+    int        xc, yc, x2, y2, r;
+    int        angle1, angle2;
+
+    /* centre */
+    xc = dw->dvi.state->x + x0;
+    yc = dw->dvi.state->y + y0;
+
+    /* to */
+    x2 = xc + x1;
+    y2 = yc + y1;
+
+    dw->dvi.state->x = x2;
+    dw->dvi.state->y = y2;
+
+    if (dw->dvi.display_enable) {
+
+       /* radius */
+       r = (int)sqrt((float) x1 * x1 + (float) y1 * y1);
+
+       /* start and finish angles */
+       if (x0 == 0) {
+               if (y0 >= 0)
+                       angle1 = 90;
+               else
+                       angle1 = 270;
+       }
+       else {
+               angle1 = (int) (atan((double)(y0) / (double)(x0)) * 180 / M_PI);
+               if (x0 > 0)
+                       angle1 = 180 - angle1;
+               else
+                       angle1 = -angle1;
+       }
+
+       if (x1 == 0) {
+               if (y1 <= 0)
+                       angle2 = 90;
+               else
+                       angle2 = 270;
+       }
+       else {
+               angle2 = (int) (atan((double)(y1) / (double)(x1)) * 180 / M_PI);
+               if (x1 < 0)
+                       angle2 = 180 - angle2;
+               else
+                       angle2 = -angle2;
+       }
+
+       if (angle1 < 0)
+               angle1 += 360;
+       if (angle2 < 0)
+               angle2 += 360;
+
+       if (angle2 < angle1)
+               angle1 -= 360;
+       angle2 = angle2 - angle1;
+
+       angle1 = ConvertAngle(angle1);
+       angle2 = ConvertAngle(angle2);
+
+       XDrawArc (XtDisplay (dw), XtWindow (dw), dw->dvi.normal_GC,
+                 ToX(dw, xc - r), ToX(dw, yc - r),
+                 ToX(dw, 2 * r), ToX(dw, 2 * r),
+                 angle1, angle2);
+    }
+}
+
+/* copy next non-blank string from p to temp, update p */
+
+static char *
+getstr(char *p, char *temp)
+{
+    while (*p == ' ' || *p == '\t' || *p == '\n')
+       p++;
+    if (*p == '\0') {
+       temp[0] = 0;
+       return((char *)NULL);
+    }
+    while (*p != ' ' && *p != '\t' && *p != '\n' && *p != '\0')
+       *temp++ = *p++;
+    *temp = '\0';
+    return(p);
+}
+
+
+/*     Draw a spline by approximating with short lines.      */
+
+/*ARGSUSED*/
+void
+DrawSpline (dw, s, len)
+       DviWidget       dw;
+       char            *s;
+       int             len;
+{
+    int                n;
+
+    /* get coordinate pairs into spline linked list */
+    if ((n = GetSpline(s)) <= 0)
+       return;
+
+    ApproxSpline(n);
+
+    DrawSplineSegments(dw);
+}
+
+
+/*     Parse string s to create a linked list of Point's with spline */
+/*     as its head.  Return the number of coordinate pairs found.    */
+
+static int
+GetSpline(s)
+    char *s;
+{
+    double     x, y, x1, y1;
+    int                n = 0;
+    Point      *pt;
+    char       *p = s, d[10];
+
+    if (!*p)
+       return(n);
+
+    pt = spline = MakePoint(0.0, 0.0);
+    n = 1;
+    x = y = 0.0;
+    p = s;
+    while (p && *p) {
+       if ((p = getstr(p, d)) == (char *)NULL)
+           break;
+       x1 = x + atof(d);
+       if ((p = getstr(p, d)) == (char *)NULL)
+           break;
+       y1 = y + atof(d);
+       pt->next = MakePoint(x1, y1);
+       pt = pt->next;
+       x = pt->x;
+       y = pt->y;
+       n++;
+    }
+
+    /* number of pairs of points */
+
+    return(n);
+}
+
+/*     Approximate a spline by lines generated by iterations of the      */
+/*     approximation algorithm from the original n points in the spline. */
+
+static void
+ApproxSpline(n)
+int n;
+{
+    int                mid, j;
+    Point      *p1, *p2, *p3, *p;
+
+    if (n < 3)
+       return;
+
+    /* number of mid-points to calculate */
+    mid = n - 3;
+
+    /* remember original points are stored as an array of n points */
+    /* so I can index it directly to calculate mid-points only.           */
+    if (mid > 0) {
+       p = spline->next;
+       j = 1;
+       while (j < n-2) {
+           p1 = p;
+           p = p->next;
+           p2 = p;
+           InsertPoint(p1, MakePoint(midx(p1, p2), midy(p1, p2)));
+           j++;
+       }
+    }
+
+    /* Now approximate curve by line segments.            */
+    /* There *should* be the correct number of points now! */
+
+    p = spline;
+    while (p != (Point *)NULL) {
+       p1 = p;
+       if ((p = p->next) == (Point *)NULL)
+           break;
+       p2 = p;
+       if ((p = p->next) == (Point *)NULL)
+           break;
+       p3 = p;         /* This point becomes first point of next curve */
+
+       LineApprox(p1, p2, p3);
+    }
+}
+
+
+/*     p1, p2, and p3 are initially 3 *consecutive* points on the curve. */
+/*     For each adjacent pair of points find the mid-point, insert this  */
+/*     in the linked list, delete the first of the two used (unless it   */
+/*     is the first for this curve).  Repeat this ITERATIONS times.      */
+
+/*ARGSUSED*/
+static void
+LineApprox(p1, p2, p3)
+Point  *p1, *p2, *p3;
+{
+    Point      *p4, *p;
+    int                reps = ITERATIONS;
+
+    while (reps) {
+       for (p = p1; p != (Point *)NULL && p != p3; ) {
+           InsertPoint(p, p4 = MakePoint( midx(p,p->next), midy(p,p->next) ));
+           if (p != p1)
+               DeletePoint(p);
+           p = p4->next;               /* skip inserted point! */
+       }
+       reps--;
+    }
+}
+
+
+/*     Traverse the linked list, calling DrawLine to approximate the */
+/*     spline curve.  Rounding errors are taken into account so that */
+/*     the "curve" is continuous, and ends up where expected.        */
+
+static void
+DrawSplineSegments(dw)
+DviWidget dw;
+{
+    Point      *p, *q;
+    double     x1, y1;
+    int                dx, dy;
+    double     xpos, ypos;
+
+    p = spline;
+    dx = dy = 0;
+
+    /* save the start position */
+
+    xpos = dw->dvi.state->x;
+    ypos = dw->dvi.state->y;
+
+    x1 = y1 = 0.0;
+
+    while (p != (Point *)NULL) {
+       dx = p->x - x1 + 0.5;
+       dy = p->y - y1 + 0.5;
+       DrawLine (dw, dx, dy);
+
+       x1 = p->x;
+       y1 = p->y;
+       dw->dvi.state->x = xpos + x1;
+       dw->dvi.state->y = ypos + y1;
+
+       q = p;
+       p = p->next;
+       XtFree((char *)q);
+    }
+    spline = (Point *)NULL;
+}
+
+
+/*     Malloc memory for a Point, and initialise the elements to x, y, NULL */
+/*     Return a pointer to the new Point.                                   */
+
+static Point *
+MakePoint(x, y)
+double x, y;
+{
+    Point      *p;
+
+    p = (Point *) XtMalloc (sizeof (Point));
+    p->x = x;
+    p->y = y;
+    p->next = (Point *)NULL;
+
+    return(p);
+}
+
+
+/*     Insert point q in linked list after point p. */
+
+static void
+InsertPoint(p, q)
+Point *p, *q;
+{
+    /* point q to the next point */
+    q->next = p->next;
+
+    /* point p to new inserted one */
+    p->next = q;
+}
+
+/*     Delete point p from the linked list. */
+
+static void
+DeletePoint(p)
+Point  *p;
+{
+    Point      *tmp;
+
+    tmp = p->next;
+    p->x = p->next->x;
+    p->y = p->next->y;
+    p->next = p->next->next;
+    XtFree((char *)tmp);
+}
diff --git a/xditview/font.c b/xditview/font.c
new file mode 100644 (file)
index 0000000..210a374
--- /dev/null
@@ -0,0 +1,486 @@
+/*
+ * font.c
+ *
+ * map dvi fonts to X fonts
+ */
+/* $XFree86: xc/programs/xditview/font.c,v 1.5 2001/08/27 23:35:12 dawes Exp $ */
+
+#include <X11/Xos.h>
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include "DviP.h"
+#include "XFontName.h"
+
+static char *
+savestr (char *s)
+{
+       char    *n;
+
+       if (!s)
+               return 0;
+       n = XtMalloc (strlen (s) + 1);
+       if (n)
+               strcpy (n, s);
+       return n;
+}
+
+static DviFontList *
+LookupFontByPosition (DviWidget dw, int position)
+{
+       DviFontList     *f;
+
+       for (f = dw->dvi.fonts; f; f=f->next)
+               if (f->dvi_number == position)
+                       break;
+       return f;
+}
+
+static DviFontSizeList *
+LookupFontSizeBySize (DviWidget dw, DviFontList *f, int size)
+{
+    DviFontSizeList *fs, *best = 0;
+    int                    bestdist;
+    char           fontNameString[2048];
+    XFontName      fontName;
+    unsigned int    fontNameAttributes;
+    int                    dist;
+
+    if (f->scalable)
+    {
+       for (best = f->sizes; best; best = best->next)
+           if (best->size == size)
+               return best;
+       best = (DviFontSizeList *) XtMalloc (sizeof *best);
+       best->next = f->sizes;
+       best->size = size;
+       XParseFontName (f->x_name, &fontName, &fontNameAttributes);
+       fontNameAttributes &= ~(FontNamePixelSize|FontNameAverageWidth);
+       fontNameAttributes |= FontNameResolutionX;
+       fontNameAttributes |= FontNameResolutionY;
+       fontNameAttributes |= FontNamePointSize;
+       fontName.ResolutionX = dw->dvi.screen_resolution;
+       fontName.ResolutionY = dw->dvi.screen_resolution;
+       fontName.PointSize = size * 10 / dw->dvi.size_scale;
+       XFormatFontName (&fontName, fontNameAttributes, fontNameString);
+       best->x_name = savestr (fontNameString);
+#ifdef USE_XFT
+       /*
+        * Force a match of a core font for adobe-fontspecific
+        * encodings; we dont have a scalable font in
+        * the right encoding
+        */
+       best->core = False;
+       if (!strcmp (fontName.CharSetRegistry, "adobe") &&
+           !strcmp (fontName.CharSetEncoding, "fontspecific"))
+       {
+           best->core = True;
+       }
+#endif
+       best->doesnt_exist = 0;
+       best->font = 0;
+       f->sizes = best;
+    }
+    else
+    {
+       bestdist = 65536;
+       for (fs = f->sizes; fs; fs=fs->next) {
+           dist = size - fs->size;
+           if (dist < 0)
+               dist = -dist * 16;
+           if (dist < bestdist)
+           {
+               best = fs;
+               bestdist = dist;
+           }
+       }
+    }
+    return best;
+}
+
+static char *
+SkipFontNameElement (char *n)
+{
+       while (*n != '-')
+               if (!*++n)
+                       return 0;
+       return n+1;
+}
+
+# define SizePosition          8
+# define EncodingPosition      13
+
+#ifndef USE_XFT
+static int
+ConvertFontNameToSize (char *n)
+{
+       int     i, size;
+
+       for (i = 0; i < SizePosition; i++) {
+               n = SkipFontNameElement (n);
+               if (!n)
+                       return -1;
+       }
+       size = atoi (n);
+       return size/10;
+}
+#endif
+
+static char *
+ConvertFontNameToEncoding (char *n)
+{
+        int i;
+       for (i = 0; i < EncodingPosition; i++) {
+               n = SkipFontNameElement (n);
+               if (!n)
+                       return 0;
+       }
+       return n;
+}
+
+static void
+DisposeFontSizes (DviWidget dw, DviFontSizeList *fs)
+{
+    DviFontSizeList    *next;
+
+    for (; fs; fs=next) {
+       next = fs->next;
+       if (fs->x_name)
+               XtFree (fs->x_name);
+       if (fs->font)
+       {
+#ifdef USE_XFT
+           XftFontClose (XtDisplay (dw), fs->font);
+#else
+           XUnloadFont (XtDisplay (dw), fs->font->fid);
+           XFree ((char *)fs->font);
+#endif
+       }
+       XtFree ((char *) fs);
+    }
+}
+
+void
+ResetFonts (DviWidget dw)
+{
+    DviFontList        *f;
+    
+    for (f = dw->dvi.fonts; f; f = f->next)
+    {
+       if (f->initialized)
+       {
+           DisposeFontSizes (dw, f->sizes);
+           f->sizes = 0;
+           f->initialized = FALSE;
+           f->scalable = FALSE;
+       }
+    }
+    /* 
+     * force requery of fonts
+     */
+    dw->dvi.font = 0;
+    dw->dvi.font_number = -1;
+    dw->dvi.cache.font = 0;
+    dw->dvi.cache.font_number = -1;
+}
+
+static DviFontSizeList *
+InstallFontSizes (DviWidget dw, char *x_name, Boolean *scalablep)
+{
+#ifndef USE_XFT
+    char           fontNameString[2048];
+    char           **fonts;
+    int                    i, count;
+    int                    size;
+    DviFontSizeList *new;
+    XFontName      fontName;
+    unsigned int    fontNameAttributes;
+#endif
+    DviFontSizeList *sizes;
+
+    sizes = 0;
+#ifdef USE_XFT
+    *scalablep = TRUE;
+#else
+    *scalablep = FALSE;
+    if (!XParseFontName (x_name, &fontName, &fontNameAttributes))
+       return 0;
+    
+    fontNameAttributes &= ~(FontNamePixelSize|FontNamePointSize);
+    fontNameAttributes |= FontNameResolutionX;
+    fontNameAttributes |= FontNameResolutionY;
+    fontName.ResolutionX = dw->dvi.screen_resolution;
+    fontName.ResolutionY = dw->dvi.screen_resolution;
+    XFormatFontName (&fontName, fontNameAttributes, fontNameString);
+    fonts = XListFonts (XtDisplay (dw), fontNameString, 10000000, &count);
+    for (i = 0; i < count; i++) {
+       size = ConvertFontNameToSize (fonts[i]);
+       if (size == 0)
+       {
+           DisposeFontSizes (dw, sizes);
+           *scalablep = TRUE;
+           sizes = 0;
+           break;
+       }
+       if (size != -1) {
+           new = (DviFontSizeList *) XtMalloc (sizeof *new);
+           new->next = sizes;
+           new->size = size;
+           new->x_name = savestr (fonts[i]);
+           new->doesnt_exist = 0;
+           new->font = 0;
+           sizes = new;
+       }
+    }
+    XFreeFontNames (fonts);
+#endif
+    return sizes;
+}
+
+static DviFontList *
+InstallFont (DviWidget dw, int position, char *dvi_name, char *x_name)
+{
+    DviFontList        *f;
+    char               *encoding;
+
+    f = LookupFontByPosition (dw, position);
+    if (f) {
+       /*
+        * ignore gratuitous font loading
+        */
+       if (!strcmp (f->dvi_name, dvi_name) && !strcmp (f->x_name, x_name))
+           return f;
+
+       DisposeFontSizes (dw, f->sizes);
+       if (f->dvi_name)
+           XtFree (f->dvi_name);
+       if (f->x_name)
+           XtFree (f->x_name);
+    } else {
+       f = (DviFontList *) XtMalloc (sizeof (*f));
+       f->next = dw->dvi.fonts;
+       dw->dvi.fonts = f;
+    }
+    f->initialized = FALSE;
+    f->dvi_name = savestr (dvi_name);
+    f->x_name = savestr (x_name);
+    f->dvi_number = position;
+    f->sizes = 0;
+    f->scalable = FALSE;
+    if (f->x_name) {
+       encoding = ConvertFontNameToEncoding (f->x_name);
+       f->char_map = DviFindMap (encoding);
+    } else
+       f->char_map = 0;
+    /* 
+     * force requery of fonts
+     */
+    dw->dvi.font = 0;
+    dw->dvi.font_number = -1;
+    dw->dvi.cache.font = 0;
+    dw->dvi.cache.font_number = -1;
+    return f;
+}
+
+static char *
+MapDviNameToXName (DviWidget dw, char *dvi_name)
+{
+    DviFontMap *fm;
+    
+    for (fm = dw->dvi.font_map; fm; fm=fm->next)
+       if (!strcmp (fm->dvi_name, dvi_name))
+           return fm->x_name;
+    ++dvi_name;
+    for (fm = dw->dvi.font_map; fm; fm=fm->next)
+       if (!strcmp (fm->dvi_name, "R"))
+           return fm->x_name;
+    if (dw->dvi.font_map->x_name)
+       return dw->dvi.font_map->x_name;
+    return "-*-*-*-*-*-*-*-*-*-*-*-*-iso8859-1";
+}
+
+#ifdef NOTUSED
+static char *
+MapXNameToDviName (dw, x_name)
+       DviWidget       dw;
+       char            *x_name;
+{
+    DviFontMap *fm;
+    
+    for (fm = dw->dvi.font_map; fm; fm=fm->next)
+       if (!strcmp (fm->x_name, x_name))
+           return fm->dvi_name;
+    return 0;
+}
+#endif
+
+void
+ParseFontMap (dw)
+       DviWidget       dw;
+{
+    char               dvi_name[1024];
+    char               x_name[2048];
+    char               *m, *s;
+    DviFontMap *fm, *new;
+
+    if (dw->dvi.font_map)
+           DestroyFontMap (dw->dvi.font_map);
+    fm = 0;
+    m = dw->dvi.font_map_string;
+    while (*m) {
+       s = m;
+       while (*m && !isspace (*m))
+           ++m;
+       strncpy (dvi_name, s, m-s);
+       dvi_name[m-s] = '\0';
+       while (isspace (*m))
+           ++m;
+       s = m;
+       while (*m && *m != '\n')
+           ++m;
+       strncpy (x_name, s, m-s);
+       x_name[m-s] = '\0';
+       new = (DviFontMap *) XtMalloc (sizeof *new);
+       new->x_name = savestr (x_name);
+       new->dvi_name = savestr (dvi_name);
+       new->next = fm;
+       fm = new;
+       ++m;
+    }
+    dw->dvi.font_map = fm;
+}
+
+void
+DestroyFontMap (font_map)
+    DviFontMap *font_map;
+{
+    DviFontMap *next;
+
+    for (; font_map; font_map = next) {
+       next = font_map->next;
+       if (font_map->x_name)
+           XtFree (font_map->x_name);
+       if (font_map->dvi_name)
+           XtFree (font_map->dvi_name);
+       XtFree ((char *) font_map);
+    }
+}
+
+/*ARGSUSED*/
+void
+SetFontPosition (dw, position, dvi_name, extra)
+    DviWidget  dw;
+    int                position;
+    char       *dvi_name;
+    char       *extra; /* unused */
+{
+    char       *x_name;
+
+    x_name = MapDviNameToXName (dw, dvi_name);
+    (void) InstallFont (dw, position, dvi_name, x_name);
+}
+
+#ifdef USE_XFT
+XftFont *
+#else
+XFontStruct *
+#endif
+QueryFont (dw, position, size)
+    DviWidget  dw;
+    int                position;
+    int                size;
+{
+    DviFontList        *f;
+    DviFontSizeList    *fs;
+
+    f = LookupFontByPosition (dw, position);
+    if (!f)
+       return dw->dvi.default_font;
+    if (!f->initialized) {
+       f->sizes = InstallFontSizes (dw, f->x_name, &f->scalable);
+       f->initialized = TRUE;
+    }
+    fs = LookupFontSizeBySize (dw, f, size);
+    if (!fs)
+       return dw->dvi.default_font;
+    if (!fs->font) {
+       if (fs->x_name)
+       {
+#ifdef USE_XFT
+           XftPattern  *pat;
+           XftPattern  *match;
+           XftResult   result;
+
+           pat = XftXlfdParse (fs->x_name, False, False);
+           XftPatternAddBool (pat, XFT_CORE, fs->core);
+           match = XftFontMatch (XtDisplay (dw),
+                                 XScreenNumberOfScreen(dw->core.screen),
+                                 pat, &result);
+           XftPatternDestroy (pat);
+           if (match)
+           {
+               fs->font = XftFontOpenPattern (XtDisplay (dw),
+                                              match);
+               if (!fs->font)
+                   XftPatternDestroy (match);
+           }
+           else
+               fs->font = 0;
+#else
+           fs->font = XLoadQueryFont (XtDisplay (dw), fs->x_name);
+#endif
+       }
+       if (!fs->font)
+           fs->font = dw->dvi.default_font;
+    }
+    return fs->font;
+}
+
+DviCharNameMap *
+QueryFontMap (dw, position)
+       DviWidget       dw;
+       int             position;
+{
+       DviFontList     *f;
+
+       f = LookupFontByPosition (dw, position);
+       if (f)
+           return f->char_map;
+       else
+           return 0;
+}
+
+unsigned char *
+DviCharIsLigature (map, name)
+    DviCharNameMap  *map;
+    char           *name;
+{
+    int            i;
+
+    for (i = 0; i < DVI_MAX_LIGATURES; i++) {
+       if (!map->ligatures[i][0])
+           break;
+       if (!strcmp (name, map->ligatures[i][0]))
+           return (unsigned char *) map->ligatures[i][1];
+    }
+    return 0;
+}
+
+#if 0
+LoadFont (dw, position, size)
+       DviWidget       dw;
+       int             position;
+       int             size;
+{
+       XFontStruct     *font;
+
+       font = QueryFont (dw, position, size);
+       dw->dvi.font_number = position;
+       dw->dvi.font_size = size;
+       dw->dvi.font = font;
+       XSetFont (XtDisplay (dw), dw->dvi.normal_GC, font->fid);
+       return;
+}
+#endif
diff --git a/xditview/install-sh b/xditview/install-sh
new file mode 100755 (executable)
index 0000000..4d4a951
--- /dev/null
@@ -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/xditview/ldblarrow b/xditview/ldblarrow
new file mode 100644 (file)
index 0000000..48bbeb0
--- /dev/null
@@ -0,0 +1,5 @@
+#define previous_width 11
+#define previous_height 11
+static char previous_bits[] = {
+   0x20, 0x04, 0x10, 0x02, 0x08, 0x01, 0x84, 0x00, 0x42, 0x00, 0x21, 0x00,
+   0x42, 0x00, 0x84, 0x00, 0x08, 0x01, 0x10, 0x02, 0x20, 0x04};
diff --git a/xditview/lex.c b/xditview/lex.c
new file mode 100644 (file)
index 0000000..12158ed
--- /dev/null
@@ -0,0 +1,92 @@
+/* $XFree86: xc/programs/xditview/lex.c,v 1.3 2000/12/04 21:01:01 dawes Exp $ */
+
+#include <X11/Xos.h>
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <stdio.h>
+#include <ctype.h>
+#include "DviP.h"
+
+int
+DviGetAndPut(dw, cp)
+    DviWidget  dw;
+    int                *cp;
+{
+    if (dw->dvi.ungot)
+    {
+       dw->dvi.ungot = 0;
+       *cp = getc (dw->dvi.file);
+    }
+    else
+    {
+       *cp = getc (dw->dvi.file);
+       putc (*cp, dw->dvi.tmpFile);
+    }
+    return *cp;
+}
+
+char *
+GetLine(dw, Buffer, Length)
+       DviWidget       dw;
+       char    *Buffer;
+       int     Length;
+{
+       int     i = 0, c;
+       char    *p = Buffer;
+
+       Length--;                           /* Save room for final NULL */
+
+       while ((!p || i < Length) && DviGetC (dw, &c) != EOF && c != '\n')
+               if (p)
+                       *p++ = c;
+#if 0
+       if (c == '\n' && p)                 /* Retain the newline like fgets */
+               *p++ = c;
+#endif
+       if (c == '\n')
+               DviUngetC(dw, c);
+       if (p)
+               *p = '\0';
+       return (Buffer);
+}
+
+char *
+GetWord(dw, Buffer, Length)
+       DviWidget       dw;
+       char    *Buffer;
+       int     Length;
+{
+       int     i = 0, c;
+       char    *p = Buffer;
+
+       Length--;                           /* Save room for final NULL */
+       while (DviGetC(dw, &c) != EOF && isspace(c))
+               ;
+       if (c != EOF)
+               DviUngetC(dw, c);
+       while (i < Length && DviGetC(dw, &c) != EOF && !isspace(c))
+               if (p)
+                       *p++ = c;
+       if (c != EOF)
+               DviUngetC(dw, c);
+       if (p)
+               *p = '\0';
+       return (Buffer);
+}
+
+int
+GetNumber(dw)
+       DviWidget       dw;
+{
+       int     i = 0,  c;
+
+       while (DviGetC(dw, &c) != EOF && isspace(c))
+               ;
+       if (c != EOF)
+               DviUngetC(dw, c);
+       while (DviGetC(dw, &c) != EOF && isdigit(c))
+               i = i*10 + c - '0';
+       if (c != EOF)
+               DviUngetC(dw, c);
+       return (i);
+}
diff --git a/xditview/missing b/xditview/missing
new file mode 100755 (executable)
index 0000000..894e786
--- /dev/null
@@ -0,0 +1,360 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2005-06-08.21
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
+#   Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try \`$0 --help' for more information"
+  exit 1
+fi
+
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+  configure_ac=configure.ac
+else
+  configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case "$1" in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  # Exit code 63 means version mismatch.  This often happens
+  # when the user try to use an ancient version of a tool on
+  # a file that requires a minimum version.  In this case we
+  # we should proceed has if the program had been absent, or
+  # if --run hadn't been passed.
+  if test $? = 63; then
+    run=:
+    msg="probably too old"
+  fi
+  ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+  aclocal      touch file \`aclocal.m4'
+  autoconf     touch file \`configure'
+  autoheader   touch file \`config.h.in'
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Now exit if we have it, but it failed.  Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case "$1" in
+  lex|yacc)
+    # Not GNU programs, they don't have --version.
+    ;;
+
+  tar)
+    if test -n "$run"; then
+       echo 1>&2 "ERROR: \`tar' requires --run"
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       exit 1
+    fi
+    ;;
+
+  *)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       # Could not run --version or --help.  This is probably someone
+       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # $TOOL exists and not knowing $TOOL uses missing.
+       exit 1
+    fi
+    ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+  aclocal*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
+         to install the \`Automake' and \`Perl' packages.  Grab them from
+         any GNU archive site."
+    touch aclocal.m4
+    ;;
+
+  autoconf)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`${configure_ac}'.  You might want to install the
+         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+         archive site."
+    touch configure
+    ;;
+
+  autoheader)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site."
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z "$files" && files="config.h"
+    touch_files=
+    for f in $files; do
+      case "$f" in
+      *:*) touch_files="$touch_files "`echo "$f" |
+                                      sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files="$touch_files $f.in";;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site."
+    find . -type f -name Makefile.am -print |
+          sed 's/\.am$/.in/' |
+          while read f; do touch "$f"; done
+    ;;
+
+  autom4te)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1' as part of \`Autoconf' from any GNU
+         archive site."
+
+    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo "#! /bin/sh"
+       echo "# Created by GNU Automake missing as a replacement of"
+       echo "#  $ $@"
+       echo "exit 0"
+       chmod +x $file
+       exit 1
+    fi
+    ;;
+
+  bison|yacc)
+    echo 1>&2 "\
+WARNING: \`$1' $msg.  You should only need it if
+         you modified a \`.y' file.  You may need the \`Bison' package
+         in order for those modifications to take effect.  You can get
+         \`Bison' from any GNU archive site."
+    rm -f y.tab.c y.tab.h
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+       case "$LASTARG" in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if [ -f "$SRCFILE" ]; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if [ -f "$SRCFILE" ]; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if [ ! -f y.tab.h ]; then
+       echo >y.tab.h
+    fi
+    if [ ! -f y.tab.c ]; then
+       echo 'main() { return 0; }' >y.tab.c
+    fi
+    ;;
+
+  lex|flex)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.l' file.  You may need the \`Flex' package
+         in order for those modifications to take effect.  You can get
+         \`Flex' from any GNU archive site."
+    rm -f lex.yy.c
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+       case "$LASTARG" in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if [ -f "$SRCFILE" ]; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if [ ! -f lex.yy.c ]; then
+       echo 'main() { return 0; }' >lex.yy.c
+    fi
+    ;;
+
+  help2man)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+        you modified a dependency of a manual page.  You may need the
+        \`Help2man' package in order for those modifications to take
+        effect.  You can get \`Help2man' from any GNU archive site."
+
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+       file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+    fi
+    if [ -f "$file" ]; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit 1
+    fi
+    ;;
+
+  makeinfo)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.texi' or \`.texinfo' file, or any other file
+         indirectly affecting the aspect of the manual.  The spurious
+         call might also be the consequence of using a buggy \`make' (AIX,
+         DU, IRIX).  You might want to install the \`Texinfo' package or
+         the \`GNU make' package.  Grab either from any GNU archive site."
+    # The file to touch is that specified with -o ...
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+      # ... or it is derived from the source name (dir/f.texi becomes f.info)
+      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+    fi
+    # If the file does not exist, the user really needs makeinfo;
+    # let's fail without touching anything.
+    test -f $file || exit 1
+    touch $file
+    ;;
+
+  tar)
+    shift
+
+    # We have already tried tar in the generic part.
+    # Look for gnutar/gtar before invocation to avoid ugly error
+    # messages.
+    if (gnutar --version > /dev/null 2>&1); then
+       gnutar "$@" && exit 0
+    fi
+    if (gtar --version > /dev/null 2>&1); then
+       gtar "$@" && exit 0
+    fi
+    firstarg="$1"
+    if shift; then
+       case "$firstarg" in
+       *o*)
+           firstarg=`echo "$firstarg" | sed s/o//`
+           tar "$firstarg" "$@" && exit 0
+           ;;
+       esac
+       case "$firstarg" in
+       *h*)
+           firstarg=`echo "$firstarg" | sed s/h//`
+           tar "$firstarg" "$@" && exit 0
+           ;;
+       esac
+    fi
+
+    echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         You may want to install GNU tar or Free paxutils, or check the
+         command line arguments."
+    exit 1
+    ;;
+
+  *)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.  Check the \`README' file,
+         it often tells you about the needed prerequisites for installing
+         this package.  You may also peek at any GNU archive site, in case
+         some other package would contain this missing \`$1' program."
+    exit 1
+    ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/xditview/mkinstalldirs b/xditview/mkinstalldirs
new file mode 100755 (executable)
index 0000000..259dbfc
--- /dev/null
@@ -0,0 +1,158 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+
+scriptversion=2005-06-29.22
+
+# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+errstatus=0
+dirmode=
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <bug-automake@gnu.org>."
+
+# process command line arguments
+while test $# -gt 0 ; do
+  case $1 in
+    -h | --help | --h*)         # -h for help
+      echo "$usage"
+      exit $?
+      ;;
+    -m)                         # -m PERM arg
+      shift
+      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+      dirmode=$1
+      shift
+      ;;
+    --version)
+      echo "$0 $scriptversion"
+      exit $?
+      ;;
+    --)                         # stop option processing
+      shift
+      break
+      ;;
+    -*)                         # unknown option
+      echo "$usage" 1>&2
+      exit 1
+      ;;
+    *)                          # first non-opt arg
+      break
+      ;;
+  esac
+done
+
+for file
+do
+  if test -d "$file"; then
+    shift
+  else
+    break
+  fi
+done
+
+case $# in
+  0) exit 0 ;;
+esac
+
+# Solaris 8's mkdir -p isn't thread-safe.  If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error.  This is a problem when calling mkinstalldirs
+# from a parallel make.  We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
+case $dirmode in
+  '')
+    if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+      echo "mkdir -p -- $*"
+      exec mkdir -p -- "$@"
+    else
+      # On NextStep and OpenStep, the `mkdir' command does not
+      # recognize any option.  It will interpret all options as
+      # directories to create, and then abort because `.' already
+      # exists.
+      test -d ./-p && rmdir ./-p
+      test -d ./--version && rmdir ./--version
+    fi
+    ;;
+  *)
+    if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+       test ! -d ./--version; then
+      echo "mkdir -m $dirmode -p -- $*"
+      exec mkdir -m "$dirmode" -p -- "$@"
+    else
+      # Clean up after NextStep and OpenStep mkdir.
+      for d in ./-m ./-p ./--version "./$dirmode";
+      do
+        test -d $d && rmdir $d
+      done
+    fi
+    ;;
+esac
+
+for file
+do
+  case $file in
+    /*) pathcomp=/ ;;
+    *)  pathcomp= ;;
+  esac
+  oIFS=$IFS
+  IFS=/
+  set fnord $file
+  shift
+  IFS=$oIFS
+
+  for d
+  do
+    test "x$d" = x && continue
+
+    pathcomp=$pathcomp$d
+    case $pathcomp in
+      -*) pathcomp=./$pathcomp ;;
+    esac
+
+    if test ! -d "$pathcomp"; then
+      echo "mkdir $pathcomp"
+
+      mkdir "$pathcomp" || lasterr=$?
+
+      if test ! -d "$pathcomp"; then
+       errstatus=$lasterr
+      else
+       if test ! -z "$dirmode"; then
+         echo "chmod $dirmode $pathcomp"
+         lasterr=
+         chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+         if test ! -z "$lasterr"; then
+           errstatus=$lasterr
+         fi
+       fi
+      fi
+    fi
+
+    pathcomp=$pathcomp/
+  done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/xditview/page.c b/xditview/page.c
new file mode 100644 (file)
index 0000000..a1c65f1
--- /dev/null
@@ -0,0 +1,90 @@
+/* $XConsortium: page.c,v 1.5 91/07/26 00:40:20 keith Exp $ */
+/* $XFree86: xc/programs/xditview/page.c,v 1.3 2001/08/01 00:45:03 tsi Exp $ */
+
+/*
+ * page.c
+ *
+ * map page numbers to file position
+ */
+
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <X11/Xos.h>
+#include <stdio.h>
+#include <ctype.h>
+#include "DviP.h"
+
+static DviFileMap *
+MapPageNumberToFileMap (DviWidget dw, int number)
+{
+       DviFileMap      *m;
+
+       for (m = dw->dvi.file_map; m; m=m->next)
+               if (m->page_number == number)
+                       break;
+       return m;
+}
+
+void
+DestroyFileMap (m)
+       DviFileMap      *m;
+{
+       DviFileMap      *next;
+
+       for (; m; m = next) {
+               next = m->next;
+               XtFree ((char *) m);
+       }
+}
+
+void
+ForgetPagePositions (dw)
+       DviWidget       dw;
+{
+       DestroyFileMap (dw->dvi.file_map);
+       dw->dvi.file_map = 0;
+}
+
+void
+RememberPagePosition(dw, number)
+       DviWidget       dw;
+       int             number;
+{
+       DviFileMap      *m;
+
+       if (!(m = MapPageNumberToFileMap (dw, number))) {
+               m = (DviFileMap *) XtMalloc (sizeof *m);
+               m->page_number = number;
+               m->next = dw->dvi.file_map;
+               dw->dvi.file_map = m;
+       }
+       if (dw->dvi.tmpFile)
+               m->position = ftell (dw->dvi.tmpFile);
+       else
+               m->position = ftell (dw->dvi.file);
+}
+
+long
+SearchPagePosition (dw, number)
+       DviWidget       dw;
+       int             number;
+{
+       DviFileMap      *m;
+
+       if (!(m = MapPageNumberToFileMap (dw, number)))
+               return -1;
+       return m->position;
+}
+
+void
+FileSeek(dw, position)
+DviWidget      dw;
+long           position;
+{
+       if (dw->dvi.tmpFile) {
+               dw->dvi.readingTmp = 1;
+               fseek (dw->dvi.tmpFile, position, 0);
+       } else
+               fseek (dw->dvi.file, position, 0);
+}
+
diff --git a/xditview/parse.c b/xditview/parse.c
new file mode 100644 (file)
index 0000000..0f5bc68
--- /dev/null
@@ -0,0 +1,475 @@
+/* $XConsortium: parse.c,v 1.13 94/04/17 20:43:36 keith Exp $ */
+/*
+
+Copyright (c) 1991  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86: xc/programs/xditview/parse.c,v 1.5tsi Exp $ */
+
+/*
+ * parse.c
+ *
+ * parse dvi input
+ */
+
+#include <X11/Xos.h>
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <stdio.h>
+#include <ctype.h>
+#include "DviP.h"
+
+static void ParseDrawFunction(DviWidget dw, char *buf);
+static void ParseDeviceControl(DviWidget dw);
+static void PutCharacters(DviWidget dw, unsigned char *src, int len);
+static void push_env(DviWidget dw);
+static void pop_env(DviWidget dw);
+
+#define HorizontalMove(dw, delta)      ((dw)->dvi.state->x += (delta))
+
+#ifdef USE_XFT
+static int
+charWidth (DviWidget dw, XftFont *font, char c)
+{
+    XGlyphInfo extents;
+
+    XftTextExtents8 (XtDisplay (dw), font, 
+                    (unsigned char *) &c, 1, &extents);
+    return extents.xOff;
+}
+#else
+#define charWidth(dw,fi,c) (\
+    (fi)->per_char ?\
+       (fi)->per_char[(c) - (fi)->min_char_or_byte2].width\
+    :\
+       (fi)->max_bounds.width\
+)
+#endif
+    
+int
+ParseInput(dw)
+    DviWidget  dw;
+{
+       int             n, k;
+       int             c;
+       char            Buffer[BUFSIZ];
+       int             NextPage;
+       int             prevFont;
+       int             otherc;
+       unsigned char   tc;
+
+       /*
+        * make sure some state exists
+        */
+
+       if (!dw->dvi.state)
+           push_env (dw);
+       for (;;) {
+               switch (DviGetC(dw, &c)) {
+               case '\n':      
+                       break;
+               case ' ':       /* when input is text */
+               case 0:         /* occasional noise creeps in */
+                       break;
+               case '{':       /* push down current environment */
+                       push_env(dw);
+                       break;
+               case '}':
+                       pop_env(dw);
+                       break;
+               /*
+                * two motion digits plus a character
+                */
+               case '0': case '1': case '2': case '3': case '4':
+               case '5': case '6': case '7': case '8': case '9':
+                       HorizontalMove(dw, (c-'0')*10 +
+                                          DviGetC(dw,&otherc)-'0');
+                       /* fall through */
+               case 'c':       /* single ascii character */
+                       (void) DviGetC(dw,&c);
+                       if (c == ' ')
+                           break;
+                       tc = c;
+                       PutCharacters (dw, &tc, 1);
+                       break;
+               case 'C':
+                       GetWord(dw, Buffer, BUFSIZ);
+                       {
+                           DviCharNameMap      *map;
+                           int                 i;
+                           unsigned char       *ligature;
+                   
+                           c = -1;
+                           map = QueryFontMap (dw, dw->dvi.state->font_number);
+                           if (map)
+                           {
+                               c = DviCharIndex (map, Buffer);
+                               if (c == -1)
+                               {
+                                   ligature = DviCharIsLigature (map, Buffer);
+                                   if (ligature) {
+                                       i = strlen ((char *) ligature);
+                                       PutCharacters (dw, ligature, i);
+                                       break;
+                                   }
+                               }
+                           }
+                           prevFont = -1;
+                           if (c == -1) {
+                               for (i = 1; (map = QueryFontMap (dw, i)); i++)
+                                   if (map->special)
+                                       if ((c = DviCharIndex (map, Buffer)) != -1) {
+                                           prevFont = dw->dvi.state->font_number;
+                                           dw->dvi.state->font_number = i;
+                                           break;
+                                       }
+                           }
+                           if (c != -1)
+                           {
+                               tc = c;
+                               PutCharacters (dw, &tc, 1);
+                           }
+                           if (prevFont != -1)
+                               dw->dvi.state->font_number = prevFont;
+                       }
+                       break;
+               case 'D':       /* draw function */
+                       GetLine(dw, Buffer, BUFSIZ);
+                       ParseDrawFunction(dw, Buffer);
+                       break;
+               case 's':       /* ignore fractional sizes */
+                       n = GetNumber(dw);
+                       if (!dw->dvi.size_scale)
+                       {
+                           static int  guesses[] = { 1, 4, 100, 1000, 1 };
+                           int         i;
+
+                           for (i = 0; i < 4; i++)
+                               if (8 <= n/guesses[i] && n/guesses[i] <= 24)
+                               {
+                                   break;
+                               }
+                           dw->dvi.size_scale = guesses[i];
+                       }
+                       dw->dvi.state->font_size = n;
+                       dw->dvi.state->line_width = n * (dw->dvi.device_resolution / 
+                                                        (720 * dw->dvi.size_scale));
+                       break;
+               case 'f':
+                       n = GetNumber(dw);
+                       dw->dvi.state->font_number = n;
+                       break;
+               case 'H':       /* absolute horizontal motion */
+                       k = GetNumber(dw);
+                       HorizontalGoto(dw, k);
+                       break;
+               case 'h':       /* relative horizontal motion */
+                       k = GetNumber(dw);
+                       HorizontalMove(dw, k);
+                       break;
+               case 'w':       /* word space */
+                       break;
+               case 'V':
+                       n = GetNumber(dw);
+                       VerticalGoto(dw, n);
+                       break;
+               case 'v':
+                       n = GetNumber(dw);
+                       VerticalMove(dw, n);
+                       break;
+               case 'P':       /* new spread */
+                       break;
+               case 'p':       /* new page */
+                       (void) GetNumber(dw);
+                       NextPage = dw->dvi.current_page + 1;
+                       RememberPagePosition(dw, NextPage);
+                       FlushCharCache (dw);
+                       return(NextPage);
+               case 'n':       /* end of line */
+                       GetNumber(dw);
+                       GetNumber(dw);
+                       HorizontalGoto(dw, 0);
+                       break;
+               case '#':       /* comment */
+               case 'F':       /* file info */
+                       GetLine(dw, NULL, 0);
+                       break;
+               case 't':       /* text */
+                       GetLine(dw, Buffer, BUFSIZ);
+                       PutCharacters (dw, (unsigned char *)Buffer,
+                                      strlen (Buffer));
+                       dw->dvi.state->x = ToDevice (dw, dw->dvi.cache.x);
+                       break;
+               case 'x':       /* device control */
+                       ParseDeviceControl(dw);
+                       break;
+               case EOF:
+                       dw->dvi.last_page = dw->dvi.current_page;
+                       FlushCharCache (dw);
+                       return dw->dvi.current_page;
+               default:
+                       GetLine (dw, Buffer, BUFSIZ);
+                       fprintf (stderr, "Unknown command %s\n", Buffer);
+                       break;
+               }
+       }
+}
+
+static void
+push_env(dw)
+       DviWidget       dw;
+{
+       DviState        *new;
+
+       new = (DviState *) XtMalloc (sizeof (*new));
+       if (dw->dvi.state)
+               *new = *(dw->dvi.state);
+       else {
+               new->font_size = 10 * dw->dvi.size_scale;
+               new->font_number = 1;
+               new->line_style = 0;
+               new->line_width = 10;
+               new->x = 0;
+               new->y = 0;
+       }
+       new->next = dw->dvi.state;
+       dw->dvi.state = new;
+}
+
+static void
+pop_env(dw)
+       DviWidget       dw;
+{
+       DviState        *old;
+
+       old = dw->dvi.state;
+       dw->dvi.state = old->next;
+       XtFree ((char *) old);
+}
+
+static void
+InitTypesetter (DviWidget dw)
+{
+       while (dw->dvi.state)
+               pop_env (dw);
+       dw->dvi.size_scale = dw->dvi.size_scale_set;
+       push_env (dw);
+       FlushCharCache (dw);
+}
+
+static void
+SetFont (DviWidget dw)
+{
+    dw->dvi.cache.font_size = dw->dvi.state->font_size;
+    dw->dvi.cache.font_number = dw->dvi.state->font_number;
+    dw->dvi.cache.font = QueryFont (dw,
+                         dw->dvi.cache.font_number,
+                         dw->dvi.cache.font_size);
+}
+
+static void
+PutCharacters (dw, src, len)
+    DviWidget      dw;
+    unsigned char   *src;
+    int                    len;
+{
+    int            xx, yx;
+    int            fx, fy;
+    char    *dst;
+    int            c;
+
+    xx = ToX(dw, dw->dvi.state->x);
+    yx = ToX(dw, dw->dvi.state->y);
+    fy = FontSizeInPixels (dw, dw->dvi.state->font_size);
+    fx = fy * len;
+    /*
+     * quick and dirty extents calculation:
+     */
+    if (yx + fy >= dw->dvi.extents.y1 &&
+       yx - fy <= dw->dvi.extents.y2 &&
+       xx + fx >= dw->dvi.extents.x1 &&
+       xx - fx <= dw->dvi.extents.x2)
+    {
+#ifdef USE_XFT
+       XftFont     *font;
+       DviTextItem *text;
+#else
+       register XFontStruct    *font;
+       register XTextItem              *text;
+#endif
+
+       if (!dw->dvi.display_enable)
+           return;
+
+       if (yx != dw->dvi.cache.y ||
+           dw->dvi.cache.char_index + len > DVI_CHAR_CACHE_SIZE)
+           FlushCharCache (dw);
+       /*
+        * load a new font, if the current block is not empty,
+        * step to the next.
+        */
+       if (dw->dvi.cache.font_size != dw->dvi.state->font_size ||
+           dw->dvi.cache.font_number != dw->dvi.state->font_number)
+       {
+           SetFont (dw);
+           if (dw->dvi.cache.cache[dw->dvi.cache.index].nchars != 0) {
+               ++dw->dvi.cache.index;
+               if (dw->dvi.cache.index >= dw->dvi.cache.max)
+                   FlushCharCache (dw);
+               dw->dvi.cache.cache[dw->dvi.cache.index].nchars = 0;
+           }
+       }
+       if (xx != dw->dvi.cache.x) {
+           if (dw->dvi.cache.cache[dw->dvi.cache.index].nchars != 0) {
+               ++dw->dvi.cache.index;
+               if (dw->dvi.cache.index >= dw->dvi.cache.max)
+                   FlushCharCache (dw);
+               dw->dvi.cache.cache[dw->dvi.cache.index].nchars = 0;
+           }
+       }
+       if (!dw->dvi.cache.font)
+           SetFont (dw);
+       text = &dw->dvi.cache.cache[dw->dvi.cache.index];
+       font = dw->dvi.cache.font;
+       dst = &dw->dvi.cache.char_cache[dw->dvi.cache.char_index];
+       if (text->nchars == 0) {
+           text->chars = dst;
+#ifdef USE_XFT
+           text->x = xx;
+#else
+           text->delta = xx - dw->dvi.cache.x;
+#endif
+#ifdef USE_XFT
+           text->font = font;
+#endif
+           if (font != dw->dvi.font) {
+#ifndef USE_XFT
+               text->font = font->fid;
+#endif
+               dw->dvi.font = font;
+           }
+#ifndef USE_XFT
+           else
+               text->font = None;
+#endif
+           dw->dvi.cache.x = xx;
+       }
+       dw->dvi.cache.char_index += len;
+       text->nchars += len;
+       while (len--)
+       {
+           c = *src++;
+           *dst++ = c;
+           if (font)
+               dw->dvi.cache.x += charWidth(dw,font,c);
+       }
+    }
+}
+
+static void
+ParseDrawFunction(dw, buf)
+       DviWidget       dw;
+       char            *buf;
+{
+    int        n, m, n1, m1;
+
+    SetGCForDraw (dw);
+    switch (buf[0]) {
+    case 'l':                          /* draw a line */
+       sscanf(buf+1, "%d %d", &n, &m);
+       DrawLine(dw, n, m);
+       break;
+    case 'c':                          /* circle */
+       sscanf(buf+1, "%d", &n);
+       DrawCircle(dw, n);
+       break;
+    case 'e':                          /* ellipse */
+       sscanf(buf+1, "%d %d", &m, &n);
+       DrawEllipse(dw, m, n);
+       break;
+    case 'a':                          /* arc */
+       sscanf(buf+1, "%d %d %d %d", &n, &m, &n1, &m1);
+       DrawArc(dw, n, m, n1, m1);
+       break;
+    case '~':                          /* wiggly line */
+       DrawSpline(dw, buf+1,1);
+       break;
+    case 't':                          /* line width */
+       sscanf(buf+1, "%d", &n);
+       dw->dvi.state->line_width = n;
+       break;
+    case 's':                          /* line style */
+       sscanf(buf+1, "%d", &n);
+       /* XXX */
+       break;
+    default:
+       /* warning("unknown drawing function %s", buf); */
+       break;
+    }
+} 
+
+extern int LastPage, CurrentPage;
+
+static void
+ParseDeviceControl(dw)                         /* Parse the x commands */
+       DviWidget       dw;
+{
+    char str[20], str1[50];
+    int c, n;
+
+    GetWord (dw, str, 20);
+    switch (str[0]) {                  /* crude for now */
+    case 'T':                          /* output device */
+       GetWord(dw, str, 20);
+       break;
+    case 'i':                          /* initialize */
+       InitTypesetter (dw);
+       break;
+    case 't':                          /* trailer */
+       break;
+    case 'p':                          /* pause -- can restart */
+       break;
+    case 's':                          /* stop */
+       return;
+    case 'r':                          /* resolution when prepared */
+       SetDeviceResolution (dw, GetNumber (dw));
+       break;
+    case 'f':                          /* font used */
+       n = GetNumber(dw);
+       GetWord(dw, str, 20);
+       GetLine(dw, str1, 50);
+       SetFontPosition(dw, n, str, str1);
+       break;
+    case 'H':                          /* char height */
+       break;
+    case 'S':                          /* slant */
+       break;
+    }
+    while (DviGetC(dw,&c) != '\n')             /* skip rest of input line */
+           if (c == EOF)
+                   return;
+}
diff --git a/xditview/rdblarrow b/xditview/rdblarrow
new file mode 100644 (file)
index 0000000..19140c7
--- /dev/null
@@ -0,0 +1,5 @@
+#define next_width 11
+#define next_height 11
+static char next_bits[] = {
+   0x21, 0x00, 0x42, 0x00, 0x84, 0x00, 0x08, 0x01, 0x10, 0x02, 0x20, 0x04,
+   0x10, 0x02, 0x08, 0x01, 0x84, 0x00, 0x42, 0x00, 0x21, 0x00};
diff --git a/xditview/xdit.bm b/xditview/xdit.bm
new file mode 100644 (file)
index 0000000..0c7aa8c
--- /dev/null
@@ -0,0 +1,14 @@
+#define xdit_width 32
+#define xdit_height 32
+static unsigned char xdit_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x03, 0x02, 0x00, 0x00, 0x02,
+   0x8a, 0xa2, 0xfc, 0x03, 0x52, 0x14, 0x03, 0x04, 0x02, 0x80, 0x00, 0x08,
+   0x52, 0x54, 0x00, 0x10, 0x8a, 0x22, 0x8f, 0x23, 0x02, 0x20, 0x06, 0x21,
+   0x8a, 0x12, 0x8c, 0x40, 0x52, 0x14, 0x8c, 0x40, 0x02, 0x10, 0x58, 0x40,
+   0x52, 0x14, 0x30, 0x40, 0x8a, 0x12, 0x30, 0x40, 0x02, 0x10, 0x70, 0x40,
+   0x8a, 0x12, 0xc8, 0x40, 0x52, 0x24, 0xc4, 0xe0, 0x02, 0x20, 0x84, 0xe1,
+   0x52, 0x54, 0xce, 0xf3, 0x8a, 0xa2, 0x00, 0xf8, 0x02, 0x00, 0x03, 0xfc,
+   0x8a, 0x22, 0xfc, 0xf3, 0x52, 0x14, 0x00, 0xc2, 0x02, 0x00, 0x00, 0x02,
+   0x52, 0x14, 0x45, 0x02, 0x8a, 0xa2, 0x28, 0x02, 0x02, 0x00, 0x00, 0x02,
+   0x02, 0x00, 0x00, 0x02, 0xfe, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/xditview/xdit_mask.bm b/xditview/xdit_mask.bm
new file mode 100644 (file)
index 0000000..a584629
--- /dev/null
@@ -0,0 +1,14 @@
+#define xdit_mask_width 32
+#define xdit_mask_height 32
+static unsigned char xdit_mask_bits[] = {
+   0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0x07,
+   0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0x1f,
+   0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xc7,
+   0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0x07,
+   0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0x07,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/xditview/xditview.c b/xditview/xditview.c
new file mode 100644 (file)
index 0000000..41f3bf4
--- /dev/null
@@ -0,0 +1,655 @@
+/* $XConsortium: xditview.c,v 1.32 94/04/17 20:43:36 eswu Exp $ */
+/*
+
+Copyright (c) 1991  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86: xc/programs/xditview/xditview.c,v 1.4tsi Exp $ */
+/*
+ * xditview -- 
+ *
+ *   Display ditroff output in an X window
+ */
+
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Xatom.h>
+#include <X11/Shell.h>
+#include <X11/Xos.h>           /* rindex declaration */
+#include <X11/Xaw/Paned.h>
+#include <X11/Xaw/Panner.h>
+#include <X11/Xaw/Porthole.h>
+#include <X11/Xaw/Viewport.h>
+#include <X11/Xaw/Box.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Dialog.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/MenuButton.h>
+#include <X11/Xaw/SimpleMenu.h>
+#include <X11/Xaw/SmeBSB.h>
+#include <X11/Xaw/AsciiText.h>
+
+#include "Dvi.h"
+
+#include "xdit.bm"
+#include "xdit_mask.bm"
+#include <stdio.h>
+#include <stdlib.h>
+
+/* Command line options table.  Only resources are entered here...there is a
+   pass over the remaining options after XtParseCommand is let loose. */
+
+static XrmOptionDescRec options[] = {
+{"-page",          "*dvi.pageNumber",      XrmoptionSepArg,    NULL},
+{"-backingStore",   "*dvi.backingStore",    XrmoptionSepArg,   NULL},
+{"-noPolyText",            "*dvi.noPolyText",      XrmoptionNoArg,     "TRUE"},
+{"-resolution",            "*dvi.screenResolution",XrmoptionSepArg,    NULL},
+};
+
+static char    current_file_name[1024];
+static FILE    *current_file;
+
+static void MakePrompt(Widget, char *, void (*)(char *), char *);
+
+/*
+ * Report the syntax for calling xditview.
+ */
+
+static void
+Syntax(char *call)
+{
+       (void) printf ("Usage: %s [-fg <color>] [-bg <color>]\n", call);
+       (void) printf ("       [-bd <color>] [-bw <pixels>] [-help]\n");
+       (void) printf ("       [-display displayname] [-geometry geom]\n");
+       (void) printf ("       [-page <page-number>] [-backing <backing-store>]\n");
+       (void) printf ("       [-resolution <screen-resolution>]\n\n");
+       exit(1);
+}
+
+static void    NewResolution (char *resString);
+static void    NewFile (char *name);
+static void    DisplayPageNumber (void);
+static void    VisitFile (char *name, Boolean resetPage);
+static Widget  toplevel, paned, porthole, dvi;
+#ifdef NOTDEF
+static Widget  form, panner;
+#endif
+static Widget  popupMenu;
+static Widget  menuBar;
+static Widget  fileMenuButton, fileMenu;
+static Widget  pageNumber;
+
+static void    NextPage(Widget entry, XtPointer name, XtPointer data);
+static void    PreviousPage(Widget entry, XtPointer name, XtPointer data);
+static void    SetResolution(Widget entry, XtPointer name, XtPointer data);
+static void    OpenFile(Widget entry, XtPointer name, XtPointer data);
+static void    RevisitFile(Widget entry, XtPointer name, XtPointer data);
+static void    Quit(Widget entry, XtPointer closure, XtPointer data);
+
+struct menuEntry {
+    char    *name;
+    void    (*function)(Widget entry, XtPointer name, XtPointer data);
+};
+
+static struct menuEntry popupMenuEntries[] = {
+    { "nextPage",          NextPage },
+    { "previousPage",      PreviousPage },
+    { "setResolution",     SetResolution },
+    { "openFile",          OpenFile },
+    { "revisitFile",       RevisitFile },
+    { "quit",              Quit }
+};
+
+static struct menuEntry fileMenuEntries[] = {
+    { "openFile",          OpenFile },
+    { "revisitFile",       RevisitFile },
+    { "setResolution",     SetResolution },
+    { "quit",              Quit }
+};
+
+static void    NextPageAction(Widget, XEvent *, String *, Cardinal *);
+static void    PreviousPageAction(Widget, XEvent *, String *, Cardinal *);
+static void    SetResolutionAction(Widget, XEvent *, String *, Cardinal *);
+static void    OpenFileAction(Widget, XEvent *, String *, Cardinal *);
+static void    RevisitFileAction(Widget, XEvent *, String *, Cardinal *);
+static void    QuitAction(Widget, XEvent *, String *, Cardinal *);
+static void    AcceptAction(Widget, XEvent *, String *, Cardinal *);
+static void    CancelAction(Widget, XEvent *, String *, Cardinal *);
+static void    UpdatePageNumber(Widget, XEvent *, String *, Cardinal *);
+static void    Noop(Widget, XEvent *, String *, Cardinal *);
+
+XtActionsRec xditview_actions[] = {
+    { "NextPage",          NextPageAction },
+    { "PreviousPage",      PreviousPageAction },
+    { "SetResolution",     SetResolutionAction },
+    { "OpenFile",          OpenFileAction },
+    { "Quit",              QuitAction },
+    { "Accept",                    AcceptAction },
+    { "Cancel",                    CancelAction },
+    { "SetPageNumber",     UpdatePageNumber },
+    { "Noop",              Noop }
+};
+
+static Atom wm_delete_window;
+
+#ifdef NOTDEF
+/*     Function Name: PannerCallback
+ *     Description: called when the panner has moved.
+ *     Arguments: panner - the panner widget.
+ *                 closure - *** NOT USED ***.
+ *                 report_ptr - the panner record.
+ *     Returns: none.
+ */
+
+/* ARGSUSED */
+static void 
+PannerCallback(Widget w, XtPointer closure, XtPointer report_ptr)
+{
+    Arg args[2];
+    XawPannerReport *report = (XawPannerReport *) report_ptr;
+
+    if (!dvi)
+       return;
+    XtSetArg (args[0], XtNx, -report->slider_x);
+    XtSetArg (args[1], XtNy, -report->slider_y);
+
+    XtSetValues(dvi, args, 2);
+}
+
+/*     Function Name: PortholeCallback
+ *     Description: called when the porthole or its child has
+ *                   changed 
+ *     Arguments: porthole - the porthole widget.
+ *                 panner_ptr - the panner widget.
+ *                 report_ptr - the porthole record.
+ *     Returns: none.
+ */
+
+/* ARGSUSED */
+static void 
+PortholeCallback(Widget w, XtPointer panner_ptr, XtPointer report_ptr)
+{
+    Arg args[10];
+    Cardinal n = 0;
+    XawPannerReport *report = (XawPannerReport *) report_ptr;
+    Widget panner = (Widget) panner_ptr;
+
+    XtSetArg (args[n], XtNsliderX, report->slider_x); n++;
+    XtSetArg (args[n], XtNsliderY, report->slider_y); n++;
+    if (report->changed != (XawPRSliderX | XawPRSliderY)) {
+       XtSetArg (args[n], XtNsliderWidth, report->slider_width); n++;
+       XtSetArg (args[n], XtNsliderHeight, report->slider_height); n++;
+       XtSetArg (args[n], XtNcanvasWidth, report->canvas_width); n++;
+       XtSetArg (args[n], XtNcanvasHeight, report->canvas_height); n++;
+    }
+    XtSetValues (panner, args, n);
+}
+#endif
+
+int
+main(int argc, char **argv)
+{
+    char           *file_name = 0;
+    int                    i;
+    XtAppContext    xtcontext;
+    Arg                    topLevelArgs[2];
+    Widget          entry;
+
+    XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
+
+    toplevel = XtAppInitialize(&xtcontext, "Xditview",
+                              options, XtNumber (options),
+                              &argc, argv, NULL, NULL, 0);
+    if (argc > 2)
+       Syntax(argv[0]);
+
+    XtAppAddActions(xtcontext, xditview_actions, XtNumber (xditview_actions));
+    XtOverrideTranslations
+       (toplevel, XtParseTranslationTable ("<Message>WM_PROTOCOLS: Quit()"));
+
+    XtSetArg (topLevelArgs[0], XtNiconPixmap,
+             XCreateBitmapFromData (XtDisplay (toplevel),
+                                    XtScreen(toplevel)->root,
+                                    (char *) xdit_bits,
+                                    xdit_width, xdit_height));
+                                   
+    XtSetArg (topLevelArgs[1], XtNiconMask,
+             XCreateBitmapFromData (XtDisplay (toplevel),
+                                    XtScreen(toplevel)->root,
+                                    (char *) xdit_mask_bits, 
+                                    xdit_mask_width, xdit_mask_height));
+    XtSetValues (toplevel, topLevelArgs, 2);
+    if (argc > 1)
+       file_name = argv[1];
+
+    /*
+     * create the popup menu and insert the entries
+     */
+    popupMenu = XtCreatePopupShell ("popupMenu", simpleMenuWidgetClass, toplevel,
+                                   NULL, 0);
+    for (i = 0; i < XtNumber (popupMenuEntries); i++) {
+       entry = XtCreateManagedWidget(popupMenuEntries[i].name, 
+                                     smeBSBObjectClass, popupMenu,
+                                     NULL, (Cardinal) 0);
+       XtAddCallback(entry, XtNcallback, popupMenuEntries[i].function, NULL);
+    }
+
+    paned = XtCreateManagedWidget("paned", panedWidgetClass, toplevel,
+                                   NULL, (Cardinal) 0);
+    menuBar = XtCreateManagedWidget ("menuBar", boxWidgetClass, paned, 0, 0);
+
+    fileMenuButton = XtCreateManagedWidget ("fileMenuButton", menuButtonWidgetClass,
+                                   menuBar, NULL, (Cardinal) 0);
+    fileMenu = XtCreatePopupShell ("fileMenu", simpleMenuWidgetClass,
+                                   fileMenuButton, NULL, (Cardinal) 0);
+    for (i = 0; i < XtNumber (fileMenuEntries); i++) {
+       entry = XtCreateManagedWidget(fileMenuEntries[i].name,
+                                     smeBSBObjectClass, fileMenu,
+                                     NULL, (Cardinal) 0);
+       XtAddCallback (entry, XtNcallback, fileMenuEntries[i].function, NULL);
+    }
+
+    (void) XtCreateManagedWidget ("prevButton", commandWidgetClass,
+                                 menuBar, NULL, (Cardinal) 0);
+
+    pageNumber = XtCreateManagedWidget("pageNumber", asciiTextWidgetClass,
+                                       menuBar, NULL, (Cardinal) 0);
+  
+    (void) XtCreateManagedWidget ("nextButton", commandWidgetClass,
+                                 menuBar, NULL, (Cardinal) 0);
+
+#ifdef NOTDEF
+    form = XtCreateManagedWidget ("form", formWidgetClass, paned,
+                                   NULL, (Cardinal) 0);
+    panner = XtCreateManagedWidget ("panner", pannerWidgetClass,
+                                   form, NULL, 0);
+    porthole = XtCreateManagedWidget ("porthole", portholeWidgetClass,
+                                     form, NULL, 0);
+    XtAddCallback(porthole, 
+                 XtNreportCallback, PortholeCallback, (XtPointer) panner);
+    XtAddCallback(panner, 
+                 XtNreportCallback, PannerCallback, (XtPointer) porthole);
+#else
+    porthole = XtCreateManagedWidget ("viewport", viewportWidgetClass,
+                                     paned, NULL, 0);
+#endif
+    dvi = XtCreateManagedWidget ("dvi", dviWidgetClass, porthole, NULL, 0);
+    if (file_name)
+       VisitFile (file_name, FALSE);
+    XtRealizeWidget (toplevel);
+    wm_delete_window = XInternAtom(XtDisplay(toplevel), "WM_DELETE_WINDOW",
+                                  False);
+    (void) XSetWMProtocols (XtDisplay(toplevel), XtWindow(toplevel),
+                            &wm_delete_window, 1);
+    XtAppMainLoop(xtcontext);
+
+    return 0;
+}
+
+static void
+DisplayPageNumber ()
+{
+    Arg        arg[2];
+    int        actual_number, last_page;
+    XawTextBlock    text;
+    int                    length;
+    char           value[128];
+    char           *cur;
+
+    XtSetArg (arg[0], XtNpageNumber, &actual_number);
+    XtSetArg (arg[1], XtNlastPageNumber, &last_page);
+    XtGetValues (dvi, arg, 2);
+    if (actual_number == 0)
+       sprintf (value, "<none>");
+    else if (last_page > 0)
+       sprintf (value, "%d of %d", actual_number, last_page);
+    else
+       sprintf (value, "%d", actual_number);
+    text.firstPos = 0;
+    text.length = strlen (value);
+    text.ptr = value;
+    text.format = FMT8BIT;
+    XtSetArg (arg[0], XtNstring, &cur);
+    XtGetValues (XawTextGetSource (pageNumber), arg, 1);
+    length = strlen (cur);
+    XawTextReplace (pageNumber, 0, length, &text);
+}
+
+static void
+SetPageNumber (int number)
+{
+    Arg        arg[1];
+
+    XtSetArg (arg[0], XtNpageNumber, number);
+    XtSetValues (dvi, arg, 1);
+    DisplayPageNumber ();
+}
+
+static void
+UpdatePageNumber (Widget w, XEvent *xev, String *s, Cardinal *c)
+{
+    char    *string;
+    Arg            arg[1];
+
+    XtSetArg (arg[0], XtNstring, &string);
+    XtGetValues (XawTextGetSource(pageNumber), arg, 1);
+    SetPageNumber (atoi(string));
+}
+
+static void
+NewResolution(resString)
+char   *resString;
+{
+    int        res;
+    Arg        arg[1];
+    
+    res = atoi (resString);
+    if (res <= 0)
+       return;
+    XtSetArg (arg[0], XtNscreenResolution, res);
+    XtSetValues (dvi, arg, 1);
+}
+
+static void
+VisitFile (char *name, Boolean resetPage)
+{
+    Arg            arg[3];
+    char    *n;
+    FILE    *new_file;
+    Boolean seek = 0;
+    int            i;
+
+    if (current_file) {
+       if (!strcmp (current_file_name, "-"))
+           ;
+       else if (current_file_name[0] == '|')
+           pclose (current_file);
+       else
+           fclose (current_file);
+    }
+    if (!strcmp (name, "-"))
+       new_file = stdin;
+    else if (name[0] == '|')
+       new_file = popen (name+1, "r");
+    else {
+       new_file = fopen (name, "r");
+       seek = 1;
+    }
+    if (!new_file) {
+       /* XXX display error message */
+       return;
+    }
+    i = 0;
+    XtSetArg (arg[i], XtNfile, new_file); i++;
+    XtSetArg (arg[i], XtNseek, seek); i++;
+    if (resetPage) {
+       XtSetArg (arg[i], XtNpageNumber, 1); i++;
+    }
+    XtSetValues (dvi, arg, i);
+    XtSetArg (arg[0], XtNtitle, name);
+    if (name[0] != '/' && (n = rindex (name, '/')))
+       n = n + 1;
+    else
+       n = name;
+    XtSetArg (arg[1], XtNiconName, n);
+    XtSetValues (toplevel, arg, 2);
+    strcpy (current_file_name, name);
+    current_file = new_file;
+    DisplayPageNumber ();
+}
+
+static void
+NewFile (name)
+char   *name;
+{
+    VisitFile (name, TRUE);
+}
+
+static char fileBuf[1024];
+static char resolutionBuf[1024];
+
+static void
+ResetMenuEntry (Widget entry)
+{
+    Arg        arg[1];
+
+    XtSetArg (arg[0], XtNpopupOnEntry, entry);
+    XtSetValues (XtParent(entry) , arg, (Cardinal) 1);
+}
+
+/*ARGSUSED*/
+static void
+NextPage (entry, name, data)
+    Widget  entry;
+    XtPointer name, data;
+{
+    NextPageAction(entry, NULL, NULL, NULL);
+    ResetMenuEntry (entry);
+}
+
+static void
+NextPageAction (Widget w, XEvent *xev, String *s, Cardinal *c)
+{
+    Arg        args[1];
+    int        number;
+
+    XtSetArg (args[0], XtNpageNumber, &number);
+    XtGetValues (dvi, args, 1);
+    SetPageNumber (number+1);
+}
+
+/*ARGSUSED*/
+static void
+PreviousPage (entry, name, data)
+    Widget  entry;
+    XtPointer name, data;
+{
+    PreviousPageAction (entry, NULL, NULL, NULL);
+    ResetMenuEntry (entry);
+}
+
+static void
+PreviousPageAction (Widget w, XEvent *xev, String *s, Cardinal *c)
+{
+    Arg        args[1];
+    int        number;
+
+    XtSetArg (args[0], XtNpageNumber, &number);
+    XtGetValues (dvi, args, 1);
+    SetPageNumber (number-1);
+}
+
+/*ARGSUSED*/
+static void
+SetResolution (entry, name, data)
+    Widget  entry;
+    XtPointer name, data;
+{
+    SetResolutionAction (entry, NULL, NULL, NULL);
+    ResetMenuEntry (entry);
+}
+
+static void
+SetResolutionAction (Widget w, XEvent *xev, String *s, Cardinal *c)
+{
+    Arg            args[1];
+    int            cur;
+
+    XtSetArg (args[0], XtNscreenResolution, &cur);
+    XtGetValues (dvi, args, 1);
+    sprintf (resolutionBuf, "%d", cur);
+    MakePrompt (toplevel, "Screen resolution:", NewResolution, resolutionBuf);
+}
+
+/*ARGSUSED*/
+static void
+OpenFile (entry, name, data)
+    Widget  entry;
+    XtPointer name, data;
+{
+    OpenFileAction (entry, NULL, NULL, NULL);
+    ResetMenuEntry (entry);
+}
+
+static void
+OpenFileAction (Widget w, XEvent *xev, String *s, Cardinal *c)
+{
+    if (current_file_name[0])
+       strcpy (fileBuf, current_file_name);
+    else
+       fileBuf[0] = '\0';
+    MakePrompt (toplevel, "File to open:", NewFile, fileBuf);
+}
+
+/*ARGSUSED*/
+static void
+RevisitFile (entry, name, data)
+    Widget  entry;
+    XtPointer name, data;
+{
+    RevisitFileAction (entry, NULL, NULL, NULL);
+    ResetMenuEntry (entry);
+}
+
+static void
+RevisitFileAction (Widget w, XEvent *xev, String *s, Cardinal *c)
+{
+    if (current_file_name[0])
+       VisitFile (current_file_name, FALSE);
+}
+
+/*ARGSUSED*/
+static void
+Quit (entry, closure, data)
+    Widget  entry;
+    XtPointer closure, data;
+{
+    QuitAction (entry, NULL, NULL, NULL);
+}
+
+static void
+QuitAction (Widget w, XEvent *xev, String *s, Cardinal *c)
+{
+    exit (0);
+}
+
+Widget promptShell, promptDialog;
+void   (*promptfunction)(char *);
+
+/* ARGSUSED */
+static
+void CancelAction (widget, event, params, num_params)
+    Widget     widget;
+    XEvent     *event;
+    String     *params;
+    Cardinal   *num_params;
+{
+    if (promptShell) {
+       XtSetKeyboardFocus(toplevel, (Widget) None);
+       XtDestroyWidget(promptShell);
+       promptShell = (Widget) 0;
+    }
+}
+
+
+/* ARGSUSED */
+static
+void AcceptAction (widget, event, params, num_params)
+    Widget     widget;
+    XEvent     *event;
+    String     *params;
+    Cardinal   *num_params;
+{
+    (*promptfunction)(XawDialogGetValueString(promptDialog));
+    CancelAction (widget, event, params, num_params);
+}
+
+static
+void Noop (Widget w, XEvent *xev, String *s, Cardinal *c)
+{
+}
+
+static void
+MakePrompt(centerw, prompt, func, def)
+Widget centerw;
+char *prompt;
+void (*func)(char *);
+char   *def;
+{
+    static Arg dialogArgs[] = {
+       {XtNlabel, (XtArgVal) 0},
+       {XtNvalue, (XtArgVal) 0},
+    };
+    Arg valueArgs[1];
+    Arg centerArgs[2];
+    Position   source_x, source_y;
+    Position   dest_x, dest_y;
+    Dimension center_width, center_height;
+    Dimension prompt_width, prompt_height;
+    Widget  valueWidget;
+    
+    CancelAction ((Widget)NULL, (XEvent *) 0, (String *) 0, (Cardinal *) 0);
+    promptShell = XtCreatePopupShell ("promptShell", transientShellWidgetClass,
+                                     toplevel, NULL, (Cardinal) 0);
+    dialogArgs[0].value = (XtArgVal)prompt;
+    dialogArgs[1].value = (XtArgVal)def;
+    promptDialog = XtCreateManagedWidget( "promptDialog", dialogWidgetClass,
+                   promptShell, dialogArgs, XtNumber (dialogArgs));
+    XawDialogAddButton(promptDialog, "accept", NULL, NULL);
+    XawDialogAddButton(promptDialog, "cancel", NULL, NULL);
+    valueWidget = XtNameToWidget (promptDialog, "value");
+    if (valueWidget) {
+       XtSetArg (valueArgs[0], XtNresizable, TRUE);
+       XtSetValues (valueWidget, valueArgs, 1);
+       /*
+        * as resizable isn't set until just above, the
+        * default value will be displayed incorrectly.
+        * rectify the situation by resetting the values
+        */
+        XtSetValues (promptDialog, dialogArgs, XtNumber (dialogArgs));
+    }
+    XtSetKeyboardFocus (promptDialog, valueWidget);
+    XtSetKeyboardFocus (toplevel, valueWidget);
+    XtRealizeWidget (promptShell);
+    /*
+     * place the widget in the center of the "parent"
+     */
+    XtSetArg (centerArgs[0], XtNwidth, &center_width);
+    XtSetArg (centerArgs[1], XtNheight, &center_height);
+    XtGetValues (centerw, centerArgs, 2);
+    XtSetArg (centerArgs[0], XtNwidth, &prompt_width);
+    XtSetArg (centerArgs[1], XtNheight, &prompt_height);
+    XtGetValues (promptShell, centerArgs, 2);
+    source_x = (int)(center_width - prompt_width) / 2;
+    source_y = (int)(center_height - prompt_height) / 3;
+    XtTranslateCoords (centerw, source_x, source_y, &dest_x, &dest_y);
+    XtSetArg (centerArgs[0], XtNx, dest_x);
+    XtSetArg (centerArgs[1], XtNy, dest_y);
+    XtSetValues (promptShell, centerArgs, 2);
+    XtMapWidget(promptShell);
+    promptfunction = func;
+}
diff --git a/xditview/xditview.man b/xditview/xditview.man
new file mode 100644 (file)
index 0000000..c75c8a8
--- /dev/null
@@ -0,0 +1,177 @@
+.\" $XConsortium: xditview.man,v 1.10 94/04/17 20:43:37 gildea Exp $
+.\"
+.\" $XFree86: xc/programs/xditview/xditview.man,v 1.4 2003/03/19 01:49:28 dawes Exp $
+.\"
+.TH XDITVIEW 1 __xorgversion__
+.SH NAME
+xditview \- display ditroff output
+.SH SYNOPSIS
+.B xditview
+[ \-\fItoolkitoption\fP .\|.\|. ] [ \-\fIoption\fP .\|.\|. ] [ \fIfilename\fP ]
+.SH DESCRIPTION
+The
+.I xditview 
+program displays
+.I ditroff
+output on an X display.  It uses no special
+metrics and automatically converts the printer coordinates into screen
+coordinates; using the user-specified screen resolution, rather than the
+actual resolution so that the appropriate fonts can be found.  If
+``\fB\-\fP'' is given as the
+.I filename,
+.I xditview
+reads from standard input.
+If ``\fB|\fP'' is the first character of
+.I filename,
+.I xditview
+forks
+.I sh
+to run the rest of the ``file name'' and uses the
+standard output of that command.
+.SH OPTIONS
+.I Xditview
+accepts all of the standard X Toolkit command line options along with the 
+additional options listed below:
+.TP 8
+.B \-page \fIpage-number\fP
+This option specifies the page number of the document to be displayed at
+start up time.
+.TP 8
+.B \-resolution \fIscreen-resolution\fP
+This specifies the desired screen resolution to use; fonts will be opened by
+requesting this resolution field in the XLFD names.
+.TP 8
+.B \-noPolyText
+Some X servers incorrectly implement PolyText with multiple strings
+per request.  This option suppresses the use of this feature in
+.I xditview.
+.TP 8
+.B \-backingStore \fIbacking-store-type\fP
+Redisplay can take up to a second or so; this option causes
+the server to save the window contents so that when it is scrolled around the
+viewport, the window is painted from contents saved in backing store. 
+\fIbacking-store-type\fP can be one of \fBAlways\fP, \fPWhenMapped\fP or
+\fPNotUseful\fP.
+.PP
+The following standard X Toolkit command line arguments are commonly used with 
+.I xditview:
+.TP 8
+.B \-bg \fIcolor\fP
+This option specifies the color to use for the background of the window.  
+The default is \fIwhite\fP.
+.TP 8
+.B \-bd \fIcolor\fP
+This option specifies the color to use for the border of the window.
+The default is \fIblack\fP.
+.TP 8
+.B \-bw \fInumber\fP
+This option specifies the width in pixels of the border surrounding the window.
+.TP 8
+.B \-fg \fIcolor\fP
+This option specifies the color to use for displaying text.  The default is 
+\fIblack\fP.
+.TP 8
+.B \-fn \fIfont\fP
+This option specifies the font to be used for displaying widget text.  The
+default is \fIfixed\fP.
+.TP 8
+.B \-rv
+This option indicates that reverse video should be simulated by swapping
+the foreground and background colors.
+.TP 8
+.B \-geometry \fIgeometry\fP
+This option specifies the preferred size and position of the window.
+.TP 8
+.B \-display \fIhost\fP:\fIdisplay\fP
+This option specifies the X server to contact.
+.TP 8
+.B \-xrm \fIresourcestring\fP
+This option specifies a resource string to be used.
+.SH X DEFAULTS
+This program uses a
+.I Dvi
+widget.  It understands all of the core resource names and
+classes as well as:
+.PP
+.TP 8
+.B width (\fPclass\fB Width)
+Specifies the width of the window.
+.TP 8
+.B height (\fPclass\fB Height)
+Specifies the height of the window.
+.TP 8
+.B foreground (\fPclass\fB Foreground)
+Specifies the default foreground color.
+.TP 8
+.B font (\fPclass\fB Font)
+Specifies the font to be used for error messages.
+.TP 8
+.B FontMap (\fBclass\fB FontMap)
+To associate the
+.I ditroff
+fonts with appropriate X fonts, this string
+resource contains a set of new-line separated specifications, each of which
+consists of a ditroff name, some white space and an XLFD pattern with *
+characters in appropriate places to allow all sizes to be listed.  The
+default fontMap is:
+.nf
+.sp
+R      \-*\-times\-medium\-r\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+I      \-*\-times\-medium\-i\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+B      \-*\-times\-bold\-r\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+F      \-*\-times\-bold\-i\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+BI     \-*\-times\-bold\-i\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+C      \-*\-courier\-medium\-r\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+CO     \-*\-courier\-medium\-o\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+CB     \-*\-courier\-bold\-r\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+CF     \-*\-courier\-bold\-o\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+H      \-*\-helvetica\-medium\-r\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+HO     \-*\-helvetica\-medium\-o\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+HB     \-*\-helvetica\-bold\-r\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+HF     \-*\-helvetica\-bold\-o\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+N      \-*\-new century schoolbook\-medium\-r\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+NI     \-*\-new century schoolbook\-medium\-i\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+NB     \-*\-new century schoolbook\-bold\-r\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+NF     \-*\-new century schoolbook\-bold\-i\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+A      \-*\-charter\-medium\-r\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+AI     \-*\-charter\-medium\-i\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+AB     \-*\-charter\-bold\-r\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+AF     \-*\-charter\-bold\-i\-normal\-\^\-*\-*\-*\-*\-*\-*\-iso8859\-1\en\e
+S      \-*\-symbol\-medium\-r\-normal\-\^\-*\-*\-*\-*\-*\-*\-adobe\-fontspecific\en\e
+S2     \-*\-symbol\-medium\-r\-normal\-\^\-*\-*\-*\-*\-*\-*\-adobe\-fontspecific\en
+.sp
+.fi
+.SH "USING XDITVIEW WITH DITROFF"
+.PP
+You can use any ditroff output file with
+.I xditview,
+although files which use
+the fonts appropriate to the fontMap will look more accurate on the screen.
+On servers which support scaled fonts, all requested font sizes will be
+accurately reflected on the screen; for servers which do not support scaled
+.I xditview
+will use the closest font from the same family.
+.SH "SEE ALSO"
+.IR X (__miscmansuffix__),
+.IR xrdb (1),
+.IR ditroff (1),
+.I "X Logical Font Description Conventions"
+.SH ORIGIN
+Portions of this program originated in
+.I xtroff which was derived
+from
+.I suntroff.  
+.SH COPYRIGHT
+Copyright 1994 X Consortium
+.br
+See \fIX\fP(1) for a full statement of rights and permissions.
+.SH AUTHORS
+Keith Packard (MIT X Consortium)
+.br
+Richard L. Hyde (Purdue)
+.br
+David Slattengren (Berkeley)
+.br
+Malcom Slaney (Schlumberger Palo Alto Research)
+.br
+Mark Moraes (University of Toronto)
diff --git a/xedit/AUTHORS b/xedit/AUTHORS
new file mode 100644 (file)
index 0000000..65e5b4c
--- /dev/null
@@ -0,0 +1,143 @@
+(Original author based on manpage)
+Chris D. Peterson, MIT X Consortium
+commands.c
+util.c
+xedit.c
+xedit.h
+
+
+------------------------------------------------------------------------
+Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+xedit:
+hook.c
+hash.c
+ispell.c
+lisp.c
+options.c
+tags.c
+util.h
+
+xedit lisp interface:
+lisp/bytecode.c
+lisp/bytecode.h
+lisp/compile.c
+lisp/core.c
+lisp/core.h
+lisp/debugger.c
+lisp/debugger.h
+lisp/format.c
+lisp/format.h
+lisp/internal.h
+lisp/io.c
+lisp/io.h
+lisp/hash.c
+lisp/hash.h
+lisp/helper.c
+lisp/helper.h
+lisp/lisp.c
+lisp/lisp.h
+lisp/math.c
+lisp/math.h
+lisp/mathimp.c
+lisp/package.c
+lisp/package.h
+lisp/pathname.c
+lisp/pathname.h
+lisp/private.h
+lisp/read.c
+lisp/read.h
+lisp/regex.c
+lisp/regex.h
+lisp/require.c
+lisp/require.h
+lisp/stream.c
+lisp/stream.h
+lisp/string.c
+lisp/string.h
+lisp/struct.c
+lisp/struct.h
+lisp/time.c
+lisp/time.h
+lisp/write.c
+lisp/write.h
+lisp/xedit.c
+lisp/xedit.h
+
+bignum math library:
+lisp/mp/mp.h
+lisp/mp/mpr.c
+lisp/mp/mpi.c
+lisp/mp/mp.c
+
+command line lisp interpreter:
+lisp/lsp.c
+
+regex library:
+lisp/re/re.c
+lisp/re/re.h
+lisp/re/reo.c
+lisp/re/rep.h
+lisp/re/rec.c
+lisp/re/tests.c
+lisp/re/tests.txt
+
+source files to test the lisp interpreter:
+lisp/test/widgets.lsp
+lisp/test/list.lsp
+lisp/test/hello.lsp
+lisp/test/regex.lsp
+lisp/test/stream.lsp
+lisp/test/math.lsp
+
+lisp binary modules:
+lisp/modules/psql.c
+lisp/modules/x11.c
+lisp/modules/xaw.c
+lisp/modules/xt.c
+
+lisp source modules:
+lisp/modules/indent.lsp
+lisp/modules/lisp.lsp
+lisp/modules/syntax.lsp
+lisp/modules/xedit.lsp
+
+lisp syntax highlight and indentation rules definitions:
+lisp/modules/progmodes/c.lsp
+lisp/modules/progmodes/html.lsp
+lisp/modules/progmodes/imake.lsp
+lisp/modules/progmodes/lisp.lsp
+lisp/modules/progmodes/make.lsp
+lisp/modules/progmodes/man.lsp
+lisp/modules/progmodes/patch.lsp
+lisp/modules/progmodes/rpm.lsp
+lisp/modules/progmodes/sgml.lsp
+lisp/modules/progmodes/sh.lsp
+lisp/modules/progmodes/xconf.lsp
+lisp/modules/progmodes/xlog.lsp
+lisp/modules/progmodes/xrdb.lsp
+
+
+------------------------------------------------------------------------
+Files required when compiling with xprint support:
+
+(Based on Copyright notice)
+Roland Mainz <roland.mainz@nrubsig.org>
+xedit:
+print.c
+print.h
+printdialog.c
+printdialog.h
+printdialogprivates.h
+
+
+------------------------------------------------------------------------
+Files required for systems that don't have the required calls in the
+standard libraries:
+
+(Based on Copyright notice)
+Jan-Simon Pendry
+realpath.c
+
+(No author information, using CVS tag)
+David Dawes <dawes@XFree86.Org>
+strcasecmp.c
diff --git a/xedit/COPYING b/xedit/COPYING
new file mode 100644 (file)
index 0000000..4e83706
--- /dev/null
@@ -0,0 +1,176 @@
+
+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.
+
+
+
+
+
+Copyright (c) 1994
+       The Regents of the University of California.  All rights reserved.
+
+This code is derived from software contributed to Berkeley by
+Jan-Simon Pendry.
+
+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.
+
+
+
+
+
+                         COPYRIGHT 1987
+                  DIGITAL EQUIPMENT CORPORATION
+                      MAYNARD, MASSACHUSETTS
+                       ALL RIGHTS RESERVED.
+
+THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
+SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
+DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR
+ANY PURPOSE.  IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
+
+IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT RIGHTS,
+APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN ADDITION TO THAT
+SET FORTH ABOVE.
+
+
+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 Equipment Corporation not be
+used in advertising or publicity pertaining to distribution of the software
+without specific, written prior permission.
+
+
+
+
+
+Copyright 2004 Roland Mainz <roland.mainz@nrubsig.org>
+
+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 (c) 1999-2002 by The XFree86 Project, Inc.
+
+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.
+
+
+
+
+
+Copyright (c) 2007 Paulo Cesar Pereira de Andrade
+
+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 (including the next
+paragraph) 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.
diff --git a/xedit/ChangeLog b/xedit/ChangeLog
new file mode 100644 (file)
index 0000000..da4f7e8
--- /dev/null
@@ -0,0 +1,796 @@
+commit 0d133999449ce7c5db19d46680430ab16e81e4fd
+Author: Peter Breitenlohner <peb@mppmu.mpg.de>
+Date:   Thu Nov 6 21:19:56 2008 +0100
+
+    enabled VPATH build
+
+commit f5edc6424b6553d58e271f64471cef32e063dd19
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Wed Oct 8 19:21:28 2008 -0300
+
+    Rewrite double click confirmation code.
+    
+      Remove the double_click global boolean, and change dc_state to a bit
+    field, instead of a single state variable.
+      The old code was the xedit original code with minimal changes, but was
+    a bit confusing when two confirmations would be required.
+      Also, this patch moves the check for file overwriting before
+    MaybeCreateFile() as it can actually call creat(), what means that it
+    can no longer ask for confirmations, as the file has been just backed up,
+    and a zero sized one created.
+
+commit d96491aad5542f052b722b94d86f0ce7661ae98b
+Merge: cc7cb04... f1efec7...
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Fri Sep 26 17:47:32 2008 -0300
+
+    Merge branch 'master' of ssh://pcpa@git.freedesktop.org/git/xorg/app/xedit
+
+commit cc7cb041c4144f1401fd520f05018028c0e0c87e
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Fri Sep 26 17:34:50 2008 -0300
+
+    Proper implementation of AddDoubleClickCallback
+    
+      I tracked it down to
+    http://cvsweb.xfree86.org/cvsweb/xc/programs/xedit/commands.c?rev=1.5&content-type=text/vnd.viewcvs-markup
+    After my patches to libXaw. Instead of checking for
+    "if (XtIsSubclass(w, asciiSrcObjectClass)) {" it should really
+    do something like "if (isXaw7orNewer) {". But I believe only XFree86
+    and Xorg versions of Xaw have the XawVersion macro in XawInit.h...
+    
+      This corrects the problem described in
+    http://bugs.freedesktop.org/show_bug.cgi?id=17726
+    
+      And the main reason is that xedit always default'ed to use a 8 bits
+    iso8859-x locale, while in Xorg it was modified to use multibyte by
+    default.
+
+commit f1efec76814500a14acf7c64184ebef1a28e264d
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Mon Aug 4 13:22:52 2008 -0700
+
+    Fixed filename conflict during compilation on case-insensitive file systems.
+
+commit dc857b78c00432de6d57124ca2e060ef0a76684f
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Thu Jul 31 14:17:17 2008 -0300
+
+    Correct make dist and update to xedit-1.1.1.
+
+commit bc470a831ee3c8d5aa254661122187048f245c92
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Wed Jul 30 18:52:32 2008 -0300
+
+    Update to xedit 1.1.0.
+
+commit fb6c60031936bdaaeb808fb61b3073bdb058607a
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Thu Jul 10 16:38:09 2008 -0300
+
+      Update file type pattern matching.
+    
+      Consider a file ending in .l a lisp source file.
+      Allow an arbitrary number of bytes following the filename for xconf
+    and xlog modes.
+      Don't use make mode for "Imakefile". Require a slash before [Mm]akefile.*.
+
+commit ed21e75c45e92c4c52f80bdb5fba0e17f5afaca1
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Jul 8 18:53:50 2008 -0300
+
+      CancelFindFile is almost the same as XeditFocus, and could be merged in a
+    same Xt action. For the moment, automatically leave line_edit in XeditFocus.
+    
+      There is one other bug that should be fixed, that I am trying to repeat
+    (having the same file loaded twice when using tags) before a new release.
+    
+      Thre is also a problem in Xaw when deleting large amounts of selections
+    that crashes xedit, aparently due to Xaw Text widget doing some wrong math
+    and attempting to allocate a huge chunk of memory.
+
+commit c23ce2ff2439f09d00dc2c226562d44f02ca591a
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Sat May 10 21:38:23 2008 -0300
+
+    Fix an off by one error check that can lead to an infinite loop.
+    
+      This can happen when using the line edit mode to search&replace regexes.
+
+commit 2b4ebe868b660a69800dc5fe801bbcc05ccaefac
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Sat May 10 21:36:36 2008 -0300
+
+    Warn if a newer version of a file exists before overwritting it.
+
+commit 0b8304c49ab2958bc2b4ef7286467a71faa38f41
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Sat Apr 12 17:43:04 2008 -0300
+
+    Add python mode.
+    
+      This mode adds syntax highlight and automatic indentation.
+      Unlike most other modes with automatic indentation, this mode most
+    only reads one line back to figure the proper indentation.
+      Some features include:
+    o When the first character in a line is typped, it automatically
+      moves it to the proper tab stop.
+    o Increments one indentation level if line ends in ':'.
+    o Properly handle vector/hash table declarations.
+
+commit 614563884d2b19e514af233089e392127c4f4027
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Sun Mar 16 20:51:25 2008 -0300
+
+    Compile warning fixes.
+    
+      Add parenthesis around a test where after macro expansion it looked like
+    boolexpr==boolres==boolres.
+      "Ansifiy" a function without arguments.
+
+commit 60643e8f0dcd86e65400160c0a6e264e7a2a081c
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Mar 11 22:28:04 2008 -0300
+
+    Support multiple make jobs.
+    
+      Minor patch to avoid requiring xedit to have some special rule in a
+    buildsystem that defaults to something like "make -j 16".
+
+commit ee636f8565931f8d897b6c8c07eb08d41695778c
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Mar 11 21:52:58 2008 -0300
+
+    Fix an incorrect buffer size calculation and allocation.
+
+commit 5bd8082a9788a1b5343eb03400944a03e4250577
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Wed Mar 12 21:59:34 2008 -0300
+
+    Add perl and "auto tools" modes.
+    
+      Auto mode has only syntax highlight mode; needs some tweaking to
+    ignore "'" characters where they are allowed, i.e. usually descriptions.
+      Perl mode has syntax highlight and indentation support. May need
+    some tweaking for some files where it may parse back too much lines before
+    assuming the indentation is correct.
+
+commit a17bf690a8f80f252c3a831c79d6e8d11ce8d66c
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Mar 11 21:51:57 2008 -0300
+
+    Add support for scrolling textwindow with mouse wheel.
+
+commit b1dd01f67a48785678209b90c1b0e4f44621c146
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Wed Mar 12 21:53:48 2008 -0300
+
+    Add a tags interface to xedit.
+    
+      To use the tags, first create a tags file with a command like "ctags -R".
+      The interface can be disabled with resources, see the updated man page.
+      Tag files are searched descending to the root directory.
+      Multiple tags files are properly handled, and multiple symbol definitions
+    can be searched.
+
+commit 3468f9f2cb65294771e1095a14b7263ae0a6a043
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Mar 11 21:50:13 2008 -0300
+
+    Update syntax highlight table and some minor tweaks including:
+    
+    o Don't cause an warning due to an unused variable after macro expansion
+      in some indentation tables.
+    o Properly handle c++ style comments in preprocessor lines. Also highlight
+      strings and character constants.
+    o Change color of "quote" property in lisp mode. This is mainly due to
+      an undesirable side effect of using the same XrmQuark in different
+      syntax highlight definitions, causing the first one to be used, and
+      later defined ones to be ignored.
+
+commit 371c42ab955357d586cf4501762f6e9cf1be53b8
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Mar 11 21:49:14 2008 -0300
+
+    Add support to enter line number in command line.
+    
+    This works the same way as for vi, i.e. "xedit file +num" will load
+    file and move cursor to line "num".
+
+commit cb30367f10f2e38065d336d331afdc50900de76d
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Mar 11 21:48:58 2008 -0300
+
+    Generic lisp interface bug fixes including:
+    
+    o Allow calling disassemble in all function types
+    o Don't limit amount of bytes to generate a hash table
+    o Allow "unreadable" symbol names to be keywords
+
+commit 953664369cc66ba17c7b9c1939fd9d7f6c6137ad
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Mar 11 21:48:39 2008 -0300
+
+    Fix several problems in the line edit mode.
+    
+    Also allow replacing control characters in the replace pattern as well
+    as nul characters.
+
+commit a2c47d3487aaf4667926195ba3f5b05b94626daf
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Mar 11 21:46:58 2008 -0300
+
+    Fix several generic bugs including:
+    
+    o Several memory read/write errors.
+    o Implement smarter XeditPrintf that will show how many times a text
+      has been printed.
+    o Check all arguments to XeditPrintf to ensure the '%' character cannot
+      be sent to it.
+    o Some minor reindentation to code that still had the original 2 spaces
+      indentation.
+
+commit a1949714b99a502a57b3dd7a99e619c10211d9fc
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Mar 11 21:46:38 2008 -0300
+
+    Make ispell interface work correctly again.
+    
+    This new interface should work properly with asciiSrc and multiSrc widgets,
+    i.e. single byte and multibyte.
+    Also added an empty dictionary entry that is understood by aspell as the
+    "default" dictionary.
+    Code is also more robust to detect aspell exiting too early.
+
+commit f1d58be104f4020ef718a542d7f5ca72cd1f531b
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Mar 11 21:44:25 2008 -0300
+
+    Readd support for *international resource and default to false.
+    
+    This allows several features, like syntax highlight and indentation,
+    turned off to be enabled again.
+
+commit 7d5dbf4a19ec6bbd36784f5d7307629b69dda873
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Wed Mar 12 21:52:30 2008 -0300
+
+    Add a generic hash table interface to replace the other implementations.
+
+commit 2f7992eaefb19f23c127e15624ba38208c03439b
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Mar 11 21:43:04 2008 -0300
+
+    Update build for sane defaults.
+    
+    Check for existing system functions.
+    Don't add test program sources with main functions to libraries.
+    Build test programs.
+
+commit 19e3f51f9758e2708fb4abfa364b346591089bcd
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Mar 11 21:41:45 2008 -0300
+
+    Add updated/meaningful README, COPYING and AUTHORS files.
+
+commit 618a07e8131f49bbda77d2cfe5832218a561a5c8
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Jul 1 18:17:44 2008 -0300
+
+    Fix a bug in the regex library
+    
+    The bug causes the regex parser to enter an infinite loop with certain
+    special patterns with alternatives. Test cases also added to ensure
+    the bug will be triggered by the tests if it is somehow reinstantiated.
+    
+    Also testing commit to xedit git repository.
+
+commit 946b5b745d9d326799a23f7210b799e1b690643d
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Dec 6 16:37:12 2007 -0500
+
+    Replace static ChangeLog with dist-hook to generate from git log
+
+commit dd27b05c49b6e747203c83a96ca812993b2a2def
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Mon Sep 3 05:51:19 2007 -0400
+
+    Add *~ to .gitignore to skip patch/emacs droppings
+
+commit e582ba82e04632157c8a7ead56b62da7ba0eddfe
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Aug 23 19:24:44 2007 -0400
+
+    Rename .cvsignore to .gitignore
+
+commit baafaa1dee42640d15f4e74ff43b0ee3343de940
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed Apr 26 23:39:19 2006 +0000
+
+    Bump to 1.0.2
+
+commit 86e42e7030394b58d9b16eddd9ccc90efa3a11b2
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Apr 3 19:42:16 2006 +0000
+
+    Bug #6480: Cygwin build fix. (Yaakov Selkowitz)
+
+commit beae4e7a8875dfe3bdae54bd3f48b922a8f8a3c1
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 21 02:29:49 2005 +0000
+
+    Update package version for X11R7 release.
+
+commit ac432c05b782f4d97943de23b97d4b3878e8fe02
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Dec 19 16:22:43 2005 +0000
+
+    Stub COPYING files
+
+commit 814ad517c4de7dfecbc51636e00a62289af45a8f
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:24:06 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+commit e70ce0696695b7e6d627d046c19c3b6c9a8ce3da
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 7 16:17:59 2005 +0000
+
+    Change to use the app-defaults default dir configured in libXt.
+
+commit 6090b669a399c4663517b845d76945c6c2f97ef9
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 6 22:48:21 2005 +0000
+
+    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit 2abc4c46f8d89aa95262db207f7796ee4ee2e2ea
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Dec 3 05:49:19 2005 +0000
+
+    Update package version number for X11R7 RC3 release.
+
+commit 83a772ee412acc4cea221e1eb416dfb641f074ed
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Nov 28 22:01:41 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 08e9327b251c7bebf85befe0c927ed82183ac874
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Mon Nov 21 10:35:00 2005 +0000
+
+    Another pass at .cvsignores for apps.
+
+commit e63cf486fac692f01a5717da970eaee2b711acec
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Sun Nov 20 22:08:52 2005 +0000
+
+    Add/improve .cvsignore files for apps.
+
+commit 312e176e35cb16b7ea2ab4ea706132786a4aa511
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sun Nov 20 04:13:45 2005 +0000
+
+    Add dependency on xp module when building with Xprint support.
+
+commit cd2d0c1372d85eba2c097c652004f97eb0821cd1
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Nov 9 21:09:20 2005 +0000
+
+    Update package version number for X11R7 RC2 release.
+
+commit 0d4e6039465c3ecadaf76c0558ecc77931c0aa54
+Author: Alan Hourihane <alanh@fairlite.demon.co.uk>
+Date:   Fri Oct 28 15:45:02 2005 +0000
+
+    build fix
+
+commit 4f20443995b7e8b90058be829bbbbad8f5f8c935
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Sun Oct 23 20:03:47 2005 +0000
+
+    Bug #1860: Prevent walking off the end of the scan_types array.
+
+commit 83ba7062d74bb228ba9daddd1f4524dee905d4f2
+Author: Alan Hourihane <alanh@fairlite.demon.co.uk>
+Date:   Fri Oct 21 08:18:25 2005 +0000
+
+    remove redundant include
+
+commit d9db7305c78e1b93c9b15f73356b8afd5cb26709
+Author: Alan Hourihane <alanh@fairlite.demon.co.uk>
+Date:   Thu Oct 20 18:24:27 2005 +0000
+
+    programs/xedit/xedit.h
+    //bugs.freedesktop.org/show_bug.cgi?id=790)
+
+commit 54c3139890ae810b4c18eed15c82303917bcb2b9
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:47:53 2005 +0000
+
+    Update package version number for RC1 release.
+
+commit 3dbe6f823ce929fee91555933312c2ad81c6f371
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Oct 18 00:32:55 2005 +0000
+
+    Change default install dir for app-default files from
+        $(sysconfdir)/X11/app-defaults to $(libdir)/X11/app-defaults to match
+        the monolith & allow localization
+
+commit cd4bfca48225f3eb78095f4437be8667c9dde5a6
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Oct 17 23:56:22 2005 +0000
+
+    Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to
+        work better with BSD make
+
+commit 636d350681f43816c658e09704242e0cad31de56
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sun Oct 16 06:06:57 2005 +0000
+
+    Change man sources from xedit.1 to xedit.man to allow the man page to be
+        processed. Move man page to top level dir to pass check-tarball test.
+
+commit 47709c7118e6280221931189019a3fab1bfdc691
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Fri Oct 14 00:25:44 2005 +0000
+
+    Use sed to fill in variables in man page
+
+commit 1c94f8dbcfcf16a01e792942632d0a89df6d0768
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 5 03:27:56 2005 +0000
+
+    Add missing files to EXTRA_DIST
+
+commit ebd7eea10cf5add145b0428e953fce3691b8423a
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed Sep 28 03:04:23 2005 +0000
+
+    Don't override , automake predefines it.
+
+commit dad8235ff737556e2eaa645a5d7b48641eba270a
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Tue Sep 27 20:20:36 2005 +0000
+
+    Only add -DINCLUDE_XPRINT_SUPPORT if the Xaw version supports it.
+
+commit bc2182af2f8d9455f9caeb686b71cae4ff1bc0bc
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Sun Aug 28 17:58:39 2005 +0000
+
+    Install the lisp files.
+
+commit d0691d15ae7cf68c8a617322a2a4a77d36c704d1
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Jul 29 21:22:32 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 aebfa8db8c0069d4474841414012b7f19ec14d53
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Sat Jul 23 16:12:58 2005 +0000
+
+    Fix DEP_* reference
+
+commit d9d6a51c74d055e93b2fb8450ef9de162e35945f
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Sat Jul 23 16:12:33 2005 +0000
+
+    - fix DEP_* references
+    - fix GNU-make only rule for app-defaults
+
+commit 0842c698bd90b2f47d808d47b37912a7a0e3ba78
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed Jul 20 19:31:52 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 c46761f286f8c9a41ee0e510211b5ed667a78479
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Tue Jul 12 18:45:46 2005 +0000
+
+    - lib/lbxutil/lbxutil.pc.in: link to lbxutil, not Xfixes
+    - symlink.sh: add xedit.h, add xedit/lis/mp directory, add xfs
+    - xc/programs/xedit: include "lisp/../xedit.h" instead of xedit/xedit.h
+    - Change include of "foo.h" to <X11/.../foo.h> in various places in
+        xc/programs/lbxproxy and xc/programs/xfs
+    - add build system for xfs
+    - add forgotten lbxproxytrans.c file
+
+commit fc1f512d7cd7876f79190511315fe219667b2e81
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Tue Jul 12 17:41:52 2005 +0000
+
+    Build system for xprint
+
+commit 6bc36c6c67fed984af4f60224a7ea693d1b7d217
+Author: Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>
+Date:   Wed Apr 20 16:18:03 2005 +0000
+
+    Move variable declaration to top. Makes gcc2 happy.
+
+commit 33c2d047571cd4ebce2eb630515fc33aa3f05b98
+Author: Roland Mainz <roland.mainz@nrubsig.org>
+Date:   Mon Apr 11 01:06:15 2005 +0000
+
+    xc/programs/Xserver/Xprint/attributes.c
+    xc/programs/glxgears/glxgears.c
+    xc/programs/xdbedizzy/xdbedizzy.c
+    xc/programs/xedit/Imakefile
+    xc/programs/xedit/Xedit-xprint.ad
+    xc/programs/xedit/util.c
+    xc/programs/xedit/xedit.h
+    xc/programs/xlogo/print.c
+    xc/programs/xlogo/xlogo.c
+    xc/programs/xlogo/xlogo.h
+    xc/programs/xman/Imakefile
+    xc/programs/xman/print.h
+    xc/programs/xmore/Imakefile
+    xc/programs/xmore/print.c
+    xc/programs/xmore/print.h
+    xc/programs/xmore/printdialog.c
+    xc/programs/xphelloworld/xpawhelloworld/xpawhelloworld.c
+    xc/programs/xphelloworld/xphelloworld/xphelloworld.c
+    xc/programs/xphelloworld/xpsimplehelloworld/xpsimplehelloworld.c
+    xc/programs/xphelloworld/xpxmhelloworld/xpxmhelloworld.c
+    //bugs.freedesktop.org/show_bug.cgi?id=790) attachment #2379
+        (https://bugs.freedesktop.org/attachment.cgi?id=2379) Implement support
+        client+Xserver support for passing output (stdout+stderr) of the
+        spooler command started by the Xprint server back to the application
+        using the "xp-spooler-command-results" XPJobAttr attribute
+        (applications can fetch the attribute value after the XPEndJobNotify
+        event was received; more details can be found in
+        http://xprint.mozdev.org/docs/dtprint_fspec.ps).
+
+commit bd31ddba0725738848be8298a7b1dd691c103fa3
+Author: Egbert Eich <eich@suse.de>
+Date:   Mon Apr 4 10:17:07 2005 +0000
+
+    Fixed sentinels in Xt, editres and xedit to reduce number of warnings with
+        gcc4 (Andreas Schwab).
+
+commit dfb0b2dac20f575a7be260895f2847daeeacb819
+Author: Roland Mainz <roland.mainz@nrubsig.org>
+Date:   Mon Jan 3 01:06:36 2005 +0000
+
+    xc/lib/XprintAppUtil/xpapputil.c
+    xc/lib/XprintAppUtil/xpapputil.h
+    xc/lib/XprintUtil/xprintutil.c
+    xc/lib/XprintUtil/xprintutil.h
+    xc/programs/glxgears/glxgears.c
+    xc/programs/xdbedizzy/xdbedizzy.c
+    xc/programs/xedit/Xedit-xprint.ad
+    xc/programs/xedit/commands.c
+    xc/programs/xlogo/print.c
+    xc/programs/xlsfonts/xlsfonts.c
+    xc/programs/xlsfonts/xlsfonts.man
+    xc/programs/xlsfonts/xlsfonts.sgml
+    xc/programs/xman/Xman-xprint.ad
+    xc/programs/xman/handler.c
+    xc/programs/xman/print.c
+    xc/programs/xman/print.h
+    xc/programs/xmore/XMore.ad
+    xc/programs/xmore/print.c
+    xc/programs/xmore/print.h
+    xc/programs/xmore/printdialog.c
+    xc/programs/xmore/printdialog.h
+    xc/programs/xmore/printdialogprivates.h
+    xc/programs/xmore/xmore.c
+    xc/programs/xphelloworld/xpawhelloworld/xpawhelloworld.c
+    xc/programs/xphelloworld/xphelloworld/xphelloworld.c
+    xc/programs/xphelloworld/xpsimplehelloworld/xpsimplehelloworld.c
+    xc/programs/xphelloworld/xpxmhelloworld/xpxmhelloworld.c
+    xc/programs/xphelloworld/xpxthelloworld/xpxthelloworld.c
+    xc/programs/xplsprinters/xplsprinters.c
+    //bugs.freedesktop.org/show_bug.cgi?id=1706) attachment #1615
+        (https://bugs.freedesktop.org/attachment.cgi?id=1615): XprintUtils
+        2004/Q3 update. This adds various new features to the XprintUtils
+        library including support for page resolutions where
+        X_resolution!=Y_resolution, listfonts-mode control and initial
+        framework for the COLORSPACE extension. Patch by Roland Mainz
+        <roland.mainz@nrubsig.org> and Julien Lafon <julien.lafon@gmail.com>.
+
+commit 5581ed55c6918f69786d63e9a401f9d8b33a66d2
+Author: Markus Kuhn <Markus.Kuhn@cl.cam.ac.uk>
+Date:   Sat Dec 4 00:43:16 2004 +0000
+
+    Encoding of numerous files changed to UTF-8
+
+commit 4d6b4556b8517ac36d6f87837dfb936872581b12
+Author: Roland Mainz <roland.mainz@nrubsig.org>
+Date:   Tue Oct 12 22:46:40 2004 +0000
+
+    Fix for https://freedesktop.org/bugzilla/show_bug.cgi?id=1601 - Fix
+        problems with wrong page counts in xedit&co. when a global "*geometry"
+        resource was overriding the internal geometry management used by
+        XawPrintShell(=usually adjust to current page size, the resource was
+        turning this into a static value). (Original patch by Felix Schulte
+        <felix.schulte@gmail.com>)
+
+commit 98e553431586c07fe0534c01c0a6e1b15ddc8958
+Author: Egbert Eich <eich@suse.de>
+Date:   Tue Sep 21 17:57:40 2004 +0000
+
+    Merged over libXpm security fix provided by Chris Evans, Matthieu Herrb and
+        Alan Coopersmith from release 6.8.1.
+    Fail during initialization with error if font/fontset is not set for
+        widget. This prevents a sig11 later when the non-existent font/fontset
+        structs are referenced.
+    Check if xf86Info.kbdProc pointer is really set before calling it on abort
+        as this pointer won't be set if the new modular keyboard driver is used
+        (Matthias Hopf).
+    Added new libs to the bindist control files.
+    Removed inclusion of unnecessary kernel header on Linux. This may fail in
+        an -ansi environment.
+
+commit 3981cffbb6f4f4fe4227481c51083063a9ea995e
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Sep 2 08:40:32 2004 +0000
+
+    Restore xman and xedit changes that were previously reverted, and make
+        Xprint support optional (Bug #1273, Roland Mainz).
+
+commit 6b12ddbb33c8722e50e7f69f456ba0ba72b76ddd
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Mon Aug 16 16:36:16 2004 +0000
+
+    As discussed and agreed on on the release-wranglers meeting of August 16,
+        I'm committing the patch from bug #1060 to back out unconditional
+        Xprint functionality.
+    Back out Xprint changes.
+    Revert xman to CVS of June 5, revert xlogo to CVS of May 8, revert xedit to
+        CVS of April 25, to back out unconditional Xprint support.
+    Fix up Xprint config logic to be like the rest of the extensions:
+        BuildXprint is a one-stop option for disabling everything Xprint
+        related. XprtServer controls building Xprt, BuildXprintLib controls
+        building Xprint libs and BuildXprintClients controls building clients
+        related to Xprint. BuiltXprint defaults to YES and the other options
+        respects relevant settings, i.e. BuildServer and BuildServersOnly.
+    Build Xaw regardless of BuildXprintLib setting.
+    Only build xphelloworld, xplsprinters and xprehashprinterlist when
+        BuildXprintClients it YES. Disable building xmore, it has always
+        supported XawPrintShell.
+    Make Xprint support depend on BuildXprintLib.
+
+commit d980ac394b3f828ce3c03d5894218d712d7b2846
+Author: Roland Mainz <roland.mainz@nrubsig.org>
+Date:   Thu Jul 29 00:40:35 2004 +0000
+
+    Fix for https://freedesktop.org/bugzilla/show_bug.cgi?id=938 - Update
+        XawPrintShell per feedback and review comments.
+
+commit d88d25361d5c03e126f040d08c4e005494ca9bfe
+Author: Roland Mainz <roland.mainz@nrubsig.org>
+Date:   Tue Jun 8 02:44:35 2004 +0000
+
+    Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=668 - Add print
+        support to xman
+
+commit cf44083fa20c4f39a89a63ced16974c832039325
+Author: Roland Mainz <roland.mainz@nrubsig.org>
+Date:   Sun May 30 22:44:01 2004 +0000
+
+    Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=695 - Add print
+        support to Xedit
+
+commit 3b70888a54396c1b5ab67be863b189c7b8775695
+Author: Roland Mainz <roland.mainz@nrubsig.org>
+Date:   Sun May 30 00:52:30 2004 +0000
+
+    Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=693 - XMore and
+        XawPrintDialog work-in-progress, fixing various problems and adding
+        framework for i18n.
+
+commit aa3ab858ee6f5e51e0816dac708142bbcc38da5b
+Author: Roland Mainz <roland.mainz@nrubsig.org>
+Date:   Mon May 24 03:17:44 2004 +0000
+
+    Fix for http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=611 -
+        Adding simple text viewer (xmore)
+
+commit 5d7513ad1d0c061f97373b684d669ebf98d7867e
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu May 6 17:31:17 2004 +0000
+
+    BugZilla #601: Fixing makedepend choking on floating point exception
+        because CHAR_BIT is defined to __CHAR_BIT__ which is a compiler
+        intrinsic define. BugZilla #605: Fixing build on IA64 which is broken
+        due to the inclusion of the kernel header asm/page.h. Kernel headers
+        however don't work with
+    -ansi. The inclusion of asm/page.h can however savely be removed as it
+        there are plenty of other ways to determine the page size.
+
+commit 9f5d0de96f079e84c648a0173bffac8ec2c3bef5
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 19:54:46 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+commit 91547cc15f41faa1a55f2d764f67abd24777e9be
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:35:19 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit 8293776acb1b916f1f7199e975bae4d370668243
+Author: Egbert Eich <eich@suse.de>
+Date:   Wed Mar 3 12:13:05 2004 +0000
+
+    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit b7c2da33938e1091850181d827a9ef6f51575883
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:36:24 2004 +0000
+
+    readding XFree86's cvs IDs
+
+commit e502fd1629139ee9e5df1f0bdeb454710ab6adfa
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 09:24:06 2004 +0000
+
+    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit dc1aded02ad02936526d5528b6504121cf86e1b1
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Mon Feb 23 20:35:39 2004 +0000
+
+    Import most of XFree86 4.4RC3. This import excludes files which have the
+        new license. If we want to, later we can import 4.4RC3 again and pick
+        up the files that have the new license, but for now the vendor branch
+        is "pure."
+
+commit 71331fcaaca36aadf8f4857526a4ca2162b71df4
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Jan 29 08:09:08 2004 +0000
+
+    Importing vendor version xf86-012804-2330 on Thu Jan 29 00:06:33 PST 2004
+
+commit 39a948f028c2e3cb3083d7d2f847acbd27facc23
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Dec 19 20:55:55 2003 +0000
+
+    XFree86 4.3.99.902 (RC 2)
+
+commit 54593d8ebb341f7c2a0321fbf4207d7848b44a7f
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Dec 19 20:55:55 2003 +0000
+
+    Initial revision
+
+commit 0912e16e368c939d60f7b1400a247c6e5f080ff6
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Thu Dec 4 22:03:48 2003 +0000
+
+    XFree86 4.3.99.901 (RC 1)
+
+commit 10dc4a2c37597e02c12a9df3e9dba02a73bfc11b
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:29:12 2003 +0000
+
+    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit 8ae60bfe8a4b233100f5128859c76239e5789f70
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:49:22 2003 +0000
+
+    XFree86 4.3.0.1
+
+commit 0a193e032ba1ecf3f003e027e833dc9d274cb740
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:49:22 2003 +0000
+
+    Initial revision
diff --git a/xedit/INSTALL b/xedit/INSTALL
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xedit/Makefile.am b/xedit/Makefile.am
new file mode 100644 (file)
index 0000000..1a32798
--- /dev/null
@@ -0,0 +1,283 @@
+# 
+#  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 = xedit
+noinst_LIBRARIES = liblisp.a libre.a libmp.a
+noinst_PROGRAMS = lisp/lsp lisp/re/tests
+
+#
+#    libmp.a
+#
+
+libmp_a_CFLAGS =
+libmp_a_SOURCES = \
+       lisp/mp/mp.c    \
+       lisp/mp/mp.h    \
+       lisp/mp/mpi.c   \
+       lisp/mp/mpr.c
+
+#
+#    liblisp.a
+#
+
+liblisp_a_CFLAGS = -I$(top_srcdir)/lisp/re -I$(top_srcdir)/lisp/mp -DLISP -DLISPDIR=\"$(LISPDIR)\" $(PKGDEPS_CFLAGS)
+liblisp_a_SOURCES = \
+       lisp/bytecode.c \
+       lisp/bytecode.h \
+       lisp/core.c \
+       lisp/core.h \
+       lisp/debugger.c \
+       lisp/debugger.h \
+       lisp/format.c \
+       lisp/format.h \
+       lisp/hash.c \
+       lisp/hash.h \
+       lisp/helper.c \
+       lisp/helper.h \
+       lisp/internal.h \
+       lisp/io.c \
+       lisp/io.h \
+       lisp/lisp.c \
+       lisp/lisp.h \
+       lisp/math.c \
+       lisp/math.h \
+       lisp/package.c \
+       lisp/package.h \
+       lisp/pathname.c \
+       lisp/pathname.h \
+       lisp/private.h \
+       lisp/read.c \
+       lisp/read.h \
+       lisp/regex.c \
+       lisp/regex.h \
+       lisp/require.c \
+       lisp/require.h \
+       lisp/stream.c \
+       lisp/stream.h \
+       lisp/string.c \
+       lisp/string.h \
+       lisp/struct.c \
+       lisp/struct.h \
+       lisp/time.c \
+       lisp/time.h \
+       lisp/write.c \
+       lisp/write.h \
+       lisp/xedit.c \
+       lisp/xedit.h
+
+if NEED_UNSETENV
+liblisp_a_SOURCES += lisp/env.c
+endif
+
+#
+#     libre.a
+#
+
+libre_a_CFLAGS = 
+libre_a_SOURCES = \
+       lisp/re/re.c \
+       lisp/re/rec.c \
+       lisp/re/re.h \
+       lisp/re/reo.c \
+       lisp/re/rep.h
+
+#
+#     xedit
+#   
+xedit_DEPENDENCIES = liblisp.a libmp.a libre.a
+xedit_CFLAGS = $(PKGDEPS_CFLAGS) -I$(top_srcdir)/lisp/re -D_BSD_SOURCE -DXEDIT
+xedit_LDADD = -L. -lre -llisp -lmp $(PKGDEPS_LIBS) -lm
+
+xedit_SOURCES =        \
+        commands.c \
+       hash.c \
+        hook.c \
+        ispell.c \
+        lisp.c \
+        options.c \
+       tags.c \
+        util.c \
+       util.h \
+        xedit.c \
+       xedit.h
+
+if NEED_REALPATH
+xedit_SOURCES += realpath.c
+endif
+
+if NEED_STRCASECMP
+xedit_SOURCES += strcasecmp.c
+endif
+
+if USE_XPRINT
+xedit_CFLAGS += -DINCLUDE_XPRINT_SUPPORT
+
+xedit_SOURCES += \
+        print.c \
+        printdialog.c \
+        printdialog.h \
+        printdialogprivates.h \
+        print.h
+endif
+
+# lisp/lsp
+lisp_lsp_DEPENDENCIES = liblisp.a libre.a libmp.a
+lisp_lsp_CFLAGS = -I$(top_srcdir)/lisp/re -I$(top_srcdir)/lisp/mp -DLISP -DLISPDIR=\"@LISPDIR@\" -D_BSD_SOURCE
+lisp_lsp_LDADD = -L. -llisp -lre -lmp -lm
+lisp_lsp_SOURCES = \
+       hash.c \
+       lisp/lsp.c
+
+if NEED_REALPATH
+lisp_lsp_SOURCES += realpath.c
+endif
+
+if NEED_STRCASECMP
+lisp_lsp_SOURCES += strcasecmp.c
+endif
+
+# re/tests
+lisp_re_tests_DEPENDENCIES = libre.a
+lisp_re_tests_CFLAGS = -I$(top_srcdir)/lisp/re -D_BSD_SOURCE
+lisp_re_tests_LDADD = -L. -lre
+lisp_re_tests_SOURCES = lisp/re/tests.c
+
+
+# App default files  (*.ad)
+
+APPDEFAULTFILES = \
+        app-defaults/Xedit-color \
+       app-defaults/Xedit
+
+if USE_XPRINT
+app-defaults/Xedit.ad: 
+       test -d app-defaults || mkdir app-defaults
+       cp $(top_srcdir)/app-defaults/Xedit-xprint.ad app-defaults/Xedit.ad
+else
+app-defaults/Xedit.ad:
+       test -d app-defaults || mkdir app-defaults
+       cp $(top_srcdir)/app-defaults/Xedit-noxprint.ad app-defaults/Xedit.ad
+endif
+
+SUFFIXES = .ad 
+
+.ad:
+       test -d app-defaults || mkdir app-defaults
+       cp $< $@
+
+appdefaultdir = @appdefaultdir@
+appdefault_DATA = $(APPDEFAULTFILES)
+
+CLEANFILES = $(APPDEFAULTFILES) app-defaults/Xedit.ad
+
+lispdir = $(LISPDIR)
+dist_lisp_DATA = ${srcdir}/lisp/modules/lisp.lsp \
+       ${srcdir}/lisp/modules/xedit.lsp \
+       ${srcdir}/lisp/modules/syntax.lsp \
+       ${srcdir}/lisp/modules/indent.lsp
+
+progmodesdir = $(LISPDIR)/progmodes
+dist_progmodes_DATA = \
+       ${srcdir}/lisp/modules/progmodes/auto.lsp \
+       ${srcdir}/lisp/modules/progmodes/c.lsp \
+       ${srcdir}/lisp/modules/progmodes/html.lsp \
+       ${srcdir}/lisp/modules/progmodes/imake.lsp \
+       ${srcdir}/lisp/modules/progmodes/lisp.lsp \
+       ${srcdir}/lisp/modules/progmodes/make.lsp \
+       ${srcdir}/lisp/modules/progmodes/man.lsp \
+       ${srcdir}/lisp/modules/progmodes/patch.lsp \
+       ${srcdir}/lisp/modules/progmodes/perl.lsp \
+       ${srcdir}/lisp/modules/progmodes/python.lsp \
+       ${srcdir}/lisp/modules/progmodes/rpm.lsp \
+       ${srcdir}/lisp/modules/progmodes/sgml.lsp \
+       ${srcdir}/lisp/modules/progmodes/sh.lsp \
+       ${srcdir}/lisp/modules/progmodes/xconf.lsp \
+       ${srcdir}/lisp/modules/progmodes/xlog.lsp \
+       ${srcdir}/lisp/modules/progmodes/xrdb.lsp
+
+appman_PRE = xedit.man
+
+EXTRA_DIST = \
+       app-defaults/Xedit-color.ad \
+       app-defaults/Xedit-xprint.ad \
+       app-defaults/Xedit-noxprint.ad \
+       app-defaults/Xedit-sample \
+       lisp/README \
+       lisp/TODO \
+       lisp/compile.c \
+       lisp/env.c \
+       lisp/mathimp.c \
+       lisp/modules/psql.c \
+       lisp/modules/x11.c \
+       lisp/modules/xaw.c \
+       lisp/modules/xt.c \
+       lisp/re/README \
+       lisp/re/tests.txt \
+       lisp/test/hello.lsp \
+       lisp/test/list.lsp \
+       lisp/test/math.lsp \
+       lisp/test/psql-1.lsp \
+       lisp/test/psql-2.lsp \
+       lisp/test/psql-3.lsp \
+       lisp/test/regex.lsp \
+       lisp/test/stream.lsp \
+       lisp/test/widgets.lsp
+
+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) < $< > $@
+
+EXTRA_DIST += ChangeLog
+MAINTAINERCLEANFILES = ChangeLog
+
+.PHONY: ChangeLog
+
+ChangeLog:
+       (GIT_DIR=$(top_srcdir)/.git git log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
+
+dist-hook: ChangeLog
diff --git a/xedit/Makefile.in b/xedit/Makefile.in
new file mode 100644 (file)
index 0000000..4a59562
--- /dev/null
@@ -0,0 +1,1705 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = xedit$(EXEEXT)
+noinst_PROGRAMS = lisp/lsp$(EXEEXT) lisp/re/tests$(EXEEXT)
+@NEED_UNSETENV_TRUE@am__append_1 = lisp/env.c
+@NEED_REALPATH_TRUE@am__append_2 = realpath.c
+@NEED_STRCASECMP_TRUE@am__append_3 = strcasecmp.c
+@USE_XPRINT_TRUE@am__append_4 = -DINCLUDE_XPRINT_SUPPORT
+@USE_XPRINT_TRUE@am__append_5 = \
+@USE_XPRINT_TRUE@        print.c \
+@USE_XPRINT_TRUE@        printdialog.c \
+@USE_XPRINT_TRUE@        printdialog.h \
+@USE_XPRINT_TRUE@        printdialogprivates.h \
+@USE_XPRINT_TRUE@        print.h
+
+@NEED_REALPATH_TRUE@am__append_6 = realpath.c
+@NEED_STRCASECMP_TRUE@am__append_7 = strcasecmp.c
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(dist_lisp_DATA) \
+       $(dist_progmodes_DATA) $(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
+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 config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = app-defaults/Xedit
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+AR = ar
+ARFLAGS = cru
+liblisp_a_AR = $(AR) $(ARFLAGS)
+liblisp_a_LIBADD =
+am__liblisp_a_SOURCES_DIST = lisp/bytecode.c lisp/bytecode.h \
+       lisp/core.c lisp/core.h lisp/debugger.c lisp/debugger.h \
+       lisp/format.c lisp/format.h lisp/hash.c lisp/hash.h \
+       lisp/helper.c lisp/helper.h lisp/internal.h lisp/io.c \
+       lisp/io.h lisp/lisp.c lisp/lisp.h lisp/math.c lisp/math.h \
+       lisp/package.c lisp/package.h lisp/pathname.c lisp/pathname.h \
+       lisp/private.h lisp/read.c lisp/read.h lisp/regex.c \
+       lisp/regex.h lisp/require.c lisp/require.h lisp/stream.c \
+       lisp/stream.h lisp/string.c lisp/string.h lisp/struct.c \
+       lisp/struct.h lisp/time.c lisp/time.h lisp/write.c \
+       lisp/write.h lisp/xedit.c lisp/xedit.h lisp/env.c
+@NEED_UNSETENV_TRUE@am__objects_1 = liblisp_a-env.$(OBJEXT)
+am_liblisp_a_OBJECTS = liblisp_a-bytecode.$(OBJEXT) \
+       liblisp_a-core.$(OBJEXT) liblisp_a-debugger.$(OBJEXT) \
+       liblisp_a-format.$(OBJEXT) liblisp_a-hash.$(OBJEXT) \
+       liblisp_a-helper.$(OBJEXT) liblisp_a-io.$(OBJEXT) \
+       liblisp_a-lisp.$(OBJEXT) liblisp_a-math.$(OBJEXT) \
+       liblisp_a-package.$(OBJEXT) liblisp_a-pathname.$(OBJEXT) \
+       liblisp_a-read.$(OBJEXT) liblisp_a-regex.$(OBJEXT) \
+       liblisp_a-require.$(OBJEXT) liblisp_a-stream.$(OBJEXT) \
+       liblisp_a-string.$(OBJEXT) liblisp_a-struct.$(OBJEXT) \
+       liblisp_a-time.$(OBJEXT) liblisp_a-write.$(OBJEXT) \
+       liblisp_a-xedit.$(OBJEXT) $(am__objects_1)
+liblisp_a_OBJECTS = $(am_liblisp_a_OBJECTS)
+libmp_a_AR = $(AR) $(ARFLAGS)
+libmp_a_LIBADD =
+am_libmp_a_OBJECTS = libmp_a-mp.$(OBJEXT) libmp_a-mpi.$(OBJEXT) \
+       libmp_a-mpr.$(OBJEXT)
+libmp_a_OBJECTS = $(am_libmp_a_OBJECTS)
+libre_a_AR = $(AR) $(ARFLAGS)
+libre_a_LIBADD =
+am_libre_a_OBJECTS = libre_a-re.$(OBJEXT) libre_a-rec.$(OBJEXT) \
+       libre_a-reo.$(OBJEXT)
+libre_a_OBJECTS = $(am_libre_a_OBJECTS)
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appdefaultdir)" \
+       "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(lispdir)" \
+       "$(DESTDIR)$(progmodesdir)"
+PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
+am__lisp_lsp_SOURCES_DIST = hash.c lisp/lsp.c realpath.c strcasecmp.c
+@NEED_REALPATH_TRUE@am__objects_2 = lisp_lsp-realpath.$(OBJEXT)
+@NEED_STRCASECMP_TRUE@am__objects_3 = lisp_lsp-strcasecmp.$(OBJEXT)
+am_lisp_lsp_OBJECTS = lisp_lsp-hash.$(OBJEXT) lisp_lsp-lsp.$(OBJEXT) \
+       $(am__objects_2) $(am__objects_3)
+lisp_lsp_OBJECTS = $(am_lisp_lsp_OBJECTS)
+lisp_lsp_LINK = $(CCLD) $(lisp_lsp_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
+am__dirstamp = $(am__leading_dot)dirstamp
+am_lisp_re_tests_OBJECTS = lisp_re_tests-tests.$(OBJEXT)
+lisp_re_tests_OBJECTS = $(am_lisp_re_tests_OBJECTS)
+lisp_re_tests_LINK = $(CCLD) $(lisp_re_tests_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+am__xedit_SOURCES_DIST = commands.c hash.c hook.c ispell.c lisp.c \
+       options.c tags.c util.c util.h xedit.c xedit.h realpath.c \
+       strcasecmp.c print.c printdialog.c printdialog.h \
+       printdialogprivates.h print.h
+@NEED_REALPATH_TRUE@am__objects_4 = xedit-realpath.$(OBJEXT)
+@NEED_STRCASECMP_TRUE@am__objects_5 = xedit-strcasecmp.$(OBJEXT)
+@USE_XPRINT_TRUE@am__objects_6 = xedit-print.$(OBJEXT) \
+@USE_XPRINT_TRUE@      xedit-printdialog.$(OBJEXT)
+am_xedit_OBJECTS = xedit-commands.$(OBJEXT) xedit-hash.$(OBJEXT) \
+       xedit-hook.$(OBJEXT) xedit-ispell.$(OBJEXT) \
+       xedit-lisp.$(OBJEXT) xedit-options.$(OBJEXT) \
+       xedit-tags.$(OBJEXT) xedit-util.$(OBJEXT) \
+       xedit-xedit.$(OBJEXT) $(am__objects_4) $(am__objects_5) \
+       $(am__objects_6)
+xedit_OBJECTS = $(am_xedit_OBJECTS)
+am__DEPENDENCIES_1 =
+xedit_LINK = $(CCLD) $(xedit_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(liblisp_a_SOURCES) $(libmp_a_SOURCES) $(libre_a_SOURCES) \
+       $(lisp_lsp_SOURCES) $(lisp_re_tests_SOURCES) $(xedit_SOURCES)
+DIST_SOURCES = $(am__liblisp_a_SOURCES_DIST) $(libmp_a_SOURCES) \
+       $(libre_a_SOURCES) $(am__lisp_lsp_SOURCES_DIST) \
+       $(lisp_re_tests_SOURCES) $(am__xedit_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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+DATA = $(appdefault_DATA) $(appman_DATA) $(dist_lisp_DATA) \
+       $(dist_progmodes_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@
+AMTAR = @AMTAR@
+APPDEFS_CFLAGS = @APPDEFS_CFLAGS@
+APPDEFS_LIBS = @APPDEFS_LIBS@
+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 = @INSTALL@
+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@
+LISPDIR = @LISPDIR@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKGDEPS_CFLAGS = @PKGDEPS_CFLAGS@
+PKGDEPS_LIBS = @PKGDEPS_LIBS@
+PKG_CONFIG = @PKG_CONFIG@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+
+# App default files
+appdefaultdir = @appdefaultdir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+noinst_LIBRARIES = liblisp.a libre.a libmp.a
+
+#
+#    libmp.a
+#
+libmp_a_CFLAGS = 
+libmp_a_SOURCES = \
+       lisp/mp/mp.c    \
+       lisp/mp/mp.h    \
+       lisp/mp/mpi.c   \
+       lisp/mp/mpr.c
+
+
+#
+#    liblisp.a
+#
+liblisp_a_CFLAGS = -I$(top_srcdir)/lisp/re -I$(top_srcdir)/lisp/mp -DLISP -DLISPDIR=\"$(LISPDIR)\" $(PKGDEPS_CFLAGS)
+liblisp_a_SOURCES = lisp/bytecode.c lisp/bytecode.h lisp/core.c \
+       lisp/core.h lisp/debugger.c lisp/debugger.h lisp/format.c \
+       lisp/format.h lisp/hash.c lisp/hash.h lisp/helper.c \
+       lisp/helper.h lisp/internal.h lisp/io.c lisp/io.h lisp/lisp.c \
+       lisp/lisp.h lisp/math.c lisp/math.h lisp/package.c \
+       lisp/package.h lisp/pathname.c lisp/pathname.h lisp/private.h \
+       lisp/read.c lisp/read.h lisp/regex.c lisp/regex.h \
+       lisp/require.c lisp/require.h lisp/stream.c lisp/stream.h \
+       lisp/string.c lisp/string.h lisp/struct.c lisp/struct.h \
+       lisp/time.c lisp/time.h lisp/write.c lisp/write.h lisp/xedit.c \
+       lisp/xedit.h $(am__append_1)
+
+#
+#     libre.a
+#
+libre_a_CFLAGS = 
+libre_a_SOURCES = \
+       lisp/re/re.c \
+       lisp/re/rec.c \
+       lisp/re/re.h \
+       lisp/re/reo.c \
+       lisp/re/rep.h
+
+
+#
+#     xedit
+#   
+xedit_DEPENDENCIES = liblisp.a libmp.a libre.a
+xedit_CFLAGS = $(PKGDEPS_CFLAGS) -I$(top_srcdir)/lisp/re -D_BSD_SOURCE \
+       -DXEDIT $(am__append_4)
+xedit_LDADD = -L. -lre -llisp -lmp $(PKGDEPS_LIBS) -lm
+xedit_SOURCES = commands.c hash.c hook.c ispell.c lisp.c options.c \
+       tags.c util.c util.h xedit.c xedit.h $(am__append_2) \
+       $(am__append_3) $(am__append_5)
+
+# lisp/lsp
+lisp_lsp_DEPENDENCIES = liblisp.a libre.a libmp.a
+lisp_lsp_CFLAGS = -I$(top_srcdir)/lisp/re -I$(top_srcdir)/lisp/mp -DLISP -DLISPDIR=\"@LISPDIR@\" -D_BSD_SOURCE
+lisp_lsp_LDADD = -L. -llisp -lre -lmp -lm
+lisp_lsp_SOURCES = hash.c lisp/lsp.c $(am__append_6) $(am__append_7)
+
+# re/tests
+lisp_re_tests_DEPENDENCIES = libre.a
+lisp_re_tests_CFLAGS = -I$(top_srcdir)/lisp/re -D_BSD_SOURCE
+lisp_re_tests_LDADD = -L. -lre
+lisp_re_tests_SOURCES = lisp/re/tests.c
+appdefault_DATA = \
+        app-defaults/Xedit-color \
+       app-defaults/Xedit
+
+lispdir = $(LISPDIR)
+dist_lisp_DATA = ${srcdir}/lisp/modules/lisp.lsp \
+       ${srcdir}/lisp/modules/xedit.lsp \
+       ${srcdir}/lisp/modules/syntax.lsp \
+       ${srcdir}/lisp/modules/indent.lsp
+
+progmodesdir = $(LISPDIR)/progmodes
+dist_progmodes_DATA = \
+       ${srcdir}/lisp/modules/progmodes/auto.lsp \
+       ${srcdir}/lisp/modules/progmodes/c.lsp \
+       ${srcdir}/lisp/modules/progmodes/html.lsp \
+       ${srcdir}/lisp/modules/progmodes/imake.lsp \
+       ${srcdir}/lisp/modules/progmodes/lisp.lsp \
+       ${srcdir}/lisp/modules/progmodes/make.lsp \
+       ${srcdir}/lisp/modules/progmodes/man.lsp \
+       ${srcdir}/lisp/modules/progmodes/patch.lsp \
+       ${srcdir}/lisp/modules/progmodes/perl.lsp \
+       ${srcdir}/lisp/modules/progmodes/python.lsp \
+       ${srcdir}/lisp/modules/progmodes/rpm.lsp \
+       ${srcdir}/lisp/modules/progmodes/sgml.lsp \
+       ${srcdir}/lisp/modules/progmodes/sh.lsp \
+       ${srcdir}/lisp/modules/progmodes/xconf.lsp \
+       ${srcdir}/lisp/modules/progmodes/xlog.lsp \
+       ${srcdir}/lisp/modules/progmodes/xrdb.lsp
+
+appman_PRE = xedit.man
+EXTRA_DIST = app-defaults/Xedit-color app-defaults/Xedit-xprint \
+       app-defaults/Xedit-noxprint app-defaults/Xedit-sample \
+       lisp/README lisp/TODO lisp/compile.c lisp/env.c lisp/mathimp.c \
+       lisp/modules/psql.c lisp/modules/x11.c lisp/modules/xaw.c \
+       lisp/modules/xt.c lisp/re/README lisp/re/tests.txt \
+       lisp/test/hello.lsp lisp/test/list.lsp lisp/test/math.lsp \
+       lisp/test/psql-1.lsp lisp/test/psql-2.lsp lisp/test/psql-3.lsp \
+       lisp/test/regex.lsp lisp/test/stream.lsp lisp/test/widgets.lsp \
+       $(appman_PRE) ChangeLog
+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
+MAINTAINERCLEANFILES = ChangeLog
+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'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+       $(am__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)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+       @if test ! -f $@; then \
+         rm -f stamp-h1; \
+         $(MAKE) $(AM_MAKEFLAGS) 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) 
+       ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+       rm -f stamp-h1
+       touch $@
+
+distclean-hdr:
+       -rm -f config.h stamp-h1
+
+clean-noinstLIBRARIES:
+       -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+liblisp.a: $(liblisp_a_OBJECTS) $(liblisp_a_DEPENDENCIES) 
+       -rm -f liblisp.a
+       $(liblisp_a_AR) liblisp.a $(liblisp_a_OBJECTS) $(liblisp_a_LIBADD)
+       $(RANLIB) liblisp.a
+libmp.a: $(libmp_a_OBJECTS) $(libmp_a_DEPENDENCIES) 
+       -rm -f libmp.a
+       $(libmp_a_AR) libmp.a $(libmp_a_OBJECTS) $(libmp_a_LIBADD)
+       $(RANLIB) libmp.a
+libre.a: $(libre_a_OBJECTS) $(libre_a_DEPENDENCIES) 
+       -rm -f libre.a
+       $(libre_a_AR) libre.a $(libre_a_OBJECTS) $(libre_a_LIBADD)
+       $(RANLIB) libre.a
+install-binPROGRAMS: $(bin_PROGRAMS)
+       @$(NORMAL_INSTALL)
+       test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p; \
+         then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+clean-noinstPROGRAMS:
+       -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+lisp/$(am__dirstamp):
+       @$(MKDIR_P) lisp
+       @: > lisp/$(am__dirstamp)
+lisp/lsp$(EXEEXT): $(lisp_lsp_OBJECTS) $(lisp_lsp_DEPENDENCIES) lisp/$(am__dirstamp)
+       @rm -f lisp/lsp$(EXEEXT)
+       $(lisp_lsp_LINK) $(lisp_lsp_OBJECTS) $(lisp_lsp_LDADD) $(LIBS)
+lisp/re/$(am__dirstamp):
+       @$(MKDIR_P) lisp/re
+       @: > lisp/re/$(am__dirstamp)
+lisp/re/tests$(EXEEXT): $(lisp_re_tests_OBJECTS) $(lisp_re_tests_DEPENDENCIES) lisp/re/$(am__dirstamp)
+       @rm -f lisp/re/tests$(EXEEXT)
+       $(lisp_re_tests_LINK) $(lisp_re_tests_OBJECTS) $(lisp_re_tests_LDADD) $(LIBS)
+xedit$(EXEEXT): $(xedit_OBJECTS) $(xedit_DEPENDENCIES) 
+       @rm -f xedit$(EXEEXT)
+       $(xedit_LINK) $(xedit_OBJECTS) $(xedit_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-bytecode.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-core.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-debugger.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-env.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-format.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-hash.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-helper.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-io.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-lisp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-math.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-package.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-pathname.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-read.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-regex.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-require.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-stream.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-string.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-struct.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-time.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-write.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblisp_a-xedit.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmp_a-mp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmp_a-mpi.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmp_a-mpr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libre_a-re.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libre_a-rec.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libre_a-reo.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lisp_lsp-hash.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lisp_lsp-lsp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lisp_lsp-realpath.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lisp_lsp-strcasecmp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lisp_re_tests-tests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-commands.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-hash.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-hook.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-ispell.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-lisp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-options.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-print.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-printdialog.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-realpath.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-strcasecmp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-tags.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-util.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xedit-xedit.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+liblisp_a-bytecode.o: lisp/bytecode.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-bytecode.o -MD -MP -MF $(DEPDIR)/liblisp_a-bytecode.Tpo -c -o liblisp_a-bytecode.o `test -f 'lisp/bytecode.c' || echo '$(srcdir)/'`lisp/bytecode.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-bytecode.Tpo $(DEPDIR)/liblisp_a-bytecode.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/bytecode.c' object='liblisp_a-bytecode.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-bytecode.o `test -f 'lisp/bytecode.c' || echo '$(srcdir)/'`lisp/bytecode.c
+
+liblisp_a-bytecode.obj: lisp/bytecode.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-bytecode.obj -MD -MP -MF $(DEPDIR)/liblisp_a-bytecode.Tpo -c -o liblisp_a-bytecode.obj `if test -f 'lisp/bytecode.c'; then $(CYGPATH_W) 'lisp/bytecode.c'; else $(CYGPATH_W) '$(srcdir)/lisp/bytecode.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-bytecode.Tpo $(DEPDIR)/liblisp_a-bytecode.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/bytecode.c' object='liblisp_a-bytecode.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-bytecode.obj `if test -f 'lisp/bytecode.c'; then $(CYGPATH_W) 'lisp/bytecode.c'; else $(CYGPATH_W) '$(srcdir)/lisp/bytecode.c'; fi`
+
+liblisp_a-core.o: lisp/core.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-core.o -MD -MP -MF $(DEPDIR)/liblisp_a-core.Tpo -c -o liblisp_a-core.o `test -f 'lisp/core.c' || echo '$(srcdir)/'`lisp/core.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-core.Tpo $(DEPDIR)/liblisp_a-core.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/core.c' object='liblisp_a-core.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-core.o `test -f 'lisp/core.c' || echo '$(srcdir)/'`lisp/core.c
+
+liblisp_a-core.obj: lisp/core.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-core.obj -MD -MP -MF $(DEPDIR)/liblisp_a-core.Tpo -c -o liblisp_a-core.obj `if test -f 'lisp/core.c'; then $(CYGPATH_W) 'lisp/core.c'; else $(CYGPATH_W) '$(srcdir)/lisp/core.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-core.Tpo $(DEPDIR)/liblisp_a-core.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/core.c' object='liblisp_a-core.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-core.obj `if test -f 'lisp/core.c'; then $(CYGPATH_W) 'lisp/core.c'; else $(CYGPATH_W) '$(srcdir)/lisp/core.c'; fi`
+
+liblisp_a-debugger.o: lisp/debugger.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-debugger.o -MD -MP -MF $(DEPDIR)/liblisp_a-debugger.Tpo -c -o liblisp_a-debugger.o `test -f 'lisp/debugger.c' || echo '$(srcdir)/'`lisp/debugger.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-debugger.Tpo $(DEPDIR)/liblisp_a-debugger.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/debugger.c' object='liblisp_a-debugger.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-debugger.o `test -f 'lisp/debugger.c' || echo '$(srcdir)/'`lisp/debugger.c
+
+liblisp_a-debugger.obj: lisp/debugger.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-debugger.obj -MD -MP -MF $(DEPDIR)/liblisp_a-debugger.Tpo -c -o liblisp_a-debugger.obj `if test -f 'lisp/debugger.c'; then $(CYGPATH_W) 'lisp/debugger.c'; else $(CYGPATH_W) '$(srcdir)/lisp/debugger.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-debugger.Tpo $(DEPDIR)/liblisp_a-debugger.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/debugger.c' object='liblisp_a-debugger.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-debugger.obj `if test -f 'lisp/debugger.c'; then $(CYGPATH_W) 'lisp/debugger.c'; else $(CYGPATH_W) '$(srcdir)/lisp/debugger.c'; fi`
+
+liblisp_a-format.o: lisp/format.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-format.o -MD -MP -MF $(DEPDIR)/liblisp_a-format.Tpo -c -o liblisp_a-format.o `test -f 'lisp/format.c' || echo '$(srcdir)/'`lisp/format.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-format.Tpo $(DEPDIR)/liblisp_a-format.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/format.c' object='liblisp_a-format.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-format.o `test -f 'lisp/format.c' || echo '$(srcdir)/'`lisp/format.c
+
+liblisp_a-format.obj: lisp/format.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-format.obj -MD -MP -MF $(DEPDIR)/liblisp_a-format.Tpo -c -o liblisp_a-format.obj `if test -f 'lisp/format.c'; then $(CYGPATH_W) 'lisp/format.c'; else $(CYGPATH_W) '$(srcdir)/lisp/format.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-format.Tpo $(DEPDIR)/liblisp_a-format.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/format.c' object='liblisp_a-format.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-format.obj `if test -f 'lisp/format.c'; then $(CYGPATH_W) 'lisp/format.c'; else $(CYGPATH_W) '$(srcdir)/lisp/format.c'; fi`
+
+liblisp_a-hash.o: lisp/hash.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-hash.o -MD -MP -MF $(DEPDIR)/liblisp_a-hash.Tpo -c -o liblisp_a-hash.o `test -f 'lisp/hash.c' || echo '$(srcdir)/'`lisp/hash.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-hash.Tpo $(DEPDIR)/liblisp_a-hash.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/hash.c' object='liblisp_a-hash.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-hash.o `test -f 'lisp/hash.c' || echo '$(srcdir)/'`lisp/hash.c
+
+liblisp_a-hash.obj: lisp/hash.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-hash.obj -MD -MP -MF $(DEPDIR)/liblisp_a-hash.Tpo -c -o liblisp_a-hash.obj `if test -f 'lisp/hash.c'; then $(CYGPATH_W) 'lisp/hash.c'; else $(CYGPATH_W) '$(srcdir)/lisp/hash.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-hash.Tpo $(DEPDIR)/liblisp_a-hash.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/hash.c' object='liblisp_a-hash.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-hash.obj `if test -f 'lisp/hash.c'; then $(CYGPATH_W) 'lisp/hash.c'; else $(CYGPATH_W) '$(srcdir)/lisp/hash.c'; fi`
+
+liblisp_a-helper.o: lisp/helper.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-helper.o -MD -MP -MF $(DEPDIR)/liblisp_a-helper.Tpo -c -o liblisp_a-helper.o `test -f 'lisp/helper.c' || echo '$(srcdir)/'`lisp/helper.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-helper.Tpo $(DEPDIR)/liblisp_a-helper.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/helper.c' object='liblisp_a-helper.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-helper.o `test -f 'lisp/helper.c' || echo '$(srcdir)/'`lisp/helper.c
+
+liblisp_a-helper.obj: lisp/helper.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-helper.obj -MD -MP -MF $(DEPDIR)/liblisp_a-helper.Tpo -c -o liblisp_a-helper.obj `if test -f 'lisp/helper.c'; then $(CYGPATH_W) 'lisp/helper.c'; else $(CYGPATH_W) '$(srcdir)/lisp/helper.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-helper.Tpo $(DEPDIR)/liblisp_a-helper.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/helper.c' object='liblisp_a-helper.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-helper.obj `if test -f 'lisp/helper.c'; then $(CYGPATH_W) 'lisp/helper.c'; else $(CYGPATH_W) '$(srcdir)/lisp/helper.c'; fi`
+
+liblisp_a-io.o: lisp/io.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-io.o -MD -MP -MF $(DEPDIR)/liblisp_a-io.Tpo -c -o liblisp_a-io.o `test -f 'lisp/io.c' || echo '$(srcdir)/'`lisp/io.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-io.Tpo $(DEPDIR)/liblisp_a-io.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/io.c' object='liblisp_a-io.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-io.o `test -f 'lisp/io.c' || echo '$(srcdir)/'`lisp/io.c
+
+liblisp_a-io.obj: lisp/io.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-io.obj -MD -MP -MF $(DEPDIR)/liblisp_a-io.Tpo -c -o liblisp_a-io.obj `if test -f 'lisp/io.c'; then $(CYGPATH_W) 'lisp/io.c'; else $(CYGPATH_W) '$(srcdir)/lisp/io.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-io.Tpo $(DEPDIR)/liblisp_a-io.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/io.c' object='liblisp_a-io.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-io.obj `if test -f 'lisp/io.c'; then $(CYGPATH_W) 'lisp/io.c'; else $(CYGPATH_W) '$(srcdir)/lisp/io.c'; fi`
+
+liblisp_a-lisp.o: lisp/lisp.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-lisp.o -MD -MP -MF $(DEPDIR)/liblisp_a-lisp.Tpo -c -o liblisp_a-lisp.o `test -f 'lisp/lisp.c' || echo '$(srcdir)/'`lisp/lisp.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-lisp.Tpo $(DEPDIR)/liblisp_a-lisp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/lisp.c' object='liblisp_a-lisp.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-lisp.o `test -f 'lisp/lisp.c' || echo '$(srcdir)/'`lisp/lisp.c
+
+liblisp_a-lisp.obj: lisp/lisp.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-lisp.obj -MD -MP -MF $(DEPDIR)/liblisp_a-lisp.Tpo -c -o liblisp_a-lisp.obj `if test -f 'lisp/lisp.c'; then $(CYGPATH_W) 'lisp/lisp.c'; else $(CYGPATH_W) '$(srcdir)/lisp/lisp.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-lisp.Tpo $(DEPDIR)/liblisp_a-lisp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/lisp.c' object='liblisp_a-lisp.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-lisp.obj `if test -f 'lisp/lisp.c'; then $(CYGPATH_W) 'lisp/lisp.c'; else $(CYGPATH_W) '$(srcdir)/lisp/lisp.c'; fi`
+
+liblisp_a-math.o: lisp/math.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-math.o -MD -MP -MF $(DEPDIR)/liblisp_a-math.Tpo -c -o liblisp_a-math.o `test -f 'lisp/math.c' || echo '$(srcdir)/'`lisp/math.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-math.Tpo $(DEPDIR)/liblisp_a-math.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/math.c' object='liblisp_a-math.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-math.o `test -f 'lisp/math.c' || echo '$(srcdir)/'`lisp/math.c
+
+liblisp_a-math.obj: lisp/math.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-math.obj -MD -MP -MF $(DEPDIR)/liblisp_a-math.Tpo -c -o liblisp_a-math.obj `if test -f 'lisp/math.c'; then $(CYGPATH_W) 'lisp/math.c'; else $(CYGPATH_W) '$(srcdir)/lisp/math.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-math.Tpo $(DEPDIR)/liblisp_a-math.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/math.c' object='liblisp_a-math.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-math.obj `if test -f 'lisp/math.c'; then $(CYGPATH_W) 'lisp/math.c'; else $(CYGPATH_W) '$(srcdir)/lisp/math.c'; fi`
+
+liblisp_a-package.o: lisp/package.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-package.o -MD -MP -MF $(DEPDIR)/liblisp_a-package.Tpo -c -o liblisp_a-package.o `test -f 'lisp/package.c' || echo '$(srcdir)/'`lisp/package.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-package.Tpo $(DEPDIR)/liblisp_a-package.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/package.c' object='liblisp_a-package.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-package.o `test -f 'lisp/package.c' || echo '$(srcdir)/'`lisp/package.c
+
+liblisp_a-package.obj: lisp/package.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-package.obj -MD -MP -MF $(DEPDIR)/liblisp_a-package.Tpo -c -o liblisp_a-package.obj `if test -f 'lisp/package.c'; then $(CYGPATH_W) 'lisp/package.c'; else $(CYGPATH_W) '$(srcdir)/lisp/package.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-package.Tpo $(DEPDIR)/liblisp_a-package.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/package.c' object='liblisp_a-package.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-package.obj `if test -f 'lisp/package.c'; then $(CYGPATH_W) 'lisp/package.c'; else $(CYGPATH_W) '$(srcdir)/lisp/package.c'; fi`
+
+liblisp_a-pathname.o: lisp/pathname.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-pathname.o -MD -MP -MF $(DEPDIR)/liblisp_a-pathname.Tpo -c -o liblisp_a-pathname.o `test -f 'lisp/pathname.c' || echo '$(srcdir)/'`lisp/pathname.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-pathname.Tpo $(DEPDIR)/liblisp_a-pathname.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/pathname.c' object='liblisp_a-pathname.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-pathname.o `test -f 'lisp/pathname.c' || echo '$(srcdir)/'`lisp/pathname.c
+
+liblisp_a-pathname.obj: lisp/pathname.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-pathname.obj -MD -MP -MF $(DEPDIR)/liblisp_a-pathname.Tpo -c -o liblisp_a-pathname.obj `if test -f 'lisp/pathname.c'; then $(CYGPATH_W) 'lisp/pathname.c'; else $(CYGPATH_W) '$(srcdir)/lisp/pathname.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-pathname.Tpo $(DEPDIR)/liblisp_a-pathname.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/pathname.c' object='liblisp_a-pathname.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-pathname.obj `if test -f 'lisp/pathname.c'; then $(CYGPATH_W) 'lisp/pathname.c'; else $(CYGPATH_W) '$(srcdir)/lisp/pathname.c'; fi`
+
+liblisp_a-read.o: lisp/read.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-read.o -MD -MP -MF $(DEPDIR)/liblisp_a-read.Tpo -c -o liblisp_a-read.o `test -f 'lisp/read.c' || echo '$(srcdir)/'`lisp/read.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-read.Tpo $(DEPDIR)/liblisp_a-read.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/read.c' object='liblisp_a-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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-read.o `test -f 'lisp/read.c' || echo '$(srcdir)/'`lisp/read.c
+
+liblisp_a-read.obj: lisp/read.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-read.obj -MD -MP -MF $(DEPDIR)/liblisp_a-read.Tpo -c -o liblisp_a-read.obj `if test -f 'lisp/read.c'; then $(CYGPATH_W) 'lisp/read.c'; else $(CYGPATH_W) '$(srcdir)/lisp/read.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-read.Tpo $(DEPDIR)/liblisp_a-read.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/read.c' object='liblisp_a-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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-read.obj `if test -f 'lisp/read.c'; then $(CYGPATH_W) 'lisp/read.c'; else $(CYGPATH_W) '$(srcdir)/lisp/read.c'; fi`
+
+liblisp_a-regex.o: lisp/regex.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-regex.o -MD -MP -MF $(DEPDIR)/liblisp_a-regex.Tpo -c -o liblisp_a-regex.o `test -f 'lisp/regex.c' || echo '$(srcdir)/'`lisp/regex.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-regex.Tpo $(DEPDIR)/liblisp_a-regex.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/regex.c' object='liblisp_a-regex.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-regex.o `test -f 'lisp/regex.c' || echo '$(srcdir)/'`lisp/regex.c
+
+liblisp_a-regex.obj: lisp/regex.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-regex.obj -MD -MP -MF $(DEPDIR)/liblisp_a-regex.Tpo -c -o liblisp_a-regex.obj `if test -f 'lisp/regex.c'; then $(CYGPATH_W) 'lisp/regex.c'; else $(CYGPATH_W) '$(srcdir)/lisp/regex.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-regex.Tpo $(DEPDIR)/liblisp_a-regex.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/regex.c' object='liblisp_a-regex.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-regex.obj `if test -f 'lisp/regex.c'; then $(CYGPATH_W) 'lisp/regex.c'; else $(CYGPATH_W) '$(srcdir)/lisp/regex.c'; fi`
+
+liblisp_a-require.o: lisp/require.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-require.o -MD -MP -MF $(DEPDIR)/liblisp_a-require.Tpo -c -o liblisp_a-require.o `test -f 'lisp/require.c' || echo '$(srcdir)/'`lisp/require.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-require.Tpo $(DEPDIR)/liblisp_a-require.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/require.c' object='liblisp_a-require.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-require.o `test -f 'lisp/require.c' || echo '$(srcdir)/'`lisp/require.c
+
+liblisp_a-require.obj: lisp/require.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-require.obj -MD -MP -MF $(DEPDIR)/liblisp_a-require.Tpo -c -o liblisp_a-require.obj `if test -f 'lisp/require.c'; then $(CYGPATH_W) 'lisp/require.c'; else $(CYGPATH_W) '$(srcdir)/lisp/require.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-require.Tpo $(DEPDIR)/liblisp_a-require.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/require.c' object='liblisp_a-require.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-require.obj `if test -f 'lisp/require.c'; then $(CYGPATH_W) 'lisp/require.c'; else $(CYGPATH_W) '$(srcdir)/lisp/require.c'; fi`
+
+liblisp_a-stream.o: lisp/stream.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-stream.o -MD -MP -MF $(DEPDIR)/liblisp_a-stream.Tpo -c -o liblisp_a-stream.o `test -f 'lisp/stream.c' || echo '$(srcdir)/'`lisp/stream.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-stream.Tpo $(DEPDIR)/liblisp_a-stream.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/stream.c' object='liblisp_a-stream.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-stream.o `test -f 'lisp/stream.c' || echo '$(srcdir)/'`lisp/stream.c
+
+liblisp_a-stream.obj: lisp/stream.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-stream.obj -MD -MP -MF $(DEPDIR)/liblisp_a-stream.Tpo -c -o liblisp_a-stream.obj `if test -f 'lisp/stream.c'; then $(CYGPATH_W) 'lisp/stream.c'; else $(CYGPATH_W) '$(srcdir)/lisp/stream.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-stream.Tpo $(DEPDIR)/liblisp_a-stream.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/stream.c' object='liblisp_a-stream.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-stream.obj `if test -f 'lisp/stream.c'; then $(CYGPATH_W) 'lisp/stream.c'; else $(CYGPATH_W) '$(srcdir)/lisp/stream.c'; fi`
+
+liblisp_a-string.o: lisp/string.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-string.o -MD -MP -MF $(DEPDIR)/liblisp_a-string.Tpo -c -o liblisp_a-string.o `test -f 'lisp/string.c' || echo '$(srcdir)/'`lisp/string.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-string.Tpo $(DEPDIR)/liblisp_a-string.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/string.c' object='liblisp_a-string.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-string.o `test -f 'lisp/string.c' || echo '$(srcdir)/'`lisp/string.c
+
+liblisp_a-string.obj: lisp/string.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-string.obj -MD -MP -MF $(DEPDIR)/liblisp_a-string.Tpo -c -o liblisp_a-string.obj `if test -f 'lisp/string.c'; then $(CYGPATH_W) 'lisp/string.c'; else $(CYGPATH_W) '$(srcdir)/lisp/string.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-string.Tpo $(DEPDIR)/liblisp_a-string.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/string.c' object='liblisp_a-string.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-string.obj `if test -f 'lisp/string.c'; then $(CYGPATH_W) 'lisp/string.c'; else $(CYGPATH_W) '$(srcdir)/lisp/string.c'; fi`
+
+liblisp_a-struct.o: lisp/struct.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-struct.o -MD -MP -MF $(DEPDIR)/liblisp_a-struct.Tpo -c -o liblisp_a-struct.o `test -f 'lisp/struct.c' || echo '$(srcdir)/'`lisp/struct.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-struct.Tpo $(DEPDIR)/liblisp_a-struct.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/struct.c' object='liblisp_a-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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-struct.o `test -f 'lisp/struct.c' || echo '$(srcdir)/'`lisp/struct.c
+
+liblisp_a-struct.obj: lisp/struct.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-struct.obj -MD -MP -MF $(DEPDIR)/liblisp_a-struct.Tpo -c -o liblisp_a-struct.obj `if test -f 'lisp/struct.c'; then $(CYGPATH_W) 'lisp/struct.c'; else $(CYGPATH_W) '$(srcdir)/lisp/struct.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-struct.Tpo $(DEPDIR)/liblisp_a-struct.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/struct.c' object='liblisp_a-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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-struct.obj `if test -f 'lisp/struct.c'; then $(CYGPATH_W) 'lisp/struct.c'; else $(CYGPATH_W) '$(srcdir)/lisp/struct.c'; fi`
+
+liblisp_a-time.o: lisp/time.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-time.o -MD -MP -MF $(DEPDIR)/liblisp_a-time.Tpo -c -o liblisp_a-time.o `test -f 'lisp/time.c' || echo '$(srcdir)/'`lisp/time.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-time.Tpo $(DEPDIR)/liblisp_a-time.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/time.c' object='liblisp_a-time.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-time.o `test -f 'lisp/time.c' || echo '$(srcdir)/'`lisp/time.c
+
+liblisp_a-time.obj: lisp/time.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-time.obj -MD -MP -MF $(DEPDIR)/liblisp_a-time.Tpo -c -o liblisp_a-time.obj `if test -f 'lisp/time.c'; then $(CYGPATH_W) 'lisp/time.c'; else $(CYGPATH_W) '$(srcdir)/lisp/time.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-time.Tpo $(DEPDIR)/liblisp_a-time.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/time.c' object='liblisp_a-time.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-time.obj `if test -f 'lisp/time.c'; then $(CYGPATH_W) 'lisp/time.c'; else $(CYGPATH_W) '$(srcdir)/lisp/time.c'; fi`
+
+liblisp_a-write.o: lisp/write.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-write.o -MD -MP -MF $(DEPDIR)/liblisp_a-write.Tpo -c -o liblisp_a-write.o `test -f 'lisp/write.c' || echo '$(srcdir)/'`lisp/write.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-write.Tpo $(DEPDIR)/liblisp_a-write.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/write.c' object='liblisp_a-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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-write.o `test -f 'lisp/write.c' || echo '$(srcdir)/'`lisp/write.c
+
+liblisp_a-write.obj: lisp/write.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-write.obj -MD -MP -MF $(DEPDIR)/liblisp_a-write.Tpo -c -o liblisp_a-write.obj `if test -f 'lisp/write.c'; then $(CYGPATH_W) 'lisp/write.c'; else $(CYGPATH_W) '$(srcdir)/lisp/write.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-write.Tpo $(DEPDIR)/liblisp_a-write.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/write.c' object='liblisp_a-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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-write.obj `if test -f 'lisp/write.c'; then $(CYGPATH_W) 'lisp/write.c'; else $(CYGPATH_W) '$(srcdir)/lisp/write.c'; fi`
+
+liblisp_a-xedit.o: lisp/xedit.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-xedit.o -MD -MP -MF $(DEPDIR)/liblisp_a-xedit.Tpo -c -o liblisp_a-xedit.o `test -f 'lisp/xedit.c' || echo '$(srcdir)/'`lisp/xedit.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-xedit.Tpo $(DEPDIR)/liblisp_a-xedit.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/xedit.c' object='liblisp_a-xedit.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-xedit.o `test -f 'lisp/xedit.c' || echo '$(srcdir)/'`lisp/xedit.c
+
+liblisp_a-xedit.obj: lisp/xedit.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-xedit.obj -MD -MP -MF $(DEPDIR)/liblisp_a-xedit.Tpo -c -o liblisp_a-xedit.obj `if test -f 'lisp/xedit.c'; then $(CYGPATH_W) 'lisp/xedit.c'; else $(CYGPATH_W) '$(srcdir)/lisp/xedit.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-xedit.Tpo $(DEPDIR)/liblisp_a-xedit.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/xedit.c' object='liblisp_a-xedit.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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-xedit.obj `if test -f 'lisp/xedit.c'; then $(CYGPATH_W) 'lisp/xedit.c'; else $(CYGPATH_W) '$(srcdir)/lisp/xedit.c'; fi`
+
+liblisp_a-env.o: lisp/env.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-env.o -MD -MP -MF $(DEPDIR)/liblisp_a-env.Tpo -c -o liblisp_a-env.o `test -f 'lisp/env.c' || echo '$(srcdir)/'`lisp/env.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-env.Tpo $(DEPDIR)/liblisp_a-env.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/env.c' object='liblisp_a-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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-env.o `test -f 'lisp/env.c' || echo '$(srcdir)/'`lisp/env.c
+
+liblisp_a-env.obj: lisp/env.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblisp_a_CFLAGS) $(CFLAGS) -MT liblisp_a-env.obj -MD -MP -MF $(DEPDIR)/liblisp_a-env.Tpo -c -o liblisp_a-env.obj `if test -f 'lisp/env.c'; then $(CYGPATH_W) 'lisp/env.c'; else $(CYGPATH_W) '$(srcdir)/lisp/env.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/liblisp_a-env.Tpo $(DEPDIR)/liblisp_a-env.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/env.c' object='liblisp_a-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) $(liblisp_a_CFLAGS) $(CFLAGS) -c -o liblisp_a-env.obj `if test -f 'lisp/env.c'; then $(CYGPATH_W) 'lisp/env.c'; else $(CYGPATH_W) '$(srcdir)/lisp/env.c'; fi`
+
+libmp_a-mp.o: lisp/mp/mp.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp_a_CFLAGS) $(CFLAGS) -MT libmp_a-mp.o -MD -MP -MF $(DEPDIR)/libmp_a-mp.Tpo -c -o libmp_a-mp.o `test -f 'lisp/mp/mp.c' || echo '$(srcdir)/'`lisp/mp/mp.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libmp_a-mp.Tpo $(DEPDIR)/libmp_a-mp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/mp/mp.c' object='libmp_a-mp.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) $(libmp_a_CFLAGS) $(CFLAGS) -c -o libmp_a-mp.o `test -f 'lisp/mp/mp.c' || echo '$(srcdir)/'`lisp/mp/mp.c
+
+libmp_a-mp.obj: lisp/mp/mp.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp_a_CFLAGS) $(CFLAGS) -MT libmp_a-mp.obj -MD -MP -MF $(DEPDIR)/libmp_a-mp.Tpo -c -o libmp_a-mp.obj `if test -f 'lisp/mp/mp.c'; then $(CYGPATH_W) 'lisp/mp/mp.c'; else $(CYGPATH_W) '$(srcdir)/lisp/mp/mp.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libmp_a-mp.Tpo $(DEPDIR)/libmp_a-mp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/mp/mp.c' object='libmp_a-mp.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) $(libmp_a_CFLAGS) $(CFLAGS) -c -o libmp_a-mp.obj `if test -f 'lisp/mp/mp.c'; then $(CYGPATH_W) 'lisp/mp/mp.c'; else $(CYGPATH_W) '$(srcdir)/lisp/mp/mp.c'; fi`
+
+libmp_a-mpi.o: lisp/mp/mpi.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp_a_CFLAGS) $(CFLAGS) -MT libmp_a-mpi.o -MD -MP -MF $(DEPDIR)/libmp_a-mpi.Tpo -c -o libmp_a-mpi.o `test -f 'lisp/mp/mpi.c' || echo '$(srcdir)/'`lisp/mp/mpi.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libmp_a-mpi.Tpo $(DEPDIR)/libmp_a-mpi.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/mp/mpi.c' object='libmp_a-mpi.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) $(libmp_a_CFLAGS) $(CFLAGS) -c -o libmp_a-mpi.o `test -f 'lisp/mp/mpi.c' || echo '$(srcdir)/'`lisp/mp/mpi.c
+
+libmp_a-mpi.obj: lisp/mp/mpi.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp_a_CFLAGS) $(CFLAGS) -MT libmp_a-mpi.obj -MD -MP -MF $(DEPDIR)/libmp_a-mpi.Tpo -c -o libmp_a-mpi.obj `if test -f 'lisp/mp/mpi.c'; then $(CYGPATH_W) 'lisp/mp/mpi.c'; else $(CYGPATH_W) '$(srcdir)/lisp/mp/mpi.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libmp_a-mpi.Tpo $(DEPDIR)/libmp_a-mpi.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/mp/mpi.c' object='libmp_a-mpi.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) $(libmp_a_CFLAGS) $(CFLAGS) -c -o libmp_a-mpi.obj `if test -f 'lisp/mp/mpi.c'; then $(CYGPATH_W) 'lisp/mp/mpi.c'; else $(CYGPATH_W) '$(srcdir)/lisp/mp/mpi.c'; fi`
+
+libmp_a-mpr.o: lisp/mp/mpr.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp_a_CFLAGS) $(CFLAGS) -MT libmp_a-mpr.o -MD -MP -MF $(DEPDIR)/libmp_a-mpr.Tpo -c -o libmp_a-mpr.o `test -f 'lisp/mp/mpr.c' || echo '$(srcdir)/'`lisp/mp/mpr.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libmp_a-mpr.Tpo $(DEPDIR)/libmp_a-mpr.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/mp/mpr.c' object='libmp_a-mpr.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) $(libmp_a_CFLAGS) $(CFLAGS) -c -o libmp_a-mpr.o `test -f 'lisp/mp/mpr.c' || echo '$(srcdir)/'`lisp/mp/mpr.c
+
+libmp_a-mpr.obj: lisp/mp/mpr.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmp_a_CFLAGS) $(CFLAGS) -MT libmp_a-mpr.obj -MD -MP -MF $(DEPDIR)/libmp_a-mpr.Tpo -c -o libmp_a-mpr.obj `if test -f 'lisp/mp/mpr.c'; then $(CYGPATH_W) 'lisp/mp/mpr.c'; else $(CYGPATH_W) '$(srcdir)/lisp/mp/mpr.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libmp_a-mpr.Tpo $(DEPDIR)/libmp_a-mpr.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/mp/mpr.c' object='libmp_a-mpr.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) $(libmp_a_CFLAGS) $(CFLAGS) -c -o libmp_a-mpr.obj `if test -f 'lisp/mp/mpr.c'; then $(CYGPATH_W) 'lisp/mp/mpr.c'; else $(CYGPATH_W) '$(srcdir)/lisp/mp/mpr.c'; fi`
+
+libre_a-re.o: lisp/re/re.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libre_a_CFLAGS) $(CFLAGS) -MT libre_a-re.o -MD -MP -MF $(DEPDIR)/libre_a-re.Tpo -c -o libre_a-re.o `test -f 'lisp/re/re.c' || echo '$(srcdir)/'`lisp/re/re.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libre_a-re.Tpo $(DEPDIR)/libre_a-re.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/re/re.c' object='libre_a-re.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) $(libre_a_CFLAGS) $(CFLAGS) -c -o libre_a-re.o `test -f 'lisp/re/re.c' || echo '$(srcdir)/'`lisp/re/re.c
+
+libre_a-re.obj: lisp/re/re.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libre_a_CFLAGS) $(CFLAGS) -MT libre_a-re.obj -MD -MP -MF $(DEPDIR)/libre_a-re.Tpo -c -o libre_a-re.obj `if test -f 'lisp/re/re.c'; then $(CYGPATH_W) 'lisp/re/re.c'; else $(CYGPATH_W) '$(srcdir)/lisp/re/re.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libre_a-re.Tpo $(DEPDIR)/libre_a-re.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/re/re.c' object='libre_a-re.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) $(libre_a_CFLAGS) $(CFLAGS) -c -o libre_a-re.obj `if test -f 'lisp/re/re.c'; then $(CYGPATH_W) 'lisp/re/re.c'; else $(CYGPATH_W) '$(srcdir)/lisp/re/re.c'; fi`
+
+libre_a-rec.o: lisp/re/rec.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libre_a_CFLAGS) $(CFLAGS) -MT libre_a-rec.o -MD -MP -MF $(DEPDIR)/libre_a-rec.Tpo -c -o libre_a-rec.o `test -f 'lisp/re/rec.c' || echo '$(srcdir)/'`lisp/re/rec.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libre_a-rec.Tpo $(DEPDIR)/libre_a-rec.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/re/rec.c' object='libre_a-rec.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) $(libre_a_CFLAGS) $(CFLAGS) -c -o libre_a-rec.o `test -f 'lisp/re/rec.c' || echo '$(srcdir)/'`lisp/re/rec.c
+
+libre_a-rec.obj: lisp/re/rec.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libre_a_CFLAGS) $(CFLAGS) -MT libre_a-rec.obj -MD -MP -MF $(DEPDIR)/libre_a-rec.Tpo -c -o libre_a-rec.obj `if test -f 'lisp/re/rec.c'; then $(CYGPATH_W) 'lisp/re/rec.c'; else $(CYGPATH_W) '$(srcdir)/lisp/re/rec.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libre_a-rec.Tpo $(DEPDIR)/libre_a-rec.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/re/rec.c' object='libre_a-rec.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) $(libre_a_CFLAGS) $(CFLAGS) -c -o libre_a-rec.obj `if test -f 'lisp/re/rec.c'; then $(CYGPATH_W) 'lisp/re/rec.c'; else $(CYGPATH_W) '$(srcdir)/lisp/re/rec.c'; fi`
+
+libre_a-reo.o: lisp/re/reo.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libre_a_CFLAGS) $(CFLAGS) -MT libre_a-reo.o -MD -MP -MF $(DEPDIR)/libre_a-reo.Tpo -c -o libre_a-reo.o `test -f 'lisp/re/reo.c' || echo '$(srcdir)/'`lisp/re/reo.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libre_a-reo.Tpo $(DEPDIR)/libre_a-reo.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/re/reo.c' object='libre_a-reo.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) $(libre_a_CFLAGS) $(CFLAGS) -c -o libre_a-reo.o `test -f 'lisp/re/reo.c' || echo '$(srcdir)/'`lisp/re/reo.c
+
+libre_a-reo.obj: lisp/re/reo.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libre_a_CFLAGS) $(CFLAGS) -MT libre_a-reo.obj -MD -MP -MF $(DEPDIR)/libre_a-reo.Tpo -c -o libre_a-reo.obj `if test -f 'lisp/re/reo.c'; then $(CYGPATH_W) 'lisp/re/reo.c'; else $(CYGPATH_W) '$(srcdir)/lisp/re/reo.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libre_a-reo.Tpo $(DEPDIR)/libre_a-reo.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/re/reo.c' object='libre_a-reo.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) $(libre_a_CFLAGS) $(CFLAGS) -c -o libre_a-reo.obj `if test -f 'lisp/re/reo.c'; then $(CYGPATH_W) 'lisp/re/reo.c'; else $(CYGPATH_W) '$(srcdir)/lisp/re/reo.c'; fi`
+
+lisp_lsp-hash.o: hash.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -MT lisp_lsp-hash.o -MD -MP -MF $(DEPDIR)/lisp_lsp-hash.Tpo -c -o lisp_lsp-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/lisp_lsp-hash.Tpo $(DEPDIR)/lisp_lsp-hash.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='hash.c' object='lisp_lsp-hash.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) $(lisp_lsp_CFLAGS) $(CFLAGS) -c -o lisp_lsp-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c
+
+lisp_lsp-hash.obj: hash.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -MT lisp_lsp-hash.obj -MD -MP -MF $(DEPDIR)/lisp_lsp-hash.Tpo -c -o lisp_lsp-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/lisp_lsp-hash.Tpo $(DEPDIR)/lisp_lsp-hash.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='hash.c' object='lisp_lsp-hash.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) $(lisp_lsp_CFLAGS) $(CFLAGS) -c -o lisp_lsp-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi`
+
+lisp_lsp-lsp.o: lisp/lsp.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -MT lisp_lsp-lsp.o -MD -MP -MF $(DEPDIR)/lisp_lsp-lsp.Tpo -c -o lisp_lsp-lsp.o `test -f 'lisp/lsp.c' || echo '$(srcdir)/'`lisp/lsp.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/lisp_lsp-lsp.Tpo $(DEPDIR)/lisp_lsp-lsp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/lsp.c' object='lisp_lsp-lsp.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) $(lisp_lsp_CFLAGS) $(CFLAGS) -c -o lisp_lsp-lsp.o `test -f 'lisp/lsp.c' || echo '$(srcdir)/'`lisp/lsp.c
+
+lisp_lsp-lsp.obj: lisp/lsp.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -MT lisp_lsp-lsp.obj -MD -MP -MF $(DEPDIR)/lisp_lsp-lsp.Tpo -c -o lisp_lsp-lsp.obj `if test -f 'lisp/lsp.c'; then $(CYGPATH_W) 'lisp/lsp.c'; else $(CYGPATH_W) '$(srcdir)/lisp/lsp.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/lisp_lsp-lsp.Tpo $(DEPDIR)/lisp_lsp-lsp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/lsp.c' object='lisp_lsp-lsp.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) $(lisp_lsp_CFLAGS) $(CFLAGS) -c -o lisp_lsp-lsp.obj `if test -f 'lisp/lsp.c'; then $(CYGPATH_W) 'lisp/lsp.c'; else $(CYGPATH_W) '$(srcdir)/lisp/lsp.c'; fi`
+
+lisp_lsp-realpath.o: realpath.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -MT lisp_lsp-realpath.o -MD -MP -MF $(DEPDIR)/lisp_lsp-realpath.Tpo -c -o lisp_lsp-realpath.o `test -f 'realpath.c' || echo '$(srcdir)/'`realpath.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/lisp_lsp-realpath.Tpo $(DEPDIR)/lisp_lsp-realpath.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='realpath.c' object='lisp_lsp-realpath.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) $(lisp_lsp_CFLAGS) $(CFLAGS) -c -o lisp_lsp-realpath.o `test -f 'realpath.c' || echo '$(srcdir)/'`realpath.c
+
+lisp_lsp-realpath.obj: realpath.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -MT lisp_lsp-realpath.obj -MD -MP -MF $(DEPDIR)/lisp_lsp-realpath.Tpo -c -o lisp_lsp-realpath.obj `if test -f 'realpath.c'; then $(CYGPATH_W) 'realpath.c'; else $(CYGPATH_W) '$(srcdir)/realpath.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/lisp_lsp-realpath.Tpo $(DEPDIR)/lisp_lsp-realpath.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='realpath.c' object='lisp_lsp-realpath.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) $(lisp_lsp_CFLAGS) $(CFLAGS) -c -o lisp_lsp-realpath.obj `if test -f 'realpath.c'; then $(CYGPATH_W) 'realpath.c'; else $(CYGPATH_W) '$(srcdir)/realpath.c'; fi`
+
+lisp_lsp-strcasecmp.o: strcasecmp.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -MT lisp_lsp-strcasecmp.o -MD -MP -MF $(DEPDIR)/lisp_lsp-strcasecmp.Tpo -c -o lisp_lsp-strcasecmp.o `test -f 'strcasecmp.c' || echo '$(srcdir)/'`strcasecmp.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/lisp_lsp-strcasecmp.Tpo $(DEPDIR)/lisp_lsp-strcasecmp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='strcasecmp.c' object='lisp_lsp-strcasecmp.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) $(lisp_lsp_CFLAGS) $(CFLAGS) -c -o lisp_lsp-strcasecmp.o `test -f 'strcasecmp.c' || echo '$(srcdir)/'`strcasecmp.c
+
+lisp_lsp-strcasecmp.obj: strcasecmp.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_lsp_CFLAGS) $(CFLAGS) -MT lisp_lsp-strcasecmp.obj -MD -MP -MF $(DEPDIR)/lisp_lsp-strcasecmp.Tpo -c -o lisp_lsp-strcasecmp.obj `if test -f 'strcasecmp.c'; then $(CYGPATH_W) 'strcasecmp.c'; else $(CYGPATH_W) '$(srcdir)/strcasecmp.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/lisp_lsp-strcasecmp.Tpo $(DEPDIR)/lisp_lsp-strcasecmp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='strcasecmp.c' object='lisp_lsp-strcasecmp.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) $(lisp_lsp_CFLAGS) $(CFLAGS) -c -o lisp_lsp-strcasecmp.obj `if test -f 'strcasecmp.c'; then $(CYGPATH_W) 'strcasecmp.c'; else $(CYGPATH_W) '$(srcdir)/strcasecmp.c'; fi`
+
+lisp_re_tests-tests.o: lisp/re/tests.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_re_tests_CFLAGS) $(CFLAGS) -MT lisp_re_tests-tests.o -MD -MP -MF $(DEPDIR)/lisp_re_tests-tests.Tpo -c -o lisp_re_tests-tests.o `test -f 'lisp/re/tests.c' || echo '$(srcdir)/'`lisp/re/tests.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/lisp_re_tests-tests.Tpo $(DEPDIR)/lisp_re_tests-tests.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/re/tests.c' object='lisp_re_tests-tests.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) $(lisp_re_tests_CFLAGS) $(CFLAGS) -c -o lisp_re_tests-tests.o `test -f 'lisp/re/tests.c' || echo '$(srcdir)/'`lisp/re/tests.c
+
+lisp_re_tests-tests.obj: lisp/re/tests.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lisp_re_tests_CFLAGS) $(CFLAGS) -MT lisp_re_tests-tests.obj -MD -MP -MF $(DEPDIR)/lisp_re_tests-tests.Tpo -c -o lisp_re_tests-tests.obj `if test -f 'lisp/re/tests.c'; then $(CYGPATH_W) 'lisp/re/tests.c'; else $(CYGPATH_W) '$(srcdir)/lisp/re/tests.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/lisp_re_tests-tests.Tpo $(DEPDIR)/lisp_re_tests-tests.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp/re/tests.c' object='lisp_re_tests-tests.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) $(lisp_re_tests_CFLAGS) $(CFLAGS) -c -o lisp_re_tests-tests.obj `if test -f 'lisp/re/tests.c'; then $(CYGPATH_W) 'lisp/re/tests.c'; else $(CYGPATH_W) '$(srcdir)/lisp/re/tests.c'; fi`
+
+xedit-commands.o: commands.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-commands.o -MD -MP -MF $(DEPDIR)/xedit-commands.Tpo -c -o xedit-commands.o `test -f 'commands.c' || echo '$(srcdir)/'`commands.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-commands.Tpo $(DEPDIR)/xedit-commands.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='commands.c' object='xedit-commands.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-commands.o `test -f 'commands.c' || echo '$(srcdir)/'`commands.c
+
+xedit-commands.obj: commands.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-commands.obj -MD -MP -MF $(DEPDIR)/xedit-commands.Tpo -c -o xedit-commands.obj `if test -f 'commands.c'; then $(CYGPATH_W) 'commands.c'; else $(CYGPATH_W) '$(srcdir)/commands.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-commands.Tpo $(DEPDIR)/xedit-commands.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='commands.c' object='xedit-commands.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-commands.obj `if test -f 'commands.c'; then $(CYGPATH_W) 'commands.c'; else $(CYGPATH_W) '$(srcdir)/commands.c'; fi`
+
+xedit-hash.o: hash.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-hash.o -MD -MP -MF $(DEPDIR)/xedit-hash.Tpo -c -o xedit-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-hash.Tpo $(DEPDIR)/xedit-hash.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='hash.c' object='xedit-hash.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c
+
+xedit-hash.obj: hash.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-hash.obj -MD -MP -MF $(DEPDIR)/xedit-hash.Tpo -c -o xedit-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-hash.Tpo $(DEPDIR)/xedit-hash.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='hash.c' object='xedit-hash.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi`
+
+xedit-hook.o: hook.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-hook.o -MD -MP -MF $(DEPDIR)/xedit-hook.Tpo -c -o xedit-hook.o `test -f 'hook.c' || echo '$(srcdir)/'`hook.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-hook.Tpo $(DEPDIR)/xedit-hook.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='hook.c' object='xedit-hook.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-hook.o `test -f 'hook.c' || echo '$(srcdir)/'`hook.c
+
+xedit-hook.obj: hook.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-hook.obj -MD -MP -MF $(DEPDIR)/xedit-hook.Tpo -c -o xedit-hook.obj `if test -f 'hook.c'; then $(CYGPATH_W) 'hook.c'; else $(CYGPATH_W) '$(srcdir)/hook.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-hook.Tpo $(DEPDIR)/xedit-hook.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='hook.c' object='xedit-hook.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-hook.obj `if test -f 'hook.c'; then $(CYGPATH_W) 'hook.c'; else $(CYGPATH_W) '$(srcdir)/hook.c'; fi`
+
+xedit-ispell.o: ispell.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-ispell.o -MD -MP -MF $(DEPDIR)/xedit-ispell.Tpo -c -o xedit-ispell.o `test -f 'ispell.c' || echo '$(srcdir)/'`ispell.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-ispell.Tpo $(DEPDIR)/xedit-ispell.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ispell.c' object='xedit-ispell.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-ispell.o `test -f 'ispell.c' || echo '$(srcdir)/'`ispell.c
+
+xedit-ispell.obj: ispell.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-ispell.obj -MD -MP -MF $(DEPDIR)/xedit-ispell.Tpo -c -o xedit-ispell.obj `if test -f 'ispell.c'; then $(CYGPATH_W) 'ispell.c'; else $(CYGPATH_W) '$(srcdir)/ispell.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-ispell.Tpo $(DEPDIR)/xedit-ispell.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='ispell.c' object='xedit-ispell.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-ispell.obj `if test -f 'ispell.c'; then $(CYGPATH_W) 'ispell.c'; else $(CYGPATH_W) '$(srcdir)/ispell.c'; fi`
+
+xedit-lisp.o: lisp.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-lisp.o -MD -MP -MF $(DEPDIR)/xedit-lisp.Tpo -c -o xedit-lisp.o `test -f 'lisp.c' || echo '$(srcdir)/'`lisp.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-lisp.Tpo $(DEPDIR)/xedit-lisp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp.c' object='xedit-lisp.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-lisp.o `test -f 'lisp.c' || echo '$(srcdir)/'`lisp.c
+
+xedit-lisp.obj: lisp.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-lisp.obj -MD -MP -MF $(DEPDIR)/xedit-lisp.Tpo -c -o xedit-lisp.obj `if test -f 'lisp.c'; then $(CYGPATH_W) 'lisp.c'; else $(CYGPATH_W) '$(srcdir)/lisp.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-lisp.Tpo $(DEPDIR)/xedit-lisp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='lisp.c' object='xedit-lisp.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-lisp.obj `if test -f 'lisp.c'; then $(CYGPATH_W) 'lisp.c'; else $(CYGPATH_W) '$(srcdir)/lisp.c'; fi`
+
+xedit-options.o: options.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-options.o -MD -MP -MF $(DEPDIR)/xedit-options.Tpo -c -o xedit-options.o `test -f 'options.c' || echo '$(srcdir)/'`options.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-options.Tpo $(DEPDIR)/xedit-options.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='options.c' object='xedit-options.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-options.o `test -f 'options.c' || echo '$(srcdir)/'`options.c
+
+xedit-options.obj: options.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-options.obj -MD -MP -MF $(DEPDIR)/xedit-options.Tpo -c -o xedit-options.obj `if test -f 'options.c'; then $(CYGPATH_W) 'options.c'; else $(CYGPATH_W) '$(srcdir)/options.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-options.Tpo $(DEPDIR)/xedit-options.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='options.c' object='xedit-options.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-options.obj `if test -f 'options.c'; then $(CYGPATH_W) 'options.c'; else $(CYGPATH_W) '$(srcdir)/options.c'; fi`
+
+xedit-tags.o: tags.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-tags.o -MD -MP -MF $(DEPDIR)/xedit-tags.Tpo -c -o xedit-tags.o `test -f 'tags.c' || echo '$(srcdir)/'`tags.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-tags.Tpo $(DEPDIR)/xedit-tags.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='tags.c' object='xedit-tags.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-tags.o `test -f 'tags.c' || echo '$(srcdir)/'`tags.c
+
+xedit-tags.obj: tags.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-tags.obj -MD -MP -MF $(DEPDIR)/xedit-tags.Tpo -c -o xedit-tags.obj `if test -f 'tags.c'; then $(CYGPATH_W) 'tags.c'; else $(CYGPATH_W) '$(srcdir)/tags.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-tags.Tpo $(DEPDIR)/xedit-tags.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='tags.c' object='xedit-tags.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-tags.obj `if test -f 'tags.c'; then $(CYGPATH_W) 'tags.c'; else $(CYGPATH_W) '$(srcdir)/tags.c'; fi`
+
+xedit-util.o: util.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-util.o -MD -MP -MF $(DEPDIR)/xedit-util.Tpo -c -o xedit-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-util.Tpo $(DEPDIR)/xedit-util.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='util.c' object='xedit-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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
+
+xedit-util.obj: util.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-util.obj -MD -MP -MF $(DEPDIR)/xedit-util.Tpo -c -o xedit-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-util.Tpo $(DEPDIR)/xedit-util.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='util.c' object='xedit-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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`
+
+xedit-xedit.o: xedit.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-xedit.o -MD -MP -MF $(DEPDIR)/xedit-xedit.Tpo -c -o xedit-xedit.o `test -f 'xedit.c' || echo '$(srcdir)/'`xedit.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-xedit.Tpo $(DEPDIR)/xedit-xedit.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='xedit.c' object='xedit-xedit.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-xedit.o `test -f 'xedit.c' || echo '$(srcdir)/'`xedit.c
+
+xedit-xedit.obj: xedit.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-xedit.obj -MD -MP -MF $(DEPDIR)/xedit-xedit.Tpo -c -o xedit-xedit.obj `if test -f 'xedit.c'; then $(CYGPATH_W) 'xedit.c'; else $(CYGPATH_W) '$(srcdir)/xedit.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-xedit.Tpo $(DEPDIR)/xedit-xedit.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='xedit.c' object='xedit-xedit.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-xedit.obj `if test -f 'xedit.c'; then $(CYGPATH_W) 'xedit.c'; else $(CYGPATH_W) '$(srcdir)/xedit.c'; fi`
+
+xedit-realpath.o: realpath.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-realpath.o -MD -MP -MF $(DEPDIR)/xedit-realpath.Tpo -c -o xedit-realpath.o `test -f 'realpath.c' || echo '$(srcdir)/'`realpath.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-realpath.Tpo $(DEPDIR)/xedit-realpath.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='realpath.c' object='xedit-realpath.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-realpath.o `test -f 'realpath.c' || echo '$(srcdir)/'`realpath.c
+
+xedit-realpath.obj: realpath.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-realpath.obj -MD -MP -MF $(DEPDIR)/xedit-realpath.Tpo -c -o xedit-realpath.obj `if test -f 'realpath.c'; then $(CYGPATH_W) 'realpath.c'; else $(CYGPATH_W) '$(srcdir)/realpath.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-realpath.Tpo $(DEPDIR)/xedit-realpath.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='realpath.c' object='xedit-realpath.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-realpath.obj `if test -f 'realpath.c'; then $(CYGPATH_W) 'realpath.c'; else $(CYGPATH_W) '$(srcdir)/realpath.c'; fi`
+
+xedit-strcasecmp.o: strcasecmp.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-strcasecmp.o -MD -MP -MF $(DEPDIR)/xedit-strcasecmp.Tpo -c -o xedit-strcasecmp.o `test -f 'strcasecmp.c' || echo '$(srcdir)/'`strcasecmp.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-strcasecmp.Tpo $(DEPDIR)/xedit-strcasecmp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='strcasecmp.c' object='xedit-strcasecmp.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-strcasecmp.o `test -f 'strcasecmp.c' || echo '$(srcdir)/'`strcasecmp.c
+
+xedit-strcasecmp.obj: strcasecmp.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-strcasecmp.obj -MD -MP -MF $(DEPDIR)/xedit-strcasecmp.Tpo -c -o xedit-strcasecmp.obj `if test -f 'strcasecmp.c'; then $(CYGPATH_W) 'strcasecmp.c'; else $(CYGPATH_W) '$(srcdir)/strcasecmp.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-strcasecmp.Tpo $(DEPDIR)/xedit-strcasecmp.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='strcasecmp.c' object='xedit-strcasecmp.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-strcasecmp.obj `if test -f 'strcasecmp.c'; then $(CYGPATH_W) 'strcasecmp.c'; else $(CYGPATH_W) '$(srcdir)/strcasecmp.c'; fi`
+
+xedit-print.o: print.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-print.o -MD -MP -MF $(DEPDIR)/xedit-print.Tpo -c -o xedit-print.o `test -f 'print.c' || echo '$(srcdir)/'`print.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-print.Tpo $(DEPDIR)/xedit-print.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='print.c' object='xedit-print.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-print.o `test -f 'print.c' || echo '$(srcdir)/'`print.c
+
+xedit-print.obj: print.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-print.obj -MD -MP -MF $(DEPDIR)/xedit-print.Tpo -c -o xedit-print.obj `if test -f 'print.c'; then $(CYGPATH_W) 'print.c'; else $(CYGPATH_W) '$(srcdir)/print.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-print.Tpo $(DEPDIR)/xedit-print.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='print.c' object='xedit-print.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-print.obj `if test -f 'print.c'; then $(CYGPATH_W) 'print.c'; else $(CYGPATH_W) '$(srcdir)/print.c'; fi`
+
+xedit-printdialog.o: printdialog.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-printdialog.o -MD -MP -MF $(DEPDIR)/xedit-printdialog.Tpo -c -o xedit-printdialog.o `test -f 'printdialog.c' || echo '$(srcdir)/'`printdialog.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-printdialog.Tpo $(DEPDIR)/xedit-printdialog.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='printdialog.c' object='xedit-printdialog.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-printdialog.o `test -f 'printdialog.c' || echo '$(srcdir)/'`printdialog.c
+
+xedit-printdialog.obj: printdialog.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xedit_CFLAGS) $(CFLAGS) -MT xedit-printdialog.obj -MD -MP -MF $(DEPDIR)/xedit-printdialog.Tpo -c -o xedit-printdialog.obj `if test -f 'printdialog.c'; then $(CYGPATH_W) 'printdialog.c'; else $(CYGPATH_W) '$(srcdir)/printdialog.c'; fi`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/xedit-printdialog.Tpo $(DEPDIR)/xedit-printdialog.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='printdialog.c' object='xedit-printdialog.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) $(xedit_CFLAGS) $(CFLAGS) -c -o xedit-printdialog.obj `if test -f 'printdialog.c'; then $(CYGPATH_W) 'printdialog.c'; else $(CYGPATH_W) '$(srcdir)/printdialog.c'; fi`
+install-appdefaultDATA: $(appdefault_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appdefaultdir)" || $(MKDIR_P) "$(DESTDIR)$(appdefaultdir)"
+       @list='$(appdefault_DATA)'; test -n "$(appdefaultdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appdefaultdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appdefaultdir)" || exit $$?; \
+       done
+
+uninstall-appdefaultDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appdefault_DATA)'; test -n "$(appdefaultdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appdefaultdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appdefaultdir)" && rm -f $$files
+install-appmanDATA: $(appman_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)"
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \
+       done
+
+uninstall-appmanDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appmandir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appmandir)" && rm -f $$files
+install-dist_lispDATA: $(dist_lisp_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(lispdir)" || $(MKDIR_P) "$(DESTDIR)$(lispdir)"
+       @list='$(dist_lisp_DATA)'; test -n "$(lispdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(lispdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(lispdir)" || exit $$?; \
+       done
+
+uninstall-dist_lispDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_lisp_DATA)'; test -n "$(lispdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(lispdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(lispdir)" && rm -f $$files
+install-dist_progmodesDATA: $(dist_progmodes_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(progmodesdir)" || $(MKDIR_P) "$(DESTDIR)$(progmodesdir)"
+       @list='$(dist_progmodes_DATA)'; test -n "$(progmodesdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(progmodesdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(progmodesdir)" || exit $$?; \
+       done
+
+uninstall-dist_progmodesDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_progmodes_DATA)'; test -n "$(progmodesdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(progmodesdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(progmodesdir)" && rm -f $$files
+
+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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       set x; \
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       $(am__remove_distdir)
+       test -d "$(distdir)" || mkdir "$(distdir)"
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$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
+       -test -n "$(am__skip_mode_fix)" \
+       || find "$(distdir)" -type d ! -perm -755 \
+               -exec chmod u+rwx,go+rx {} \; -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 $(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-lzma: distdir
+       tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+       $(am__remove_distdir)
+
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+       $(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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+       *.tar.bz2*) \
+         bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.lzma*) \
+         lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+       *.tar.Z*) \
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+       *.shar.gz*) \
+         GZIP=$(GZIP_ENV) gzip -dc $(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)
+       test -d $(distdir)/_build || exit 0; \
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && am__cwd=`pwd` \
+         && $(am__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 \
+         && cd "$$am__cwd" \
+         || exit 1
+       $(am__remove_distdir)
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+       @$(am__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 $(LIBRARIES) $(PROGRAMS) $(DATA) config.h
+installdirs:
+       for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appdefaultdir)" "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(lispdir)" "$(DESTDIR)$(progmodesdir)"; 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)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+       -rm -f lisp/$(am__dirstamp)
+       -rm -f lisp/re/$(am__dirstamp)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \
+       clean-noinstPROGRAMS 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
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-appdefaultDATA install-appmanDATA \
+       install-dist_lispDATA install-dist_progmodesDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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-appdefaultDATA uninstall-appmanDATA \
+       uninstall-binPROGRAMS uninstall-dist_lispDATA \
+       uninstall-dist_progmodesDATA
+
+.MAKE: all install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+       clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \
+       clean-noinstPROGRAMS ctags dist dist-all dist-bzip2 dist-gzip \
+       dist-hook dist-lzma dist-shar dist-tarZ dist-xz 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-appdefaultDATA install-appmanDATA \
+       install-binPROGRAMS install-data install-data-am \
+       install-dist_lispDATA install-dist_progmodesDATA install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+       tags uninstall uninstall-am uninstall-appdefaultDATA \
+       uninstall-appmanDATA uninstall-binPROGRAMS \
+       uninstall-dist_lispDATA uninstall-dist_progmodesDATA
+
+
+.man.$(APP_MAN_SUFFIX):
+       sed $(MAN_SUBSTS) < $< > $@
+
+.PHONY: ChangeLog
+
+ChangeLog:
+       (GIT_DIR=$(top_srcdir)/.git git log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
+
+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/xedit/NEWS b/xedit/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xedit/README b/xedit/README
new file mode 100644 (file)
index 0000000..4188af3
--- /dev/null
@@ -0,0 +1,604 @@
+      Xedit is a simple text editor for X.
+
+      Please check xedit(1) for  information about resources  and configurable
+  options.
+
+      The authors  file should  list the  original authors  of all  files, but
+  unfortunately most  collaborators and  people that  changed portions  of the
+  code is not listed.
+
+
+      List of default keyboard commands.
+  Uppercase letters means both, uppercase and lowercase.
+  Lowercase letter usually means Shift key is not pressed.
+  C-    Means Control key.
+  M-    Means Meta key.
+        Usually Alt key has the same effect.
+  S-    Means Shift key.
+
+  C-A   Move cursor to beginning of line.
+  C-B or Left
+        Move cursor backwards one character.
+  C-C   Insert CUT_BUFFER0 selection at cursor position.
+  C-D   Delete next character.
+  C-E   Move cursor to end of line.
+  C-F or Right
+        Move cursor forwards one character.
+  C-G   Keyboard reset.
+        Use it to switch direction in the Undo stack, i.e. switch between
+        Undo and Redo.
+        It can also be used to stop the lisp interpreter if it is executing
+        code.
+  C-H   Deletes character before cursor.
+  C-J   Adds a newline and indent.
+        If the current buffer is the *scratch* buffer, it will work
+        like C-X,C-E, but print the lisp output directly to the scratch
+        buffer. Examples:
+        (list 1 2 3) C-J will print (1 2 3) and move the cursor to
+        the next line.
+  C-K   Deletes text from cursor position to end of line.
+  C-L   Redraw text window.
+  C-M   Adds a newline.
+  C-N or Down
+        Move cursor to next line.
+  C-O   Adds one newline at cursor position without moving cursor.
+  C-P or Up
+        Move cursor to previous line.
+  C-R   Opens search dialog, searching backwards.
+  C-S   Opens search dialog, searching forwards.
+  C-T   Transpose characters.
+  C-U   Starts multiply mode.
+        Multiply mode means that most keyboard commands will be repeated
+        by its parameter. After pressing C-U type a number, that can be
+        negative. Examples:
+        C-U 10 C-F  will move the cursor 10 characters forwards
+        C-U -10 C-F will move the cursor 10 characters backwards
+        If no number is specified, or if the number zero is specified,
+        the default value is 4.
+  C-V or PageDown
+        Move cursor to next page.
+  C-W   Kills current selection.
+        C-W is also useful when there is no active selection, to return to
+        the previous position the left mouse was clicked in the text window.
+  C-Y   Inserts SECONDARY selection.
+        This usually means text delete with commands other than by just
+        pressing Backspace or Delete (that can be multiplied)
+  C-Z   Scroll one line up.
+  M-B or C-Left
+        Move cursor backwards one word.
+        C-Left only moves over alphabetic or numeric characters
+  M-C   Capitalize word under cursor position, or next word.
+  M-F or C-Right
+        Move cursor forwards one word.
+        C-Right only moves over alphabetic or numeric characters.
+  M-I   Opens  a dialog prompting for a file name to be inserted at the
+        cursor position.
+        (This isn't very user friendly, this is a cavemen interface, you will
+        love it, you will never use it).
+  M-K   Kills text from cursor position to end of paragraph.
+  M-L   Downcase word at cursor position or next word.
+  M-Q   Format paragraph.
+        Xedit interfaces Xaw code that allows several types of text
+        formatting. To use it, you need to Select "Auto Fill" in the
+        "Edit Menu" and select values for "Break Columns". After that,
+        Select "Edit Menu"->"Justification" for the available options.
+        Text typed will usually be automatically corrected, but if you
+        need to change text in the middle of a previous line, use M-Q
+        to reformat, and C-_ to undo if required.
+        Examples of text:
+
+                    This text with align
+                    left and break
+                    columns at 20 and
+                    40.
+
+                         This text with align
+                              right and break
+                            columns at 25 and
+                            45. Remember that
+                            Auto Fill must be
+                         selected. And it may
+                         be required to press
+                          M-Q when going back
+                             to edit previous
+                                       lines.
+
+                                         This text with align center
+                                         and break columns at 40 and
+                                        70. A good tip is to make sure
+                                         there are empty lines before
+                                        and after the aligned text, so
+                                        that M-Q will not format more
+                                             text than it should.
+
+                 This text  with full  align,
+               note that  it will  spread the
+               words  to   fully   fill   the
+               configured break  columns,  in
+               this case 15 and 45. Also note
+               that  it  doesn't  remove  any
+               extra  indentation   from  the
+               first  line.   This   may   be
+               considered a  bug or  feature,
+               but  it   doesn't  respect   2
+               spaces after  an '.'  dot. And
+               it doesn't align the last line
+               of text.
+
+  This text with Auto Fill disabled. When Auto  Fill is disabled, tabs are
+usually preserved, like this,          and                     this. But it
+will basically format the text to not be larger than the text widget screen
+width and. But it the screen is scrolled horizontally, it will not work as
+expected, the advantage over the above interface is that is considers font
+characters width, while the other interface assumes fixed width characters.
+
+        Notice that "auto formatting" with Auto Fill mode is done when
+        pressing enter, but information isn't saved per paragraph, so
+        if values of align or break columns are changed, trying to edit
+        a text block with different configuration will not give the expected
+        results.
+        Also notice that lines starting with non printable characters aren't
+        automatically formatted. This is helpful for some editing modes
+        where symbols can be used before lines in a paragraph. If you don't
+        need this feature, usually pressing Space or Tab is enough to put the
+        cursor at the proper position.
+  M-U   Upcase word at cursor position or next word.
+  M-V or PageUp
+        Move cursor to previous page.
+  M-Y   Kill ring yank feature. Basically it will circulate over all
+        text that has been cut in the current session. Keep pressing it
+        until happy :-)
+  M-Z   Scrolls one line down.
+  M-D   Kill word at cursor position or next word.
+  S-M-D Delete word at cursor position or next word.
+        Does not go to the kill ring.
+  M-H or M-Delete or M-Backspace.
+        Kill word at cursor position or previous word.
+  S-M-H or S-M-Delete or S-M-Backspace
+        Delete word at cursor position or previous word.
+        Does not go to the kill ring.
+  M-.   Find definition/declaration of symbol string of selected text, and/or
+        finds next tag when more than one definition exists for the symbol.
+  M-< or Home
+        Move cursor to beginning of file.
+  M-> or End
+        Move cursor to end of file.
+  M-] or C-Down
+        Move cursor to next paragraph.
+  M-[ or C-Up
+        Move cursor to previous paragraph.
+  C-_ or C-X,U
+        Undo.
+        If enabled in the given textwidget. Not enabled by default in the
+        message window and filename window, or any of the other text widgets
+        in the several available dialogs.
+  C-\ or C-Kanji
+        Reconnect Input Method.
+        In international mode (probably broken interface).
+  S-Insert
+        Insert PRIMARY selection from CUT_BUFFER0.
+  C-Q
+        Followed by any character, will insert the next typed character
+        useful to insert control characters. For example C-Q,C-L will
+        insert ^L at the cursor position.
+  LeftMouseButton
+        When pressed marks the start of a PRIMARY selection at CUTBUFFER0
+        When moved while pressed extends the selection.
+  MiddleMouseButton
+        When pressed, inserts the PRIMARY selection at CUTBUFFER0 at
+        the cursor position.
+  RightMouseButton
+        Can be used to adjust a selection done with LeftMouseButton.
+  C-A,Tab
+        If the loaded file has a indentation rules file, C or Lisp, xedit
+        will reindent the line. Also, entering a fresh character on a
+        newline should be enough to move the cursor to the proper position.
+        To override it, you may need to use the C-U to multiply the action,
+        as it will only indent if only one character was added.
+  C-X,C-C or (Pressing the Quit button)
+        Exits xedit.
+        If there are unsaved files, a message will be printed asking to
+        "exit" again, or save the files.
+  C-X,C-E
+        Execute lisp expression before the cursor position.
+  C-X,C-F
+        Changes keyboard input focus to the filename text input window.
+        In this mode, pressing Tab will try to complete the filename
+        being typed.
+        When more than one match exists, pressing Tab again will display
+        the directory navigation window.
+        The initial search path usually is the basename of the file loaded
+        in the current textwindow, or currently directory from where
+        xedit was started if the *scratch* is the current "buffer".
+        The character ~ can be used as a shortcut for the home directory
+        and ~username will be replaced by the home directory of "username"
+        if it exists.
+  C-X,C-S or (Pressing the Save button)
+        Saves the file in the current text window.
+  C-X,Tab
+        Indents the current paragraph.
+        Use the C-U modifier to specify the number of spaces to insert
+        or remove if the C-U parameter is negative.
+  C-X,0
+        Deletes the current window.
+        The file being edited is not unloaded.
+  C-X,1
+        Deletes the other window.
+        The file being edited is not unloaded.
+  C-X,2
+        Splits vertically the current window.
+  C-X,3
+        Splits vertically the current window.
+  C-X,b
+        Switch the contents of the current window to the next file in
+        the list of loaded files.
+  C-X,d
+        Displays the directory listing window.
+        In this window, it is possible to navigate in the file system
+        to choose a file to edit.
+        Usually, this is the same as pressing C-X,C-F,Tab
+        See C-X,C-F for more information.
+  C-X,k
+        Unloads the file being edited.
+        If the file has not been saved, a message will be displayed,
+        asking to either press C-X,k again, or save the file
+        The *scratch* buffer cannot be killed and will always
+        prints a warning when exiting xedit. This is the expected behavior.
+  C-X,o
+        Switch input focus to the other window, making it the current one
+        If the editor doesn't have splited windows, this command is ignored.
+  Insert
+        Switches between insert and overwrite mode.
+        In overwrite mode text is typed over existing file contents,
+        only extending the file contents when typing at the end of
+        a line (or file).
+  Escape
+        Enters the line edit mode.
+        In this mode it is possible to use regex expressions to search and
+        replace the contents of the file loaded in the current text window.
+        Refer to the xedit(1) manpage for more information of the regex
+        expression format.
+        Note that the regex used by xedit isn't IEEE Std 1003.2 compliant,
+        and not compliant with most regex implementations in that it doesn't
+        support some complex search patterns, usually involving patterns
+        like ((.*)+)? that may require too much restarts or have several
+        correct interpretations for multiple matches. Also, it always does
+        minimal matching, and it is not configurable like in pcre, example:
+        searching "a1a1a1" with the pattern "(.*)\d" will find "a1" and
+        not "a1a1a1" as could be expected.
+        Please refer to lisp/re/README for more information on the supported
+        regex expressions.
+  C-LeftMouseButton
+        Displays the "File Menu" from where it is possible to select a
+        new file to be edited in the current window.
+  C-MiddleMouseButton
+        Displays the "Edit Menu" that usually has the following options:
+     +------------------+-------------+
+     | Wrapping      -> | Never       |
+     |                  | Line        |
+     |                  | Word        |
+     | Auto Fill        +-------------+
+     |                  +-------------+
+     | Justification -> | Left        |
+     |                  | Right       |
+     |                  | Center      |
+     |                  | Full        |
+     |                  +-------------+
+     | Break Columns... |
+     |                  +-------------+
+     | Scrollbars    -> | Vertical    |
+     |                  | Horizontal  |
+     |                  +-------------+
+     |                  +-------------+
+     | Edit Mode     -> | Plain/None  |
+     |                  | C/C++       |
+     |                  | Lisp/Scheme |
+     |                  | X imake     |
+     |                  | Makefile    |
+     |                  | Unix shell  |
+     |                  | SGML        |
+     |                  | HTML        |
+     |                  | Man page    |
+     |                  | X resource  |
+     |                  | XF86Config  |
+     |                  | RPM spec    |
+     |                  | XFree86 log |
+     |                  | Patch file  |
+     +------------------+-------------+
+        "Wrapping" is disabled if "Auto Fill" is enabled.
+        "Justification" and "Break Columns..." are enabled if "Auto Fill"
+        is also enabled.
+        "Edit Mode" lists the available syntax highlight and indentation
+        rules defined.
+        Note that most of these options don't work in "international" mode.
+        Several xedit interfaces works only with 8 bits encodings, and
+        doesn't properly handle UTF-8.
+  C-RightMouseButton
+        Displays the "Option Menu".
+        Currently the only option is an Ispell frontend.
+  FourthMouseButton (usually also moving up the mouse wheel)
+        Scroll one line down
+  FifthMouseButton (usually also moving down the mouse wheel)
+        Scroll one line up
+
+
+
+      There  is   also   some   documentation   in   lisp/README,   lisp/TODO,
+  lisp/re/README, lisp/re/tests.txt, and comments/justifications/wishlists for
+  the cases the interpreter fail to give the proper result for a given test.
+
+      The  lisp  interpreter  implements  most  of   a  standard  COMMON  LISP
+  environment, but the  compiler generates only  byte code and  not everything
+  can be compiled, in those cases the interpreter  does the work. Examples are
+  constructs involving  UNWIND-PROTECT or  any  kind of  jump  outside of  the
+  current function body.
+
+      For more  information please  consult any  COMMON LISP  documentation or
+  tutorial.
+
+
+
+      Simple tutorial on writing a "foolang" syntax highlight mode for xedit.
+
+  Create a file called foolang.lsp
+  Add:
+  --
+  (require "syntax")
+  (require "indent")
+  (in-package "XEDIT")
+  --
+  to foolang.lsp
+  Check the available files if you want a custom property, or to know about
+  the available ones. One example is:
+  --
+  (defsynprop *prop-foolang*
+    "foolang"
+    :font       "fixed"
+    :foreground "rgb:a/b/c"
+    :background "rgb:1/2/3"
+    :underline  t
+    :overstrike t)
+  --
+  Check  lisp/modules/xedit.lsp  for   the  other  options,   like  subscript,
+  superscript and/or combining XLFD properties.
+  Create a syntax definition for foolang. Check the definition of defsyntax in
+  lisp/modules/syntax.lsp for more details. One example for foolang is:
+  --
+  (defsyntax *foolang-mode* :foolang nil nil nil
+    ;; use the sample property created for foolang whenever the string
+    ;; foolang is found at the toplevel
+    (syntoken "\\<foolang\\>" :property *prop-foolang*)
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; process C style comments
+    (syntoken "/*" :nospec t :begin :comment :contained t)
+      ;; contained is an option to not "export" this definition to child
+      ;; tables
+
+    (syntable :comment *prop-comment* #'default-indent
+      ;; #'default-indent means a very simple indent that follows indentation
+      ;; of previous line. Use nil for no indentation
+
+      ;; Don't start a new table, instead flag as an error if nested
+      (syntoken "/*" :nospec t :property *prop-error*)
+        ;; :nospec t sets the RE_NOSPEC flag for the regex, i.e. searches
+        ;; a literal string, and * will not be a special character
+
+      (syntoken "XXX|TODO|FIXME" :property *prop-annotation*)
+        ;; just to make it easier to flag some important comment
+
+      (syntoken "*/" :nospec t :switch -1)
+        ;; The :switch argument is the number of tables to "pop", in
+        ;; this case, we are at table :comment, and :switch -1 returns
+        ;; to table :foolang, that is the "root" table
+    )
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Process lisp comments that can nest
+    (syntable :lisp-comment *prop-comment* nil
+
+      ;; Start a comment, possibly nested
+      (syntoken "#|" :nospec t :begin :lisp-comment)
+
+      ;; Returns to previous comment in stack or to main :foolang table
+      (syntoken "|#" :nospec t :switch -1)
+
+      ;; For easier flagging important comments
+      (syntoken "XXX|FIXME|TODO" :property *prop-annotation*)
+    )
+
+    ;; This is usually in the end of the list, but can be anywhere,
+    ;; just that if it isn't at the end, conflicting rules are resolved
+    ;; by declaration order
+    (synaugment :lisp-comment)
+      ;; Adds the :lisp-comment table to :foolang table
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Lisp like strings that don't need a \ at the end of the line
+    (syntable :lisp-string *prop-string* nil
+      ;; ignore a escaped " in the middle of the string
+      (syntoken "\\\\.")
+        ;; Note that no options are used, just keep using the current
+        ;; property. Unfortunately, backslashes must be escaped twice.
+        ;; Once for the lisp reader and once for the regex compiler.
+
+      (syntoken "\"" :nospec: t :switch -1)
+        ;; :nospec is used just to create a faster regex. switch -1
+        ;; returns to the previous syntax table. It isn't an error to
+        ;; try to go down the "root" table, but if that happens, it
+        ;; probably means either wrong syntax definition of malformed input.
+    )
+
+    (synaugment :lisp-string)
+      ;; Adds the :lisp-string table to :foolang table
+      ;; Note that since there isn't a rule to start a string in the
+      ;; :lisp-string table, it cannot nest, maybe because the ending
+      ;; character is the starting character ? :-))
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; C style string rules
+    (syntable :string *prop-string* nil
+      ;; Ignore escaped characters
+      (syntoken "\\\\.")
+
+    ;; Match, most, printf arguments.
+    (syntoken "%%|%([+-]?\\d+)?(l?[deEfgiouxX]|[cdeEfgiopsuxX])"
+        :property *prop-format*)
+      ;; Just for fun. This makes easier to see printf formats in strings
+      ;; *prop-format* is *prop-string* with the :underline option
+
+    (syntoken "\\\\$")
+    ;; a backslash extends the string to the next line
+
+    ;; A nonscaped " inside a string finishes it, since this table doesn't
+    ;; have sub tables, and cannot nest, should return to :foolang table
+    ;; from here
+    (syntoken "\"" :nospec t :switch -1)
+
+    ;; This token rule starts a new table called :error because end of line
+    ;; has been matched. Note that it is defined last, so that a line
+    ;; ending with " or \ will be processed first.
+    (syntoken ".?$" :begin :error)
+
+    (synaugment :string)
+      ;; Adds the :string table to :foolang table
+
+    ;; This table is used by :string, but could be shared for other patterns
+    ;; like characters constants, etc.
+    ;; It uses :switch -2 because it is started inside the :string table,
+    ;; but it is also a table, so, pops two tables from the table stack
+    (syntable :error *prop-error* nil
+       (syntoken "^.*$" :switch -2)
+    )
+  )
+  --
+
+      Indentation rules are significantly  more complex. I suggest  looking at
+  lisp/modules/indent.lsp   for   the   macros   and   function   definitions;
+  and lisp/modules/progmodes/lisp.lsp and lisp/modules/progmodes/c.lsp for two
+  sample  implementations   of   indentation   for   Lisp/Scheme   and   C/C++
+  respectively.
+
+      Note also  that indentation  is parsed  backwards, what  can cause  some
+  confusion, and make "visualization" of order or precedence of evaluation for
+  rules harder to understand.
+
+      A simple indentation rules definition for foolang could be:
+
+  --
+  (defindent *foolang-mode-indent* :foolang
+    ;; This must be the first token and usually the only token matching
+    ;; BOL (Beginning of Line)
+    (indtoken "^\\s*"   :indent
+      :code (or *offset* (setq *offset* (+ *ind-offset* *ind-length*))))
+      ;; the keyword :indent is a pattern put on a list when there is
+      ;; a match, so that later patterns can be "reduced" by some other
+      ;; rule, i.e.:  (:indent :indent) could be reduced to (:indent)
+
+    (indtoken "//.*$"   nil)
+      ;; C++ style comment. Returning nil instead of a token basically
+      ;; ignores the token, as it should not enter the reduction pattern
+      ;; list
+
+    ;; Sample C comment pattern
+    (indtoken "*/" :ccomment :nospec t :begin :comment)
+      ;; Note that the indaugment macro doesn't need to be used, and actually
+      ;; would be an error. In this example, the indentation compiler checks
+      ;; the :begin :comment and handles it internally, as it already needs
+      ;; to check for things like typos, unreachable labels, detectable
+      ;; non resolving rules, etc. There is runtime check also, so it should
+      ;; never enter an infinite loop when trying to resolve reduction rules.
+      ;; Check lisp/modules/indent.lsp:(compile-indent-table) for the
+      ;; implementation and more comments.
+
+    ;; Indentation rules also have stacked tables
+    (indtable :comment
+      (indtoken "/*" :ocomment :nospec t :switch -1))
+      ;; Note that the name is :ocomment (open comment), but that the
+      ;; the table is finished when matching the open comment pattern
+
+    ;; A simple initialization of a variable used by the indentation rules
+    (indinit       (parens 0))
+      ;; This variable can be declared anywhere in the body of defindent,
+      ;; It will be properly moved to a "variables declaration section"
+      ;; when expanding and compiling the table.
+
+    (indtoken "("  :oparen  :nospec t  :code (incf parens))
+    (indtoken ")"  :cparen  :nospec t  :code (decf parens))
+      ;; These two tokes add the patterns :oparen and :cparen to the
+      ;; "pattern list", and also have code to remember the balancing
+      ;; of parenthesis.
+
+
+    ;; One of the simplest reduction rules :-)
+    (indreduce nil
+      t
+      ((:comment)))
+      ;; Once the boundings of a comment are found, just ignore it, like
+      ;; what was done with the // pattern, but in that case, the boundings
+      ;; were readily available.
+      ;; The t (True) parameter means that this rule is always evaluated,
+      ;; but conditional code may be used, and implicit code may be added
+      ;; to the end of the indreduce macro.
+      ;; Since it is a macro, code can be compiled to optimized bytecode
+      ;; after the macro is expanded.
+
+    (indinit    (indent 0))
+      ;; Note that there is a special *indent* variable that should hold the
+      ;; proper indentation value, but it may be required to "overwrite"
+      ;; without forgetting that value, for things like:
+      ;;
+      ;;  foo(bar(baz(blah
+      ;;      ^       ^
+      ;;      |       |
+      ;;      indent  |
+      ;;              effective indentation to be used
+      ;;
+      ;; where it is desirable to align the code in the next line with the
+      ;; last open parenthesis.
+
+
+      Since the  interface is,  unfortunately,  complex enough  to not  expect
+  casual users to have something like a $HOME/.xedit file,  if you want to add
+  new modes, please check lisp/modules/xedit.lsp:*auto-modes*
+
+      There is some documentation about the variable. It should be possible to
+  change/update the variable from the lisp interface  in the *scratch* buffer,
+  but for  safety, it  is suggested  that  if you  add new  rules, you  should
+  restart  xedit  after  it.  Also  note  that  there   is  compiled  code  in
+  lisp/xedit.c that expects that variable to follow an specific format.
+
+      You may notice that several .lsp files  aren't "properly indented"; this
+  is because the lisp indentation rules  file was made long after  most of the
+  other files were done, and it was considered  a bad practice to gratuitously
+  reindent all files.
+
+
+
+      At the  time  of this  writing,  the ispell  interface  should be  again
+  functional, but it may be required to use some  old ispell program to handle
+  non utf8 text. But it should work properly for  the english language, and in
+  international mode, should work with any language. But there are problems in
+  international mode not fixed.
+
+      I  (Paulo  Cesar)  considered  several  times   to   extend  the  normal
+  textwidget to handle  utf8, but this  is probably  a lot of  work/time badly
+  spent and I prefer  to work on other  personal projects, but still  xedit is
+  the editor I use for programming. The XPRINT support unfortunately is broken
+  due to it. Note that xedit,  like pretty much any other  Xaw application can
+  be linked against  Xaw with  XPRINT support. In  the case  of xedit,  a flag
+  could be used, like the "international" variable to, at runtime, disable all
+  the related code, if required.
+
+      Also at the time of this writing, the tags  interface was added, as well
+  as several other bug fixes. The tags interface is documented in the manpage,
+  but the action  shortcut may  not be clear.  The default  shortcut is  M-. .
+  There is no support for more  than one tags file, or changing  the tags file
+  at runtime. But  the code  should be  easy to  adapt for  this case,  as all
+  related functions receive pointers to the appropriate structures. One option
+  could be to descend  from the directory of  the loaded file searching  for a
+  tags file, and then associate the file with the tags definition, if it isn't
+  already loaded. Shouldn't be  hard to implement. For  "inter project" files,
+  it should be better to  have one xedit window per  "project", i.e. searching
+  the definition of something  like a libc  symbol should probably be  done in
+  another xedit window.
diff --git a/xedit/aclocal.m4 b/xedit/aclocal.m4
new file mode 100644 (file)
index 0000000..e3e9a3e
--- /dev/null
@@ -0,0 +1,1941 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009  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.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
+[m4_warning([this file was generated for autoconf 2.65.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# 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 <http://pkg-config.freedesktop.org/>.])],
+               [$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 xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
+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 "Software"),
+dnl to deal in the Software without restriction, including without limitation
+dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
+dnl and/or sell copies of the Software, and to permit persons to whom the
+dnl Software is furnished to do so, subject to the following conditions:
+dnl
+dnl The above copyright notice and this permission notice (including the next
+dnl paragraph) shall be included in all copies or substantial portions of the
+dnl Software.
+dnl
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+dnl DEALINGS IN THE SOFTWARE.
+
+# 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 ensure that this macro is defined, also add:
+# m4_ifndef([XORG_MACROS_VERSION],
+#     [m4_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.
+m4_defun([XORG_MACROS_VERSION],[
+m4_define([vers_have], [1.5.0])
+m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
+m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
+m4_if(m4_cmp(maj_have, maj_needed), 0,,
+    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
+m4_if(m4_version_compare(vers_have, [$1]), -1,
+    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
+m4_undefine([vers_have])
+m4_undefine([maj_have])
+m4_undefine([maj_needed])
+]) # 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])
+       # under Cygwin unix is still defined even with -undef
+       elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+               RAWCPPFLAGS="-undef -ansi"
+               AC_MSG_RESULT([yes, with -ansi])
+       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],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+
+if test x"$cross_compiling" = x"yes" ; then
+  HAVE_DEFS_ENT=no
+else
+  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+fi
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+AC_PATH_PROG(PS2PDF, ps2pdf)
+
+AC_MSG_CHECKING([Whether to build documentation])
+
+if test x$HAVE_DEFS_ENT != 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 && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([Whether to build text documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([Whether to build PDF documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([Whether to build PostScript documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([Whether to build HTML documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# XORG_WITH_XMLTO
+# ----------------
+# Minimum version: 1.5.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-xmlto option, it allows maximum flexibilty in making decisions
+# as whether or not to use the xmlto package.
+#
+# Interface to module:
+# HAVE_XMLTO:  used in makefiles to conditionally generate documentation
+# XMLTO:       returns the path of the xmlto program found
+#              returns the path set by the user in the environment
+# --with-xmlto:        'yes' user instructs the module to use xmlto
+#              'no' user instructs the module not to use xmlto
+#
+# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_XMLTO],[
+AC_ARG_VAR([XMLTO], [Path to xmlto command])
+AC_ARG_WITH(xmlto,
+       AS_HELP_STRING([--with-xmlto],
+          [Use xmlto to regenerate documentation (default: yes, if installed)]),
+          [use_xmlto=$withval], [use_xmlto=auto])
+
+if test "x$use_xmlto" = x"auto"; then
+   AC_PATH_PROG([XMLTO], [xmlto])
+   if test "x$XMLTO" = "x"; then
+        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
+       have_xmlto=no
+   else
+        have_xmlto=yes
+   fi
+elif test "x$use_xmlto" = x"yes" ; then
+   AC_PATH_PROG([XMLTO], [xmlto])
+   if test "x$XMLTO" = "x"; then
+        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
+   fi
+   have_xmlto=yes
+elif test "x$use_xmlto" = x"no" ; then
+   if test "x$XMLTO" != "x"; then
+      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
+   fi
+   have_xmlto=no
+else
+   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
+fi
+AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
+]) # XORG_CHECK_XMLTO
+
+# XORG_WITH_ASCIIDOC
+# ----------------
+# Minimum version: 1.5.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-asciidoc option, it allows maximum flexibilty in making decisions
+# as whether or not to use the asciidoc package.
+#
+# Interface to module:
+# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
+# ASCIIDOC:     returns the path of the asciidoc program found
+#               returns the path set by the user in the environment
+# --with-asciidoc: 'yes' user instructs the module to use asciidoc
+#                'no' user instructs the module not to use asciidoc
+#
+# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_ASCIIDOC],[
+AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
+AC_ARG_WITH(asciidoc,
+       AS_HELP_STRING([--with-asciidoc],
+          [Use asciidoc to regenerate documentation (default: yes, if installed)]),
+          [use_asciidoc=$withval], [use_asciidoc=auto])
+
+if test "x$use_asciidoc" = x"auto"; then
+   AC_PATH_PROG([ASCIIDOC], [asciidoc])
+   if test "x$ASCIIDOC" = "x"; then
+        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
+       have_asciidoc=no
+   else
+        have_asciidoc=yes
+   fi
+elif test "x$use_asciidoc" = x"yes" ; then
+   AC_PATH_PROG([ASCIIDOC], [asciidoc])
+   if test "x$ASCIIDOC" = "x"; then
+        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
+   fi
+   have_asciidoc=yes
+elif test "x$use_asciidoc" = x"no" ; then
+   if test "x$ASCIIDOC" != "x"; then
+      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
+   fi
+   have_asciidoc=no
+else
+   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
+fi
+AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
+]) # XORG_CHECK_ASCIIDOC
+
+# XORG_WITH_DOXYGEN
+# ----------------
+# Minimum version: 1.5.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-doxygen option, it allows maximum flexibilty in making decisions
+# as whether or not to use the doxygen package.
+#
+# Interface to module:
+# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
+# DOXYGEN:      returns the path of the doxygen program found
+#               returns the path set by the user in the environment
+# --with-doxygen: 'yes' user instructs the module to use doxygen
+#                'no' user instructs the module not to use doxygen
+#
+# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_DOXYGEN],[
+AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
+AC_ARG_WITH(doxygen,
+       AS_HELP_STRING([--with-doxygen],
+          [Use doxygen to regenerate documentation (default: yes, if installed)]),
+          [use_doxygen=$withval], [use_doxygen=auto])
+
+if test "x$use_doxygen" = x"auto"; then
+   AC_PATH_PROG([DOXYGEN], [doxygen])
+   if test "x$DOXYGEN" = "x"; then
+        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
+       have_doxygen=no
+   else
+        have_doxygen=yes
+   fi
+elif test "x$use_doxygen" = x"yes" ; then
+   AC_PATH_PROG([DOXYGEN], [doxygen])
+   if test "x$DOXYGEN" = "x"; then
+        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
+   fi
+   have_doxygen=yes
+elif test "x$use_doxygen" = x"no" ; then
+   if test "x$DOXYGEN" != "x"; then
+      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
+   fi
+   have_doxygen=no
+else
+   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
+fi
+AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
+]) # XORG_CHECK_DOXYGEN
+
+# 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,
+       AS_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],
+               [MALLOC_ZERO_RETURNS_NULL=yes])
+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, [AS_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, [AS_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
+
+# XORG_CWARNFLAGS
+# ---------------
+# Minimum version: 1.2.0
+#
+# Defines CWARNFLAGS to enable C compiler warnings.
+#
+AC_DEFUN([XORG_CWARNFLAGS], [
+AC_REQUIRE([AC_PROG_CC])
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+AC_SUBST(CWARNFLAGS)
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+]) # XORG_CWARNFLAGS
+
+# XORG_STRICT_OPTION
+# -----------------------
+# Minimum version: 1.3.0
+#
+# Add configure option to enable strict compilation
+AC_DEFUN([XORG_STRICT_OPTION], [
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CC_C99])
+AC_REQUIRE([XORG_CWARNFLAGS])
+
+AC_ARG_ENABLE(strict-compilation,
+                         AS_HELP_STRING([--enable-strict-compilation],
+                         [Enable all warnings from compiler and make them errors (default: disabled)]),
+                         [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
+if test "x$STRICT_COMPILE" = "xyes"; then
+       AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+       AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+AC_SUBST([CWARNFLAGS])
+]) # XORG_STRICT_OPTION
+
+# XORG_DEFAULT_OPTIONS
+# --------------------
+# Minimum version: 1.3.0
+#
+# Defines default options for X.Org modules.
+#
+AC_DEFUN([XORG_DEFAULT_OPTIONS], [
+XORG_CWARNFLAGS
+XORG_STRICT_OPTION
+XORG_RELEASE_VERSION
+XORG_CHANGELOG
+XORG_INSTALL
+XORG_MANPAGE_SECTIONS
+]) # XORG_DEFAULT_OPTIONS
+
+# XORG_INSTALL()
+# ----------------
+# Minimum version: 1.4.0
+#
+# Defines the variable INSTALL_CMD as the command to copy
+# INSTALL from $prefix/share/util-macros.
+#
+AC_DEFUN([XORG_INSTALL], [
+AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
+INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+AC_SUBST([INSTALL_CMD])
+]) # XORG_INSTALL
+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.  Also
+# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+AC_DEFUN([XORG_RELEASE_VERSION],[
+       AC_ARG_WITH(release-version,
+                       AS_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
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+               [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+               [Major version of this package])
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+               [$PVM],
+               [Minor version of this package])
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+               [$PVP],
+               [Patch version of this package])
+])
+
+# XORG_CHANGELOG()
+# ----------------
+# Minimum version: 1.2.0
+#
+# Defines the variable CHANGELOG_CMD as the command to generate
+# ChangeLog from git.
+#
+#
+AC_DEFUN([XORG_CHANGELOG], [
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+AC_SUBST([CHANGELOG_CMD])
+]) # XORG_CHANGELOG
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11.1], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# 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, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# 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])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+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, 2006, 2009
+# 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 10
+
+# 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], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$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
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    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, 2006, 2008, 2009 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 16
+
+# 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.62])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
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+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
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_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)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+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
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_AM_DEPENDENCIES(OBJC)],
+                 [define([AC_PROG_OBJC],
+                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# 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_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
+                         (and sometimes confusing) to the casual installer],
+      [USE_MAINTAINER_MODE=$enableval],
+      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  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, 2009  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_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.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
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_PROG_CC_C_O
+# --------------
+# Like AC_PROG_CC_C_O, but changed for automake.
+AC_DEFUN([AM_PROG_CC_C_O],
+[AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+dnl Make sure AC_PROG_CC is never called again, or it will override our
+dnl setting of CC.
+m4_define([AC_PROG_CC],
+          [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# 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
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# 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, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _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],
+[m4_foreach_w([_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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# 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
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# 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="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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/xedit/app-defaults/Xedit-color.ad b/xedit/app-defaults/Xedit-color.ad
new file mode 100644 (file)
index 0000000..da811b9
--- /dev/null
@@ -0,0 +1,195 @@
+! $XFree86: xc/programs/xedit/Xedit-color.ad,v 1.14 2002/11/10 23:21:56 paulo Exp $
+
+#include "Xedit"
+
+*background:                   gray70
+*foreground:                   gray15
+*borderColor:                  gray40
+*Command.highlightThickness:   1
+*Command.backgroundPixmap:     gradient:vertical?dimension=18&start=gray90&end=gray65
+*Command.foreground:           gray20
+*Command.displayList:\
+foreground     gray92;\
+line           1,0,-2,0;\
+foreground     gray95;\
+line           2,1,-3,1;\
+foreground     gray74;\
+segments       3,-3,-4,-3, 2,-4,-3,-4, 1,-6,-2,-6;\
+point          -1,-1;\
+foreground     gray80;\
+line           0,0,0,-1;\
+point          -1,0
+
+*Command.translations: #override \
+<Btn1Down>:    set-values(1, foreground, gray20, background, rgb:d/5/5) set()\n\
+Button1<Leave>: reset() set-values(1, foreground, gray20, background, gray70)\n\
+<Btn1Up>:      notify() unset()
+
+*Toggle.foreground:            gray30
+*Toggle.background:            gray82
+*Toggle.borderColor:           gray90
+*Toggle.displayList:\
+foreground     gray75;\
+segments       0,1,0,-2,-1,1,-1,-2;\
+foreground     gray80;\
+segments       0,0,-1,0,0,-1,-1,-1;\
+points         1,1,1,-2,-2,1, -2,-2
+
+*bc_label.backgroundPixmap:    gradient:vertical?dimension=18&start=gray90&end=gray65
+*bc_label.displayList:\
+foreground     gray92;\
+line           1,0,-2,0;\
+foreground     gray95;\
+line           2,1,-3,1;\
+foreground     gray74;\
+segments       3,-2,-4,-2, 2,-3,-3,-3, 1,-5,-2,-5
+*bc_label.foreground:          gray20
+
+*formWindow.backgroundPixmap:  gradient:vertical?dimension=18&start=gray90&end=gray65
+*formWindow.displayList:\
+foreground     gray92;\
+line           1,0,-2,0;\
+foreground     gray95;\
+line           2,1,-3,1;\
+foreground     gray74;\
+segments       3,-2,-4,-2, 2,-3,-3,-3, 1,-5,-2,-5
+*formWindow*backgroundPixmap:  ParentRelative
+*formWindow*foreground:                gray20
+*formWindow*background:                gray74
+*formWindow.labelWindow.background:    gray80
+*formWindow.labelWindow.displayList:\
+line-style     onoffdash;\
+foreground     gray30;\
+background     gray96;\
+draw-rect      3,2,15,14;\
+foreground     gray78;\
+fill-rect      4,3,15,14
+
+*dirlabel.foreground:          gray20
+*dirlabel.backgroundPixmap:    gradient:vertical?dimension=18&start=gray90&end=gray65
+*dirlabel.displayList:\
+foreground     gray92;\
+line           1,0,-2,0;\
+foreground     gray95;\
+line           2,1,-3,1;\
+foreground     gray74;\
+segments       3,-2,-4,-2, 2,-3,-3,-3, 1,-5,-2,-5
+*dirwindow.background:         gray96
+
+*internalBorderColor:          gray40
+
+*Text*Text.background:         gray96
+*Text.background:              gray96
+*Text.?.background:            gray96
+*Text*cursorColor:             rgb:d/5/5
+*Text.displayList:\
+foreground     white;\
+line           1,-1,-2,-1;\
+foreground     gray88;\
+line           1,0,-2,0
+
+*Scrollbar.foreground:         rgb:a/5/5
+*Scrollbar.background:         gray60
+*Text.Scrollbar.background:    gray60
+*Scrollbar.backgroundPixmap:   gradient:horizontal?dimension=14&start=gray70&end=gray85
+*hScrollbar.backgroundPixmap:  gradient:vertical?dimension=14&start=gray85&end=gray70
+*hScrollbar.displayList:\
+foreground     gray85;\
+segments       1,-1,-2,-1,1,0,-2,0
+*vScrollbar.displayList:\
+foreground     gray85;\
+segments       0,1,0,-2,-1,1,-1,-2
+*Scrollbar.thumb:              vlines2
+*hScrollbar.thumb:             hlines2
+
+*SimpleMenu*borderWidth:               0
+*SimpleMenu*backgroundPixmap:  xlogo11?foreground=gray90&background=gray88
+*SimpleMenu*background:                gray90
+*SimpleMenu*foreground:                gray20
+*SimpleMenu.VerticalMargins:   3
+*SimpleMenu.HorizontalMargins: 3
+*SimpleMenu.SimpleMenu.VerticalMargins:        3
+*SimpleMenu.SimpleMenu.HorizontalMargins:      3
+*SimpleMenu.menuLabel.foreground:      rgb:d/5/5
+*SimpleMenu*displayList:\
+foreground     gray70;\
+lines          +2,-2,-2,-2,-2,+2;\
+foreground     gray95;\
+lines          -2,+1,+1,+1,+1,-2;\
+foreground     gray30;\
+lines          +1,-1,-1,-1,-1,+1;\
+foreground     gray80;\
+lines          -1,+0,+0,+0,+0,-1
+
+*TransientShell.backgroundPixmap:      xlogo11?foreground=gray90&background=gray87
+*TransientShell.Form.backgroundPixmap:         ParentRelative
+*TransientShell.Form.Label.backgroundPixmap:   ParentRelative
+
+*ispell*Scrollbar.borderColor: gray50
+*ispell*Scrollbar.displayList:
+*ispell*List.background:       gray96
+*ispell*word.background:       gray96
+*ispell*word.backgroundPixmap: XtUnspecifiedPixmap
+*ispell*word.translations:\
+<Enter>:       highlight()\n\
+<Leave>:       reset()\n\
+<Btn1Down>:    set()\n\
+<Btn1Up>:      notify() unset()\n
+*ispell*word.displayList:
+*ispell.Form.Form.borderColor: gray80
+*ispell.Form.Form.displayList: \
+foreground     gray90;\
+lines          +1,-1,-1,-1,-1,+1;\
+foreground     gray30;\
+lines          -1,+0,+0,+0,+0,-1;\
+foreground     gray60;\
+lines          +2,-2,-2,-2,-2,+2
+*ispell*status.backgroundPixmap:       XtUnspecifiedPixmap
+*ispell*status.background:     gray96
+*ispell*terse.justify:         right
+*ispell*terse.internalWidth:   10
+*ispell*terse.background:      gray75
+*ispell*terse.foreground:      gray20
+*ispell*terse.highlightThickness:      0
+*ispell*terse.displayList:\
+line-style     solid;\
+foreground     gray70;\
+fill-arc       6,4,14,12;\
+foreground     gray90;\
+draw-arc       6,4,14,12,45,180;\
+draw-lines     +0,-1,-1,-1,-1,+0;\
+foreground     gray50;\
+draw-arc       6,4,14,12,225,180;\
+draw-lines     -2,+0,+0,+0,+0,-2;\
+foreground     gray45;\
+dashes         2,1;\
+line-style     onoffdash;\
+draw-rect      +1,+1,-2,-2
+*ispell*options.MenuButton.borderColor:        gray70
+*ispell*options.MenuButton.background: gray78
+*ispell*options.MenuButton.backgroundPixmap:   gradient:vertical?dimension=18&start=gray90&end=gray65
+*ispell*options.MenuButton.displayList:\
+foreground     gray60;\
+lines          +2,-2,-2,-2,-2,+2;\
+foreground     gray95;\
+lines          -3,+1,+1,+1,+1,-3;\
+foreground     gray78;\
+points         -2,+1,+1,-2
+
+*tip.foreground:       rgb:48/48/00
+*tip.backgroundPixmap: None
+*tip.borderWidth:      0
+*tip.rightMargin:      7
+*tip.bottomMargin:     3
+*tip.displayList:\
+foreground     rgb:f/e/8;\
+fill-rect      1,1,-2,-2;\
+foreground     rgb:d/c/6;\
+draw-segments  0,1,0,-3,1,-2,-3,-2,-2,-3,-2,1,-3,0,1,0;\
+foreground     rgb:a/8/4;\
+draw-lines     2,-1, -2,-1, -1,-2, -1,2
+
+*grip.foreground:      gray10
+*grip.displayList:\
+foreground     gray80;\
+points         0,0,0,-1,-1,-1,-1,0
diff --git a/xedit/app-defaults/Xedit-noxprint.ad b/xedit/app-defaults/Xedit-noxprint.ad
new file mode 100644 (file)
index 0000000..b626bf3
--- /dev/null
@@ -0,0 +1,468 @@
+! $XFree86: xc/programs/xedit/Xedit.ad,v 1.23 2002/09/22 07:09:05 paulo Exp $
+
+*geometry:                             590x440
+*input:                                        TRUE
+*enableBackups:                                True
+*backupNameSuffix:                     ~
+*changedBitmap:                                xlogo11
+*international:                                False
+
+*hints:\
+Use Control-S and Control-R to Search.\n\
+Use Control-Shift-_ to Undo. Control-G to switch between Undo and Redo.\n\
+Use Control-A to jump to the beginning of the line.\n\
+Use Control-E to jump to the end of the line.\n\
+Use Control-T to transpose characters.\n\
+Use Control-K to cut to the end of the line. Control-Y to paste.\n\
+Use Control-Q to escape control characters.\n\
+Use Control-U[,<number>] to multiply actions. Control-G to cancel.\n\
+Use Control-Z to scroll one line up. Meta-Z to scroll one line down.\n\
+Use Meta-Q to format a paragraph.\n\
+Use Right-Button to extend selections.\n\
+Use Meta-I to insert a file.\n\
+Use Control-W to delete a selection, and/or jump to the selection mark.\n\
+Use Control-X,Control-F to find a file. Tab for filename completion.\n\
+Use Control-X,Control-S to save.\n\
+Use Control-X,Control-C to exit.\n\
+Use Control-C to paste the selection at CUT_BUFFER0.\n\
+Use Control Left-Button to popup the File Menu.\n\
+Use Control Middle-Button to popup the Edit Menu.\n\
+Use Control Right-Button to popup the Option Menu.\n\
+Use Control-X,Tab to Indent.\n\
+Use Control-X,0 to delete current splitted window.\n\
+Use Control-X,1 to delete other splitted window.\n\
+Use Control-X,2 to split the window vertically.\n\
+Use Control-X,3 to split the window horizontally.\n\
+Use Control-X,b to switch to another file.\n\
+Use Control-X,d to list directory. Control-G to Cancel.\n\
+Use Control-X,k to close file being edited.\n\
+Use Control-X,o to switch to another splitted window.\n\
+Use Control-X,u to undo. Control-G to switch between Undo and Redo.\n\
+Use Insert to toggle Overwrite mode.\n\
+Use Control-G to interrupt the lisp subprocess.\n\
+Use Escape to enter or leave regex search and replace mode.\n\
+Use Alt-. to search tags for the selected symbol or find the next match.
+
+*formWindow*defaultDistance:           2
+*formWindow.?.borderWidth:             0
+*formWindow.min:                       18
+*formWindow.max:                       18
+*formWindow.showGrip:                  False
+*positionWindow.fromHoriz:             labelWindow
+*positionWindow.horizDistance:         0
+*positionWindow.left:                  chainRight
+*positionWindow.right:                 chainRight
+*positionWindow.width:                 90
+*positionWindow.label:                 error
+*positionWindow.justify:               left
+*labelWindow*justify:                  center
+*labelWindow*label:                    no file yet
+*labelWindow.left:                     chainLeft
+*labelWindow.right:                    chainRight
+
+*quit.label:                           Quit
+*quit.tip:                             Close xedit window
+*save.label:                           Save
+*save.tip:                             Save current file
+*load.label:                           Load
+*load.tip:                             Load a new file
+
+*buttons*orientation:                  horizontal
+*buttons*showGrip:                     False
+*buttons.min:                          18
+
+*messageWindow.height:                 50
+*messageWindow.min:                    18
+*Paned*Text*allowResize:               True
+
+*messageWindow.autoFill:               False
+*messageWindow.scrollVertical:         Never
+
+*editWindow.autoFill:                  False
+*editWindow.scrollVertical:            Always
+*editWindow.showGrip:                  True
+xedit.textSource*enableUndo:           True
+
+*bc_label*label:                       Use Control-S and Control-R to Search.
+*bc_label*showGrip:                    False
+*bc_label.min:                         18
+
+*dirlabel.showGrip:                    False
+*dirlabel.min:                         18
+*dirlabel.max:                         18
+
+*dirwindow.defaultColumns:             0
+*dirwindow.verticalList:               True
+
+*viewport.forceBars:                   True
+*viewport.allowVert:                   1
+
+*insertFile*text.width:                        141
+*insertFile*text.?.pieceSize:          256
+*search*searchText.width:              157
+*search*replaceText.width:             157
+*search*case.horizDistance:            25
+*search*Text.?.pieceSize:              256
+
+*SimpleMenu.BackingStore:              NotUseful
+*SimpleMenu.menuLabel.vertSpace:       80
+*SimpleMenu.SmeBSB.HorizontalMargins:  16
+*SimpleMenu.justify:                   center
+*SimpleMenu.menuLabel.height:          250
+*SimpleMenu*cursor:                    left_ptr
+
+*fileMenu.label:                       File Menu
+*optionsMenu.label:                    Option Menu
+*optionsMenu.ispell.label:             ispell...
+*editMenu.label:                       Edit Menu
+*editMenu.wrapMenuItem.label:          Wrapping
+*editMenu.wrapMenuItem.leftBitmap:     menu12
+*wrapMenu.never.label:                 Never
+*wrapMenu.line.label:                  Line
+*wrapMenu.word.label:                  Word
+*editMenu.autoFill.label:              Auto Fill
+*editMenu.justifyMenuItem.label:       Justification
+*editMenu.justifyMenuItem.leftBitmap:  menu12
+*justifyMenu.left.label:               Left
+*justifyMenu.right.label:              Right
+*justifyMenu.center.label:             Center
+*justifyMenu.full.label:               Full
+*editMenu.breakColumns.label:          Break Columns...
+*editMenu.scrollMenuItem.label:                Scrollbars
+*editMenu.scrollMenuItem.leftBitmap:   menu12
+*scrollMenu.vertical.label:            Vertical
+*scrollMenu.horizontal.label:          Horizontal
+*editMenu.modeMenuItem.leftBitmap:     menu12
+*editMenu.modeMenuItem.label:          Edit Mode
+*editModes.none.label:                 Plain/None
+
+*TransientShell*Text.translations: #override \
+c<Key>S:       no-op(r)\n\
+c<Key>R:       no-op(r)\n\
+m<Key>I:       no-op(r)
+
+*search.translations: #override \
+<Create>:get-values(my, $w, width, $h, height)\
+       set-values(1, minWidth, $w, minHeight, $h, maxHeight, $h, allowShellResize, False)
+
+*insertFile.title:                     Insert File
+*insertFile.translations: #override \
+<Create>:get-values(my, $w, width, $h, height)\
+       set-values(1, minWidth, $w, minHeight, $h, maxHeight, $h, allowShellResize, False)
+
+*baseTranslations: #override \
+<Ctrl>X,<Ctrl>C:quit()\n\
+<Ctrl>X,<Ctrl>S:save-file()\n\
+<Ctrl>X,<Ctrl>F:find-file()\n\
+<Key>Escape:   line-edit()
+
+*messageWindow.Translations: #override \
+<Ctrl>X,<Ctrl>C:quit()\n\
+<Ctrl>X,<Ctrl>S:save-file()\n\
+<Ctrl>X,<Ctrl>F:find-file()\n\
+<Enter>:       no-op()\n\
+<Leave>:       no-op()\n\
+<Btn1Down>:    set-keyboard-focus() select-start()
+
+*searchText.Translations: #override \
+<Enter>:       no-op()\n\
+<Leave>:       no-op()\n\
+<Btn1Down>:    set-keyboard-focus() select-start()
+
+*replaceText.Translations: #override \
+<Enter>:       no-op()\n\
+<Leave>:       no-op()\n\
+<Btn1Down>:    set-keyboard-focus() select-start()
+
+*editWindow.translations: #override \
+<Ctrl>X,<Ctrl>E:lisp-eval()\n\
+<Ctrl>X,<Key>Tab:indent()\n\
+<Ctrl>X,:<Key>0:delete-window(current)\n\
+<Ctrl>X,:<Key>1:delete-window(other)\n\
+<Ctrl>X,:<Key>2:split-window(vertical)\n\
+<Ctrl>X,:<Key>3:split-window(horizontal)\n\
+<Ctrl>X,!l @Num_Lock<Key>b:switch-source()\n\
+<Ctrl>X,!l <Key>b:switch-source()\n\
+<Ctrl>X,!@Num_Lock<Key>b:switch-source()\n\
+<Ctrl>X,!<Key>b:switch-source()\n\
+<Ctrl>X,!l @Num_Lock<Key>d:dir-window()\n\
+<Ctrl>X,!l <Key>d:dir-window()\n\
+<Ctrl>X,!@Num_Lock<Key>d:dir-window()\n\
+<Ctrl>X,!<Key>d:dir-window()\n\
+<Ctrl>X,!l @Num_Lock<Key>k:kill-file()\n\
+<Ctrl>X,!l <Key>k:kill-file()\n\
+<Ctrl>X,!@Num_Lock<Key>k:kill-file()\n\
+<Ctrl>X,!<Key>k:kill-file()\n\
+<Ctrl>X,!l @Num_Lock<Key>o:other-window()\n\
+<Ctrl>X,!l <Key>o:other-window()\n\
+<Ctrl>X,!@Num_Lock<Key>o:other-window()\n\
+<Ctrl>X,!<Key>o:other-window()\n\
+<Ctrl>X,!l @Num_Lock<Key>u:undo()\n\
+<Ctrl>X,!l <Key>u:undo()\n\
+<Ctrl>X,!@Num_Lock<Key>u:undo()\n\
+<Ctrl>X,!<Key>u:undo()\n\
+<Ctrl>G:       xedit-keyboard-reset()\n\
+<Ctrl>J:       xedit-print-lisp-eval()\n\
+:m<Key>.:      tags()\n\
+<Key>Tab:      insert-char()\n\
+!l @Num_Lock<Key>b:insert-char()\n\
+!l <Key>b:     insert-char()\n\
+!@Num_Lock<Key>b:insert-char()\n\
+!<Key>b:       insert-char()\n\
+!l @Num_Lock<Key>d:insert-char()\n\
+!l <Key>d:     insert-char()\n\
+!@Num_Lock<Key>d:insert-char()\n\
+!<Key>d:       insert-char()\n\
+!l <Key>k:     insert-char()\n\
+!l @Num_Lock<Key>k:insert-char()\n\
+!@Num_Lock<Key>k:insert-char()\n\
+!<Key>k:       insert-char()\n\
+!l @Num_Lock<Key>o:insert-char()\n\
+!l <Key>o:     insert-char()\n\
+!@Num_Lock<Key>o:insert-char()\n\
+!<Key>o:       insert-char()\n\
+!l @Num_Lock<Key>u:insert-char()\n\
+!l <Key>u:     insert-char()\n\
+!@Num_Lock<Key>u:insert-char()\n\
+!<Key>u:       insert-char()\n\
+~s <Key>Insert:        toggle-overwrite()\n\
+c l @Num_Lock<Btn1Down>:xedit-focus() popup-menu(fileMenu)\n\
+c @Num_Lock<Btn1Down>:xedit-focus() popup-menu(fileMenu)\n\
+c l<Btn1Down>: xedit-focus() popup-menu(fileMenu)\n\
+c<Btn1Down>:   xedit-focus() popup-menu(fileMenu)\n\
+c l @Num_Lock<Btn2Down>:xedit-focus() popup-menu(editMenu)\n\
+c @Num_Lock<Btn2Down>:xedit-focus() popup-menu(editMenu)\n\
+c l<Btn2Down>: xedit-focus() popup-menu(editMenu)\n\
+c<Btn2Down>:   xedit-focus() popup-menu(editMenu)\n\
+c l @Num_Lock<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\
+c @Num_Lock<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\
+c l<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\
+c<Btn3Down>:   xedit-focus() popup-menu(optionsMenu)\n\
+<Btn1Down>:    xedit-focus() select-start()\n\
+<Btn4Down>:    scroll-one-line-down()\n\
+<Btn5Down>:    scroll-one-line-up()
+
+*filename.?.pieceSize:                 256
+*filename.translations: #override \
+c<Key>S:       no-op(r)\n\
+c<Key>R:       no-op(r)\n\
+m<Key>I:       no-op(r)\n\
+c<Key>G:       cancel-find-file()\n\
+<Key>Return:   load-file()\n\
+<Key>Tab:      file-completion(h)\n\
+<Key>Escape:   cancel-find-file()\n\
+<Enter>:       no-op()\n\
+<Leave>:       no-op()\n\
+<Btn1Down>:    set-keyboard-focus() select-start()
+
+*ispell.translations:  #override \
+<Message>WM_PROTOCOLS: ispell(end)
+
+! Sample dictionary, word chars and text mode resources setup
+!*ispell.dictionary:                   br
+!*ispell.dictionaries:                 br american americanmed+ english
+!*ispell*br.wordChars:                 áéíóúçÁÉÍÓÚÇàÀâêôÂÊÔüÜãõÃÕ-
+*ispell.ispellCommand:                 /usr/bin/aspell -B -m
+*ispell.lookCommand:                   /bin/egrep
+!*ispell*text.skipLines:               .#
+
+*ispell.geometry:                      0x0
+*ispell.minWidth:                      320
+*ispell.minHeight:                     245
+*ispell*Label.borderWidth:             0
+*ispell*Label.internalHeight:          4
+*ispell*Label.justify:                 right
+*ispell*Label.width:                   112
+*ispell*Label.left:                    chainLeft
+*ispell*Label.right:                   chainLeft
+*ispell*Label.top:                     chainTop
+*ispell*Label.bottom:                  chainTop
+*ispell*mispelled.label:               Misspelled word:
+*ispell*mispelled.top:                 chainTop
+*ispell*mispelled.bottom:              chainTop
+*ispell*mispelled.internalWidth:       0
+*ispell*repeated.label:                        Repeated words:
+*ispell*repeated.internalWidth:                0
+*ispell*replacement.label:             Replace with:
+*ispell*word.fromHoriz:                        mispelled
+*ispell*word.justify:                  left
+*ispell*word.borderWidth:              1
+*ispell*word.internalWidth:            4
+*ispell*word.internalHeight:           3
+*ispell*word.width:                    194
+*ispell*word.left:                     chainLeft
+*ispell*word.right:                    chainRight
+*ispell*word.top:                      chainTop
+*ispell*word.bottom:                   chainTop
+*ispell*word.label:
+*ispell*word.tip:                      Press here to select this text
+*ispell*word.highlightThickness:       0
+*ispell*text.fromHoriz:                        replacement
+*ispell*replacement.fromVert:          mispelled
+*ispell*replacement.internalWidth:     0
+*ispell*form.text.fromVert:            word
+*ispell*form.text.width:               194
+*ispell*form.text.top:                 chainTop
+*ispell*form.text.bottom:              chainTop
+*ispell*form.text.left:                        chainLeft
+*ispell*form.text.right:               chainRight
+*ispell*form.text.leftMargin:          4
+*ispell*form.text.?.pieceSize:         256
+*ispell*suggestions.label:             Suggestions:
+*ispell*suggestions.fromVert:          replacement
+*ispell*suggestions.internalWidth:     0
+*ispell*viewport.fromHoriz:            suggestions
+*ispell*viewport.fromVert:             text
+*ispell*viewport.width:                        194
+*ispell*viewport.height:               143
+*ispell*viewport.top:                  chainTop
+*ispell*viewport.bottom:               chainBottom
+*ispell*viewport.left:                 chainLeft
+*ispell*viewport.right:                        chainRight
+*ispell*viewport.forceBars:            1
+*ispell*viewport.allowVert:            1
+*ispell*list.defaultColumns:           1
+*ispell*list.longest:                  16384
+*ispell*commands.vertDistance:         5
+*ispell*commands.fromVert:             suggestions
+*ispell*commands.top:                  chainBottom
+*ispell*commands.bottom:               chainBottom
+*ispell*commands.right:                        chainLeft
+*ispell*commands.left:                 chainLeft
+*ispell*check.label:                   Check
+*ispell*check.width:                   54
+*ispell*check.tip:                     Ask ispell about the word in the text field
+*ispell*look.label:                    Look
+*ispell*look.fromHoriz:                        check
+*ispell*look.horizDistance:            0
+*ispell*look.width:                    46
+*ispell*look.tip:                      Runs the look command
+*ispell*undo.fromVert:                 check
+*ispell*undo.label:                    Undo
+*ispell*undo.width:                    102
+*ispell*undo.tip:                      Undo last action
+*ispell*replace.fromVert:              undo
+*ispell*replace.label:                 Replace
+*ispell*replace.tip:                   Replace occurence of the word
+*ispell*replaceAll.fromVert:           undo
+*ispell*replaceAll.fromHoriz:          replace
+*ispell*replaceAll.label:              All
+*ispell*replaceAll.tip:                        Replace all occurences of the word
+*ispell*ignore.fromVert:               replace
+*ispell*ignore.label:                  Ignore
+*ispell*ignore.tip:                    Ignore this word
+*ispell*ignoreAll.fromVert:            replaceAll
+*ispell*ignoreAll.fromHoriz:           ignore
+*ispell*ignoreAll.label:               All
+*ispell*ignoreAll.tip:                 Ignore all ocurrences of the word
+*ispell*add.fromVert:                  ignore
+*ispell*add.label:                     Add
+*ispell*add.width:                     50
+*ispell*add.tip:                       Add word to your private dictionary
+*ispell*addUncap.fromVert:             ignoreAll
+*ispell*addUncap.fromHoriz:            add
+*ispell*addUncap.label:                        Uncap
+*ispell*addUncap.horizDistance:                0
+*ispell*addUncap.width:                        50
+*ispell*addUncap.tip:                  Add word uncapitalized, to your private dictionary
+*ispell*suspend.fromVert:              add
+*ispell*suspend.label:                 Suspend
+*ispell*suspend.width:                 57
+*ispell*suspend.tip:                   Suspend ispell execution
+*ispell*cancel.fromHoriz:              suspend
+*ispell*cancel.fromVert:               addUncap
+*ispell*cancel.label:                  Close
+*ispell*cancel.width:                  43
+*ispell*cancel.horizDistance:          0
+*ispell*cancel.tip:                    Terminates ispell process
+*ispell*replace.width:                 65
+*ispell*ignore.width:                  65
+*ispell*replaceAll.width:              35
+*ispell*replaceAll.horizDistance:      0
+*ispell*ignoreAll.width:               35
+*ispell*ignoreAll.horizDistance:       0
+*ispell*terse.fromVert:                        cancel
+*ispell*terse.Label:                   Terse Mode
+*ispell*terse.width:                   104
+*ispell*terse.borderWidth:             0
+*ispell*terse.tip:                     Switch terse mode
+*ispell*status.fromVert:               viewport
+*ispell*status.fromHoriz:              suggestions
+*ispell*status.top:                    chainBottom
+*ispell*status.bottom:                 chainBottom
+*ispell*status.left:                   chainLeft
+*ispell*status.right:                  chainRight
+*ispell*status.width:                  194
+*ispell*status.borderWidth:            1
+*ispell*status.justify:                        left
+*ispell*status.internalHeight:         2
+*ispell*status.vertDistance:           2
+*ispell*options.fromVert:              status
+*ispell*options.fromHoriz:             commands
+*ispell*options.bottom:                        chainBottom
+*ispell*options.top:                   chainBottom
+*ispell*options.left:                  chainLeft
+*ispell*options.right:                 chainRight
+*ispell*options.dict.width:            121
+*ispell*options.horizDistance:         2
+*ispell*options.vertDistance:          2
+*ispell*options.defaultDistance:       2
+*ispell*dict.highlightThickness:       0
+*ispell*dict.justify:                  left
+*ispell*dict.resizable:                        False
+*ispell*dict.leftBitmap:               menu12
+*ispell*dict.label:                    Dictionary
+*ispell*dict.tip:                      Change dictionary
+*ispell*options.format.width:          65
+*ispell*format.highlightThickness:     0
+*ispell*format.justify:                        left
+*ispell*format.resizable:              False
+*ispell*format.leftBitmap:             menu12
+*ispell*format.fromHoriz:              dict
+*ispell*format.horizDistance:          0
+*ispell*format.tip:                    Select text type
+
+*columns.minWidth:                     140
+*columns.minHeight:                    76
+*columns.maxWidth:                     140
+*columns.maxHeight:                    76
+*columns.form*defaultDistance:         4
+*columns*left:                         chainLeft
+*columns*right:                                chainLeft
+*columns*top:                          chainTop
+*columns*bottom:                       chainTop
+*columns*Label.width:                  96
+*columns*Label.borderWidth:            0
+*columns*Label.internalHeight:         4
+*columns*Label.internalWidth:          2
+*columns*Label.justify:                        right
+*columns*Text.width:                   30
+*columns*Command.width:                        58
+*columns*leftLabel.label:              Left Column:
+*columns*left.fromHoriz:               leftLabel
+*columns*rightLabel.label:             Right Column:
+*columns*rightLabel.fromVert:          leftLabel
+*columns*right.fromHoriz:              rightLabel
+*columns*right.fromVert:               left
+*columns*ok.fromVert:                  rightLabel
+*columns*cancel.fromHoriz:             ok
+*columns*cancel.fromVert:              rightLabel
+*columns*cancel.horizDistance:         12
+*columns*Text.?.pieceSize:             8
+
+*columns*Text.translations: #override \
+c<Key>S:       no-op(r)\n\
+c<Key>R:       no-op(r)\n\
+m<Key>I:       no-op(r)\n\
+<Key>Return:   set-columns(ok)\n\
+<Key>Tab:      change-field()\n\
+c<Key>G:       set-columns(cancel)\n\
+<Key>Escape:   set-columns(cancel)\n\
+<Enter>:       no-op()\n\
+<Leave>:       no-op()\n\
+<Btn1Down>:    set-keyboard-focus() select-start()
+
+*columns.translations: #override \
+<Message>WM_PROTOCOLS: set-columns(cancel)
+
+! EOF.
diff --git a/xedit/app-defaults/Xedit-sample b/xedit/app-defaults/Xedit-sample
new file mode 100644 (file)
index 0000000..cd4786a
--- /dev/null
@@ -0,0 +1,233 @@
+! $XFree86: xc/programs/xedit/Xedit-sample,v 1.7 1999/06/06 08:49:13 dawes Exp $
+
+Xedit*insertFile*text.width:           150
+Xedit*search*searchText.width:         192
+Xedit*search*replaceText.width:                192
+Xedit*search*case.horizDistance:       14
+Xedit*Text.autoFill:                   false
+Xedit*cursorColor:                     red
+Xedit.geometry:                                600x400
+Xedit*font:                            -*-courier-bold-r-*-*-12-*-*-*-*-*-*-1
+Xedit*Text.?.font:                     -*-courier-medium-r-*-*-12-*-*-*-*-*-*-1
+Xedit*Text.rightMargin:                        0
+Xedit*filename.backgroundPixmap:       gradient:vertical?dimension=3&start=rgb:e/d/d&end=rgb:f/e/e
+Xedit*filename.topMargin:              3
+Xedit*messageWindow.backgroundPixmap:  gradient:vertical?dimension=3&start=rgb:e/d/d&end=rgb:f/e/e
+Xedit*editWindow.backgroundPixmap:     gradient:vertical?dimension=3&start=rgb:e/d/d&end=rgb:f/e/e
+Xedit*editWindow.wrap:                 Never
+Xedit*formWindow*font:                 -*-courier-bold-r-*-*-12-*-*-*-*-*-*-1
+Xedit*formWindow*background:           rgb:9/0/2
+Xedit*formWindow*foreground:           rgb:d/c/8
+Xedit*formWindow*backgroundPixmap:     XtUnspecifiedPixmap
+Xedit*formWindow.displayList:\
+foreground     rgb:3/0/1;\
+draw-lines     +1,-1,-1,-1,-1,+1;\
+foreground     rgb:d/0/3;\
+draw-lines     -1,+0,+0,+0,+0,-1;\
+foreground     rgb:b/2/3;\
+draw-lines     +2,-2,-2,-2,-2,+2;\
+foreground     rgb:8/0/1;\
+draw-lines     -2,+1,+1,+1,+1,-2
+Xedit*bc_label.background:             rgb:9/0/2
+Xedit*bc_label.foreground:             rgb:d/c/8
+Xedit*bc_label.displayList:\
+foreground     rgb:3/0/1;\
+draw-lines     +1,-1,-1,-1,-1,+1;\
+foreground     rgb:d/0/3;\
+draw-lines     -1,+0,+0,+0,+0,-1;\
+foreground     rgb:b/2/3;\
+draw-lines     +2,-2,-2,-2,-2,+2;\
+foreground     rgb:8/0/1;\
+draw-lines     -2,+1,+1,+1,+1,-2
+Xedit*Scrollbar.background:            rgb:e/c/c
+Xedit*Scrollbar.foreground:            rgb:a/7/7
+Xedit*Scrollbar.borderColor:           rgb:9/8/8
+Xedit*vScrollbar.thumb:                        hlines2
+Xedit*hScrollbar.thumb:                        vlines2
+Xedit*Scrollbar.width:                 12
+Xedit*Scrollbar.height:                        12
+Xedit*Scrollbar.backgroundPixmap:      gray3?background=rgb:c/a/a&foreground=rgb:d/b/b
+Xedit*Scrollbar.displayList:\
+foreground     rgb:7/4/4;\
+draw-lines     +0,-1,-1,-1,-1,+0;\
+foreground     rgb:4/2/2;\
+draw-lines     -2,+0,+0,+0,+0,-2
+Xedit*Paned.internalBorderColor:       rgb:9/8/8
+Xedit*buttons.internalBorderColor:     rgb:8/7/7
+Xedit*Grip.width:                      10
+Xedit*Grip.height:                     10
+Xedit*Grip.foreground:                 IndianRed3
+Xedit*Grip.displayList:\
+foreground     IndianRed1;\
+draw-rect      +0,+0,-2,-2;\
+foreground     IndianRed4;\
+draw-lines     +1,-1,-1,-1,-1,+1
+Xedit*Command.internalWidth:           8
+Xedit*Command.internalHeight:          2
+Xedit*Command.borderWidth:             0
+Xedit*Command.background:              rgb:9/0/2
+Xedit*Command.foreground:              rgb:d/c/8
+Xedit*Command.highlightThickness:      0
+Xedit*Command.displayList:\
+foreground     rgb:3/0/1;\
+draw-lines     +1,-1,-1,-1,-1,+1;\
+foreground     rgb:d/0/3;\
+draw-lines     -1,+0,+0,+0,+0,-1;\
+foreground     rgb:b/2/3;\
+draw-lines     +2,-2,-2,-2,-2,+2;\
+foreground     rgb:8/0/1;\
+draw-lines     -2,+1,+1,+1,+1,-2
+Xedit*Toggle.borderWidth:              1
+Xedit*Toggle.borderColor:              rgb:a/9/9
+Xedit*Toggle.background:               rgb:f/e/e
+Xedit*Toggle.foreground:               rgb:9/0/2
+Xedit*Toggle.highlightThickness:       1
+Xedit*Toggle.internalWidth:            10
+Xedit*Toggle.internalHeight:           2
+Xedit*Toggle.justify:                  left
+Xedit*Toggle.displayList:\
+foreground     rgb:6/0/1;\
+draw-lines     +2,-2,-2,-2,-2,+2;\
+foreground     rgb:d/2/3;\
+draw-lines     -2,+1,+1,+1,+1,-2
+Xedit*Form.background:                 rgb:f/e/e
+Xedit*Form.Label.background:           rgb:f/e/e
+Xedit*Form.backgroundPixmap:           gradient:vertical?dimension=3&start=rgb:e/d/d&end=rgb:f/e/e
+Xedit*Form.Label.backgroundPixmap:     ParentRelative
+Xedit*Form*Text.backgroundPixmap:      gradient:vertical?dimension=3&start=rgb:dc/cc/cc&end=rgb:ec/dc/dc
+Xedit*Form.Text.leftMargin:            5
+Xedit*Form.Text.rightMargin:           4
+Xedit*Form.Text.topMargin:             2
+Xedit*Form.Text.bottomMargin:          2
+Xedit*Form.Text.borderWidth:           2
+Xedit*Form.Text.borderColor:           rgb:9/0/2
+Xedit*Form.Text.displayList:\
+foreground     gray50;\
+draw-lines     -1,+0,+0,+0,+0,-1;\
+foreground     gray80;\
+draw-rect      +1,+1,-1,-1
+Xedit*Form.Label.font:                 fixed
+Xedit*Form.Command.internalWidth:      8
+Xedit*Form.Command.internalHeight:     4
+Xedit*Form.Command.borderWidth:                0
+Xedit*Form.Command.background:         rgb:9/0/2
+Xedit*Form.Command.foreground:         rgb:d/c/8
+Xedit*Form.Command.highlightThickness: 0
+Xedit*Form.Command.displayList:\
+foreground     rgb:3/0/1;\
+draw-lines     +2,-2,-2,-2,-2,+2;\
+foreground     rgb:d/0/3;\
+draw-lines     -2,+1,+1,+1,+1,-2;\
+foreground     rgb:b/2/3;\
+draw-lines     +3,-3,-3,-3,-3,+3;\
+foreground     rgb:8/0/1;\
+draw-lines     -3,+2,+2,+2,+2,-3;\
+foreground     rgb:9/8/8;\
+draw-lines     +2,-1,-1,-1,-1,+2;\
+foreground     rgb:f/e/e;\
+draw-lines     -1,+1,-1,+0,+0,+0,+0,-1,+1,-1
+Xedit*SimpleMenu.displayList:\
+foreground     rgb:3/0/1;\
+draw-lines     +1,-1,-1,-1,-1,+1;\
+foreground     rgb:d/0/3;\
+draw-lines     -1,+0,+0,+0,+0,-1;\
+foreground     rgb:b/2/3;\
+draw-lines     +2,-2,-2,-2,-2,+2;\
+foreground     rgb:8/0/1;\
+draw-lines     -2,+1,+1,+1,+1,-2;\
+foreground     rgb:a/1/3;\
+fill-rect      +3,+4,-4,+22;\
+foreground     rgb:b/a/6;\
+draw-line      +4,+4,-5,+4;\
+draw-line      +4,+22,-5,+22
+Xedit*SimpleMenu.VerticalMargins:      2
+Xedit*SimpleMenu.HorizontalMargins:    2
+Xedit*SimpleMenu.borderWidth:          0
+Xedit*SimpleMenu.?.foreground:         rgb:d/c/8
+Xedit*SimpleMenu.background:           rgb:9/0/2
+Xedit*dirlabel*font:                   -*-courier-bold-r-*-*-12-*-*-*-*-*-*-1
+Xedit*dirlabel*background:             rgb:9/0/2
+Xedit*dirlabel*foreground:             rgb:d/c/8
+Xedit*dirlabel*backgroundPixmap:       XtUnspecifiedPixmap
+Xedit*dirlabel.displayList:\
+foreground     rgb:3/0/1;\
+draw-lines     +1,-1,-1,-1,-1,+1;\
+foreground     rgb:d/0/3;\
+draw-lines     -1,+0,+0,+0,+0,-1;\
+foreground     rgb:b/2/3;\
+draw-lines     +2,-2,-2,-2,-2,+2;\
+foreground     rgb:8/0/1;\
+draw-lines     -2,+1,+1,+1,+1,-2
+Xedit*dirwindow*font:                  -*-courier-bold-r-*-*-12-*-*-*-*-*-*-1
+Xedit*dirwindow*foreground:            rgb:9/0/2
+Xedit*dirwindow.backgroundPixmap:      gradient:vertical?dimension=3&start=rgb:e/d/d&end=rgb:f/e/e
+Xedit*viewport*Scrollbar.thumb:                hlines2
+Xedit*ispell*text.width:               192
+Xedit*ispell.form.defaultDistance:     4
+Xedit*ispell*commands.Command.vertDistance:    0
+Xedit*ispell*commands.Command.height:  22
+Xedit*ispell*commands.check.vertDistance:      3
+Xedit*ispell*commands.look.vertDistance:       3
+Xedit*ispell*replaceAll.width:         39
+Xedit*ispell*ignoreAll.width:          39
+Xedit*ispell*check.width:              54
+Xedit*ispell*look.width:               50
+Xedit*ispell*undo.width:               104
+Xedit*ispell*add.width:                        52
+Xedit*ispell*addUncap.width:           52
+Xedit*ispell*suspend.width:            60
+Xedit*ispell*suspend.internalWidth:    0
+Xedit*ispell*cancel.width:             44
+Xedit*ispell*cancel.internalWidth:     0
+Xedit*ispell*terse.width:              101
+Xedit*ispell*terse.height:             18
+Xedit*ispell*terse.vertDistance:       2
+Xedit*ispell*replace.internalWidth:    0
+Xedit*ispell*viewport.height:          139
+Xedit*ispell*list.foreground:          rgb:9/0/2
+Xedit*ispell*list.backgroundPixmap:    gradient:vertical?dimension=3&start=rgb:e/d/d&end=rgb:f/e/e
+Xedit*ispell*borderColor:              rgb:9/0/2
+Xedit*ispell*word.font:                        -*-courier-medium-r-*-*-12-*-*-*-*-*-*-1
+Xedit*ispell*word.displayList:
+Xedit*ispell*word.foreground:          black
+Xedit*ispell*word.background:          rgb:f/e/e
+Xedit*ispell*word.borderWidth:         1
+Xedit*ispell*word.height:              18
+Xedit*SimpleMenu.SimpleMenu.displayList:\
+foreground     rgb:3/0/1;\
+draw-lines     +1,-1,-1,-1,-1,+1;\
+foreground     rgb:d/0/3;\
+draw-lines     -1,+0,+0,+0,+0,-1;\
+foreground     rgb:b/2/3;\
+draw-lines     +2,-2,-2,-2,-2,+2;\
+foreground     rgb:8/0/1;\
+draw-lines     -2,+1,+1,+1,+1,-2
+Xedit*columns*Label.width:             84
+Xedit*columns.minWidth:                        130
+Xedit*columns.minHeight:               80
+Xedit*columns.maxWidth:                        130
+Xedit*columns.maxHeight:               80
+Xedit*columns*cancel.horizDistance:    6
+Xedit*ispell*SimpleMenu.displayList:\
+foreground     rgb:3/0/1;\
+draw-lines     +1,-1,-1,-1,-1,+1;\
+foreground     rgb:d/0/3;\
+draw-lines     -1,+0,+0,+0,+0,-1;\
+foreground     rgb:b/2/3;\
+draw-lines     +2,-2,-2,-2,-2,+2;\
+foreground     rgb:8/0/1;\
+draw-lines     -2,+1,+1,+1,+1,-2
+Xedit*ispell*MenuButton.borderColor:           rgb:f/e/e
+Xedit*ispell*MenuButton.background:            rgb:9/0/2
+Xedit*ispell*MenuButton.foreground:            rgb:d/c/8
+Xedit*ispell*MenuButton.highlightThickness:    0
+Xedit*ispell*MenuButton.displayList:\
+foreground     rgb:3/0/1;\
+draw-lines     +1,-1,-1,-1,-1,+1;\
+foreground     rgb:d/0/3;\
+draw-lines     -1,+0,+0,+0,+0,-1;\
+foreground     rgb:b/2/3;\
+draw-lines     +2,-2,-2,-2,-2,+2;\
+foreground     rgb:8/0/1;\
+draw-lines     -2,+1,+1,+1,+1,-2
+Xedit*tip.background:  yellow
diff --git a/xedit/app-defaults/Xedit-xprint.ad b/xedit/app-defaults/Xedit-xprint.ad
new file mode 100644 (file)
index 0000000..34ed4e9
--- /dev/null
@@ -0,0 +1,565 @@
+! $XFree86: xc/programs/xedit/Xedit.ad,v 1.23 2002/09/22 07:09:05 paulo Exp $
+
+*geometry:                             590x440
+*input:                                        TRUE
+*enableBackups:                                True
+*backupNameSuffix:                     ~
+*changedBitmap:                                xlogo11
+*international:                         True
+
+*hints:\
+Use Control-S and Control-R to Search.\n\
+Use Control-Shift-_ to Undo. Control-G to switch between Undo and Redo.\n\
+Use Control-A to jump to the beginning of the line.\n\
+Use Control-E to jump to the end of the line.\n\
+Use Control-T to transpose characters.\n\
+Use Control-K to cut to the end of the line. Control-Y to paste.\n\
+Use Control-Q to escape control characters.\n\
+Use Control-U[,<number>] to multiply actions. Control-G to cancel.\n\
+Use Control-Z to scroll one line up. Meta-Z to scroll one line down.\n\
+Use Meta-Q to format a paragraph.\n\
+Use Right-Button to extend selections.\n\
+Use Meta-I to insert a file.\n\
+Use Control-W to delete a selection, and/or jump to the selection mark.\n\
+Use Control-X,Control-F to find a file. Tab for filename completion.\n\
+Use Control-X,Control-S to save.\n\
+Use Control-X,Control-C to exit.\n\
+Use Control-C to paste the selection at CUT_BUFFER0.\n\
+Use Control Left-Button to popup the File Menu.\n\
+Use Control Middle-Button to popup the Edit Menu.\n\
+Use Control Right-Button to popup the Option Menu.\n\
+Use Control-X,Tab to Indent.\n\
+Use Control-X,0 to delete current splitted window.\n\
+Use Control-X,1 to delete other splitted window.\n\
+Use Control-X,2 to split the window vertically.\n\
+Use Control-X,3 to split the window horizontally.\n\
+Use Control-X,b to switch to another file.\n\
+Use Control-X,d to list directory. Control-G to Cancel.\n\
+Use Control-X,k to close file being edited.\n\
+Use Control-X,o to switch to another splitted window.\n\
+Use Control-X,u to undo. Control-G to switch between Undo and Redo.\n\
+Use Insert to toggle Overwrite mode.\n\
+Use Control-G to interrupt the lisp subprocess
+
+*formWindow*defaultDistance:           2
+*formWindow.?.borderWidth:             0
+*formWindow.min:                       18
+*formWindow.max:                       18
+*formWindow.showGrip:                  False
+*positionWindow.fromHoriz:             labelWindow
+*positionWindow.horizDistance:         0
+*positionWindow.left:                  chainRight
+*positionWindow.right:                 chainRight
+*positionWindow.width:                 90
+*positionWindow.label:                 error
+*positionWindow.justify:               left
+*labelWindow*justify:                  center
+*labelWindow*label:                    no file yet
+*labelWindow.left:                     chainLeft
+*labelWindow.right:                    chainRight
+
+*quit.label:                           Quit
+*quit.tip:                             Close xedit window
+*save.label:                           Save
+*save.tip:                             Save current file
+*load.label:                           Load
+*load.tip:                             Load a new file
+*print.label:                          Print
+*print.tip:                            Print current file
+
+*buttons*orientation:                  horizontal
+*buttons*showGrip:                     False
+*buttons.min:                          18
+
+*messageWindow.height:                 70
+*messageWindow.min:                    18
+*Paned*Text*allowResize:               True
+
+*messageWindow.autoFill:               False
+*messageWindow.scrollVertical:         Never
+
+*editWindow.autoFill:                  False
+*editWindow.scrollVertical:            Always
+*editWindow.showGrip:                  True
+xedit.textSource*enableUndo:           True
+
+*bc_label*label:                       Use Control-S and Control-R to Search.
+*bc_label*showGrip:                    False
+*bc_label.min:                         18
+
+*dirlabel.showGrip:                    False
+*dirlabel.min:                         18
+*dirlabel.max:                         18
+
+*dirwindow.defaultColumns:             0
+*dirwindow.verticalList:               True
+
+*viewport.forceBars:                   True
+*viewport.allowVert:                   1
+
+*insertFile*text.width:                        141
+*insertFile*text.?.pieceSize:          256
+*search*searchText.width:              157
+*search*replaceText.width:             157
+*search*case.horizDistance:            25
+*search*Text.?.pieceSize:              256
+
+*SimpleMenu.BackingStore:              NotUseful
+*SimpleMenu.menuLabel.vertSpace:       80
+*SimpleMenu.SmeBSB.HorizontalMargins:  16
+*SimpleMenu.justify:                   center
+*SimpleMenu.menuLabel.height:          250
+*SimpleMenu*cursor:                    left_ptr
+
+*fileMenu.label:                       File Menu
+*optionsMenu.label:                    Option Menu
+*optionsMenu.ispell.label:             ispell...
+*editMenu.label:                       Edit Menu
+*editMenu.wrapMenuItem.label:          Wrapping
+*editMenu.wrapMenuItem.leftBitmap:     menu12
+*wrapMenu.never.label:                 Never
+*wrapMenu.line.label:                  Line
+*wrapMenu.word.label:                  Word
+*editMenu.autoFill.label:              Auto Fill
+*editMenu.justifyMenuItem.label:       Justification
+*editMenu.justifyMenuItem.leftBitmap:  menu12
+*justifyMenu.left.label:               Left
+*justifyMenu.right.label:              Right
+*justifyMenu.center.label:             Center
+*justifyMenu.full.label:               Full
+*editMenu.breakColumns.label:          Break Columns...
+*editMenu.scrollMenuItem.label:                Scrollbars
+*editMenu.scrollMenuItem.leftBitmap:   menu12
+*scrollMenu.vertical.label:            Vertical
+*scrollMenu.horizontal.label:          Horizontal
+*editMenu.modeMenuItem.leftBitmap:     menu12
+*editMenu.modeMenuItem.label:          Edit Mode
+*editModes.none.label:                 Plain/None
+
+*TransientShell*Text.translations: #override \
+c<Key>S:       no-op(r)\n\
+c<Key>R:       no-op(r)\n\
+m<Key>I:       no-op(r)
+
+*search.translations: #override \
+<Create>:get-values(my, $w, width, $h, height)\
+       set-values(1, minWidth, $w, minHeight, $h, maxHeight, $h, allowShellResize, False)
+
+*insertFile.title:                     Insert File
+*insertFile.translations: #override \
+<Create>:get-values(my, $w, width, $h, height)\
+       set-values(1, minWidth, $w, minHeight, $h, maxHeight, $h, allowShellResize, False)
+
+*baseTranslations: #override \
+<Ctrl>X,<Ctrl>C:quit()\n\
+<Ctrl>X,<Ctrl>S:save-file()\n\
+<Ctrl>X,<Ctrl>P:print-file()\n\
+<Ctrl>X,<Ctrl>F:find-file()\n\
+<Key>Escape:   line-edit()
+
+*messageWindow.Translations: #override \
+<Ctrl>X,<Ctrl>C:quit()\n\
+<Ctrl>X,<Ctrl>S:save-file()\n\
+<Ctrl>X,<Ctrl>P:print-file()\n\
+<Ctrl>X,<Ctrl>F:find-file()\n\
+<Enter>:       no-op()\n\
+<Leave>:       no-op()\n\
+<Btn1Down>:    set-keyboard-focus() select-start()
+
+*searchText.Translations: #override \
+<Enter>:       no-op()\n\
+<Leave>:       no-op()\n\
+<Btn1Down>:    set-keyboard-focus() select-start()
+
+*replaceText.Translations: #override \
+<Enter>:       no-op()\n\
+<Leave>:       no-op()\n\
+<Btn1Down>:    set-keyboard-focus() select-start()
+
+*editWindow.translations: #override \
+<Ctrl>X,<Ctrl>E:lisp-eval()\n\
+<Ctrl>X,<Key>Tab:indent()\n\
+<Ctrl>X,:<Key>0:delete-window(current)\n\
+<Ctrl>X,:<Key>1:delete-window(other)\n\
+<Ctrl>X,:<Key>2:split-window(vertical)\n\
+<Ctrl>X,:<Key>3:split-window(horizontal)\n\
+<Ctrl>X,!l @Num_Lock<Key>b:switch-source()\n\
+<Ctrl>X,!l <Key>b:switch-source()\n\
+<Ctrl>X,!@Num_Lock<Key>b:switch-source()\n\
+<Ctrl>X,!<Key>b:switch-source()\n\
+<Ctrl>X,!l @Num_Lock<Key>d:dir-window()\n\
+<Ctrl>X,!l <Key>d:dir-window()\n\
+<Ctrl>X,!@Num_Lock<Key>d:dir-window()\n\
+<Ctrl>X,!<Key>d:dir-window()\n\
+<Ctrl>X,!l @Num_Lock<Key>k:kill-file()\n\
+<Ctrl>X,!l <Key>k:kill-file()\n\
+<Ctrl>X,!@Num_Lock<Key>k:kill-file()\n\
+<Ctrl>X,!<Key>k:kill-file()\n\
+<Ctrl>X,!l @Num_Lock<Key>o:other-window()\n\
+<Ctrl>X,!l <Key>o:other-window()\n\
+<Ctrl>X,!@Num_Lock<Key>o:other-window()\n\
+<Ctrl>X,!<Key>o:other-window()\n\
+<Ctrl>X,!l @Num_Lock<Key>u:undo()\n\
+<Ctrl>X,!l <Key>u:undo()\n\
+<Ctrl>X,!@Num_Lock<Key>u:undo()\n\
+<Ctrl>X,!<Key>u:undo()\n\
+<Ctrl>G:       xedit-keyboard-reset()\n\
+<Ctrl>J:       xedit-print-lisp-eval()\n\
+<Key>Tab:      insert-char()\n\
+!l @Num_Lock<Key>b:insert-char()\n\
+!l <Key>b:     insert-char()\n\
+!@Num_Lock<Key>b:insert-char()\n\
+!<Key>b:       insert-char()\n\
+!l @Num_Lock<Key>d:insert-char()\n\
+!l <Key>d:     insert-char()\n\
+!@Num_Lock<Key>d:insert-char()\n\
+!<Key>d:       insert-char()\n\
+!l <Key>k:     insert-char()\n\
+!l @Num_Lock<Key>k:insert-char()\n\
+!@Num_Lock<Key>k:insert-char()\n\
+!<Key>k:       insert-char()\n\
+!l @Num_Lock<Key>o:insert-char()\n\
+!l <Key>o:     insert-char()\n\
+!@Num_Lock<Key>o:insert-char()\n\
+!<Key>o:       insert-char()\n\
+!l @Num_Lock<Key>u:insert-char()\n\
+!l <Key>u:     insert-char()\n\
+!@Num_Lock<Key>u:insert-char()\n\
+!<Key>u:       insert-char()\n\
+~s <Key>Insert:        toggle-overwrite()\n\
+c l @Num_Lock<Btn1Down>:xedit-focus() popup-menu(fileMenu)\n\
+c @Num_Lock<Btn1Down>:xedit-focus() popup-menu(fileMenu)\n\
+c l<Btn1Down>: xedit-focus() popup-menu(fileMenu)\n\
+c<Btn1Down>:   xedit-focus() popup-menu(fileMenu)\n\
+c l @Num_Lock<Btn2Down>:xedit-focus() popup-menu(editMenu)\n\
+c @Num_Lock<Btn2Down>:xedit-focus() popup-menu(editMenu)\n\
+c l<Btn2Down>: xedit-focus() popup-menu(editMenu)\n\
+c<Btn2Down>:   xedit-focus() popup-menu(editMenu)\n\
+c l @Num_Lock<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\
+c @Num_Lock<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\
+c l<Btn3Down>:xedit-focus() popup-menu(optionsMenu)\n\
+c<Btn3Down>:   xedit-focus() popup-menu(optionsMenu)\n\
+<Btn1Down>:    xedit-focus() select-start()\n\
+<Btn4Down>:    scroll-one-line-down()\n\
+<Btn5Down>:    scroll-one-line-up()
+
+*filename.?.pieceSize:                 256
+*filename.translations: #override \
+c<Key>S:       no-op(r)\n\
+c<Key>R:       no-op(r)\n\
+m<Key>I:       no-op(r)\n\
+c<Key>G:       cancel-find-file()\n\
+<Key>Return:   load-file()\n\
+<Key>Tab:      file-completion(h)\n\
+<Key>Escape:   cancel-find-file()\n\
+<Enter>:       no-op()\n\
+<Leave>:       no-op()\n\
+<Btn1Down>:    set-keyboard-focus() select-start()
+
+*ispell.translations:  #override \
+<Message>WM_PROTOCOLS: ispell(end)
+
+! Sample dictionary, word chars and text mode resources setup
+!*ispell.dictionary:                   br
+!*ispell.dictionaries:                 br american americanmed+ english
+!*ispell*br.wordChars:                 áéíóúçÁÉÍÓÚÇàÀâêôÂÊÔüÜãõÃÕ-
+*ispell.ispellCommand:                 /usr/bin/aspell -B -m
+*ispell.lookCommand:                   /bin/egrep
+!*ispell*text.skipLines:               .#
+
+*ispell.geometry:                      0x0
+*ispell.minWidth:                      320
+*ispell.minHeight:                     245
+*ispell*Label.borderWidth:             0
+*ispell*Label.internalHeight:          4
+*ispell*Label.justify:                 right
+*ispell*Label.width:                   112
+*ispell*Label.left:                    chainLeft
+*ispell*Label.right:                   chainLeft
+*ispell*Label.top:                     chainTop
+*ispell*Label.bottom:                  chainTop
+*ispell*mispelled.label:               Misspelled word:
+*ispell*mispelled.top:                 chainTop
+*ispell*mispelled.bottom:              chainTop
+*ispell*mispelled.internalWidth:       0
+*ispell*repeated.label:                        Repeated words:
+*ispell*repeated.internalWidth:                0
+*ispell*replacement.label:             Replace with:
+*ispell*word.fromHoriz:                        mispelled
+*ispell*word.justify:                  left
+*ispell*word.borderWidth:              1
+*ispell*word.internalWidth:            4
+*ispell*word.internalHeight:           3
+*ispell*word.width:                    194
+*ispell*word.left:                     chainLeft
+*ispell*word.right:                    chainRight
+*ispell*word.top:                      chainTop
+*ispell*word.bottom:                   chainTop
+*ispell*word.label:
+*ispell*word.tip:                      Press here to select this text
+*ispell*word.highlightThickness:       0
+*ispell*text.fromHoriz:                        replacement
+*ispell*replacement.fromVert:          mispelled
+*ispell*replacement.internalWidth:     0
+*ispell*form.text.fromVert:            word
+*ispell*form.text.width:               194
+*ispell*form.text.top:                 chainTop
+*ispell*form.text.bottom:              chainTop
+*ispell*form.text.left:                        chainLeft
+*ispell*form.text.right:               chainRight
+*ispell*form.text.leftMargin:          4
+*ispell*form.text.?.pieceSize:         256
+*ispell*suggestions.label:             Suggestions:
+*ispell*suggestions.fromVert:          replacement
+*ispell*suggestions.internalWidth:     0
+*ispell*viewport.fromHoriz:            suggestions
+*ispell*viewport.fromVert:             text
+*ispell*viewport.width:                        194
+*ispell*viewport.height:               143
+*ispell*viewport.top:                  chainTop
+*ispell*viewport.bottom:               chainBottom
+*ispell*viewport.left:                 chainLeft
+*ispell*viewport.right:                        chainRight
+*ispell*viewport.forceBars:            1
+*ispell*viewport.allowVert:            1
+*ispell*list.defaultColumns:           1
+*ispell*list.longest:                  16384
+*ispell*commands.vertDistance:         5
+*ispell*commands.fromVert:             suggestions
+*ispell*commands.top:                  chainBottom
+*ispell*commands.bottom:               chainBottom
+*ispell*commands.right:                        chainLeft
+*ispell*commands.left:                 chainLeft
+*ispell*check.label:                   Check
+*ispell*check.width:                   54
+*ispell*check.tip:                     Ask ispell about the word in the text field
+*ispell*look.label:                    Look
+*ispell*look.fromHoriz:                        check
+*ispell*look.horizDistance:            0
+*ispell*look.width:                    46
+*ispell*look.tip:                      Runs the look command
+*ispell*undo.fromVert:                 check
+*ispell*undo.label:                    Undo
+*ispell*undo.width:                    102
+*ispell*undo.tip:                      Undo last action
+*ispell*replace.fromVert:              undo
+*ispell*replace.label:                 Replace
+*ispell*replace.tip:                   Replace occurence of the word
+*ispell*replaceAll.fromVert:           undo
+*ispell*replaceAll.fromHoriz:          replace
+*ispell*replaceAll.label:              All
+*ispell*replaceAll.tip:                        Replace all occurences of the word
+*ispell*ignore.fromVert:               replace
+*ispell*ignore.label:                  Ignore
+*ispell*ignore.tip:                    Ignore this word
+*ispell*ignoreAll.fromVert:            replaceAll
+*ispell*ignoreAll.fromHoriz:           ignore
+*ispell*ignoreAll.label:               All
+*ispell*ignoreAll.tip:                 Ignore all ocurrences of the word
+*ispell*add.fromVert:                  ignore
+*ispell*add.label:                     Add
+*ispell*add.width:                     50
+*ispell*add.tip:                       Add word to your private dictionary
+*ispell*addUncap.fromVert:             ignoreAll
+*ispell*addUncap.fromHoriz:            add
+*ispell*addUncap.label:                        Uncap
+*ispell*addUncap.horizDistance:                0
+*ispell*addUncap.width:                        50
+*ispell*addUncap.tip:                  Add word uncapitalized, to your private dictionary
+*ispell*suspend.fromVert:              add
+*ispell*suspend.label:                 Suspend
+*ispell*suspend.width:                 57
+*ispell*suspend.tip:                   Suspend ispell execution
+*ispell*cancel.fromHoriz:              suspend
+*ispell*cancel.fromVert:               addUncap
+*ispell*cancel.label:                  Close
+*ispell*cancel.width:                  43
+*ispell*cancel.horizDistance:          0
+*ispell*cancel.tip:                    Terminates ispell process
+*ispell*replace.width:                 65
+*ispell*ignore.width:                  65
+*ispell*replaceAll.width:              35
+*ispell*replaceAll.horizDistance:      0
+*ispell*ignoreAll.width:               35
+*ispell*ignoreAll.horizDistance:       0
+*ispell*terse.fromVert:                        cancel
+*ispell*terse.Label:                   Terse Mode
+*ispell*terse.width:                   104
+*ispell*terse.borderWidth:             0
+*ispell*terse.tip:                     Switch terse mode
+*ispell*status.fromVert:               viewport
+*ispell*status.fromHoriz:              suggestions
+*ispell*status.top:                    chainBottom
+*ispell*status.bottom:                 chainBottom
+*ispell*status.left:                   chainLeft
+*ispell*status.right:                  chainRight
+*ispell*status.width:                  194
+*ispell*status.borderWidth:            1
+*ispell*status.justify:                        left
+*ispell*status.internalHeight:         2
+*ispell*status.vertDistance:           2
+*ispell*options.fromVert:              status
+*ispell*options.fromHoriz:             commands
+*ispell*options.bottom:                        chainBottom
+*ispell*options.top:                   chainBottom
+*ispell*options.left:                  chainLeft
+*ispell*options.right:                 chainRight
+*ispell*options.dict.width:            121
+*ispell*options.horizDistance:         2
+*ispell*options.vertDistance:          2
+*ispell*options.defaultDistance:       2
+*ispell*dict.highlightThickness:       0
+*ispell*dict.justify:                  left
+*ispell*dict.resizable:                        False
+*ispell*dict.leftBitmap:               menu12
+*ispell*dict.label:                    Dictionary
+*ispell*dict.tip:                      Change dictionary
+*ispell*options.format.width:          65
+*ispell*format.highlightThickness:     0
+*ispell*format.justify:                        left
+*ispell*format.resizable:              False
+*ispell*format.leftBitmap:             menu12
+*ispell*format.fromHoriz:              dict
+*ispell*format.horizDistance:          0
+*ispell*format.tip:                    Select text type
+
+*columns.minWidth:                     140
+*columns.minHeight:                    76
+*columns.maxWidth:                     140
+*columns.maxHeight:                    76
+*columns.form*defaultDistance:         4
+*columns*left:                         chainLeft
+*columns*right:                                chainLeft
+*columns*top:                          chainTop
+*columns*bottom:                       chainTop
+*columns*Label.width:                  96
+*columns*Label.borderWidth:            0
+*columns*Label.internalHeight:         4
+*columns*Label.internalWidth:          2
+*columns*Label.justify:                        right
+*columns*Text.width:                   30
+*columns*Command.width:                        58
+*columns*leftLabel.label:              Left Column:
+*columns*left.fromHoriz:               leftLabel
+*columns*rightLabel.label:             Right Column:
+*columns*rightLabel.fromVert:          leftLabel
+*columns*right.fromHoriz:              rightLabel
+*columns*right.fromVert:               left
+*columns*ok.fromVert:                  rightLabel
+*columns*cancel.fromHoriz:             ok
+*columns*cancel.fromVert:              rightLabel
+*columns*cancel.horizDistance:         12
+*columns*Text.?.pieceSize:             8
+
+*columns*Text.translations: #override \
+c<Key>S:       no-op(r)\n\
+c<Key>R:       no-op(r)\n\
+m<Key>I:       no-op(r)\n\
+<Key>Return:   set-columns(ok)\n\
+<Key>Tab:      change-field()\n\
+c<Key>G:       set-columns(cancel)\n\
+<Key>Escape:   set-columns(cancel)\n\
+<Enter>:       no-op()\n\
+<Leave>:       no-op()\n\
+<Btn1Down>:    set-keyboard-focus() select-start()
+
+*columns.translations: #override \
+<Message>WM_PROTOCOLS: set-columns(cancel)
+
+! Use "white" as background for printing
+*printshell*background:   white
+
+! Print dialog
+*printdialogshell*geometry:                       600x120
+*printdialogshell*title:                          Print
+*printdialogshell*main*ok.fromVert:               innerform
+*printdialogshell*main*ok.label:                  Print
+*printdialogshell*main*ok.tip:                    Print
+*printdialogshell*main*setup.fromHoriz:           ok
+*printdialogshell*main*setup.fromVert:            innerform
+*printdialogshell*main*setup.label:               Setup...
+*printdialogshell*main*setup.tip:                 Configure print job options (page size, orientation, etc.)
+*printdialogshell*main*cancel.fromHoriz:          setup
+*printdialogshell*main*cancel.fromVert:           innerform
+*printdialogshell*main*cancel.label:              Cancel
+*printdialogshell*main*cancel.tip:                Cancel printing
+*printdialogshell*main*desclabel.label:           Printer Description:
+*printdialogshell*main*desclabel.tip:             Short description of printer
+*printdialogshell*main*desc.fromHoriz:            desclabel
+*printdialogshell*main*desc.tip:                  Short description of printer
+*printdialogshell*main*info.fromHoriz:            desc
+*printdialogshell*main*info.label:                Printer info...
+*printdialogshell*main*info.tip:                  Display additional information about this printer
+*printdialogshell*main*namelabel.fromVert:        desclabel
+*printdialogshell*main*namelabel.label:           Printer Name:
+*printdialogshell*main*namelabel.tip:             Name of selected printer
+*printdialogshell*main*name.fromHoriz:            namelabel
+*printdialogshell*main*name.fromVert:             desclabel
+*printdialogshell*main*name.tip:                  Name of selected printer
+*printdialogshell*main*selectprinter.fromHoriz:   name
+*printdialogshell*main*selectprinter.fromVert:    desclabel
+*printdialogshell*main*selectprinter.label:       Select Printer...
+*printdialogshell*main*selectprinter.label:       Select Printer...
+*printdialogshell*main*selectprinter.tip:         Select a different printer
+*printdialogshell*main*filenamelabel.fromVert:    namelabel
+*printdialogshell*main*filenamelabel.label:       File Name:
+*printdialogshell*main*filenamelabel.tip:         File where the output should be stored
+*printdialogshell*main*filename.fromHoriz:        filenamelabel
+*printdialogshell*main*filename.fromVert:         namelabel
+*printdialogshell*main*filename.tip:              File where the output should be stored
+*printdialogshell*main*selectfile.fromHoriz:      filename
+*printdialogshell*main*selectfile.fromVert:       namelabel
+*printdialogshell*main*selectfile.label:          Select File...
+*printdialogshell*main*selectfile.tip:            Select file where the output should be stored
+*printdialogshell*main*printtoprinter.fromVert:   filenamelabel
+*printdialogshell*main*printtoprinter.label:      Print to Printer
+*printdialogshell*main*printtoprinter.tip:        Send print job to printer
+*printdialogshell*main*printtofile.fromVert:      filenamelabel
+*printdialogshell*main*printtofile.fromHoriz:     printtoprinter
+*printdialogshell*main*printtofile.label:         Print to File
+*printdialogshell*main*printtofile.tip:           Save print job in a file
+
+! Print job options dialog
+*printdialogshell*setup*geometry:                     600x400
+*printdialogshell*setup*title:                        Print: Print job options
+*printdialogshell*setup*ok.fromVert:                  list
+*printdialogshell*setup*ok.label:                     OK
+*printdialogshell*setup*ok.tip:                       Commit changes
+*printdialogshell*setup*cancel.fromHoriz:             ok
+*printdialogshell*setup*cancel.fromVert:              list
+*printdialogshell*setup*cancel.label:                 Cancel
+*printdialogshell*setup*cancel.tip:                   Cancel and reset to defaults
+*printdialogshell*setup*paperlist.tip:                Select paper size
+*printdialogshell*setup*resolutionlist.fromHoriz:     paperlist
+*printdialogshell*setup*resolutionlist.tip:           Select page resolution
+*printdialogshell*setup*orientationlist.fromHoriz:    resolutionlist
+*printdialogshell*setup*orientationlist.tip:          Select page orientation
+*printdialogshell*setup*plexlist.fromHoriz:           orientationlist
+*printdialogshell*setup*plexlist.tip:                 Select page plex mode (simplex, duplex, etc.)
+*printdialogshell*setup*colorspacelist.fromHoriz:     plexlist
+*printdialogshell*setup*colorspacelist.tip:           Select color space (color, grayscale, CYMK, etc.)
+*printdialogshell*setup*jobcopieslabel.fromVert:      paperlist
+*printdialogshell*setup*jobcopieslabel.tip:           Set number of job copies
+*printdialogshell*setup*jobcopieslabel.label:         Job Copies:
+*printdialogshell*setup*jobcopies.fromHoriz:          jobcopieslabel
+*printdialogshell*setup*jobcopies.fromVert:           paperlist
+*printdialogshell*setup*jobcopies.tip:                Set number of job copies
+
+! Printer selection
+*printdialogshell*printerselection*geometry:          400x150
+*printdialogshell*printerselection*title:             Print: Select printer
+*printdialogshell*printerselection*ok.fromVert:       list
+*printdialogshell*printerselection*ok.label:          OK
+*printdialogshell*printerselection*ok.tip:            Switch printer
+*printdialogshell*printerselection*cancel.fromHoriz:  ok
+*printdialogshell*printerselection*cancel.fromVert:   list
+*printdialogshell*printerselection*cancel.label:      Cancel
+*printdialogshell*printerselection*cancel.tip:        Cancel printer selection
+*printdialogshell*printerselection*list.tip:          Select printer name from list
+
+! Select job file
+*printdialogshell*selectfile*geometry:          400x80
+*printdialogshell*selectfile*title:             Print: Select job file
+*printdialogshell*selectfile*dialog.label:      Select Filename:
+
+! EOF.
diff --git a/xedit/commands.c b/xedit/commands.c
new file mode 100644 (file)
index 0000000..4461218
--- /dev/null
@@ -0,0 +1,1196 @@
+/* $XConsortium: commands.c,v 1.33 91/10/21 14:32:18 eswu Exp $ */
+
+/*
+ *                       COPYRIGHT 1987
+ *                DIGITAL EQUIPMENT CORPORATION
+ *                    MAYNARD, MASSACHUSETTS
+ *                     ALL RIGHTS RESERVED.
+ *
+ * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
+ * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
+ * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR
+ * ANY PURPOSE.  IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
+ *
+ * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT RIGHTS,
+ * APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN ADDITION TO THAT
+ * SET FORTH ABOVE.
+ *
+ *
+ * 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 Equipment Corporation not be 
+ * used in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission.
+ */
+/* $XFree86: xc/programs/xedit/commands.c,v 1.29tsi Exp $ */
+
+#include <X11/Xfuncs.h>
+#include <X11/Xos.h>
+#include "xedit.h"
+#ifdef INCLUDE_XPRINT_SUPPORT
+#include "printdialog.h"
+#include "print.h"
+#endif /* INCLUDE_XPRINT_SUPPORT */
+#ifdef CRAY
+#include <unistd.h>
+#endif
+#include <stdlib.h>
+#include <stdio.h>
+#include <limits.h>
+#include <string.h>
+#include <dirent.h>
+#include <pwd.h>
+#include <sys/stat.h>
+#include <X11/Xmu/SysUtil.h>
+#include <X11/IntrinsicP.h>
+#include <X11/Xaw/TextSrcP.h>
+
+/* Turn a NULL pointer string into an empty string */
+#define NULLSTR(x) (((x)!=NULL)?(x):(""))
+
+#define Error(x) { printf x ; exit(EXIT_FAILURE); }
+#define Assertion(expr, msg) { if (!(expr)) { Error msg } }
+#define Log(x)   { if (True) printf x; }
+
+#ifdef INCLUDE_XPRINT_SUPPORT
+static Widget printdialog_shell = NULL;
+static Widget printdialog       = NULL;
+static char   printJobNameBuffer[PATH_MAX+256];
+#endif /* INCLUDE_XPRINT_SUPPORT */
+
+void ResetSourceChanged(xedit_flist_item*);
+static void ResetDC(Widget, XtPointer, XtPointer);
+
+static void AddDoubleClickCallback(Widget, Bool);
+static Bool ReallyDoLoad(char*, char*);
+static char *makeBackupName(String, String, unsigned);
+
+/*
+ * External
+ */
+extern void _XawTextShowPosition(TextWidget);
+
+extern Widget scratch, texts[3], labels[3];
+
+#define DC_UNSAVED     (1 << 0)
+#define DC_LOADED      (1 << 1)
+#define DC_CLOBBER     (1 << 2)
+#define DC_KILL                (1 << 3)
+#define DC_SAVE                (1 << 4)
+#define DC_NEWER       (1 << 5)
+static int dc_state;
+
+static void
+AddDoubleClickCallback(Widget w, Bool state)
+{
+    if (state)
+       XtAddCallback(w, XtNcallback, ResetDC, NULL);
+    else
+       XtRemoveCallback(w, XtNcallback, ResetDC, NULL);
+}
+  
+/*     Function Name: ResetDC
+ *     Description: Resets the double click flag.
+ *     Arguments: w - the text widget.
+ *                 junk, garbage - *** NOT USED ***
+ *     Returns: none.
+ */
+
+/* ARGSUSED */
+static void
+ResetDC(Widget w, XtPointer junk, XtPointer garbage)
+{
+    AddDoubleClickCallback(w, FALSE);
+}
+
+/*ARGSUSED*/
+void
+QuitAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    DoQuit(w, NULL, NULL);
+}
+
+/*ARGSUSED*/
+void
+DoQuit(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    unsigned i;
+    Bool source_changed = False;
+
+    if (!(dc_state & DC_UNSAVED)) {
+       for (i = 0; i < flist.num_itens; i++)
+           if (flist.itens[i]->flags & CHANGED_BIT) {
+               source_changed = True;
+               break;
+           }
+    }
+    if (!source_changed) {
+#ifndef __UNIXOS2__
+       XeditLispCleanUp();
+#endif
+       exit(0);
+    }
+
+    XeditPrintf("Unsaved changes. Save them, or Quit again.\n");
+    Feep();
+    dc_state |= DC_UNSAVED;
+    AddDoubleClickCallback(XawTextGetSource(textwindow), True);
+}
+
+static char *
+makeBackupName(String buf, String filename, unsigned len)
+{
+    if (app_resources.backupNamePrefix
+       && strlen(app_resources.backupNamePrefix)) {
+       if (strchr(app_resources.backupNamePrefix, '/'))
+           XmuSnprintf(buf, len, "%s%s%s", app_resources.backupNamePrefix,
+                       filename, app_resources.backupNameSuffix);
+       else {
+           char fname[BUFSIZ];
+           char *name, ch;
+
+           strncpy(fname, filename, sizeof(fname) - 1);
+           fname[sizeof(fname) - 1] = '\0';
+           if ((name = strrchr(fname, '/')) != NULL)
+               ++name;
+           else
+               name = filename;
+           ch = *name;
+           *name = '\0';
+           ++name;
+           XmuSnprintf(buf, len, "%s%s%c%s%s",
+                       fname, app_resources.backupNamePrefix, ch, name,
+                       app_resources.backupNameSuffix);
+       }
+    }
+    else
+       XmuSnprintf(buf, len, "%s%s",
+                   filename, app_resources.backupNameSuffix);
+
+    return (strcmp(filename, buf) ? buf : NULL);
+}
+  
+#if defined(USG) && !defined(CRAY)
+int rename (from, to)
+    char *from, *to;
+{
+    (void) unlink (to);
+    if (link (from, to) == 0) {
+        unlink (from);
+        return 0;
+    } else {
+        return -1;
+    }
+}
+#endif
+
+/*ARGSUSED*/
+void
+SaveFile(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    if (line_edit) {
+       /* Don't try to save buffer with regex string.
+        * Call CancelFindFile() to leave line_edit mode.
+        */
+       XeditPrintf("Save: Leaving line edit mode -- nothing saved.\n");
+       CancelFindFile(w, event, params, num_params);
+       Feep();
+    }
+    else
+       DoSave(w, NULL, NULL);
+}
+
+/*ARGSUSED*/
+void
+DoSave(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    String name = GetString(filenamewindow);
+    String filename = ResolveName(name);
+    FileAccess file_access;
+    xedit_flist_item *item;
+    Boolean exists;
+    Widget source = XawTextGetSource(textwindow);
+    char buffer[BUFSIZ];
+    struct stat st;
+    static char *nothing_saved = " -- nothing saved.\n";
+
+    if (!filename) {
+       XmuSnprintf(buffer, sizeof(buffer), "%s%s",
+                   "Save: Can't resolve pathname",  nothing_saved);
+       goto error;
+    }
+    else if (*name == '\0') {
+       XmuSnprintf(buffer, sizeof(buffer), "%s%s",
+                   "Save: No filename specified", nothing_saved);
+       goto error;
+    }
+
+    item = FindTextSource(NULL, filename);
+    if (item != NULL && item->source != source) {
+       if (!(dc_state & DC_LOADED)) {
+           XmuSnprintf(buffer, sizeof(buffer), "%s%s%s%s",
+                       "Save: file ", name, " is already loaded, "
+                       "Save again to unload it", nothing_saved);
+           Feep();
+           dc_state |= DC_LOADED;
+           AddDoubleClickCallback(XawTextGetSource(textwindow), True);
+           goto error;
+       }
+       else {
+           KillTextSource(item);
+           item = FindTextSource(source = XawTextGetSource(textwindow), NULL);
+           dc_state &= ~DC_LOADED;
+       }
+    }
+    else if (item && !(item->flags & CHANGED_BIT)) {
+       if (!(dc_state & DC_SAVE)) {
+           XmuSnprintf(buffer, sizeof(buffer), "%s%s",
+                       "Save: No changes need to be saved, "
+                       "save again to override", nothing_saved);
+           Feep();
+           dc_state |= DC_SAVE;
+           AddDoubleClickCallback(XawTextGetSource(textwindow), True);
+           goto error;
+       }
+       else
+           dc_state &= ~DC_SAVE;
+    }
+
+    file_access = CheckFilePermissions(filename, &exists);
+    if (exists) {
+       if (stat(filename, &st) != 0) {
+           XmuSnprintf(buffer, sizeof(buffer), "%s%s%s",
+                       "Save: cannot stat ", name, nothing_saved);
+           goto error;
+       }
+       else if (!S_ISREG(st.st_mode)) {
+           XmuSnprintf(buffer, sizeof(buffer), "%s%s%s%s",
+                       "Save: file ", name, "is not a regular file",
+                       nothing_saved);
+           goto error;
+       }
+    }
+
+    if (!item || strcmp(item->filename, filename)) {
+       if (file_access == WRITE_OK && exists) {
+           if (!(dc_state & DC_CLOBBER)) {
+               XmuSnprintf(buffer, sizeof(buffer), "%s%s%s%s",
+                           "Save: file ", name, " already exists, "
+                           "save again to override", nothing_saved);
+               Feep();
+               dc_state |= DC_CLOBBER;
+               AddDoubleClickCallback(XawTextGetSource(textwindow), True);
+               goto error;
+           }
+           else
+               dc_state &= ~DC_CLOBBER;
+       }
+       if (!item)
+           item = FindTextSource(source, NULL);
+    }
+
+    if (item && item->mtime && exists && item->mtime < st.st_mtime) {
+       if (!(dc_state & DC_NEWER)) {
+           XmuSnprintf(buffer, sizeof(buffer), "%s%s",
+                       "Save: Newer file exists, "
+                       "save again to override", nothing_saved);
+           Feep();
+           dc_state |= DC_NEWER;
+           AddDoubleClickCallback(XawTextGetSource(textwindow), True);
+           goto error;
+       }
+       else
+           dc_state &= DC_NEWER;
+    }
+
+    if (app_resources.enableBackups && exists) {
+       char backup_file[BUFSIZ];
+
+       if (makeBackupName(backup_file, filename, sizeof(backup_file)) == NULL
+           || rename(filename, backup_file) != 0) {
+           XeditPrintf("Error backing up file: %s\n", filename);
+       }
+    }
+
+    switch (file_access = MaybeCreateFile(filename)) {
+       case NO_READ:
+       case READ_OK:
+           XeditPrintf("File %s could not be opened for writing.\n", name);
+           Feep();
+           break;
+       case WRITE_OK:
+           if (XawAsciiSaveAsFile(source, filename)) {
+               int i;
+               Arg args[1];
+
+               XmuSnprintf(buffer, sizeof(buffer),
+                           "%s       Read - Write", name);
+               XtSetArg(args[0], XtNlabel, buffer);
+               for (i = 0; i < 3; i++)
+                   if (XawTextGetSource(texts[i]) == source)
+                       XtSetValues(labels[i], args, 1);
+
+               XeditPrintf("Saved file: %s\n", name);
+
+               if (item && item->source != scratch) {
+                   XtSetArg(args[0], XtNlabel, filename);
+                   XtSetValues(item->sme, args, 1);
+
+                   XtSetArg(args[0], XtNeditType, XawtextEdit);
+                   XtSetValues(item->source, args, 1);
+
+                   XtFree(item->name);
+                   XtFree(item->filename);
+                   item->name = XtNewString(name);
+                   item->filename = XtNewString(filename);
+                   item->flags = EXISTS_BIT;
+               }
+               else {
+                   item = flist.itens[0];
+                   XtRemoveCallback(scratch, XtNcallback, SourceChanged,
+                                    (XtPointer)item);
+                   item->source = scratch =
+                   XtVaCreateWidget("textSource", international ?
+                                    multiSrcObjectClass :
+                                    asciiSrcObjectClass,
+                                    topwindow,
+                                    XtNtype, XawAsciiFile,
+                                    XtNeditType, XawtextEdit,
+                                    NULL, NULL);
+                   ResetSourceChanged(item);
+                   XtAddCallback(scratch, XtNcallback, SourceChanged,
+                                 (XtPointer)item);
+
+                   item = AddTextSource(source, name, filename, EXISTS_BIT,
+                                        file_access);
+                   XtAddCallback(item->source, XtNcallback, SourceChanged,
+                                 (XtPointer)item);
+               }
+
+               /* Keep file protection mode */
+               if (item->mode)
+                   chmod(filename, item->mode);
+
+               /* Remember time of last modification */
+               if (stat(filename, &st) == 0)
+                   item->mtime = st.st_mtime;
+
+               item->flags |= EXISTS_BIT;
+               ResetSourceChanged(item);
+           }
+           else {
+               XeditPrintf("Error saving file: %s\n",  name);
+               Feep();
+           }
+           break;
+       default:
+           Feep();
+           break;
+    }
+
+    return;
+error:
+    XeditPrintf("%s", buffer);
+    Feep();
+}
+
+/*ARGSUSED*/
+void
+DoLoad(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    if (ReallyDoLoad(GetString(filenamewindow), ResolveName(NULL))) {
+        SwitchDirWindow(False);
+        XtSetKeyboardFocus(topwindow, textwindow);
+    }
+}
+
+Bool
+LoadFileInTextwindow(char *name, char *resolved_name)
+{
+    return (ReallyDoLoad(name, resolved_name));
+}
+
+static Bool
+ReallyDoLoad(char *name, char *filename)
+{
+    Arg args[5];
+    Cardinal num_args = 0;
+    xedit_flist_item *item;
+    Widget source = XawTextGetSource(textwindow);
+
+    if (!filename) {
+       XeditPrintf("Load: Can't resolve pathname.\n");
+       Feep();
+       return (False);
+    }
+    else if (*name == '\0') {
+       XeditPrintf("Load: No file specified.\n");
+       Feep();
+    }
+    if ((item = FindTextSource(NULL, filename)) != NULL) {
+       SwitchTextSource(item);
+       return (True);
+    }
+    else {
+       struct stat st;
+
+       if (stat(filename, &st) == 0 && !S_ISREG(st.st_mode)) {
+           if (S_ISDIR(st.st_mode)) {
+               char path[BUFSIZ + 1];
+
+               strncpy(path, filename, sizeof(path) - 2);
+               path[sizeof(path) - 2] = '\0';
+               if (*path) {
+                   if (path[strlen(path) - 1] != '/')
+                       strcat(path, "/");
+               }
+               else
+                   strcpy(path, "./");
+               XtSetArg(args[0], XtNlabel, "");
+               XtSetValues(dirlabel, args, 1);
+               SwitchDirWindow(True);
+               DirWindowCB(dirwindow, path, NULL);
+               return (False);
+           }
+       }
+    }
+
+    {
+       Boolean exists;
+       int flags;
+       FileAccess file_access;
+
+       switch( file_access = CheckFilePermissions(filename, &exists) ) {
+       case NO_READ:
+           if (exists)
+               XeditPrintf("File %s, %s", name,
+                           "exists, and could not be opened for reading.\n");
+           else
+               XeditPrintf("File %s %s %s",  name,
+                           "does not exist, and",
+                           "the directory could not be opened for writing.\n");
+
+           Feep();
+           return (False);
+       case READ_OK:
+           XtSetArg(args[num_args], XtNeditType, XawtextRead); num_args++;
+           XeditPrintf("File %s opened READ ONLY.\n", name);
+           break;
+       case WRITE_OK:
+           XtSetArg(args[num_args], XtNeditType, XawtextEdit); num_args++;
+           XeditPrintf("File %s opened read - write.\n", name);
+           break;
+       default:
+           Feep();
+           return (False);
+       }
+
+       if (exists) {
+           flags = EXISTS_BIT;
+           XtSetArg(args[num_args], XtNstring, filename); num_args++;
+       }
+       else {
+           flags = 0;
+           XtSetArg(args[num_args], XtNstring, NULL); num_args++;
+       }
+
+       source = XtVaCreateWidget("textSource", international ?
+                                 multiSrcObjectClass :
+                                 asciiSrcObjectClass,
+                                 topwindow,
+                                 XtNtype, XawAsciiFile,
+                                 XtNeditType, XawtextEdit,
+                                 NULL, NULL);
+       XtSetValues(source, args, num_args);
+
+       item = AddTextSource(source, name, filename, flags, file_access);
+       XtAddCallback(item->source, XtNcallback, SourceChanged,
+                     (XtPointer)item);
+       if (exists && file_access == WRITE_OK) {
+           struct stat st;
+
+           if (stat(item->filename, &st) == 0) {
+               item->mode = st.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
+               item->mtime = st.st_mtime;
+           }
+       }
+       SwitchTextSource(item);
+       ResetSourceChanged(item);
+    }
+
+    return (True);
+}
+
+#ifdef INCLUDE_XPRINT_SUPPORT
+static void
+printshellDestroyXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    XawPrintDialogClosePrinterConnection(printdialog, False);
+}
+
+static void
+printOKXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    XawPrintDialogCallbackStruct *pdcs = (XawPrintDialogCallbackStruct *)callData;
+    Cardinal                      n;
+    Arg                           args[2];
+    Widget                        textsource;
+
+    Log(("printOKXtProc: OK.\n"));
+    
+    /* Get TextSource object */
+    n = 0;
+    XtSetArg(args[n], XtNtextSource, &textsource); n++;
+    XtGetValues(textwindow, args, n);
+    
+    Assertion(textsource != NULL, (("printOKXtProc: textsource == NULL.\n")));
+   
+    /* ||printJobNameBuffer| must live as long the print job prints
+     * because it is used for the job title AND the page headers... */
+    sprintf(printJobNameBuffer, "Xedit print job");
+
+    DoPrintTextSource("Xedit",
+                      textsource, topwindow,
+                      pdcs->pdpy, pdcs->pcontext, pdcs->colorspace,
+                      printshellDestroyXtProc,
+                      printJobNameBuffer,
+                      pdcs->printToFile?pdcs->printToFileName:NULL);
+
+    XtPopdown(printdialog_shell);
+}
+
+static void
+printCancelXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    Log(("printCancelXtProc: cancel.\n"));
+    XtPopdown(printdialog_shell);
+    
+    Log(("destroying print dialog shell...\n"));
+    XtDestroyWidget(printdialog_shell);
+    printdialog_shell = NULL;
+    printdialog       = NULL;
+    Log(("... done\n"));
+}
+
+
+/*ARGSUSED*/
+void
+PrintFile(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    DoPrint(w, NULL, NULL);
+}
+
+/*ARGSUSED*/
+void
+DoPrint(Widget w, XtPointer client_data, XtPointer call_data)
+{
+  Dimension   width, height;
+  Position    x, y;
+  Widget      parent = topwindow;
+  Log(("print!\n"));
+  
+  if (!printdialog) {
+    int n;
+    Arg args[20];
+
+    n = 0;
+    XtSetArg(args[n], XtNallowShellResize, True); n++;
+    printdialog_shell = XtCreatePopupShell("printdialogshell",
+                                           transientShellWidgetClass,
+                                           topwindow, args, n);
+    n = 0;
+    printdialog = XtCreateManagedWidget("printdialog", printDialogWidgetClass,
+                                        printdialog_shell, args, n);
+    XtAddCallback(printdialog, XawNOkCallback,     printOKXtProc,     NULL);
+    XtAddCallback(printdialog, XawNCancelCallback, printCancelXtProc, NULL);
+
+    XtRealizeWidget(printdialog_shell);
+  }
+
+  /* Center dialog */
+  XtVaGetValues(printdialog_shell,
+      XtNwidth,  &width,
+      XtNheight, &height,
+      NULL);
+
+  x = (Position)(XWidthOfScreen( XtScreen(parent)) - width)  / 2;
+  y = (Position)(XHeightOfScreen(XtScreen(parent)) - height) / 3;
+
+  XtVaSetValues(printdialog_shell,
+      XtNx, x,
+      XtNy, y,
+      NULL);
+        
+  XtPopup(printdialog_shell, XtGrabNonexclusive);
+}
+#endif /* INCLUDE_XPRINT_SUPPORT */
+
+/*     Function Name: SourceChanged
+ *     Description: A callback routine called when the source has changed.
+ *     Arguments: w - the text source that has changed.
+ *                client_data - xedit_flist_item associated with text buffer.
+ *                 call_data - NULL is unchanged
+ *     Returns: none.
+ */
+/*ARGSUSED*/
+void
+SourceChanged(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    xedit_flist_item *item = (xedit_flist_item*)client_data;
+    Bool changed = (Bool)(long)call_data;
+
+    if (changed) {
+       if (item->flags & CHANGED_BIT)
+           return;
+       item->flags |= CHANGED_BIT;
+    }
+    else {
+       if (item->flags & CHANGED_BIT)
+           ResetSourceChanged(item);
+       return;
+    }
+
+    if (flist.pixmap) {
+       Arg args[1];
+       Cardinal num_args;
+       int i;
+
+       num_args = 0;
+       XtSetArg(args[num_args], XtNleftBitmap, flist.pixmap);  ++num_args;
+       XtSetValues(item->sme, args, num_args);
+
+       for (i = 0; i < 3; i++)
+           if (XawTextGetSource(texts[i]) == item->source)
+               XtSetValues(labels[i], args, num_args);
+    }
+}
+
+/*     Function Name: ResetSourceChanged.
+ *     Description: Sets the source changed to FALSE, and
+ *                   registers a callback to set it to TRUE when
+ *                   the source has changed.
+ *     Arguments: item - item with widget to register the callback on.
+ *     Returns: none.
+ */
+
+void
+ResetSourceChanged(xedit_flist_item *item)
+{
+    Arg args[1];
+    Cardinal num_args;
+    int i;
+
+    num_args = 0;
+    XtSetArg(args[num_args], XtNleftBitmap, None);     ++num_args;
+    XtSetValues(item->sme, args, num_args);
+
+    dc_state = 0;
+    for (i = 0; i < 3; i++) {
+       if (XawTextGetSource(texts[i]) == item->source)
+           XtSetValues(labels[i], args, num_args);
+       AddDoubleClickCallback(XawTextGetSource(texts[i]), False);
+    }
+
+    num_args = 0;
+    XtSetArg(args[num_args], XtNsourceChanged, False); ++num_args;
+    XtSetValues(item->source, args, num_args);
+
+    item->flags &= ~CHANGED_BIT;
+}
+
+/*ARGSUSED*/
+void
+KillFile(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    xedit_flist_item *item = FindTextSource(XawTextGetSource(textwindow), NULL);
+
+    if (item->source == scratch) {
+       Feep();
+       return;
+    }
+
+    if (item->flags & CHANGED_BIT) {
+       if (!(dc_state & DC_KILL)) {
+           XeditPrintf("Kill: Unsaved changes. Kill again to override.\n");
+           Feep();
+           dc_state |= DC_KILL;
+           AddDoubleClickCallback(XawTextGetSource(textwindow), True);
+           return;
+       }
+       dc_state &= ~DC_KILL;
+    }
+    KillTextSource(item);
+}
+
+/*ARGSUSED*/
+void
+FindFile(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    char *string;
+    char *slash;
+    XawTextBlock block;
+    XawTextPosition end = XawTextSourceScan(XawTextGetSource(filenamewindow),
+                                           0, XawstAll, XawsdRight, 1, True);
+
+    if (!line_edit) {
+       string = GetString(filenamewindow);
+       if (string)
+           slash = strrchr(string, '/');
+    }
+    else {
+       string = "";
+       slash = NULL;
+       line_edit = False;
+    }
+
+    block.firstPos = 0;
+    block.format = FMT8BIT;
+    block.ptr = string;
+    block.length = slash ? slash - string + 1 : 0;
+
+    if (block.length != end)
+       XawTextReplace(filenamewindow, 0, end, &block);
+    XawTextSetInsertionPoint(filenamewindow, end);
+    XtSetKeyboardFocus(topwindow, filenamewindow);
+}
+
+/*ARGSUSED*/
+void
+LoadFile(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    if (line_edit)
+       LineEdit(textwindow);
+    else if (ReallyDoLoad(GetString(filenamewindow), ResolveName(NULL))) {
+       SwitchDirWindow(False);
+       XtSetKeyboardFocus(topwindow, textwindow);
+    }
+}
+
+/*ARGSUSED*/
+void
+CancelFindFile(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    Arg args[1];
+    xedit_flist_item *item;
+
+    XtSetKeyboardFocus(topwindow, textwindow);
+
+    item = FindTextSource(XawTextGetSource(textwindow), NULL);
+
+    if (item->source != scratch)
+       XtSetArg(args[0], XtNstring, item->name);
+    else
+       XtSetArg(args[0], XtNstring, NULL);
+
+    XtSetValues(filenamewindow, args, 1);
+    /* XXX This probably should be done by the TextWidget, i.e. notice
+     * if the cursor became inivisible due to an horizontal scroll */
+    _XawTextShowPosition((TextWidget)filenamewindow);
+
+   if (XtIsManaged(XtParent(dirwindow)))
+       SwitchDirWindow(False);
+
+    line_edit = False;
+}
+
+static int
+compar(_Xconst void *a, _Xconst void *b)
+{
+    return (strcmp(*(char **)a, *(char **)b));
+}
+
+/*ARGSUSED*/
+void
+FileCompletion(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    XawTextBlock block;
+    String text;
+    int length;
+    char **matches, *save, *dir_name, *file_name, match[257];
+    unsigned n_matches, len, mlen, buflen;
+    DIR *dir;
+    Bool changed, slash = False, has_dot = False;
+#define        SM_NEVER        0
+#define SM_HINT                1
+#define SM_ALWAYS      2
+    int show_matches;
+
+    text = GetString(filenamewindow);
+
+    if (!text) {
+       Feep();
+       return;
+    }
+    else if (line_edit) {
+       Feep();
+       line_edit = 0;
+    }
+
+    {
+       XawTextPosition pos = XawTextGetInsertionPoint(w);
+       char *cslash = strchr(&text[pos], '/'), *cdot = strchr(&text[pos], '.');
+
+       if (cslash != NULL || cdot != NULL) {
+           if (cslash != NULL && (cdot == NULL || cdot > cslash)) {
+               length = cslash - text;
+               slash = True;
+           }
+           else {
+               length = cdot - text;
+               has_dot = True;
+           }
+       }
+       else
+           length = strlen(text);
+    }
+
+    if (*num_params == 1 && length == strlen(text)) {
+       switch (params[0][0]) {
+       case 'n':               /* Never */
+       case 'N':
+           show_matches = SM_NEVER;
+           break;
+       case 'h':               /* Hint */
+       case 'H':
+           show_matches = SM_HINT;
+           break;
+       case 'a':               /* Always */
+       case 'A':
+           show_matches = SM_ALWAYS;
+           break;
+       default:
+           show_matches = SM_NEVER;
+           XtAppWarning(XtWidgetToApplicationContext(w),
+                        "Bad argument to file-completion, "
+                        "must be Never, Hint or Always");
+           break;
+       }
+    }
+    else
+       show_matches = SM_NEVER;
+
+    matches = NULL;
+    n_matches = buflen = 0;
+    save = XtMalloc(length + 1);
+    memmove(save, text, length);
+    save[length] = '\0';
+
+    if (save[0] == '~' && save[1]) {
+       char *slash2 = strchr(save, '/');
+
+       if (slash2) {
+           struct passwd *pw;
+           char home[BUFSIZ];
+           char *name;
+           int slen = strlen(save), diff = slash2 - save;
+
+           *slash2 = '\0';
+           name = save + 1;
+           if (strlen(name) != 0)
+               pw = getpwnam(name);
+           else
+               pw = getpwuid(getuid());
+
+           if (pw) {
+               char fname[BUFSIZ];
+               int hlen;
+
+               strncpy(home, pw->pw_dir, sizeof(home) - 1);
+               home[sizeof(home) - 1] = '\0';
+               hlen = strlen(home);
+               strncpy(fname, slash2 + 1, sizeof(fname) - 1);
+               fname[sizeof(fname) - 1] = '\0';
+               save = XtRealloc(save, slen - diff + hlen + 2);
+               (void)memmove(save, home, hlen);
+               save[hlen] = '/';
+               strcpy(&save[hlen + 1], fname);
+
+               /* expand directory */
+               block.length = strlen(save);
+               block.ptr = save;
+               block.firstPos = 0;
+               block.format = FMT8BIT;
+               XawTextReplace(filenamewindow, 0, length, &block);
+               XawTextSetInsertionPoint(filenamewindow, length = block.length);
+           }
+           else
+               *slash2 = '/';
+       }
+    }
+
+    if ((file_name = strrchr(save, '/')) != NULL) {
+       *file_name = '\0';
+       ++file_name;
+       dir_name = save;
+       if (!file_name[0])
+           slash = True;
+       if (!dir_name[0])
+           dir_name = "/";
+    }
+    else {
+       dir_name = ".";
+       file_name = save;
+    }
+    len = strlen(file_name);
+
+    if ((dir = opendir(dir_name)) != NULL) {
+       char path[BUFSIZ], *pptr;
+       struct dirent *ent;
+       int isdir = 0, first = 1, bytes;
+
+       XmuSnprintf(path, sizeof(path), "%s/", dir_name);
+       pptr = path + strlen(path);
+       bytes = sizeof(path) - (pptr - path) - 1;
+
+       mlen = 0;
+       match[0] = '\0';
+       while ((ent = readdir(dir)) != NULL) {
+           unsigned d_namlen = strlen(ent->d_name);
+
+           if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0)
+               continue;
+           if (d_namlen >= len && strncmp(ent->d_name, file_name, len) == 0) {
+               char *tmp = &(ent->d_name[len]), *mat = match;
+               struct stat st;
+               Bool is_dir = FALSE;
+
+               strncpy(pptr, ent->d_name, bytes);
+               pptr[bytes] = '\0';
+               if (stat(path, &st) != 0)
+                   /* Should check errno, may be a broken symbolic link
+                    * a directory with r-- permission, etc */
+                   continue;
+               else if (first || show_matches != SM_NEVER) {
+                   is_dir = S_ISDIR(st.st_mode);
+               }
+
+               if (first) {
+                   strncpy(match, tmp, sizeof(match) - 1);
+                   match[sizeof(match) - 2] = '\0';
+                   mlen = strlen(match);
+                   first = 0;
+                   isdir = is_dir;
+               }
+               else {
+                   while (*tmp && *mat && *tmp++ == *mat)
+                       ++mat;
+                   if (mlen > mat - match) {
+                       mlen = mat - match;
+                       match[mlen] = '\0';
+                   }
+               }
+               if (show_matches != SM_NEVER) {
+                   matches = (char **)XtRealloc((char*)matches, sizeof(char**)
+                                                * (n_matches + 1));
+                   buflen += d_namlen + 1;
+                   if (is_dir) {
+                       matches[n_matches] = XtMalloc(d_namlen + 2);
+                       strcpy(matches[n_matches], ent->d_name);
+                       strcat(matches[n_matches], "/");
+                       ++buflen;
+                   }
+                   else
+                       matches[n_matches] = XtNewString(ent->d_name);
+               }
+               else if (mlen == 0 && n_matches >= 1) {
+                   ++n_matches;
+                   break;
+               }
+               ++n_matches;
+           }
+       }
+
+       closedir(dir);
+       changed = mlen != 0;
+
+       if (first || n_matches) {
+           Bool free_matches = True, add_slash = n_matches == 1 && isdir && !slash;
+
+           if (mlen && has_dot && match[mlen - 1] == '.')
+               --mlen;
+
+           if (mlen || add_slash) {
+               XawTextPosition pos;
+
+               block.firstPos = 0;
+               block.format = FMT8BIT;
+               if (mlen) {
+                   pos = length;
+                   block.length = mlen;
+                   block.ptr = match;
+                   XawTextReplace(filenamewindow, pos, pos, &block);
+                   XawTextSetInsertionPoint(filenamewindow, pos + block.length);
+               }
+               if (add_slash) {
+                   XawTextPosition actual = XawTextGetInsertionPoint(w);
+
+                   pos = XawTextSourceScan(XawTextGetSource(w), 0, XawstAll,
+                                           XawsdRight, 1, True);
+                   block.length = 1;
+                   block.ptr = "/";
+                   XawTextReplace(filenamewindow, pos, pos, &block);
+                   if (actual == pos)
+                       XawTextSetInsertionPoint(filenamewindow, pos + 1);
+               }
+           }
+           else if (n_matches != 1 || isdir) {
+               if (show_matches == SM_NEVER)
+                   Feep();
+           }
+
+           if (show_matches != SM_NEVER) {
+               if (show_matches == SM_ALWAYS || (!changed && n_matches != 1)) {
+                   char **list = NULL, *label;
+                   int n_list;
+                   Arg args[2];
+
+                   XtSetArg(args[0], XtNlist, &list);
+                   XtSetArg(args[1], XtNnumberStrings, &n_list);
+                   XtGetValues(dirwindow, args, 2);
+
+                   matches = (char **)XtRealloc((char*)matches, sizeof(char**)
+                                                * (n_matches + 2));
+                   matches[n_matches++] = XtNewString("./");
+                   matches[n_matches++] = XtNewString("../");
+                   qsort(matches, n_matches, sizeof(char*), compar);
+                   XtSetArg(args[0], XtNlist, matches);
+                   XtSetArg(args[1], XtNnumberStrings, n_matches);
+                   XtSetValues(dirwindow, args, 2);
+                   if (n_list > 0
+                       && (n_list != 1 || list[0] != XtName(dirwindow))) {
+                       while (--n_list > -1)
+                           XtFree(list[n_list]);
+                       XtFree((char*)list);
+                   }
+
+                   label = ResolveName(dir_name);
+                   XtSetArg(args[0], XtNlabel, label);
+                   XtSetValues(dirlabel, args, 1);
+                   SwitchDirWindow(True);
+                   free_matches = False;
+               }
+           }
+           if (free_matches && matches) {
+               while (--n_matches > -1)
+                   XtFree(matches[n_matches]);
+               XtFree((char*)matches);
+           }
+       }
+       else
+           Feep();
+    }
+    else
+       Feep();
+
+    XtFree(save);
+}
+
+/*ARGSUSED*/
+void
+DirWindowCB(Widget w, XtPointer user_data, XtPointer call_data)
+{
+    XawListReturnStruct *file_info = (XawListReturnStruct *)call_data;
+    char *dir_name, *string, path[BUFSIZ];
+    Arg args[2];
+
+    if (file_info == NULL)
+       string = (char *)user_data;
+    else
+       string = file_info->string;
+
+    XtSetArg(args[0], XtNlabel, &dir_name);
+    XtGetValues(dirlabel, args, 1);
+    if (*dir_name == '\0') {
+       strncpy(path, string, sizeof(path) - 1);
+       path[sizeof(path) - 1] = '\0';
+    }
+    else if (strcmp(dir_name, "/") == 0)
+       XmuSnprintf(path, sizeof(path), "/%s", string);
+    else
+       XmuSnprintf(path, sizeof(path), "%s/%s", dir_name, string);
+
+    if (*string && string[strlen(string) - 1] == '/') {
+       DIR *dir;
+
+       if ((dir = opendir(path)) != NULL) {
+           struct dirent *ent;
+           struct stat st;
+           unsigned d_namlen;
+           Bool isdir;
+           char **entries = NULL, **list = NULL;
+           int n_entries = 0, n_list = 0;
+           char *label, *pptr = path + strlen(path);
+           int bytes = sizeof(path) - (pptr - path) - 1;
+
+           while ((ent = readdir(dir)) != NULL) {
+               d_namlen = strlen(ent->d_name);
+               strncpy(pptr, ent->d_name, bytes);
+               pptr[bytes] = '\0';
+               if (stat(path, &st) != 0)
+                   /* Should check errno, may be a broken symbolic link
+                    * a directory with r-- permission, etc */
+                   continue;
+               else
+                   isdir = S_ISDIR(st.st_mode);
+
+               entries = (char **)XtRealloc((char*)entries, sizeof(char*)
+                                            * (n_entries + 1));
+               if (isdir) {
+                   entries[n_entries] = XtMalloc(d_namlen + 2);
+                   strcpy(entries[n_entries], ent->d_name);
+                   strcat(entries[n_entries], "/");
+               }
+               else
+                   entries[n_entries] = XtNewString(ent->d_name);
+               ++n_entries;
+           }
+           closedir(dir);
+
+           XtSetArg(args[0], XtNlist, &list);
+           XtSetArg(args[1], XtNnumberStrings, &n_list);
+           XtGetValues(dirwindow, args, 2);
+
+           if (n_entries == 0) {
+               entries = (char**)XtMalloc(sizeof(char*) * 2);
+               /* Directory has read but not execute permission? */
+               entries[n_entries++] = XtNewString("./");
+               entries[n_entries++] = XtNewString("../");
+           }
+           qsort(entries, n_entries, sizeof(char*), compar);
+           XtSetArg(args[0], XtNlist, entries);
+           XtSetArg(args[1], XtNnumberStrings, n_entries);
+           XtSetValues(dirwindow, args, 2);
+           if (n_list > 0
+               && (n_list != 1 || list[0] != XtName(dirwindow))) {
+               while (--n_list > -1)
+                   XtFree(list[n_list]);
+               XtFree((char*)list);
+           }
+
+           *pptr = '\0';
+           if ((label = ResolveName(path)) == NULL) {
+               Feep();
+               label = path;
+           }
+           XtSetArg(args[0], XtNlabel, label);
+           XtSetValues(dirlabel, args, 1);
+
+           strncpy(path, label, sizeof(path) - 2);
+           if (*path && path[strlen(path) - 1] != '/')
+               strcat(path, "/");
+           XtSetArg(args[0], XtNstring, path);
+           XtSetValues(filenamewindow, args, 1);
+           XtSetKeyboardFocus(topwindow, filenamewindow);
+           XawTextSetInsertionPoint(filenamewindow, strlen(path));
+       }
+       else
+           Feep();
+    }
+    else {
+       (void)ReallyDoLoad(path, path);
+       SwitchDirWindow(False);
+       XtSetKeyboardFocus(topwindow, textwindow);
+    }
+}
diff --git a/xedit/compile b/xedit/compile
new file mode 100755 (executable)
index 0000000..c0096a7
--- /dev/null
@@ -0,0 +1,143 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand `-c -o'.
+
+scriptversion=2009-10-06.20; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009  Free Software
+# Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# 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, see <http://www.gnu.org/licenses/>.
+
+# 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 <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+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 <bug-automake@gnu.org>.
+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 's|^.*[\\/]||; s|^[a-zA-Z]:||; 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
+  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  test "${cofile}bj" = "$ofile" || 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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xedit/config.guess b/xedit/config.guess
new file mode 100755 (executable)
index 0000000..c2246a4
--- /dev/null
@@ -0,0 +1,1502 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+#   Free Software Foundation, Inc.
+
+timestamp='2009-12-30'
+
+# 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 (context
+# diff format) to <config-patches@gnu.org> and include a 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.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+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 <config-patches@gnu.org>."
+
+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, 2006, 2007, 2008, 2009, 2010 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 "$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 ;;
+           sh5el) machine=sh5le-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 -q __ELF__
+               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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+       echo i386-pc-auroraux${UNAME_RELEASE}
+       exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+       eval $set_cc_for_build
+       SUN_ARCH="i386"
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       echo ${SUN_ARCH}-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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:*:[456])
+       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+               IBM_ARCH=rs6000
+       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 <stdlib.h>
+              #include <unistd.h>
+
+              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 -q __LP64__
+           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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       exit ;;
+    i*:CYGWIN*:*)
+       echo ${UNAME_MACHINE}-pc-cygwin
+       exit ;;
+    *: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 ;;
+    *:Interix*:*)
+       case ${UNAME_MACHINE} in
+           x86)
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           authenticamd | genuineintel | EM64T)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+           IA64)
+               echo ia64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+       esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       exit ;;
+    8664:Windows_NT:*)
+       echo x86_64-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*:*:* | x86_64: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 ;;
+    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 -q ld.so.1
+       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+       exit ;;
+    arm*:Linux:*:*)
+       eval $set_cc_for_build
+       if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_EABI__
+       then
+           echo ${UNAME_MACHINE}-unknown-linux-gnu
+       else
+           echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+       fi
+       exit ;;
+    avr32*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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 ;;
+    i*86:Linux:*:*)
+       LIBC=gnu
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+       echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+       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:*:* | mips64:Linux:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #undef CPU
+       #undef ${UNAME_MACHINE}
+       #undef ${UNAME_MACHINE}el
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=${UNAME_MACHINE}el
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       CPU=${UNAME_MACHINE}
+       #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; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-unknown-linux-gnu
+       exit ;;
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-gnu
+       exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+       echo hppa64-unknown-linux-gnu
+       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 ;;
+    ppc64:Linux:*:*)
+       echo powerpc64-unknown-linux-gnu
+       exit ;;
+    ppc:Linux:*:*)
+       echo powerpc-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 ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-gnu
+       exit ;;
+    x86_64:Linux:*:*)
+       echo x86_64-unknown-linux-gnu
+       exit ;;
+    xtensa*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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.[02]*:*)
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-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; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       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; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; 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.[02]*:*)
+       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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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 ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       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 ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-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
+           i386)
+               eval $set_cc_for_build
+               if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+                 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+                     (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+                     grep IS_64BIT_ARCH >/dev/null
+                 then
+                     UNAME_PROCESSOR="x86_64"
+                 fi
+               fi ;;
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/xedit/config.h.in b/xedit/config.h.in
new file mode 100644 (file)
index 0000000..f859945
--- /dev/null
@@ -0,0 +1,37 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
+/* 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 home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Version number of package */
+#undef VERSION
diff --git a/xedit/config.sub b/xedit/config.sub
new file mode 100755 (executable)
index 0000000..c2d1257
--- /dev/null
@@ -0,0 +1,1714 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+#   Free Software Foundation, Inc.
+
+timestamp='2010-01-22'
+
+# 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 <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted GNU 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.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# 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 <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-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 | -microblaze)
+               os=
+               basic_machine=$1
+               ;;
+        -bluegene*)
+               os=-cnk
+               ;;
+       -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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | bfin \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fido | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | lm32 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore | mep | metag \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64octeon | mips64octeonel \
+       | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | moxie \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | rx \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | ubicom32 \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | z8k | z80)
+               basic_machine=$basic_machine-unknown
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12 | picochip)
+               # Motorola 68HC11/12.
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64octeon-* | mips64octeonel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | none-* | np1-* | ns16k-* | ns32k-* \
+       | orion-* \
+       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+       | pyramid-* \
+       | romp-* | rs6000-* | rx-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tile-* | tilegx-* \
+       | tron-* \
+       | ubicom32-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa*-* \
+       | ymp-* \
+       | z8k-* | z80-*)
+               ;;
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               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
+               ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       bluegene*)
+               basic_machine=powerpc-ibm
+               os=-cnk
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+        cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
+       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
+               ;;
+       cr16)
+               basic_machine=cr16-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
+               ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
+       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
+               ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       m88k-omron*)
+               basic_machine=m88k-omron
+               ;;
+       magnum | m3230)
+               basic_machine=mips-mips
+               os=-sysv
+               ;;
+       merlin)
+               basic_machine=ns32k-utek
+               os=-sysv
+               ;;
+        microblaze)
+               basic_machine=microblaze-xilinx
+               ;;
+       mingw32)
+               basic_machine=i386-pc
+               os=-mingw32
+               ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
+       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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       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
+               ;;
+        # This must be matched before tile*.
+        tilegx*)
+               basic_machine=tilegx-unknown
+               os=-linux-gnu
+               ;;
+       tile*)
+               basic_machine=tile-unknown
+               os=-linux-gnu
+               ;;
+       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
+               ;;
+       z80-*-coff)
+               basic_machine=z80-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[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+               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.
+        -auroraux)
+               os=-auroraux
+               ;;
+       -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* | -cnk* | -sunos | -sunos[34]*\
+             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+             | -sym* | -kopensolaris* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* | -aros* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
+             | -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* | -cegcc* \
+             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -linux-newlib* | -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* | -rdos* | -toppers* | -drops* | -es*)
+       # 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
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+        -nacl*)
+               ;;
+       -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
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
+       *-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
+               ;;
+        mep-*)
+               os=-elf
+               ;;
+       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
+                               ;;
+                       -cnk*|-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/xedit/configure b/xedit/configure
new file mode 100755 (executable)
index 0000000..9a70097
--- /dev/null
@@ -0,0 +1,5805 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.65 for xedit 1.1.2.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+        /*)
+          for as_base in sh bash ksh sh5; do
+            # Try only shells that exist, to save several forks.
+            as_shell=$as_dir/$as_base
+            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+          done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+       # neutralization value for shells without unset; and this also
+       # works around shells that cannot unset nonexistent variables.
+       BASH_ENV=/dev/null
+       ENV=/dev/null
+       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+       export CONFIG_SHELL
+       exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$?; test $as_status -eq 0 && as_status=1
+  if test "$3"; then
+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  fi
+  $as_echo "$as_me: error: $1" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# 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`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='xedit'
+PACKAGE_TARNAME='xedit'
+PACKAGE_VERSION='1.1.2'
+PACKAGE_STRING='xedit 1.1.2'
+PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
+PACKAGE_URL=''
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+ADMIN_MAN_DIR
+DRIVER_MAN_DIR
+MISC_MAN_DIR
+FILE_MAN_DIR
+LIB_MAN_DIR
+APP_MAN_DIR
+ADMIN_MAN_SUFFIX
+DRIVER_MAN_SUFFIX
+MISC_MAN_SUFFIX
+FILE_MAN_SUFFIX
+LIB_MAN_SUFFIX
+APP_MAN_SUFFIX
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+appdefaultdir
+APPDEFS_LIBS
+APPDEFS_CFLAGS
+NEED_UNSETENV_FALSE
+NEED_UNSETENV_TRUE
+NEED_STRCASECMP_FALSE
+NEED_STRCASECMP_TRUE
+NEED_REALPATH_FALSE
+NEED_REALPATH_TRUE
+LISPDIR
+PKGDEPS_LIBS
+PKGDEPS_CFLAGS
+USE_XPRINT_FALSE
+USE_XPRINT_TRUE
+PKG_CONFIG
+RANLIB
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_xprint
+with_lispdir
+with_release_version
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+PKG_CONFIG
+PKGDEPS_CFLAGS
+PKGDEPS_LIBS
+APPDEFS_CFLAGS
+APPDEFS_LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)   ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=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 ;;
+
+  -*) as_fn_error "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information."
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_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'`
+  as_fn_error "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
+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
+    $as_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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error "pwd does not report name of working directory"
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 xedit 1.1.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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/xedit]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_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 xedit 1.1.2:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --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
+  --enable-xprint         Compile with xprint support (default: disabled)
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-lispdir=PATH     Directory to install lisp files (default:
+                          $libdir/X11/xedit/lisp)
+  --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<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  PKG_CONFIG  path to pkg-config utility
+  PKGDEPS_CFLAGS
+              C compiler flags for PKGDEPS, overriding pkg-config
+  PKGDEPS_LIBS
+              linker flags for PKGDEPS, overriding pkg-config
+  APPDEFS_CFLAGS
+              C compiler flags for APPDEFS, overriding pkg-config
+  APPDEFS_LIBS
+              linker flags for APPDEFS, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+xedit configure 1.1.2
+generated by GNU Autoconf 2.65
+
+Copyright (C) 2009 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
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* 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_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_func
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by xedit $as_me 1.1.2, which was
+generated by GNU Autoconf 2.65.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append 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
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+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,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > 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
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_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.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_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 $ac_precious_vars; 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,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_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
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_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.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+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.11'
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  for ac_t in install-sh install.sh shtool; do
+    if test -f "$ac_dir/$ac_t"; then
+      ac_aux_dir=$ac_dir
+      ac_install_sh="$ac_aux_dir/$ac_t -c"
+      break 2
+    fi
+  done
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$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'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# 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".
+      as_fn_error "ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "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 $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+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='xedit'
+ VERSION='1.1.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"}
+
+# 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 -'
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-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
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+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
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "no acceptable C compiler found in \$PATH
+See \`config.log' for more details." "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM 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.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "C compiler cannot create executables
+See \`config.log' for more details." "$LINENO" 5; }; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+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
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-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=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+  $as_echo_n "(cached) " >&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
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$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
+
+
+if test "x$CC" != xcc; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
+fi
+set dummy $CC; ac_cc=`$as_echo "$2" |
+                     sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } &&
+   test -f conftest2.$ac_objext && { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; };
+then
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  if test "x$CC" != xcc; then
+    # Test first that cc exists at all.
+    if { ac_try='cc -c conftest.$ac_ext >&5'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+      rm -f conftest2.*
+      if { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } &&
+        test -f conftest2.$ac_objext && { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; };
+      then
+       # cc works too.
+       :
+      else
+       # cc exists but doesn't like -o.
+       eval ac_cv_prog_cc_${ac_cc}_c_o=no
+      fi
+    fi
+  fi
+else
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
+
+fi
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+
+# Check whether --enable-xprint was given.
+if test "${enable_xprint+set}" = set; then :
+  enableval=$enable_xprint; enable_xprint=$enableval
+else
+  enable_xprint=no
+fi
+
+ if test x$enable_xprint = xyes; then
+  USE_XPRINT_TRUE=
+  USE_XPRINT_FALSE='#'
+else
+  USE_XPRINT_TRUE='#'
+  USE_XPRINT_FALSE=
+fi
+
+if test x$enable_xprint = xyes; then
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PKGDEPS" >&5
+$as_echo_n "checking for PKGDEPS... " >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$PKGDEPS_CFLAGS"; then
+        pkg_cv_PKGDEPS_CFLAGS="$PKGDEPS_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xprintutil xp xaw8\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xprintutil xp xaw8") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_PKGDEPS_CFLAGS=`$PKG_CONFIG --cflags "xprintutil xp xaw8" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$PKGDEPS_LIBS"; then
+        pkg_cv_PKGDEPS_LIBS="$PKGDEPS_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xprintutil xp xaw8\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xprintutil xp xaw8") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_PKGDEPS_LIBS=`$PKG_CONFIG --libs "xprintutil xp xaw8" 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
+               PKGDEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xprintutil xp xaw8"`
+        else
+               PKGDEPS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xprintutil xp xaw8"`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$PKGDEPS_PKG_ERRORS" >&5
+
+       as_fn_error "Package requirements (xprintutil xp xaw8) were not met:
+
+$PKGDEPS_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 PKGDEPS_CFLAGS
+and PKGDEPS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 PKGDEPS_CFLAGS
+and PKGDEPS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." "$LINENO" 5; }
+else
+       PKGDEPS_CFLAGS=$pkg_cv_PKGDEPS_CFLAGS
+       PKGDEPS_LIBS=$pkg_cv_PKGDEPS_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       :
+fi
+   print_noprint=xprint
+else
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PKGDEPS" >&5
+$as_echo_n "checking for PKGDEPS... " >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$PKGDEPS_CFLAGS"; then
+        pkg_cv_PKGDEPS_CFLAGS="$PKGDEPS_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xaw7\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xaw7") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_PKGDEPS_CFLAGS=`$PKG_CONFIG --cflags "xaw7" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$PKGDEPS_LIBS"; then
+        pkg_cv_PKGDEPS_LIBS="$PKGDEPS_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xaw7\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xaw7") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_PKGDEPS_LIBS=`$PKG_CONFIG --libs "xaw7" 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
+               PKGDEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xaw7"`
+        else
+               PKGDEPS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xaw7"`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$PKGDEPS_PKG_ERRORS" >&5
+
+       as_fn_error "Package requirements (xaw7) were not met:
+
+$PKGDEPS_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 PKGDEPS_CFLAGS
+and PKGDEPS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 PKGDEPS_CFLAGS
+and PKGDEPS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." "$LINENO" 5; }
+else
+       PKGDEPS_CFLAGS=$pkg_cv_PKGDEPS_CFLAGS
+       PKGDEPS_LIBS=$pkg_cv_PKGDEPS_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       :
+fi
+   print_noprint=noxprint
+fi
+ac_config_links="$ac_config_links app-defaults/Xedit:app-defaults/Xedit-$print_noprint"
+
+
+
+# Check whether --with-lispdir was given.
+if test "${with_lispdir+set}" = set; then :
+  withval=$with_lispdir;  lispdir="$withval"
+else
+   lispdir=${libdir}/X11/xedit/lisp
+fi
+
+LISPDIR=$lispdir
+
+
+
+ac_fn_c_check_func "$LINENO" "realpath" "ac_cv_func_realpath"
+if test "x$ac_cv_func_realpath" = x""yes; then :
+
+else
+  have_realpath=yes
+fi
+
+ if test x$have_realpath = xyes; then
+  NEED_REALPATH_TRUE=
+  NEED_REALPATH_FALSE='#'
+else
+  NEED_REALPATH_TRUE='#'
+  NEED_REALPATH_FALSE=
+fi
+
+ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp"
+if test "x$ac_cv_func_strcasecmp" = x""yes; then :
+
+else
+  have_strcasecmp=yes
+fi
+
+ if test x$have_strcasecmp = xyes; then
+  NEED_STRCASECMP_TRUE=
+  NEED_STRCASECMP_FALSE='#'
+else
+  NEED_STRCASECMP_TRUE='#'
+  NEED_STRCASECMP_FALSE=
+fi
+
+ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
+if test "x$ac_cv_func_unsetenv" = x""yes; then :
+
+else
+  have_unsetenv=yes
+fi
+
+ if test x$have_unsetenv = xyes; then
+  NEED_UNSETENV_TRUE=
+  NEED_UNSETENV_FALSE='#'
+else
+  NEED_UNSETENV_TRUE='#'
+  NEED_UNSETENV_FALSE=
+fi
+
+
+
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for APPDEFS" >&5
+$as_echo_n "checking for APPDEFS... " >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$APPDEFS_CFLAGS"; then
+        pkg_cv_APPDEFS_CFLAGS="$APPDEFS_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xt\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_APPDEFS_CFLAGS=`$PKG_CONFIG --cflags "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$APPDEFS_LIBS"; then
+        pkg_cv_APPDEFS_LIBS="$APPDEFS_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xt\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_APPDEFS_LIBS=`$PKG_CONFIG --libs "xt" 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
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xt"`
+        else
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xt"`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$APPDEFS_PKG_ERRORS" >&5
+
+       as_fn_error "Package requirements (xt) were not met:
+
+$APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." "$LINENO" 5; }
+else
+       APPDEFS_CFLAGS=$pkg_cv_APPDEFS_CFLAGS
+       APPDEFS_LIBS=$pkg_cv_APPDEFS_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       :
+fi
+appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+
+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 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"
+               { $as_echo "$as_me:${as_lineno-$LINENO}: Building with package name set to $PACKAGE" >&5
+$as_echo "$as_me: Building with package name set to $PACKAGE" >&6;}
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     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" &&
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+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_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${USE_XPRINT_TRUE}" && test -z "${USE_XPRINT_FALSE}"; then
+  as_fn_error "conditional \"USE_XPRINT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${NEED_REALPATH_TRUE}" && test -z "${NEED_REALPATH_FALSE}"; then
+  as_fn_error "conditional \"NEED_REALPATH\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${NEED_STRCASECMP_TRUE}" && test -z "${NEED_STRCASECMP_FALSE}"; then
+  as_fn_error "conditional \"NEED_STRCASECMP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${NEED_UNSETENV_TRUE}" && test -z "${NEED_UNSETENV_FALSE}"; then
+  as_fn_error "conditional \"NEED_UNSETENV\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $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}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$?; test $as_status -eq 0 && as_status=1
+  if test "$3"; then
+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  fi
+  $as_echo "$as_me: error: $1" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by xedit $as_me 1.1.2, which was
+generated by GNU Autoconf 2.65.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_links="$ac_config_links"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   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 links:
+$config_links
+
+Configuration commands:
+$config_commands
+
+Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+xedit config.status 1.1.2
+configured by $0, generated by GNU Autoconf 2.65,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2009 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+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
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  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 || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "app-defaults/Xedit") CONFIG_LINKS="$CONFIG_LINKS app-defaults/Xedit:app-defaults/Xedit-$print_noprint" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  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_LINKS+set}" = set || CONFIG_LINKS=$config_links
+  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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || as_fn_error "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# 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
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #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.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS  :L $CONFIG_LINKS  :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # 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.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || as_fn_error "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || as_fn_error "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+       || as_fn_error "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$_am_arg" : 'X\(//\)[^/]' \| \
+        X"$_am_arg" : 'X\(//\)$' \| \
+        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+  :L)
+  #
+  # CONFIG_LINK
+  #
+
+  if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
+    :
+  else
+    # Prefer the file from the source tree if names are identical.
+    if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
+      ac_source=$srcdir/$ac_source
+    fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
+$as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
+
+    if test ! -r "$ac_source"; then
+      as_fn_error "$ac_source: file not found" "$LINENO" 5
+    fi
+    rm -f "$ac_file"
+
+    # Try a relative symlink, then a hard link, then a copy.
+    case $srcdir in
+    [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;;
+       *) ac_rel_source=$ac_top_build_prefix$ac_source ;;
+    esac
+    ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
+      ln "$ac_source" "$ac_file" 2>/dev/null ||
+      cp -p "$ac_source" "$ac_file" ||
+      as_fn_error "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
+  fi
+ ;;
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_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=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# 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 || as_fn_exit $?
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/xedit/configure.ac b/xedit/configure.ac
new file mode 100644 (file)
index 0000000..64fc0b1
--- /dev/null
@@ -0,0 +1,72 @@
+
+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(xedit,[1.1.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xedit)
+AM_INIT_AUTOMAKE([dist-bzip2])
+AM_MAINTAINER_MODE
+
+AM_CONFIG_HEADER(config.h)
+
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_INSTALL
+AC_PROG_RANLIB
+PKG_PROG_PKG_CONFIG
+
+AC_ARG_ENABLE(xprint,
+             AS_HELP_STRING([--enable-xprint],
+                            [Compile with xprint support (default: disabled)]),
+             [enable_xprint=$enableval], [enable_xprint=no])
+AM_CONDITIONAL(USE_XPRINT, test x$enable_xprint = xyes)
+if test x$enable_xprint = xyes; then
+   PKG_CHECK_MODULES(PKGDEPS, xprintutil xp xaw8)
+else
+   PKG_CHECK_MODULES(PKGDEPS, xaw7)
+fi
+
+AC_ARG_WITH(lispdir, AS_HELP_STRING([--with-lispdir=PATH],
+           [Directory to install lisp files (default: $libdir/X11/xedit/lisp)]),
+           [ lispdir="$withval"],
+           [ lispdir=${libdir}/X11/xedit/lisp ])
+LISPDIR=$lispdir
+AC_SUBST(LISPDIR)
+
+AC_CHECK_FUNC(realpath, [], [have_realpath=yes])
+AM_CONDITIONAL(NEED_REALPATH, test x$have_realpath = xyes)
+AC_CHECK_FUNC(strcasecmp, [], [have_strcasecmp=yes])
+AM_CONDITIONAL(NEED_STRCASECMP, test x$have_strcasecmp = xyes)
+AC_CHECK_FUNC(unsetenv, [], [have_unsetenv=yes])
+AM_CONDITIONAL(NEED_UNSETENV, test x$have_unsetenv = xyes)
+
+AC_SUBST(PKGDEPS_CFLAGS)
+AC_SUBST(PKGDEPS_LIBS)
+
+PKG_CHECK_MODULES(APPDEFS, xt)
+appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+AC_SUBST(appdefaultdir)
+
+XORG_MANPAGE_SECTIONS
+XORG_RELEASE_VERSION
+
+AC_OUTPUT([Makefile])
diff --git a/xedit/depcomp b/xedit/depcomp
new file mode 100755 (executable)
index 0000000..df8eea7
--- /dev/null
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s,\\\\\\\\,/,g"
+   depmode=msvisualcpp
+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.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    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.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[     ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "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"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${
+              s/^ *//
+              s/ \\*$//
+              s/$/:/
+              p
+            }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # 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 mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $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 "X$1" != 'X--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 "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    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.
+    -arch)
+      eat=yes ;;
+    -*|$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 "X$1" != 'X--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.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::     \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # 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
+  ;;
+
+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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xedit/hash.c b/xedit/hash.c
new file mode 100644 (file)
index 0000000..4f3e14a
--- /dev/null
@@ -0,0 +1,322 @@
+/*
+ * Copyright (c) 2007,2008 Paulo Cesar Pereira de Andrade
+ *
+ * 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 (including the next
+ * paragraph) 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.
+ *
+ * Author: Paulo Cesar Pereira de Andrade
+ */
+
+#include "util.h"
+#include <stdlib.h>
+#include <string.h>
+
+/*
+ *   This is a very simplified and adapted version of the hash tables I am
+ * using in a personal project. It was added to try to have a single hash
+ * table implementation in xedit. The lisp (for user code) version was not
+ * converted, but the following hastables have been converted:
+ *  ispell.c - list of replace and ignore words
+ *  hook.c   - list of auto replace words
+ *  internal lisp data structures:
+ *     atoms
+ *     strings
+ *     packages
+ *     opaque types
+ *   also, all code traversing hash tables is now using
+ *     hash_iter_first() and hash_iter_next()
+ *  conversion isn't as good as I originally wanted, code is using hash_check
+ *  instead of hash_get, but this is due to the code not having a basic
+ *  { void *data; int length; } object to store string like objects
+ *
+ *   Also, this hash table implementation was added mainly for the tags
+ * support.
+ */
+
+/*
+ * Prototypes
+ */
+static int hash_equal(hash_table *hash, hash_key *left, hash_key *right);
+static unsigned int hash_data(char *value, unsigned int length);
+static unsigned int hash_value(hash_key *key);
+
+
+/*
+ * Implementation
+ */
+static int
+hash_equal(hash_table *hash, hash_key *left, hash_key *right)
+{
+    if (left->length == right->length) {
+       if (left == right)
+           return (1);
+       if (hash->compare)
+           return (hash->compare(left, right));
+       return (memcmp(left->value, right->value, left->length) == 0);
+    }
+
+    return (0);
+}
+
+static unsigned int
+hash_data(char *value, unsigned int length)
+{
+    char               *ptr;
+    unsigned int       i, key;
+
+    for (i = key = 0, ptr = value; i < length; i++)
+       key = (key << (key & 1)) ^ ptr[i];
+
+    return (key);
+}
+
+static unsigned int
+hash_value(hash_key *key)
+{
+    return (hash_data(key->value, key->length));
+}
+
+hash_table *
+hash_new(unsigned int length, hash_compare compare)
+{
+    hash_table *hash;
+
+    hash = calloc(1, sizeof(hash_table));
+    if (hash) {
+       hash->entries = calloc(length, sizeof(hash_entry *));
+       if (hash->entries) {
+           hash->length = length;
+           hash->compare = compare;
+           hash->iter.offset = -1;
+       }
+       else {
+           free(hash);
+           hash = (hash_table *)0;
+       }
+    }
+
+    return (hash);
+}
+
+hash_entry *
+hash_put(hash_table *hash, hash_entry *entry)
+{
+    unsigned int       key;
+    hash_entry         *prev, *ptr;
+
+    /* Offset in hash table vector for this entry */
+    key = hash_value(entry->key) % hash->length;
+
+    /* We hope this is nil for most calls */
+    ptr = hash->entries[key];
+
+    /* Check if clashed with another entry */
+    for (prev = ptr; ptr; prev = ptr, ptr = ptr->next) {
+       /* Replace current entry */
+       if (hash_equal(hash, entry->key, ptr->key)) {
+           /* If not trying to readd same value */
+           if (entry != ptr) {
+               if (ptr == prev)
+                   hash->entries[key] = entry;
+               else
+                   prev->next = entry;
+               entry->next = ptr->next;
+               /* Finished */
+           }
+           else
+               ptr = (hash_entry *)0;
+           goto hash_put_done;
+       }
+    }
+
+    /* Add new entry */
+    if (prev == (hash_entry *)0)
+       /* If no entry in offset */
+       hash->entries[key] = entry;
+    else
+       /* Add to end of clashing list */
+       prev->next = entry;
+    entry->next = (hash_entry *)0;
+
+    /* Increase sum of entries counter*/
+    ++hash->count;
+
+hash_put_done:
+    /* ptr will be nil if no entry was replaced, of tried to add
+     * again an entry already in the hash table */
+    return (ptr);
+}
+
+hash_entry *
+hash_get(hash_table *hash, hash_key *name)
+{
+    unsigned int       key;
+    hash_entry         *entry;
+
+    key = hash_value(name) % hash->length;
+    for (entry = hash->entries[key]; entry; entry = entry->next) {
+       if (hash_equal(hash, name, entry->key)) {
+
+           return (entry);
+       }
+    }
+
+    return ((hash_entry *)0);
+}
+
+hash_entry *
+hash_check(hash_table *hash, char *name, unsigned int length)
+{
+    unsigned int       key;
+    hash_entry         *entry;
+
+    key = hash_data(name, length) % hash->length;
+    for (entry = hash->entries[key]; entry; entry = entry->next) {
+       if (length == entry->key->length &&
+           memcmp(name, entry->key->value, length) == 0) {
+
+           return (entry);
+       }
+    }
+
+    return ((hash_entry *)0);
+}
+
+hash_entry *
+hash_rem_no_free(hash_table *hash, hash_entry *entry)
+{
+    unsigned int       key;
+    hash_entry         *ptr, *prev;
+
+    key = hash_value(entry->key) % hash->length;
+    for (ptr = prev = hash->entries[key]; ptr; prev = ptr, ptr = ptr->next) {
+       if (ptr == entry) {
+           --hash->count;
+           if (ptr == prev)
+               hash->entries[key] = ptr->next;
+           else
+               prev->next = ptr->next;
+           break;
+       }
+    }
+
+    if (ptr && ptr == hash->iter.entry)
+       hash->iter.entry = ptr->next;
+
+    /* If entry wasn't in hash table ptr will be nil */
+    return (ptr);
+}
+
+void
+hash_rem(hash_table *hash, hash_entry *entry)
+{
+    entry = hash_rem_no_free(hash, entry);
+    if (entry) {
+       free(entry->key->value);
+       free(entry->key);
+       free(entry);
+    }
+}
+
+void
+hash_rehash(hash_table *hash, unsigned int length)
+{
+    unsigned int       i, key;
+    hash_entry         *entry, *next, **entries;
+
+    entries = (hash_entry **)calloc(length, sizeof(hash_entry *));
+    if (entries) {
+       /* Populate the new table, note that clashes are now in reverse order */
+       for (i = 0; i < hash->length; i++) {
+           for (entry = hash->entries[i]; entry; entry = next) {
+               next = entry->next;
+               key = hash_value(entry->key) % length;
+               entry->next = entries[key];
+               entries[key] = entry;
+           }
+       }
+
+       /* Finish updating hash table */
+       free(hash->entries);
+       hash->entries = entries;
+       hash->length = length;
+    }
+    hash->iter.offset = -1;
+}
+
+hash_entry *
+hash_iter_first(hash_table *hash)
+{
+    hash->iter.offset = 0;
+    hash->iter.entry = (hash_entry *)0;
+
+    return (hash_iter_next(hash));
+}
+
+hash_entry *
+hash_iter_next(hash_table *hash)
+{
+    if (hash->iter.offset >= 0) {
+       if (hash->iter.entry) {
+           if ((hash->iter.entry = hash->iter.entry->next))
+               return (hash->iter.entry);
+           ++hash->iter.offset;
+       }
+       for (; hash->iter.offset < hash->length; hash->iter.offset++) {
+           if ((hash->iter.entry = hash->entries[hash->iter.offset]))
+               return (hash->iter.entry);
+       }
+       hash->iter.entry = (hash_entry *)0;
+       hash->iter.offset = -1;
+    }
+
+    return ((hash_entry *)0);
+}
+
+void
+hash_clr(hash_table *hash)
+{
+    unsigned int       i;
+    hash_entry         *entry, *next;
+
+    /* Extra data should be free'd with the iterator */
+    for (i = 0; i < hash->length; i++) {
+       entry = hash->entries[i];
+       if (entry) {
+           for (next = entry; entry; entry = next) {
+               next = entry->next;
+               free(entry->key->value);
+               free(entry->key);
+               free(entry);
+           }
+           hash->entries[i] = (hash_entry *)0;
+       }
+    }
+
+    hash->count = 0;
+    hash->iter.offset = -1;
+}
+
+void
+hash_del(hash_table *hash)
+{
+    hash_clr(hash);
+    free(hash->entries);
+    free(hash);
+}
diff --git a/xedit/hook.c b/xedit/hook.c
new file mode 100644 (file)
index 0000000..7dd6da0
--- /dev/null
@@ -0,0 +1,1265 @@
+/*
+ * Copyright (c) 1999 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/hook.c,v 1.9 2003/01/08 05:07:40 paulo Exp $ */
+
+/*
+ * This file is intended to be used to add all the necessary hooks to xedit
+ * emulate certain features of emacs (and other text editors) that are better
+ * kept only in xedit, to avoid unnecessary code in the Text Widget.
+ *
+ * The code here is not finished, and will probably be changed frequently.
+ */
+
+#include "xedit.h"
+#include "re.h"
+#include "util.h"
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+/*
+ * Types
+ */
+typedef struct _ReplaceEntry {
+    hash_key *word;
+    struct _ReplaceEntry *next;
+    char *replace;
+} ReplaceEntry;
+
+typedef enum {
+    SubstituteDisabled,
+    SubstituteAsk,
+    SubstituteNo,
+    SubstituteYes
+} SubstitutionState;
+
+typedef struct _EditInfo {
+    /* Xedit regex data */
+    re_cod regex;
+    re_mat mats[10];
+
+    /* Last command entered */
+    char command[128];
+
+    /* String and flags used to compile regex */
+    char pattern[64];
+    char subst_pattern[64];
+    int pat_length;
+    int flags;
+
+    /* Substitution buffer */
+    char subst[64];
+    int soff, slen, sref;
+
+    /* For interactive substitution */
+    int callback;
+    Widget widget;
+    char *text_line;
+    SubstitutionState state;
+    XawTextPosition from, to, start, end, first, last;
+
+    /* Use if need to allocate a buffer to pass the entire line to reexec */
+    char *line;
+    long lsize;
+
+    /* Buffer to prepare replacement, if needs to expand backreferences */
+    char *buffer;
+    long bsize;
+} EditInfo;
+
+/*
+ * Prototypes
+ */
+static void ActionHook(Widget, XtPointer, String, XEvent*, String*, Cardinal*);
+static void AutoReplaceHook(Widget, String, XEvent*);
+static Bool StartAutoReplace(void);
+static char *ReplacedWord(char*, char*);
+static void AutoReplace(Widget, XEvent*);
+static void AutoReplaceCallback(Widget, XtPointer, XtPointer);
+
+static void SubstituteHook(Widget w, String action, XEvent *event);
+static void SubstituteCallback(Widget, XtPointer, XtPointer);
+
+/*
+ * Initialization
+ */
+#define STRTBLSZ       11
+static hash_table *replace_hash;
+static EditInfo einfo;
+extern Widget scratch;
+
+/*
+ * Implementation
+ */
+Bool
+StartHooks(XtAppContext app)
+{
+    static Bool first_time = True;
+
+    if (first_time) {
+       StartAutoReplace();
+       (void)XtAppAddActionHook(app, ActionHook, NULL);
+       first_time = False;
+
+       return (True);
+    }
+    return (False);
+}
+
+/*ARGSUSED*/
+static void
+ActionHook(Widget w, XtPointer client_data, String action, XEvent *event,
+          String *params, Cardinal *num_params)
+{
+    AutoReplaceHook(w, action, event);
+    SubstituteHook(w, action, event);
+}
+
+/*** auto replace ***/
+struct {
+    Widget widget;
+    String text;
+    Cardinal length;
+    XawTextPosition left, right;
+    Bool replace;
+    Bool enabled;
+} auto_replace;
+
+static void
+AutoReplaceHook(Widget w, String action, XEvent *event)
+{
+    static Bool multiply;
+
+    if (w != textwindow || !auto_replace.enabled)
+       return;
+
+    if (auto_replace.widget != textwindow) {
+       if (auto_replace.replace) {
+           auto_replace.replace = False;
+           XtRemoveCallback(auto_replace.widget, XtNpositionCallback,
+                            AutoReplaceCallback, NULL);
+       }
+    }
+    else if (strcmp(action, "multiply") == 0) {
+       multiply = True;
+       return;
+    }
+    else if (strcmp(action, "numeric") == 0) {
+       if (multiply)
+           return;
+    }
+    else if (strcmp(action, "insert-char") && strcmp(action, "newline") &&
+       strcmp(action, "newline-and-indent")) {
+       return;
+    }
+    multiply = False;
+
+    AutoReplace(w, event);
+}
+
+static Bool
+StartAutoReplace(void)
+{
+    Bool esc;
+    int len, llen, rlen, count = 0;
+    char ch, *tmp, *left, *right, *replace = app_resources.auto_replace;
+
+    if (!replace || !*replace)
+       return (False);
+
+    replace_hash = hash_new(STRTBLSZ, NULL);
+
+    left = XtMalloc(llen = 256);
+    right = XtMalloc(rlen = 256);
+    while (*replace) {
+       /* skip white spaces */
+       while (*replace && isspace(*replace))
+           ++replace;
+       if (!*replace)
+           break;
+
+       /* read left */
+       tmp = replace;
+       while (*replace && !isspace(*replace))
+           ++replace;
+       len = replace - tmp;
+       if (len >= llen)
+           left = XtRealloc(left, llen = len + 1);
+       strncpy(left, tmp, len);
+       left[len] = '\0';
+
+       /* skip white spaces */
+       while (*replace && isspace(*replace))
+           ++replace;
+
+       /* read right */
+       len = 0;
+       esc = False;
+       while ((ch = *replace) != '\0') {
+           ++replace;
+           if (len + 2 >= rlen)
+               right = XtRealloc(right, rlen += 256);
+           if (ch == '\\') {
+               if (esc)
+                   right[len++] = '\\';
+               esc = !esc;
+               continue;
+           }
+           else if (ch == '\n' && !esc)
+               break;
+           else
+               right[len++] = ch;
+           esc = False;
+       }
+       right[len] = '\0';
+
+       (void)ReplacedWord(left, right);
+       ++count;
+    }
+    XtFree(left);
+    XtFree(right);
+
+    return (auto_replace.enabled = count > 0);
+}
+
+static char *
+ReplacedWord(char *word, char *replace)
+{
+    int length;
+    ReplaceEntry *entry;
+
+    length = strlen(word);
+    entry = (ReplaceEntry *)hash_check(replace_hash, word, length);
+    if (entry == NULL && replace != NULL) {
+       entry = XtNew(ReplaceEntry);
+       entry->word = XtNew(hash_key);
+       entry->word->value = XtNewString(word);
+       entry->word->length = length;
+       entry->next = NULL;
+       entry->replace = XtNewString(replace);
+       hash_put(replace_hash, (hash_entry *)entry);
+    }
+    else if (replace) {
+       XtFree(entry->replace);
+       entry->replace = XtNewString(replace);
+    }
+
+    return (entry ? entry->replace : NULL);
+}
+
+static void
+AutoReplace(Widget w, XEvent *event)
+{
+    static XComposeStatus compose = {NULL, 0};
+    KeySym keysym;
+    XawTextBlock block;
+    XawTextPosition left, right, pos;
+    Widget source;
+    int i, len, size;
+    char *str, buf[32], mb[sizeof(wchar_t)];
+
+    size = XLookupString((XKeyEvent*)event, mb, sizeof(mb), &keysym, &compose);
+
+    if (size != 1 || isalnum(*mb))
+       return;
+
+    source = XawTextGetSource(w);
+    right = XawTextGetInsertionPoint(w);
+    left = XawTextSourceScan(source, right, XawstWhiteSpace,
+                            XawsdLeft, 1, False);
+
+    if (left < 0 || left == right)
+       return;
+
+    len = 0;
+    str = buf;
+    size = sizeof(buf);
+    pos = left;
+    while (pos < right) {
+       pos = XawTextSourceRead(source, pos, &block, right - pos);
+       for (i = 0; i < block.length; i++) {
+           if (block.format == FMT8BIT)
+               *mb = block.ptr[i];
+           else
+               wctomb(mb, ((wchar_t*)block.ptr)[i]);
+           str[len++] = *mb;
+           if (len + 2 >= size) {
+               if (str == buf)
+                   str = XtMalloc(size += sizeof(buf));
+               else
+                   str = XtRealloc(str, size += sizeof(buf));
+           }
+       }
+    }
+    str[len] = '\0';
+    if ((auto_replace.text = ReplacedWord(str, NULL)) != NULL) {
+       auto_replace.length = strlen(auto_replace.text);
+       auto_replace.left = left;
+       auto_replace.right = right;
+       auto_replace.replace = True;
+       XtAddCallback(auto_replace.widget = w, XtNpositionCallback,
+                     AutoReplaceCallback, NULL);
+    }
+    if (str != buf)
+       XtFree(str);
+}
+
+/*ARGSUSED*/
+static void
+AutoReplaceCallback(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    int i, inc;
+    XawTextBlock block, text;
+    char buffer[1024], mb[sizeof(wchar_t)];
+    XawTextPosition left, right, pos;
+
+    if (!auto_replace.replace || w != auto_replace.widget)
+       return;
+
+    XtRemoveCallback(auto_replace.widget, XtNpositionCallback,
+                    AutoReplaceCallback, NULL);
+    auto_replace.replace = False;
+
+    inc = XawTextGetInsertionPoint(w) - auto_replace.right;
+    if (auto_replace.length + inc > sizeof(buffer))
+       block.ptr = XtMalloc(auto_replace.length + inc);
+    else
+       block.ptr = buffer;
+    memcpy(block.ptr, auto_replace.text, auto_replace.length);
+
+    block.length = auto_replace.length;
+    pos = left = auto_replace.right;
+    right = left + inc;
+    while (pos < right) {
+       pos = XawTextSourceRead(XawTextGetSource(w), pos, &text, inc);
+       for (i = 0; i < text.length; i++) {
+           if (text.format == FMT8BIT)
+               *mb = text.ptr[i];
+           else
+               wctomb(mb, ((wchar_t*)text.ptr)[i]);
+           block.ptr[block.length++] = *mb;
+       }
+    }
+
+    block.firstPos = 0;
+    block.format = FMT8BIT;
+
+    if (XawTextReplace(w, auto_replace.left, auto_replace.right + inc,
+                      &block) == XawEditDone)
+       XawTextSetInsertionPoint(w, auto_replace.left + block.length);
+
+    if (block.ptr != buffer)
+       XtFree(block.ptr);
+}
+
+/*ARGUSED*/
+void
+LineEditAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    XawTextBlock block;
+
+    if (international) {
+       /* XXX FIXME */
+        fprintf(stderr, "LineEditAction: Not working in international mode.\n");
+       return;
+    }
+
+    block.firstPos = 0;
+    block.format = FMT8BIT;
+    block.ptr = einfo.command;
+    block.length = strlen(einfo.command);
+
+    XawTextReplace(filenamewindow, 0,
+                  XawTextLastPosition(filenamewindow), &block);
+    XtSetKeyboardFocus(topwindow, filenamewindow);
+    line_edit = True;
+}
+
+void
+LineEdit(Widget w)
+{
+    /* Global usage variables */
+    XawTextPosition from, to, first, last, position, length, redisplay;
+    int replace, compile, ecode, nth, flags, count, etype;
+    char *command, *line, buffer[128];
+    XawTextBlock block;
+    Widget source;
+    XawTextScanDirection direction;
+    xedit_flist_item *item;
+
+    /* Variables used while parsing command */
+    int state, action, offset, icase, confirm;
+    long lfrom, lto, lfinc, ltinc, number;
+    char *ptr, *pstart, *pend, *rstart, *rend, *tmp;
+
+    /* Variables used in the search/replace loop */
+    int len;
+    XawTextPosition adjust = 0;
+
+    command = GetString(filenamewindow);
+    length = strlen(command);
+    if (length >= sizeof(einfo.command)) {
+       Feep();
+       return;
+    }
+
+    item = FindTextSource(XawTextGetSource(w), NULL);
+    source = item->source;
+    position = XawTextGetInsertionPoint(w);
+    first = XawTextSourceScan(source, 0, XawstAll, XawsdLeft, 1, True);
+    last = XawTextSourceScan(source, 0, XawstAll, XawsdRight, 1, True);
+    compile = redisplay = nth = count = confirm = 0;
+    direction = XawsdRight;
+    flags = RE_STARTEND;
+
+       /* Error types */
+#define T_NONE         0
+#define T_OPTION       1
+#define T_ICASE                2
+#define T_COMMAND      3
+#define T_REPLACE      4
+#define T_SEARCH       5
+#define T_BACKSLASH    6
+#define T_DIRECTION    7
+#define T_COMMA                8
+#define T_OFFSET       9
+#define T_INCREMENT    10
+#define T_NUMBER       11
+#define T_UNFINISHED   12
+#define T_RANGE                13
+#define T_BACKREF      14
+#define T_EDIT         15
+    etype = T_NONE;
+
+#define FAIL(code)     { etype = code; goto fail; }
+
+       /* Value for the line value, anything else is the line number */
+#define L_FIRST                -1
+#define L_CURRENT      -2
+#define L_LAST         -3
+    lfrom = L_FIRST;
+    lto = L_LAST;
+
+       /* Parsing states */
+#define E_FINC         0
+#define E_FROM         1
+#define E_COMMA                2
+#define E_TINC         3
+#define E_TO           4
+#define E_COMMAND      5
+#define E_REGEX                6
+#define E_SUBST                7
+#define E_OPTIONS      8
+    state = E_FROM;        /* Beginning interpretation */
+
+       /* Known commands */
+#define        A_SEARCH        0
+#define        A_REPLACE       1
+    action = A_SEARCH;
+
+       /* Flag to replace all occurrences */
+#define        O_ALL           -1
+
+    number = 1;
+    lfinc = ltinc = 0;
+    icase = offset = 0;
+    pstart = pend = rstart = rend = NULL;
+
+    if (einfo.state != SubstituteDisabled) {
+       if (einfo.widget != w || strcmp(einfo.command, command)) {
+           einfo.widget = w;
+           einfo.state = SubstituteAsk;
+       }
+       else {
+           XawTextPosition s_start, s_end;
+
+           XawTextGetSelectionPos(w, &s_start, &s_end);
+           if (s_start != einfo.start || s_end != einfo.end)
+               einfo.state = SubstituteAsk;
+           confirm = replace = 1;
+           from = einfo.from;
+           to = einfo.to;
+           first = einfo.first;
+           last = einfo.last;
+           goto confirm_label;
+       }
+    }
+
+    /* Remember last command */
+    strcpy(einfo.command, command); 
+
+    /* Loop parsing command */
+    for (ptr = einfo.command; *ptr;) {
+       switch (*ptr++) {
+           case 'c':
+               if (state != E_OPTIONS &&
+                   state != E_COMMAND &&
+                   state != E_REGEX)
+                   FAIL(T_OPTION)
+               confirm = 1;
+               break;
+           case 'g':
+               if (state != E_OPTIONS &&
+                   state != E_COMMAND &&
+                   state != E_REGEX)
+                   FAIL(T_OPTION)
+               offset = O_ALL;
+               break;
+           case 'i':
+               if (state != E_OPTIONS &&
+                   state != E_COMMAND &&
+                   state != E_REGEX &&
+                   state != E_FROM)
+                   FAIL(T_ICASE)
+               icase = 1;
+               break;
+           case 's':
+               if (state == E_FROM)
+                   lfrom = lto = L_CURRENT;
+               else if (state == E_COMMA) {
+                   lto = L_CURRENT;
+                   ltinc = lfinc;
+               }
+               else if (state == E_TO)
+                   lto = L_LAST;
+               else if (state == E_FINC) {
+                   ltinc = lfinc;
+                   lto = L_CURRENT;
+               }
+               else if (state != E_COMMAND && state != E_TINC)
+                   FAIL(T_COMMAND)
+               action = A_REPLACE;
+               state = E_REGEX;
+               break;
+           case '?':
+               if (action == A_REPLACE)
+                   FAIL(T_REPLACE)
+           case '/':
+               if (state == E_TINC)
+                   state = action == A_REPLACE ? E_REGEX : E_FROM;
+               else if (state == E_COMMA || state == E_FINC) {
+                   lto = L_LAST;
+                   state = E_FROM;
+               }
+               else if (state == E_TO) {
+                   if (ltinc == 0)
+                       lto = L_LAST;
+                   state = E_FROM;
+               }
+               else if (state == E_COMMAND)
+                   state = E_FROM;
+               else if (state != E_REGEX &&
+                        state != E_SUBST &&
+                        state != E_FROM)
+                   FAIL(T_SEARCH)
+               if (state != E_SUBST)
+                   direction = ptr[-1] == '/' ? XawsdRight : XawsdLeft;
+               for (tmp = ptr; *tmp; tmp++) {
+                   if (*tmp == '\\') {
+                       if (*++tmp == '\0')
+                           FAIL(T_BACKSLASH)
+                   }
+                   else if (*tmp == ptr[-1])
+                       break;
+               }
+               if (state == E_REGEX) {
+                   if (*tmp != ptr[-1])
+                       FAIL(T_DIRECTION)
+                   pstart = ptr;
+                   pend = ptr = tmp;
+                   state = E_SUBST;
+               }
+               else if (state == E_FROM) {
+                   pstart = ptr;
+                   pend = ptr = tmp;
+                   state = E_OPTIONS;
+                   if (*ptr)
+                       ++ptr;
+               }
+               else { /* E_SUBST */
+                   rstart = ptr;
+                   rend = tmp;
+                   state = E_OPTIONS;
+                   ptr = tmp;
+                   if (*ptr)
+                       ++ptr;
+               }
+               break;
+           case ',':
+               if (state == E_FROM)
+                   lfrom = L_FIRST;
+               else if (state == E_FINC)
+                   lfrom = L_CURRENT;
+               else if (state != E_COMMA)
+                   FAIL(T_COMMA)
+               state = E_TO;
+               break;
+           case '%':
+               if (state == E_FROM) {
+                   lfrom = L_FIRST;
+                   lto = L_LAST;
+                   state = E_COMMAND;
+               }
+               else
+                   FAIL(T_OFFSET)
+               break;
+           case '$':
+               if (state != E_TO)
+                   FAIL(T_OFFSET)
+               lto = L_LAST;
+               state = E_COMMAND;
+               break;
+           case '.':
+               if (state == E_FROM) {
+                   lfrom = L_CURRENT;
+                   state = E_COMMA;
+               }
+               else if (state == E_TO) {
+                   lto = L_CURRENT;
+                   state = E_COMMAND;
+               }
+               else
+                   FAIL(T_OFFSET)
+               break;
+           case '+':
+               if (state == E_FROM) {
+                   lfinc = 1;
+                   lfrom = L_CURRENT;
+                   state = E_FINC;
+               }
+               else if (state == E_TO) {
+                   ltinc = 1;
+                   lto = L_CURRENT;
+                   state = E_TINC;
+               }
+               else
+                   FAIL(T_INCREMENT)
+               break;
+           case '-':       case '^':
+               if (state == E_FROM) {
+                   lfinc = -1;
+                   lfrom = L_CURRENT;
+                   state = E_FINC;
+               }
+               else if (state == E_TO) {
+                   ltinc = -1;
+                   lto = L_CURRENT;
+                   state = E_TINC;
+               }
+               else
+                   FAIL(T_INCREMENT)
+               number = -1;
+               break;
+           case ';':
+               if (state != E_FROM)
+                   FAIL(T_OFFSET)
+               lfrom = L_CURRENT;
+               lto = L_LAST;
+               state = E_COMMAND;
+               break;
+           case '1':       case '2':       case '3':
+           case '4':       case '5':       case '6':
+           case '7':       case '8':       case '9':
+               number = number * (ptr[-1] - '0');
+               while (isdigit(*ptr))
+                   number = number * 10 + (*ptr++ - '0');
+               if (state == E_FROM) {
+                   lfrom = number;
+                   state = E_COMMA;
+               }
+               else if (state == E_FINC) {
+                   lfinc = number;
+                   state = E_COMMA;
+               }
+               else if (state == E_TO) {
+                   lto = number;
+                   state = E_COMMAND;
+               }
+               else if (state == E_TINC) {
+                   ltinc = number;
+                   state = E_COMMAND;
+               }
+               else if (state == E_OPTIONS && action == A_REPLACE)
+                   offset = number - 1;
+               else
+                   FAIL(T_NUMBER)
+               number = 1;
+               break;
+           case '\0':
+               if (state == E_OPTIONS)
+                   break;
+           default:
+               FAIL(T_UNFINISHED)
+       }
+    }
+
+    replace = action == A_REPLACE;
+
+    switch (lfrom) {
+       case L_FIRST:
+           from = first;
+           break;
+       case L_LAST:
+           from = LSCAN(last, 1, False);
+           break;
+       case L_CURRENT:
+           if (lfinc <= 0)
+               from = LSCAN(position, -lfinc + 1, False);
+           else {
+               from = RSCAN(position, lfinc + 1, False);
+               from = LSCAN(from, 1, False);
+           }
+           break;
+       default:
+           from = RSCAN(first, lfrom, False);
+           from = LSCAN(from, 1, False);
+           break;
+    }
+    /* Just requesting to go to the numbered line */
+    if (state == E_COMMA || state == E_FINC) {
+       XawTextSetInsertionPoint(w, from);
+       return;
+    }
+
+    length = pend - pstart;
+    if (pstart == NULL || (replace && rstart == NULL) ||
+       length >= sizeof(einfo.pattern) - 1)
+       FAIL(T_UNFINISHED)
+
+    /* Need to (re)compile regular expression pattern? */
+    if ((!!(einfo.flags & RE_ICASE) ^ icase) ||
+       einfo.pat_length != length ||
+       memcmp(pstart, einfo.pattern,
+              length > einfo.pat_length ? einfo.pat_length : length)) {
+       compile = 1;
+       memcpy(einfo.pattern, pstart, length);
+       einfo.pattern[length] = '\0';
+       einfo.flags = icase ? RE_ICASE : 0;
+    }
+
+    /* Check range of lines to operate on */
+    switch (lto) {
+       case L_FIRST:
+           to = RSCAN(first, 1, True);
+           break;
+       case L_LAST:
+           to = last;
+           break;
+       case L_CURRENT:
+           if (ltinc < 0) {
+               to = LSCAN(position, -ltinc + 1, True);
+               to = RSCAN(to, 2, True);
+           }
+           else
+               to = RSCAN(position, ltinc + 1, True);
+           break;
+       default:
+           to = RSCAN(first, lto, True);
+           break;
+    }
+    if (from >= to)
+       FAIL(T_RANGE)
+
+    /* Set first and last position allowed to search/replace */
+    first = from;
+    last = to;
+
+    /* Check bounds to work on */
+    if (replace) {
+       int i, j, ch;
+
+       /* Check number of required match results and remove/parse backslashes */
+       einfo.slen = rend - rstart;
+       einfo.sref = 0;
+       einfo.soff = offset;
+       for (i = j = 0; i < einfo.slen; i++) {
+           ch = rstart[i];
+           if (ch == '\\') {
+               ++i;
+               switch (rstart[i]) {
+                   case '0':   ch = '\0';      break;
+                   case 'a':   ch = '\a';      break;
+                   case 'b':   ch = '\b';      break;
+                   case 'f':   ch = '\f';      break;
+                   case 'n':   ch = '\n';      break;
+                   case 'r':   ch = '\r';      break;
+                   case 't':   ch = '\t';      break;
+                   case 'v':   ch = '\v';      break;
+                   case '1':   case '2':       case '3':
+                   case '4':   case '5':       case '6':
+                   case '7':   case '8':       case '9':
+                       einfo.subst[j++] = '\\';
+                       if (rstart[i] - '0' > einfo.sref)
+                           einfo.sref = rstart[i] - '0';
+                       /* FALLTHROUGH */
+                   default:
+                       ch = rstart[i];
+                       break;
+               }
+           }
+           einfo.subst[j++] = ch;
+       }
+       einfo.slen = j;
+    }
+    else if (einfo.widget != w) {
+       /* Just a flag for backward search */
+       einfo.from = last;
+       einfo.widget = w;
+    }
+
+    /* Compile pattern if required */
+    if (compile) {
+       int ch;
+       char *eptr, *pptr;
+
+       /* Parse backslashes */
+       pptr = einfo.subst_pattern;
+       for (eptr = einfo.pattern, ch = *eptr++; ch; ch = *eptr++) {
+           if (ch == '\\') {
+               switch (*eptr) {
+                   case '0':   ch = '\0';  einfo.flags |= RE_PEND; break;
+                   case 'a':   ch = '\a';      break;
+                   case 'b':   ch = '\b';      break;
+                   case 'f':   ch = '\f';      break;
+                   case 'n':   ch = '\n';      break;
+                   case 'r':   ch = '\r';      break;
+                   case 't':   ch = '\t';      break;
+                   case 'v':   ch = '\v';      break;
+                   default:                    break;
+               }
+               if (ch != '\\')
+                   ++eptr;
+           }
+           *pptr++ = ch;
+       }
+       *pptr = '\0';
+
+       refree(&einfo.regex);
+       /* Allow nuls in search regex */
+       einfo.regex.re_endp = pptr;
+       ecode = recomp(&einfo.regex, einfo.subst_pattern, einfo.flags);
+       if (ecode)
+           goto print;
+    }
+
+    if (!replace && position >= first && position <= last) {
+       from = position;
+       /* The backwards repetition currently is only backwards when
+        * changing lines, so remember from where started, to also
+        * search in the first line. */
+       if (LSCAN(from, 1, False) == from) {
+           if (direction == XawsdLeft)
+               einfo.from = from;
+       }
+       else
+           flags |= RE_NOTBOL;
+    }
+    to = RSCAN(from, 1, True);
+
+    if (confirm) {
+       if (!replace)
+           FAIL(T_UNFINISHED)
+       einfo.widget = w;
+       einfo.state = SubstituteAsk;
+       einfo.from = from;
+       einfo.to = to;
+       einfo.first = first;
+       einfo.last = last;
+    }
+    else
+       einfo.state = SubstituteDisabled;
+
+confirm_label:
+    if (replace) {
+       redisplay = 1;
+       XawTextDisableRedisplay(w);
+    }
+
+    for (;;) {
+       if (confirm && einfo.state != SubstituteAsk) {
+           /* Restore state from previous call */
+           ecode = 0;
+           nth = einfo.soff;
+           /* einfo.mats should not have changed */
+           if (einfo.state == SubstituteYes) {
+               einfo.state = SubstituteAsk;
+               line = einfo.text_line;
+               goto substitute_label;
+           }
+           else {
+               ++nth;
+               einfo.state = SubstituteAsk;
+               from = einfo.from = einfo.end;
+               goto no_substitute_label;
+           }
+       }
+
+       /* Read or use a line of text inplace */
+       position = from;
+       length = to - from;
+       XawTextSourceRead(source, position, &block, to - position);
+       if (block.length >= length)
+           line = block.ptr;
+       else {
+           if (length > einfo.lsize) {
+               einfo.line = XtRealloc(einfo.line, to - from);
+               einfo.lsize = to - from;
+           }
+           memcpy(einfo.line, block.ptr, block.length);
+           length = block.length;
+           for (position += length;
+                position < to && block.length;
+                position += block.length) {
+               XawTextSourceRead(source, position, &block, to - position);
+               memcpy(einfo.line + length, block.ptr, block.length);
+               length += block.length;
+           }
+           line = einfo.line;
+       }
+
+       /* Execute expression */
+       einfo.mats[0].rm_so = 0;
+       einfo.mats[0].rm_eo = to - from;
+
+       /* If not last line or if it ends in a newline */
+       if (to != from) {
+           if (to < last || (to > from && line[einfo.mats[0].rm_eo - 1] == '\n'))
+               --einfo.mats[0].rm_eo;
+
+           ecode = reexec(&einfo.regex, line,
+                          einfo.sref + 1, &einfo.mats[0], flags);
+
+           if (replace && einfo.mats[0].rm_so == einfo.mats[0].rm_eo)
+               /* Ignore empty matches */
+               ecode = RE_NOMATCH;
+
+           if (ecode == 0 && confirm &&
+               (einfo.soff == O_ALL || nth == einfo.soff)) {
+               einfo.end = from + einfo.mats[0].rm_eo;
+               einfo.start = from + einfo.mats[0].rm_so;
+               XawTextSetInsertionPoint(w, einfo.end);
+               XawTextSetSelection(w, einfo.start, einfo.end);
+
+               einfo.state = SubstituteAsk;
+               einfo.from = from;
+               einfo.to = to;
+               einfo.first = first;
+               einfo.last = last;
+               einfo.text_line = line;
+               break;
+           }
+       }
+       else
+           /* Check bellow will update offsets */
+           ecode = RE_NOMATCH;
+
+substitute_label:
+       if (ecode == 0) {
+           from += einfo.mats[0].rm_so;
+           len = einfo.mats[0].rm_eo - einfo.mats[0].rm_so;
+
+           /* Found match */
+           if (replace) {
+               /* If not replacing all ocurrences, or if not
+                * at the correct offset */
+               if (einfo.soff != O_ALL && nth < einfo.soff) {
+                   from += len;
+                   ++nth;
+                   continue;
+               }
+
+               /* Do the substitution */
+               block.firstPos = 0;
+               block.format = FMT8BIT;
+               if (einfo.sref) {
+                   /* Hard way */
+                   int i, ref, xlen;
+
+                   for (i = length = 0; i < einfo.slen; i++) {
+                       if (length + 2 >= einfo.bsize) {
+                           einfo.bsize = einfo.bsize + 1024;
+                           einfo.buffer = XtRealloc(einfo.buffer, einfo.bsize);
+                       }
+                       if (einfo.subst[i] == '\\') {
+                           ++i;
+                           if (einfo.subst[i] >= '1' && einfo.subst[i] <= '9') {
+                               ref = einfo.subst[i] - '0';
+                               xlen = einfo.mats[ref].rm_eo -
+                                      einfo.mats[ref].rm_so;
+                               if (xlen < 0)
+                                   /* Oops, something went wrong... */
+                                   FAIL(T_BACKREF)
+                               if (length + xlen >= einfo.bsize) {
+                                   einfo.bsize += xlen + 1024 - (xlen % 1024);
+                                   einfo.buffer = XtRealloc(einfo.buffer,
+                                                            einfo.bsize);
+                               }
+                               memcpy(einfo.buffer + length,
+                                     line + einfo.mats[ref].rm_so, xlen);
+                               length += xlen;
+                           }
+                           else {
+                               einfo.buffer[length++] = einfo.subst[i - 1];
+                               einfo.buffer[length++] = einfo.subst[i];
+                           }
+                       }
+                       else
+                           einfo.buffer[length++] = einfo.subst[i];
+                   }
+                   block.ptr = einfo.buffer;
+                   block.length = length;
+               }
+               else {
+                   block.ptr = einfo.subst;
+                   block.length = length = einfo.slen;
+               }
+               adjust = length - len;
+               if (XawTextReplace(w, from, from + len, &block) != XawEditDone)
+                   FAIL(T_EDIT)
+               last += adjust;
+               to += adjust;
+               from += length;
+
+no_substitute_label:
+               if (einfo.soff != O_ALL) {
+                   nth = 0;
+                   to = RSCAN(from, 1, True);
+                   from = LSCAN(to, 1, False);
+                   if (to == last) {
+                       XawTextSetInsertionPoint(w, from);
+                       break;
+                   }
+               }
+               else
+                   flags |= RE_NOTBOL;
+           }
+           else {
+               XawTextSetInsertionPoint(w, from + len);
+               XawTextSetSelection(w, from, from + len);
+               break;
+           }
+       }
+       else if (ecode == RE_NOMATCH) {
+           nth = 0;
+
+           /* Try again in the next/previous line */
+           if (direction == XawsdLeft) {
+               from = LSCAN(to - 1, 1 + (from != to), False);
+               if (einfo.from <= first) {
+                   Feep();
+                   if (++count > 1) {
+                       XawTextSetInsertionPoint(w, position);
+                       XawTextUnsetSelection(w);
+                       break;
+                   }
+                   from = LSCAN(last, 1, False);
+               }
+               to = RSCAN(from, 1, True);
+               /* Can use einfo.from because replace is only done forward */
+               einfo.from = from;
+           }
+           else {
+               if (to >= last) {
+                   Feep();
+                   if (replace || ++count > 1) {
+                       XawTextSetInsertionPoint(w, position);
+                       XawTextUnsetSelection(w);
+                       einfo.state = SubstituteDisabled;
+                       confirm = 0;
+                       break;
+                   }
+                   to = first;
+               }
+               from = LSCAN(to + 1, 1, False);
+               to = RSCAN(from, 1, True);
+           }
+
+           /* Reset flags now */
+           flags = RE_STARTEND;
+       }
+       else
+           goto print;
+    }
+
+    if (redisplay)
+       XawTextEnableRedisplay(w);
+    /* If replacing not interatively return to the edit window after finished */
+    if (replace && !confirm) {
+       Arg args[1];
+
+       XtSetKeyboardFocus(topwindow, textwindow);
+       if (item->source != scratch)
+           XtSetArg(args[0], XtNstring, item->name);
+       else
+           XtSetArg(args[0], XtNstring, NULL);
+       XtSetValues(filenamewindow, args, 1);
+       line_edit = False;
+    }
+    return;
+
+print:
+    if (redisplay)
+       XawTextEnableRedisplay(w);
+
+    strcpy(buffer, "Regex error: ");
+    length = 13;
+    reerror(ecode, &einfo.regex,
+            buffer + length, sizeof(buffer) - length - 2);
+    strcat(buffer, "\n");
+    XeditPrintf("%s", buffer);
+    refree(&einfo.regex);
+    einfo.state = SubstituteDisabled;
+    Feep();
+    return;
+
+
+fail:
+    if (etype != T_NONE) {
+       switch (etype) {
+           case T_OPTION:
+               ptr = "Option needs a command";
+               break;
+           case T_ICASE:
+               ptr = "Icase needs an command defined or none for search";
+               break;
+           case T_COMMAND:
+               ptr = "Command incorrectly specified";
+               break;
+           case T_REPLACE:
+               ptr = "Can only search backwards";
+               break;
+           case T_SEARCH:
+               ptr = "Badly placed search/replace specifier";
+               break;
+           case T_BACKSLASH:
+               ptr = "A single backslash cannot be the last command character";
+               break;
+           case T_DIRECTION:
+               ptr = "Regular expression must be separeted by / or ? not both";
+               break;
+           case T_COMMA:
+               ptr = "Badly placed comma";
+               break;
+           case T_OFFSET:
+               ptr = "Badly placed line offset specifier";
+               break;
+           case T_INCREMENT:
+               ptr = "Badly placed line offset increment specifier";
+               break;
+           case T_NUMBER:
+               ptr = "Numeric argument not expected";
+               break;
+           case T_UNFINISHED:
+               ptr = "Unfinished command";
+               break;
+           case T_RANGE:
+               ptr = "Bad line range";
+               break;
+           case T_BACKREF:
+               /* This may be an internal re error, but most likely the
+                * user asked for something like "s/re0(re1)re2/\2/" */
+               ptr = "Bad backreference";
+               break;
+           case T_EDIT:
+               ptr = "Failed to replace text";
+               break;
+           default:
+               ptr = "Unknown error";
+               break;
+       }
+       XeditPrintf("Error: %s.\n", ptr);
+    }
+    if (redisplay)
+       XawTextEnableRedisplay(w);
+    einfo.state = SubstituteDisabled;
+    Feep();
+}
+
+static void
+SubstituteHook(Widget w, String action, XEvent *event)
+{
+    if (w != filenamewindow)
+       return;
+
+    if (line_edit && einfo.state == SubstituteAsk) {
+       if (strcmp(action, "newline") == 0 ||
+           strcmp(action, "load-file") == 0)
+           einfo.state = SubstituteAsk;
+       else if (strcmp(action, "insert-char") == 0) {
+           static XComposeStatus compose = {NULL, 0};
+           KeySym keysym;
+           char mb[sizeof(wchar_t)];
+
+           if (XLookupString((XKeyEvent*)event, mb, sizeof(mb),
+                             &keysym, &compose) == 1) {
+               if (*mb == 'y' || *mb == 'Y')
+                   einfo.state = SubstituteYes;
+               else if (*mb == 'n' || *mb == 'N')
+                   einfo.state = SubstituteNo;
+               else
+                   einfo.state = SubstituteDisabled;
+
+               if (einfo.state != SubstituteDisabled) {
+                   einfo.callback = 1;
+                   XtAddCallback(filenamewindow, XtNpositionCallback,
+                                 SubstituteCallback, NULL);
+               }
+           }
+       }
+       else if (strcmp(action, "cancel-find-file") == 0)
+           einfo.state = SubstituteDisabled;
+    }
+    if (einfo.state == SubstituteDisabled && einfo.callback) {
+       einfo.callback = 0;
+       XtRemoveCallback(filenamewindow, XtNpositionCallback,
+                        SubstituteCallback, NULL);
+    }
+}
+
+/*ARGSUSED*/
+static void
+SubstituteCallback(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    XawTextBlock block;
+
+    einfo.callback = 0;
+    XtRemoveCallback(filenamewindow, XtNpositionCallback,
+                    SubstituteCallback, NULL);
+
+    block.firstPos = 0;
+    block.format = FMT8BIT;
+    block.ptr = einfo.command;
+    block.length = strlen(einfo.command);
+
+    XawTextReplace(filenamewindow, 0,
+                  XawTextLastPosition(filenamewindow), &block);
+
+    LineEdit(einfo.widget);
+}
diff --git a/xedit/install-sh b/xedit/install-sh
new file mode 100755 (executable)
index 0000000..6781b98
--- /dev/null
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# 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.
+
+nl='
+'
+IFS=" ""       $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+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:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+       shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+       case $mode in
+         *' '* | *'    '* | *'
+'*       | *'*'* | *'?'* | *'['*)
+           echo "$0: invalid mode: $mode" >&2
+           exit 1;;
+       esac
+       shift;;
+
+    -o) chowncmd="$chownprog $2"
+       shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+       shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)        shift
+       break;;
+
+    -*)        echo "$0: invalid option: $1" >&2
+       exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # 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: $dst_arg: Is a directory" >&2
+       exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+       (dirname "$dst") 2>/dev/null ||
+       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+            X"$dst" : 'X\(//\)[^/]' \| \
+            X"$dst" : 'X\(//\)$' \| \
+            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+       echo X"$dst" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+       # Create intermediate dirs using mode 755 as modified by the umask.
+       # This is like FreeBSD 'install' as of 1997-10-28.
+       umask=`umask`
+       case $stripcmd.$umask in
+         # Optimize common cases.
+         *[2367][2367]) mkdir_umask=$umask;;
+         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+         *[0-7])
+           mkdir_umask=`expr $umask + 22 \
+             - $umask % 100 % 40 + $umask % 20 \
+             - $umask % 10 % 4 + $umask % 2
+           `;;
+         *) mkdir_umask=$umask,go-w;;
+       esac
+
+       # With -d, create the new directory with the user-specified mode.
+       # Otherwise, rely on $mkdir_umask.
+       if test -n "$dir_arg"; then
+         mkdir_mode=-m$mode
+       else
+         mkdir_mode=
+       fi
+
+       posix_mkdir=false
+       case $umask in
+         *[123567][0-7][0-7])
+           # POSIX mkdir -p sets u+wx bits regardless of umask, which
+           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+           ;;
+         *)
+           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+           if (umask $mkdir_umask &&
+               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+           then
+             if test -z "$dir_arg" || {
+                  # Check for POSIX incompatibilities with -m.
+                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                  # other-writeable bit of parent directory when it shouldn't.
+                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                  case $ls_ld_tmpdir in
+                    d????-?r-*) different_mode=700;;
+                    d????-?--*) different_mode=755;;
+                    *) false;;
+                  esac &&
+                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                  }
+                }
+             then posix_mkdir=:
+             fi
+             rmdir "$tmpdir/d" "$tmpdir"
+           else
+             # Remove any dirs left behind by ancient mkdir implementations.
+             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+           fi
+           trap '' 0;;
+       esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+       umask $mkdir_umask &&
+       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+       /*) prefix='/';;
+       -*) prefix='./';;
+       *)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+       test -z "$d" && continue
+
+       prefix=$prefix$d
+       if test -d "$prefix"; then
+         prefixes=
+       else
+         if $posix_mkdir; then
+           (umask=$mkdir_umask &&
+            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+           # Don't fail if two instances are running concurrently.
+           test -d "$prefix" || exit 1
+         else
+           case $prefix in
+             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+             *) qprefix=$prefix;;
+           esac
+           prefixes="$prefixes '$qprefix'"
+         fi
+       fi
+       prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+       # Don't fail if two instances are running concurrently.
+       (umask $mkdir_umask &&
+        eval "\$doit_exec \$mkdirprog $prefixes") ||
+         test -d "$dstdir" || exit 1
+       obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # 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
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"    2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+       # Now remove or move aside any old file at destination location.
+       # We try this two ways since rm can't unlink itself on some
+       # systems and the destination file might be busy for other
+       # reasons.  In this case, the final cleanup might fail but the new
+       # file should still install successfully.
+       {
+         test ! -f "$dst" ||
+         $doit $rmcmd -f "$dst" 2>/dev/null ||
+         { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+           { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+         } ||
+         { echo "$0: cannot unlink or rename $dst" >&2
+           (exit 1); exit 1
+         }
+       } &&
+
+       # Now rename the file to the real destination.
+       $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xedit/ispell.c b/xedit/ispell.c
new file mode 100644 (file)
index 0000000..842927c
--- /dev/null
@@ -0,0 +1,2229 @@
+/*
+ * Copyright (c) 1999 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XdotOrg: xc/programs/xedit/ispell.c,v 1.6 2004/12/04 00:43:13 kuhn Exp $ */
+/* $XFree86: xc/programs/xedit/ispell.c,v 1.19 2002/10/19 20:04:20 herrb Exp $ */
+
+#include "xedit.h"
+#include "util.h"
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <ctype.h>
+#include <locale.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <X11/Xaw/Toggle.h>
+#include <X11/Xaw/MenuButton.h>
+#include <X11/Xaw/SmeBSB.h>
+#include <X11/Xaw/SimpleMenu.h>
+#include <X11/Xos.h>
+
+#define RECEIVE                1
+#define SEND           2
+
+#define CHECK          0
+#define        ADD             1
+#define REMOVE         2
+
+#define        ASIS            1
+#define UNCAP          2
+
+/*
+ * Types
+ */
+#define UNDO_DEPTH     16
+typedef struct _ispell_undo {
+    char *undo_str;
+    int undo_count;
+    XawTextPosition undo_pos;
+    Boolean repeat;    /* two (misspelled?) words together */
+    Boolean terse;
+    int format;                /* remember text formatting style */
+    struct _ispell_undo *next, *prev;
+} ispell_undo;
+
+typedef struct _ispell_dict {
+    Widget sme;
+    char *wchars;
+    struct _ispell_dict *next;
+} ispell_dict;
+
+#define        TEXT    0
+#define HTML   1
+struct _ispell_format {
+    char *name;
+    int value;
+    Widget sme;
+};
+
+static struct _ispell_format ispell_format[] = {
+    {"text",   TEXT},
+    {"html",   HTML},
+};
+
+struct _ispell {
+    Widget shell, form, mispelled, repeated, word, replacement, text,
+          suggestions, viewport, list, commands, replace, status,
+          replaceAll, undo, ignore, ignoreAll, add, addUncap, suspend,
+          cancel, check, look, terse, options, dict, dictMenu,
+          format, formatMenu;
+
+    Widget ascii, source;
+    XtInputId id;
+    int pid, ifd[2], ofd[2];
+    XawTextPosition left, right;
+    char *item;
+    Bool lock;
+    Bool repeat;
+    Bool checkit;
+    int stat;
+    char *buf;
+    int bufsiz;
+    int buflen;
+    char sendbuf[1024];
+    char sentbuf[1024];
+
+    int undo_depth;
+    ispell_undo *undo_head, *undo_base;
+    char *undo_for;
+
+    char *wchars;
+    char *cmd;
+    char *skip;
+    char *command;
+    Boolean terse_mode, undo_terse_mode;
+    char *guess_label, *miss_label, *root_label, *none_label, *eof_label,
+        *compound_label, *ok_label, *repeat_label, *working_label, *look_label;
+    char *look_cmd;
+    char *words_file;
+
+    char *dictionary;
+    char *dict_list;
+    ispell_dict *dict_info;
+
+    int format_mode;   /* to undo correctly */
+    char *formatting;
+    struct _ispell_format *format_info;
+};
+
+typedef struct _ReplaceEntry ReplaceEntry;
+struct _ReplaceEntry {
+    hash_key   *word;
+    ReplaceEntry*next;
+    char       *replace;
+};
+
+typedef struct _IgnoreEntry IgnoreEntry;
+struct _IgnoreEntry {
+    hash_key   *word;
+    IgnoreEntry        *next;
+    int                add;
+};
+
+/*
+ * Prototypes
+ */
+static void AddIspell(Widget, XtPointer, XtPointer);
+static void ChangeDictionaryIspell(Widget, XtPointer, XtPointer);
+static void ChangeFormatIspell(Widget, XtPointer, XtPointer);
+static void CheckIspell(Widget, XtPointer, XtPointer);
+static void IgnoreIspell(Widget, XtPointer, XtPointer);
+static Bool InitIspell(void);
+static void IspellCheckUndo(void);
+static int IspellConvertHtmlAmp(char*);
+static Bool IspellDoIgnoredWord(char*, int, int);
+static Bool IspellIgnoredWord(char*, int, int);
+static void IspellInputCallback(XtPointer, int*, XtInputId*);
+static void IspellKillUndoBuffer(void);
+static Bool IspellReceive(void);
+static char *IspellReplacedWord(char*, char*);
+static int IspellSend(void);
+static void IspellSetSelection(XawTextPosition, XawTextPosition);
+static void IspellSetRepeated(Bool);
+static void IspellSetSensitive(Bool);
+static void IspellSetStatus(char*);
+static void IspellSetTerseMode(Bool);
+static Bool IspellStartProcess(void);
+static Bool IspellCheckProcess(void);
+static Bool IspellEndProcess(Bool, Bool);
+static void LookIspell(Widget, XtPointer, XtPointer);
+static void PopdownIspell(Widget, XtPointer, XtPointer);
+static void ReplaceIspell(Widget, XtPointer, XtPointer);
+static void RevertIspell(Widget, XtPointer, XtPointer);
+static void SelectIspell(Widget, XtPointer, XtPointer);
+static void ToggleTerseIspell(Widget, XtPointer, XtPointer);
+#ifndef SIGNALRETURNSINT
+static void timeout_signal(int);
+static void (*old_timeout)(int);
+#else
+static int timeout_signal(int);
+static int (*old_timeout)(int);
+#endif
+static void UndoIspell(Widget, XtPointer, XtPointer);
+
+Bool _XawTextSrcUndo(TextSrcObject, XawTextPosition*);
+
+/*
+ * Initialization
+ */
+static struct _ispell ispell;
+
+#define RSTRTBLSZ      23
+#define ISTRTBLSZ      71
+static hash_table *replace_hash;
+static hash_table *ignore_hash;
+
+#ifndef XtCStatus
+#define XtCStatus      "Status"
+#endif
+
+#define Offset(field) XtOffsetOf(struct _ispell, field)
+static XtResource resources[] = {
+    {"wordChars", "Chars", XtRString, sizeof(char*),
+       Offset(wchars), XtRString, ""},
+    {"ispellCommand", "CommandLine", XtRString, sizeof(char*),
+       Offset(cmd), XtRString, "/usr/local/bin/ispell"},
+    {"terseMode", "Terse", XtRBoolean, sizeof(Boolean),
+       Offset(terse_mode), XtRImmediate, (XtPointer)False},
+    {"guessLabel", XtCStatus, XtRString, sizeof(String),
+       Offset(guess_label), XtRString, "Guess"},
+    {"missLabel", XtCStatus, XtRString, sizeof(String),
+       Offset(miss_label), XtRString, "Miss"},
+    {"rootLabel", XtCStatus, XtRString, sizeof(String),
+       Offset(root_label), XtRString, "Root:"},
+    {"noneLabel", XtCStatus, XtRString, sizeof(String),
+       Offset(none_label), XtRString, "None"},
+    {"compoundLabel", XtCStatus, XtRString, sizeof(String),
+       Offset(compound_label), XtRString, "Compound"},
+    {"okLabel", XtCStatus, XtRString, sizeof(String),
+       Offset(ok_label), XtRString, "Ok"},
+    {"eofLabel", XtCStatus, XtRString, sizeof(String),
+       Offset(eof_label), XtRString, "End Of File"},
+    {"repeatLabel", XtCStatus, XtRString, sizeof(String),
+       Offset(repeat_label), XtRString, "Repeat"},
+    {"workingLabel", XtCStatus, XtRString, sizeof(String),
+       Offset(working_label), XtRString, "..."},
+    {"lookLabel", XtCStatus, XtRString, sizeof(String),
+       Offset(look_label), XtRString, "Look"},
+    {"lookCommand", "CommandLine", XtRString, sizeof(char*),
+       Offset(look_cmd), XtRString, "/usr/bin/egrep -i"},
+    {"wordsFile", "Words", XtRString, sizeof(char*),
+       Offset(words_file), XtRString, "/usr/share/dict/words"},
+    {"dictionary", "Dictionary", XtRString, sizeof(char*),
+       Offset(dictionary), XtRString, "american"},
+    {"dictionaries", "Dictionary", XtRString, sizeof(char*),
+       Offset(dict_list), XtRString, "american americanmed+ english"},
+    {"formatting", "TextFormat", XtRString, sizeof(char*),
+       Offset(formatting), XtRString, "text"},
+};
+#undef Offset
+
+#ifdef NO_LIBC_I18N
+static int
+ToLower(int ch)
+{
+    char buf[2];
+
+    *buf = ch;
+    XmuNCopyISOLatin1Lowered(buf, buf, sizeof(buf));
+
+    return (*buf);
+}
+
+static int
+ToUpper(int ch)
+{
+    char buf[2];
+
+    *buf = ch;
+    XmuNCopyISOLatin1Uppered(buf, buf, sizeof(buf));
+
+    return (*buf);
+}
+
+static int
+IsLower(int ch)
+{
+    char upbuf[2];
+    char lobuf[2];
+
+    *upbuf = *lobuf = ch;
+    XmuNCopyISOLatin1Lowered(lobuf, lobuf, sizeof(lobuf));
+    XmuNCopyISOLatin1Uppered(upbuf, upbuf, sizeof(upbuf));
+
+    return (*lobuf != *upbuf && ch == *lobuf);
+}
+
+static int
+IsUpper(int ch)
+{
+    char upbuf[2];
+    char lobuf[2];
+
+    *upbuf = *lobuf = ch;
+    XmuNCopyISOLatin1Lowered(lobuf, lobuf, sizeof(lobuf));
+    XmuNCopyISOLatin1Uppered(upbuf, upbuf, sizeof(upbuf));
+
+    return (*lobuf != *upbuf && ch == *upbuf);
+}
+#else
+#define        ToLower tolower
+#define ToUpper        toupper
+#define IsLower islower
+#define IsUpper isupper
+#endif
+
+/*
+ * Implementation
+ */
+#ifdef STDERR_FILENO
+# define WRITES(s) write(STDERR_FILENO, s, strlen(s))
+#else
+# define WRITES(s) write(fileno(stderr), s, strlen(s))
+#endif
+
+/*ARGSUSED*/
+#ifndef SIGNALRETURNSINT
+static void
+timeout_signal(int unused)
+{
+    int olderrno = errno;
+
+    WRITES("Warning: Timeout waiting ispell process to die.\n");
+    kill(ispell.pid, SIGTERM);
+    errno = olderrno;
+}
+#else
+static int
+timeout_signal(int unused)
+{
+    int olderrno = errno;
+
+    WRITES("Warning: Timeout waiting ispell process to die.\n");
+    kill(ispell.pid, SIGTERM);
+    
+    errno = olderrno;
+    return (0);
+}
+#endif
+
+static void
+IspellSetSelection(XawTextPosition left, XawTextPosition right)
+{
+    /* Try to make sure the selected word is completely visible */
+    XawTextSetInsertionPoint(ispell.ascii, right);
+    XawTextSetInsertionPoint(ispell.ascii, left);
+    XawTextSetSelection(ispell.ascii, left, right);
+}
+
+static void
+IspellSetStatus(char *label)
+{
+    Arg args[1];
+
+    XtSetArg(args[0], XtNlabel, label);
+    XtSetValues(ispell.status, args, 1);
+}
+
+static void
+IspellSetRepeated(Bool state)
+{
+    static char *mispelled, *repeated;
+    Arg args[1];
+
+    if (mispelled == NULL) {
+       XtSetArg(args[0], XtNlabel, &mispelled);
+       XtGetValues(ispell.mispelled, args, 1);
+       mispelled = XtNewString(mispelled);
+    }
+    if (repeated == NULL) {
+       XtSetArg(args[0], XtNlabel, &repeated);
+       XtGetValues(ispell.repeated, args, 1);
+       repeated = XtNewString(repeated);
+    }
+    XtSetSensitive(ispell.replaceAll, !state);
+    XtSetSensitive(ispell.ignoreAll, !state);
+    XtSetSensitive(ispell.add, !state);
+    XtSetSensitive(ispell.addUncap, !state);
+    if (!state) {
+       XtSetArg(args[0], XtNlabel, mispelled);
+       XtSetValues(ispell.mispelled, args, 1);
+    }
+    else {
+       XtSetArg(args[0], XtNlabel, repeated);
+       XtSetValues(ispell.mispelled, args, 1);
+    }
+}
+
+static void
+IspellSetSensitive(Bool state)
+{
+    XtSetSensitive(ispell.replace, state);
+    XtSetSensitive(ispell.replaceAll, state);
+    XtSetSensitive(ispell.ignore, state);
+    XtSetSensitive(ispell.ignoreAll, state);
+    XtSetSensitive(ispell.add, state);
+    XtSetSensitive(ispell.addUncap, state);
+}
+
+static void
+IspellSetTerseMode(Bool mode)
+{
+    Arg args[1];
+
+    XtSetArg(args[0], XtNstate, ispell.terse_mode = mode);
+    XtSetValues(ispell.terse, args, 1);
+    write(ispell.ofd[1], mode ? "!\n" : "%\n", 2);
+}
+
+static void
+IspellCheckUndo(void)
+{
+    ispell_undo *undo = XtNew(ispell_undo);
+
+    if (ispell.undo_for && strcmp(ispell.undo_for, ispell.dictionary)) {
+       XeditPrintf("Undo: Dictionary changed. Previous undo information lost.\n");
+       IspellKillUndoBuffer();
+       Feep();
+    }
+
+    undo->next = NULL;
+    undo->repeat = False;
+    undo->terse = ispell.undo_terse_mode;
+    undo->format = ispell.format_mode;
+    if ((undo->prev = ispell.undo_head) != NULL)
+       undo->prev->next = undo;
+    else
+       undo->prev = NULL;
+    ++ispell.undo_depth;
+    if (!ispell.undo_base) {
+       ispell.undo_base = undo;
+       XtSetSensitive(ispell.undo, True);
+    }
+    else if (ispell.undo_depth > UNDO_DEPTH) {
+       ispell_undo *tmp;
+
+       if (ispell.undo_base->undo_str)
+           XtFree(ispell.undo_base->undo_str);
+       tmp = ispell.undo_base->next;
+       XtFree((char*)ispell.undo_base);
+       tmp->prev = NULL;
+       ispell.undo_base = tmp;
+       ispell.undo_depth = UNDO_DEPTH;
+    }
+    ispell.undo_head = undo;
+}
+
+static char *
+IspellReplacedWord(char *word, char *replace)
+{
+    int                        word_len;
+    hash_key           *word_key;
+    ReplaceEntry       *entry;
+
+    word_len = strlen(word);
+    entry = (ReplaceEntry *)hash_check(replace_hash, word, word_len);
+    if (entry == NULL) {
+       word_key = XtNew(hash_key);
+       word_key->value = XtNewString(word);
+       word_key->length = word_len;
+       entry = XtNew(ReplaceEntry);
+       entry->word = word_key;
+       entry->replace = NULL;
+       entry->next = NULL;
+       hash_put(replace_hash, (hash_entry *)entry);
+    }
+
+    if (replace) {
+       XtFree(entry->replace);
+       entry->replace = XtNewString(replace);
+    }
+
+    return (entry->replace);
+}
+
+static Bool
+IspellDoIgnoredWord(char *word, int cmd, int add)
+{
+    int                word_len;
+    hash_key   *word_key;
+    IgnoreEntry        *entry;
+
+    word_len = strlen(word);
+    entry = (IgnoreEntry *)hash_check(ignore_hash, word, word_len);
+    if (entry == NULL) {
+       if (cmd != ADD)
+           return (False);
+
+       word_key = XtNew(hash_key);
+       word_key->value = XtNewString(word);
+       word_key->length = word_len;
+       entry = XtNew(IgnoreEntry);
+       entry->word = word_key;
+       entry->add = add;
+       entry->next = NULL;
+       hash_put(ignore_hash, (hash_entry *)entry);
+
+       return (True);
+    }
+    else if (cmd == REMOVE)
+       hash_rem(ignore_hash, (hash_entry *)entry);
+
+    return (cmd == CHECK);
+}
+
+static Bool
+IspellIgnoredWord(char *word, int cmd, int add)
+{
+    if (add != UNCAP && IspellDoIgnoredWord(word, cmd, add))
+       return (True);
+
+    /* add/remove uncapped word to/of list,
+     * or cheks for correct capitalization */
+    if (add == UNCAP || cmd == CHECK) {
+       unsigned char *str = (unsigned char*)word;
+       unsigned char string[1024];
+       Bool upper, status;
+       int i;
+
+       status = True;
+       upper = IsUpper(*str);
+       *string = upper ? ToLower(*str) : *str;
+       if (*str)
+           str++;
+       if (IsLower(*str))
+           upper = False;
+       for (i = 1; *str && i < sizeof(string) - 1; i++, str++) {
+           if (upper && IsLower(*str))
+               status = False;
+           else if (!upper && IsUpper(*str))
+               status = False;
+           string[i] = ToLower(*str);
+       }
+       string[i] = '\0';
+
+       if ((cmd != CHECK || status) &&
+           IspellDoIgnoredWord((char*)string, cmd, add))
+           return (True);
+    }
+
+    return (False);
+}
+
+/*ARGSUSED*/
+static Bool
+IspellReceive(void)
+{
+    int i, len, old_len;
+    Arg args[2];
+    char *str, *end, **list, **old_list;
+    char *tmp, word[1024];
+    int j;
+
+    if (ispell.lock || ispell.stat != RECEIVE)
+       return (False);
+
+    while (1) {                /* read the entire line */
+       if (ispell.buflen >= ispell.bufsiz - 1)
+           ispell.buf = XtRealloc(ispell.buf, ispell.bufsiz += BUFSIZ);
+       if ((len = read(ispell.ifd[0], &ispell.buf[ispell.buflen],
+                       ispell.bufsiz - ispell.buflen - 1)) <= 0)
+           break;
+       ispell.buflen += len;
+    }
+    if (ispell.buflen <= 0)
+       return (False);
+    len = 0;
+    i = ispell.buflen - 1;
+    while (i >= 0 && ispell.buf[i] == '\n') {
+       ++len;
+       --i;
+    }
+    if (len < 2 - ((ispell.terse_mode && i == -1) || ispell.buf[0] == '@'))
+       return (False);
+    ispell.buf[ispell.buflen - len] = '\0';
+    ispell.buflen = 0;
+
+    if ((tmp = strchr(ispell.sendbuf, '\n')) != NULL)
+       *tmp = '\0';
+
+    switch (ispell.buf[0]) {
+       case '&':       /* MISS */
+       case '?':       /* GUESS */
+           str = strchr(&ispell.buf[2], ' ');
+           if (!ispell.checkit) {
+               *str = '\0';
+               XtSetArg(args[0], XtNlabel, &ispell.buf[2]);
+               XtSetValues(ispell.word, args, 1);
+           }
+           ++str;
+           list = NULL;
+           str = strchr(str, ':') + 1;
+           for (i = 0; ; i++) {
+               end = strchr(str, ',');
+               if (end)        *end = '\0';
+               if ((i % 16) == 0)
+                   list = (char**)XtRealloc((char*)list, (i + 16) * sizeof(char*));
+               tmp = word;
+               for (j = 1; j < sizeof(word) && str[j]; j++) {
+                   if (str[j] == '+')
+                       continue;
+                   else if (str[j] == '-' && str[j+1] != '-' && str[j-1] != '-') {
+                       char *p, string[256];
+                       int k, l;
+
+                       for (l = 0, k = j + 1; str[k] != '+' && str[k] != '-'
+                            && str[k] && l < sizeof(string) - 1; k++, l++)
+                           string[l] = str[k];
+                       string[l] = '\0';
+                       *tmp = '\0';
+                       if (l && (p = strstr(word, string)) != NULL) {
+                           char *sav = p;
+
+                           while ((p = strstr(p + l, string)) != NULL)
+                               sav = p;
+                           p = sav;
+                           if (strcmp(p, string) == 0) {
+                               tmp = p;
+                               j = k - 1;
+                           }
+                           else
+                               *tmp++ = '-';
+                       }
+                       else
+                           *tmp++ = '-';
+                   }
+                   else
+                       *tmp++ = str[j];
+               }
+               *tmp = '\0';
+               list[i] = XtNewString(word);
+
+               if (end)        str = end + 1;
+               else            break;
+           }
+           len = i + 1;
+
+           XtSetArg(args[0], XtNlist, &old_list);
+           XtSetArg(args[1], XtNnumberStrings, &old_len);
+           XtGetValues(ispell.list, args, 2);
+
+           ispell.item = NULL;
+           if ((str = IspellReplacedWord(&ispell.buf[2], NULL)) != NULL)
+               for (i = 0; i < len; i++) {
+                   if (strcmp(list[i], str) == 0) {
+                       ispell.item = list[i];
+                       break;
+                   }
+               }
+           else
+               ispell.item = list[i = 0];
+           if (!ispell.item) {
+               list = (char**)XtRealloc((char*)list, (len + 1) * sizeof(char*));
+               ispell.item = list[i] = XtNewString(str);
+               ++len;
+           }
+
+           XtSetArg(args[0], XtNlist, list);
+           XtSetArg(args[1], XtNnumberStrings, len);
+           XtSetValues(ispell.list, args, 2);
+
+           XtSetSensitive(ispell.list, True);
+           if (!ispell.checkit)
+               XawListHighlight(ispell.list, i);
+
+           if (old_len > 1 || (XtName(ispell.list) != old_list[0])) {
+               while (--old_len > -1)
+                   XtFree(old_list[old_len]);
+               XtFree((char*)old_list);
+           }
+
+           if (!ispell.checkit) {
+               XtSetArg(args[0], XtNstring, ispell.item);
+               XtSetValues(ispell.text, args, 1);
+               IspellSetSelection(ispell.left, ispell.right);
+               if (ispell.repeat)
+                   IspellSetRepeated(ispell.repeat = False);
+           }
+
+           IspellSetStatus(ispell.buf[0] == '?' ?
+                           ispell.guess_label : ispell.miss_label);
+           ispell.undo_terse_mode = ispell.terse_mode;
+           ispell.format_mode = ispell.format_info->value;
+           ispell.lock = True;
+           break;
+       case '#':       /* NONE */
+       case '-':       /* COMPOUND */
+       case '+':       /* ROOT */
+       check_label:
+           str = &ispell.sendbuf[1];
+           if (!ispell.checkit) {
+               XtSetArg(args[0], XtNlabel, str);
+               XtSetValues(ispell.word, args, 1);
+           }
+
+           XtSetArg(args[0], XtNlist, &old_list);
+           XtSetArg(args[1], XtNnumberStrings, &old_len);
+           XtGetValues(ispell.list, args, 2);
+           ispell.item = NULL;
+
+           list = (char**)XtMalloc(sizeof(char**));
+           if ((tmp = IspellReplacedWord(str, NULL)) != NULL)
+               str = tmp;
+           if (tmp == NULL && ispell.buf[0] == '#')
+               list[0] = XtNewString("");
+           else
+               list[0] = XtNewString(str);
+
+           XtSetArg(args[0], XtNlist, list);
+           XtSetArg(args[1], XtNnumberStrings, 1);
+           XtSetValues(ispell.list, args, 2);
+
+           if (tmp == NULL && ispell.buf[0] == '#') {
+               XawListUnhighlight(ispell.list);
+               XtSetSensitive(ispell.list, False);
+           }
+           else {
+               XtSetSensitive(ispell.list, True);
+               if (!ispell.checkit)
+                   XawListHighlight(ispell.list, 0);
+           }
+           if (old_len > 1 || (XtName(ispell.list) != old_list[0])) {
+               while (--old_len > -1)
+                   XtFree(old_list[old_len]);
+               XtFree((char*)old_list);
+           }
+
+           if (!ispell.checkit) {
+               XtSetArg(args[0], XtNstring, str);
+               XtSetValues(ispell.text, args, 1);
+               IspellSetSelection(ispell.left, ispell.right);
+               if (ispell.repeat)
+                   IspellSetRepeated(ispell.repeat = False);
+           }
+
+           ispell.undo_terse_mode = ispell.terse_mode;
+           ispell.format_mode = ispell.format_info->value;
+           ispell.lock = True;
+           if (ispell.buf[0] == '+') {
+               if ((tmp = strchr(&ispell.buf[2], '\n')) != NULL)
+                   *tmp = '\0';
+               XmuSnprintf(word, sizeof(word), "%s %s",
+                           ispell.root_label, &ispell.buf[2]);
+               IspellSetStatus(word);
+           }
+           else
+               IspellSetStatus(ispell.buf[0] == '#' ? ispell.none_label :
+                               ispell.buf[0] == '-' ? ispell.compound_label :
+                               ispell.ok_label);
+           break;
+       case '*':       /* OK */
+       case '\0':      /* when running in terse mode */
+           if (!ispell.checkit)
+               (void)IspellIgnoredWord(&ispell.sendbuf[1], ADD, 0);
+           else
+               goto check_label;
+           ispell.lock = False;
+           break;
+       case '@':       /* Ispell banner */
+           /* it only happens when the dictionary is changed */
+           if (!ispell.repeat) {
+               XawTextPosition left, right;
+
+               ispell.stat = SEND;
+               while (IspellSend() == 0)
+                   ;
+               /* word chars may have changed */
+               XawTextGetSelectionPos(ispell.ascii, &left, &right);
+               if (left != ispell.left || right != ispell.right) {
+                   XtSetArg(args[0], XtNstring, &ispell.sendbuf[1]);
+                   XtSetValues(ispell.text, args, 1);
+                   IspellSetSelection(ispell.left, ispell.right);
+               }
+               ispell.checkit = True;
+           }
+           else {
+               IspellSetStatus(ispell.repeat_label);
+               ispell.undo_terse_mode = ispell.terse_mode;
+               ispell.format_mode = ispell.format_info->value;
+               ispell.lock = True;
+               return (True);
+           }
+           break;
+       default:
+           fprintf(stderr, "Unknown ispell command '%c'\n", ispell.buf[0]);
+           return (False);
+    }
+
+    if (!ispell.lock && !ispell.checkit) {
+       ispell.stat = SEND;
+       while (IspellSend() == 0)
+           ;
+    }
+
+    return (True);
+}
+
+static int
+IspellConvertHtmlAmp(char *buf)
+{
+    int len, ch = '?';
+
+    /* this function is static, so I can do it */
+    *strchr(++buf, ';') = '\0';
+
+    len = strlen(buf);
+    if (len == 0)
+       return ('&');
+    if (len > 1) {
+       if (strcasecmp(&buf[1], "lt") == 0)
+           ch = '<';
+       else if (strcasecmp(&buf[1], "gt") == 0)
+           ch = '>';
+       else if (strcasecmp(&buf[1], "nbsp") == 0)
+           ch = ' ';
+       else if (strcasecmp(&buf[1], "amp") == 0)
+           ch = '&';
+       else if (strcasecmp(&buf[1], "quot") == 0)
+           ch = '"';
+       else if (*buf == '#') {
+           char *tmp;
+
+           if (len == 1)
+               return ('?');
+           ch = strtol(&buf[1], &tmp, 10);
+           if (*tmp)
+               fprintf(stderr, "Warning: bad html interpreting '&#' mark.\n");
+       }
+       else if (strcmp(&buf[1], "acute") == 0) {
+           switch (*buf) {
+               case 'a': ch = 0xe1; break;
+               case 'e': ch = 0xe9; break;
+               case 'i': ch = 0xed; break;
+               case 'o': ch = 0xf3; break;
+               case 'u': ch = 0xfa; break;
+               case 'A': ch = 0xc1; break;
+               case 'E': ch = 0xc9; break;
+               case 'I': ch = 0xcd; break;
+               case 'O': ch = 0xd3; break;
+               case 'U': ch = 0xda; break;
+           }
+       }
+       else if (strcmp(&buf[1], "grave") == 0) {
+           switch (*buf) {
+               case 'a': ch = 0xe0; break;
+               case 'e': ch = 0xe8; break;
+               case 'i': ch = 0xec; break;
+               case 'o': ch = 0xf2; break;
+               case 'u': ch = 0xf9; break;
+               case 'A': ch = 0xc0; break;
+               case 'E': ch = 0xc8; break;
+               case 'I': ch = 0xcc; break;
+               case 'O': ch = 0xd2; break;
+               case 'U': ch = 0xd9; break;
+           }
+       }
+       else if (strcmp(&buf[1], "tilde") == 0) {
+           switch (*buf) {
+               case 'a': ch = 0xe3; break;
+               case 'o': ch = 0xf5; break;
+               case 'n': ch = 0xf1; break;
+               case 'A': ch = 0xe3; break;
+               case 'O': ch = 0xd5; break;
+               case 'N': ch = 0xd1; break;
+           }
+       }
+       else if (strcmp(&buf[1], "circ") == 0) {
+           switch (*buf) {
+               case 'a': ch = 0xe2; break;
+               case 'e': ch = 0xea; break;
+               case 'i': ch = 0xee; break;
+               case 'o': ch = 0xf4; break;
+               case 'u': ch = 0xfb; break;
+               case 'A': ch = 0xc2; break;
+               case 'E': ch = 0xca; break;
+               case 'I': ch = 0xce; break;
+               case 'O': ch = 0xd4; break;
+               case 'U': ch = 0xdb; break;
+           }
+       }
+       else if (strcmp(&buf[1], "cedil") == 0) {
+           switch (*buf) {
+               case 'c': ch = 0xe7; break;
+               case 'C': ch = 0xc7; break;
+           }
+       }
+       /* add more cases here */
+    }
+
+    return (ch);
+}
+
+/*ARGSUSED*/
+static int
+IspellSend(void)
+{
+    XawTextPosition position, old_left, pos;
+    XawTextBlock block;
+    int i, len, spaces, nls;
+    Bool nl, html, inside_html;
+    char ampbuf[32];
+    int amplen;
+
+    if (ispell.lock || ispell.stat != SEND)
+       return (-1);
+
+    len = 1;
+    ispell.sendbuf[0] = '^';   /* don't evaluate following characters as commands */
+
+    spaces = nls = 0;
+
+    html = ispell.format_info->value == HTML;
+    inside_html = False;
+    amplen = 0;
+
+    /* skip non word characters */
+    pos = position = ispell.right;
+    nl = False;
+    while (1) {
+       Bool done = False;
+       char mb[sizeof(wchar_t)];
+
+       retry_html_space:
+       position = XawTextSourceRead(ispell.source, position,
+                                    &block, BUFSIZ);
+       if (block.length == 0) {        /* end of file */
+           ispell.stat = 0;
+           ispell.lock = True;
+           XawTextSetInsertionPoint(ispell.ascii, ispell.right);
+           XawTextUnsetSelection(ispell.ascii);
+           IspellSetSensitive(False);
+           IspellSetStatus(ispell.eof_label);
+           return (-1);
+       }
+       for (i = 0; i < block.length; i++) {
+           if (international)
+               wctomb(mb, ((wchar_t*)block.ptr)[i]);
+           else
+               mb[0] = block.ptr[i];
+           if (amplen) {
+               if (amplen + 2 >= sizeof(ampbuf)) {
+                   if (!ispell.terse_mode)
+                       fprintf(stderr, "Warning: error interpreting '&' mark.\n");
+                   amplen = 0;
+                   position = pos + 1;
+                   goto retry_html_space;
+               }
+               else if ((ampbuf[amplen++] = *mb) == ';') {
+                   int ch;
+
+                   ampbuf[amplen] = '\0';
+                   ch = IspellConvertHtmlAmp(ampbuf);
+                   amplen = 0;
+                   if (isalpha(ch) ||
+                       (ch && strchr(ispell.wchars, ch))) {
+                       /* interpret it again */
+                       ispell.right = pos;
+                       i = 0;
+                       done = True;
+                       break;
+                   }
+                   else if ((ch == '\n' || isspace(ch)) && spaces >= 0)
+                       ++spaces;
+                   else
+                       spaces = -1;
+               }
+           }
+           else if (html && *mb == '&') {
+               ampbuf[amplen++] = *mb;
+               pos = block.firstPos + i;
+               continue;
+           }
+           else if ((!html || !inside_html) && (isalpha(*mb) ||
+               (*mb && strchr(ispell.wchars, *mb)))) {
+               done = True;
+               break;
+           }
+           else if (!html && *mb == '\n') {
+               nl = True;
+               if (++nls > 1 && (!html || !inside_html))
+                   spaces = -1;
+               else if (spaces >= 0)
+                   ++spaces;
+           }
+           else if (nl) {
+               nl = False;
+               if (*mb && strchr(ispell.skip, *mb)) {
+                   position = ispell.right =
+                       XawTextSourceScan(ispell.source, ispell.right + i,
+                                         XawstEOL, XawsdRight, 1, False);
+                   i = 0;
+                   break;
+               }
+               else if (spaces >= 0 && isspace(*mb))
+                   ++spaces;
+               else
+                   spaces = -1;
+           }
+           else if (html && inside_html) {
+               if (*mb == '>')
+                   inside_html = False;
+           }
+           else if (html && *mb == '<')
+               inside_html = True;
+           else if (spaces >= 0 && (isspace(*mb) || (html && *mb == '\n')))
+               ++spaces;
+           else
+               spaces = -1;
+       }
+
+       ispell.right += i;
+       if (done)
+           break;
+    }
+
+    old_left = ispell.left;
+
+    /* read a word */
+    position = ispell.left = ispell.right;
+    while (1) {
+       Bool done = False;
+       char mb[sizeof(wchar_t)];
+
+       retry_html_word:
+       position = XawTextSourceRead(ispell.source, position,
+                                    &block, BUFSIZ);
+       if (block.length == 0 && len == 1) {    /* end of file */
+           ispell.stat = 0;
+           ispell.lock = True;
+           XawTextSetInsertionPoint(ispell.ascii, ispell.right);
+           XawTextUnsetSelection(ispell.ascii);
+           IspellSetSensitive(False);
+           IspellSetStatus(ispell.eof_label);
+           return (-1);
+       }
+       for (i = 0; i < block.length; i++) {
+           if (international)
+               wctomb(mb, ((wchar_t*)block.ptr)[i]);
+           else
+               mb[0] = block.ptr[i];
+           if (amplen) {
+               if (amplen + 2 >= sizeof(ampbuf)) {
+                   if (!ispell.terse_mode)
+                       fprintf(stderr, "Warning: error interpreting '&' mark.\n");
+                   amplen = 0;
+                   position = pos + 1;
+                   if (strchr(ispell.wchars, '&')) {
+                       if (len + 1 >= sizeof(ispell.sendbuf) - 1) {
+                           done = True;
+                           fprintf(stderr, "Warning: word is too large!\n");
+                           break;
+                       }
+                       ispell.sendbuf[len++] = '&';
+                       goto retry_html_word;
+                   }
+                   else {
+                       ispell.right = position;
+                       i = 0;
+                       done = True;
+                       break;
+                   }
+               }
+               else if ((ampbuf[amplen++] = *mb) == ';') {
+                   int ch;
+
+                   ampbuf[amplen] = '\0';
+                   ch = IspellConvertHtmlAmp(ampbuf);
+                   amplen = 0;
+                   if (!isalpha(ch) &&
+                       (!ch || !strchr(ispell.wchars, ch))) {
+                       ispell.right = pos;
+                       i = 0;
+                       done = True;
+                       break;
+                   }
+                   *mb = ch;
+               }
+               else
+                   continue;
+           }
+           else if (html && *mb == '&') {
+               ampbuf[amplen++] = *mb;
+               pos = block.firstPos + i;
+               continue;
+           }
+           else if (!isalpha(*mb) && (!*mb || !strchr(ispell.wchars, *mb))) {
+               done = True;
+               break;
+           }
+           ispell.sendbuf[len] = *mb;
+           if (++len >= sizeof(ispell.sendbuf) - 1) {
+               done = True;
+               fprintf(stderr, "Warning: word is too large!\n");
+               break;
+           }
+       }
+       ispell.right += i;
+       if (done || block.length == 0)
+           break;
+    }
+
+    ispell.sendbuf[len] = '\0';
+
+    if (spaces > 0 && spaces <= 32 && strcmp(ispell.sendbuf, ispell.sentbuf) == 0) {
+       Arg args[2];
+       int old_len;    
+       char **list, **old_list;
+       char label[sizeof(ispell.sendbuf) + sizeof(ispell.sentbuf) + 32];
+
+       strcpy(label, &ispell.sendbuf[1]);
+       for (i = 0; i < spaces; i++)
+           label[len + i - 1] = ' ';
+       strcpy(&label[len + i - 1], &ispell.sendbuf[1]);
+       XtSetArg(args[0], XtNlabel, label);
+       XtSetValues(ispell.word, args, 1);
+
+       XtSetArg(args[0], XtNstring, &ispell.sendbuf[1]);
+       XtSetValues(ispell.text, args, 1);
+
+       XtSetArg(args[0], XtNlist, &old_list);
+       XtSetArg(args[1], XtNnumberStrings, &old_len);
+       XtGetValues(ispell.list, args, 2);
+       list = (char**)XtMalloc(sizeof(char**));
+       list[0] = XtNewString(&ispell.sendbuf[1]);
+       XtSetArg(args[0], XtNlist, list);
+       XtSetArg(args[1], XtNnumberStrings, 1);
+       XtSetValues(ispell.list, args, 2);
+       XtSetSensitive(ispell.list, True);
+       XawListHighlight(ispell.list, 0);
+       if (old_len > 1 || (XtName(ispell.list) != old_list[0])) {
+           while (--old_len > -1)
+               XtFree(old_list[old_len]);
+           XtFree((char*)old_list);
+       }
+
+       IspellSetRepeated(True);
+       IspellSetSelection(old_left, ispell.right);
+       IspellSetStatus(ispell.repeat_label);
+       ispell.repeat = ispell.lock = True;
+
+       return (1);
+    }
+    strcpy(ispell.sentbuf, ispell.sendbuf);
+
+    if (len <= 2 || IspellIgnoredWord(&ispell.sendbuf[1], CHECK, 0))
+       return (0);
+
+    ispell.sendbuf[len++] = '\n';
+
+    write(ispell.ofd[1], ispell.sendbuf, len);
+
+    ispell.stat = RECEIVE;
+
+    return (1);
+}
+
+/*ARGSUSED*/
+static void
+IspellInputCallback(XtPointer closure, int *source, XtInputId *id)
+{
+    if (ispell.right < 0) {
+       int len;
+       char buf[1024];
+
+       ispell.right = XawTextGetInsertionPoint(ispell.ascii);
+       ispell.right = XawTextSourceScan(ispell.source, ispell.right,
+                                             XawstEOL, XawsdLeft, 1, True);
+       len = read(ispell.ifd[0], buf, sizeof(buf));
+       if (strncmp(buf, "@(#)", 4) == 0) {
+           Arg args[1];
+
+           buf[len - 1] = '\0';
+           XtSetArg(args[0], XtNtitle, &buf[5]);
+           XtSetValues(ispell.shell, args, 1);
+       }
+       else
+           fprintf(stderr, "Error: is ispell talking with me?\n");
+       IspellSetTerseMode(ispell.terse_mode);
+       while (IspellSend() == 0)
+           ;
+    }
+    else if (ispell.source)
+       IspellReceive();
+}
+
+/*ARGSUSED*/
+void
+IspellCallback(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    Cardinal zero = 0;
+
+    IspellAction(textwindow, NULL, NULL, &zero);
+}
+
+/*ARGSUSED*/
+void
+IspellAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    Arg args[3];
+    Cardinal num_args;
+    char **strs, **list;
+    int n_strs;
+    Bool first_time = InitIspell();
+
+    if (*num_params == 1 && (params[0][0] == 'e' || params[0][0] == 'E')) {
+       PopdownIspell(w, (XtPointer)True, NULL);
+       return;
+    }
+
+    if (!XtIsSubclass(w, textWidgetClass) || ispell.source) {
+       Feep();
+       return;
+    }
+
+    ispell.source = XawTextGetSource(ispell.ascii = w);
+
+    if (first_time) {
+       /* let the user choose the better position for the ispell window */
+       Dimension width, height, b_width;
+       Position x, y, max_x, max_y;
+
+       x = y = -1;
+       if (event) {
+           switch (event->type) {
+               case ButtonPress:
+               case ButtonRelease:
+                   x = event->xbutton.x_root;
+                   y = event->xbutton.y_root;
+                   break;
+               case KeyPress:
+               case KeyRelease:
+                   x = event->xkey.x_root;
+                   y = event->xkey.y_root;
+                   break;
+           }
+       }
+       if (x < 0 || y < 0) {
+           Window r, c;
+           int rx, ry, wx, wy;
+           unsigned mask;
+
+           XQueryPointer(XtDisplay(ispell.shell), XtWindow(ispell.shell),
+                         &r, &c, &rx, &ry, &wx, &wy, &mask);
+           x = rx;
+           y = ry;
+       }
+
+       num_args = 0;
+       XtSetArg(args[num_args], XtNwidth, &width);             num_args++;
+       XtSetArg(args[num_args], XtNheight, &height);           num_args++;
+       XtSetArg(args[num_args], XtNborderWidth, &b_width);     num_args++;
+       XtGetValues(ispell.shell, args, num_args);
+
+       width += b_width << 1;
+       height += b_width << 1;
+
+       x -= (Position)(width >> 1);
+       if (x < 0)
+           x = 0;
+       if (x > (max_x = (Position)(XtScreen(w)->width - width)))
+           x = max_x;
+
+       y -= (Position)(height >> 1);
+       if (y < 0)
+           y = 0;
+       if (y > (max_y = (Position)(XtScreen(w)->height - height)))
+           y = max_y;
+
+       num_args = 0;
+       XtSetArg(args[num_args], XtNx, x);      num_args++;
+       XtSetArg(args[num_args], XtNy, y);      num_args++;
+       XtSetValues(ispell.shell, args, num_args);
+    }
+
+    if (ispell.repeat)
+       IspellSetRepeated(False);
+    ispell.lock = ispell.repeat = ispell.checkit = False;
+    ispell.stat = SEND;
+
+    IspellSetSensitive(True);
+    XtSetSensitive(ispell.undo, False);
+
+    XtSetArg(args[0], XtNlabel, "");
+    XtSetValues(ispell.word, args, 1);
+
+    XtSetArg(args[0], XtNstring, "");
+    XtSetValues(ispell.text, args, 1);
+
+    XtSetArg(args[0], XtNlist, &strs);
+    XtSetArg(args[1], XtNnumberStrings, &n_strs);
+    XtGetValues(ispell.list, args, 2);
+
+    list = (char**)XtMalloc(sizeof(char**));
+    list[0] = XtNewString("");
+    XtSetArg(args[0], XtNlist, list);
+    XtSetArg(args[1], XtNnumberStrings, 1);
+    XtSetValues(ispell.list, args, 2);
+
+    if (n_strs > 1 || (XtName(ispell.list) != strs[0])) {
+       while (--n_strs > -1)
+           XtFree(strs[n_strs]);
+       XtFree((char*)strs);
+    }
+
+    IspellSetStatus(ispell.working_label);
+
+    if (!ispell.pid)
+       (void)IspellStartProcess();
+    else {
+       ispell.right = XawTextGetInsertionPoint(ispell.ascii);
+       ispell.right = XawTextSourceScan(ispell.source, ispell.right,
+                                             XawstEOL, XawsdLeft, 1, True);
+       while (IspellSend() == 0)
+           ;
+    }
+
+    XtPopup(ispell.shell, XtGrabExclusive);
+    XtSetKeyboardFocus(ispell.shell, ispell.text);
+}
+
+static Bool
+IspellStartProcess(void)
+{
+    if (!ispell.pid) {
+       int len;
+       char format[32];
+       static char *command;
+
+       ispell.source = XawTextGetSource(ispell.ascii);
+
+       if (command)
+           XtFree(command);
+
+       strcpy(format, "%s -a");
+       len = strlen(ispell.cmd) + 4;
+       if (ispell.dictionary && *ispell.dictionary) {
+           len += strlen(ispell.dictionary) + 6;
+           strcat(format, " -d '%s'");
+           if (ispell.wchars && *ispell.wchars) {
+               len += strlen(ispell.wchars + 6);
+               strcat(format, " -w '%s'");
+           }
+       }
+       command = XtMalloc(len);
+       XmuSnprintf(command, len, format,
+                   ispell.cmd, ispell.dictionary, ispell.wchars);
+
+       pipe(ispell.ifd);
+       pipe(ispell.ofd);
+       if ((ispell.pid = fork()) == 0) {
+           close(0);
+           close(1);
+           dup2(ispell.ofd[0], 0);
+           dup2(ispell.ifd[1], 1);
+           close(ispell.ofd[0]);
+           close(ispell.ofd[1]);
+           close(ispell.ifd[0]);
+           close(ispell.ifd[1]);
+           if (!international)
+               setlocale(LC_ALL, "ISO-8859-1");
+           execl("/bin/sh", "sh", "-c", command, NULL);
+           exit(-127);
+       }
+       else if (ispell.pid < 0) {
+           fprintf(stderr, "Cannot fork\n");
+           exit(1);
+       }
+       ispell.buf = XtMalloc(ispell.bufsiz = BUFSIZ);
+       ispell.right = -1;
+       ispell.id = XtAppAddInput(XtWidgetToApplicationContext(ispell.shell),
+                                 ispell.ifd[0], (XtPointer)XtInputReadMask,
+                                 IspellInputCallback, NULL);
+       fcntl(ispell.ifd[0], F_SETFL, O_NONBLOCK);
+    }
+    else
+       return (False);
+
+    return (True);
+}
+
+/*ARGSUSED*/
+static void
+PopdownIspell(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    (void)IspellEndProcess((Bool)(long)client_data, True);
+    XtPopdown(ispell.shell);
+    *ispell.sentbuf = '\0';
+}
+
+static Bool
+IspellCheckProcess(void)
+{
+    int status;
+
+    if (ispell.pid) {
+       waitpid(ispell.pid, &status, WNOHANG);
+       if (WIFEXITED(status)) {
+           ispell.pid = 0;
+       }
+       else
+           return (True);
+    }
+
+    return (False);
+}
+
+static Bool
+IspellEndProcess(Bool killit, Bool killundo)
+{
+    ispell.source = NULL;
+
+    if (ispell.pid) {
+       IgnoreEntry     *ientry;
+       ReplaceEntry    *rentry;
+
+       /* insert added words in private dictionary */
+       for (ientry = (IgnoreEntry *)hash_iter_first(ignore_hash);
+            ientry;
+            ientry = (IgnoreEntry *)hash_iter_next(ignore_hash)) {
+           if (ientry->add) {
+               if (ientry->add == UNCAP)
+                   write(ispell.ofd[1], "&", 1);
+               else
+                   write(ispell.ofd[1], "*", 1);
+               write(ispell.ofd[1], ientry->word->value, ientry->word->length);
+               write(ispell.ofd[1], "\n", 1);
+           }
+       }
+       write(ispell.ofd[1], "#\n", 2);         /* save dictionary */
+       hash_clr(ignore_hash);
+
+       if (killit) {
+           XtRemoveInput(ispell.id);
+
+           close(ispell.ofd[0]);
+           close(ispell.ofd[1]);
+           close(ispell.ifd[0]);
+           close(ispell.ifd[1]);
+
+           /* if something goes wrong, we don't want to block here forever */
+           old_timeout = signal(SIGALRM, timeout_signal);
+           alarm(10);
+           waitpid(ispell.pid, NULL, 0);
+           alarm(0);
+           signal(SIGALRM, old_timeout);
+
+           ispell.pid = 0;
+           if (ispell.buf)
+               XtFree(ispell.buf);
+           ispell.buf = NULL;
+
+           /* forget about replace matches */
+           for (rentry = (ReplaceEntry *)hash_iter_first(replace_hash);
+                rentry;
+                rentry = (ReplaceEntry *)hash_iter_next(replace_hash)) {
+               XtFree(rentry->replace);
+           }
+           hash_clr(replace_hash);
+       }
+
+       if (killundo)
+           IspellKillUndoBuffer();
+    }
+    else
+       return (False);
+
+    return (True);
+}
+
+static void
+IspellKillUndoBuffer(void)
+{
+    ispell_undo *undo, *pundo;
+
+    undo = pundo = ispell.undo_base;
+    while (undo) {
+       undo = undo->next;
+       if (pundo->undo_str)
+           XtFree(pundo->undo_str);
+       XtFree((char*)pundo);
+       pundo = undo;
+    }
+    ispell.undo_base = ispell.undo_head = NULL;
+    ispell.undo_for = NULL;
+    ispell.undo_depth = 0;
+    XtSetSensitive(ispell.undo, False);
+}
+
+/*ARGSUSED*/
+static void
+RevertIspell(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    Arg args[1];
+    char *string, *repstr = NULL;
+
+    XtSetArg(args[0], XtNlabel, &string);
+    XtGetValues(ispell.word, args, 1);
+    if ((repstr = strchr(string, ' ')) != NULL) {
+       string = repstr = XtNewString(string);
+       *strchr(repstr, ' ') = '\0';
+    }
+    XtSetArg(args[0], XtNstring, string);
+    XtSetValues(ispell.text, args, 1);
+    if (repstr)
+       XtFree(repstr);
+}
+
+/*ARGSUSED*/
+static void
+SelectIspell(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    XawListReturnStruct *info = (XawListReturnStruct *)call_data;
+    Arg args[1];
+
+    XtSetArg(args[0], XtNstring, ispell.item = info->string);
+    XtSetValues(ispell.text, args, 1);
+}
+
+/*ARGSUSED*/
+void
+ReplaceIspell(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    XawTextPosition pos = XawTextGetInsertionPoint(ispell.ascii);
+    XawTextBlock check, search, replace;
+    Arg args[1];
+    char *text;
+
+    if (!ispell.lock)
+       return;
+
+    XtSetArg(args[0], XtNlabel, &text);
+    XtGetValues(ispell.word, args, 1);
+    search.ptr = text;
+    search.format = XawFmt8Bit;
+    search.firstPos = 0;
+    search.length = ispell.right - pos;
+
+    XtSetArg(args[0], XtNstring, &text);
+    XtGetValues(ispell.text, args, 1);
+    replace.ptr = text;
+    replace.format = XawFmt8Bit;
+    replace.firstPos = 0;
+    replace.length = strlen(text);
+
+    if (strcmp(search.ptr, replace.ptr) != 0 &&
+       XawTextReplace(ispell.ascii, pos, pos + search.length,
+                      &replace) == XawEditDone) {
+       ispell.right += replace.length - search.length;
+       IspellCheckUndo();
+       ispell.undo_head->undo_str = NULL;
+       ispell.undo_head->undo_pos = pos;
+       ispell.undo_head->undo_count = 1;
+
+       if (ispell.repeat) {
+           ispell.undo_head->repeat = 2; /* To recognize later it was replaced */
+           ispell.undo_head->undo_count = ispell.right;
+           ispell.undo_head->undo_str = XtNewString(search.ptr);
+       }
+       if (client_data && !ispell.repeat) {
+           XawTextDisableRedisplay(ispell.ascii);
+           pos = ispell.right;
+           while ((pos = XawTextSourceSearch(ispell.source, pos, XawsdRight, &search))
+               != XawTextSearchError) {
+               Bool do_replace = True;
+               char mb[sizeof(wchar_t)];
+
+               if (XawTextSourceRead(ispell.source, pos - 1, &check, 1) > 0) {
+                   if (international)
+                       wctomb(mb, *(wchar_t*)check.ptr);
+                   else
+                       mb[0] = check.ptr[0];
+                   do_replace = !isalpha(*mb) && *mb && !strchr(ispell.wchars, *mb);
+               }
+               if (do_replace &&
+                   XawTextSourceRead(ispell.source, pos + search.length, &check, 1) > 0) {
+                   if (international)
+                       wctomb(mb, *(wchar_t*)check.ptr);
+                   else
+                       mb[0] = check.ptr[0];
+                   do_replace = !isalpha(*mb) && *mb && !strchr(ispell.wchars, *mb);
+               }
+               if (do_replace) {
+                   XawTextReplace(ispell.ascii, pos, pos + search.length, &replace);
+                   ++ispell.undo_head->undo_count;
+               }
+               pos += search.length;
+           }
+           XawTextEnableRedisplay(ispell.ascii);
+       }
+       (void)IspellReplacedWord(search.ptr, replace.ptr);
+
+       strncpy(&ispell.sentbuf[1], replace.ptr, sizeof(ispell.sentbuf) - 2);
+       ispell.sentbuf[sizeof(ispell.sentbuf) - 1] = '\0';
+    }
+    else
+       Feep();
+
+    if (ispell.repeat)
+       ispell.right = ispell.left = XawTextGetInsertionPoint(ispell.ascii);
+    else if (!ispell.terse_mode || !ispell.item ||
+            strcmp(ispell.item, replace.ptr))
+       ispell.right = ispell.left;     /* check it again! */
+
+    ispell.lock = ispell.checkit = False;
+
+    ispell.stat = SEND;
+    IspellSetStatus(ispell.working_label);
+    while (IspellSend() == 0)
+       ;
+}
+
+/*ARGSUSED*/
+void
+IgnoreIspell(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    Arg args[1];
+    char *text;
+
+    if (!ispell.lock)
+       return;
+
+    XtSetArg(args[0], XtNlabel, &text);
+    XtGetValues(ispell.word, args, 1);
+
+    IspellCheckUndo();
+
+    if ((ispell.undo_head->repeat = ispell.repeat) != False) {
+       ispell.undo_head->undo_count = ispell.right;
+       ispell.undo_head->undo_str = XtNewString(text);
+    }
+    else
+       ispell.undo_head->undo_count = 0;
+
+    ispell.undo_head->undo_pos = XawTextGetInsertionPoint(ispell.ascii);
+
+    if (!ispell.repeat) {
+       if (client_data) {
+           IspellIgnoredWord(text, ADD, 0);
+           ispell.undo_head->undo_str = XtNewString(text);
+       }
+       else 
+           ispell.undo_head->undo_str = NULL;
+    }
+
+    ispell.lock = ispell.checkit = False;
+
+    ispell.stat = SEND;
+    IspellSetStatus(ispell.working_label);
+    while (IspellSend() == 0)
+       ;
+}
+
+/*ARGSUSED*/
+void
+AddIspell(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    Arg args[1];
+    char *text;
+    int cmd = (long)client_data;
+
+    if (!ispell.lock || ispell.repeat)
+       return;
+
+    XtSetArg(args[0], XtNlabel, &text);
+    XtGetValues(ispell.word, args, 1);
+
+    IspellCheckUndo();
+    ispell.undo_head->undo_str = XtNewString(text);
+    ispell.undo_head->undo_pos = XawTextGetInsertionPoint(ispell.ascii);
+    ispell.undo_head->undo_count = -cmd;
+
+    (void)IspellIgnoredWord(text, ADD, cmd);
+
+    ispell.lock = ispell.checkit = False;
+    ispell.stat = SEND;
+    IspellSetStatus(ispell.working_label);
+    while (IspellSend() == 0)
+       ;
+}
+
+/*ARGSUSED*/
+static void
+UndoIspell(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    Bool enable_redisplay = False;
+    ispell_undo *undo = ispell.undo_head;
+
+    if ((!ispell.lock && ispell.stat) || !undo)
+       return;
+
+    if (ispell.undo_for && strcmp(ispell.undo_for, ispell.dictionary)) {
+       XeditPrintf("Undo: Dictionary changed. Undo information was lost.\n");
+       IspellKillUndoBuffer();
+       Feep();
+       return;
+    }
+
+    if (undo->terse != ispell.terse_mode)
+       IspellSetTerseMode(undo->terse);
+
+    if (undo->format != ispell.format_info->value) {
+       struct _ispell_format *fmt = &ispell_format[undo->format];
+       ChangeFormatIspell(fmt->sme, (XtPointer)fmt, NULL);
+    }
+
+    if (undo->undo_count > 0 && !undo->repeat) {
+       XawTextPosition tmp;
+
+       enable_redisplay = undo->undo_count > 1;
+       if (enable_redisplay)
+           XawTextDisableRedisplay(ispell.ascii);
+       while (undo->undo_count--)
+           if (!_XawTextSrcUndo((TextSrcObject)ispell.source, &tmp)) {
+               Feep();
+               break;
+           }
+    }
+    else if (undo->undo_count < 0) {
+       if (undo->undo_str)
+           (void)IspellIgnoredWord(undo->undo_str, REMOVE, -undo->undo_count);
+    }
+    else if (undo->undo_str) {
+       if (!undo->repeat)
+           IspellIgnoredWord(undo->undo_str, REMOVE, 0);
+    }
+
+    XawTextSetInsertionPoint(ispell.ascii,
+                            ispell.right = ispell.left = undo->undo_pos);
+    if (enable_redisplay)
+       XawTextEnableRedisplay(ispell.ascii);
+
+    /* need to do it because may be two misspelled words together */
+    if (undo->repeat) {
+       char **list, **old_list;
+       int old_len;
+       Arg args[2];
+
+       if (undo->repeat > 1) {
+           XawTextDisableRedisplay(ispell.ascii);
+           if (!_XawTextSrcUndo((TextSrcObject)ispell.source, &ispell.right))
+               Feep();
+           XawTextEnableRedisplay(ispell.ascii);
+       }
+       else
+           ispell.right = (XawTextPosition)undo->undo_count;
+       IspellSetRepeated(ispell.repeat = True);
+       XtSetArg(args[0], XtNlabel, undo->undo_str);
+       XtSetValues(ispell.word, args, 1);
+       XmuSnprintf(ispell.sentbuf, sizeof(ispell.sentbuf), "^%s",
+                   strrchr(undo->undo_str, ' ') + 1);
+       strcpy(ispell.sendbuf, ispell.sentbuf);
+       XtSetArg(args[0], XtNstring, &ispell.sentbuf[1]);
+       XtSetValues(ispell.text, args, 1);
+
+       XtSetArg(args[0], XtNlist, &old_list);
+       XtSetArg(args[1], XtNnumberStrings, &old_len);
+       XtGetValues(ispell.list, args, 2);
+
+       list = (char **)XtMalloc(sizeof(char*));
+       list[0] = XtNewString(&ispell.sentbuf[1]);
+       XtSetArg(args[0], XtNlist, list);
+       XtSetArg(args[1], XtNnumberStrings, 1);
+       XtSetValues(ispell.list, args, 2);
+       XtSetSensitive(ispell.list, True);
+       XawListHighlight(ispell.list, 0);
+
+       if (old_len > 1 || (XtName(ispell.list) != old_list[0])) {
+           while (--old_len > -1)
+               XtFree(old_list[old_len]);
+           XtFree((char*)old_list);
+       }
+
+       IspellSetSelection(ispell.left, ispell.right);
+       IspellSetStatus(ispell.repeat_label);
+       ispell.lock = True;
+       ispell.checkit = False;
+    }
+    else if (ispell.repeat) {
+       *ispell.sentbuf = '\0';
+       IspellSetRepeated(ispell.repeat = False);
+    }
+
+    if (undo->prev)
+       undo->prev->next = NULL;
+    ispell.undo_head = undo->prev;
+    if (undo == ispell.undo_base) {
+       ispell.undo_base = NULL;
+       ispell.undo_for = NULL;
+       XtSetSensitive(ispell.undo, False);
+    }
+    if (undo->undo_str)
+       XtFree(undo->undo_str);
+    XtFree((char*)undo);
+    --ispell.undo_depth;
+
+    if (!ispell.stat || ispell.checkit)
+       IspellSetSensitive(True);
+
+    if (!ispell.repeat) {
+       ispell.lock = ispell.checkit = False;
+       ispell.stat = SEND;
+       IspellSetStatus(ispell.working_label);
+       while (IspellSend() == 0)
+           ;
+    }
+}
+
+/*ARGSUSED*/
+static void
+CheckIspell(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    Arg args[1];
+    char *text, *str, string[1024];
+    int i, len;
+
+    if (!ispell.lock)
+       return;
+
+    XtSetArg(args[0], XtNstring, &text);
+    XtGetValues(ispell.text, args, 1);
+
+    /* Check only a word at a time */
+    len = 0;
+    str = text;
+    while (*str) {
+       if (isalpha(*str) || strchr(ispell.wchars, *str))
+           break;
+       ++str;
+       ++len;
+    }
+    i = 0;
+    while (*str) {
+       if (isalpha(*str) || strchr(ispell.wchars, *str))
+           string[i++] = *str++;
+       else
+           break;
+    }
+    string[i] = '\0';
+
+    if (strcmp(text, string)) {
+       XawTextPosition pos = XawTextGetInsertionPoint(ispell.text) - len;
+
+       XtSetArg(args[0], XtNstring, string);
+       XtSetValues(ispell.text, args, 1);
+       XawTextSetInsertionPoint(ispell.text, pos);
+       Feep();
+    }
+
+    if (i == 0) {
+       Feep();
+       return;
+    }
+
+    len = XmuSnprintf(ispell.sendbuf, sizeof(ispell.sendbuf), "^%s\n", string);
+
+    ispell.sendbuf[sizeof(ispell.sendbuf) - 1] = '\n';
+
+    write(ispell.ofd[1], ispell.sendbuf, len);
+
+    ispell.lock = False;
+    ispell.checkit = True;
+    ispell.stat = RECEIVE;
+}
+
+/*ARGSUSED*/
+static void
+LookIspell(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    int len, old_len;
+    FILE *fd;
+    Arg args[2];
+    char *text, *str, **list, **old_list, command[1024], buffer[1024];
+    Bool sensitive = True;
+
+    if (!ispell.lock)
+       return;
+
+    XtSetArg(args[0], XtNstring, &text);
+    XtGetValues(ispell.text, args, 1);
+
+    if (!*text) {
+       Feep();
+       return;
+    }
+
+    if (strlen(ispell.look_cmd) + strlen(text) + strlen(ispell.words_file) + 8
+       > sizeof(command) - 1) {
+       fprintf(stderr, "Command line too large\n");
+       return;
+    }
+
+    XmuSnprintf(command, sizeof(command), "%s '^%s.*$' %s",
+               ispell.look_cmd, text, ispell.words_file);
+
+    if ((fd = popen(command, "r")) == NULL) {
+       fprintf(stderr, "Cannot popen '%s'\n", ispell.look_cmd);
+       return;
+    }
+
+    list = NULL;
+    len = 0;
+
+#define        MAX_LOOK_RESULTS        256
+    while (fgets(buffer, sizeof(buffer), fd) != NULL) {
+       if ((str = strchr(buffer, '\n')) == NULL) {
+           fprintf(stderr, "String is too large\n");
+           break;
+       }
+       *str = '\0';
+       if ((len % 16) == 0)
+           list = (char**)XtRealloc((char*)list, sizeof(char*) * (len + 16));
+       list[len] = XtNewString(buffer);
+       if (++len >= MAX_LOOK_RESULTS) {
+           Feep();
+           break;
+       }
+    }
+#undef MAX_LOOK_RESULTS
+
+    XtSetArg(args[0], XtNlist, &old_list);
+    XtSetArg(args[1], XtNnumberStrings, &old_len);
+    XtGetValues(ispell.list, args, 2);
+
+    if (len == 0) {
+       list = (char**)XtMalloc(sizeof(char*));
+       list[0] = XtNewString("");
+       len = 1;
+       sensitive = False;
+    }
+
+    XtSetArg(args[0], XtNlist, list);
+    XtSetArg(args[1], XtNnumberStrings, len);
+    XtSetValues(ispell.list, args, 2);
+
+    XtSetSensitive(ispell.list, sensitive);
+    IspellSetStatus(sensitive ? ispell.look_label : ispell.none_label);
+
+    if (old_len > 1 || (XtName(ispell.list) != old_list[0])) {
+       while (--old_len > -1)
+           XtFree(old_list[old_len]);
+       XtFree((char*)old_list);
+    }
+
+    pclose(fd);
+}
+
+/*ARGSUSED*/
+static void
+ToggleTerseIspell(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    if (!ispell.lock)
+       return;
+
+    ispell.terse_mode = !ispell.terse_mode;
+    write(ispell.ofd[1], ispell.terse_mode ? "!\n" : "%\n", 2);
+}
+
+/*ARGSUSED*/
+static void
+ChangeDictionaryIspell(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    ispell_dict *tmp, *dic = (ispell_dict*)client_data;
+    XawTextPosition pos = XawTextGetInsertionPoint(ispell.ascii);
+    XawTextPosition right = ispell.right;
+    Arg args[1];
+
+    if (strcmp(XtName(dic->sme), ispell.dictionary) == 0)
+       return;
+
+    if (!ispell.lock) {
+       if (IspellCheckProcess()) {
+           Feep();
+           return;
+       }
+    }
+
+    for (tmp = ispell.dict_info; tmp; tmp = tmp->next)
+       if (strcmp(XtName(tmp->sme), ispell.dictionary) == 0) {
+           XtSetArg(args[0], XtNleftBitmap, None);
+           XtSetValues(tmp->sme, args, 1);
+       }
+
+    if (ispell.undo_base && !ispell.undo_for)
+       ispell.undo_for = ispell.dictionary;
+
+    XtSetArg(args[0], XtNleftBitmap, flist.pixmap);
+    XtSetValues(dic->sme, args, 1);
+    ispell.dictionary = XtName(dic->sme);
+    ispell.wchars = dic->wchars;
+    XtSetArg(args[0], XtNlabel, XtName(dic->sme));
+    XtSetValues(ispell.dict, args, 1);
+
+    IspellSetStatus(ispell.working_label);
+
+    (void)IspellEndProcess(True, False);
+    ispell.lock = ispell.checkit = False;
+    (void)IspellStartProcess();
+
+    ispell.stat = RECEIVE;
+
+    /* restart at the same selected word */
+    if (ispell.repeat == False)
+       ispell.left = ispell.right = pos;
+    else
+       ispell.right = right;
+}
+
+/*ARGSUSED*/
+static void
+ChangeFormatIspell(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    struct _ispell_format *fmt = (struct _ispell_format*)client_data;
+    Arg args[1];
+
+    if (strcmp(fmt->name, ispell.formatting) == 0)
+       return;
+
+    if (!ispell.lock) {
+       Feep();
+       return;
+    }
+
+    XtSetArg(args[0], XtNleftBitmap, None);
+    XtSetValues(ispell.format_info->sme, args, 1);
+
+    XtSetArg(args[0], XtNleftBitmap, flist.pixmap);
+    XtSetValues(fmt->sme, args, 1);
+    ispell.formatting = fmt->name;
+    ispell.format_info = fmt;
+    XtSetArg(args[0], XtNlabel, fmt->name);
+    XtSetValues(ispell.format, args, 1);
+}
+
+static Bool
+InitIspell(void)
+{
+    Atom delete_window;
+    char *str, *list;
+    XtResource dict_res;
+    ispell_dict *dict, *prev_dict;
+    int i;
+    static XtResource text_res[] = {
+       {"skipLines", "Skip", XtRString, sizeof(char*),
+        XtOffsetOf(struct _ispell, skip), XtRString, "#"},
+    };
+
+    if (ispell.shell)
+       return (False);
+
+    replace_hash = hash_new(RSTRTBLSZ, NULL);
+    ignore_hash = hash_new(ISTRTBLSZ, NULL);
+
+    ispell.shell       = XtCreatePopupShell("ispell", transientShellWidgetClass,
+                                            topwindow, NULL, 0);
+
+    XtGetApplicationResources(ispell.shell, (XtPointer)&ispell, resources,
+                             XtNumber(resources), NULL, 0);
+
+    ispell.form                = XtCreateManagedWidget("form", formWidgetClass,
+                                               ispell.shell, NULL, 0);
+    ispell.mispelled   = XtCreateManagedWidget("mispelled", labelWidgetClass,
+                                               ispell.form, NULL, 0);
+    ispell.repeated    = XtCreateWidget("repeated", labelWidgetClass,
+                                        ispell.form, NULL, 0);
+    ispell.word                = XtCreateManagedWidget("word", commandWidgetClass,
+                                               ispell.form, NULL, 0);
+    XtAddCallback(ispell.word, XtNcallback, RevertIspell, NULL);
+    ispell.replacement = XtCreateManagedWidget("replacement", labelWidgetClass,
+                                               ispell.form, NULL, 0);
+    ispell.text                = XtVaCreateManagedWidget("text", asciiTextWidgetClass,
+                                               ispell.form,
+                                               XtNeditType, XawtextEdit,
+                                               NULL);
+    ispell.suggestions = XtCreateManagedWidget("suggestions", labelWidgetClass,
+                                               ispell.form, NULL, 0);
+    ispell.viewport    = XtCreateManagedWidget("viewport", viewportWidgetClass,
+                                               ispell.form, NULL, 0);
+    ispell.list                = XtCreateManagedWidget("list", listWidgetClass,
+                                               ispell.viewport, NULL, 0);
+    XtAddCallback(ispell.list, XtNcallback, SelectIspell, NULL);
+    ispell.commands    = XtCreateManagedWidget("commands", formWidgetClass,
+                                               ispell.form, NULL, 0);
+    ispell.check       = XtCreateManagedWidget("check", commandWidgetClass,
+                                               ispell.commands, NULL, 0);
+    XtAddCallback(ispell.check, XtNcallback, CheckIspell, NULL);
+    ispell.look                = XtCreateManagedWidget("look", commandWidgetClass,
+                                               ispell.commands, NULL, 0);
+    XtAddCallback(ispell.look, XtNcallback, LookIspell, NULL);
+    ispell.undo                = XtCreateManagedWidget("undo", commandWidgetClass,
+                                               ispell.commands, NULL, 0);
+    XtAddCallback(ispell.undo, XtNcallback, UndoIspell, NULL);
+    ispell.replace     = XtCreateManagedWidget("replace", commandWidgetClass,
+                                               ispell.commands, NULL, 0);
+    XtAddCallback(ispell.replace, XtNcallback, ReplaceIspell, (XtPointer)False);
+    ispell.replaceAll  = XtCreateManagedWidget("replaceAll", commandWidgetClass,
+                                               ispell.commands, NULL, 0);
+    XtAddCallback(ispell.replaceAll, XtNcallback, ReplaceIspell, (XtPointer)True);
+    ispell.ignore      = XtCreateManagedWidget("ignore", commandWidgetClass,
+                                               ispell.commands, NULL, 0);
+    XtAddCallback(ispell.ignore, XtNcallback, IgnoreIspell, (XtPointer)False);
+    ispell.ignoreAll   = XtCreateManagedWidget("ignoreAll", commandWidgetClass,
+                                               ispell.commands, NULL, 0);
+    XtAddCallback(ispell.ignoreAll, XtNcallback, IgnoreIspell, (XtPointer)True);
+    ispell.add         = XtCreateManagedWidget("add", commandWidgetClass,
+                                               ispell.commands, NULL, 0);
+    XtAddCallback(ispell.add, XtNcallback, AddIspell, (XtPointer)ASIS);
+    ispell.addUncap    = XtCreateManagedWidget("addUncap", commandWidgetClass,
+                                               ispell.commands, NULL, 0);
+    XtAddCallback(ispell.addUncap, XtNcallback, AddIspell, (XtPointer)UNCAP);
+    ispell.suspend     = XtCreateManagedWidget("suspend", commandWidgetClass,
+                                               ispell.commands, NULL, 0);
+    XtAddCallback(ispell.suspend, XtNcallback, PopdownIspell, (XtPointer)False);
+    ispell.cancel      = XtCreateManagedWidget("cancel", commandWidgetClass,
+                                               ispell.commands, NULL, 0);
+    XtAddCallback(ispell.cancel, XtNcallback, PopdownIspell, (XtPointer)True);
+    ispell.terse       = XtVaCreateManagedWidget("terse", toggleWidgetClass,
+                                                 ispell.commands,
+                                                 XtNstate, ispell.terse_mode,
+                                                 NULL);
+    XtAddCallback(ispell.terse, XtNcallback, ToggleTerseIspell, NULL);
+    ispell.status      = XtCreateManagedWidget("status", labelWidgetClass,
+                                               ispell.form, NULL, 0);
+    ispell.options     = XtCreateManagedWidget("options", formWidgetClass,
+                                               ispell.form, NULL, 0);
+    ispell.dict                = XtVaCreateManagedWidget("dict", menuButtonWidgetClass,
+                                                 ispell.options,
+                                                 XtNmenuName, "dictionaries",
+                                                 NULL);
+    ispell.dictMenu    = XtCreatePopupShell("dictionaries", simpleMenuWidgetClass,
+                                            ispell.options, NULL, 0);
+    XtRealizeWidget(ispell.dictMenu);
+
+    ispell.format      = XtVaCreateManagedWidget("format", menuButtonWidgetClass,
+                                                 ispell.options,
+                                                 XtNmenuName, "formats",
+                                                 NULL);
+    ispell.formatMenu  = XtCreatePopupShell("formats", simpleMenuWidgetClass,
+                                            ispell.options, NULL, 0);
+    XtRealizeWidget(ispell.formatMenu);
+
+    XtRealizeWidget(ispell.shell);
+
+    for (i = 0; i < sizeof(ispell_format) / sizeof(ispell_format[0]); i++) {
+       struct _ispell_format *fmt = &ispell_format[i];
+
+       fmt->sme = XtCreateManagedWidget(fmt->name, smeBSBObjectClass,
+                                        ispell.formatMenu, NULL, 0);
+       XtAddCallback(fmt->sme, XtNcallback, ChangeFormatIspell, (XtPointer)fmt);
+
+       if (strcmp(fmt->name, ispell.formatting) == 0) {
+           Arg args[1];
+
+           XtSetArg(args[0], XtNlabel, ispell.formatting);
+           XtSetValues(ispell.format, args, 1);
+           XtSetArg(args[0], XtNleftBitmap, flist.pixmap);
+           XtSetValues(fmt->sme, args, 1);
+           ispell.format_info = fmt;
+       }
+    }
+    if (ispell.format_info == NULL) {
+       Arg args[1];
+       char msg[256];
+
+       ispell.format_info = &ispell_format[TEXT];
+
+       XmuSnprintf(msg, sizeof(msg),
+                   "Unrecognized formatting type \"%s\", will use \"%s\"",
+                   ispell.formatting, ispell.format_info->name);
+       XtAppWarning(XtWidgetToApplicationContext(ispell.shell), msg);
+       ispell.formatting = ispell.format_info->name;
+
+       XtSetArg(args[0], XtNlabel, ispell.format_info->name);
+       XtSetValues(ispell.format, args, 1);
+       XtSetArg(args[0], XtNleftBitmap, flist.pixmap);
+       XtSetValues(ispell.format_info->sme, args, 1);
+    }
+    XtGetApplicationResources(ispell_format[TEXT].sme, (XtPointer)&ispell,
+                             text_res, XtNumber(text_res), NULL, 0);
+
+    dict_res.resource_name = "wordChars";
+    dict_res.resource_class = "Chars";
+    dict_res.resource_type = XtRString;
+    dict_res.resource_size = sizeof(char*);
+    dict_res.resource_offset = XtOffsetOf(ispell_dict, wchars);
+    dict_res.default_type = XtRString;
+    dict_res.default_addr = "";
+
+    list = XtNewString(ispell.dict_list);
+
+    /* Create first empty entry */
+    dict = XtNew(ispell_dict);
+    dict->sme = XtCreateManagedWidget("", smeBSBObjectClass,
+                                     ispell.dictMenu, NULL, 0);
+    dict->wchars = "";
+    XtAddCallback(dict->sme, XtNcallback, ChangeDictionaryIspell,
+                 (XtPointer)dict);
+    ispell.dict_info = prev_dict = dict;
+
+    for (str = strtok(list, " \t,"); str; str = strtok(NULL, " \t,")) {
+       dict = XtNew(ispell_dict);
+       dict->sme = XtCreateManagedWidget(str, smeBSBObjectClass,
+                                         ispell.dictMenu, NULL, 0);
+       XtGetApplicationResources(dict->sme, (XtPointer)dict, &dict_res,
+                                 1, NULL, 0);
+       XtAddCallback(dict->sme, XtNcallback, ChangeDictionaryIspell,
+                     (XtPointer)dict);
+       prev_dict->next = dict;
+       prev_dict = dict;
+       dict->next = NULL;
+    }
+    XtFree(list);
+
+    for (dict = ispell.dict_info; dict; dict = dict->next) {
+       if (strcmp(XtName(dict->sme), ispell.dictionary) == 0) {
+           Arg args[1];
+
+           XtSetArg(args[0], XtNleftBitmap, flist.pixmap);
+           XtSetValues(dict->sme, args, 1);
+           XtSetArg(args[0], XtNlabel, XtName(dict->sme));
+           XtSetValues(ispell.dict, args, 1);
+           ispell.wchars = dict->wchars;
+           break;
+       }
+    }
+
+
+    delete_window = XInternAtom(XtDisplay(ispell.shell), "WM_DELETE_WINDOW", False);
+    XSetWMProtocols(XtDisplay(ispell.shell), XtWindow(ispell.shell), &delete_window, 1);
+
+    return (True);
+}
diff --git a/xedit/lisp.c b/xedit/lisp.c
new file mode 100644 (file)
index 0000000..7191979
--- /dev/null
@@ -0,0 +1,274 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp.c,v 1.20tsi Exp $ */
+
+#include "xedit.h"
+#include "lisp/lisp.h"
+#include "lisp/xedit.h"
+#include <unistd.h>
+#include <locale.h>
+#include <ctype.h>
+
+#include <X11/Xaw/SmeBSB.h>
+#include <X11/Xaw/SimpleMenu.h>
+
+/*
+ * Prototypes
+ */
+static void XeditDoLispEval(Widget);
+static void EditModeCallback(Widget, XtPointer, XtPointer);
+
+/*
+ * Initialization
+ */
+static int lisp_initialized;
+extern Widget scratch;
+static Widget edit_mode_menu, edit_mode_entry, edit_mode_none;
+
+/*
+ * Implementation
+ */
+void
+XeditLispInitialize(void)
+{
+    setlocale(LC_NUMERIC, "C");
+    lisp_initialized = 1;
+    LispBegin();
+    LispXeditInitialize();
+}
+
+void
+XeditLispCleanUp(void)
+{
+    LispEnd();
+}
+
+void
+XeditLispEval(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    XeditDoLispEval(messwidget);
+}
+
+void
+XeditPrintLispEval(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    if (XawTextGetSource(w) == scratch) {
+       XtCallActionProc(w, "newline", event, params, *num_params);
+       XeditDoLispEval(w);
+    }
+    else
+       XtCallActionProc(w, "newline-and-indent", event, params, *num_params);
+}
+
+void
+XeditKeyboardReset(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    XtCallActionProc(w, "keyboard-reset", event, params, *num_params);
+}
+
+void
+SetTextProperties(xedit_flist_item *item)
+{
+    if (lisp_initialized) {
+       Widget source = XawTextGetSource(textwindow);
+       XawTextPosition top = XawTextTopPosition(textwindow);
+
+       if (source != item->source)
+           XawTextSetSource(textwindow, item->source, 0);
+       XeditLispSetEditMode(item, NULL);
+       if (source != item->source)
+           XawTextSetSource(textwindow, source, top);
+    }
+}
+
+void
+UnsetTextProperties(xedit_flist_item *item)
+{
+    XeditLispUnsetEditMode(item);
+}
+
+static void
+XeditDoLispEval(Widget output)
+{
+    Widget src;
+    XawTextBlock block;
+    XawTextPosition position, end;
+
+    /* get lisp expression */
+    src = XawTextGetSource(textwindow);
+    position = XawTextGetInsertionPoint(textwindow);
+    --position;
+    while (position >= 0) {
+       (void)XawTextSourceRead(src, position, &block, 1);
+       if (!isspace(block.ptr[0]))
+           break;
+       --position;
+    }
+    end = position + 1;
+
+    if (block.ptr[0] != ')') {
+       while (position >= 0) {
+           (void)XawTextSourceRead(src, position, &block, 1);
+           if (isspace(block.ptr[0]) ||
+               block.ptr[0] == '(' ||
+               block.ptr[0] == ')' ||
+               block.ptr[0] == '"' ||
+               block.ptr[0] == '|')
+               break;
+           --position;
+       }
+       if (!isspace(block.ptr[0]))
+           ++position;
+    }
+    else {
+       /* XXX note that embedded '(' and ')' will confuse this code */
+       XawTextPosition last, tmp;
+       int level = 0;
+       char ptr[2];
+
+       last = position;
+       ptr[1] = '\0';
+       block.ptr = ptr;
+       do {
+           block.ptr[0] = '(';
+           position = XawTextSourceSearch(src, last, XawsdLeft, &block);
+           if (position == XawTextSearchError) {
+               Feep();
+               return;
+           }
+           block.ptr[0] = ')';
+           tmp = position;
+           do {
+               tmp = XawTextSourceSearch(src, tmp, XawsdRight, &block);
+               if (tmp == XawTextSearchError) {
+                   Feep();
+                   return;
+               }
+               if (tmp <= last)
+                   ++level;
+           } while (++tmp <= last);
+           --level;
+           last = position;
+       } while (level);
+       /* check for extra characters */
+       while (position > 0) {
+           (void)XawTextSourceRead(src, position - 1, &block, 1);
+           if (block.length != 1 ||
+               isspace(block.ptr[0]) ||
+               block.ptr[0] == ')' ||
+               block.ptr[0] == '"' ||
+               block.ptr[0] == '|')
+               break;
+           --position;
+       }
+    }
+
+    if (position < 0 || position >= end)
+       Feep();
+    else
+       XeditLispExecute(output, position, end);
+}
+
+void
+CreateEditModePopup(Widget parent)
+{
+    int i;
+    Widget sme;
+    static char *editModes = "editModes";
+
+    XtVaCreateManagedWidget("modeMenuItem", smeBSBObjectClass, parent,
+                           XtNmenuName, editModes, NULL);
+    edit_mode_menu = XtCreatePopupShell(editModes, simpleMenuWidgetClass,
+                                       parent, NULL, 0);
+    XtRealizeWidget(edit_mode_menu);
+
+    edit_mode_none = XtCreateManagedWidget("none", smeBSBObjectClass,
+                                          edit_mode_menu, NULL, 0);
+    XtAddCallback(edit_mode_none, XtNcallback, EditModeCallback, NULL);
+
+    for (i = 0; i < num_mode_infos; i++) {
+       sme = XtVaCreateManagedWidget("mode", smeBSBObjectClass, edit_mode_menu,
+                                     XtNlabel, mode_infos[i].desc, NULL);
+       XtAddCallback(sme, XtNcallback, EditModeCallback,
+                     (XtPointer)(mode_infos + i));
+       mode_infos[i].sme = sme;
+    }
+}
+
+void
+SetEditModeMenu(void)
+{
+    int i;
+    Widget old_entry = edit_mode_entry, new_entry = edit_mode_none;
+    xedit_flist_item *item = FindTextSource(XawTextGetSource(textwindow), NULL);
+
+    for (i = 0; i < num_mode_infos; i++) {
+       if (item->xldata && item->xldata->syntax &&
+           mode_infos[i].syntax == item->xldata->syntax) {
+           new_entry = mode_infos[i].sme;
+           break;
+       }
+    }
+
+    if (old_entry != new_entry) {
+       if (old_entry)
+           XtVaSetValues(old_entry, XtNleftBitmap, None, NULL);
+       XtVaSetValues(new_entry, XtNleftBitmap, flist.pixmap, NULL);
+       edit_mode_entry = new_entry;
+    }
+}
+
+static void
+EditModeCallback(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    Widget source = XawTextGetSource(textwindow);
+    EditModeInfo *info = (EditModeInfo*)client_data;
+    xedit_flist_item *item = FindTextSource(source, NULL);
+
+    /* If no edit mode selected and selecting the plain/none mode */
+    if ((info == NULL &&
+        (item->xldata == NULL || item->xldata->syntax == NULL)) ||
+       /* if selecting the current mode */
+       (info && item && item->xldata && info->syntax &&
+        info->syntax == item->xldata->syntax))
+       return;
+
+    XawTextSourceClearEntities(source,
+                              XawTextSourceScan(source, 0, XawstAll,
+                                                XawsdLeft, 1, True),
+                              XawTextSourceScan(source, 0, XawstAll,
+                                                XawsdRight, 1, True));
+    XeditLispUnsetEditMode(item);
+    if (info)
+       XeditLispSetEditMode(item, info->symbol);
+    else
+       item->properties = NULL;
+    UpdateTextProperties(1);
+}
diff --git a/xedit/lisp/README b/xedit/lisp/README
new file mode 100644 (file)
index 0000000..f6e5fdb
--- /dev/null
@@ -0,0 +1,195 @@
+$XFree86: xc/programs/xedit/lisp/README,v 1.12 2002/11/23 08:26:47 paulo Exp $
+
+LAST UPDATED:  $Date$
+
+
+    SUMMARY
+
+  This is a small lisp interpreter for xedit. It implements a subset of
+Common Lisp and the xedit package implements several of the basic Emacs
+lisp functions.
+
+(shared modules not broken, but needs a redesign for better performance,
+ but won't be made available in the default build probably for a long time,
+ it would be really better to generate the interface dinamically, and/or just
+ link agains't the required libraries and use a ffi interface)
++------------------------------------------------------------------------
+|   It has a very simple method for loading shared modules, slightly based on
+| the XFree86 loader code, that is currently disabled by default. To enable it,
+| edit lisp.cf and change BuildSharedLispModules to YES.
+|
+|   Assuming you have built it with BuildSharedLispModules enabled, you can build
+| a small test application can be built in this directory running "make lsp".
+| Two lisp programs are available in the test directory. To test the programs
+| run "./lsp test/hello.lsp" or "./lsp test/widgets.lsp".
++------------------------------------------------------------------------
+
+  Currently, it should be used as an helper and/or a small calculator embedded
+in xedit. For the future it should be possible to write entire interfaces
+in the xedit text buffers.
+
+
+    USAGE SUMMARY
+
+  To evaluate lisp expressions, put the text cursor just after the
+lisp expression and press:
+C-x,C-e        - will evaluate it, and print the result to the message window
+C-j    - will evaluate it, and print the result to the edit window, any
+         errors are printed to the message window.
+C-g    - will send an SIGINT to the lisp process, and that process will
+         stop whatever it was processing and jump to the toplevel,
+         to wait for more input.
+
+Note that C-j will only work in the *scratch* buffer.
+
+
+     NOTES
+
+  The improvements to xedit including the several possibilites to extend
+the editor using Lisp are expected to allow making of xedit a versatile
+text editor for programming, but there is code being (slowly) developed
+that should also make it useable as a small word processor, for things
+like WYSIWYG html, etc.
+  The xedit development is being done very slowly, maybe it will get
+somewhere someday, but it is a pet/hobby project, there is no intention
+of making of it an end user editor (the idea is to make it an useful
+development tool).
+  In some aspects the development is trying to mimic several Emacs
+features, but there is no intention of competition (if xedit ever get
+something better than Emacs, I hope that it serves as a motivation to
+make of Emacs an even better editor), actually it is expected to explore
+different areas and use alternate solutions for the implementation.
+  Most work in a computer is done in a text editor and the more the editor
+can help the user the better.
+
+
+(debugger is broken and very slow, no prevision for fixing it, but is
+ expected to work correctly for interpreted only code)
++------------------------------------------------------------------------
+|     DEBUGGER
+|
+|   There is a, currently, very simple debugger implement in the interpreter.
+| The debugger is now optional, and off by default. To make it available,
+| you need to recompile with -DDEBUGGER.
+| To use the debugger, run the lsp sample program as "./lsp -d", and optionally
+| pass a second parameter, for the file to be interpreted. Once the debugger
+| prompt is visible, type "help" for a summary of options. To leave the debugger
+| type "continue".
+|   Note that the debugger is still very simple, it won't work from xedit, and
+| won't drop to the debugger on "fatal errors". It allows adding breakpoints to
+| functions and watchpoints to variables. Support for changing data and going to
+| the debugger on fatal errors should be added at some time.
++------------------------------------------------------------------------
+
+
+    COMPILER
+
+  Now there is a very simple bytecode compiler. It is far from finished, but
+for simple code can show significant better performance.
+  There is not yet an interface to compile entire files and no interface to
+store the generated bytecode in disk. There is an interface to bytecode
+compile toplevel forms as a LAMBDA NIL, but it is not yet exported.
+  If your code needs to call GO/RETURN/RETURN-FROM as the result of an EVAL,
+it must jump to code in the interpreter, after compiling all calls to
+GO/RETURN/RETURN-FROM are just stack adjusting and jumps in the bytecode.
+CATCH/THROW and UNWIND-PROTECT are running as interpreted code for now, so it
+is safe to use these, but code in such blocks is not compiled/optimized
+(not even macro expansion is done, as it understands that while not compiled,
+everything is candidate to redefinition at any time).
+  To compile the code, just write a function, and compile it, example:
+
+       (defun fact (n)
+           (if (< n 2)
+               1
+               (* n (fact (1- n)))
+           )
+       )
+       FACT
+
+       (compile 'fact)
+       FACT
+       NIL
+       NIL
+
+       (disassemble 'fact)
+       Function FACT:
+       1 required argument: N
+       0 optional arguments
+       0 keyword parameters
+       No rest argument
+
+       Bytecode header:
+       1 element used in the stack
+       2 elements used in the builtin stack
+       0 elements used in the protected stack
+       Constant 0 = 1
+       Constant 1 = (2)
+       Symbol 0 = N
+       Builtin 0 = *
+       Builtin 1 = 1-
+       Builtin 2 = <
+
+       Initial stack:
+       0 = N
+
+       Bytecode stream:
+          0  LOAD&PUSH (0)
+          2  LOADCON&PUSH [1]      ;  (2)
+          4  CALL 2 [2]            ;  <
+          7  JUMPNIL 8
+         10  LOADCON [0]           ;  1
+         12  NOOP
+         13  JUMP 19
+         16  LOAD&PUSH (0)
+         18  LOAD&PUSH (0)
+         20  CALL 1 [1]            ;  1-
+         23  LET* [0]              ;  N
+         25  LETREC 1
+         27  UNLET 1
+         29  BCONS1
+         30  CALL 1 [0]            ;  *
+         33  RETURN
+       FACT
+
+
+  There are several optimizations that should be done at some time, I don't
+think adding NOOP opcodes will help everywhere to make aligned memory reads
+of shorts and ints.
+  It should have explicitly visible registers, not the abstraction of "the
+current value", so the code generator can choose register allocation for
+loop control variables, commonly used variables, etc, for example. Jumps
+should have 3 types: byte relative, 2 bytes relative and 4 bytes relative.
+For now there is only 2 byte relative jumps, byte relative jumps
+can show a significant performance increase, but they are disable until
+it is decided how inlined functions will work, if it just updates the bytecode
+header and cut&past the bytecode, jumps must be updated, and some jumps
+may not fit anymore in a byte.
+
+
+    OPTIMIZATION
+
+  There are plenty of possibilities to make the interpreter run faster. Some
+optimizations that can make it run quite faster in certain cases are:
+  o Better object memory layout and gc. The current memory allocation code
+    is very bad, it try to keep 3 times more free objects than the currently
+    used number, this can consume a lot of memory. The reason is to reduce
+    the gc time cost so that it will in average miss only one in every 4
+    collect tries.
+  o Implement real vectors, currently they are just a list, so it cannot
+    just deference a given index, and gc time is very long also.
+  o Most lists are never changed once created, it could somehow add an index
+    field in the cons cell, so that NTH/NTHCDR/LENGTH like code could just
+    deference the correct object, instead of traversing the CDR of every
+    cons. This would probably require implementing lists as vectors, while
+    making it easy to deference would make life harder when deleting/inserting
+    sublists in a list. It should also better be done in a way that does
+    not require a lot of objects allocated linearly.
+
+
+    HELPING
+
+  Send comments and code to me (paulo@XFree86.Org) or to the XFree86
+mailing/patch lists.
+
+--
+Paulo
diff --git a/xedit/lisp/TODO b/xedit/lisp/TODO
new file mode 100644 (file)
index 0000000..0f06306
--- /dev/null
@@ -0,0 +1,81 @@
+$XFree86: xc/programs/xedit/lisp/TODO,v 1.8 2002/11/23 08:26:47 paulo Exp $
+
+LAST UPDATED:  $Date$
+
+  Small todo list
+
+o Change function/macro body to know if a &key or &optional argument was not
+  provided, and initialize to the default value in the function, for
+  interpreted and builtin functions it is better done before the function is
+  called, but for bytecode it is better in the function.
+o Following the previous idea, change function definitions in the format:
+  (defun afun (a &aux b (c (some-code))) ...)
+  to
+  (defun afun (a) (let* ((b (c (some-code)))) ...))
+  This can significatively reduce bytecode size, and also simplify function
+  calls.
+o Optimize text redisplay in Xaw, instead of allocating a copy of the buffer
+  for the paint-list, should use the text in place, and only allocate small
+  buffers when required, i.e. displaying control characters, etc.
+o Add an interface to create new object types dinamically.
+o Add a special string object to simplify and avoid too many copies of
+  portions of the text buffers. This special string should be read-only
+  and not gc-collected.
+o Make the bytecode compiler smarter to detect some constructs like:
+  (builtin-or-bytecode-function-call arg1 arg2 (return))
+  this will not properly restore the internal stacks.
+
+o When an Init function is present in every file, call LispAddBuiltin from
+  that initialization function.
+o Cleanup the code, make it optional to build some uncommon features (as well
+  as the entire interpreter?). Implement more functions directly in lisp.
+o Finish an "specification" for loadable modules. Write a FFI interface.
+  Without the possibility of using already existing libraries, the interpreter
+  won't be too much useful due to a poor library. It is very desirable to
+  "auto-generate" directly from C header files the interface to the lisp
+  code, and from that, dlload a shared library. In some cases, it is required
+  to link statically with a new interpreter binary, make it easy.
+o Implement a better string type. That should support characters larger than
+  8 bits, and that should allow embeded nuls.
+o Implement a richer set of math functions. This, if properly done can be
+  made a loadable module.
+o Optmize mathimp.c, comparing a double with a bignum should never cause an
+  error. Implement mp?_initsetXXX functions?
+o Finish missing features in read.c, and simplify it.
+o (close) probably should not send a signal when closing a pipe.
+o Implement "real" vectors, they exist to make access to field elements
+  at constant time, implementing vectors as lists may be very slow.
+o Use float and double as floating points formats.
+o Implement support for vectors of "atomic" types. Vectors of floats would
+  be useful for example if a OpenGL binding is done.
+o Implement a multiple precision floating point format. Either a 128 bits
+  (or configurable length?) IEEE 754 like number, or some format using
+  ratios, a epsilon for rouding, rounding modes, exact/inexact flag, a good
+  amount of guard digits, etc.
+o Write more functions and optimization for bignums. Try to make the code
+  as reusable as possible, either by other software or at least by the
+  different number types.
+o Instead of using mathimp.c for a large amount of functions, implement a
+  "generic number" type and implement the calculations directly in the
+  mp library.
+o Add more missing Common Lisp features, like &allow-other-keys for function
+  definitions, the missing structure features, CLOS etc.
+o Fix the Postgresql module, make it compile everywhere.
+o Add support for multi-threaded applications?
+o Make it possible to know if a object has only one reference, this is
+  required to make "inplace" changes of variables. Very useful for things
+  like (incf) and (decf), and also when dealing with bignums.
+o Maybe have a freelist for objects depending on the type. Bignums can be
+  reused, and having some large ones expecting to be freed by the gc can
+  consume a lot of memory.
+o Internationalization. Support ',' in floats? Correctly treat characters
+  for {up,down}-casing.
+o Synch the Xaw text code for supporting tables, text alignment/paragraphs,
+  etc, and add bindings to the interpreter. Add support for incremental
+  changes of those properties, currently it is "read-only".
+o Write some type of "hyperlinks", this is the only feature missing to even
+  allow writting a web browser inside xedit.
+o Write some "demos" (maybe a file manager or a simple mail reader) using the
+  Xt/Xaw bindings (needs modules working in all systems).
+o Remove all calls to the macros GCDisable and GCEnable. This is unsafe
+  and should be removed.
diff --git a/xedit/lisp/bytecode.c b/xedit/lisp/bytecode.c
new file mode 100644 (file)
index 0000000..cc7d1c5
--- /dev/null
@@ -0,0 +1,3696 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/bytecode.c,v 1.17 2003/05/27 22:27:01 tsi Exp $ */
+
+
+/*
+somethings TODO:
+
+ o Write code for allowing storing the bytecode on disk. Basically
+   write a section of the bytecode with the package name of the symbol
+   pointers, and after that, the symbols used. At load time just put
+   the pointers in the bytecode. Constants can be stored as the string
+   representation. Probably just storing the gc protected code as a
+   string is enough to rebuild it.
+
+ o Write code to store tags of BLOCK/CATCH and setjump buffer stacks,
+   and, only keep track of this if non byte-compiled code is called,
+   as after byte-compilation RETURN and THROW are just jumps.
+
+ o Remove not reliable "optmization code" code from Com_XXX functions
+   and do it later, removing dead code, tests with a constant argument,
+   etc, in the "link time". Frequently joining sequential opcodes to a
+   compound version.
+
+ o Write an optimizer to do code transformation.
+
+ o Write code to know when variables can be changed in place, this
+   can save a huge time in loop counters.
+
+ o Write code for fast garbage collection of objects that can be
+   safely collected.
+
+ o Cleanup of interpreted code. Having bytecode mean that the interpreter
+   now is better having a clean and small code. If speed is important,
+   it should be byte compiled.
+
+ o Limit the stacks length. So that instead of using an index, use the
+   pointer where an object value should be read/stored as the stack address
+   would not change during the program execution.
+
+ o Optimize jump to jump. Common in code like:
+       (IF test
+           (GO somewhere)
+           (GO elsewhere)
+       )
+       (GO there)
+   that generates a bytecode like:
+       <code to evaluate test>
+       JUMPNIL :NIL-RESULT
+       :T-RESULT
+           JUMP :SOMEWHERE
+       JUMP :END-OF-IF                 ;; <- this is not required, or even
+       :NIL-RESULT                     ;;    better, notice the jump after
+           JUMP :ELSEWHERE             ;;    the if and transform it into
+       :END-OF-IF                      ;;    a JUMP :THERE (assuming there
+       JUMP :THERE                     ;;    (was no jump in the T code).
+
+ o Optimize variables that are known to not change it's value, i.e. pseudo
+   constants. Loading the value of a constant should be faster than loading
+   the current value of a variable; the constant table could fit in the
+   processor cache line and needs less calculation to find the object address.
+
+ o Fix some known problems, like when calling return or return-from while
+   building the argument list to a builtin function, or inline of recursive
+   functions.
+ */
+
+
+#include "lisp/bytecode.h"
+#include "lisp/write.h"
+
+#define        SYMBOL_KEYWORD  -1      /* A keyword, load as constant */
+#define        SYMBOL_CONSTANT -2      /* Defined as constant at compile time */
+#define        SYMBOL_UNBOUND  -3      /* Not a local variable */
+
+#define NEW_TREE(type)         CompileNewTree(com, type)
+
+/* If in tagbody, ignore anything that is not code */
+#define        IN_TAGBODY()            (com->block->type == LispBlockBody && \
+                                com->level == com->tagbody)
+#define        FORM_ENTER()            ++com->level
+#define        FORM_LEAVE()            --com->level
+
+#define COMPILE_FAILURE(message)                       \
+    LispMessage("COMPILE: %s", message);               \
+    longjmp(com->jmp, 1)
+
+/*
+ * Types
+ */
+typedef struct _CodeTree CodeTree;
+typedef struct _CodeBlock CodeBlock;
+
+typedef enum {
+    CodeTreeBytecode,
+    CodeTreeLabel,
+    CodeTreeGo,
+    CodeTreeJump,
+    CodeTreeJumpIf,
+    CodeTreeCond,
+    CodeTreeBlock,
+    CodeTreeReturn
+} CodeTreeType;
+
+struct _CodeTree {
+    CodeTreeType type;
+
+    /* Resolved when linking, may be adjusted while optimizing */
+    long offset;
+
+    LispByteOpcode code;
+
+    union {
+       signed char signed_char;
+       signed short signed_short;
+       signed int signed_int;
+       LispAtom *atom;
+       LispObj *object;
+       CodeTree *tree;
+       CodeBlock *block;
+       struct {
+           unsigned char num_arguments;
+           LispBuiltin *builtin;
+           signed short offset;        /* Used if opcode is XBC_CALL_SET */
+       } builtin;
+       struct {
+           unsigned char num_arguments;
+           LispObj *name;
+           LispObj *lambda;
+       } call;
+       struct {
+           unsigned char num_arguments;
+           LispObj *code;
+       } bytecall;
+       struct {
+           short offset;
+           LispAtom *name;
+       } let;
+       struct {
+           LispAtom *symbol;
+           LispAtom *name;
+       } let_sym;
+       struct {
+           LispObj *object;
+           LispAtom *name;
+       } let_con;
+       struct {
+           signed short load;
+           signed short set;
+       } load_set;
+       struct {
+           LispObj *object;
+           signed short offset;
+       } load_con_set;
+       struct {
+           LispObj *car;
+           LispObj *cdr;
+       } cons;
+       struct {
+           short offset;
+           LispObj *definition;
+       } struc;
+    } data;
+
+    CodeTree *next;
+    CodeTree *group;
+    CodeBlock *block;
+};
+
+struct _CodeBlock {
+    LispBlockType type;
+    LispObj *tag;
+
+    struct {
+       LispObj **labels;
+       CodeTree **codes;       /* Filled at link time */
+       int length;
+       int space;
+    } tagbody;
+
+    struct {
+       LispAtom **symbols;     /* Identifiers of variables in a block */
+       int *flags;             /* Information about usage of the variable */
+       int length;
+    } variables;
+
+    int bind;                  /* Used in case of RETURN from LET */
+    int level;                 /* Nesting level block was created */
+
+    CodeTree *tree, *tail;
+    CodeBlock *prev;           /* Linked list as a stack */
+    CodeTree *parent;          /* Back reference */
+};
+
+struct _LispCom {
+    unsigned char *bytecode;   /* Bytecode generated so far */
+    long length;
+
+    CodeBlock *block, *toplevel;
+
+    int tagbody;               /* Inside a tagbody block? */
+    int level;                 /* Nesting level */
+    int macro;                 /* Expanding a macro? */
+
+    int lex;
+
+    int warnings;
+
+    LispObj *form, *plist;
+
+    jmp_buf jmp;               /* Used if compilation cannot be finished */
+
+    struct {
+       int cstack;     /* Current number of objects in forms evaluation */
+       int cbstack;
+       int cpstack;
+       int stack;      /* max number of objects will be loaded in stack */
+       int bstack;
+       int pstack;
+    } stack;
+
+    struct {
+       /* Constant table */
+       LispObj **constants;
+       int num_constants;
+       /* Symbol table */
+       LispAtom **symbols;
+       int num_symbols;
+       /* Builtin table */
+       LispBuiltin **builtins;
+       int num_builtins;
+       /* Bytecode table */
+       LispObj **bytecodes;
+       int num_bytecodes;
+    } table;
+};
+
+/*
+ * Prototypes
+ */
+static LispObj *MakeBytecodeObject(LispCom*, LispObj*, LispObj*);
+
+static CodeTree *CompileNewTree(LispCom*, CodeTreeType);
+static void CompileFreeState(LispCom*);
+static void CompileFreeBlock(CodeBlock*);
+static void CompileFreeTree(CodeTree*);
+
+static void CompileIniBlock(LispCom*, LispBlockType, LispObj*);
+static void CompileFiniBlock(LispCom*);
+
+static void com_BytecodeChar(LispCom*, LispByteOpcode, char);
+static void com_BytecodeShort(LispCom*, LispByteOpcode, short);
+static void com_BytecodeObject(LispCom*, LispByteOpcode, LispObj*);
+static void com_BytecodeCons(LispCom*, LispByteOpcode, LispObj*, LispObj*);
+
+static void com_BytecodeAtom(LispCom*, LispByteOpcode, LispAtom*);
+
+static void com_Bytecode(LispCom*, LispByteOpcode);
+
+static void com_Load(LispCom*, short);
+static void com_LoadLet(LispCom*, short, LispAtom*);
+static void com_LoadPush(LispCom*, short);
+
+static void com_Let(LispCom*, LispAtom*);
+
+static void com_Bind(LispCom*, short);
+static void com_Unbind(LispCom*, short);
+
+static void com_LoadSym(LispCom*, LispAtom*);
+static void com_LoadSymLet(LispCom*, LispAtom*, LispAtom*);
+static void com_LoadSymPush(LispCom*, LispAtom*);
+
+static void com_LoadCon(LispCom*, LispObj*);
+static void com_LoadConLet(LispCom*, LispObj*, LispAtom*);
+static void com_LoadConPush(LispCom*, LispObj*);
+
+static void com_Set(LispCom*, short);
+static void com_SetSym(LispCom*, LispAtom*);
+
+static void com_Struct(LispCom*, short, LispObj*);
+static void com_Structp(LispCom*, LispObj*);
+
+static void com_Call(LispCom*, unsigned char, LispBuiltin*);
+static void com_Bytecall(LispCom*, unsigned char, LispObj*);
+static void com_Funcall(LispCom*, LispObj*, LispObj*);
+
+static void CompileStackEnter(LispCom*, int, int);
+static void CompileStackLeave(LispCom*, int, int);
+
+static void LinkBytecode(LispCom*);
+
+static LispObj *ExecuteBytecode(unsigned char*);
+
+
+/* Defined in lisp.c */
+void LispMoreStack(void);
+void LispMoreEnvironment(void);
+void LispMoreGlobals(LispPackage*);
+LispObj *LispEvalBackquote(LispObj*, int);
+void LispSetAtomObjectProperty(LispAtom*, LispObj*);
+
+/*
+ * Initialization
+ */
+extern int pagesize;
+
+LispObj x_cons[8];
+static LispObj *cons, *cons1, *cons2, *cons3, *cons4, *cons5, *cons6, *cons7;
+
+/*
+ * Implementation
+ */
+#include "lisp/compile.c"
+
+void
+LispBytecodeInit(void)
+{
+    cons = &x_cons[7];
+    cons->type = LispCons_t;
+    CDR(cons) = NIL;
+    cons1 = &x_cons[6];
+    cons1->type = LispCons_t;
+    CDR(cons1) = cons;
+    cons2 = &x_cons[5];
+    cons2->type = LispCons_t;
+    CDR(cons2) = cons1;
+    cons3 = &x_cons[4];
+    cons3->type = LispCons_t;
+    CDR(cons3) = cons2;
+    cons4 = &x_cons[3];
+    cons4->type = LispCons_t;
+    CDR(cons4) = cons3;
+    cons5 = &x_cons[2];
+    cons5->type = LispCons_t;
+    CDR(cons5) = cons4;
+    cons6 = &x_cons[1];
+    cons6->type = LispCons_t;
+    CDR(cons6) = cons5;
+    cons7 = &x_cons[0];
+    cons7->type = LispCons_t;
+    CDR(cons7) = cons6;
+}
+
+LispObj *
+Lisp_Compile(LispBuiltin *builtin)
+/*
+ compile name &optional definition
+ */
+{
+    GC_ENTER();
+    LispObj *result, *warnings_p, *failure_p;
+
+    LispObj *name, *definition;
+
+    definition = ARGUMENT(1);
+    name = ARGUMENT(0);
+
+    result = name;
+    warnings_p = NIL;
+    failure_p = T;
+
+    if (name != NIL) {
+       LispAtom *atom;
+
+       CHECK_SYMBOL(name);
+       atom = name->data.atom;
+       if (atom->a_builtin || atom->a_compiled)
+           goto finished_compilation;
+       else if (atom->a_function) {
+           LispCom com;
+           int failed;
+           int lex = 0, base;
+           LispArgList *alist;
+           LispObj *lambda, *form, *arguments;
+
+           lambda = atom->property->fun.function;
+           if (definition != UNSPEC || lambda->funtype != LispFunction)
+               /* XXX TODO replace definition etc. */
+               goto finished_compilation;
+           alist = atom->property->alist;
+
+           memset(&com, 0, sizeof(LispCom));
+           com.toplevel = com.block = LispCalloc(1, sizeof(CodeBlock));
+           com.block->type = LispBlockClosure;
+           com.block->tag = name;
+
+           /*  Create a fake argument list to avoid yet another flag
+            * for ComCall. The value does not matter, just the fact
+            * that the symbol will be bound or not in the implicit
+            * PROGN of the function body. */
+           base = alist->num_arguments - alist->auxs.num_symbols;
+           if (base) {
+               LispObj *argument;
+               int i, sforms;
+
+               for (i = sforms = 0; i < alist->optionals.num_symbols; i++)
+                   if (alist->optionals.sforms[i])
+                       ++sforms;
+
+               arguments = form = NIL;
+               i = sforms +
+                   alist->normals.num_symbols + alist->optionals.num_symbols;
+
+               if (i) {
+                   arguments = form = CONS(NIL, NIL);
+                   GC_PROTECT(arguments);
+                   for (--i; i > 0; i--) {
+                       RPLACD(form, CONS(NIL, NIL));
+                       form = CDR(form);
+                   }
+               }
+
+               for (i = 0; i < alist->keys.num_symbols; i++) {
+                   /* key symbol */
+                   if (alist->keys.keys[i])
+                       argument = QUOTE(alist->keys.keys[i]);
+                   else
+                       argument = alist->keys.symbols[i];
+
+                   /* add key */
+                   if (arguments == NIL) {
+                       arguments = form = CONS(argument, NIL);
+                       GC_PROTECT(arguments);
+                   }
+                   else {
+                       RPLACD(form, CONS(argument, NIL));
+                       form = CDR(form);
+                   }
+
+                   /* add value */
+                   RPLACD(form, CONS(NIL, NIL));
+                   form = CDR(form);
+
+                   if (alist->keys.sforms[i]) {
+                       RPLACD(form, CONS(NIL, NIL));
+                       form = CDR(form);
+                   }
+               }
+
+               if (alist->rest) {
+                   if (arguments == NIL) {
+                       arguments = form = CONS(NIL, NIL);
+                       GC_PROTECT(arguments);
+                   }
+                   else {
+                       RPLACD(form, CONS(NIL, NIL));
+                       form = CDR(form);
+                   }
+               }
+           }
+           else
+               arguments = NIL;
+
+           form = CONS(lambda->data.lambda.code, NIL);
+           GC_PROTECT(form);
+           com.form = form;
+           com.plist = CONS(NIL, NIL);
+           GC_PROTECT(com.plist);
+
+           failed = 1;
+           if (setjmp(com.jmp) == 0) {
+               /* Save interpreter state */
+               lex = com.lex = lisp__data.env.lex;
+               base = ComCall(&com, alist, name, arguments, 1, 0, 1);
+
+               /* Generate code tree */
+               lisp__data.env.lex = base;
+               ComProgn(&com, CAR(form));
+               failed = 0;
+           }
+
+           /* Restore interpreter state */
+           lisp__data.env.lex = lex;
+           lisp__data.env.head = lisp__data.env.length = base;
+
+           if (!failed) {
+               failure_p = NIL;
+               result = MakeBytecodeObject(&com, name,
+                                           lambda->data.lambda.data);
+               LispSetAtomCompiledProperty(atom, result);
+               result = name;
+           }
+           if (com.warnings)
+               warnings_p = FIXNUM(com.warnings);
+           goto finished_compilation;
+       }
+       else
+           goto undefined_function;
+    }
+
+undefined_function:
+    LispDestroy("%s: the function %s is undefined",
+               STRFUN(builtin), STROBJ(name));
+
+finished_compilation:
+    RETURN(0) = warnings_p;
+    RETURN(1) = failure_p;
+    RETURN_COUNT = 2;
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+Lisp_Disassemble(LispBuiltin *builtin)
+/*
+ disassemble function
+ */
+{
+    int macro;
+    char buffer[128];
+    LispAtom *atom;
+    LispArgList *alist;
+    LispBuiltin *xbuiltin;
+    LispObj *name, *lambda, *bytecode;
+
+    LispObj *function;
+
+    function = ARGUMENT(0);
+
+    macro = 0;
+    alist = NULL;
+    xbuiltin = NULL;
+    name = bytecode = NULL;
+
+    switch (OBJECT_TYPE(function)) {
+       case LispFunction_t:
+           function = function->data.atom->object;
+       case LispAtom_t:
+           name = function;
+           atom = function->data.atom;
+           alist = atom->property->alist;
+           if (atom->a_builtin) {
+               xbuiltin = atom->property->fun.builtin;
+               macro = xbuiltin->type == LispMacro;
+           }
+           else if (atom->a_compiled)
+               bytecode = atom->property->fun.function;
+           else if (atom->a_function) {
+               lambda = atom->property->fun.function;
+               macro = lambda->funtype == LispMacro;
+           }
+           else if (atom->a_defstruct &&
+                    atom->property->structure.function != STRUCT_NAME) {
+               if (atom->property->structure.function == STRUCT_CONSTRUCTOR)
+                   atom = Omake_struct->data.atom;
+               else if (atom->property->structure.function == STRUCT_CHECK)
+                   atom = Ostruct_type->data.atom;
+               else
+                   atom = Ostruct_access->data.atom;
+               xbuiltin = atom->property->fun.builtin;
+           }
+           else
+               LispDestroy("%s: the function %s is not defined",
+                           STRFUN(builtin), STROBJ(function));
+           break;
+       case LispBytecode_t:
+           name = Olambda;
+           bytecode = function;
+           break;
+       case LispLambda_t:
+           name = Olambda;
+           alist = (LispArgList*)function->data.lambda.name->data.opaque.data;
+           break;
+       case LispCons_t:
+           if (CAR(function) == Olambda) {
+               function = EVAL(function);
+               if (OBJECT_TYPE(function) == LispLambda_t) {
+                   name = Olambda;
+                   alist = (LispArgList*)
+                       function->data.lambda.name->data.opaque.data;
+                   break;
+               }
+           }
+       default:
+           LispDestroy("%s: %s is not a function",
+                       STRFUN(builtin), STROBJ(function));
+           break;
+    }
+
+    if (xbuiltin) {
+       LispWriteStr(NIL, "Builtin ", 8);
+       if (macro)
+           LispWriteStr(NIL, "macro ", 6);
+       else
+           LispWriteStr(NIL, "function ", 9);
+    }
+    else if (macro)
+       LispWriteStr(NIL, "Macro ", 6);
+    else
+       LispWriteStr(NIL, "Function ", 9);
+    LispWriteObject(NIL, name);
+    LispWriteStr(NIL, ":\n", 2);
+
+    if (alist) {
+       int i;
+
+       sprintf(buffer, "%d required argument%s",
+               alist->normals.num_symbols,
+               alist->normals.num_symbols != 1 ? "s" : "");
+       LispWriteStr(NIL, buffer, strlen(buffer));
+       for (i = 0; i < alist->normals.num_symbols; i++) {
+           LispWriteChar(NIL, i ? ',' : ':');
+           LispWriteChar(NIL, ' ');
+           LispWriteStr(NIL, ATOMID(alist->normals.symbols[i])->value,
+                        ATOMID(alist->normals.symbols[i])->length);
+       }
+       LispWriteChar(NIL, '\n');
+
+       sprintf(buffer, "%d optional argument%s",
+               alist->optionals.num_symbols,
+               alist->optionals.num_symbols != 1 ? "s" : "");
+       LispWriteStr(NIL, buffer, strlen(buffer));
+       for (i = 0; i < alist->optionals.num_symbols; i++) {
+           LispWriteChar(NIL, i ? ',' : ':');
+           LispWriteChar(NIL, ' ');
+           LispWriteStr(NIL, ATOMID(alist->optionals.symbols[i])->value,
+                        ATOMID(alist->optionals.symbols[i])->length);
+       }
+       LispWriteChar(NIL, '\n');
+
+       sprintf(buffer, "%d keyword parameter%s",
+               alist->keys.num_symbols,
+               alist->keys.num_symbols != 1 ? "s" : "");
+       LispWriteStr(NIL, buffer, strlen(buffer));
+       for (i = 0; i < alist->keys.num_symbols; i++) {
+           LispWriteChar(NIL, i ? ',' : ':');
+           LispWriteChar(NIL, ' ');
+           LispWriteObject(NIL, alist->keys.symbols[i]);
+       }
+       LispWriteChar(NIL, '\n');
+
+       if (alist->rest) {
+           LispWriteStr(NIL, "Rest argument: ", 15);
+           LispWriteStr(NIL, ATOMID(alist->rest)->value,
+                        ATOMID(alist->rest)->length);
+           LispWriteChar(NIL, '\n');
+       }
+       else
+           LispWriteStr(NIL, "No rest argument\n", 17);
+    }
+
+    if (bytecode) {
+       Atom_id id;
+       char *ptr;
+       int *offsets[4];
+       int i, done, j, sym0, sym1, con0, con1, bui0, byt0, strd, strf;
+       LispObj **constants;
+       LispAtom **symbols;
+       LispBuiltin **builtins;
+       LispObj **names;
+       short stack, num_constants, num_symbols, num_builtins, num_bytecodes;
+       unsigned char *base, *stream = bytecode->data.bytecode.bytecode->code;
+
+       LispWriteStr(NIL, "\nBytecode header:\n", 18);
+
+       /* Header information */
+       stack = *(short*)stream;
+       stream += sizeof(short);
+       sprintf(buffer, "%d element%s used in the stack\n",
+               stack, stack != 1 ? "s" : "");
+       LispWriteStr(NIL, buffer, strlen(buffer));
+       stack = *(short*)stream;
+       stream += sizeof(short);
+       sprintf(buffer, "%d element%s used in the builtin stack\n",
+               stack, stack != 1 ? "s" : "");
+       LispWriteStr(NIL, buffer, strlen(buffer));
+       stack = *(short*)stream;
+       stream += sizeof(short);
+       sprintf(buffer, "%d element%s used in the protected stack\n",
+               stack, stack != 1 ? "s" : "");
+       LispWriteStr(NIL, buffer, strlen(buffer));
+
+       num_constants = *(short*)stream;
+       stream += sizeof(short);
+       num_symbols = *(short*)stream;
+       stream += sizeof(short);
+       num_builtins = *(short*)stream;
+       stream += sizeof(short);
+       num_bytecodes = *(short*)stream;
+       stream += sizeof(short);
+
+       constants = (LispObj**)stream;
+       stream += num_constants * sizeof(LispObj*);
+       symbols = (LispAtom**)stream;
+       stream += num_symbols * sizeof(LispAtom*);
+       builtins = (LispBuiltin**)stream;
+       stream += num_builtins * sizeof(LispBuiltin*);
+       stream += num_bytecodes * sizeof(unsigned char*);
+       names = (LispObj**)stream;
+       stream += num_bytecodes * sizeof(LispObj*);
+
+       for (i = 0; i < num_constants; i++) {
+           sprintf(buffer, "Constant %d = %s\n", i, STROBJ(constants[i]));
+           LispWriteStr(NIL, buffer, strlen(buffer));
+       }
+
+/* Macro XSTRING avoids some noisy in the output, if it were defined as
+ * #define XSTRING(object) object ? STROBJ(object) : #<UNBOUND>
+ *     and called as XSTRING(atom->object)
+ * it would also print the package name were the symbol was first defined,
+ * but for local variables, only the symbol string is important. */
+#define XSTRING(key)           key ? key->value : "#<UNBOUND>"
+
+       for (i = 0; i < num_symbols; i++) {
+           sprintf(buffer, "Symbol %d = %s\n",
+                   i, XSTRING(symbols[i]->key));
+           LispWriteStr(NIL, buffer, strlen(buffer));
+       }
+       for (i = 0; i < num_builtins; i++) {
+           sprintf(buffer, "Builtin %d = %s\n",
+                   i, STROBJ(builtins[i]->symbol));
+           LispWriteStr(NIL, buffer, strlen(buffer));
+       }
+       for (i = 0; i < num_bytecodes; i++) {
+           sprintf(buffer, "Bytecode %d = %s\n",
+                   i, STROBJ(names[i]));
+           LispWriteStr(NIL, buffer, strlen(buffer));
+       }
+
+       /*  Make readability slightly easier printing the names of local
+        * variables where it's offset is known, i.e. function arguments. */
+       if (alist) {
+           if (alist->num_arguments == 0)
+               LispWriteStr(NIL, "\nNo initial stack\n", 18);
+           else {
+               int len1, len2;
+
+               j = 0;
+               LispWriteStr(NIL, "\nInitial stack:\n", 16);
+
+               for (i = 0; i < alist->normals.num_symbols; i++, j++) {
+                   sprintf(buffer, "%d = ", j);
+                   LispWriteStr(NIL, buffer, strlen(buffer));
+                   id = alist->normals.symbols[i]->data.atom->key;
+                   LispWriteStr(NIL, id->value, id->length);
+                   LispWriteChar(NIL, '\n');
+               }
+
+               for (i = 0; i < alist->optionals.num_symbols; i++, j++) {
+                   sprintf(buffer, "%d = ", j);
+                   LispWriteStr(NIL, buffer, strlen(buffer));
+                   id = alist->optionals.symbols[i]->data.atom->key;
+                   LispWriteStr(NIL, id->value, id->length);
+                   LispWriteChar(NIL, '\n');
+                   if (alist->optionals.sforms[i]) {
+                       sprintf(buffer, "%d = ", j);
+                       len1 = strlen(buffer);
+                       LispWriteStr(NIL, buffer, len1);
+                       id = alist->optionals.sforms[i]->data.atom->key;
+                       len2 = id->length;
+                       LispWriteStr(NIL, id->value, len2);
+                       LispWriteChars(NIL, ' ', 28 - (len1 + len2));
+                       LispWriteStr(NIL, ";  sform\n", 9);
+                       j++;
+                   }
+               }
+
+               for (i = 0; i < alist->keys.num_symbols; i++, j++) {
+                   sprintf(buffer, "%d = ", j);
+                   len1 = strlen(buffer);
+                   LispWriteStr(NIL, buffer, len1);
+                   if (alist->keys.keys[i]) {
+                       id = alist->keys.keys[i]->data.atom->key;
+                       len2 = id->length;
+                       LispWriteStr(NIL, id->value, id->length);
+                       LispWriteChars(NIL, ' ', 28 - (len1 + len2));
+                       LispWriteStr(NIL, ";  special key", 14);
+                   }
+                   else {
+                       id = alist->keys.symbols[i]->data.atom->key;
+                       LispWriteStr(NIL, id->value, id->length);
+                   }
+                   LispWriteChar(NIL, '\n');
+                   if (alist->keys.sforms[i]) {
+                       sprintf(buffer, "%d = ", j);
+                       len1 = strlen(buffer);
+                       LispWriteStr(NIL, buffer, len1);
+                       id = alist->keys.sforms[i]->data.atom->key;
+                       len2 = id->length;
+                       LispWriteStr(NIL, id->value, len2);
+                       LispWriteChars(NIL, ' ', 28 - (len1 + len2));
+                       LispWriteStr(NIL, ";  sform\n", 9);
+                       j++;
+                   }
+               }
+
+               if (alist->rest) {
+                   sprintf(buffer, "%d = ", j);
+                   len1 = strlen(buffer);
+                   LispWriteStr(NIL, buffer, len1);
+                   id = alist->rest->data.atom->key;
+                   len2 = id->length;
+                   LispWriteStr(NIL, id->value, len2);
+                   LispWriteChar(NIL, '\n');
+                   j++;
+               }
+
+               for (i = 0; i < alist->auxs.num_symbols; i++, j++) {
+                   sprintf(buffer, "%d = ", j);
+                   len1 = strlen(buffer);
+                   LispWriteStr(NIL, buffer, len1);
+                   id = alist->auxs.symbols[i]->data.atom->key;
+                   len2 = id->length;
+                   LispWriteStr(NIL, id->value, len2);
+                   LispWriteChars(NIL, ' ', 28 - (len1 + len2));
+                   LispWriteStr(NIL, ";  aux\n", 7);
+               }
+           }
+       }
+
+       LispWriteStr(NIL, "\nBytecode stream:\n", 18);
+
+       base = stream;
+       for (done = j = 0; !done; j = 0) {
+           sym0 = sym1 = con0 = con1 = bui0 = byt0 = strd = strf = -1;
+           sprintf(buffer, "%4ld  ", (long)(stream - base));
+           ptr = buffer + strlen(buffer);
+           switch (*stream++) {
+               case XBC_NOOP:  strcpy(ptr, "NOOP");    break;
+               case XBC_PRED:
+                   strcpy(ptr, "PRED:");
+                   ptr += strlen(ptr);
+                   goto predicate;
+               case XBC_INV:   strcpy(ptr, "INV");     break;
+               case XBC_NIL:   strcpy(ptr, "NIL");     break;
+               case XBC_T:     strcpy(ptr, "T");       break;
+               case XBC_CAR:   strcpy(ptr, "CAR");     break;
+               case XBC_CDR:   strcpy(ptr, "CDR");     break;
+               case XBC_RPLACA:strcpy(ptr, "RPLACA");  break;
+               case XBC_RPLACD:strcpy(ptr, "RPLACD");  break;
+               case XBC_EQ:    strcpy(ptr, "EQ");      break;
+               case XBC_EQL:   strcpy(ptr, "EQL");     break;
+               case XBC_EQUAL: strcpy(ptr, "EQUAL");   break;
+               case XBC_EQUALP:strcpy(ptr, "EQUALP");  break;
+               case XBC_LENGTH:strcpy(ptr, "LENGTH");  break;
+               case XBC_LAST:  strcpy(ptr, "LAST");    break;
+               case XBC_NTHCDR:strcpy(ptr, "NTHCDR");  break;
+               case XBC_PUSH:  strcpy(ptr, "PUSH");    break;
+               case XBC_CAR_PUSH:
+                   strcpy(ptr, "CAR&PUSH");
+                   break;
+               case XBC_CDR_PUSH:
+                   strcpy(ptr, "CDR&PUSH");
+                   break;
+               case XBC_PUSH_NIL:
+                   strcpy(ptr, "PUSH NIL");
+                   break;
+               case XBC_PUSH_UNSPEC:
+                   strcpy(ptr, "PUSH #<UNSPEC>");
+                   break;
+               case XBC_PUSH_T:
+                   strcpy(ptr, "PUSH T");
+                   break;
+               case XBC_PUSH_NIL_N:
+                   strcpy(ptr, "PUSH NIL ");
+                   ptr += strlen(ptr);
+                   sprintf(ptr, "%d", (int)(*stream++));
+                   break;
+               case XBC_PUSH_UNSPEC_N:
+                   strcpy(ptr, "PUSH #<UNSPEC> ");
+                   ptr += strlen(ptr);
+                   sprintf(ptr, "%d", (int)(*stream++));
+                   break;
+               case XBC_LET:
+                   strcpy(ptr, "LET");
+/* update sym0 */
+symbol:
+                   offsets[j++] = &sym0;
+/* update <offsets> - print [byte] */
+offset:
+                   ptr += strlen(ptr);
+                   i = *stream++;
+                   *(offsets[j - 1]) = i;
+                   sprintf(ptr, " [%d]", i);
+                   break;
+               case XBC_LETX:
+                   strcpy(ptr, "LET*");
+                   goto symbol;
+               case XBC_LET_NIL:
+                   strcpy(ptr, "LET NIL");
+                   goto symbol;
+               case XBC_LETX_NIL:
+                   strcpy(ptr, "LET* NIL");
+                   goto symbol;
+               case XBC_LETBIND:
+                   strcpy(ptr, "LETBIND");
+/* print byte */
+value:
+                   ptr += strlen(ptr);
+                   sprintf(ptr, " %d", (int)(*stream++));
+                   break;
+               case XBC_UNLET:strcpy(ptr, "UNLET");    goto value;
+               case XBC_LOAD:
+                   strcpy(ptr, "LOAD");
+/* print (byte) */
+reference:
+                   ptr += strlen(ptr);
+                   i = *stream++;
+                   sprintf(ptr, " (%d)", i);
+                   break;
+               case XBC_LOAD_CAR:
+                   strcpy(ptr, "LOAD&CAR");
+                   goto reference;
+               case XBC_LOAD_CDR:
+                   strcpy(ptr, "LOAD&CDR");
+                   goto reference;
+               case XBC_LOAD_CAR_STORE:
+                   strcpy(ptr, "LOAD&CAR&STORE");
+                   goto reference;
+               case XBC_LOAD_CDR_STORE:
+                   strcpy(ptr, "LOAD&CDR&STORE");
+                   goto reference;
+               case XBC_LOAD_LET:
+                   strcpy(ptr, "LOAD&LET");
+load_let:
+                   offsets[j++] = &sym0;
+                   i = *stream++;
+                   ptr += strlen(ptr);
+                   sprintf(ptr, " (%d)", i);
+                   goto offset;
+               case XBC_LOAD_LETX:
+                   strcpy(ptr, "LOAD&LET*");
+                   goto load_let;
+               case XBC_STRUCT:
+                   strcpy(ptr, "STRUCT");
+                   offsets[j++] = &strf;
+                   offsets[j++] = &strd;
+/* update <offsets> - print [byte] - update <offsets> - print [byte] */
+offset_offset:
+                   ptr += strlen(ptr);
+                   i = *stream++;
+                   *(offsets[j - 2]) = i;
+                   sprintf(ptr, " [%d]", i);
+                   goto offset;
+               case XBC_LOAD_PUSH:
+                   strcpy(ptr, "LOAD&PUSH");
+                   goto reference;
+               case XBC_LOADCON:
+                   strcpy(ptr, "LOADCON");
+constant:
+                   offsets[j++] = &con0;
+                   goto offset;
+               case XBC_LOADCON_SET:
+                   strcpy(ptr, "LOADCON&SET");
+                   offsets[j++] = &con0;
+/* update <offsets> - print [byte] - print (byte) */
+offset_reference:
+                   i = *stream++;
+                   *(offsets[j - 1]) = i;
+                   ptr += strlen(ptr);
+                   sprintf(ptr, " [%d]", i);
+                   goto reference;
+               case XBC_STRUCTP:
+                   strcpy(ptr, "STRUCTP");
+                   offsets[j++] = &strd;
+                   goto offset;
+               case XBC_LOADCON_LET:
+                   strcpy(ptr, "LOADCON&LET");
+loadcon_let:
+                   offsets[j++] = &con0;
+                   offsets[j++] = &sym0;
+                   goto offset_offset;
+               case XBC_LOADCON_LETX:
+                   strcpy(ptr, "LOADCON&LET*");
+                   goto loadcon_let;
+               case XBC_LOADCON_PUSH:
+                   strcpy(ptr, "LOADCON&PUSH");
+                   goto constant;
+               case XBC_LOADSYM:
+                   strcpy(ptr, "LOADSYM");
+                   goto symbol;
+               case XBC_LOADSYM_LET:
+                   strcpy(ptr, "LOADSYM&LET");
+loadsym_let:
+                   offsets[j++] = &sym0;
+                   offsets[j++] = &sym1;
+                   goto offset_offset;
+               case XBC_LOADSYM_LETX:
+                   strcpy(ptr, "LOADSYM&LET*");
+                   goto loadsym_let;
+               case XBC_LOADSYM_PUSH:
+                   strcpy(ptr, "LOADSYM&PUSH");
+                   goto symbol;
+               case XBC_LOAD_SET:
+                   strcpy(ptr, "LOAD&SET");
+/* print (byte) - print (byte) */
+reference_reference:
+                   ptr += strlen(ptr);
+                   i = *stream++;
+                   sprintf(ptr, " (%d)", i);
+                   goto reference;
+               case XBC_LOAD_CAR_SET:
+                   strcpy(ptr, "LOAD&CAR&SET");
+                   goto reference_reference;
+               case XBC_LOAD_CDR_SET:
+                   strcpy(ptr, "LOAD&CDR&SET");
+                   goto reference_reference;
+               case XBC_CAR_SET:
+                   strcpy(ptr, "CAR&SET");
+                   goto reference;
+               case XBC_CDR_SET:
+                   strcpy(ptr, "CDR&SET");
+                   goto reference;
+               case XBC_SET:
+                   strcpy(ptr, "SET");
+                   goto reference;
+               case XBC_SETSYM:
+                   strcpy(ptr, "SETSYM");
+                   goto symbol;
+               case XBC_SET_NIL:
+                   strcpy(ptr, "SET NIL");
+                   goto reference;
+               case XBC_CALL:
+                   strcpy(ptr, "CALL");
+                   ptr += strlen(ptr);
+                   sprintf(ptr, " %d", (int)(*stream++));
+                   offsets[j++] = &bui0;
+                   goto offset;
+               case XBC_CALL_SET:
+                   strcpy(ptr, "CALL&SET");
+                   ptr += strlen(ptr);
+                   sprintf(ptr, " %d", (int)(*stream++));
+                   offsets[j++] = &bui0;
+                   goto offset_reference;
+               case XBC_BYTECALL:
+                   strcpy(ptr, "BYTECALL");
+                   ptr += strlen(ptr);
+                   sprintf(ptr, " %d", (int)(*stream++));
+                   offsets[j++] = &byt0;
+                   goto offset;
+               case XBC_FUNCALL:
+                   strcpy(ptr, "FUNCALL");
+constant_constant:
+                   offsets[j++] = &con0;
+                   offsets[j++] = &con1;
+                   goto offset_offset;
+               case XBC_CCONS:
+                   strcpy(ptr, "CCONS");
+                   goto constant_constant;
+               case XBC_CSTAR: strcpy(ptr, "CSTAR");   break;
+               case XBC_CFINI: strcpy(ptr, "CFINI");   break;
+               case XBC_LSTAR: strcpy(ptr, "LSTAR");   break;
+               case XBC_LCONS: strcpy(ptr, "LCONS");   break;
+               case XBC_LFINI: strcpy(ptr, "LFINI");   break;
+               case XBC_BCONS: strcpy(ptr, "BCONS");   break;
+               case XBC_BCONS1:        case XBC_BCONS2:        case XBC_BCONS3:
+               case XBC_BCONS4:        case XBC_BCONS5:        case XBC_BCONS6:
+               case XBC_BCONS7:
+                   strcpy(ptr, "BCONS");
+                   ptr += strlen(ptr);
+                   sprintf(ptr, "%d", (int)(stream[-1] - XBC_BCONS));
+                   break;
+               case XBC_JUMP:
+                   strcpy(ptr, "JUMP");
+integer:
+                   ptr += strlen(ptr);
+                   sprintf(ptr, " %d", *(signed short*)stream);
+                   stream += sizeof(short);
+                   break;
+               case XBC_JUMPT:
+                   strcpy(ptr, "JUMPT");
+                   goto integer;
+               case XBC_JUMPNIL:
+                   strcpy(ptr, "JUMPNIL");
+                   goto integer;
+               case XBC_LETREC:
+                   strcpy(ptr, "LETREC");
+                   ptr += strlen(ptr);
+                   sprintf(ptr, " %d", (int)*stream++);
+                   break;
+               case XBC_RETURN:
+                   strcpy(ptr, "RETURN");
+                   done = 1;
+                   break;
+           }
+           i = ptr - buffer + strlen(ptr);
+           LispWriteStr(NIL, buffer, i);
+           if (j) {
+
+               /* Pad */
+               LispWriteChars(NIL, ' ', 28 - i);
+               LispWriteChar(NIL, ';');
+
+               ptr = buffer;
+
+               /* Structure */
+               if (strf >= 0) {
+                   /* strd is valid if strf set */
+                   LispObj *fields = constants[strd];
+
+                   for (; strf >= 0; strf--)
+                       fields = CDR(fields);               
+                   strcpy(ptr, "  ");      ptr += 2;
+                   strcpy(ptr, CAR(fields)->data.atom->key->value);
+                   ptr += strlen(ptr);
+               }
+               if (strd >= 0) {
+                   strcpy(ptr, "  ");          ptr += 2;
+                   strcpy(ptr, STROBJ(CAR(constants[strd])));
+                   ptr += strlen(ptr);
+               }
+
+               /* Constants */
+               if (con0 >= 0) {
+                   strcpy(ptr, "  ");  ptr += 2;
+                   strcpy(ptr, STROBJ(constants[con0]));
+                   ptr += strlen(ptr);
+                   if (con1 >= 0) {
+                       strcpy(ptr, "  ");      ptr += 2;
+                       strcpy(ptr, STROBJ(constants[con1]));
+                       ptr += strlen(ptr);
+                   }
+               }
+
+               /* Builtin */
+               if (bui0 >= 0) {
+                   strcpy(ptr, "  ");  ptr += 2;
+                   strcpy(ptr, STROBJ(builtins[bui0]->symbol));
+                   ptr += strlen(ptr);
+               }
+
+               /* Bytecode */
+               if (byt0 >= 0) {
+                   strcpy(ptr, "  ");  ptr += 2;
+                   strcpy(ptr, STROBJ(names[byt0]));
+                   ptr += strlen(ptr);
+               }
+
+               /* Symbols */
+               if (sym0 >= 0) {
+                   strcpy(ptr, "  ");  ptr += 2;
+                   strcpy(ptr, XSTRING(symbols[sym0]->key));
+                   ptr += strlen(ptr);
+                   if (sym1 >= 0) {
+                       strcpy(ptr, "  ");      ptr += 2;
+                       strcpy(ptr, XSTRING(symbols[sym1]->key));
+                       ptr += strlen(ptr);
+                   }
+               }
+
+               i = ptr - buffer;
+               LispWriteStr(NIL, buffer, i);
+           }
+           LispWriteChar(NIL, '\n');
+           continue;
+predicate:
+           switch (*stream++) {
+               case XBP_CONSP:     strcpy(ptr, "CONSP");   break;
+               case XBP_LISTP:     strcpy(ptr, "LISTP");   break;
+               case XBP_NUMBERP:   strcpy(ptr, "NUMBERP"); break;
+           }
+           LispWriteStr(NIL, buffer, ptr - buffer + strlen(ptr));
+           LispWriteChar(NIL, '\n');
+       }
+#undef XSTRING
+    }
+
+    return (function);
+}
+
+
+
+LispObj *
+LispCompileForm(LispObj *form)
+{
+    GC_ENTER();
+    int failed;
+    LispCom com;
+
+    if (!CONSP(form))
+       /* Incorrect call or NIL */
+       return (form);
+
+    memset(&com, 0, sizeof(LispCom));
+
+    com.toplevel = com.block = LispCalloc(1, sizeof(CodeBlock));
+    com.block->type = LispBlockNone;
+    com.lex = lisp__data.env.lex;
+
+    com.plist = CONS(NIL, NIL);
+    GC_PROTECT(com.plist);
+
+    failed = 1;
+    if (setjmp(com.jmp) == 0) {
+       for (; CONSP(form); form = CDR(form)) {
+           com.form = form;
+           ComEval(&com, CAR(form));
+       }
+       failed = 0;
+    }
+    GC_LEAVE();
+
+    return (failed ? NIL : MakeBytecodeObject(&com, NIL, NIL));
+}
+
+LispObj *
+LispExecuteBytecode(LispObj *object)
+{
+    if (!BYTECODEP(object))
+       return (EVAL(object));
+
+    return (ExecuteBytecode(object->data.bytecode.bytecode->code));
+}
+
+static LispObj *
+MakeBytecodeObject(LispCom *com, LispObj *name, LispObj *plist)
+{
+    LispObj *object;
+    LispBytecode *bytecode;
+
+    GC_ENTER();
+    unsigned char *stream;
+    short i, num_constants;
+    LispObj **constants, *code, *cons, *prev;
+
+    /* Resolve dependencies, optimize and create byte stream */
+    LinkBytecode(com);
+
+    object = LispNew(NIL, NIL);
+    GC_PROTECT(object);
+    bytecode = LispMalloc(sizeof(LispBytecode));
+    bytecode->code = com->bytecode;
+    bytecode->length = com->length;
+
+
+    stream = bytecode->code;
+
+    /* Skip stack information */
+    stream += sizeof(short) * 3;
+
+    /* Get information */
+    num_constants = *(short*)stream;
+    stream += sizeof(short) * 4;
+    constants = (LispObj**)stream;
+
+    GC_PROTECT(plist);
+    code = cons = prev = NIL;
+    for (i = 0; i < num_constants; i++) {
+       if (POINTERP(constants[i]) && !XSYMBOLP(constants[i])) {
+           if (code == NIL) {
+               code = cons = prev = CONS(constants[i], NIL);
+               GC_PROTECT(code);
+           }
+           else {
+               RPLACD(cons, CONS(constants[i], NIL));
+               prev = cons;
+               cons = CDR(cons);
+           }
+       }
+    }
+
+    /* Protect this in case the function is redefined */
+    for (i = 0; i < com->table.num_bytecodes; i++) {   
+       if (code == NIL) {
+           code = cons = prev = CONS(com->table.bytecodes[i], NIL);
+           GC_PROTECT(code);
+       }
+       else {
+           RPLACD(cons, CONS(com->table.bytecodes[i], NIL));
+           prev = cons;
+           cons = CDR(cons);
+       }
+    }
+
+    /* Free everything, but the LispCom structure and the generated bytecode */
+    CompileFreeState(com);
+    
+    /* Allocate the minimum required number of cons cells to protect objects */
+    if (!CONSP(code))
+       code = plist;
+    else if (CONSP(plist)) {
+       if (code == cons)
+           RPLACD(code, plist);
+       else
+           RPLACD(cons, plist);
+    }
+    else {
+       if (code == cons)
+           code = CAR(code);
+       else
+           CDR(prev) = CAR(cons);
+    }
+
+    object->data.bytecode.bytecode = bytecode;
+    /* Byte code references this object, so it cannot be garbage collected */
+    object->data.bytecode.code = code;
+    object->data.bytecode.name = name;
+    object->type = LispBytecode_t;
+
+    LispMused(bytecode);
+    LispMused(bytecode->code);
+    GC_LEAVE();
+
+    return (object);
+}
+
+static void
+CompileFreeTree(CodeTree *tree)
+{
+    if (tree->type == CodeTreeBlock)
+       CompileFreeBlock(tree->data.block);
+    LispFree(tree);
+}
+
+static void
+CompileFreeBlock(CodeBlock *block)
+{
+    CodeTree *tree = block->tree, *next;
+
+    while (tree) {
+       next = tree->next;
+       CompileFreeTree(tree);
+       tree = next;
+    }
+    if (block->type == LispBlockBody) {
+       LispFree(block->tagbody.labels);
+       LispFree(block->tagbody.codes);
+    }
+    LispFree(block->variables.symbols);
+    LispFree(block->variables.flags);
+    LispFree(block);
+}
+
+static void
+CompileFreeState(LispCom *com)
+{
+    CompileFreeBlock(com->block);
+    LispFree(com->table.constants);
+    LispFree(com->table.symbols);
+    LispFree(com->table.builtins);
+    LispFree(com->table.bytecodes);
+}
+
+/* XXX Put a breakpoint here when changing the macro expansion code.
+ *     No opcodes should be generated during macro expansion. */
+static CodeTree *
+CompileNewTree(LispCom *com, CodeTreeType type)
+{
+    CodeTree *tree = LispMalloc(sizeof(CodeTree));
+
+    tree->type = type;
+    tree->next = NULL;
+    tree->block = com->block;
+    if (com->block->tree == NULL)
+       com->block->tree = tree;
+    else
+       com->block->tail->next = tree;
+    com->block->tail = tree;
+
+    return (tree);
+}
+
+static void
+CompileIniBlock(LispCom *com, LispBlockType type, LispObj *tag)
+{
+    CodeTree *tree = NEW_TREE(CodeTreeBlock);
+    CodeBlock *block = LispCalloc(1, sizeof(CodeBlock));
+
+    tree->data.block = block;
+
+    block->type = type;
+    block->tag = tag;
+    block->prev = com->block;
+    block->parent = tree;
+    block->level = com->level;
+    com->block = block;
+
+    if (type == LispBlockBody)
+       com->tagbody = com->level;
+}
+
+static void
+CompileFiniBlock(LispCom *com)
+{
+    com->block = com->block->prev;
+    if (com->block && com->block->type == LispBlockBody)
+       com->tagbody = com->block->level;
+}
+
+static void
+com_BytecodeChar(LispCom *com, LispByteOpcode code, char value)
+{
+    CodeTree *tree = NEW_TREE(CodeTreeBytecode);
+
+    tree->code = code;
+    tree->data.signed_char = value;
+}
+
+static void
+com_BytecodeShort(LispCom *com, LispByteOpcode code, short value)
+{
+    CodeTree *tree = NEW_TREE(CodeTreeBytecode);
+
+    tree->code = code;
+    tree->data.signed_short = value;
+}
+
+static void
+com_BytecodeAtom(LispCom *com, LispByteOpcode code, LispAtom *atom)
+{
+    CodeTree *tree = NEW_TREE(CodeTreeBytecode);
+
+    tree->code = code;
+    tree->data.atom = atom;
+}
+
+static void
+com_BytecodeObject(LispCom *com, LispByteOpcode code, LispObj *object)
+{
+    CodeTree *tree = NEW_TREE(CodeTreeBytecode);
+
+    tree->code = code;
+    tree->data.object = object;
+}
+
+static void
+com_BytecodeCons(LispCom *com, LispByteOpcode code, LispObj *car, LispObj *cdr)
+{
+    CodeTree *tree = NEW_TREE(CodeTreeBytecode);
+
+    tree->code = code;
+    tree->data.cons.car = car;
+    tree->data.cons.cdr = cdr;
+}
+
+static void
+com_Bytecode(LispCom *com, LispByteOpcode code)
+{
+    CodeTree *tree = NEW_TREE(CodeTreeBytecode);
+
+    tree->code = code;
+}
+
+static void
+com_Load(LispCom *com, short offset)
+{
+    com_BytecodeShort(com, XBC_LOAD, offset);
+}
+
+static void
+com_LoadLet(LispCom *com, short offset, LispAtom *name)
+{
+    CodeTree *tree = NEW_TREE(CodeTreeBytecode);
+
+    tree->code = XBC_LOAD_LET;
+    tree->data.let.offset = offset;
+    tree->data.let.name = name;
+}
+
+static void
+com_LoadPush(LispCom *com, short offset)
+{
+    com_BytecodeShort(com, XBC_LOAD_PUSH, offset);
+}
+
+static void
+com_Let(LispCom *com, LispAtom *name)
+{
+    com_BytecodeAtom(com, XBC_LET, name);
+}
+
+static void
+com_Bind(LispCom *com, short count)
+{
+    if (count)
+       com_BytecodeShort(com, XBC_LETBIND, count);
+}
+
+static void
+com_Unbind(LispCom *com, short count)
+{
+    if (count)
+       com_BytecodeShort(com, XBC_UNLET, count);
+}
+
+static void
+com_LoadSym(LispCom *com, LispAtom *atom)
+{
+    com_BytecodeAtom(com, XBC_LOADSYM, atom);
+}
+
+static void
+com_LoadSymLet(LispCom *com, LispAtom *symbol, LispAtom *name)
+{
+    CodeTree *tree = NEW_TREE(CodeTreeBytecode);
+
+    tree->code = XBC_LOADSYM_LET;
+    tree->data.let_sym.symbol = symbol;
+    tree->data.let_sym.name = name;
+}
+
+static void
+com_LoadSymPush(LispCom *com, LispAtom *name)
+{
+    com_BytecodeAtom(com, XBC_LOADSYM_PUSH, name);
+}
+
+static void
+com_LoadCon(LispCom *com, LispObj *constant)
+{
+    if (constant == NIL)
+       com_Bytecode(com, XBC_NIL);
+    else if (constant == T)
+       com_Bytecode(com, XBC_T);
+    else if (constant == UNSPEC) {
+       COMPILE_FAILURE("internal error: loading #<UNSPEC>");
+    }
+    else
+       com_BytecodeObject(com, XBC_LOADCON, constant);
+}
+
+static void
+com_LoadConLet(LispCom *com, LispObj *constant, LispAtom *name)
+{
+    if (constant == NIL)
+       com_BytecodeAtom(com, XBC_LET_NIL, name);
+    else {
+       CodeTree *tree = NEW_TREE(CodeTreeBytecode);
+
+       tree->code = XBC_LOADCON_LET;
+       tree->data.let_con.object = constant;
+       tree->data.let_con.name = name;
+    }
+}
+
+static void
+com_LoadConPush(LispCom *com, LispObj *constant)
+{
+    if (constant == NIL)
+       com_Bytecode(com, XBC_PUSH_NIL);
+    else if (constant == T)
+       com_Bytecode(com, XBC_PUSH_T);
+    else if (constant == UNSPEC)
+       com_Bytecode(com, XBC_PUSH_UNSPEC);
+    else
+       com_BytecodeObject(com, XBC_LOADCON_PUSH, constant);
+}
+
+static void
+com_Set(LispCom *com, short offset)
+{
+    com_BytecodeShort(com, XBC_SET, offset);
+}
+
+static void
+com_SetSym(LispCom *com, LispAtom *symbol)
+{
+    com_BytecodeAtom(com, XBC_SETSYM, symbol);
+}
+
+static void
+com_Struct(LispCom *com, short offset, LispObj *definition)
+{
+    CodeTree *tree = NEW_TREE(CodeTreeBytecode);
+
+    tree->code = XBC_STRUCT;
+    tree->data.struc.offset = offset;
+    tree->data.struc.definition = definition;
+}
+
+static void
+com_Structp(LispCom *com, LispObj *definition)
+{
+    com_BytecodeObject(com, XBC_STRUCTP, definition);
+}
+
+static void
+com_Call(LispCom *com, unsigned char num_arguments, LispBuiltin *builtin)
+{
+    CodeTree *tree = NEW_TREE(CodeTreeBytecode);
+
+    tree->code = XBC_CALL;
+    tree->data.builtin.num_arguments = num_arguments;
+    tree->data.builtin.builtin = builtin;
+}
+
+static void
+com_Bytecall(LispCom *com, unsigned char num_arguments, LispObj *code)
+{
+    CodeTree *tree = NEW_TREE(CodeTreeBytecode);
+
+    tree->code = XBC_BYTECALL;
+    tree->data.bytecall.num_arguments = num_arguments;
+    tree->data.bytecall.code = code;
+}
+
+static void
+com_Funcall(LispCom *com, LispObj *function, LispObj *arguments)
+{
+    com_BytecodeCons(com, XBC_FUNCALL, function, arguments);
+}
+
+static void
+CompileStackEnter(LispCom *com, int count, int builtin)
+{
+    if (!com->macro) {
+       if (builtin) {
+           com->stack.cbstack += count;
+           if (com->stack.bstack < com->stack.cbstack)
+               com->stack.bstack = com->stack.cbstack;
+       }
+       else {
+           com->stack.cstack += count;
+           if (com->stack.stack < com->stack.cstack)
+               com->stack.stack = com->stack.cstack;
+       }
+    }
+}
+
+static void
+CompileStackLeave(LispCom *com, int count, int builtin)
+{
+    if (!com->macro) {
+       if (builtin)
+           com->stack.cbstack -= count;
+       else
+           com->stack.cstack -= count;
+    }
+}
+
+static void
+LinkWarnUnused(LispCom *com, CodeBlock *block)
+{
+    int i;
+    CodeTree *tree;
+
+    for (tree = block->tree; tree; tree = tree->next) {
+       if (tree->type == CodeTreeBlock)
+           LinkWarnUnused(com, tree->data.block);
+    }
+
+    for (i = 0; i < block->variables.length; i++)
+       if (!(block->variables.flags[i] & (VARIABLE_USED | VARIABLE_ARGUMENT))) {
+           ++com->warnings;
+           LispWarning("the variable %s is unused",
+                       block->variables.symbols[i]->key->value);
+       }
+}
+
+#define        INTERNAL_ERROR_STRING "COMPILE: internal error #%d"
+#define        INTERNAL_ERROR(value) LispDestroy(INTERNAL_ERROR_STRING, value)
+static long
+LinkBuildOffsets(LispCom *com, CodeTree *tree, long offset)
+{
+    for (; tree; tree = tree->next) {
+       tree->offset = offset;
+       switch (tree->type) {
+           case CodeTreeBytecode:
+               switch (tree->code) {
+                   case XBC_NOOP:
+                       INTERNAL_ERROR(__LINE__);
+                       break;
+
+                   /* byte */
+                   case XBC_BCONS:
+                   case XBC_BCONS1:
+                   case XBC_BCONS2:
+                   case XBC_BCONS3:
+                   case XBC_BCONS4:
+                   case XBC_BCONS5:
+                   case XBC_BCONS6:
+                   case XBC_BCONS7:
+                   case XBC_INV:
+                   case XBC_NIL:
+                   case XBC_T:
+                   case XBC_PUSH:
+                   case XBC_CAR_PUSH:
+                   case XBC_CDR_PUSH:
+                   case XBC_PUSH_NIL:
+                   case XBC_PUSH_UNSPEC:
+                   case XBC_PUSH_T:
+                   case XBC_LSTAR:
+                   case XBC_LCONS:
+                   case XBC_LFINI:
+                   case XBC_RETURN:
+                   case XBC_CSTAR:
+                   case XBC_CFINI:
+                   case XBC_CAR:
+                   case XBC_CDR:
+                   case XBC_RPLACA:
+                   case XBC_RPLACD:
+                   case XBC_EQ:
+                   case XBC_EQL:
+                   case XBC_EQUAL:
+                   case XBC_EQUALP:
+                   case XBC_LENGTH:
+                   case XBC_LAST:
+                   case XBC_NTHCDR:
+                       ++offset;
+                       break;
+
+                   /* byte + byte */
+                   case XBC_PUSH_NIL_N:
+                   case XBC_PUSH_UNSPEC_N:
+                   case XBC_PRED:
+                   case XBC_LETREC:
+                   case XBC_LOAD_PUSH:
+                   case XBC_CAR_SET:
+                   case XBC_CDR_SET:
+                   case XBC_SET:
+                   case XBC_SET_NIL:
+                   case XBC_LETBIND:
+                   case XBC_UNLET:
+                   case XBC_LOAD:
+                   case XBC_LOAD_CAR:
+                   case XBC_LOAD_CDR:
+                   case XBC_LOAD_CAR_STORE:
+                   case XBC_LOAD_CDR_STORE:
+                   case XBC_LET:
+                   case XBC_LETX:
+                   case XBC_LET_NIL:
+                   case XBC_LETX_NIL:
+                   case XBC_STRUCTP:
+                   case XBC_SETSYM:
+                   case XBC_LOADCON_PUSH:
+                   case XBC_LOADSYM_PUSH:
+                   case XBC_LOADCON:
+                   case XBC_LOADSYM:
+                       offset += 2;
+                       break;
+
+                   /* byte + byte + byte */
+                   case XBC_CALL:
+                   case XBC_BYTECALL:
+                   case XBC_LOAD_SET:
+                   case XBC_LOAD_CAR_SET:
+                   case XBC_LOAD_CDR_SET:
+                   case XBC_LOADCON_SET:
+                   case XBC_LOAD_LET:
+                   case XBC_LOAD_LETX:
+                   case XBC_STRUCT:
+                   case XBC_LOADCON_LET:
+                   case XBC_LOADCON_LETX:
+                   case XBC_LOADSYM_LET:
+                   case XBC_LOADSYM_LETX:
+                   case XBC_CCONS:
+                   case XBC_FUNCALL:
+                       offset += 3;
+                       break;
+
+                   /* byte + short */
+                   case XBC_JUMP:
+                   case XBC_JUMPT:
+                   case XBC_JUMPNIL:
+                       /* XXX this is likely a jump to random address here */
+                       INTERNAL_ERROR(__LINE__);
+                       offset += sizeof(short) + 1;
+                       break;
+
+                   /* byte + byte + byte + byte */
+                   case XBC_CALL_SET:
+                       offset += 4;
+                       break;
+               }
+               break;
+           case CodeTreeLabel:
+               /* Labels are not loaded */
+               break;
+           case CodeTreeJump:
+           case CodeTreeJumpIf:
+           case CodeTreeCond:
+               /* If not the point where the conditional block finishes */
+               if (tree->code != XBC_NOOP)
+                   /* Reserve space for the jump opcode */
+                   offset += sizeof(short) + 1;
+               break;
+           case CodeTreeGo:
+           case CodeTreeReturn:
+               /* Reserve space for the jump opcode */
+               offset += sizeof(short) + 1;
+               break;
+           case CodeTreeBlock:
+               offset = LinkBuildOffsets(com, tree->data.block->tree, offset);
+               break;
+       }
+    }
+
+    return (offset);
+}
+
+static void
+LinkDoOptimize_0(LispCom *com, CodeBlock *block)
+{
+    CodeTree *tree, *prev, *next;
+
+    /*  Remove redundant or join opcodes that can be joined. Do it here
+     * because some of these are hard to detect earlier, and/or would
+     * require a lot of duplicated code or more time. */
+    tree = prev = block->tree;
+    while (tree) {
+       next = tree->next;
+
+       /* LET -> LET* */
+       if (next &&
+           next->type == CodeTreeBytecode &&
+           next->code == XBC_LETBIND &&
+           next->data.signed_short == 1) {
+           switch (tree->code) {
+               case XBC_LET:
+                   tree->code = XBC_LETX;
+                   goto remove_next_label;
+               case XBC_LET_NIL:
+                   tree->code = XBC_LETX_NIL;
+                   goto remove_next_label;
+               case XBC_LOAD_LET:
+                   tree->code = XBC_LOAD_LETX;
+                   goto remove_next_label;
+               case XBC_LOADCON_LET:
+                   tree->code = XBC_LOADCON_LETX;
+                   goto remove_next_label;
+               case XBC_LOADSYM_LET:
+                   tree->code = XBC_LOADSYM_LETX;
+                   goto remove_next_label;
+               default:
+                   break;
+           }
+       }
+
+       switch (tree->type) {
+           case CodeTreeBytecode:
+               switch (tree->code) {
+                   case XBC_LOADCON:
+                       if (next && next->type == CodeTreeBytecode) {
+                           switch (next->code) {
+                               case XBC_LET:
+                                   next->code = XBC_LOADCON_LET;
+                                   next->data.let_con.name =
+                                       next->data.atom;
+                                   next->data.let_con.object =
+                                       tree->data.object;
+                                   goto remove_label;
+                               case XBC_PUSH:
+                                   next->code = XBC_LOADCON_PUSH;
+                                   next->data.object = tree->data.object;
+                                   goto remove_label;
+                               case XBC_CAR:
+                                   if (tree->data.object != NIL) {
+                                       if (!CONSP(tree->data.object))
+                                           LispDestroy("CAR: %s is not a list",
+                                                       STROBJ(
+                                                       tree->data.object));
+                                       next->code = XBC_LOADCON;
+                                       next->data.object =
+                                           CAR(tree->data.object);
+                                   }
+                                   goto remove_label;
+                               case XBC_CDR:
+                                   if (tree->data.object != NIL) {
+                                       if (!CONSP(tree->data.object))
+                                           LispDestroy("CAR: %s is not a list",
+                                                       STROBJ(
+                                                       tree->data.object));
+                                       next->code = XBC_LOADCON;
+                                       next->data.object =
+                                           CDR(tree->data.object);
+                                   }
+                                   goto remove_label;
+                               case XBC_SET:
+                                   next->code = XBC_LOADCON_SET;
+                                   next->data.load_con_set.offset =
+                                       next->data.signed_short;
+                                   next->data.load_con_set.object =
+                                       tree->data.object;
+                                   goto remove_label;
+                               default:
+                                   break;
+                           }
+                       }
+                       break;
+                   case XBC_LOADSYM:
+                       if (next && next->type == CodeTreeBytecode) {
+                           switch (next->code) {
+                               case XBC_LET:
+                                   next->code = XBC_LOADSYM_LET;
+                                   next->data.let_sym.name =
+                                       next->data.atom;
+                                   next->data.let_sym.symbol =
+                                       tree->data.atom;
+                                   goto remove_label;
+                               case XBC_PUSH:
+                                   next->code = XBC_LOADSYM_PUSH;
+                                   next->data.atom = tree->data.atom;
+                                   goto remove_label;
+                               default:
+                                   break;
+                           }
+                       }
+                       break;
+                   case XBC_LOAD:
+                       if (next && next->type == CodeTreeBytecode) {
+                           switch (next->code) {
+                               case XBC_SET:
+                                   next->code = XBC_LOAD_SET;
+                                   next->data.load_set.set =
+                                       next->data.signed_short;
+                                   next->data.load_set.load =
+                                       tree->data.signed_short;
+                                   goto remove_label;
+                               /* TODO add XBC_LOAD_SETSYM */
+                               case XBC_CAR:
+                                   next->code = XBC_LOAD_CAR;
+                                   next->data.signed_short =
+                                       tree->data.signed_short;
+                                   goto remove_label;
+                               case XBC_CDR:
+                                   next->code = XBC_LOAD_CDR;
+                                   next->data.signed_short =
+                                       tree->data.signed_short;
+                                   goto remove_label;
+                               case XBC_PUSH:
+                                   tree->code = XBC_LOAD_PUSH;
+                                   goto remove_next_label;
+                               case XBC_LET:
+                                   next->code = XBC_LOAD_LET;
+                                   next->data.let.name = next->data.atom;
+                                   next->data.let.offset =
+                                       tree->data.signed_short;
+                                   goto remove_label;
+                               default:
+                                   break;
+                           }
+                       }
+                       break;
+                   case XBC_LOAD_CAR:
+                       if (next && next->type == CodeTreeBytecode &&
+                           next->code == XBC_SET) {
+                           if (next->data.signed_short ==
+                               tree->data.signed_short)
+                               next->code = XBC_LOAD_CAR_STORE;
+                           else {
+                               next->code = XBC_LOAD_CAR_SET;
+                               next->data.load_set.set =
+                                   next->data.signed_short;
+                               next->data.load_set.load =
+                                   tree->data.signed_short;
+                           }
+                           goto remove_label;
+                       }
+                       break;
+                   case XBC_LOAD_CDR:
+                       if (next && next->type == CodeTreeBytecode &&
+                           next->code == XBC_SET) {
+                           if (next->data.signed_short ==
+                               tree->data.signed_short)
+                               next->code = XBC_LOAD_CDR_STORE;
+                           else {
+                               next->code = XBC_LOAD_CDR_SET;
+                               next->data.load_set.set =
+                                   next->data.signed_short;
+                               next->data.load_set.load =
+                                   tree->data.signed_short;
+                           }
+                           goto remove_label;
+                       }
+                       break;
+                   case XBC_CALL:
+                       if (next && next->type == CodeTreeBytecode) {
+                           switch (next->code) {
+                               case XBC_SET:
+                                   next->code = XBC_CALL_SET;
+                                   next->data.builtin.offset =
+                                       next->data.signed_short;
+                                   next->data.builtin.num_arguments =
+                                       tree->data.builtin.num_arguments;
+                                   next->data.builtin.builtin =
+                                       tree->data.builtin.builtin;
+                                   goto remove_label;
+                               /* TODO add XBC_CALL_SETSYM */
+                               default:
+                                   break;
+                           }
+                       }
+                       break;
+                   case XBC_CAR:
+                       if (next && next->type == CodeTreeBytecode) {
+                           switch (next->code) {
+                               case XBC_SET:
+                                   next->code = XBC_CAR_SET;
+                                   goto remove_label;
+                               /* TODO add XBC_CAR_SETSYM */
+                               case XBC_PUSH:
+                                   next->code = XBC_CAR_PUSH;
+                                   goto remove_label;
+                               default:
+                                   break;
+                           }
+                       }
+                       break;
+                   case XBC_CDR:
+                       if (next && next->type == CodeTreeBytecode) {
+                           switch (next->code) {
+                               case XBC_SET:
+                                   next->code = XBC_CDR_SET;
+                                   goto remove_label;
+                               /* TODO add XBC_CDR_SETSYM */
+                               case XBC_PUSH:
+                                   next->code = XBC_CDR_PUSH;
+                                   goto remove_label;
+                               default:
+                                   break;
+                           }
+                       }
+                       break;
+                   case XBC_NIL:
+                       if (next && next->type == CodeTreeBytecode) {
+                           switch (next->code) {
+                               case XBC_SET:
+                                   next->code = XBC_SET_NIL;
+                                   goto remove_label;
+                               /* TODO add XBC_SETSYM_NIL */
+                               default:
+                                   break;
+                           }
+                       }
+                       break;
+                   case XBC_PUSH_NIL:
+                       if (next && next->type == CodeTreeBytecode &&
+                           next->code == XBC_PUSH_NIL) {
+                           next->code = XBC_PUSH_NIL_N;
+                           next->data.signed_char = 2;
+                           goto remove_label;
+                       }
+                       break;
+                   case XBC_PUSH_NIL_N:
+                       if (next && next->type == CodeTreeBytecode &&
+                           next->code == XBC_PUSH_NIL) {
+                           next->code = XBC_PUSH_NIL_N;
+                           next->data.signed_char = tree->data.signed_char + 1;
+                           goto remove_label;
+                       }
+                       break;
+                   case XBC_PUSH_UNSPEC:
+                       if (next && next->type == CodeTreeBytecode &&
+                           next->code == XBC_PUSH_UNSPEC) {
+                           next->code = XBC_PUSH_UNSPEC_N;
+                           next->data.signed_char = 2;
+                           goto remove_label;
+                       }
+                       break;
+                   case XBC_PUSH_UNSPEC_N:
+                       if (next && next->type == CodeTreeBytecode &&
+                           next->code == XBC_PUSH_UNSPEC) {
+                           next->code = XBC_PUSH_UNSPEC_N;
+                           next->data.signed_char = tree->data.signed_char + 1;
+                           goto remove_label;
+                       }
+                       break;
+                   default:
+                       break;
+               }
+               break;
+           case CodeTreeBlock:
+               LinkDoOptimize_0(com, tree->data.block);
+               break;
+           default:
+               break;
+       }
+       goto update_label;
+remove_label:
+       if (tree == block->tree) {
+           block->tree = prev = next;
+           if (tree == block->tail)
+               block->tail = tree;
+       }
+       else
+           prev->next = next;
+       CompileFreeTree(tree);
+       tree = next;
+       continue;
+remove_next_label:
+       tree->next = next->next;
+       CompileFreeTree(next);
+       continue;
+update_label:
+       prev = tree;
+       tree = tree->next;
+    }
+}
+
+static void
+LinkOptimize_0(LispCom *com)
+{
+    /* Recursive */
+    LinkDoOptimize_0(com, com->block);
+}
+
+static void
+LinkResolveLabels(LispCom *com, CodeBlock *block)
+{
+    int i;
+    CodeTree *tree = block->tree;
+
+    for (; tree; tree = tree->next) {
+       if (tree->type == CodeTreeBlock)
+           LinkResolveLabels(com, tree->data.block);
+       else if (tree->type == CodeTreeLabel) {
+           for (i = 0; i < block->tagbody.length; i++)
+               if (tree->data.object == block->tagbody.labels[i]) {
+                   block->tagbody.codes[i] = tree;
+                   break;
+               }
+       }
+    }
+}
+
+static void
+LinkResolveJumps(LispCom *com, CodeBlock *block)
+{
+    int i;
+    CodeBlock *body = block;
+    CodeTree *ptr, *tree = block->tree;
+
+    /* Check if there is a tagbody. Error checking already done */
+    while (body && body->type != LispBlockBody)
+       body = body->prev;
+
+    for (; tree; tree = tree->next) {
+       switch (tree->type) {
+           case CodeTreeBytecode:
+           case CodeTreeLabel:
+               break;
+
+           case CodeTreeBlock:
+               LinkResolveJumps(com, tree->data.block);
+               break;
+
+           case CodeTreeGo:
+               for (i = 0; i < body->tagbody.length; i++)
+                   if (tree->data.object == body->tagbody.labels[i])
+                       break;
+               if (i == body->tagbody.length)
+                   LispDestroy("COMPILE: no visible tag %s to GO",
+                               STROBJ(tree->data.object));
+               /* Now the jump code is known */
+               tree->data.tree = body->tagbody.codes[i];
+               break;
+
+           case CodeTreeCond:
+               if (tree->code == XBC_JUMPNIL)
+                   /* If test is NIL, go to next test */
+                   tree->data.tree = tree->group->next;
+               else if (tree->code == XBC_JUMPT) {
+                   /* After executing code, test was T */
+                   for (ptr = tree->group;
+                        ptr->code != XBC_NOOP;
+                        ptr = ptr->group)
+                       ;
+                   tree->data.tree = ptr;
+               }
+               break;
+
+           case CodeTreeJumpIf:
+               if (tree->code != XBC_NOOP) {
+                   for (ptr = tree->group;
+                        ptr->code != XBC_NOOP;
+                        ptr = ptr->group) {
+                       if (ptr->type == CodeTreeJump) {
+                           /* ELSE code of IF */
+                           ptr = ptr->next;
+                           /* Skip inconditional jump node */
+                           break;
+                       }
+                   }
+                   tree->data.tree = ptr;
+               }
+               break;
+
+           case CodeTreeJump:
+               if (tree->code != XBC_NOOP)
+                   tree->data.tree = tree->group;
+               break;
+
+           case CodeTreeReturn:
+               /* One bytecode is guaranteed to exist in the code tree */
+               if (tree->data.block->parent == NULL)
+                   /* Returning from the function or toplevel form */
+                   tree->data.tree = tree->data.block->tail;
+               else {
+                   for (;;) {
+                       ptr = tree->data.block->parent->next;
+                       if (ptr) {
+                           tree->data.tree = ptr;
+                           break;
+                       }
+                       else
+                           /* Move one BLOCK up */
+                           tree->data.block = tree->data.block->prev;
+                   }
+               }
+               break;
+       }
+    }
+}
+
+static long
+LinkPad(long offset, long adjust, int preffix, int datalen)
+{
+    /* If byte or aligned data */
+    if (datalen <= preffix || ((offset + adjust + preffix) % datalen) == 0)
+       return (adjust);
+
+    return (adjust + (datalen - ((offset + adjust + preffix) % datalen)));
+}
+
+static long
+LinkFixupOffsets(LispCom *com, CodeTree *tree, long adjust)
+{
+    for (; tree; tree = tree->next) {
+       switch (tree->type) {
+           case CodeTreeBytecode:
+               switch (tree->code) {
+                   /* byte + short */
+                   case XBC_JUMP:
+                   case XBC_JUMPT:
+                   case XBC_JUMPNIL:
+                       adjust = LinkPad(tree->offset, adjust, 1,
+                                        sizeof(short));
+                       /*FALLTROUGH*/
+                   default:
+                       tree->offset += adjust;
+                       break;
+               }
+               break;
+           case CodeTreeLabel:
+               /* Labels are not loaded, just adjust offset */
+               tree->offset += adjust;
+               break;
+           case CodeTreeJump:
+           case CodeTreeCond:
+           case CodeTreeJumpIf:
+               /* If an opcode will be generated. */
+               if (tree->code != XBC_NOOP)
+                   adjust = LinkPad(tree->offset, adjust, 1, sizeof(short));
+               tree->offset += adjust;
+               break;
+           case CodeTreeGo:
+           case CodeTreeReturn:
+               adjust = LinkPad(tree->offset, adjust, 1, sizeof(short));
+               tree->offset += adjust;
+               break;
+           case CodeTreeBlock:
+               adjust = LinkFixupOffsets(com, tree->data.block->tree, adjust);
+               break;
+       }
+    }
+
+    return (adjust);
+}
+
+static void
+LinkSkipPadding(LispCom *com, CodeTree *tree)
+{
+    int found;
+    CodeTree *ptr;
+
+    /* Recurse to adjust forward jumps or jumps to the start of the block */
+    for (ptr = tree; ptr; ptr = ptr->next) {
+       if (ptr->type == CodeTreeBlock) {
+           LinkSkipPadding(com, ptr->data.block->tree);
+           ptr->offset = ptr->data.block->tree->offset;
+       }
+    }
+
+    /* Adjust the nodes offsets */
+    for (; tree; tree = tree->next) {
+       switch (tree->type) {
+           case CodeTreeBytecode:
+           case CodeTreeBlock:
+           case CodeTreeGo:
+           case CodeTreeReturn:
+               break;
+           case CodeTreeJump:
+           case CodeTreeCond:
+           case CodeTreeJumpIf:
+               if (tree->code != XBC_NOOP)
+                   /* If code will be generated */
+                   break;
+           case CodeTreeLabel:
+               /* This should be done in reversed order, but to avoid
+                * the requirement of a prev pointer, do the job in a
+                * harder way here. */
+               for (found = 0, ptr = tree->next; ptr; ptr = ptr->next) {
+                   switch (ptr->type) {
+                       case CodeTreeBytecode:
+                       case CodeTreeBlock:
+                       case CodeTreeGo:
+                       case CodeTreeReturn:
+                           found = 1;
+                           break;
+                       case CodeTreeJump:
+                       case CodeTreeCond:
+                       case CodeTreeJumpIf:
+                           if (ptr->code != XBC_NOOP)
+                               found = 1;
+                           break;
+                       case CodeTreeLabel:
+                           break;
+                   }
+                   if (found)
+                       break;
+               }
+               if (found)
+                   tree->offset = ptr->offset;
+               break;
+       }
+    }
+}
+
+static void
+LinkCalculateJump(LispCom *com, CodeTree *tree, LispByteOpcode code)
+{
+    long jumpto, offset, distance;
+
+    tree->type = CodeTreeBytecode;
+    /* After the opcode */
+    offset = tree->offset + 1;
+    jumpto = tree->data.tree->offset;
+    /* Effective distance */
+    distance = jumpto - offset;
+    tree->code = code;
+    if (distance < -32768 || distance > 32767) {
+       COMPILE_FAILURE("jump too long");
+    }
+    tree->data.signed_int = distance;
+}
+
+static void
+LinkFixupJumps(LispCom *com, CodeTree *tree)
+{
+    for (; tree; tree = tree->next) {
+       switch (tree->type) {
+           case CodeTreeBytecode:
+           case CodeTreeLabel:
+               break;
+           case CodeTreeCond:
+               if (tree->code == XBC_JUMPNIL)
+                   /* Go to next test if NIL */
+                   LinkCalculateJump(com, tree, XBC_JUMPNIL);
+               else if (tree->code == XBC_JUMPT)
+                   /* After executing T code */
+                   LinkCalculateJump(com, tree, XBC_JUMP);
+               break;
+           case CodeTreeJumpIf:
+               if (tree->code != XBC_NOOP)
+                   LinkCalculateJump(com, tree, tree->code);
+               break;
+           case CodeTreeGo:
+               /* Inconditional jump */
+               LinkCalculateJump(com, tree, XBC_JUMP);
+               break;
+           case CodeTreeReturn:
+               /* Inconditional jump */
+               if (tree->data.tree != tree)
+                   /* If need to skip something */
+                   LinkCalculateJump(com, tree, XBC_JUMP);
+               break;
+           case CodeTreeBlock:
+               LinkFixupJumps(com, tree->data.block->tree);
+               break;
+           case CodeTreeJump:
+               if (tree->code != XBC_NOOP)
+                   LinkCalculateJump(com, tree, tree->code);
+       }
+    }
+}
+
+static void
+LinkBuildTableSymbol(LispCom *com, LispAtom *symbol)
+{
+    if (BuildTablePointer(symbol, (void***)&com->table.symbols,
+                         &com->table.num_symbols) > 0xff) {
+       COMPILE_FAILURE("more than 256 symbols");
+    }
+}
+
+static void
+LinkBuildTableConstant(LispCom *com, LispObj *constant)
+{
+    if (BuildTablePointer(constant, (void***)&com->table.constants,
+                         &com->table.num_constants) > 0xff) {
+       COMPILE_FAILURE("more than 256 constants");
+    }
+}
+
+static void
+LinkBuildTableBuiltin(LispCom *com, LispBuiltin *builtin)
+{
+    if (BuildTablePointer(builtin, (void***)&com->table.builtins,
+                         &com->table.num_builtins) > 0xff) {
+       COMPILE_FAILURE("more than 256 functions");
+    }
+}
+
+static void
+LinkBuildTableBytecode(LispCom *com, LispObj *bytecode)
+{
+    if (BuildTablePointer(bytecode, (void***)&com->table.bytecodes,
+                         &com->table.num_bytecodes) > 0xff) {
+       COMPILE_FAILURE("more than 256 bytecode functions");
+    }
+}
+
+static void
+LinkBuildTables(LispCom *com, CodeBlock *block)
+{
+    CodeTree *tree;
+
+    for (tree = block->tree; tree; tree = tree->next) {
+       switch (tree->type) {
+           case CodeTreeBytecode:
+               switch (tree->code) {
+                   case XBC_LET:
+                   case XBC_LETX:
+                   case XBC_LET_NIL:
+                   case XBC_LETX_NIL:
+                   case XBC_SETSYM:
+                   case XBC_LOADSYM:
+                   case XBC_LOADSYM_PUSH:
+                       LinkBuildTableSymbol(com, tree->data.atom);
+                       break;
+                   case XBC_STRUCTP:
+                   case XBC_LOADCON:
+                   case XBC_LOADCON_PUSH:
+                       LinkBuildTableConstant(com, tree->data.object);
+                       break;
+                   case XBC_LOADCON_SET:
+                       LinkBuildTableConstant(com, tree->data.load_con_set.object);
+                       break;
+                   case XBC_CALL:
+                   case XBC_CALL_SET:
+                       LinkBuildTableBuiltin(com, tree->data.builtin.builtin);
+                       break;
+                   case XBC_BYTECALL:
+                       LinkBuildTableBytecode(com, tree->data.bytecall.code);
+                       break;
+                   case XBC_LOAD_LET:
+                   case XBC_LOAD_LETX:
+                       LinkBuildTableSymbol(com, tree->data.let.name);
+                       break;
+                   case XBC_STRUCT:
+                       LinkBuildTableConstant(com, tree->data.struc.definition);
+                       break;
+                   case XBC_LOADSYM_LET:
+                   case XBC_LOADSYM_LETX:
+                       LinkBuildTableSymbol(com, tree->data.let_sym.symbol);
+                       LinkBuildTableSymbol(com, tree->data.let_sym.name);
+                       break;
+                   case XBC_LOADCON_LET:
+                   case XBC_LOADCON_LETX:
+                       LinkBuildTableConstant(com, tree->data.let_con.object);
+                       LinkBuildTableSymbol(com, tree->data.let_con.name);
+                       break;
+                   case XBC_CCONS:
+                   case XBC_FUNCALL:
+                       LinkBuildTableConstant(com, tree->data.cons.car);
+                       LinkBuildTableConstant(com, tree->data.cons.cdr);
+                       break;
+                   default:
+                       break;
+               }
+               break;
+           case CodeTreeBlock:
+               LinkBuildTables(com, tree->data.block);
+               break;
+           default:
+               break;
+       }
+    }
+}
+
+static long
+LinkEmmitBytecode(LispCom *com, CodeTree *tree,
+                 unsigned char *bytecode, long offset)
+{
+    short i;
+
+    for (; tree; tree = tree->next) {
+       /* Fill padding */
+       while (offset < tree->offset)
+           bytecode[offset++] = XBC_NOOP;
+
+       switch (tree->type) {
+           case CodeTreeBytecode:
+               bytecode[offset++] = tree->code;
+               switch (tree->code) {
+                   /* Noop should not enter the CodeTree */
+                   case XBC_NOOP:
+                       INTERNAL_ERROR(__LINE__);
+                       break;
+
+                   /* byte */
+                   case XBC_BCONS:
+                   case XBC_BCONS1:
+                   case XBC_BCONS2:
+                   case XBC_BCONS3:
+                   case XBC_BCONS4:
+                   case XBC_BCONS5:
+                   case XBC_BCONS6:
+                   case XBC_BCONS7:
+                   case XBC_INV:
+                   case XBC_NIL:
+                   case XBC_T:
+                   case XBC_PUSH_NIL:
+                   case XBC_PUSH_UNSPEC:
+                   case XBC_PUSH_T:
+                   case XBC_CAR_PUSH:
+                   case XBC_CDR_PUSH:
+                   case XBC_PUSH:
+                   case XBC_LSTAR:
+                   case XBC_LCONS:
+                   case XBC_LFINI:
+                   case XBC_RETURN:
+                   case XBC_CSTAR:
+                   case XBC_CFINI:
+                   case XBC_CAR:
+                   case XBC_CDR:
+                   case XBC_RPLACA:
+                   case XBC_RPLACD:
+                   case XBC_EQ:
+                   case XBC_EQL:
+                   case XBC_EQUAL:
+                   case XBC_EQUALP:
+                   case XBC_LENGTH:
+                   case XBC_LAST:
+                   case XBC_NTHCDR:
+                       break;
+
+                   /* byte + byte */
+                   case XBC_LETREC:
+                   case XBC_PRED:
+                   case XBC_PUSH_NIL_N:
+                   case XBC_PUSH_UNSPEC_N:
+                       bytecode[offset++] = tree->data.signed_char;
+                       break;
+
+                   /* byte + byte */
+                   case XBC_CAR_SET:
+                   case XBC_CDR_SET:
+                   case XBC_SET:
+                   case XBC_SET_NIL:
+                   case XBC_LETBIND:
+                   case XBC_UNLET:
+                   case XBC_LOAD_PUSH:
+                   case XBC_LOAD:
+                   case XBC_LOAD_CAR:
+                   case XBC_LOAD_CDR:
+                   case XBC_LOAD_CAR_STORE:
+                   case XBC_LOAD_CDR_STORE:
+                       bytecode[offset++] = tree->data.signed_short;
+                       break;
+
+                   /* byte + byte + byte */
+                   case XBC_LOAD_SET:
+                   case XBC_LOAD_CAR_SET:
+                   case XBC_LOAD_CDR_SET:
+                       bytecode[offset++] = tree->data.load_set.load;
+                       bytecode[offset++] = tree->data.load_set.set;
+                       break;
+
+                   /* byte + short */
+                   case XBC_JUMP:
+                   case XBC_JUMPT:
+                   case XBC_JUMPNIL:
+                       *(short*)(bytecode + offset) = tree->data.signed_int;
+                       offset += sizeof(short);
+                       break;
+
+                   /* byte + byte */
+                   case XBC_LET:
+                   case XBC_LETX:
+                   case XBC_LET_NIL:
+                   case XBC_LETX_NIL:
+                   case XBC_SETSYM:
+                   case XBC_LOADSYM:
+                   case XBC_LOADSYM_PUSH:
+                       i = FindIndex(tree->data.atom,
+                                     (void**)com->table.symbols,
+                                     com->table.num_symbols);
+                       bytecode[offset++] = i;
+                       break;
+
+                   /* byte + byte */
+                   case XBC_STRUCTP:
+                   case XBC_LOADCON:
+                   case XBC_LOADCON_PUSH:
+                       i = FindIndex(tree->data.object,
+                                     (void**)com->table.constants,
+                                     com->table.num_constants);
+                       bytecode[offset++] = i;
+                       break;
+
+                   /* byte + byte + byte */
+                   case XBC_LOADCON_SET:
+                       i = FindIndex(tree->data.load_con_set.object,
+                                     (void**)com->table.constants,
+                                     com->table.num_constants);
+                       bytecode[offset++] = i;
+                       bytecode[offset++] = tree->data.load_con_set.offset;
+                       break;
+
+                   /* byte + byte + byte */
+                   case XBC_CALL:
+                       bytecode[offset++] = tree->data.builtin.num_arguments;
+                       i = FindIndex(tree->data.builtin.builtin,
+                                     (void**)com->table.builtins,
+                                     com->table.num_builtins);
+                       bytecode[offset++] = i;
+                       break;
+
+                   /* byte + byte + byte */
+                   case XBC_BYTECALL:
+                       bytecode[offset++] = tree->data.bytecall.num_arguments;
+                       i = FindIndex(tree->data.bytecall.code,
+                                     (void**)com->table.bytecodes,
+                                     com->table.num_bytecodes);
+                       bytecode[offset++] = i;
+                       break;
+
+                   /* byte + byte + byte + byte */
+                   case XBC_CALL_SET:
+                       bytecode[offset++] = tree->data.builtin.num_arguments;
+                       i = FindIndex(tree->data.builtin.builtin,
+                                     (void**)com->table.builtins,
+                                     com->table.num_builtins);
+                       bytecode[offset++] = i;
+                       bytecode[offset++] = tree->data.builtin.offset;
+                       break;
+
+                   /* byte + byte + byte */
+                   case XBC_LOAD_LET:
+                   case XBC_LOAD_LETX:
+                       bytecode[offset++] = tree->data.let.offset;
+                       i = FindIndex(tree->data.let.name,
+                                     (void**)com->table.symbols,
+                                     com->table.num_symbols);
+                       bytecode[offset++] = i;
+                       break;
+
+                   /* byte + byte + byte */
+                   case XBC_STRUCT:
+                       bytecode[offset++] = tree->data.struc.offset;
+                       i = FindIndex(tree->data.struc.definition,
+                                     (void**)com->table.constants,
+                                     com->table.num_constants);
+                       bytecode[offset++] = i;
+                       break;
+
+                   /* byte + byte + byte */
+                   case XBC_LOADSYM_LET:
+                   case XBC_LOADSYM_LETX:
+                       i = FindIndex(tree->data.let_sym.symbol,
+                                     (void**)com->table.symbols,
+                                     com->table.num_symbols);
+                       bytecode[offset++] = i;
+                       i = FindIndex(tree->data.let_sym.name,
+                                     (void**)com->table.symbols,
+                                     com->table.num_symbols);
+                       bytecode[offset++] = i;
+                       break;
+
+                   /* byte + byte + byte */
+                   case XBC_LOADCON_LET:
+                   case XBC_LOADCON_LETX:
+                       i = FindIndex(tree->data.let_con.object,
+                                     (void**)com->table.constants,
+                                     com->table.num_constants);
+                       bytecode[offset++] = i;
+                       i = FindIndex(tree->data.let_con.name,
+                                     (void**)com->table.symbols,
+                                     com->table.num_symbols);
+                       bytecode[offset++] = i;
+                       break;
+
+                   /* byte + byte + byte */
+                   case XBC_CCONS:
+                   case XBC_FUNCALL:
+                       i = FindIndex(tree->data.cons.car,
+                                     (void**)com->table.constants,
+                                     com->table.num_constants);
+                       bytecode[offset++] = i;
+                       i = FindIndex(tree->data.cons.cdr,
+                                     (void**)com->table.constants,
+                                     com->table.num_constants);
+                       bytecode[offset++] = i;
+                       break;
+               }
+               break;
+           case CodeTreeLabel:
+               /* Labels are not loaded */
+               break;
+           case CodeTreeCond:
+           case CodeTreeJump:
+           case CodeTreeJumpIf:
+               if (tree->code != XBC_NOOP)
+                   INTERNAL_ERROR(__LINE__);
+               break;
+           case CodeTreeGo:
+               INTERNAL_ERROR(__LINE__);
+               break;
+           case CodeTreeReturn:
+               if (tree->data.tree != tree)
+                   INTERNAL_ERROR(__LINE__);
+               break;
+           case CodeTreeBlock:
+               offset = LinkEmmitBytecode(com, tree->data.block->tree,
+                                          bytecode, offset);
+               break;
+       }
+    }
+
+    return (offset);
+}
+
+static void
+LinkBytecode(LispCom *com)
+{
+    long offset, count;
+    unsigned char **codes;
+    LispObj **names;
+
+    /* Close bytecode */
+    com_Bytecode(com, XBC_RETURN);
+
+    /* The only usage of this information for now, and still may generate
+     * false positives because arguments to unamed functions are not being
+     * parsed as well as arguments to yet undefined function/maros.
+     * XXX should also add declaim/declare to let the code specify that
+     * the argument is unused */
+    LinkWarnUnused(com, com->block);
+
+    /* First level optimization */
+    LinkOptimize_0(com);
+
+    /* Resolve tagbody labels */
+    LinkResolveLabels(com, com->block);
+
+    /* Resolve any pending jumps */
+    LinkResolveJumps(com, com->block);
+
+    /* Calculate unpadded offsets */
+    LinkBuildOffsets(com, com->block->tree, 0);
+
+    /* Do padding for aligned memory reads */
+    LinkFixupOffsets(com, com->block->tree, 0);
+
+    /* Jumps normally are to a node that does not generate code,
+     * and due to padding, the jump may go to a address with a
+     * XBC_NOOP, so adjust the jump to the next useful opcode. */
+    LinkSkipPadding(com, com->block->tree);
+
+    /* Now addresses are known */
+    LinkFixupJumps(com, com->block->tree);
+
+    /* Build symbol, constant and builtin tables */
+    LinkBuildTables(com, com->block);
+
+    /* Stack info */
+    com->length = sizeof(short) * 3;
+    /* Tables info */
+    com->length += sizeof(short) * 4;
+    com->length += com->table.num_constants * sizeof(LispObj*);
+    com->length += com->table.num_symbols * sizeof(LispAtom*);
+    com->length += com->table.num_builtins * sizeof(LispBuiltin*);
+    com->length += com->table.num_bytecodes * sizeof(unsigned char*);
+    com->length += com->table.num_bytecodes * sizeof(LispObj*);
+
+    /* Allocate space for the bytecode stream */
+    com->length += com->block->tail->offset + 1;
+    com->bytecode = LispMalloc(com->length);
+
+    /* Add header */
+    offset = 0;
+    *(short*)(com->bytecode + offset) = com->stack.stack;
+    offset += sizeof(short);
+    *(short*)(com->bytecode + offset) = com->stack.bstack;
+    offset += sizeof(short);
+    *(short*)(com->bytecode + offset) = com->stack.pstack;
+    offset += sizeof(short);
+
+    *(short*)(com->bytecode + offset) = com->table.num_constants;
+    offset += sizeof(short);
+    *(short*)(com->bytecode + offset) = com->table.num_symbols;
+    offset += sizeof(short);
+    *(short*)(com->bytecode + offset) = com->table.num_builtins;
+    offset += sizeof(short);
+    *(short*)(com->bytecode + offset) = com->table.num_bytecodes;
+    offset += sizeof(short);
+
+    count = sizeof(LispObj*) * com->table.num_constants;
+    memcpy(com->bytecode + offset, com->table.constants, count);
+    offset += count;
+    count = sizeof(LispAtom*) * com->table.num_symbols;
+    memcpy(com->bytecode + offset, com->table.symbols, count);
+    offset += count;
+    count = sizeof(LispBuiltin*) * com->table.num_builtins;
+    memcpy(com->bytecode + offset, com->table.builtins, count);
+    offset += count;
+
+    /* Store bytecode information */
+    for (count = 0, codes = (unsigned char**)(com->bytecode + offset);
+        count < com->table.num_bytecodes; count++, codes++)
+       *codes = com->table.bytecodes[count]->data.bytecode.bytecode->code;
+    offset += com->table.num_bytecodes * sizeof(unsigned char*);
+    /* Store names, only useful for disassemble but may also be used
+     * to check if a function was redefined, and the bytecode is referencing
+     * the older version, the current version can be checked looking at
+     * <name>->data.atom */
+    for (count = 0, names = (LispObj**)(com->bytecode + offset);
+        count < com->table.num_bytecodes; count++, names++)
+       *names = com->table.bytecodes[count]->data.bytecode.name;
+    offset += com->table.num_bytecodes * sizeof(LispObj*);
+
+    /* Generate it */
+    LinkEmmitBytecode(com, com->block->tree, com->bytecode + offset, 0);
+}
+
+static LispObj *
+ExecuteBytecode(register unsigned char *stream)
+{
+    register LispObj *reg0;
+    register LispAtom *atom;
+    register short offset;
+    LispObj *reg1;
+    LispBuiltin *builtin;
+    LispObj *lambda;
+    LispObj *arguments;
+    unsigned char *bytecode;
+
+    LispObj **constants;
+    LispAtom **symbols;
+    LispBuiltin **builtins;
+    unsigned char **codes;
+    short num_constants, num_symbols, num_builtins, num_codes;
+
+    int lex, len;
+
+    /* To control gc protected slots */
+    int phead, pbase;
+
+    long fixnum = 0;
+
+#if defined(__GNUC__) && !defined(ANSI_SOURCE)
+#define ALLOW_GOTO_ADDRESS
+#endif
+
+#ifdef ALLOW_GOTO_ADDRESS
+#define JUMP_ADDRESS(label)    &&label
+    static const void *opcode_labels[] = {
+       JUMP_ADDRESS(XBC_NOOP),
+       JUMP_ADDRESS(XBC_INV),
+       JUMP_ADDRESS(XBC_NIL),
+       JUMP_ADDRESS(XBC_T),
+       JUMP_ADDRESS(XBC_PRED),
+       JUMP_ADDRESS(XBC_CAR),
+       JUMP_ADDRESS(XBC_CDR),
+       JUMP_ADDRESS(XBC_CAR_SET),
+       JUMP_ADDRESS(XBC_CDR_SET),
+       JUMP_ADDRESS(XBC_RPLACA),
+       JUMP_ADDRESS(XBC_RPLACD),
+       JUMP_ADDRESS(XBC_EQ),
+       JUMP_ADDRESS(XBC_EQL),
+       JUMP_ADDRESS(XBC_EQUAL),
+       JUMP_ADDRESS(XBC_EQUALP),
+       JUMP_ADDRESS(XBC_LENGTH),
+       JUMP_ADDRESS(XBC_LAST),
+       JUMP_ADDRESS(XBC_NTHCDR),
+       JUMP_ADDRESS(XBC_CAR_PUSH),
+       JUMP_ADDRESS(XBC_CDR_PUSH),
+       JUMP_ADDRESS(XBC_PUSH),
+       JUMP_ADDRESS(XBC_PUSH_NIL),
+       JUMP_ADDRESS(XBC_PUSH_UNSPEC),
+       JUMP_ADDRESS(XBC_PUSH_T),
+       JUMP_ADDRESS(XBC_PUSH_NIL_N),
+       JUMP_ADDRESS(XBC_PUSH_UNSPEC_N),
+       JUMP_ADDRESS(XBC_LET),
+       JUMP_ADDRESS(XBC_LETX),
+       JUMP_ADDRESS(XBC_LET_NIL),
+       JUMP_ADDRESS(XBC_LETX_NIL),
+       JUMP_ADDRESS(XBC_LETBIND),
+       JUMP_ADDRESS(XBC_UNLET),
+       JUMP_ADDRESS(XBC_LOAD),
+       JUMP_ADDRESS(XBC_LOAD_LET),
+       JUMP_ADDRESS(XBC_LOAD_LETX),
+       JUMP_ADDRESS(XBC_LOAD_PUSH),
+       JUMP_ADDRESS(XBC_LOADCON),
+       JUMP_ADDRESS(XBC_LOADCON_LET),
+       JUMP_ADDRESS(XBC_LOADCON_LETX),
+       JUMP_ADDRESS(XBC_LOADCON_PUSH),
+       JUMP_ADDRESS(XBC_LOAD_CAR),
+       JUMP_ADDRESS(XBC_LOAD_CDR),
+       JUMP_ADDRESS(XBC_LOAD_CAR_STORE),
+       JUMP_ADDRESS(XBC_LOAD_CDR_STORE),
+       JUMP_ADDRESS(XBC_LOADCON_SET),
+       JUMP_ADDRESS(XBC_LOADSYM),
+       JUMP_ADDRESS(XBC_LOADSYM_LET),
+       JUMP_ADDRESS(XBC_LOADSYM_LETX),
+       JUMP_ADDRESS(XBC_LOADSYM_PUSH),
+       JUMP_ADDRESS(XBC_LOAD_SET),
+       JUMP_ADDRESS(XBC_LOAD_CAR_SET),
+       JUMP_ADDRESS(XBC_LOAD_CDR_SET),
+       JUMP_ADDRESS(XBC_SET),
+       JUMP_ADDRESS(XBC_SETSYM),
+       JUMP_ADDRESS(XBC_SET_NIL),
+       JUMP_ADDRESS(XBC_CALL),
+       JUMP_ADDRESS(XBC_CALL_SET),
+       JUMP_ADDRESS(XBC_BYTECALL),
+       JUMP_ADDRESS(XBC_FUNCALL),
+       JUMP_ADDRESS(XBC_LETREC),
+       JUMP_ADDRESS(XBC_BCONS),
+       JUMP_ADDRESS(XBC_BCONS1),
+       JUMP_ADDRESS(XBC_BCONS2),
+       JUMP_ADDRESS(XBC_BCONS3),
+       JUMP_ADDRESS(XBC_BCONS4),
+       JUMP_ADDRESS(XBC_BCONS5),
+       JUMP_ADDRESS(XBC_BCONS6),
+       JUMP_ADDRESS(XBC_BCONS7),
+       JUMP_ADDRESS(XBC_CCONS),
+       JUMP_ADDRESS(XBC_CSTAR),
+       JUMP_ADDRESS(XBC_CFINI),
+       JUMP_ADDRESS(XBC_LSTAR),
+       JUMP_ADDRESS(XBC_LCONS),
+       JUMP_ADDRESS(XBC_LFINI),
+       JUMP_ADDRESS(XBC_JUMP),
+       JUMP_ADDRESS(XBC_JUMPT),
+       JUMP_ADDRESS(XBC_JUMPNIL),
+       JUMP_ADDRESS(XBC_STRUCT),
+       JUMP_ADDRESS(XBC_STRUCTP),
+       JUMP_ADDRESS(XBC_RETURN)
+    };
+    static const void *predicate_opcode_labels[] = {
+       JUMP_ADDRESS(XBP_CONSP),
+       JUMP_ADDRESS(XBP_LISTP),
+       JUMP_ADDRESS(XBP_NUMBERP)
+    };
+#endif
+
+    reg0 = NIL;
+
+    bytecode = stream;
+    pbase = lisp__data.protect.length;
+
+    /* stack */
+    offset = *(short*)stream;
+    stream += sizeof(short);
+    if (lisp__data.env.length + offset > lisp__data.env.space) {
+       do
+           LispMoreEnvironment();
+       while (lisp__data.env.length + offset >= lisp__data.env.space);
+    }
+    /* builtin stack */
+    offset = *(short*)stream;
+    stream += sizeof(short);
+    if (lisp__data.stack.length + offset >= lisp__data.stack.space) {
+       do
+           LispMoreStack();
+       while (lisp__data.stack.length + offset >= lisp__data.stack.space);
+    }
+    /* protect stack */
+    phead = *(short*)stream;
+    stream += sizeof(short);
+    if (lisp__data.protect.length + phead > lisp__data.protect.space) {
+       do
+           LispMoreProtects();
+       while (lisp__data.protect.length + phead >= lisp__data.protect.space);
+    }
+
+    num_constants = *(short*)stream;
+    stream += sizeof(short);
+    num_symbols = *(short*)stream;
+    stream += sizeof(short);
+    num_builtins = *(short*)stream;
+    stream += sizeof(short);
+    num_codes = *(short*)stream;
+    stream += sizeof(short);
+
+    constants = (LispObj**)stream;
+    stream += num_constants * sizeof(LispObj*);
+    symbols = (LispAtom**)stream;
+    stream += num_symbols * sizeof(LispAtom*);
+    builtins = (LispBuiltin**)stream;
+    stream += num_builtins * sizeof(LispBuiltin*);
+    codes = (unsigned char**)stream;
+    stream += num_codes * (sizeof(unsigned char*) + sizeof(LispObj*));
+
+    for (; phead > 0; phead--)
+       lisp__data.protect.objects[lisp__data.protect.length++] = NIL;
+    phead = pbase;
+
+#ifdef ALLOW_GOTO_ADDRESS
+#define OPCODE_LABEL(label)    label
+#define NEXT_OPCODE()          goto *opcode_labels[*stream++]
+#define GOTO_PREDICATE()       goto *predicate_opcode_labels[*stream++]
+#else
+#define OPCODE_LABEL(label)    case label
+#define NEXT_OPCODE()          goto next_opcode
+#define GOTO_PREDICATE()       goto predicate_label
+    for (;;) {
+next_opcode:
+       switch (*stream++) {
+#endif /* ALLOW_GOTO_ADDRESS */
+
+OPCODE_LABEL(XBC_NOOP):
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_PRED):
+       GOTO_PREDICATE();
+
+OPCODE_LABEL(XBC_INV):
+       reg0 = reg0 == NIL ? T : NIL;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_NIL):
+       reg0 = NIL;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_T):
+       reg0 = T;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_CAR):
+car:
+       if (reg0 != NIL) {
+           if (!CONSP(reg0))
+               LispDestroy("CAR: %s is not a list", STROBJ(reg0));
+           reg0 = CAR(reg0);
+       }
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_CDR):
+cdr:
+       if (reg0 != NIL) {
+           if (!CONSP(reg0))
+               LispDestroy("CDR: %s is not a list", STROBJ(reg0));
+           reg0 = CDR(reg0);
+       }
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_RPLACA):
+       reg1 = lisp__data.stack.values[--lisp__data.stack.length];
+       if (!CONSP(reg1))
+           LispDestroy("RPLACA: %s is not a cons", STROBJ(reg1));
+       RPLACA(reg1, reg0);
+       reg0 = reg1;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_RPLACD):
+       reg1 = lisp__data.stack.values[--lisp__data.stack.length];
+       if (!CONSP(reg1))
+           LispDestroy("RPLACD: %s is not a cons", STROBJ(reg1));
+       RPLACD(reg1, reg0);
+       reg0 = reg1;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_BCONS):
+       CAR(cons) = reg0;
+       lisp__data.stack.values[lisp__data.stack.length++] = cons;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_BCONS1):
+       offset = lisp__data.stack.length - 1;
+       CAR(cons) = reg0;
+       CAR(cons1) = lisp__data.stack.values[offset];
+       lisp__data.stack.values[offset] = cons1;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_BCONS2):
+       offset = lisp__data.stack.length;
+       CAR(cons) = reg0;
+       CAR(cons1) = lisp__data.stack.values[--offset];
+       CAR(cons2) = lisp__data.stack.values[--offset];
+       lisp__data.stack.values[offset] = cons2;
+       lisp__data.stack.length = offset + 1;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_BCONS3):
+       offset = lisp__data.stack.length;
+       CAR(cons) = reg0;
+       CAR(cons1) = lisp__data.stack.values[--offset];
+       CAR(cons2) = lisp__data.stack.values[--offset];
+       CAR(cons3) = lisp__data.stack.values[--offset];
+       lisp__data.stack.values[offset] = cons3;
+       lisp__data.stack.length = offset + 1;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_BCONS4):
+       offset = lisp__data.stack.length;
+       CAR(cons) = reg0;
+       CAR(cons1) = lisp__data.stack.values[--offset];
+       CAR(cons2) = lisp__data.stack.values[--offset];
+       CAR(cons3) = lisp__data.stack.values[--offset];
+       CAR(cons4) = lisp__data.stack.values[--offset];
+       lisp__data.stack.values[offset] = cons4;
+       lisp__data.stack.length = offset + 1;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_BCONS5):
+       offset = lisp__data.stack.length;
+       CAR(cons) = reg0;
+       CAR(cons1) = lisp__data.stack.values[--offset];
+       CAR(cons2) = lisp__data.stack.values[--offset];
+       CAR(cons3) = lisp__data.stack.values[--offset];
+       CAR(cons4) = lisp__data.stack.values[--offset];
+       CAR(cons5) = lisp__data.stack.values[--offset];
+       lisp__data.stack.values[offset] = cons5;
+       lisp__data.stack.length = offset + 1;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_BCONS6):
+       offset = lisp__data.stack.length;
+       CAR(cons) = reg0;
+       CAR(cons1) = lisp__data.stack.values[--offset];
+       CAR(cons2) = lisp__data.stack.values[--offset];
+       CAR(cons3) = lisp__data.stack.values[--offset];
+       CAR(cons4) = lisp__data.stack.values[--offset];
+       CAR(cons5) = lisp__data.stack.values[--offset];
+       CAR(cons6) = lisp__data.stack.values[--offset];
+       lisp__data.stack.values[offset] = cons6;
+       lisp__data.stack.length = offset + 1;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_BCONS7):
+       offset = lisp__data.stack.length;
+       CAR(cons) = reg0;
+       CAR(cons1) = lisp__data.stack.values[--offset];
+       CAR(cons2) = lisp__data.stack.values[--offset];
+       CAR(cons3) = lisp__data.stack.values[--offset];
+       CAR(cons4) = lisp__data.stack.values[--offset];
+       CAR(cons5) = lisp__data.stack.values[--offset];
+       CAR(cons6) = lisp__data.stack.values[--offset];
+       CAR(cons7) = lisp__data.stack.values[--offset];
+       lisp__data.stack.values[offset] = cons7;
+       lisp__data.stack.length = offset + 1;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_EQ):
+       reg0 = reg0 == lisp__data.stack.values[--lisp__data.stack.length] ? T : NIL;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_EQL):
+       reg1 = lisp__data.stack.values[--lisp__data.stack.length];
+       reg0 = XEQL(reg1, reg0);
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_EQUAL):
+       reg1 = lisp__data.stack.values[--lisp__data.stack.length];
+       reg0 = XEQUAL(reg1, reg0);
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_EQUALP):
+       reg1 = lisp__data.stack.values[--lisp__data.stack.length];
+       reg0 = XEQUALP(reg1, reg0);
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_LENGTH):
+       reg0 = FIXNUM(LispLength(reg0));
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_LAST):
+    {
+       long length;
+
+       reg1 = lisp__data.stack.values[--lisp__data.stack.length];
+       if (CONSP(reg1)) {
+           if (reg0 != NIL) {
+               if (!FIXNUMP(reg0) || (fixnum = FIXNUM_VALUE(reg0)) < 0)
+                   LispDestroy("LAST: %s is not a positive fixnum",
+                               STROBJ(reg0));
+           }
+           else
+               fixnum = 1;
+           reg0 = reg1;
+           for (reg0 = reg1, length = 0;
+                CONSP(reg0);
+                reg0 = CDR(reg0), length++)
+               ;
+           for (length -= fixnum, reg0 = reg1; length > 0; length--)
+               reg0 = CDR(reg0);
+       }
+       else
+           reg0 = reg1;
+    }  NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_NTHCDR):
+       reg1 = lisp__data.stack.values[--lisp__data.stack.length];
+       if (!FIXNUMP(reg1) || (fixnum = FIXNUM_VALUE(reg1)) < 0)
+           LispDestroy("NTHCDR: %s is not a positive fixnum",
+                       STROBJ(reg1));
+       if (reg0 != NIL) {
+           if (!CONSP(reg0))
+               LispDestroy("NTHCDR: %s is not a list", STROBJ(reg0));
+           for (; fixnum > 0; fixnum--) {
+               if (!CONSP(reg0))
+                   break;
+               reg0 = CDR(reg0);
+           }
+       }
+       NEXT_OPCODE();
+
+       /* Push to builtin stack */
+OPCODE_LABEL(XBC_CAR_PUSH):
+       if (reg0 != NIL) {
+           if (!CONSP(reg0))
+               LispDestroy("CAR: %s is not a list", STROBJ(reg0));
+           reg0 = CAR(reg0);
+       }
+       goto push_builtin;
+
+OPCODE_LABEL(XBC_CDR_PUSH):
+       if (reg0 != NIL) {
+           if (!CONSP(reg0))
+               LispDestroy("CDR: %s is not a list", STROBJ(reg0));
+           reg0 = CDR(reg0);
+       }
+       /*FALLTROUGH*/
+
+OPCODE_LABEL(XBC_PUSH):
+push_builtin:
+       lisp__data.stack.values[lisp__data.stack.length++] = reg0;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_PUSH_NIL):
+       lisp__data.stack.values[lisp__data.stack.length++] = NIL;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_PUSH_UNSPEC):
+       lisp__data.stack.values[lisp__data.stack.length++] = UNSPEC;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_PUSH_T):
+       lisp__data.stack.values[lisp__data.stack.length++] = T;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_PUSH_NIL_N):
+       for (offset = *stream++; offset > 0; offset--)
+           lisp__data.stack.values[lisp__data.stack.length++] = NIL;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_PUSH_UNSPEC_N):
+       for (offset = *stream++; offset > 0; offset--)
+           lisp__data.stack.values[lisp__data.stack.length++] = UNSPEC;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_LET):
+let_argument:
+       /*  The global object value is not changed, so it does not
+        * matter if it is a constant symbol. An error would be
+        * generated if it was declared as constant at the time of
+        * bytecode generation. Check can be done looking at the
+        * atom->constant field. */
+       atom = symbols[*stream++];
+       atom->offset = lisp__data.env.length;
+       lisp__data.env.names[lisp__data.env.length] = atom->key;
+       lisp__data.env.values[lisp__data.env.length++] = reg0;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_LETX):
+letx_argument:
+       atom = symbols[*stream++];
+       atom->offset = lisp__data.env.length;
+       lisp__data.env.names[lisp__data.env.length] = atom->key;
+       lisp__data.env.values[lisp__data.env.length++] = reg0;
+       lisp__data.env.head++;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_LET_NIL):
+       atom = symbols[*stream++];
+       atom->offset = lisp__data.env.length;
+       lisp__data.env.names[lisp__data.env.length] = atom->key;
+       lisp__data.env.values[lisp__data.env.length++] = NIL;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_LETX_NIL):
+       atom = symbols[*stream++];
+       atom->offset = lisp__data.env.length;
+       lisp__data.env.names[lisp__data.env.length] = atom->key;
+       lisp__data.env.values[lisp__data.env.length++] = NIL;
+       lisp__data.env.head++;
+       NEXT_OPCODE();
+
+       /* Bind locally added variables to a block */
+OPCODE_LABEL(XBC_LETBIND):
+       offset = *stream++;
+       lisp__data.env.head += offset;
+       NEXT_OPCODE();
+
+       /* Unbind locally added variables to a block */
+OPCODE_LABEL(XBC_UNLET):
+       offset = *stream++;
+       lisp__data.env.head -= offset;
+       lisp__data.env.length -= offset;
+       NEXT_OPCODE();
+
+       /* Load value from stack */
+OPCODE_LABEL(XBC_LOAD):
+       offset = *stream++;
+       reg0 = lisp__data.env.values[lisp__data.env.lex + offset];
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_LOAD_CAR):
+       offset = *stream++;
+       reg0 = lisp__data.env.values[lisp__data.env.lex + offset];
+       goto car;
+
+OPCODE_LABEL(XBC_LOAD_CDR):
+       offset = *stream++;
+       reg0 = lisp__data.env.values[lisp__data.env.lex + offset];
+       goto cdr;
+
+OPCODE_LABEL(XBC_LOAD_CAR_STORE):
+       offset = *stream++;
+       reg0 = lisp__data.env.values[lisp__data.env.lex + offset];
+       if (reg0 != NIL) {
+           if (!CONSP(reg0))
+               LispDestroy("CAR: %s is not a list", STROBJ(reg0));
+           reg0 = CAR(reg0);
+           lisp__data.env.values[lisp__data.env.lex + offset] = reg0;
+       }
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_LOAD_CDR_STORE):
+       offset = *stream++;
+       reg0 = lisp__data.env.values[lisp__data.env.lex + offset];
+       if (reg0 != NIL) {
+           if (!CONSP(reg0))
+               LispDestroy("CDR: %s is not a list", STROBJ(reg0));
+           reg0 = CDR(reg0);
+           lisp__data.env.values[lisp__data.env.lex + offset] = reg0;
+       }
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_LOAD_LET):
+       offset = *stream++;
+       reg0 = lisp__data.env.values[lisp__data.env.lex + offset];
+       goto let_argument;
+
+OPCODE_LABEL(XBC_LOAD_LETX):
+       offset = *stream++;
+       reg0 = lisp__data.env.values[lisp__data.env.lex + offset];
+       goto letx_argument;
+
+OPCODE_LABEL(XBC_LOAD_PUSH):
+       offset = *stream++;
+       reg0 = lisp__data.env.values[lisp__data.env.lex + offset];
+       lisp__data.stack.values[lisp__data.stack.length++] = reg0;
+       NEXT_OPCODE();
+
+       /* Load pointer to constant */
+OPCODE_LABEL(XBC_LOADCON):
+       reg0 = constants[*stream++];
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_LOADCON_LET):
+       reg0 = constants[*stream++];
+       goto let_argument;
+
+OPCODE_LABEL(XBC_LOADCON_LETX):
+       reg0 = constants[*stream++];
+       goto letx_argument;
+
+OPCODE_LABEL(XBC_LOADCON_PUSH):
+       reg0 = constants[*stream++];
+       lisp__data.stack.values[lisp__data.stack.length++] = reg0;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_LOADCON_SET):
+       reg0 = constants[*stream++];
+       offset = *stream++;
+       lisp__data.env.values[lisp__data.env.lex + offset] = reg0;
+       NEXT_OPCODE();
+
+       /* Change value of local variable */
+OPCODE_LABEL(XBC_CAR_SET):
+car_set:
+       if (reg0 != NIL) {
+           if (!CONSP(reg0))
+               LispDestroy("CAR: %s is not a list", STROBJ(reg0));
+           reg0 = CAR(reg0);
+       }
+       goto set_local_variable;
+
+OPCODE_LABEL(XBC_CDR_SET):
+cdr_set:
+       if (reg0 != NIL) {
+           if (!CONSP(reg0))
+               LispDestroy("CDR: %s is not a list", STROBJ(reg0));
+           reg0 = CDR(reg0);
+       }
+       goto set_local_variable;
+
+OPCODE_LABEL(XBC_LOAD_CAR_SET):
+       offset = *stream++;
+       reg0 = lisp__data.env.values[lisp__data.env.lex + offset];
+       goto car_set;
+
+OPCODE_LABEL(XBC_LOAD_CDR_SET):
+       offset = *stream++;
+       reg0 = lisp__data.env.values[lisp__data.env.lex + offset];
+       goto cdr_set;
+
+OPCODE_LABEL(XBC_LOAD_SET):
+       offset = *stream++;
+       reg0 = lisp__data.env.values[lisp__data.env.lex + offset];
+       /*FALLTROUGH*/
+
+OPCODE_LABEL(XBC_SET):
+set_local_variable:
+       offset = *stream++;
+       lisp__data.env.values[lisp__data.env.lex + offset] = reg0;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_SET_NIL):
+       offset = *stream++;
+       lisp__data.env.values[lisp__data.env.lex + offset] = NIL;
+       NEXT_OPCODE();
+
+       /* Change value of a global/special variable */
+OPCODE_LABEL(XBC_SETSYM):
+           atom = symbols[*stream++];
+           if (atom->dyn) {
+               /*  atom->dyn and atom->constant are exclusive, no
+                * need to check if variable declared as constant. */
+               if (atom->offset < lisp__data.env.head &&
+                   lisp__data.env.names[atom->offset] == atom->key)
+                   lisp__data.env.values[atom->offset] = reg0;
+               else {
+                   if (atom->watch)
+                       LispSetAtomObjectProperty(atom, reg0);
+                   else
+                       SETVALUE(atom, reg0);
+               }
+           }
+           else if (atom->a_object) {
+               if (atom->constant)
+                   LispDestroy("EVAL: %s is a constant",
+                               STROBJ(atom->object));
+               else if (atom->watch)
+                   LispSetAtomObjectProperty(atom, reg0);
+               else
+                   SETVALUE(atom, reg0);
+           }
+           else {
+               /* Create new global variable */
+               LispPackage *pack;
+
+               LispWarning("the variable %s was not declared",
+                           atom->key->value);
+               LispSetAtomObjectProperty(atom, reg0);
+               pack = atom->package->data.package.package;
+               if (pack->glb.length >= pack->glb.space)
+                   LispMoreGlobals(pack);
+               pack->glb.pairs[pack->glb.length++] = atom->object;
+           }
+           NEXT_OPCODE();
+
+/* Resolve symbol value at runtime */
+#define LOAD_SYMBOL_VALUE()                                        \
+    atom = symbols[*stream++];                                     \
+    if (atom->dyn) {                                               \
+       if (atom->offset < lisp__data.env.head &&                   \
+           lisp__data.env.names[atom->offset] == atom->key)        \
+           reg0 = lisp__data.env.values[atom->offset];             \
+       else {                                                      \
+           reg0 = atom->property->value;                           \
+           if (reg0 == UNBOUND)                                    \
+               LispDestroy("EVAL: the symbol %s is unbound",  \
+                           STROBJ(atom->object));                  \
+       }                                                           \
+    }                                                              \
+    else {                                                         \
+       if (atom->a_object)                                         \
+           reg0 = atom->property->value;                           \
+       else                                                        \
+           LispDestroy("EVAL: the symbol %s is unbound",           \
+                       STROBJ(atom->object));                      \
+    }
+
+OPCODE_LABEL(XBC_LOADSYM):
+       LOAD_SYMBOL_VALUE();
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_LOADSYM_LET):
+       LOAD_SYMBOL_VALUE();
+       goto let_argument;
+
+OPCODE_LABEL(XBC_LOADSYM_LETX):
+       LOAD_SYMBOL_VALUE();
+       goto letx_argument;
+
+OPCODE_LABEL(XBC_LOADSYM_PUSH):
+       LOAD_SYMBOL_VALUE();
+       lisp__data.stack.values[lisp__data.stack.length++] = reg0;
+       NEXT_OPCODE();
+
+           /* Builtin function */
+OPCODE_LABEL(XBC_CALL):
+       offset = *stream++;
+       lisp__data.stack.base = lisp__data.stack.length - offset;
+       builtin = builtins[*stream++];
+       if (builtin->multiple_values) {
+           RETURN_COUNT = 0;
+           reg0 = builtin->function(builtin);
+       }
+       else {
+           reg0 = builtin->function(builtin);
+           RETURN_COUNT = 0;
+       }
+       lisp__data.stack.length -= offset;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_CALL_SET):
+       offset = *stream++;
+       lisp__data.stack.base = lisp__data.stack.length - offset;
+       builtin = builtins[*stream++];
+       if (builtin->multiple_values) {
+           RETURN_COUNT = 0;
+           reg0 = builtin->function(builtin);
+       }
+       else {
+           reg0 = builtin->function(builtin);
+           RETURN_COUNT = 0;
+       }
+       lisp__data.stack.length -= offset;
+       offset = *stream++;
+       lisp__data.env.values[lisp__data.env.lex + offset] = reg0;
+       NEXT_OPCODE();
+
+       /* Bytecode call */
+OPCODE_LABEL(XBC_BYTECALL):
+       lex = lisp__data.env.lex;
+       offset = *stream++;
+       lisp__data.env.head = lisp__data.env.length;
+       len = lisp__data.env.lex = lisp__data.env.length - offset;
+       reg0 = ExecuteBytecode(codes[*stream++]);
+       lisp__data.env.length = lisp__data.env.head = len;
+       lisp__data.env.lex = lex;
+       NEXT_OPCODE();
+
+       /* Unimplemented function/macro call */
+OPCODE_LABEL(XBC_FUNCALL):
+       lambda = constants[*stream++];
+       arguments = constants[*stream++];
+       reg0 = LispFuncall(lambda, arguments, 1);
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_JUMP):
+       stream += *(signed short*)stream;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_JUMPT):
+       if (reg0 != NIL)
+           stream += *(signed short*)stream;
+       else
+           /* skip jump relative offset */
+           stream += sizeof(signed short);
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_JUMPNIL):
+       if (reg0 == NIL)
+           stream += *(signed short*)stream;
+       else
+           /* skip jump relative offset */
+           stream += sizeof(signed short);
+       NEXT_OPCODE();
+
+       /* Build CONS of two constant arguments */
+OPCODE_LABEL(XBC_CCONS):
+       reg0 = constants[*stream++];
+       reg1 = constants[*stream++];
+       reg0 = CONS(reg0, reg1);
+       NEXT_OPCODE();
+
+       /* Start CONS */
+OPCODE_LABEL(XBC_CSTAR):
+       /* This the CAR of the CONS */
+       lisp__data.protect.objects[phead++] = reg0;
+       NEXT_OPCODE();
+
+       /* Finish CONS */
+OPCODE_LABEL(XBC_CFINI):
+       reg0 = CONS(lisp__data.protect.objects[--phead], reg0);
+       NEXT_OPCODE();
+
+       /* Start building list */
+OPCODE_LABEL(XBC_LSTAR):
+       reg1 = CONS(reg0, NIL);
+       /* Start of list stored here */
+       lisp__data.protect.objects[phead++] = reg1;
+       /* Tail of list stored here */
+       lisp__data.protect.objects[phead++] = reg1;
+       NEXT_OPCODE();
+
+       /* Add to list */
+OPCODE_LABEL(XBC_LCONS):
+       reg1 = lisp__data.protect.objects[phead - 2];
+       RPLACD(reg1, CONS(reg0, NIL));
+        lisp__data.protect.objects[phead - 2] = CDR(reg1);
+       NEXT_OPCODE();
+
+       /* Finish list */
+OPCODE_LABEL(XBC_LFINI):
+       phead -= 2;
+       reg0 = lisp__data.protect.objects[phead + 1];
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_STRUCT):
+       offset = *stream++;
+       reg1 = constants[*stream++];
+       if (!STRUCTP(reg0) || reg0->data.struc.def != reg1) {
+           char *name = ATOMID(CAR(reg1))->value;
+
+           for (reg1 = CDR(reg1); offset; offset--)
+               reg1 = CDR(reg1);
+           LispDestroy("%s-%s: %s is not a %s",
+                       name, ATOMID(CAR(reg1))->value, STROBJ(reg0), name);
+       }
+       for (reg0 = reg0->data.struc.fields; offset; offset--)
+           reg0 = CDR(reg0);
+       reg0 = CAR(reg0);
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_STRUCTP):
+       reg1 = constants[*stream++];
+       reg0 = STRUCTP(reg0) && reg0->data.struc.def == reg1 ? T : NIL;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_LETREC):
+       /* XXX could/should optimize, shouldn't need to parse
+        * the bytecode header again */
+       lex = lisp__data.env.lex;
+       offset = *stream++;
+       lisp__data.env.head = lisp__data.env.length;
+       len = lisp__data.env.lex = lisp__data.env.length - offset;
+       reg0 = ExecuteBytecode(bytecode);
+       lisp__data.env.length = lisp__data.env.head = len;
+       lisp__data.env.lex = lex;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBC_RETURN):
+       lisp__data.protect.length = pbase;
+       return (reg0);
+
+#ifndef ALLOW_GOTO_ADDRESS
+       }       /* end of switch */
+
+predicate_label:
+       switch (*stream++) {
+#endif
+
+OPCODE_LABEL(XBP_CONSP):
+       reg0 = CONSP(reg0) ? T : NIL;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBP_LISTP):
+       reg0 = LISTP(reg0) ? T : NIL;
+       NEXT_OPCODE();
+
+OPCODE_LABEL(XBP_NUMBERP):
+       reg0 = NUMBERP(reg0) ? T : NIL;
+       NEXT_OPCODE();
+
+#ifndef ALLOW_GOTO_ADDRESS
+       }       /* end of switch */
+    }
+#endif
+
+    /*NOTREACHED*/
+    return (reg0);
+}
diff --git a/xedit/lisp/bytecode.h b/xedit/lisp/bytecode.h
new file mode 100644 (file)
index 0000000..8aac701
--- /dev/null
@@ -0,0 +1,268 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/bytecode.h,v 1.5tsi Exp $ */
+
+#include "lisp/private.h"
+
+#ifndef Lisp_Bytecode_h
+#define Lisp_Bytecode_h
+
+/* Number of arguments for &REST functions with no side effects,
+ * i.e. does not need to allocate new cells to build argument list.
+ * If this value is changed, it is also required to add more
+ * XBC_BCONS? opcodes and change ExecuteBytecode() */
+#define MAX_BCONS      8
+
+typedef enum {
+    XBP_CONSP,
+    XBP_LISTP,
+    XBP_NUMBERP
+} LispBytePredicate;
+
+typedef enum {
+    XBC_NOOP,
+
+    XBC_INV,           /* If NIL loaded, change to T else to NIL */
+    XBC_NIL,           /* Load NIL */
+    XBC_T,             /* Load T */
+
+    XBC_PRED,          /* Preffix for predicate test */
+       /* Followed by byte indicating test */
+
+    XBC_CAR,           /* Set loaded value to it's car */
+    XBC_CDR,           /* Set loaded value to it's cdr */
+
+    XBC_CAR_SET,       /* Set local variable to CAR or CDR of loaded value */
+    XBC_CDR_SET,
+       /* Offset of local variable follows */
+
+    /* Sets C[AD]R of top of builtin stack with
+     * loaded value and pop builtin stack */
+    XBC_RPLACA,
+    XBC_RPLACD,
+
+    /* Push only one argument in builtin stack, and call directly
+     * LispObjectCompare without the need of pushing the second arguument */
+    XBC_EQ,
+    XBC_EQL,
+    XBC_EQUAL,
+    XBC_EQUALP,
+
+    XBC_LENGTH,
+    XBC_LAST,
+    XBC_NTHCDR,
+
+    XBC_CAR_PUSH,      /* Pushes CAR or CDR of loaded value to builtin stack */
+    XBC_CDR_PUSH,
+
+    XBC_PUSH,          /* Push argument in builtin stack */
+    XBC_PUSH_NIL,      /* Pushes NIL in builtin stack */
+    XBC_PUSH_UNSPEC,   /* Pushes #<UNSPEC> in builtin stack */
+    XBC_PUSH_T,                /* Pushes T in builtin stack */
+    XBC_PUSH_NIL_N,    /* Pushes NIL in the builtin stack N times */
+    XBC_PUSH_UNSPEC_N, /* Pushes #<UNSPEC> in the builtin stack N times */
+
+
+       /* The builtin stack base is saved when entering the bytecode
+        * interpreter, and the bytecode does not reenter from builtin
+        * functions, yet, so there is no need, for XBC_BSAVE and
+        * XBC_BREST instructions */
+
+    XBC_LET,           /* Push loaded value to stack */
+    XBC_LETX,          /* Push loaded value to stack and bind */
+       /*  Next byte(s) are the symbol offset */
+    XBC_LET_NIL,       /* Push loaded value to stack */
+    XBC_LETX_NIL,      /* Push loaded value to stack and bind */
+       /*  Next byte(s) are the symbol offset */
+
+    XBC_LETBIND,       /* Bind locally added variables */
+       /* Followed by number of symbols to bind */
+
+    XBC_UNLET,         /* Unbind locally binded variables */
+       /* Followed by number of symbols to unbind */
+
+    XBC_LOAD,          /* Load argument already from the stack */
+       /* Followed by  offset follows the opcode */
+    XBC_LOAD_LET,      /* Load argument and push */
+    XBC_LOAD_LETX,     /* Load argument,  push and bind */
+       /* Followed by a short and the atom to be bound */
+    XBC_LOAD_PUSH,
+
+    XBC_LOADCON,       /* Load a literal constant */
+       /* Next bytes are the constant object */
+    XBC_LOADCON_LET,   /* Load a literal constant and push */
+    XBC_LOADCON_LETX,  /* Load a literal constant, push and bind */
+       /* Followed by object constant and symbol to be bound */
+    XBC_LOADCON_PUSH,
+
+    /* Load CAR or CDR of local variable */
+    XBC_LOAD_CAR,
+    XBC_LOAD_CDR,
+
+    /* Change local variable value to it's CAR or CDR */
+    XBC_LOAD_CAR_STORE,
+    XBC_LOAD_CDR_STORE,
+
+    XBC_LOADCON_SET,
+       /* Followed by constant offset and local variable offset */
+
+    XBC_LOADSYM,       /* Load object symbol value */
+       /* The object atom pointer follows de opcode */
+    XBC_LOADSYM_LET,   /* Load object symbol value and push */
+    XBC_LOADSYM_LETX,  /* Load object symbol value, push and bind */
+       /* The symbol atom name and bounded atom name to be bound follows */
+    XBC_LOADSYM_PUSH,
+
+    XBC_LOAD_SET,      /* Set value of local variable to the value of another */
+       /* Followed by two shorts */
+    XBC_LOAD_CAR_SET,  /* Like LOAD_SET, but apply CAR or CDR in the value */
+    XBC_LOAD_CDR_SET,
+
+    XBC_SET,           /* Change value of local variable */
+       /* A short integer with relative offset follows opcode */
+    XBC_SETSYM,                /* Change value of symbol */
+       /* The atom symbol pointer follows opcode */
+
+    XBC_SET_NIL,       /* Like XBC_SET but sets the local variable to NIL */
+
+    XBC_CALL,          /* Call builtin function */
+       /* 1 byte follows telling how many arguments to use */
+       /* LispBuiltin pointer follows opcode */
+
+    XBC_CALL_SET,
+       /* Like BCALL, but also followed by an short index of local variable */
+
+    XBC_BYTECALL,      /* Call bytecode */
+       /* 1 byte for number of arguments */
+       /* 1 byte for index in bytecode table */
+
+    XBC_FUNCALL,
+       /* Opcode followed by function and arguments objects, to
+        * be evaluated at run time, as it was not resolved at
+        * bytecode generation time (or is not implemented in
+        * the bytecode compiler) */
+
+
+    XBC_LETREC,                /* Recursive function call */
+       /* 1 byte follows telling how many arguments the funtion receives */
+
+    /* Helper for math functions. Uses a preallocated CONS,
+     * setting it's CAR to the loaded value, and in the same step
+     * pushes the CONS to the builtin stack */
+    XBC_BCONS,
+    /* Like BCONS but it is a list of 2 arguments, first argument
+     * is saved on the stack, replace with list of 2 arguments */
+    XBC_BCONS1,
+    /* Like BCONS1 but it is a list of 3 arguments, first arguments
+     * are saved on the stack, replace with list of first stack
+     * argument with list or 3 arguments, and pop stack  */
+    XBC_BCONS2,
+    XBC_BCONS3,
+    XBC_BCONS4,
+    XBC_BCONS5,
+    XBC_BCONS6,
+    XBC_BCONS7,
+
+    /* Build a CONS */
+    XBC_CCONS,         /* Make CONS of two constants */
+       /* Constants follow opcode */
+    XBC_CSTAR,         /* Save the CAR of the CONS */
+    XBC_CFINI,         /* Loaded value is the CDR */
+
+    /* These are to help in interactively building lists */
+    XBC_LSTAR,         /* Start building a list in the gc protected stack */
+    XBC_LCONS,         /* Add loaded object to list */
+    XBC_LFINI,         /* List is finished */
+
+    /* Inconditional jumps */
+    XBC_JUMP,          /* Jump relative to following signed int */
+
+    /* Conditional jumps, if true */
+    XBC_JUMPT,         /* Jump relative to following signed int */
+
+    /* Conditional jumps, if false */
+    XBC_JUMPNIL,       /* Jump relative to following signed int */
+
+    /* Structure field access and type check */
+    XBC_STRUCT,
+    XBC_STRUCTP,
+
+    XBC_RETURN         /* Resume bytecode execution */
+} LispByteOpcode;
+
+
+struct _LispBytecode {
+    unsigned char *code;       /* Bytecode data */
+    long length;               /* length of bytecode stream */
+};
+
+/*
+ * Prototypes
+ */
+void LispBytecodeInit(void);
+
+LispObj *Lisp_Compile(LispBuiltin*);
+LispObj *Lisp_Disassemble(LispBuiltin*);
+
+LispObj *LispCompileForm(LispObj*);
+LispObj *LispExecuteBytecode(LispObj*);
+
+void Com_And(LispCom*, LispBuiltin*);
+void Com_Block(LispCom*, LispBuiltin*);
+void Com_C_r(LispCom*, LispBuiltin*);
+void Com_Cond(LispCom*, LispBuiltin*);
+void Com_Cons(LispCom*, LispBuiltin*);
+void Com_Consp(LispCom*, LispBuiltin*);
+void Com_Dolist(LispCom*, LispBuiltin*);
+void Com_Eq(LispCom*, LispBuiltin*);
+void Com_Go(LispCom*, LispBuiltin*);
+void Com_If(LispCom*, LispBuiltin*);
+void Com_Last(LispCom*, LispBuiltin*);
+void Com_Length(LispCom*, LispBuiltin*);
+void Com_Let(LispCom*, LispBuiltin*);
+void Com_Letx(LispCom*, LispBuiltin*);
+void Com_Listp(LispCom*, LispBuiltin*);
+void Com_Loop(LispCom*, LispBuiltin*);
+void Com_Nthcdr(LispCom*, LispBuiltin*);
+void Com_Null(LispCom*, LispBuiltin*);
+void Com_Numberp(LispCom*, LispBuiltin*);
+void Com_Or(LispCom*, LispBuiltin*);
+void Com_Progn(LispCom*, LispBuiltin*);
+void Com_Return(LispCom*, LispBuiltin*);
+void Com_ReturnFrom(LispCom*, LispBuiltin*);
+void Com_Rplac_(LispCom*, LispBuiltin*);
+void Com_Setq(LispCom*, LispBuiltin*);
+void Com_Tagbody(LispCom*, LispBuiltin*);
+void Com_Unless(LispCom*, LispBuiltin*);
+void Com_Until(LispCom*, LispBuiltin*);
+void Com_When(LispCom*, LispBuiltin*);
+void Com_While(LispCom*, LispBuiltin*);
+
+#endif /* Lisp_Bytecode_h */
diff --git a/xedit/lisp/compile.c b/xedit/lisp/compile.c
new file mode 100644 (file)
index 0000000..829baea
--- /dev/null
@@ -0,0 +1,2224 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/compile.c,v 1.15tsi Exp $ */
+
+#define VARIABLE_USED          0x0001
+#define VARIABLE_ARGUMENT      0x0002
+
+/*
+ * Prototypes
+ */
+static void ComPredicate(LispCom*, LispBuiltin*, LispBytePredicate);
+static void ComReturnFrom(LispCom*, LispBuiltin*, int);
+
+static int ComConstantp(LispCom*, LispObj*);
+static void ComAddVariable(LispCom*, LispObj*, LispObj*);
+static int ComGetVariable(LispCom*, LispObj*);
+static void ComVariableSetFlag(LispCom*, LispAtom*, int);
+#define COM_VARIABLE_USED(atom)                                \
+    ComVariableSetFlag(com, atom, VARIABLE_USED)
+#define COM_VARIABLE_ARGUMENT(atom)                    \
+       ComVariableSetFlag(com, atom, VARIABLE_ARGUMENT)
+
+static int FindIndex(void*, void**, int);
+static int compare(const void*, const void*);
+static int BuildTablePointer(void*, void***, int*);
+
+static void ComLabel(LispCom*, LispObj*);
+static void ComPush(LispCom*, LispObj*, LispObj*, int, int, int);
+static int ComCall(LispCom*, LispArgList*, LispObj*, LispObj*, int, int, int);
+static void ComFuncall(LispCom*, LispObj*, LispObj*, int);
+static void ComProgn(LispCom*, LispObj*);
+static void ComEval(LispCom*, LispObj*);
+
+static void ComRecursiveCall(LispCom*, LispArgList*, LispObj*, LispObj*);
+static void ComInlineCall(LispCom*, LispArgList*, LispObj*, LispObj*, LispObj*);
+
+static void ComMacroBackquote(LispCom*, LispObj*);
+static void ComMacroCall(LispCom*, LispArgList*, LispObj*, LispObj*, LispObj*);
+static LispObj *ComMacroExpandBackquote(LispCom*, LispObj*);
+static LispObj *ComMacroExpand(LispCom*, LispObj*);
+static LispObj *ComMacroExpandFuncall(LispCom*, LispObj*, LispObj*);
+static LispObj *ComMacroExpandEval(LispCom*, LispObj*);
+
+/*
+ * Implementation
+ */
+void
+Com_And(LispCom *com, LispBuiltin *builtin)
+/*
+ and &rest args
+ */
+{
+    LispObj *args;
+
+    args = ARGUMENT(0);
+
+    if (CONSP(args)) {
+       /* Evaluate first argument */
+       ComEval(com, CAR(args));
+       args = CDR(args);
+
+       /* If more than one argument, create jump list */
+       if (CONSP(args)) {
+           CodeTree *tree = NULL, *group;
+
+           group = NEW_TREE(CodeTreeJumpIf);
+           group->code = XBC_JUMPNIL;
+
+           for (; CONSP(args); args = CDR(args)) {
+               ComEval(com, CAR(args));
+               tree = NEW_TREE(CodeTreeJumpIf);
+               tree->code = XBC_JUMPNIL;
+               group->group = tree;
+               group = tree;
+           }
+           /*  Finish form the last CodeTree code is changed to sign the
+            * end of the AND list */
+           group->code = XBC_NOOP;
+           if (group)
+               group->group = tree;
+       }
+    }
+    else
+       /* Identity of AND is T */
+       com_Bytecode(com, XBC_T);
+}
+
+void
+Com_Block(LispCom *com, LispBuiltin *builtin)
+/*
+ block name &rest body
+ */
+{
+
+    LispObj *name, *body;
+
+    body = ARGUMENT(1);
+    name = ARGUMENT(0);
+
+    if (name != NIL && name != T && !SYMBOLP(name))
+       LispDestroy("%s: %s cannot name a block",
+                   STRFUN(builtin), STROBJ(name));
+    if (CONSP(body)) {
+       CompileIniBlock(com, LispBlockTag, name);
+       ComProgn(com, body);
+       CompileFiniBlock(com);
+    }
+    else
+       /* Just load NIL without starting an empty block */
+       com_Bytecode(com, XBC_NIL);
+}
+
+void
+Com_C_r(LispCom *com, LispBuiltin *builtin)
+/*
+ c[ad]{1,4}r list
+ */
+{
+    LispObj *list;
+    char *desc;
+
+    list = ARGUMENT(0);
+
+    desc = STRFUN(builtin);
+    if (*desc == 'F')          /* FIRST */
+       desc = "CAR";
+    else if (*desc == 'R')     /* REST */
+       desc = "CDR";
+
+    /* Check if it is a list of constants */
+    while (desc[1] != 'R')
+       desc++;
+    ComEval(com, list);
+    while (*desc != 'C') {
+       com_Bytecode(com, *desc == 'A' ? XBC_CAR : XBC_CDR);
+       --desc;
+    }
+}
+
+void
+Com_Cond(LispCom *com, LispBuiltin *builtin)
+/*
+ cond &rest body
+ */
+{
+    int count;
+    LispObj *code, *body;
+    CodeTree *group, *tree;
+
+    body = ARGUMENT(0);
+
+    count = 0;
+    group = NULL;
+    if (CONSP(body)) {
+       for (; CONSP(body); body = CDR(body)) {
+           code = CAR(body);
+           CHECK_CONS(code);
+           ++count;
+           ComEval(com, CAR(code));
+           tree = NEW_TREE(CodeTreeCond);
+           if (group)
+               group->group = tree;
+           tree->code = XBC_JUMPNIL;
+           group = tree;
+           /* The code to execute if the test is true */
+           ComProgn(com, CDR(code));
+           /* Add a node signaling the end of the PROGN code */
+           tree = NEW_TREE(CodeTreeCond);
+           tree->code = XBC_JUMPT;
+           if (group)
+               group->group = tree;
+           group = tree;
+       }
+    }
+    if (!count)
+       com_Bytecode(com, XBC_NIL);
+    else
+       /* Where to jump after T progn */
+       group->code = XBC_NOOP;
+}
+
+void
+Com_Cons(LispCom *com, LispBuiltin *builtin)
+/*
+ cons car cdr
+ */
+{
+    LispObj *car, *cdr;
+
+    cdr = ARGUMENT(1);
+    car = ARGUMENT(0);
+
+    if (ComConstantp(com, car) && ComConstantp(com, cdr))
+       com_BytecodeCons(com, XBC_CCONS, car, cdr);
+    else {
+       ++com->stack.cpstack;
+       if (com->stack.pstack < com->stack.cpstack)
+           com->stack.pstack = com->stack.cpstack;
+       ComEval(com, car);
+       com_Bytecode(com, XBC_CSTAR);
+       ComEval(com, cdr);
+       com_Bytecode(com, XBC_CFINI);
+       --com->stack.cpstack;
+    }
+}
+
+void
+Com_Consp(LispCom *com, LispBuiltin *builtin)
+/*
+ consp object
+ */
+{
+    ComPredicate(com, builtin, XBP_CONSP);
+}
+
+void
+Com_Dolist(LispCom *com, LispBuiltin *builtin)
+/*
+ dolist init &rest body
+ */
+{
+    int unbound, item;
+    LispObj *symbol, *list, *result;
+    LispObj *init, *body;
+    CodeTree *group, *tree;
+
+    body = ARGUMENT(1);
+    init = ARGUMENT(0);
+
+    CHECK_CONS(init);
+    symbol = CAR(init);
+    CHECK_SYMBOL(symbol);
+    CHECK_CONSTANT(symbol);
+    init = CDR(init);
+    if (CONSP(init)) {
+       list = CAR(init);
+       init = CDR(init);
+    }
+    else
+       list = NIL;
+    if (CONSP(init)) {
+       result = CAR(init);
+       if (CONSP(CDR(init)))
+           LispDestroy("%s: too many arguments %s",
+                       STRFUN(builtin), STROBJ(CDR(init)));
+    }
+    else
+       result = NIL;
+
+    /* Generate code for the body of the form.
+     * The generated code uses two objects unavailable to user code,
+     * in the format:
+     * (block NIL
+     *     (let ((? list) (item NIL))
+     *         (tagbody
+     *             .                       ; the DOT object as a label
+     *             (when (consp list)
+     *                 (setq item (car ?))
+     *                 @body               ; code to be executed
+     *                 (setq ? (cdr ?))
+     *                 (go .)
+     *             )
+     *         )
+     *         (setq item nil)
+     *         result
+     *     )
+     * )
+     */
+
+    /* XXX All of the logic below should be simplified at some time
+     * by adding more opcodes for compound operations ... */
+
+    /* Relative offsets the locally added variables will have at run time */
+    unbound = lisp__data.env.length - lisp__data.env.lex;
+    item = unbound + 1;
+
+    /* Start BLOCK NIL */
+    FORM_ENTER();
+    CompileIniBlock(com, LispBlockTag, NIL);
+
+    /* Add the <?> variable */
+    ComPush(com, UNBOUND, list, 1, 0, 0);
+    /* Add the <item> variable */
+    ComPush(com, symbol, NIL, 0, 0, 0);
+    /* Stack length is increased */
+    CompileStackEnter(com, 2, 0);
+    /* Bind variables */
+    com_Bind(com, 2);
+    com->block->bind += 2;
+    lisp__data.env.head += 2;
+
+    /* Remember that iteration variable is used even if it not referenced */
+    COM_VARIABLE_USED(symbol->data.atom);
+
+    /* Initialize the TAGBODY */
+    FORM_ENTER();
+    CompileIniBlock(com, LispBlockBody, NIL);
+
+    /* Create the <.> label */
+    ComLabel(com, DOT);
+
+    /* Load <?> variable */
+    com_BytecodeShort(com, XBC_LOAD, unbound);
+    /* Check if <?> is a list */
+    com_BytecodeChar(com, XBC_PRED, XBP_CONSP);
+
+    /* Start WHEN block */
+    group = NEW_TREE(CodeTreeJumpIf);
+    group->code = XBC_JUMPNIL;
+    /* Load <?> again */
+    com_BytecodeShort(com, XBC_LOAD, unbound);
+    /* Get CAR of <?> */
+    com_Bytecode(com, XBC_CAR);
+    /* Store it in <item> */
+    com_BytecodeShort(com, XBC_SET, item);
+    /* Execute @BODY */
+    ComProgn(com, body);
+
+    /* Load <?> again */
+    com_BytecodeShort(com, XBC_LOAD, unbound);
+    /* Get CDR of <?> */
+    com_Bytecode(com, XBC_CDR);
+    /* Change value of <?> */
+    com_BytecodeShort(com, XBC_SET, unbound);
+
+    /* GO back to <.> */
+    tree = NEW_TREE(CodeTreeGo);
+    tree->data.object = DOT;
+
+    /* Finish WHEN block */
+    tree = NEW_TREE(CodeTreeJumpIf);
+    tree->code = XBC_NOOP;
+    group->group = tree;
+
+    /* Finish the TAGBODY */
+    CompileFiniBlock(com);
+    FORM_LEAVE();
+
+    /* Set <item> to NIL, in case result references it...
+     * Loaded value is NIL as the CONSP predicate */
+    com_BytecodeShort(com, XBC_SET, item);
+
+    /* Evaluate <result> */
+    ComEval(com, result);
+
+    /* Unbind variables */
+    lisp__data.env.head -= 2;
+    lisp__data.env.length -= 2;
+    com->block->bind -= 2;
+    com_Unbind(com, 2);
+    /* Stack length is reduced. */
+    CompileStackLeave(com, 2, 0);
+
+    /* Finish BLOCK NIL */
+    CompileFiniBlock(com);
+    FORM_LEAVE();
+}
+
+void
+Com_Eq(LispCom *com, LispBuiltin *builtin)
+/*
+ eq left right
+ eql left right
+ equal left right
+ equalp left right
+ */
+{
+    LispObj *left, *right;
+    LispByteOpcode code;
+    char *name;
+
+    right = ARGUMENT(1);
+    left = ARGUMENT(0);
+
+    CompileStackEnter(com, 1, 1);
+    /* Just like preparing to call a builtin function */
+    ComEval(com, left);
+    com_Bytecode(com, XBC_PUSH);
+    /* The second argument is now loaded */
+    ComEval(com, right);
+
+    /* Compare arguments and restore builtin stack */
+    name = STRFUN(builtin);
+    switch (name[3]) {
+       case 'L':
+           code = XBC_EQL;
+           break;
+       case 'U':
+           code = name[5] == 'P' ? XBC_EQUALP : XBC_EQUAL;
+           break;
+       default:
+           code = XBC_EQ;
+           break;
+    }
+    com_Bytecode(com, code);
+
+    CompileStackLeave(com, 1, 1);
+}
+
+void
+Com_Go(LispCom *com, LispBuiltin *builtin)
+/*
+ go tag
+ */
+{
+    int bind;
+    LispObj *tag;
+    CodeTree *tree;
+    CodeBlock *block;
+
+    tag = ARGUMENT(0);
+
+    block = com->block;
+    bind = block->bind;
+
+    while (block) {
+       if (block->type == LispBlockClosure || block->type == LispBlockBody)
+           break;
+       block = block->prev;
+       if (block)
+           bind += block->bind;
+    }
+
+    if (!block || block->type != LispBlockBody)
+       LispDestroy("%s called not within a block", STRFUN(builtin));
+
+    /* Unbind any local variables */
+    com_Unbind(com, bind);
+    tree = NEW_TREE(CodeTreeGo);
+    tree->data.object = tag;
+}
+
+void
+Com_If(LispCom *com, LispBuiltin *builtin)
+/*
+ if test then &optional else
+ */
+{
+    CodeTree *group, *tree;
+    LispObj *test, *then, *oelse;
+
+    oelse = ARGUMENT(2);
+    then = ARGUMENT(1);
+    test = ARGUMENT(0);
+
+    /* Build code to execute test */
+    ComEval(com, test);
+
+    /* Add jump node to use if test is NIL */
+    group = NEW_TREE(CodeTreeJumpIf);
+    group->code = XBC_JUMPNIL;
+
+    /* Build T code */
+    ComEval(com, then);
+
+    if (oelse != UNSPEC) {
+       /* Remember start of NIL code */
+       tree = NEW_TREE(CodeTreeJump);
+       tree->code = XBC_JUMP;
+       group->group = tree;
+       group = tree;
+       /* Build NIL code */
+       ComEval(com, oelse);
+    }
+
+    /* Remember jump of T code */
+    tree = NEW_TREE(CodeTreeJumpIf);
+    tree->code = XBC_NOOP;
+    group->group = tree;
+}
+
+void
+Com_Last(LispCom *com, LispBuiltin *builtin)
+/*
+ last list &optional count
+ */
+{
+    LispObj *list, *count;
+
+    count = ARGUMENT(1);
+    list = ARGUMENT(0);
+
+    ComEval(com, list);
+    CompileStackEnter(com, 1, 1);
+    com_Bytecode(com, XBC_PUSH);
+    if (count == UNSPEC)
+       count = FIXNUM(1);
+    ComEval(com, count);
+    CompileStackLeave(com, 1, 1);
+    com_Bytecode(com, XBC_LAST);
+}
+
+void
+Com_Length(LispCom *com, LispBuiltin *builtin)
+/*
+ length sequence
+ */
+{
+    LispObj *sequence;
+
+    sequence = ARGUMENT(0);
+
+    ComEval(com, sequence);
+    com_Bytecode(com, XBC_LENGTH);
+}
+
+void
+Com_Let(LispCom *com, LispBuiltin *builtin)
+/*
+ let init &rest body
+ */
+{
+    int count;
+    LispObj *symbol, *value, *pair;
+
+    LispObj *init, *body;
+
+    body = ARGUMENT(1);
+    init = ARGUMENT(0);
+
+    if (init == NIL) {
+       /* If no local variables */
+       ComProgn(com, body);
+       return;
+    }
+    CHECK_CONS(init);
+
+    /* Could optimize if the body is empty and the
+     * init form is known to have no side effects */
+
+    for (count = 0; CONSP(init); init = CDR(init), count++) {
+       pair = CAR(init);
+       if (CONSP(pair)) {
+           symbol = CAR(pair);
+           pair = CDR(pair);
+           if (CONSP(pair)) {
+               value = CAR(pair);
+               if (CDR(pair) != NIL)
+                   LispDestroy("%s: too much arguments to initialize %s",
+                               STRFUN(builtin), STROBJ(symbol));
+           }
+           else
+               value = NIL;
+       }
+       else {
+           symbol = pair;
+           value = NIL;
+       }
+       CHECK_SYMBOL(symbol);
+       CHECK_CONSTANT(symbol);
+
+       /* Add the variable */
+       ComPush(com, symbol, value, 1, 0, 0);
+    }
+
+    /* Stack length is increased */
+    CompileStackEnter(com, count, 0);
+    /* Bind the added variables */
+    com_Bind(com, count);
+    com->block->bind += count;
+    lisp__data.env.head += count;
+    /* Generate code for the body of the form */
+    ComProgn(com, body);
+    /* Unbind the added variables */
+    lisp__data.env.head -= count;
+    lisp__data.env.length -= count;
+    com->block->bind -= count;
+    com_Unbind(com, count);
+    /* Stack length is reduced. */
+    CompileStackLeave(com, count, 0);
+}
+
+void
+Com_Letx(LispCom *com, LispBuiltin *builtin)
+/*
+ let* init &rest body
+ */
+{
+    int count;
+    LispObj *symbol, *value, *pair;
+
+    LispObj *init, *body;
+
+    body = ARGUMENT(1);
+    init = ARGUMENT(0);
+
+    if (init == NIL) {
+       /* If no local variables */
+       ComProgn(com, body);
+       return;
+    }
+    CHECK_CONS(body);
+
+    /* Could optimize if the body is empty and the
+     * init form is known to have no side effects */
+
+    for (count = 0; CONSP(init); init = CDR(init), count++) {
+       pair = CAR(init);
+       if (CONSP(pair)) {
+           symbol = CAR(pair);
+           pair = CDR(pair);
+           if (CONSP(pair)) {
+               value = CAR(pair);
+               if (CDR(pair) != NIL)
+                   LispDestroy("%s: too much arguments to initialize %s",
+                               STRFUN(builtin), STROBJ(symbol));
+           }
+           else
+               value = NIL;
+       }
+       else {
+           symbol = pair;
+           value = NIL;
+       }
+       CHECK_SYMBOL(symbol);
+       CHECK_CONSTANT(symbol);
+
+       /* LET* is identical to &AUX arguments, just bind the symbol */
+       ComPush(com, symbol, value, 1, 0, 0);
+       /* Every added variable is binded */
+       com_Bind(com, 1);
+       /* Must be binded at compile time also */
+       ++lisp__data.env.head;
+       ++com->block->bind;
+    }
+
+    /* Generate code for the body of the form */
+    CompileStackEnter(com, count, 0);
+    ComProgn(com, body);
+    com_Unbind(com, count);
+    com->block->bind -= count;
+    lisp__data.env.head -= count;
+    lisp__data.env.length -= count;
+    CompileStackLeave(com, count, 0);
+}
+
+void
+Com_Listp(LispCom *com, LispBuiltin *builtin)
+/*
+ listp object
+ */
+{
+    ComPredicate(com, builtin, XBP_LISTP);
+}
+
+void
+Com_Loop(LispCom *com, LispBuiltin *builtin)
+/*
+ loop &rest body
+ */
+{
+    CodeTree *tree, *group;
+    LispObj *body;
+
+    body = ARGUMENT(0);
+
+    /* Start NIL block */
+    CompileIniBlock(com, LispBlockTag, NIL);
+
+    /* Insert node to mark LOOP start */
+    tree = NEW_TREE(CodeTreeJump);
+    tree->code = XBC_NOOP;
+
+    /* Execute @BODY */
+    if (CONSP(body))
+       ComProgn(com, body);
+    else
+       /* XXX bytecode.c code require that blocks have at least one opcode */
+       com_Bytecode(com, XBC_NIL);
+
+    /* Insert node to jump of start of LOOP */
+    group = NEW_TREE(CodeTreeJump);
+    group->code = XBC_JUMP;
+    group->group = tree;
+
+    /* Finish NIL block */
+    CompileFiniBlock(com);
+}
+
+void
+Com_Nthcdr(LispCom *com, LispBuiltin *builtin)
+/*
+ nthcdr index list
+ */
+{
+    LispObj *oindex, *list;
+
+    list = ARGUMENT(1);
+    oindex = ARGUMENT(0);
+
+    ComEval(com, oindex);
+    CompileStackEnter(com, 1, 1);
+    com_Bytecode(com, XBC_PUSH);
+    ComEval(com, list);
+    CompileStackLeave(com, 1, 1);
+    com_Bytecode(com, XBC_NTHCDR);
+}
+
+void
+Com_Null(LispCom *com, LispBuiltin *builtin)
+/*
+ null list
+ */
+{
+    LispObj *list;
+
+    list = ARGUMENT(0);
+
+    if (list == NIL)
+       com_Bytecode(com, XBC_T);
+    else if (ComConstantp(com, list))
+       com_Bytecode(com, XBC_NIL);
+    else {
+       ComEval(com, list);
+       com_Bytecode(com, XBC_INV);
+    }
+}
+
+void
+Com_Numberp(LispCom *com, LispBuiltin *builtin)
+/*
+ numberp object
+ */
+{
+    ComPredicate(com, builtin, XBP_NUMBERP);
+}
+
+void
+Com_Or(LispCom *com, LispBuiltin *builtin)
+/*
+ or &rest args
+ */
+{
+    LispObj *args;
+
+    args = ARGUMENT(0);
+
+    if (CONSP(args)) {
+       /* Evaluate first argument */
+       ComEval(com, CAR(args));
+       args = CDR(args);
+
+       /* If more than one argument, create jump list */
+       if (CONSP(args)) {
+           CodeTree *tree = NULL, *group;
+
+           group = NEW_TREE(CodeTreeJumpIf);
+           group->code = XBC_JUMPT;
+
+           for (; CONSP(args); args = CDR(args)) {
+               ComEval(com, CAR(args));
+               tree = NEW_TREE(CodeTreeJumpIf);
+               tree->code = XBC_JUMPT;
+               group->group = tree;
+               group = tree;
+           }
+           /*  Finish form the last CodeTree code is changed to sign the
+            * end of the AND list */
+           group->code = XBC_NOOP;
+           group->group = tree;
+       }
+    }
+    else
+       /* Identity of OR is NIL */
+       com_Bytecode(com, XBC_NIL);
+}
+
+void
+Com_Progn(LispCom *com, LispBuiltin *builtin)
+/*
+ progn &rest body
+ */
+{
+    LispObj *body;
+
+    body = ARGUMENT(0);
+
+    ComProgn(com, body);
+}
+
+void
+Com_Return(LispCom *com, LispBuiltin *builtin)
+/*
+ return &optional result
+ */
+{
+    ComReturnFrom(com, builtin, 0);
+}
+
+void
+Com_ReturnFrom(LispCom *com, LispBuiltin *builtin)
+/*
+ return-from name &optional result
+ */
+{
+    ComReturnFrom(com, builtin, 1);
+}
+
+void
+Com_Rplac_(LispCom *com, LispBuiltin *builtin)
+/*
+ rplac[ad] place value
+ */
+{
+    LispObj *place, *value;
+
+    value = ARGUMENT(1);
+    place = ARGUMENT(0);
+
+    CompileStackEnter(com, 1, 1);
+    ComEval(com, place);
+    com_Bytecode(com, XBC_PUSH);
+    ComEval(com, value);
+    com_Bytecode(com, STRFUN(builtin)[5] == 'A' ? XBC_RPLACA : XBC_RPLACD);
+    CompileStackLeave(com, 1, 1);
+}
+
+void
+Com_Setq(LispCom *com, LispBuiltin *builtin)
+/*
+ setq &rest form
+ */
+{
+    int offset;
+    LispObj *form, *symbol, *value;
+
+    form = ARGUMENT(0);
+
+    for (; CONSP(form); form = CDR(form)) {
+       symbol = CAR(form);
+       CHECK_SYMBOL(symbol);
+       CHECK_CONSTANT(symbol);
+       form = CDR(form);
+       if (!CONSP(form))
+           LispDestroy("%s: odd number of arguments", STRFUN(builtin));
+       value = CAR(form);
+       /* Generate code to load value */
+       ComEval(com, value);
+       offset = ComGetVariable(com, symbol);
+       if (offset >= 0)
+           com_Set(com, offset);
+       else
+           com_SetSym(com, symbol->data.atom);
+    }
+}
+
+void
+Com_Tagbody(LispCom *com, LispBuiltin *builtin)
+/*
+ tagbody &rest body
+ */
+{
+    LispObj *body;
+
+    body = ARGUMENT(0);
+
+    if (CONSP(body)) {
+       CompileIniBlock(com, LispBlockBody, NIL);
+       ComProgn(com, body);
+       /* Tagbody returns NIL */
+       com_Bytecode(com, XBC_NIL);
+       CompileFiniBlock(com);
+    }
+    else
+       /* Tagbody always returns NIL */
+       com_Bytecode(com, XBC_NIL);
+}
+
+void
+Com_Unless(LispCom *com, LispBuiltin *builtin)
+/*
+ unless test &rest body
+ */
+{
+    CodeTree *group, *tree;
+    LispObj *test, *body;
+
+    body = ARGUMENT(1);
+    test = ARGUMENT(0);
+
+    /* Generate code to evaluate test */
+    ComEval(com, test);
+    /* Add node after test */
+    group = NEW_TREE(CodeTreeJumpIf);
+    group->code = XBC_JUMPT;
+    /* Generate NIL code */
+    ComProgn(com, body);
+    /* Insert node to know where to jump if test is T */
+    tree = NEW_TREE(CodeTreeJumpIf);
+    tree->code = XBC_NOOP;
+    group->group = tree;
+}
+
+void
+Com_Until(LispCom *com, LispBuiltin *builtin)
+/*
+ until test &rest body
+ */
+{
+    CodeTree *tree, *group, *ltree, *lgroup;
+    LispObj *test, *body;
+
+    body = ARGUMENT(1);
+    test = ARGUMENT(0);
+
+    /* Insert node to mark LOOP start */
+    ltree = NEW_TREE(CodeTreeJump);
+    ltree->code = XBC_NOOP;
+
+    /* Build code for test */
+    ComEval(com, test);
+    group = NEW_TREE(CodeTreeJumpIf);
+    group->code = XBC_JUMPT;
+
+    /* Execute @BODY */
+    ComProgn(com, body);
+
+    /* Insert node to jump to test again */
+    lgroup = NEW_TREE(CodeTreeJump);
+    lgroup->code = XBC_JUMP;
+    lgroup->group = ltree;
+
+    /* Insert node to know where to jump if test is T */
+    tree = NEW_TREE(CodeTreeJumpIf);
+    tree->code = XBC_NOOP;
+    group->group = tree;
+}
+
+void
+Com_When(LispCom *com, LispBuiltin *builtin)
+/*
+ when test &rest body
+ */
+{
+    CodeTree *group, *tree;
+    LispObj *test, *body;
+
+    body = ARGUMENT(1);
+    test = ARGUMENT(0);
+
+    /* Generate code to evaluate test */
+    ComEval(com, test);
+    /* Add node after test */
+    group = NEW_TREE(CodeTreeJumpIf);
+    group->code = XBC_JUMPNIL;
+    /* Generate T code */
+    ComProgn(com, body);
+    /* Insert node to know where to jump if test is NIL */
+    tree = NEW_TREE(CodeTreeJumpIf);
+    tree->code = XBC_NOOP;
+    group->group = tree;
+}
+
+void
+Com_While(LispCom *com, LispBuiltin *builtin)
+/*
+ while test &rest body
+ */
+{
+    CodeTree *tree, *group, *ltree, *lgroup;
+    LispObj *test, *body;
+
+    body = ARGUMENT(1);
+    test = ARGUMENT(0);
+
+    /* Insert node to mark LOOP start */
+    ltree = NEW_TREE(CodeTreeJump);
+    ltree->code = XBC_NOOP;
+
+    /* Build code for test */
+    ComEval(com, test);
+    group = NEW_TREE(CodeTreeJumpIf);
+    group->code = XBC_JUMPNIL;
+
+    /* Execute @BODY */
+    ComProgn(com, body);
+
+    /* Insert node to jump to test again */
+    lgroup = NEW_TREE(CodeTreeJump);
+    lgroup->code = XBC_JUMP;
+    lgroup->group = ltree;
+
+    /* Insert node to know where to jump if test is NIL */
+    tree = NEW_TREE(CodeTreeJumpIf);
+    tree->code = XBC_NOOP;
+    group->group = tree;
+}
+
+
+/***********************************************************************
+ * Com_XXX helper functions
+ ***********************************************************************/
+static void
+ComPredicate(LispCom *com, LispBuiltin *builtin, LispBytePredicate predicate)
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    if (ComConstantp(com, object)) {
+       switch (predicate) {
+           case XBP_CONSP:
+               com_Bytecode(com, CONSP(object) ? XBC_T : XBC_NIL);
+               break;
+           case XBP_LISTP:
+               com_Bytecode(com, CONSP(object) || object == NIL ?
+                            XBC_T : XBC_NIL);
+               break;
+           case XBP_NUMBERP:
+               com_Bytecode(com, NUMBERP(object) ? XBC_T : XBC_NIL);
+               break;
+       }
+    }
+    else {
+       ComEval(com, object);
+       com_BytecodeChar(com, XBC_PRED, predicate);
+    }
+}
+
+/* XXX Could receive an argument telling if is the last statement in the
+ * block(s), i.e. if a jump opcode should be generated or just the
+ * evaluation of the returned value. Probably this is better done in
+ * an optimization step. */
+static void
+ComReturnFrom(LispCom *com, LispBuiltin *builtin, int from)
+{
+    int bind;
+    CodeTree *tree;
+    LispObj *name, *result;
+    CodeBlock *block = com->block;
+
+    if (from) {
+       result = ARGUMENT(1);
+       name = ARGUMENT(0);
+    }
+    else {
+       result = ARGUMENT(0);
+       name = NIL;
+    }
+    if (result == UNSPEC)
+       result = NIL;
+
+    bind = block->bind;
+    while (block) {
+       if (block->type == LispBlockClosure)
+           /* A function call */
+           break;
+       else if (block->type == LispBlockTag && block->tag == name)
+           break;
+       block = block->prev;
+       if (block)
+           bind += block->bind;
+    }
+
+    if (!block || block->tag != name)
+       LispDestroy("%s: no visible %s block", STRFUN(builtin), STROBJ(name));
+
+    /* Generate code to load result */
+    ComEval(com, result);
+
+    /* Check for added variables that the jump is skiping the unbind opcode */
+    com_Unbind(com, bind);
+
+    tree = NEW_TREE(CodeTreeReturn);
+    tree->data.block = block;
+}
+
+/***********************************************************************
+ * Helper functions
+ ***********************************************************************/
+static int
+ComConstantp(LispCom *com, LispObj *object)
+{
+    switch (OBJECT_TYPE(object)) {
+       case LispAtom_t:
+           /* Keywords are guaranteed to evaluate to itself */
+           if (object->data.atom->package == lisp__data.keyword)
+               break;
+           return (0);
+
+           /* Function call */
+       case LispCons_t:
+
+           /* Need macro expansion, these are special abstract objects */
+       case LispQuote_t:
+       case LispBackquote_t:
+       case LispComma_t:
+       case LispFunctionQuote_t:
+           return (0);
+
+           /* Anything else is a literal constant */
+       default:
+           break;
+    }
+
+    return (1);
+}
+
+static int
+FindIndex(void *item, void **table, int length)
+{
+    long cmp;
+    int left, right, i;
+
+    left = 0;
+    right = length - 1;
+    while (left <= right) {
+       i = (left + right) >> 1;
+       cmp = (char*)item - (char*)table[i];
+       if (cmp == 0)
+           return (i);
+       else if (cmp < 0)
+           right = i - 1;
+       else
+           left = i + 1;
+    }
+
+    return (-1);
+}
+
+static int
+compare(const void *left, const void *right)
+{
+    long cmp = *(char**)left - *(char**)right;
+
+    return (cmp < 0 ? -1 : 1);
+}
+
+static int
+BuildTablePointer(void *pointer, void ***pointers, int *num_pointers)
+{
+    int i;
+
+    if ((i = FindIndex(pointer, *pointers, *num_pointers)) < 0) {
+       *pointers = LispRealloc(*pointers,
+                               sizeof(void*) * (*num_pointers + 1));
+       (*pointers)[*num_pointers] = pointer;
+       if (++*num_pointers > 1)
+           qsort(*pointers, *num_pointers, sizeof(void*), compare);
+       i = FindIndex(pointer, *pointers, *num_pointers);
+    }
+
+    return (i);
+}
+
+static void
+ComAddVariable(LispCom *com, LispObj *symbol, LispObj *value)
+{
+    LispAtom *atom = symbol->data.atom;
+
+    if (atom && atom->key && !com->macro) {
+       int i, length = com->block->variables.length;
+
+       i = BuildTablePointer(atom, (void***)&com->block->variables.symbols,
+                             &com->block->variables.length);
+
+       if (com->block->variables.length != length) {
+           com->block->variables.flags =
+               LispRealloc(com->block->variables.flags,
+                           com->block->variables.length * sizeof(int));
+
+           /* Variable was inserted in the middle of the list */
+           if (i < length)
+               memmove(com->block->variables.flags + i + 1,
+                       com->block->variables.flags + i,
+                       (length - i) * sizeof(int));
+
+           com->block->variables.flags[i] = 0;
+       }
+    }
+
+    LispAddVar(symbol, value);
+}
+
+static int
+ComGetVariable(LispCom *com, LispObj *symbol)
+{
+    LispAtom *name;
+    int i, base, offset;
+    Atom_id id;
+
+    name = symbol->data.atom;
+    if (name->constant) {
+       if (name->package == lisp__data.keyword)
+           /*  Just load <symbol> from the byte stream, keywords are
+            * guaranteed to evaluate to itself. */
+           return (SYMBOL_KEYWORD);
+       return (SYMBOL_CONSTANT);
+    }
+
+    offset = name->offset;
+    id = name->key;
+    base = lisp__data.env.lex;
+    i = lisp__data.env.head - 1;
+
+    /* If variable is local */
+    if (offset <= i && offset >= com->lex && lisp__data.env.names[offset] == id) {
+       COM_VARIABLE_USED(name);
+       /* Relative offset */
+       return (offset - base);
+    }
+
+    /* name->offset may have been changed in a macro expansion */
+    for (; i >= com->lex; i--)
+       if (lisp__data.env.names[i] == id) {
+           name->offset = i;
+           COM_VARIABLE_USED(name);
+           return (i - base);
+       }
+
+    if (!name->a_object) {
+       ++com->warnings;
+       LispWarning("variable %s is neither declared nor bound",
+                   name->key->value);
+    }
+
+    /* Not found, resolve <symbol> at run time */
+    return (SYMBOL_UNBOUND);
+}
+
+static void
+ComVariableSetFlag(LispCom *com, LispAtom *atom, int flag)
+{
+    int i;
+    CodeBlock *block = com->block;
+
+    while (block) {
+       i = FindIndex(atom, (void**)block->variables.symbols,
+                     block->variables.length);
+       if (i >= 0) {
+           block->variables.flags[i] |= flag;
+           /*  Descend block list if an argument to function being called
+            * has the same name as a bound variable in the current function.
+            */
+           if ((flag & VARIABLE_ARGUMENT) ||
+               !(block->variables.flags[i] & VARIABLE_ARGUMENT))
+               break;
+       }
+       block = block->prev;
+    }
+}
+
+/***********************************************************************
+ * Bytecode compiler functions
+ ***********************************************************************/
+static void
+ComLabel(LispCom *com, LispObj *label)
+{
+    int i;
+    CodeTree *tree;
+
+    for (i = 0; i < com->block->tagbody.length; i++)
+       if (label == com->block->tagbody.labels[i])
+           LispDestroy("TAGBODY: tag %s specified more than once",
+                       STROBJ(label));
+
+    if (com->block->tagbody.length >= com->block->tagbody.space) {
+       com->block->tagbody.labels =
+           LispRealloc(com->block->tagbody.labels,
+                       sizeof(LispObj*) * (com->block->tagbody.space + 8));
+       /*  Reserve space, will be used at link time when
+        * resolving GO jumps. */
+       com->block->tagbody.codes =
+           LispRealloc(com->block->tagbody.codes,
+                       sizeof(CodeTree*) * (com->block->tagbody.space + 8));
+       com->block->tagbody.space += 8;
+    }
+
+    com->block->tagbody.labels[com->block->tagbody.length++] = label;
+    tree = NEW_TREE(CodeTreeLabel);
+    tree->data.object = label;
+}
+
+static void
+ComPush(LispCom *com, LispObj *symbol, LispObj *value,
+       int eval, int builtin, int compile)
+{
+    /*  If <compile> is set, it is pushing an argument to one of
+     * Com_XXX functions. */
+    if (compile) {
+       if (builtin)
+           lisp__data.stack.values[lisp__data.stack.length++] = value;
+       else
+           ComAddVariable(com, symbol, value);
+       return;
+    }
+
+    /*  If <com->macro> is set, it is expanding a macro, just add the local
+     * variable <symbol> bounded to <value>, so that it will be available
+     * when calling the interpreter to expand the macro. */
+    else if (com->macro) {
+       ComAddVariable(com, symbol, value);
+       return;
+    }
+
+    /*  If <eval> is set, it must generate the opcodes to evaluate <value>.
+     * If <value> is a constant, just generate the opcodes to load it. */
+    else if (eval && !ComConstantp(com, value)) {
+       switch (OBJECT_TYPE(value)) {
+           case LispAtom_t: {
+               int offset = ComGetVariable(com, value);
+
+               if (offset >= 0) {
+                   /* Load <value> from user stack at the relative offset */
+                   if (builtin)
+                       com_LoadPush(com, offset);
+                   else
+                       com_LoadLet(com, offset, symbol->data.atom);
+               }
+               /* ComConstantp() does not return true for this, as the
+                * current value must be computed. */
+               else if (offset == SYMBOL_CONSTANT) {
+                   value = value->data.atom->property->value;
+                   if (builtin)
+                       com_LoadConPush(com, value);
+                   else
+                       com_LoadConLet(com, value, symbol->data.atom);
+               }
+               else {
+                   /* Load value bound to <value> at run time */
+                   if (builtin)
+                       com_LoadSymPush(com, value->data.atom);
+                   else
+                       com_LoadSymLet(com, value->data.atom,
+                                      symbol->data.atom);
+               }
+           }   break;
+
+           default:
+               /* Generate code to evaluate <value> */
+               ComEval(com, value);
+               if (builtin)
+                   com_Bytecode(com, XBC_PUSH);
+               else
+                   com_Let(com, symbol->data.atom);
+               break;
+       }
+
+       /*  Remember <symbol> will be bound, <value> only matters for
+        * the Com_XXX  functions */
+       if (builtin)
+           lisp__data.stack.values[lisp__data.stack.length++] = value;
+       else
+           ComAddVariable(com, symbol, value);
+       return;
+    }
+
+    if (builtin) {
+       /* Load <value> as a constant in builtin stack */
+       com_LoadConPush(com, value);
+       lisp__data.stack.values[lisp__data.stack.length++] = value;
+    }
+    else {
+       /* Load <value> as a constant in stack */
+       com_LoadConLet(com, value, symbol->data.atom);
+       /* Remember <symbol> will be bound */
+       ComAddVariable(com, symbol, value);
+    }
+}
+
+/*  This function does almost the same job as LispMakeEnvironment, but
+ * it is not optimized for speed, as it is not building argument lists
+ * to user code, but to Com_XXX functions, or helping in generating the
+ * opcodes to load arguments at bytecode run time. */
+static int
+ComCall(LispCom *com, LispArgList *alist,
+       LispObj *name, LispObj *values,
+       int eval, int builtin, int compile)
+{
+    char *desc;
+    int i, count, base;
+    LispObj **symbols, **defaults, **sforms;
+
+    if (builtin) {
+       base = lisp__data.stack.length;
+       /* This should never be executed, but make the check for safety */
+       if (base + alist->num_arguments > lisp__data.stack.space) {
+           do
+               LispMoreStack();
+           while (base + alist->num_arguments > lisp__data.stack.space);
+       }
+    }
+    else
+       base = lisp__data.env.length;
+
+    desc = alist->description;
+    switch (*desc++) {
+       case '.':
+           goto normal_label;
+       case 'o':
+           goto optional_label;
+       case 'k':
+           goto key_label;
+       case 'r':
+           goto rest_label;
+       case 'a':
+           goto aux_label;
+       default:
+           goto done_label;
+    }
+
+
+    /* Normal arguments */
+normal_label:
+    i = 0;
+    symbols = alist->normals.symbols;
+    count = alist->normals.num_symbols;
+    for (; i < count && CONSP(values); i++, values = CDR(values)) {
+       ComPush(com, symbols[i], CAR(values), eval, builtin, compile);
+       if (!builtin && !com->macro)
+           COM_VARIABLE_ARGUMENT(symbols[i]->data.atom);
+    }
+    if (i < count)
+       LispDestroy("%s: too few arguments", STROBJ(name));
+
+    switch (*desc++) {
+       case 'o':
+           goto optional_label;
+       case 'k':
+           goto key_label;
+       case 'r':
+           goto rest_label;
+       case 'a':
+           goto aux_label;
+       default:
+           goto done_label;
+    }
+
+
+    /* &OPTIONAL */
+optional_label:
+    i = 0;
+    count = alist->optionals.num_symbols;
+    symbols = alist->optionals.symbols;
+    defaults = alist->optionals.defaults;
+    sforms = alist->optionals.sforms;
+    for (; i < count && CONSP(values); i++, values = CDR(values)) {
+       ComPush(com, symbols[i], CAR(values), eval, builtin, compile);
+       if (!builtin && !com->macro)
+           COM_VARIABLE_ARGUMENT(symbols[i]->data.atom);
+       if (sforms[i]) {
+           ComPush(com, sforms[i], T, 0, builtin, compile);
+           if (!builtin && !com->macro)
+               COM_VARIABLE_ARGUMENT(sforms[i]->data.atom);
+       }
+    }
+    for (; i < count; i++) {
+       if (!builtin) {
+           int lex = com->lex;
+           int head = lisp__data.env.head;
+
+           com->lex = base;
+           lisp__data.env.head = lisp__data.env.length;
+           /* default arguments are evaluated for macros */
+           ComPush(com, symbols[i], defaults[i], 1, 0, compile);
+           if (!com->macro)
+               COM_VARIABLE_ARGUMENT(symbols[i]->data.atom);
+           lisp__data.env.head = head;
+           com->lex = lex;
+       }
+       else
+           ComPush(com, symbols[i], defaults[i], eval, 1, compile);
+       if (sforms[i]) {
+           ComPush(com, sforms[i], NIL, 0, builtin, compile);
+           if (!builtin && !com->macro)
+               COM_VARIABLE_ARGUMENT(sforms[i]->data.atom);
+       }
+    }
+
+    switch (*desc++) {
+       case 'k':
+           goto key_label;
+       case 'r':
+           goto rest_label;
+       case 'a':
+           goto aux_label;
+       default:
+           goto done_label;
+    }
+
+
+    /* &KEY */
+key_label:
+    {
+       int varset;
+       LispObj *val, *karg, **keys;
+
+       count = alist->keys.num_symbols;
+       symbols = alist->keys.symbols;
+       defaults = alist->keys.defaults;
+       sforms = alist->keys.sforms;
+       keys = alist->keys.keys;
+
+       /* Check if arguments are correctly specified */
+       for (karg = values; CONSP(karg); karg = CDR(karg)) {
+           val = CAR(karg);
+           if (KEYWORDP(val)) {
+               for (i = 0; i < alist->keys.num_symbols; i++)
+                   if (!keys[i] && symbols[i] == val)
+                       break;
+           }
+
+           else if (!builtin &&
+                    QUOTEP(val) && SYMBOLP(val->data.quote)) {
+               for (i = 0; i < alist->keys.num_symbols; i++)
+                   if (keys[i] && ATOMID(keys[i]) == ATOMID(val->data.quote))
+                       break;
+           }
+
+           else
+               /* Just make the error test true */
+               i = alist->keys.num_symbols;
+
+           if (i == alist->keys.num_symbols) {
+               /* If not in argument specification list... */
+               char function_name[36];
+
+               strcpy(function_name, STROBJ(name));
+               LispDestroy("%s: invalid keyword %s",
+                           function_name, STROBJ(val));
+           }
+
+           karg = CDR(karg);
+           if (!CONSP(karg))
+               LispDestroy("%s: &KEY needs arguments as pairs",
+                           STROBJ(name));
+       }
+
+       /* Add variables */
+       for (i = 0; i < alist->keys.num_symbols; i++) {
+           val = defaults[i];
+           varset = 0;
+           if (!builtin && keys[i]) {
+               Atom_id atom = ATOMID(keys[i]);
+
+               /* Special keyword specification, need to compare ATOMID
+                * and keyword specification must be a quoted object */
+               for (karg = values; CONSP(karg); karg = CDR(karg)) {
+                   val = CAR(karg);
+                   if (QUOTEP(val) && atom == ATOMID(val->data.quote)) {
+                       val = CADR(karg);
+                       varset = 1;
+                       break;
+                   }
+                   karg = CDR(karg);
+               }
+           }
+
+           else {
+               /* Normal keyword specification, can compare object pointers,
+                * as they point to the same object in the keyword package */
+               for (karg = values; CONSP(karg); karg = CDR(karg)) {
+                   /* Don't check if argument is a valid keyword or
+                    * special quoted keyword */
+                   if (symbols[i] == CAR(karg)) {
+                       val = CADR(karg);
+                       varset = 1;
+                       break;
+                   }
+                   karg = CDR(karg);
+               }
+           }
+
+           /* Add the variable to environment */
+           if (varset) {
+               ComPush(com, symbols[i], val, eval, builtin, compile);
+               if (sforms[i])
+                   ComPush(com, sforms[i], T, 0, builtin, compile);
+           }
+           else {
+               /* default arguments are evaluated for macros */
+               if (!builtin) {
+                   int lex = com->lex;
+                   int head = lisp__data.env.head;
+
+                   com->lex = base;
+                   lisp__data.env.head = lisp__data.env.length;
+                   ComPush(com, symbols[i], val, eval, 0, compile);
+                   lisp__data.env.head = head;
+                   com->lex = lex;
+               }
+               else
+                   ComPush(com, symbols[i], val, eval, builtin, compile);
+               if (sforms[i])
+                   ComPush(com, sforms[i], NIL, 0, builtin, compile);
+           }
+           if (!builtin && !com->macro) {
+               COM_VARIABLE_ARGUMENT(symbols[i]->data.atom);
+               if (sforms[i])
+                   COM_VARIABLE_ARGUMENT(sforms[i]->data.atom);
+           }
+       }
+    }
+
+    if (*desc == 'a') {
+       /* &KEY uses all remaining arguments */
+       values = NIL;
+       goto aux_label;
+    }
+    goto finished_label;
+
+
+    /* &REST */
+rest_label:
+    if (!eval || !CONSP(values) || (compile && !builtin))
+       ComPush(com, alist->rest, values, eval, builtin, compile);
+    else {
+       char *string;
+       LispObj *list, *car = NIL;
+       int count, constantp;
+
+       /* Count number of arguments and check if it is a list of constants */
+       for (count = 0, constantp = 1, list = values;
+            CONSP(list);
+            list = CDR(list), count++) {
+           car = CAR(list);
+           if (!ComConstantp(com, car))
+               constantp = 0;
+       }
+
+       string = builtin ? ATOMID(name)->value : NULL;
+       /* XXX FIXME should have a flag indicating if function call
+        * change the &REST arguments even if it is a constant list
+        * (or if the returned value may be changed). */
+       if (string && (count < MAX_BCONS || constantp) &&
+           strcmp(string, "LIST") &&
+           strcmp(string, "APPLY") &&  /* XXX depends on function argument */
+           strcmp(string, "VECTOR") &&
+           /* Append does not copy the last/single list */
+           (strcmp(string, "APPEND") || !CONSP(car))) {
+           if (constantp) {
+               /* If the builtin function changes the &REST parameters, must
+                * define a Com_XXX function for it. */
+               ComPush(com, alist->rest, values, 0, builtin, compile);
+           }
+           else {
+               CompileStackEnter(com, count - 1, 1);
+               for (; CONSP(CDR(values)); values = CDR(values)) {
+                   /* Evaluate this argument */
+                   ComEval(com, CAR(values));
+                   /* Save result in builtin stack */
+                   com_Bytecode(com, XBC_PUSH);
+               }
+               CompileStackLeave(com, count - 1, 1);
+               /* The last argument is not saved in the stack */
+               ComEval(com, CAR(values));
+               values = NIL;
+               com_Bytecode(com, (LispByteOpcode)(XBC_BCONS + (count - 1)));
+           }
+       }
+       else {
+           /* Allocate a fresh list of cons */
+
+           /* Generate code to load object */
+           ComEval(com, CAR(values));
+
+           com->stack.cpstack += 2;
+           if (com->stack.pstack < com->stack.cpstack)
+               com->stack.pstack = com->stack.cpstack;
+           /* Start building a gc protected list, with the loaded value */
+           com_Bytecode(com, XBC_LSTAR);
+
+           for (values = CDR(values); CONSP(values); values = CDR(values)) {
+               /* Generate code to load object */
+               ComEval(com, CAR(values));
+
+               /* Add loaded value to gc protected list */
+               com_Bytecode(com, XBC_LCONS);
+           }
+
+           /* Finish gc protected list */
+           com_Bytecode(com, XBC_LFINI);
+
+           /* Push loaded value */
+           if (builtin)
+               com_Bytecode(com, XBC_PUSH);
+           else {
+               com_Let(com, alist->rest->data.atom);
+
+               /* Remember this symbol will be bound */
+               ComAddVariable(com, alist->rest, values);
+           }
+           com->stack.cpstack -= 2;
+       }
+    }
+    if (!builtin && !com->macro)
+       COM_VARIABLE_ARGUMENT(alist->rest->data.atom);
+    if (*desc != 'a')
+       goto finished_label;
+
+
+    /* &AUX */
+aux_label:
+    i = 0;
+    count = alist->auxs.num_symbols;
+    symbols = alist->auxs.symbols;
+    defaults = alist->auxs.initials;
+    if (!builtin && !compile) {
+       int lex = com->lex;
+
+       com->lex = base;
+       lisp__data.env.head = lisp__data.env.length;
+       for (; i < count; i++) {
+           ComPush(com, symbols[i], defaults[i], 1, 0, 0);
+           if (!com->macro)
+               COM_VARIABLE_ARGUMENT(symbols[i]->data.atom);
+           ++lisp__data.env.head;
+       }
+       com->lex = lex;
+    }
+    else {
+       for (; i < count; i++) {
+           ComPush(com, symbols[i], defaults[i], eval, builtin, compile);
+           if (!builtin && !com->macro)
+               COM_VARIABLE_ARGUMENT(symbols[i]->data.atom);
+       }
+    }
+
+done_label:
+    if (CONSP(values))
+       LispDestroy("%s: too many arguments", STROBJ(name));
+
+finished_label:
+    if (builtin)
+       lisp__data.stack.base = base;
+    else
+       lisp__data.env.head = lisp__data.env.length;
+
+    return (base);
+}
+
+static void
+ComFuncall(LispCom *com, LispObj *function, LispObj *arguments, int eval)
+{
+    int base, compile;
+    LispAtom *atom;
+    LispArgList *alist;
+    LispBuiltin *builtin;
+    LispObj *lambda;
+
+    switch (OBJECT_TYPE(function)) {
+       case LispFunction_t:
+           function = function->data.atom->object;
+       case LispAtom_t:
+           atom = function->data.atom;
+           alist = atom->property->alist;
+
+           if (atom->a_builtin) {
+               builtin = atom->property->fun.builtin;
+               compile = builtin->compile != NULL;
+
+               /*  If one of:
+                *      o expanding a macro
+                *      o calling a builtin special form
+                *      o builtin function is a macro
+                * don't evaluate arguments. */
+               if (com->macro || compile || builtin->type == LispMacro)
+                   eval = 0;
+
+               if (!com->macro && builtin->type == LispMacro) {
+                   /* Set flag of variable used, in case variable is only
+                    * used as a builtin macro argument. */
+                   LispObj *obj;
+
+                   for (obj = arguments; CONSP(obj); obj = CDR(obj)) {
+                       if (SYMBOLP(CAR(obj)))
+                           COM_VARIABLE_USED(CAR(obj)->data.atom);
+                   }
+               }
+
+               FORM_ENTER();
+               if (!compile && !com->macro)
+                   CompileStackEnter(com, alist->num_arguments, 1);
+
+               /* Build argument list in the interpreter stacks */
+               base = ComCall(com, alist, function, arguments,
+                              eval, 1, compile);
+
+               /* If <compile> is set, it is a special form */
+               if (compile)
+                   builtin->compile(com, builtin);
+
+               /* Else, generate opcodes to call builtin function */
+               else {
+                   com_Call(com, alist->num_arguments, builtin);
+                   CompileStackLeave(com, alist->num_arguments, 1);
+               }
+               lisp__data.stack.base = lisp__data.stack.length = base;
+               FORM_LEAVE();
+           }
+           else if (atom->a_function) {
+               int macro;
+
+               lambda = atom->property->fun.function;
+               macro = lambda->funtype == LispMacro;
+
+               /* If <macro> is set, expand macro */
+               if (macro)
+                   ComMacroCall(com, alist, function, lambda, arguments);
+
+               else {
+                   if (com->toplevel->type == LispBlockClosure &&
+                       com->toplevel->tag == function)
+                       ComRecursiveCall(com, alist, function, arguments);
+                   else {
+#if 0
+                       ComInlineCall(com, alist, function, arguments,
+                                     lambda->data.lambda.code);
+#else
+                       com_Funcall(com, function, arguments);
+#endif
+                   }
+               }
+           }
+           else if (atom->a_defstruct &&
+                    atom->property->structure.function != STRUCT_NAME &&
+                    atom->property->structure.function != STRUCT_CONSTRUCTOR) {
+               LispObj *definition = atom->property->structure.definition;
+
+               if (!CONSP(arguments) || CONSP(CDR(arguments)))
+                   LispDestroy("%s: too %s arguments", atom->key->value,
+                               CONSP(arguments) ? "many" : "few");
+
+               ComEval(com, CAR(arguments));
+               if (atom->property->structure.function == STRUCT_CHECK)
+                   com_Structp(com, definition);
+               else
+                   com_Struct(com,
+                              atom->property->structure.function, definition);
+           }
+           else if (atom->a_compiled) {
+               FORM_ENTER();
+               CompileStackEnter(com, alist->num_arguments, 0);
+
+               /* Build argument list in the interpreter stacks */
+               base = ComCall(com, alist, function, arguments, 1, 0, 0);
+               com_Bytecall(com, alist->num_arguments,
+                            atom->property->fun.function);
+               CompileStackLeave(com, alist->num_arguments, 0);
+               lisp__data.env.head = lisp__data.env.length = base;
+               FORM_LEAVE();
+           }
+           else {
+               /* Not yet defined function/macro. */
+               ++com->warnings;
+               LispWarning("call to undefined function %s", atom->key->value);
+               com_Funcall(com, function, arguments);
+           }
+           break;
+
+       case LispLambda_t:
+           lambda = function->data.lambda.code;
+           alist = (LispArgList*)function->data.lambda.name->data.opaque.data;
+           ComInlineCall(com, alist, NIL, arguments, lambda->data.lambda.code);
+           break;
+
+       case LispCons_t:
+           if (CAR(function) == Olambda) {
+               function = EVAL(function);
+               if (LAMBDAP(function)) {
+                   GC_ENTER();
+
+                   GC_PROTECT(function);
+                   lambda = function->data.lambda.code;
+                   alist = (LispArgList*)function->data.lambda.name->data.opaque.data;
+                   ComInlineCall(com, alist, NIL, arguments, lambda->data.lambda.code);
+                   GC_LEAVE();
+                   break;
+               }
+           }
+
+       default:
+           /*  XXX If bytecode objects are made available, should
+            * handle it here. */
+           LispDestroy("EVAL: %s is invalid as a function",
+                       STROBJ(function));
+           /*NOTREACHED*/
+           break;
+    }
+}
+
+/* Generate opcodes for an implicit PROGN */
+static void
+ComProgn(LispCom *com, LispObj *code)
+{
+    if (CONSP(code)) {
+       for (; CONSP(code); code = CDR(code))
+           ComEval(com, CAR(code));
+    }
+    else
+       /* If no code to execute, empty PROGN returns NIL */
+       com_Bytecode(com, XBC_NIL);
+}
+
+/* Generate opcodes to evaluate <object>. */
+static void
+ComEval(LispCom *com, LispObj *object)
+{
+    int offset;
+    LispObj *form;
+
+    switch (OBJECT_TYPE(object)) {
+       case LispAtom_t:
+           if (IN_TAGBODY())
+               ComLabel(com, object);
+           else {
+               offset = ComGetVariable(com, object);
+               if (offset >= 0)
+                   /* Load from user stack at relative offset */
+                   com_Load(com, offset);
+               else if (offset == SYMBOL_KEYWORD)
+                   com_LoadCon(com, object);
+               else if (offset == SYMBOL_CONSTANT)
+                   /* Symbol defined as constant, just load it's value */
+                   com_LoadCon(com, LispGetVar(object));
+               else
+                   /* Load value bound to symbol at run time */
+                   com_LoadSym(com, object->data.atom);
+           }
+           break;
+
+       case LispCons_t: {
+           /* Macro expansion may be done in the object form */
+           form = com->form;
+           com->form = object;
+           ComFuncall(com, CAR(object), CDR(object), 1);
+           com->form = form;
+       }   break;
+
+       case LispQuote_t:
+           com_LoadCon(com, object->data.quote);
+           break;
+
+       case LispBackquote_t:
+           /* Macro expansion is stored in the current value of com->form */
+           ComMacroBackquote(com, object);
+           break;
+
+       case LispComma_t:
+           LispDestroy("EVAL: comma outside of backquote");
+           break;
+
+       case LispFunctionQuote_t:
+           object = object->data.quote;
+           if (SYMBOLP(object))
+               object = LispSymbolFunction(object);
+           else if (CONSP(object) && CAR(object) == Olambda) {
+               /* object will only be associated with bytecode later,
+                * so, make sure it is protected until compilation finishes */
+               object = EVAL(object);
+               RPLACD(com->plist, CONS(CAR(com->plist), CDR(com->plist)));
+               RPLACA(com->plist, object);
+           }
+           else
+               LispDestroy("FUNCTION: %s is not a function", STROBJ(object));
+           com_LoadCon(com, object);
+           break;
+
+       case LispFixnum_t:
+           if (IN_TAGBODY()) {
+               ComLabel(com, object);
+               break;
+           }
+           /*FALLTROUGH*/
+
+       default:
+           /* Constant object */
+           com_LoadCon(com, object);
+           break;
+    }
+}
+
+/***********************************************************************
+ * Lambda expansion helper functions
+ ***********************************************************************/
+static void
+ComRecursiveCall(LispCom *com, LispArgList *alist,
+                LispObj *name, LispObj *arguments)
+{
+    int base, lex;
+
+    /* Save state */
+    lex = lisp__data.env.lex;
+
+    FORM_ENTER();
+
+    /* Generate code to push function arguments in the stack */
+    base = ComCall(com, alist, name, arguments, 1, 0, 0);
+
+    /* Stack will grow this amount */
+    CompileStackEnter(com, alist->num_arguments, 0);
+
+#if 0
+    /* Make the variables available at run time */
+    com_Bind(com, alist->num_arguments);
+    com->block->bind += alist->num_arguments;
+#endif
+
+    com_BytecodeChar(com, XBC_LETREC, alist->num_arguments);
+
+#if 0
+    /* The variables are now unbound */
+    com_Unbind(com, alist->num_arguments);
+    com->block->bind -= alist->num_arguments;
+#endif
+
+    /* Stack length is reduced */
+    CompileStackLeave(com, alist->num_arguments, 0);
+    FORM_LEAVE();
+
+    /* Restore state */
+    lisp__data.env.lex = lex;
+    lisp__data.env.head = lisp__data.env.length = base;
+}
+
+static void
+ComInlineCall(LispCom *com, LispArgList *alist,
+             LispObj *name, LispObj *arguments, LispObj *lambda)
+{
+    int base, lex;
+
+    /* Save state */
+    lex = lisp__data.env.lex;
+
+    FORM_ENTER();
+    /* Start the inline function block */
+    CompileIniBlock(com, LispBlockClosure, name);
+
+    /* Generate code to push function arguments in the stack */
+    base = ComCall(com, alist, name, arguments, 1, 0, 0);
+
+    /* Stack will grow this amount */
+    CompileStackEnter(com, alist->num_arguments, 0);
+
+    /* Make the variables available at run time */
+    com_Bind(com, alist->num_arguments);
+    com->block->bind += alist->num_arguments;
+
+    /* Expand the lambda list */
+    ComProgn(com, lambda);
+
+    /* The variables are now unbound */
+    com_Unbind(com, alist->num_arguments);
+    com->block->bind -= alist->num_arguments;
+
+    /* Stack length is reduced */
+    CompileStackLeave(com, alist->num_arguments, 0);
+
+    /* Finish the inline function block */
+    CompileFiniBlock(com);
+    FORM_LEAVE();
+
+    /* Restore state */
+    lisp__data.env.lex = lex;
+    lisp__data.env.head = lisp__data.env.length = base;
+}
+
+/***********************************************************************
+ * Macro expansion helper functions.
+ ***********************************************************************/
+static LispObj *
+ComMacroExpandBackquote(LispCom *com, LispObj *object)
+{
+    return (LispEvalBackquote(object->data.quote, 1));
+}
+
+static LispObj *
+ComMacroExpandFuncall(LispCom *com, LispObj *function, LispObj *arguments)
+{
+    return (LispFuncall(function, arguments, 1));
+}
+
+static LispObj *
+ComMacroExpandEval(LispCom *com, LispObj *object)
+{
+    LispObj *result;
+
+    switch (OBJECT_TYPE(object)) {
+       case LispAtom_t:
+           result = LispGetVar(object);
+
+           /* Macro expansion requires bounded symbols */
+           if (result == NULL)
+               LispDestroy("EVAL: the variable %s is unbound",
+                           STROBJ(object));
+           break;
+
+       case LispCons_t:
+           result = ComMacroExpandFuncall(com, CAR(object), CDR(object));
+           break;
+
+       case LispQuote_t:
+           result = object->data.quote;
+           break;
+
+       case LispBackquote_t:
+           result = ComMacroExpandBackquote(com, object);
+           break;
+
+       case LispComma_t:
+           LispDestroy("EVAL: comma outside of backquote");
+
+       case LispFunctionQuote_t:
+           result = EVAL(object);
+           break;
+
+       default:
+           result = object;
+           break;
+    }
+
+    return (result);
+}
+
+static LispObj *
+ComMacroExpand(LispCom *com, LispObj *lambda)
+{
+    LispObj *result, **presult = &result;
+    int jumped, *pjumped = &jumped, backquote, *pbackquote = &backquote;
+    LispBlock *block;
+
+    int interpreter_lex, interpreter_head, interpreter_base;
+
+    /* Save interpreter state */
+    interpreter_base = lisp__data.stack.length;
+    interpreter_head = lisp__data.env.length;
+    interpreter_lex = lisp__data.env.lex;
+
+    /* Use the variables */
+    *presult = NIL;
+    *pjumped = 1;
+    *pbackquote = !CONSP(lambda);
+
+    block = LispBeginBlock(NIL, LispBlockProtect);
+    if (setjmp(block->jmp) == 0) {
+       if (!backquote) {
+           for (; CONSP(lambda); lambda = CDR(lambda))
+               result = ComMacroExpandEval(com, CAR(lambda));
+       }
+       else
+           result = ComMacroExpandBackquote(com, lambda);
+
+       *pjumped = 0;
+    }
+    LispEndBlock(block);
+
+    /* If tried to jump out of the macro expansion block */
+    if (!lisp__data.destroyed && jumped)
+       LispDestroy("*** EVAL: bad jump in macro expansion");
+
+    /* Macro expansion did something wrong */
+    if (lisp__data.destroyed) {
+       LispMessage("*** EVAL: aborting macro expansion");
+       LispDestroy(".");
+    }
+
+    /* Restore interpreter state */
+    lisp__data.env.lex = interpreter_lex;
+    lisp__data.stack.length = interpreter_base;
+    lisp__data.env.head = lisp__data.env.length = interpreter_head;
+
+    return (result);
+}
+
+static void
+ComMacroCall(LispCom *com, LispArgList *alist,
+            LispObj *name, LispObj *lambda, LispObj *arguments)
+{
+    int base;
+    LispObj *body;
+
+    ++com->macro;
+    base = ComCall(com, alist, name, arguments, 0, 0, 0);
+    body = lambda->data.lambda.code;
+    body = ComMacroExpand(com, body);
+    --com->macro;
+    lisp__data.env.head = lisp__data.env.length = base;
+
+    /* Macro is expanded, store the result */
+    CAR(com->form) = body;
+    ComEval(com, body);
+}
+
+static void
+ComMacroBackquote(LispCom *com, LispObj *lambda)
+{
+    LispObj *body;
+
+    ++com->macro;
+    body = ComMacroExpand(com, lambda);
+    --com->macro;
+
+    /* Macro is expanded, store the result */
+    CAR(com->form) = body;
+
+    com_LoadCon(com, body);
+}
diff --git a/xedit/lisp/core.c b/xedit/lisp/core.c
new file mode 100644 (file)
index 0000000..89f5d5c
--- /dev/null
@@ -0,0 +1,7024 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/core.c,v 1.71tsi Exp $ */
+
+#include "lisp/io.h"
+#include "lisp/core.h"
+#include "lisp/format.h"
+#include "lisp/helper.h"
+#include "lisp/package.h"
+#include "lisp/private.h"
+#include "lisp/write.h"
+
+/*
+ * Types
+ */
+typedef struct _SeqInfo {
+    LispType type;
+    union {
+       LispObj *list;
+       LispObj **vector;
+       unsigned char *string;
+    } data;
+} SeqInfo;
+
+#define SETSEQ(seq, object)                                            \
+    switch (seq.type = XOBJECT_TYPE(object)) {                         \
+       case LispString_t:                                              \
+           seq.data.string = (unsigned char*)THESTR(object);           \
+           break;                                                      \
+       case LispCons_t:                                                \
+           seq.data.list = object;                                     \
+           break;                                                      \
+       default:                                                        \
+           seq.data.list = object->data.array.list;                    \
+           break;                                                      \
+    }
+
+#ifdef __UNIXOS2__
+# define finite(x) isfinite(x)
+#endif
+
+#ifdef NEED_SETENV
+extern int setenv(const char *name, const char *value, int overwrite);
+extern void unsetenv(const char *name);
+#endif
+
+/*
+ * Prototypes
+ */
+#define NONE           0
+
+#define        REMOVE          1
+#define        SUBSTITUTE      2
+#define DELETE         3
+#define        NSUBSTITUTE     4
+
+#define ASSOC          1
+#define MEMBER         2
+
+#define FIND           1
+#define POSITION       2
+
+#define        IF              1
+#define        IFNOT           2
+
+#define UNION          1
+#define INTERSECTION   2
+#define SETDIFFERENCE  3
+#define SETEXCLUSIVEOR 4
+#define SUBSETP                5
+#define NSETDIFFERENCE 6
+#define NINTERSECTION  7
+#define NUNION         8
+#define NSETEXCLUSIVEOR        9
+
+#define COPY_LIST      1
+#define COPY_ALIST     2
+#define COPY_TREE      3
+
+#define EVERY          1
+#define SOME           2
+#define NOTEVERY       3
+#define NOTANY         4
+
+/* Call directly LispObjectCompare() if possible */
+#define FCODE(predicate)                                       \
+    predicate == Oeql ? FEQL :                                 \
+       predicate == Oequal ? FEQUAL :                          \
+           predicate == Oeq ? FEQ :                            \
+               predicate == Oequalp ? FEQUALP : 0
+#define FCOMPARE(predicate, left, right, code)                 \
+    code == FEQ ? left == right :                              \
+       code ? LispObjectCompare(left, right, code) != NIL :    \
+              APPLY2(predicate, left, right) != NIL
+
+#define FUNCTION_CHECK(predicate)                              \
+    if (FUNCTIONP(predicate))                                  \
+       predicate = (predicate)->data.atom->object
+
+#define CHECK_TEST_0()                                         \
+    if (test != UNSPEC && test_not != UNSPEC)                  \
+       LispDestroy("%s: specify either :TEST or :TEST-NOT",    \
+                   STRFUN(builtin))
+
+#define CHECK_TEST()                                           \
+    CHECK_TEST_0();                                            \
+    if (test_not == UNSPEC) {                                  \
+       if (test == UNSPEC)                                     \
+           lambda = Oeql;                                      \
+       else                                                    \
+           lambda = test;                                      \
+       expect = 1;                                             \
+    }                                                          \
+    else {                                                     \
+       lambda = test_not;                                      \
+       expect = 0;                                             \
+    }                                                          \
+    FUNCTION_CHECK(lambda);                                    \
+    code = FCODE(lambda)
+
+
+static LispObj *LispAdjoin(LispBuiltin*,
+                          LispObj*, LispObj*, LispObj*, LispObj*, LispObj*);
+static LispObj *LispAssocOrMember(LispBuiltin*, int, int);
+static LispObj *LispEverySomeAnyNot(LispBuiltin*, int);
+static LispObj *LispFindOrPosition(LispBuiltin*, int, int);
+static LispObj *LispDeleteOrRemoveDuplicates(LispBuiltin*, int);
+static LispObj *LispDeleteRemoveXSubstitute(LispBuiltin*, int, int);
+static LispObj *LispListSet(LispBuiltin*, int);
+static LispObj *LispMapc(LispBuiltin*, int);
+static LispObj *LispMapl(LispBuiltin*, int);
+static LispObj *LispMapnconc(LispObj*);
+extern LispObj *LispRunSetf(LispArgList*, LispObj*, LispObj*, LispObj*);
+extern LispObj *LispRunSetfMacro(LispAtom*, LispObj*, LispObj*);
+static LispObj *LispMergeSort(LispObj*, LispObj*, LispObj*, int);
+static LispObj *LispXReverse(LispBuiltin*, int);
+static LispObj *LispCopyList(LispBuiltin*, LispObj*, int);
+static LispObj *LispValuesList(LispBuiltin*, int);
+static LispObj *LispTreeEqual(LispObj*, LispObj*, LispObj*, int);
+static LispDocType_t LispDocumentationType(LispBuiltin*, LispObj*);
+
+extern void LispSetAtomObjectProperty(LispAtom*, LispObj*);
+
+/*
+ * Initialization
+ */
+LispObj *Oeq, *Oeql, *Oequal, *Oequalp, *Omake_array,
+       *Kinitial_contents, *Osetf, *Ootherwise, *Oquote;
+LispObj *Ogensym_counter;
+
+Atom_id Svariable, Sstructure, Stype, Ssetf;
+
+/*
+ * Implementation
+ */
+void
+LispCoreInit(void)
+{
+    Oeq                        = STATIC_ATOM("EQ");
+    Oeql               = STATIC_ATOM("EQL");
+    Oequal             = STATIC_ATOM("EQUAL");
+    Oequalp            = STATIC_ATOM("EQUALP");
+    Omake_array                = STATIC_ATOM("MAKE-ARRAY");
+    Kinitial_contents  = KEYWORD("INITIAL-CONTENTS");
+    Osetf              = STATIC_ATOM("SETF");
+    Ootherwise         = STATIC_ATOM("OTHERWISE");
+    LispExportSymbol(Ootherwise);
+    Oquote             = STATIC_ATOM("QUOTE");
+    LispExportSymbol(Oquote);
+
+    Svariable          = GETATOMID("VARIABLE");
+    Sstructure         = GETATOMID("STRUCTURE");
+    Stype              = GETATOMID("TYPE");
+
+    /* Create as a constant so that only the C code should change the value */
+    Ogensym_counter    = STATIC_ATOM("*GENSYM-COUNTER*");
+    LispDefconstant(Ogensym_counter, FIXNUM(0), NIL);
+    LispExportSymbol(Ogensym_counter);
+
+    Ssetf      = ATOMID(Osetf);
+}
+
+LispObj *
+Lisp_Acons(LispBuiltin *builtin)
+/*
+ acons key datum alist
+ */
+{
+    LispObj *key, *datum, *alist;
+
+    alist = ARGUMENT(2);
+    datum = ARGUMENT(1);
+    key = ARGUMENT(0);
+
+    return (CONS(CONS(key, datum), alist));
+}
+
+static LispObj *
+LispAdjoin(LispBuiltin*builtin, LispObj *item, LispObj *list,
+          LispObj *key, LispObj *test, LispObj *test_not)
+{
+    GC_ENTER();
+    int code, expect, value;
+    LispObj *lambda, *compare, *object;
+
+    CHECK_LIST(list);
+    CHECK_TEST();
+
+    if (key != UNSPEC) {
+       item = APPLY1(key, item);
+       /* Result is not guaranteed to be gc protected */
+       GC_PROTECT(item);
+    }
+
+    /* Check if item is not already in place */
+    for (object = list; CONSP(object); object = CDR(object)) {
+       compare = CAR(object);
+       if (key != UNSPEC) {
+           compare = APPLY1(key, compare);
+           GC_PROTECT(compare);
+           value = FCOMPARE(lambda, item, compare, code);
+           /* Unprotect compare... */
+           --lisp__data.protect.length;
+       }
+       else
+           value = FCOMPARE(lambda, item, compare, code);
+
+       if (value == expect) {
+           /* Item is already in list */
+           GC_LEAVE();
+
+           return (list);
+       }
+    }
+    GC_LEAVE();
+
+    return (CONS(item, list));
+}
+
+LispObj *
+Lisp_Adjoin(LispBuiltin *builtin)
+/*
+ adjoin item list &key key test test-not
+ */
+{
+    LispObj *item, *list, *key, *test, *test_not;
+
+    test_not = ARGUMENT(4);
+    test = ARGUMENT(3);
+    key = ARGUMENT(2);
+    list = ARGUMENT(1);
+    item = ARGUMENT(0);
+
+    return (LispAdjoin(builtin, item, list, key, test, test_not));
+}
+
+LispObj *
+Lisp_Append(LispBuiltin *builtin)
+/*
+ append &rest lists
+ */
+{
+    GC_ENTER();
+    LispObj *result, *cons, *list;
+
+    LispObj *lists;
+
+    lists = ARGUMENT(0);
+
+    /* no arguments */
+    if (!CONSP(lists))
+       return (NIL);
+
+    /* skip initial nil lists */
+    for (; CONSP(CDR(lists)) && CAR(lists) == NIL; lists = CDR(lists))
+       ;
+
+    /* last argument is not copied (even if it is the single argument) */
+    if (!CONSP(CDR(lists)))
+       return (CAR(lists));
+
+    /* make sure result is a list */
+    list = CAR(lists);
+    CHECK_CONS(list);
+    result = cons = CONS(CAR(list), NIL);
+    GC_PROTECT(result);
+    for (list = CDR(list); CONSP(list); list = CDR(list)) {
+       RPLACD(cons, CONS(CAR(list), NIL));
+       cons = CDR(cons);
+    }
+    lists = CDR(lists);
+
+    /* copy intermediate lists */
+    for (; CONSP(CDR(lists)); lists = CDR(lists)) {
+       list = CAR(lists);
+       if (list == NIL)
+           continue;
+       /* intermediate elements must be lists */
+       CHECK_CONS(list);
+       for (; CONSP(list); list = CDR(list)) {
+           RPLACD(cons, CONS(CAR(list), NIL));
+           cons = CDR(cons);
+       }
+    }
+
+    /* add last element */
+    RPLACD(cons, CAR(lists));
+
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+Lisp_Aref(LispBuiltin *builtin)
+/*
+ aref array &rest subscripts
+ */
+{
+    long c, count, idx, seq;
+    LispObj *obj, *dim;
+
+    LispObj *array, *subscripts;
+
+    subscripts = ARGUMENT(1);
+    array = ARGUMENT(0);
+
+    /* accept strings also */
+    if (STRINGP(array) && CONSP(subscripts) && CDR(subscripts) == NIL) {
+       long offset, length = STRLEN(array);
+
+       CHECK_INDEX(CAR(subscripts));
+       offset = FIXNUM_VALUE(CAR(subscripts));
+
+       if (offset >= length)
+           LispDestroy("%s: index %ld too large for sequence length %ld",
+                       STRFUN(builtin), offset, length);
+
+       return (SCHAR(THESTR(array)[offset]));
+    }
+
+    CHECK_ARRAY(array);
+
+    for (count = 0, dim = subscripts, obj = array->data.array.dim; CONSP(dim);
+        count++, dim = CDR(dim), obj = CDR(obj)) {
+       if (count >= array->data.array.rank)
+           LispDestroy("%s: too many subscripts %s",
+                       STRFUN(builtin), STROBJ(subscripts));
+       if (!INDEXP(CAR(dim)) ||
+           FIXNUM_VALUE(CAR(dim)) >= FIXNUM_VALUE(CAR(obj)))
+           LispDestroy("%s: %s is out of range or a bad index",
+                       STRFUN(builtin), STROBJ(CAR(dim)));
+    }
+    if (count < array->data.array.rank)
+       LispDestroy("%s: too few subscripts %s",
+                   STRFUN(builtin), STROBJ(subscripts));
+
+    for (count = seq = 0, dim = subscripts; CONSP(dim); dim = CDR(dim), seq++) {
+       for (idx = 0, obj = array->data.array.dim; idx < seq;
+            obj = CDR(obj), ++idx)
+           ;
+       for (c = 1, obj = CDR(obj); obj != NIL; obj = CDR(obj))
+           c *= FIXNUM_VALUE(CAR(obj));
+       count += c * FIXNUM_VALUE(CAR(dim));
+    }
+
+    for (array = array->data.array.list; count > 0; array = CDR(array), count--)
+       ;
+
+    return (CAR(array));
+}
+
+static LispObj *
+LispAssocOrMember(LispBuiltin *builtin, int function, int comparison)
+/*
+ assoc item list &key test test-not key
+ assoc-if predicate list &key key
+ assoc-if-not predicate list &key key
+ member item list &key test test-not key
+ member-if predicate list &key key
+ member-if-not predicate list &key key
+ */
+{
+    int code = 0, expect, value;
+    LispObj *lambda, *result, *compare;
+
+    LispObj *item, *list, *test, *test_not, *key;
+
+    if (comparison == NONE) {
+       key = ARGUMENT(4);
+       test_not = ARGUMENT(3);
+       test = ARGUMENT(2);
+       list = ARGUMENT(1);
+       item = ARGUMENT(0);
+       lambda = NIL;
+    }
+    else {
+       key = ARGUMENT(2);
+       list = ARGUMENT(1);
+       lambda = ARGUMENT(0);
+       test = test_not = UNSPEC;
+       item = NIL;
+    }
+
+    if (list == NIL)
+       return (NIL);
+    CHECK_CONS(list);
+
+    /* Resolve compare function, and expected result of comparison */
+    if (comparison == NONE) {
+       CHECK_TEST();
+    }
+    else
+       expect = comparison == IFNOT ? 0 : 1;
+
+    result = NIL;
+    for (; CONSP(list); list = CDR(list)) {
+       compare = CAR(list);
+       if (function == ASSOC) {
+           if (!CONSP(compare))
+               continue;
+           compare = CAR(compare);
+       }
+       if (key != UNSPEC)
+           compare = APPLY1(key, compare);
+
+       if (comparison == NONE)
+           value = FCOMPARE(lambda, item, compare, code);
+       else
+           value = APPLY1(lambda, compare) != NIL;
+       if (value == expect) {
+           result = list;
+           if (function == ASSOC)
+               result = CAR(result);
+           break;
+       }
+    }
+    if (function == MEMBER) {
+       CHECK_LIST(list);
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Assoc(LispBuiltin *builtin)
+/*
+ assoc item list &key test test-not key
+ */
+{
+    return (LispAssocOrMember(builtin, ASSOC, NONE));
+}
+
+LispObj *
+Lisp_AssocIf(LispBuiltin *builtin)
+/*
+ assoc-if predicate list &key key
+ */
+{
+    return (LispAssocOrMember(builtin, ASSOC, IF));
+}
+
+LispObj *
+Lisp_AssocIfNot(LispBuiltin *builtin)
+/*
+ assoc-if-not predicate list &key key
+ */
+{
+    return (LispAssocOrMember(builtin, ASSOC, IFNOT));
+}
+
+LispObj *
+Lisp_And(LispBuiltin *builtin)
+/*
+ and &rest args
+ */
+{
+    LispObj *result = T, *args;
+
+    args = ARGUMENT(0);
+
+    for (; CONSP(args); args = CDR(args)) {
+       result = EVAL(CAR(args));
+       if (result == NIL)
+           break;
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Apply(LispBuiltin *builtin)
+/*
+ apply function arg &rest more-args
+ */
+{
+    GC_ENTER();
+    LispObj *result, *arguments;
+
+    LispObj *function, *arg, *more_args;
+
+    more_args = ARGUMENT(2);
+    arg = ARGUMENT(1);
+    function = ARGUMENT(0);
+
+    if (more_args == NIL) {
+       CHECK_LIST(arg);
+       arguments = arg;
+       for (; CONSP(arg); arg = CDR(arg))
+           ;
+       CHECK_LIST(arg);
+    }
+    else {
+       LispObj *cons;
+
+       CHECK_CONS(more_args);
+       arguments = cons = CONS(arg, NIL);
+       GC_PROTECT(arguments);
+       for (arg = CDR(more_args);
+            CONSP(arg);
+            more_args = arg, arg = CDR(arg)) {
+           RPLACD(cons, CONS(CAR(more_args), NIL));
+           cons = CDR(cons);
+       }
+       more_args = CAR(more_args);
+       if (more_args != NIL) {
+           for (arg = more_args; CONSP(arg); arg = CDR(arg))
+               ;
+           CHECK_LIST(arg);
+           RPLACD(cons, more_args);
+       }
+    }
+
+    result = APPLY(function, arguments);
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+Lisp_Atom(LispBuiltin *builtin)
+/*
+ atom object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (CONSP(object) ? NIL : T);
+}
+
+LispObj *
+Lisp_Block(LispBuiltin *builtin)
+/*
+ block name &rest body
+ */
+{
+    int did_jump, *pdid_jump = &did_jump;
+    LispObj *res, **pres = &res;
+    LispBlock *block;
+
+    LispObj *name, *body;
+
+    body = ARGUMENT(1);
+    name = ARGUMENT(0);
+
+    if (!SYMBOLP(name) && name != NIL && name != T)
+       LispDestroy("%s: %s cannot name a block",
+                   STRFUN(builtin), STROBJ(name));
+
+    *pres = NIL;
+    *pdid_jump = 1;
+    block = LispBeginBlock(name, LispBlockTag);
+    if (setjmp(block->jmp) == 0) {
+       for (; CONSP(body); body = CDR(body))
+           res = EVAL(CAR(body));
+       *pdid_jump = 0;
+    }
+    LispEndBlock(block);
+    if (*pdid_jump)
+       *pres = lisp__data.block.block_ret;
+
+    return (res);
+}
+
+LispObj *
+Lisp_Boundp(LispBuiltin *builtin)
+/*
+ boundp symbol
+ */
+{
+    LispAtom *atom;
+
+    LispObj *symbol = ARGUMENT(0);
+
+    CHECK_SYMBOL(symbol);
+
+    atom = symbol->data.atom;
+    if (atom->package == lisp__data.keyword ||
+       (atom->a_object && atom->property->value != UNBOUND))
+       return (T);
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_Butlast(LispBuiltin *builtin)
+/*
+ butlast list &optional count
+ */
+{
+    GC_ENTER();
+    long length, count;
+    LispObj *result, *cons, *list, *ocount;
+
+    ocount = ARGUMENT(1);
+    list = ARGUMENT(0);
+
+    CHECK_LIST(list);
+    if (ocount == UNSPEC)
+       count = 1;
+    else {
+       CHECK_INDEX(ocount);
+       count = FIXNUM_VALUE(ocount);
+    }
+    length = LispLength(list);
+
+    if (count == 0)
+       return (list);
+    else if (count >= length)
+       return (NIL);
+
+    length -= count + 1;
+    result = cons = CONS(CAR(list), NIL);
+    GC_PROTECT(result);
+    for (list = CDR(list); length > 0; list = CDR(list), length--) {
+       RPLACD(cons, CONS(CAR(list), NIL));
+       cons = CDR(cons);
+    }
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+Lisp_Nbutlast(LispBuiltin *builtin)
+/*
+ nbutlast list &optional count
+ */
+{
+    long length, count;
+    LispObj *result, *list, *ocount;
+
+    ocount = ARGUMENT(1);
+    list = ARGUMENT(0);
+
+    CHECK_LIST(list);
+    if (ocount == UNSPEC)
+       count = 1;
+    else {
+       CHECK_INDEX(ocount);
+       count = FIXNUM_VALUE(ocount);
+    }
+    length = LispLength(list);
+
+    if (count == 0)
+       return (list);
+    else if (count >= length)
+       return (NIL);
+
+    length -= count + 1;
+    result = list;
+    for (; length > 0; list = CDR(list), length--)
+       ;
+    RPLACD(list, NIL);
+
+    return (result);
+}
+
+LispObj *
+Lisp_Car(LispBuiltin *builtin)
+/*
+ car list
+ */
+{
+    LispObj *list, *result = NULL;
+
+    list = ARGUMENT(0);
+
+    if (list == NIL)
+       result = NIL;
+    else {
+       CHECK_CONS(list);
+       result = CAR(list);
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Case(LispBuiltin *builtin)
+/*
+ case keyform &rest body
+ */
+{
+    LispObj *result, *code, *keyform, *body, *form;
+
+    body = ARGUMENT(1);
+    keyform = ARGUMENT(0);
+
+    result = NIL;
+    keyform = EVAL(keyform);
+
+    for (; CONSP(body); body = CDR(body)) {
+       code = CAR(body);
+       CHECK_CONS(code);
+
+       form = CAR(code);
+       if (form == T || form == Ootherwise) {
+           if (CONSP(CDR(body)))
+               LispDestroy("%s: %s must be the last clause",
+                           STRFUN(builtin), STROBJ(CAR(code)));
+           result = CDR(code);
+           break;
+       }
+       else if (CONSP(form)) {
+           for (; CONSP(form); form = CDR(form))
+               if (XEQL(keyform, CAR(form)) == T) {
+                   result = CDR(code);
+                   break;
+               }
+           if (CONSP(form))    /* if found match */
+               break;
+       }
+       else if (XEQL(keyform, form) == T) {
+           result = CDR(code);
+           break;
+       }
+    }
+
+    for (body = result; CONSP(body); body = CDR(body))
+       result = EVAL(CAR(body));
+
+    return (result);
+}
+
+LispObj *
+Lisp_Catch(LispBuiltin *builtin)
+/*
+ catch tag &rest body
+ */
+{
+    int did_jump, *pdid_jump = &did_jump;
+    LispObj *res, **pres = &res;
+    LispBlock *block;
+
+    LispObj *tag, *body;
+
+    body = ARGUMENT(1);
+    tag = ARGUMENT(0);
+
+    *pres = NIL;
+    *pdid_jump = 1;
+    block = LispBeginBlock(tag, LispBlockCatch);
+    if (setjmp(block->jmp) == 0) {
+       for (; CONSP(body); body = CDR(body))
+           res = EVAL(CAR(body));
+       *pdid_jump = 0;
+    }
+    LispEndBlock(block);
+    if (*pdid_jump)
+       *pres = lisp__data.block.block_ret;
+
+    return (res);
+}
+
+LispObj *
+Lisp_Coerce(LispBuiltin *builtin)
+/*
+ coerce object result-type
+ */
+{
+    LispObj *object, *result_type;
+
+    result_type = ARGUMENT(1);
+    object = ARGUMENT(0);
+
+    return (LispCoerce(builtin, object, result_type));
+}
+
+LispObj *
+Lisp_Cdr(LispBuiltin *builtin)
+/*
+ cdr list
+ */
+{
+    LispObj *list, *result = NULL;
+
+    list = ARGUMENT(0);
+
+    if (list == NIL)
+       result = NIL;
+    else {
+       CHECK_CONS(list);
+       result = CDR(list);
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_C_r(LispBuiltin *builtin)
+/*
+ c[ad]{2,4}r list
+ */
+{
+    char *desc;
+
+    LispObj *list, *result = NULL;
+
+    list = ARGUMENT(0);
+
+    result = list;
+    desc = STRFUN(builtin);
+    while (desc[1] != 'R')
+       ++desc;
+    while (*desc != 'C') {
+       if (result == NIL)
+           break;
+       CHECK_CONS(result);
+       result = *desc == 'A' ? CAR(result) : CDR(result);
+       --desc;
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Cond(LispBuiltin *builtin)
+/*
+ cond &rest body
+ */
+{
+    LispObj *result, *code, *body;
+
+    body = ARGUMENT(0);
+
+    result = NIL;
+    for (; CONSP(body); body = CDR(body)) {
+       code = CAR(body);
+
+       CHECK_CONS(code);
+       result = EVAL(CAR(code));
+       if (result == NIL)
+           continue;
+       for (code = CDR(code); CONSP(code); code = CDR(code))
+           result = EVAL(CAR(code));
+       break;
+    }
+
+    return (result);
+}
+
+static LispObj *
+LispCopyList(LispBuiltin *builtin, LispObj *list, int function)
+{
+    GC_ENTER();
+    LispObj *result, *cons;
+
+    if (list == NIL)
+       return (list);
+    CHECK_CONS(list);
+
+    result = cons = CONS(NIL, NIL);
+    GC_PROTECT(result);
+    if (CONSP(CAR(list))) {
+       switch (function) {
+           case COPY_LIST:
+               RPLACA(result, CAR(list));
+               break;
+           case COPY_ALIST:
+               RPLACA(result, CONS(CAR(CAR(list)), CDR(CAR(list))));
+               break;
+           case COPY_TREE:
+               RPLACA(result, LispCopyList(builtin, CAR(list), COPY_TREE));
+               break;
+       }
+    }
+    else
+       RPLACA(result, CAR(list));
+
+    for (list = CDR(list); CONSP(list); list = CDR(list)) {
+       CDR(cons) = CONS(NIL, NIL);
+       cons = CDR(cons);
+       if (CONSP(CAR(list))) {
+           switch (function) {
+               case COPY_LIST:
+                   RPLACA(cons, CAR(list));
+                   break;
+               case COPY_ALIST:
+                   RPLACA(cons, CONS(CAR(CAR(list)), CDR(CAR(list))));
+                   break;
+               case COPY_TREE:
+                   RPLACA(cons, LispCopyList(builtin, CAR(list), COPY_TREE));
+                   break;
+           }
+       }
+       else
+           RPLACA(cons, CAR(list));
+    }
+    /* in case list is dotted */
+    RPLACD(cons, list);
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+Lisp_CopyAlist(LispBuiltin *builtin)
+/*
+ copy-alist list
+ */
+{
+    LispObj *list;
+
+    list = ARGUMENT(0);
+
+    return (LispCopyList(builtin, list, COPY_ALIST));
+}
+
+LispObj *
+Lisp_CopyList(LispBuiltin *builtin)
+/*
+ copy-list list
+ */
+{
+    LispObj *list;
+
+    list = ARGUMENT(0);
+
+    return (LispCopyList(builtin, list, COPY_LIST));
+}
+
+LispObj *
+Lisp_CopyTree(LispBuiltin *builtin)
+/*
+ copy-tree list
+ */
+{
+    LispObj *list;
+
+    list = ARGUMENT(0);
+
+    return (LispCopyList(builtin, list, COPY_TREE));
+}
+
+LispObj *
+Lisp_Cons(LispBuiltin *builtin)
+/*
+ cons car cdr
+ */
+{
+    LispObj *car, *cdr;
+
+    cdr = ARGUMENT(1);
+    car = ARGUMENT(0);
+
+    return (CONS(car, cdr));
+}
+
+LispObj *
+Lisp_Consp(LispBuiltin *builtin)
+/*
+ consp object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (CONSP(object) ? T : NIL);
+}
+
+LispObj *
+Lisp_Constantp(LispBuiltin *builtin)
+/*
+ constantp form &optional environment
+ */
+{
+    LispObj *form;
+
+    form = ARGUMENT(0);
+
+    /* not all self-evaluating objects are considered constants */
+    if (!POINTERP(form) ||
+       NUMBERP(form) ||
+       XQUOTEP(form) ||
+       (XCONSP(form) && CAR(form) == Oquote) ||
+       (XSYMBOLP(form) && form->data.atom->constant) ||
+       XSTRINGP(form) ||
+       XARRAYP(form))
+       return (T);
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_Defconstant(LispBuiltin *builtin)
+/*
+ defconstant name initial-value &optional documentation
+ */
+{
+    LispObj *name, *initial_value, *documentation;
+
+    documentation = ARGUMENT(2);
+    initial_value = ARGUMENT(1);
+    name = ARGUMENT(0);
+
+    CHECK_SYMBOL(name);
+    if (documentation != UNSPEC) {
+       CHECK_STRING(documentation);
+    }
+    else
+       documentation = NIL;
+    LispDefconstant(name, EVAL(initial_value), documentation);
+
+    return (name);
+}
+
+LispObj *
+Lisp_Defmacro(LispBuiltin *builtin)
+/*
+ defmacro name lambda-list &rest body
+ */
+{
+    LispArgList *alist;
+
+    LispObj *lambda, *name, *lambda_list, *body;
+
+    body = ARGUMENT(2);
+    lambda_list = ARGUMENT(1);
+    name = ARGUMENT(0);
+
+    CHECK_SYMBOL(name);
+    alist = LispCheckArguments(LispMacro, lambda_list, ATOMID(name)->value, 0);
+
+    if (CONSP(body) && STRINGP(CAR(body))) {
+       LispAddDocumentation(name, CAR(body), LispDocFunction);
+       body = CDR(body);
+    }
+
+    lambda_list = LispListProtectedArguments(alist);
+    lambda = LispNewLambda(name, body, lambda_list, LispMacro);
+
+    if (name->data.atom->a_builtin || name->data.atom->a_compiled) {
+       if (name->data.atom->a_builtin) {
+           ERROR_CHECK_SPECIAL_FORM(name->data.atom);
+       }
+       /* redefining these may cause surprises if bytecode
+        * compiled functions references them */
+       LispWarning("%s: %s is being redefined", STRFUN(builtin),
+                   ATOMID(name)->value);
+
+       LispRemAtomBuiltinProperty(name->data.atom);
+    }
+
+    LispSetAtomFunctionProperty(name->data.atom, lambda, alist);
+    LispUseArgList(alist);
+
+    return (name);
+}
+
+LispObj *
+Lisp_Defun(LispBuiltin *builtin)
+/*
+ defun name lambda-list &rest body
+ */
+{
+    LispArgList *alist;
+
+    LispObj *lambda, *name, *lambda_list, *body;
+
+    body = ARGUMENT(2);
+    lambda_list = ARGUMENT(1);
+    name = ARGUMENT(0);
+
+    CHECK_SYMBOL(name);
+    alist = LispCheckArguments(LispFunction, lambda_list, ATOMID(name)->value, 0);
+
+    if (CONSP(body) && STRINGP(CAR(body))) {
+       LispAddDocumentation(name, CAR(body), LispDocFunction);
+       body = CDR(body);
+    }
+
+    lambda_list = LispListProtectedArguments(alist);
+    lambda = LispNewLambda(name, body, lambda_list, LispFunction);
+
+    if (name->data.atom->a_builtin || name->data.atom->a_compiled) {
+       if (name->data.atom->a_builtin) {
+           ERROR_CHECK_SPECIAL_FORM(name->data.atom);
+       }
+       /* redefining these may cause surprises if bytecode
+        * compiled functions references them */
+       LispWarning("%s: %s is being redefined", STRFUN(builtin),
+                   ATOMID(name)->value);
+
+       LispRemAtomBuiltinProperty(name->data.atom);
+    }
+    LispSetAtomFunctionProperty(name->data.atom, lambda, alist);
+    LispUseArgList(alist);
+
+    return (name);
+}
+
+LispObj *
+Lisp_Defsetf(LispBuiltin *builtin)
+/*
+ defsetf function lambda-list &rest body
+ */
+{
+    LispArgList *alist;
+    LispObj *obj;
+    LispObj *lambda, *function, *lambda_list, *store, *body;
+
+    body = ARGUMENT(2);
+    lambda_list = ARGUMENT(1);
+    function = ARGUMENT(0);
+
+    CHECK_SYMBOL(function);
+
+    if (body == NIL || (CONSP(body) && STRINGP(CAR(body)))) {
+       if (!SYMBOLP(lambda_list))
+           LispDestroy("%s: syntax error %s %s",
+                       STRFUN(builtin), STROBJ(function), STROBJ(lambda_list));
+       if (body != NIL)
+           LispAddDocumentation(function, CAR(body), LispDocSetf);
+
+       LispSetAtomSetfProperty(function->data.atom, lambda_list, NULL);
+
+       return (function);
+    }
+
+    alist = LispCheckArguments(LispSetf, lambda_list, ATOMID(function)->value, 0);
+
+    store = CAR(body);
+    if (!CONSP(store))
+       LispDestroy("%s: %s is a bad store value",
+                   STRFUN(builtin), STROBJ(store));
+    for (obj = store; CONSP(obj); obj = CDR(obj)) {
+       CHECK_SYMBOL(CAR(obj));
+    }
+
+    body = CDR(body);
+    if (CONSP(body) && STRINGP(CAR(body))) {
+       LispAddDocumentation(function, CAR(body), LispDocSetf);
+       body = CDR(body);
+    }
+
+    lambda = LispNewLambda(function, body, store, LispSetf);
+    LispSetAtomSetfProperty(function->data.atom, lambda, alist);
+    LispUseArgList(alist);
+
+    return (function);
+}
+
+LispObj *
+Lisp_Defparameter(LispBuiltin *builtin)
+/*
+ defparameter name initial-value &optional documentation
+ */
+{
+    LispObj *name, *initial_value, *documentation;
+
+    documentation = ARGUMENT(2);
+    initial_value = ARGUMENT(1);
+    name = ARGUMENT(0);
+
+    CHECK_SYMBOL(name);
+    if (documentation != UNSPEC) {
+       CHECK_STRING(documentation);
+    }
+    else
+       documentation = NIL;
+
+    LispProclaimSpecial(name, EVAL(initial_value), documentation);
+
+    return (name);
+}
+
+LispObj *
+Lisp_Defvar(LispBuiltin *builtin)
+/*
+ defvar name &optional initial-value documentation
+ */
+{
+    LispObj *name, *initial_value, *documentation;
+
+    documentation = ARGUMENT(2);
+    initial_value = ARGUMENT(1);
+    name = ARGUMENT(0);
+
+    CHECK_SYMBOL(name);
+    if (documentation != UNSPEC) {
+       CHECK_STRING(documentation);
+    }
+    else
+       documentation = NIL;
+
+    LispProclaimSpecial(name,
+                       initial_value != UNSPEC ? EVAL(initial_value) : NULL,
+                       documentation);
+
+    return (name);
+}
+
+LispObj *
+Lisp_Delete(LispBuiltin *builtin)
+/*
+ delete item sequence &key from-end test test-not start end count key
+ */
+{
+    return (LispDeleteRemoveXSubstitute(builtin, DELETE, NONE));
+}
+
+LispObj *
+Lisp_DeleteIf(LispBuiltin *builtin)
+/*
+ delete-if predicate sequence &key from-end start end count key
+ */
+{
+    return (LispDeleteRemoveXSubstitute(builtin, DELETE, IF));
+}
+
+LispObj *
+Lisp_DeleteIfNot(LispBuiltin *builtin)
+/*
+ delete-if-not predicate sequence &key from-end start end count key
+ */
+{
+    return (LispDeleteRemoveXSubstitute(builtin, DELETE, IFNOT));
+}
+
+LispObj *
+Lisp_DeleteDuplicates(LispBuiltin *builtin)
+/*
+ delete-duplicates sequence &key from-end test test-not start end key
+ */
+{
+    return (LispDeleteOrRemoveDuplicates(builtin, DELETE));
+}
+
+LispObj *
+Lisp_Do(LispBuiltin *builtin)
+/*
+ do init test &rest body
+ */
+{
+    return (LispDo(builtin, 0));
+}
+
+LispObj *
+Lisp_DoP(LispBuiltin *builtin)
+/*
+ do* init test &rest body
+ */
+{
+    return (LispDo(builtin, 1));
+}
+
+static LispDocType_t
+LispDocumentationType(LispBuiltin *builtin, LispObj *type)
+{
+    Atom_id atom;
+    LispDocType_t doc_type = LispDocVariable;
+
+    CHECK_SYMBOL(type);
+    atom = ATOMID(type);
+
+    if (atom == Svariable)
+       doc_type = LispDocVariable;
+    else if (atom == Sfunction)
+       doc_type = LispDocFunction;
+    else if (atom == Sstructure)
+       doc_type = LispDocStructure;
+    else if (atom == Stype)
+       doc_type = LispDocType;
+    else if (atom == Ssetf)
+       doc_type = LispDocSetf;
+    else {
+       LispDestroy("%s: unknown documentation type %s",
+                   STRFUN(builtin), STROBJ(type));
+       /*NOTREACHED*/
+    }
+
+    return (doc_type);
+}
+
+LispObj *
+Lisp_Documentation(LispBuiltin *builtin)
+/*
+ documentation symbol type
+ */
+{
+    LispObj *symbol, *type;
+
+    type = ARGUMENT(1);
+    symbol = ARGUMENT(0);
+
+    CHECK_SYMBOL(symbol);
+    /* type is checked in LispDocumentationType() */
+
+    return (LispGetDocumentation(symbol, LispDocumentationType(builtin, type)));
+}
+
+LispObj *
+Lisp_DoList(LispBuiltin *builtin)
+{
+    return (LispDoListTimes(builtin, 0));
+}
+
+LispObj *
+Lisp_DoTimes(LispBuiltin *builtin)
+{
+    return (LispDoListTimes(builtin, 1));
+}
+
+LispObj *
+Lisp_Elt(LispBuiltin *builtin)
+/*
+ elt sequence index
+ svref sequence index
+ */
+{
+    long offset, length;
+    LispObj *result, *sequence, *oindex;
+
+    oindex = ARGUMENT(1);
+    sequence = ARGUMENT(0);
+
+    length = LispLength(sequence);
+
+    CHECK_INDEX(oindex);
+    offset = FIXNUM_VALUE(oindex);
+
+    if (offset >= length)
+       LispDestroy("%s: index %ld too large for sequence length %ld",
+                   STRFUN(builtin), offset, length);
+
+    if (STRINGP(sequence))
+       result = SCHAR(THESTR(sequence)[offset]);
+    else {
+       if (ARRAYP(sequence))
+           sequence = sequence->data.array.list;
+
+       for (; offset > 0; offset--, sequence = CDR(sequence))
+           ;
+       result = CAR(sequence);
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Endp(LispBuiltin *builtin)
+/*
+ endp object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    if (object == NIL)
+       return (T);
+    CHECK_CONS(object);
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_Eq(LispBuiltin *builtin)
+/*
+ eq left right
+ */
+{
+    LispObj *left, *right;
+
+    right = ARGUMENT(1);
+    left = ARGUMENT(0);
+
+    return (XEQ(left, right));
+}
+
+LispObj *
+Lisp_Eql(LispBuiltin *builtin)
+/*
+ eql left right
+ */
+{
+    LispObj *left, *right;
+
+    right = ARGUMENT(1);
+    left = ARGUMENT(0);
+
+    return (XEQL(left, right));
+}
+
+LispObj *
+Lisp_Equal(LispBuiltin *builtin)
+/*
+ equal left right
+ */
+{
+    LispObj *left, *right;
+
+    right = ARGUMENT(1);
+    left = ARGUMENT(0);
+
+    return (XEQUAL(left, right));
+}
+
+LispObj *
+Lisp_Equalp(LispBuiltin *builtin)
+/*
+ equalp left right
+ */
+{
+    LispObj *left, *right;
+
+    right = ARGUMENT(1);
+    left = ARGUMENT(0);
+
+    return (XEQUALP(left, right));
+}
+
+LispObj *
+Lisp_Error(LispBuiltin *builtin)
+/*
+ error control-string &rest arguments
+ */
+{
+    LispObj *string, *arglist;
+
+    LispObj *control_string, *arguments;
+
+    arguments = ARGUMENT(1);
+    control_string = ARGUMENT(0);
+
+    arglist = CONS(NIL, CONS(control_string, arguments));
+    GC_PROTECT(arglist);
+    string = APPLY(Oformat, arglist);
+    LispDestroy("%s", THESTR(string));
+    /*NOTREACHED*/
+
+    /* No need to call GC_ENTER() and GC_LEAVE() macros */
+    return (NIL);
+}
+
+LispObj *
+Lisp_Eval(LispBuiltin *builtin)
+/*
+ eval form
+ */
+{
+    int lex;
+    LispObj *form, *result;
+
+    form = ARGUMENT(0);
+
+    /* make sure eval form will not access local variables */
+    lex = lisp__data.env.lex;
+    lisp__data.env.lex = lisp__data.env.length;
+    result = EVAL(form);
+    lisp__data.env.lex = lex;
+
+    return (result);
+}
+
+static LispObj *
+LispEverySomeAnyNot(LispBuiltin *builtin, int function)
+/*
+ every predicate sequence &rest more-sequences
+ some predicate sequence &rest more-sequences
+ notevery predicate sequence &rest more-sequences
+ notany predicate sequence &rest more-sequences
+ */
+{
+    GC_ENTER();
+    long i, j, length, count;
+    LispObj *result, *list, *item, *arguments, *acons, *value;
+    SeqInfo stk[8], *seqs;
+
+    LispObj *predicate, *sequence, *more_sequences;
+
+    more_sequences = ARGUMENT(2);
+    sequence = ARGUMENT(1);
+    predicate = ARGUMENT(0);
+
+    count = 1;
+    length = LispLength(sequence);
+    for (list = more_sequences; CONSP(list); list = CDR(list), count++) {
+       i = LispLength(CAR(list));
+       if (i < length)
+           length = i;
+    }
+
+    result = function == EVERY || function == NOTANY ? T : NIL;
+
+    /* if at least one sequence has length zero */
+    if (length == 0)
+       return (result);
+
+    if (count > sizeof(stk) / sizeof(stk[0]))
+       seqs = LispMalloc(count * sizeof(SeqInfo));
+    else
+       seqs = &stk[0];
+
+    /* build information about sequences */
+    SETSEQ(seqs[0], sequence);
+    for (i = 1, list = more_sequences; CONSP(list); list = CDR(list), i++) {
+       item = CAR(list);
+       SETSEQ(seqs[i], item);
+    }
+
+    /* prepare argument list */
+    arguments = acons = CONS(NIL, NIL);
+    GC_PROTECT(arguments);
+    for (i = 1; i < count; i++) {
+       RPLACD(acons, CONS(NIL, NIL));
+       acons = CDR(acons);
+    }
+
+    /* loop applying predicate in sequence elements */
+    for (i = 0; i < length; i++) {
+
+       /* build argument list */
+       for (acons = arguments, j = 0; j < count; acons = CDR(acons), j++) {
+           if (seqs[j].type == LispString_t)
+               item = SCHAR(*seqs[j].data.string++);
+           else {
+               item = CAR(seqs[j].data.list);
+               seqs[j].data.list = CDR(seqs[j].data.list);
+           }
+           RPLACA(acons, item);
+       }
+
+       /* apply predicate */
+       value = APPLY(predicate, arguments);
+
+       /* check if needs to terminate loop */
+       if (value == NIL) {
+           if (function == EVERY) {
+               result = NIL;
+               break;
+           }
+           if (function == NOTEVERY) {
+               result = T;
+               break;
+           }
+       }
+       else {
+           if (function == SOME) {
+               result = value;
+               break;
+           }
+           if (function == NOTANY) {
+               result = NIL;
+               break;
+           }
+       }
+    }
+
+    GC_LEAVE();
+    if (seqs != &stk[0])
+       LispFree(seqs);
+
+    return (result);
+}
+
+LispObj *
+Lisp_Every(LispBuiltin *builtin)
+/*
+ every predicate sequence &rest more-sequences
+ */
+{
+    return (LispEverySomeAnyNot(builtin, EVERY));
+}
+
+LispObj *
+Lisp_Some(LispBuiltin *builtin)
+/*
+ some predicate sequence &rest more-sequences
+ */
+{
+    return (LispEverySomeAnyNot(builtin, SOME));
+}
+
+LispObj *
+Lisp_Notevery(LispBuiltin *builtin)
+/*
+ notevery predicate sequence &rest more-sequences
+ */
+{
+    return (LispEverySomeAnyNot(builtin, NOTEVERY));
+}
+
+LispObj *
+Lisp_Notany(LispBuiltin *builtin)
+/*
+ notany predicate sequence &rest more-sequences
+ */
+{
+    return (LispEverySomeAnyNot(builtin, NOTANY));
+}
+
+LispObj *
+Lisp_Fboundp(LispBuiltin *builtin)
+/*
+ fboundp symbol
+ */
+{
+    LispAtom *atom;
+
+    LispObj *symbol = ARGUMENT(0);
+
+    CHECK_SYMBOL(symbol);
+
+    atom = symbol->data.atom;
+    if (atom->a_function || atom->a_builtin || atom->a_compiled)
+       return (T);
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_Find(LispBuiltin *builtin)
+/*
+ find item sequence &key from-end test test-not start end key
+ */
+{
+    return (LispFindOrPosition(builtin, FIND, NONE));
+}
+
+LispObj *
+Lisp_FindIf(LispBuiltin *builtin)
+/*
+ find-if predicate sequence &key from-end start end key
+ */
+{
+    return (LispFindOrPosition(builtin, FIND, IF));
+}
+
+LispObj *
+Lisp_FindIfNot(LispBuiltin *builtin)
+/*
+ find-if-not predicate sequence &key from-end start end key
+ */
+{
+    return (LispFindOrPosition(builtin, FIND, IFNOT));
+}
+
+LispObj *
+Lisp_Fill(LispBuiltin *builtin)
+/*
+ fill sequence item &key start end
+ */
+{
+    long i, start, end, length;
+
+    LispObj *sequence, *item, *ostart, *oend;
+
+    oend = ARGUMENT(3);
+    ostart = ARGUMENT(2);
+    item = ARGUMENT(1);
+    sequence = ARGUMENT(0);
+
+    LispCheckSequenceStartEnd(builtin, sequence, ostart, oend,
+                             &start, &end, &length);
+
+    if (STRINGP(sequence)) {
+       int ch;
+       char *string = THESTR(sequence);
+
+       CHECK_STRING_WRITABLE(sequence);
+       CHECK_SCHAR(item);
+       ch = SCHAR_VALUE(item);
+       for (i = start; i < end; i++)
+           string[i] = ch;
+    }
+    else {
+       LispObj *list;
+
+       if (CONSP(sequence))
+           list = sequence;
+       else
+           list = sequence->data.array.list;
+
+       for (i = 0; i < start; i++, list = CDR(list))
+           ;
+       for (; i < end; i++, list = CDR(list))
+           RPLACA(list, item);
+    }
+
+    return (sequence);
+}
+
+LispObj *
+Lisp_Fmakunbound(LispBuiltin *builtin)
+/*
+ fmkaunbound symbol
+ */
+{
+    LispObj *symbol;
+
+    symbol = ARGUMENT(0);
+
+    CHECK_SYMBOL(symbol);
+    if (symbol->data.atom->a_function)
+       LispRemAtomFunctionProperty(symbol->data.atom);
+    else if (symbol->data.atom->a_builtin)
+       LispRemAtomBuiltinProperty(symbol->data.atom);
+    else if (symbol->data.atom->a_compiled)
+       LispRemAtomCompiledProperty(symbol->data.atom);
+
+    return (symbol);
+}
+
+LispObj *
+Lisp_Funcall(LispBuiltin *builtin)
+/*
+ funcall function &rest arguments
+ */
+{
+    LispObj *result;
+
+    LispObj *function, *arguments;
+
+    arguments = ARGUMENT(1);
+    function = ARGUMENT(0);
+
+    result = APPLY(function, arguments);
+
+    return (result);
+}
+
+LispObj *
+Lisp_Functionp(LispBuiltin *builtin)
+/*
+ functionp object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (FUNCTIONP(object) || LAMBDAP(object) ? T : NIL);
+}
+
+LispObj *
+Lisp_Get(LispBuiltin *builtin)
+/*
+ get symbol indicator &optional default
+ */
+{
+    LispObj *result;
+
+    LispObj *symbol, *indicator, *defalt;
+
+    defalt = ARGUMENT(2);
+    indicator = ARGUMENT(1);
+    symbol = ARGUMENT(0);
+
+    CHECK_SYMBOL(symbol);
+
+    result = LispGetAtomProperty(symbol->data.atom, indicator);
+
+    if (result != NIL)
+       result = CAR(result);
+    else
+       result = defalt == UNSPEC ? NIL : defalt;
+
+    return (result);
+}
+
+/*
+ * ext::getenv
+ */
+LispObj *
+Lisp_Getenv(LispBuiltin *builtin)
+/*
+ getenv name
+ */
+{
+    char *value;
+
+    LispObj *name;
+
+    name = ARGUMENT(0);
+
+    CHECK_STRING(name);
+    value = getenv(THESTR(name));
+
+    return (value ? STRING(value) : NIL);
+}
+
+LispObj *
+Lisp_Gc(LispBuiltin *builtin)
+/*
+ gc &optional car cdr
+ */
+{
+    LispObj *car, *cdr;
+
+    cdr = ARGUMENT(1);
+    car = ARGUMENT(0);
+
+    LispGC(car, cdr);
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_Gensym(LispBuiltin *builtin)
+/*
+ gensym &optional arg
+ */
+{
+    char *preffix = "G", name[132];
+    long counter = LONGINT_VALUE(Ogensym_counter->data.atom->property->value);
+    LispObj *symbol;
+
+    LispObj *arg;
+
+    arg = ARGUMENT(0);
+    if (arg != UNSPEC) {
+       if (STRINGP(arg))
+           preffix = THESTR(arg);
+       else {
+           CHECK_INDEX(arg);
+           counter = FIXNUM_VALUE(arg);
+       }
+    }
+    snprintf(name, sizeof(name), "%s%ld", preffix, counter);
+    if (strlen(name) >= 128)
+       LispDestroy("%s: name %s too long", STRFUN(builtin), name);
+    Ogensym_counter->data.atom->property->value = INTEGER(counter + 1);
+
+    symbol = UNINTERNED_ATOM(name);
+    symbol->data.atom->unreadable = !LispCheckAtomString(name);
+
+    return (symbol);
+}
+
+LispObj *
+Lisp_Go(LispBuiltin *builtin)
+/*
+ go tag
+ */
+{
+    unsigned blevel = lisp__data.block.block_level;
+
+    LispObj *tag;
+
+    tag = ARGUMENT(0);
+
+    while (blevel) {
+       LispBlock *block = lisp__data.block.block[--blevel];
+
+       if (block->type == LispBlockClosure)
+           /* if reached a function call */
+           break;
+       if (block->type == LispBlockBody) {
+           lisp__data.block.block_ret = tag;
+           LispBlockUnwind(block);
+           BLOCKJUMP(block);
+       }
+     }
+
+    LispDestroy("%s: no visible tagbody for %s",
+               STRFUN(builtin), STROBJ(tag));
+    /*NOTREACHED*/
+    return (NIL);
+}
+
+LispObj *
+Lisp_If(LispBuiltin *builtin)
+/*
+ if test then &optional else
+ */
+{
+    LispObj *result, *test, *then, *oelse;
+
+    oelse = ARGUMENT(2);
+    then = ARGUMENT(1);
+    test = ARGUMENT(0);
+
+    test = EVAL(test);
+    if (test != NIL)
+       result = EVAL(then);
+    else if (oelse != UNSPEC)
+       result = EVAL(oelse);
+    else
+       result = NIL;
+
+    return (result);
+}
+
+LispObj *
+Lisp_IgnoreErrors(LispBuiltin *builtin)
+/*
+ ignore-erros &rest body
+ */
+{
+    LispObj *result;
+    int i, jumped;
+    LispBlock *block;
+
+    /* interpreter state */
+    GC_ENTER();
+    int stack, lex, length;
+
+    /* memory allocation */
+    int mem_level;
+    void **mem;
+
+    LispObj *body;
+
+    body = ARGUMENT(0);
+
+    /* Save environment information */
+    stack = lisp__data.stack.length;
+    lex = lisp__data.env.lex;
+    length = lisp__data.env.length;
+
+    /* Save memory allocation information */
+    mem_level = lisp__data.mem.level;
+    mem = LispMalloc(mem_level * sizeof(void*));
+    memcpy(mem, lisp__data.mem.mem, mem_level * sizeof(void*));
+
+    ++lisp__data.ignore_errors;
+    result = NIL;
+    jumped = 1;
+    block = LispBeginBlock(NIL, LispBlockProtect);
+    if (setjmp(block->jmp) == 0) {
+       for (; CONSP(body); body = CDR(body))
+           result = EVAL(CAR(body));
+       jumped = 0;
+    }
+    LispEndBlock(block);
+    if (!lisp__data.destroyed && jumped)
+       result = lisp__data.block.block_ret;
+
+    if (lisp__data.destroyed) {
+       /* Restore environment */
+       lisp__data.stack.length = stack;
+       lisp__data.env.lex = lex;
+       lisp__data.env.head = lisp__data.env.length = length;
+       GC_LEAVE();
+
+       /* Check for possible leaks due to ignoring errors */
+       for (i = 0; i < mem_level; i++) {
+           if (lisp__data.mem.mem[i] && mem[i] != lisp__data.mem.mem[i])
+               LispFree(lisp__data.mem.mem[i]);
+       }
+       for (; i < lisp__data.mem.level; i++) {
+           if (lisp__data.mem.mem[i])
+               LispFree(lisp__data.mem.mem[i]);
+       }
+
+       lisp__data.destroyed = 0;
+       result = NIL;
+       RETURN_COUNT = 1;
+       RETURN(0) = lisp__data.error_condition;
+    }
+    LispFree(mem);
+    --lisp__data.ignore_errors;
+
+    return (result);
+}
+
+LispObj *
+Lisp_Intersection(LispBuiltin *builtin)
+/*
+ intersection list1 list2 &key test test-not key
+ */
+{
+    return (LispListSet(builtin, INTERSECTION));
+}
+
+LispObj *
+Lisp_Nintersection(LispBuiltin *builtin)
+/*
+ nintersection list1 list2 &key test test-not key
+ */
+{
+    return (LispListSet(builtin, NINTERSECTION));
+}
+
+LispObj *
+Lisp_Keywordp(LispBuiltin *builtin)
+/*
+ keywordp object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (KEYWORDP(object) ? T : NIL);
+}
+
+LispObj *
+Lisp_Lambda(LispBuiltin *builtin)
+/*
+ lambda lambda-list &rest body
+ */
+{
+    GC_ENTER();
+    LispObj *name;
+    LispArgList *alist;
+
+    LispObj *lambda, *lambda_list, *body;
+
+    body = ARGUMENT(1);
+    lambda_list = ARGUMENT(0);
+
+    alist = LispCheckArguments(LispLambda, lambda_list, Snil->value, 0);
+
+    name = OPAQUE(alist, LispArgList_t);
+    lambda_list = LispListProtectedArguments(alist);
+    GC_PROTECT(name);
+    GC_PROTECT(lambda_list);
+    lambda = LispNewLambda(name, body, lambda_list, LispLambda);
+    LispUseArgList(alist);
+    GC_LEAVE();
+
+    return (lambda);
+}
+
+LispObj *
+Lisp_Last(LispBuiltin *builtin)
+/*
+ last list &optional count
+ */
+{
+    long count, length;
+    LispObj *list, *ocount;
+
+    ocount = ARGUMENT(1);
+    list = ARGUMENT(0);
+
+    if (!CONSP(list))
+       return (list);
+
+    length = LispLength(list);
+
+    if (ocount == UNSPEC)
+       count = 1;
+    else {
+       CHECK_INDEX(ocount);
+       count = FIXNUM_VALUE(ocount);
+    }
+
+    if (count >= length)
+       return (list);
+
+    length -= count;
+    for (; length > 0; length--)
+       list = CDR(list);
+
+    return (list);
+}
+
+LispObj *
+Lisp_Length(LispBuiltin *builtin)
+/*
+ length sequence
+ */
+{
+    LispObj *sequence;
+
+    sequence = ARGUMENT(0);
+
+    return (FIXNUM(LispLength(sequence)));
+}
+
+LispObj *
+Lisp_Let(LispBuiltin *builtin)
+/*
+ let init &rest body
+ */
+{
+    GC_ENTER();
+    int head = lisp__data.env.length;
+    LispObj *init, *body, *pair, *result, *list, *cons = NIL;
+
+    body = ARGUMENT(1);
+    init = ARGUMENT(0);
+
+    CHECK_LIST(init);
+    for (list = NIL; CONSP(init); init = CDR(init)) {
+       LispObj *symbol, *value;
+
+       pair = CAR(init);
+       if (SYMBOLP(pair)) {
+           symbol = pair;
+           value = NIL;
+       }
+       else {
+           CHECK_CONS(pair);
+           symbol = CAR(pair);
+           CHECK_SYMBOL(symbol);
+           pair = CDR(pair);
+           if (CONSP(pair)) {
+               value = CAR(pair);
+               if (CDR(pair) != NIL)
+                   LispDestroy("%s: too much arguments to initialize %s",
+                               STRFUN(builtin), STROBJ(symbol));
+               value = EVAL(value);
+           }
+           else
+               value = NIL;
+       }
+       pair = CONS(symbol, value);
+       if (list == NIL) {
+           list = cons = CONS(pair, NIL);
+           GC_PROTECT(list);
+       }
+       else {
+           RPLACD(cons, CONS(pair, NIL));
+           cons = CDR(cons);
+       }
+    }
+    /* Add variables */
+    for (; CONSP(list); list = CDR(list)) {
+       pair = CAR(list);
+       CHECK_CONSTANT(CAR(pair));
+       LispAddVar(CAR(pair), CDR(pair));
+       ++lisp__data.env.head;
+    }
+    /* Values of symbols are now protected */
+    GC_LEAVE();
+
+    /* execute body */
+    for (result = NIL; CONSP(body); body = CDR(body))
+       result = EVAL(CAR(body));
+
+    lisp__data.env.head = lisp__data.env.length = head;
+
+    return (result);
+}
+
+LispObj *
+Lisp_LetP(LispBuiltin *builtin)
+/*
+ let* init &rest body
+ */
+{
+    int head = lisp__data.env.length;
+    LispObj *init, *body, *pair, *result;
+
+    body = ARGUMENT(1);
+    init = ARGUMENT(0);
+
+    CHECK_LIST(init);
+    for (; CONSP(init); init = CDR(init)) {
+       LispObj *symbol, *value;
+
+       pair = CAR(init);
+       if (SYMBOLP(pair)) {
+           symbol = pair;
+           value = NIL;
+       }
+       else {
+           CHECK_CONS(pair);
+           symbol = CAR(pair);
+           CHECK_SYMBOL(symbol);
+           pair = CDR(pair);
+           if (CONSP(pair)) {
+               value = CAR(pair);
+               if (CDR(pair) != NIL)
+                   LispDestroy("%s: too much arguments to initialize %s",
+                               STRFUN(builtin), STROBJ(symbol));
+               value = EVAL(value);
+           }
+           else
+               value = NIL;
+       }
+
+       CHECK_CONSTANT(symbol);
+       LispAddVar(symbol, value);
+       ++lisp__data.env.head;
+    }
+
+    /* execute body */
+    for (result = NIL; CONSP(body); body = CDR(body))
+       result = EVAL(CAR(body));
+
+    lisp__data.env.head = lisp__data.env.length = head;
+
+    return (result);
+}
+
+LispObj *
+Lisp_List(LispBuiltin *builtin)
+/*
+ list &rest args
+ */
+{
+    LispObj *args;
+
+    args = ARGUMENT(0);
+
+    return (args);
+}
+
+LispObj *
+Lisp_ListP(LispBuiltin *builtin)
+/*
+ list* object &rest more-objects
+ */
+{
+    GC_ENTER();
+    LispObj *result, *cons;
+
+    LispObj *object, *more_objects;
+
+    more_objects = ARGUMENT(1);
+    object = ARGUMENT(0);
+
+    if (!CONSP(more_objects))
+       return (object);
+
+    result = cons = CONS(object, CAR(more_objects));
+    GC_PROTECT(result);
+    for (more_objects = CDR(more_objects); CONSP(more_objects);
+        more_objects = CDR(more_objects)) {
+       object = CAR(more_objects);
+       RPLACD(cons, CONS(CDR(cons), object));
+       cons = CDR(cons);
+    }
+    GC_LEAVE();
+
+    return (result);
+}
+
+/* "classic" list-length */
+LispObj *
+Lisp_ListLength(LispBuiltin *builtin)
+/*
+ list-length list
+ */
+{
+    long length;
+    LispObj *fast, *slow;
+
+    LispObj *list;
+
+    list = ARGUMENT(0);
+
+    CHECK_LIST(list);
+    for (fast = slow = list, length = 0;
+        CONSP(slow);
+        slow = CDR(slow), length += 2) {
+       if (fast == NIL)
+           break;
+       CHECK_CONS(fast);
+       fast = CDR(fast);
+       if (fast == NIL) {
+           ++length;
+           break;
+       }
+       CHECK_CONS(fast);
+       fast = CDR(fast);
+       if (slow == fast)
+           /* circular list */
+           return (NIL);
+    }
+
+    return (FIXNUM(length));
+}
+
+LispObj *
+Lisp_Listp(LispBuiltin *builtin)
+/*
+ listp object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (object == NIL || CONSP(object) ? T : NIL);
+}
+
+static LispObj *
+LispListSet(LispBuiltin *builtin, int function)
+/*
+ intersection list1 list2 &key test test-not key
+ nintersection list1 list2 &key test test-not key
+ set-difference list1 list2 &key test test-not key
+ nset-difference list1 list2 &key test test-not key
+ set-exclusive-or list1 list2 &key test test-not key
+ nset-exclusive-or list1 list2 &key test test-not key
+ subsetp list1 list2 &key test test-not key
+ union list1 list2 &key test test-not key
+ nunion list1 list2 &key test test-not key
+ */
+{
+    GC_ENTER();
+    int code, expect, value, inplace, check_list2,
+       intersection, setdifference, xunion, setexclusiveor;
+    LispObj *lambda, *result, *cmp, *cmp1, *cmp2,
+           *item, *clist1, *clist2, *cons, *cdr;
+
+    LispObj *list1, *list2, *test, *test_not, *key;
+
+    key = ARGUMENT(4);
+    test_not = ARGUMENT(3);
+    test = ARGUMENT(2);
+    list2 = ARGUMENT(1);
+    list1 = ARGUMENT(0);
+
+    /* Check if arguments are valid lists */
+    CHECK_LIST(list1);
+    CHECK_LIST(list2);
+
+    setdifference = intersection = xunion = setexclusiveor = inplace = 0;
+    switch (function) {
+       case NSETDIFFERENCE:
+           inplace = 1;
+       case SETDIFFERENCE:
+           setdifference = 1;
+           break;
+       case NINTERSECTION:
+           inplace = 1;
+       case INTERSECTION:
+           intersection = 1;
+           break;
+       case NUNION:
+           inplace = 1;
+       case UNION:
+           xunion = 1;
+           break;
+       case NSETEXCLUSIVEOR:
+           inplace = 1;
+       case SETEXCLUSIVEOR:
+           setexclusiveor = 1;
+           break;
+    }
+
+    /* Check for fast return */
+    if (list1 == NIL)
+       return (setdifference || intersection ?
+               NIL : function == SUBSETP ? T : list2);
+    if (list2 == NIL)
+       return (intersection || xunion || function == SUBSETP ? NIL : list1);
+
+    CHECK_TEST();
+    clist1 = cdr = NIL;
+
+    /* Make a copy of list2 with the key predicate applied */
+    if (key != UNSPEC) {
+       result = cons = CONS(APPLY1(key, CAR(list2)), NIL);
+       GC_PROTECT(result);
+       for (cmp2 = CDR(list2); CONSP(cmp2); cmp2 = CDR(cmp2)) {
+           item = APPLY1(key, CAR(cmp2));
+           RPLACD(cons, CONS(APPLY1(key, CAR(cmp2)), NIL));
+           cons = CDR(cons);
+       }
+       /* check if list2 is a proper list */
+       CHECK_LIST(cmp2);
+       clist2 = result;
+       check_list2 = 0;
+    }
+    else {
+       clist2 = list2;
+       check_list2 = 1;
+    }
+    result = cons = NIL;
+
+    /* Compare elements of lists
+     * Logic:
+     *    UNION
+     *         1) Walk list1 and if CAR(list1) not in list2, add it to result
+     *         2) Add list2 to result
+     *    INTERSECTION
+     *         1) Walk list1 and if CAR(list1) in list2, add it to result
+     *    SET-DIFFERENCE
+     *         1) Walk list1 and if CAR(list1) not in list2, add it to result
+     *    SET-EXCLUSIVE-OR
+     *         1) Walk list1 and if CAR(list1) not in list2, add it to result
+     *         2) Walk list2 and if CAR(list2) not in list1, add it to result
+     *    SUBSETP
+     *         1) Walk list1 and if CAR(list1) not in list2, return NIL
+     *         2) Return T
+     */
+    value = 0;
+    for (cmp1 = list1; CONSP(cmp1); cmp1 = CDR(cmp1)) {
+       item = CAR(cmp1);
+
+       /* Apply key predicate if required */
+       if (key != UNSPEC) {
+           cmp = APPLY1(key, item);
+           if (setexclusiveor) {
+               if (clist1 == NIL) {
+                   clist1 = cdr = CONS(cmp, NIL);
+                   GC_PROTECT(clist1);
+               }
+               else {
+                   RPLACD(cdr, CONS(cmp, NIL));
+                   cdr = CDR(cdr);
+               }
+           }
+       }
+       else
+           cmp = item;
+
+       /* Compare against list2 */
+       for (cmp2 = clist2; CONSP(cmp2); cmp2 = CDR(cmp2)) {
+           value = FCOMPARE(lambda, cmp, CAR(cmp2), code);
+           if (value == expect)
+               break;
+       }
+       if (check_list2 && value != expect) {
+           /* check if list2 is a proper list */
+           CHECK_LIST(cmp2);
+           check_list2 = 0;
+       }
+
+       if (function == SUBSETP) {
+           /* Element of list1 not in list2? */
+           if (value != expect) {
+               GC_LEAVE();
+
+               return (NIL);
+           }
+       }
+       /* If need to add item to result */
+       else if (((setdifference || xunion || setexclusiveor) &&
+                 value != expect) ||
+                (intersection && value == expect)) {
+           if (inplace) {
+               if (result == NIL)
+                   result = cons = cmp1;
+               else {
+                   if (setexclusiveor) {
+                       /* don't remove elements yet, will need
+                        * to check agains't list2 later */
+                       for (cmp2 = cons; CDR(cmp2) != cmp1; cmp2 = CDR(cmp2))
+                           ;
+                       if (cmp2 != cons) {
+                           RPLACD(cmp2, list1);
+                           list1 = cmp2;
+                       }
+                   }
+                   RPLACD(cons, cmp1);
+                   cons = cmp1;
+               }
+           }
+           else {
+               if (result == NIL) {
+                   result = cons = CONS(item, NIL);
+                   GC_PROTECT(result);
+               }
+               else {
+                   RPLACD(cons, CONS(item, NIL));
+                   cons = CDR(cons);
+               }
+           }
+       }
+    }
+    /* check if list1 is a proper list */
+    CHECK_LIST(cmp1);
+
+    if (function == SUBSETP) {
+       GC_LEAVE();
+
+       return (T);
+    }
+    else if (xunion) {
+       /* Add list2 to tail of result */
+       if (result == NIL)
+           result = list2;
+       else
+           RPLACD(cons, list2);
+    }
+    else if (setexclusiveor) {
+       LispObj *result2, *cons2;
+
+       result2 = cons2 = NIL;
+       for (cmp2 = list2; CONSP(cmp2); cmp2 = CDR(cmp2)) {
+           item = CAR(cmp2);
+
+           if (key != UNSPEC) {
+               cmp = CAR(clist2);
+               /* XXX changing clist2 */
+               clist2 = CDR(clist2);
+               cmp1 = clist1;
+           }
+           else {
+               cmp = item;
+               cmp1 = list1;
+           }
+
+           /* Compare against list1 */
+           for (; CONSP(cmp1); cmp1 = CDR(cmp1)) {
+               value = FCOMPARE(lambda, cmp, CAR(cmp1), code);
+               if (value == expect)
+                   break;
+           }
+
+           if (value != expect) {
+               if (inplace) {
+                   if (result2 == NIL)
+                       result2 = cons2 = cmp2;
+                   else {
+                       RPLACD(cons2, cmp2);
+                       cons2 = cmp2;
+                   }
+               }
+               else {
+                   if (result == NIL) {
+                       result = cons = CONS(item, NIL);
+                       GC_PROTECT(result);
+                   }
+                   else {
+                       RPLACD(cons, CONS(item, NIL));
+                       cons = CDR(cons);
+                   }
+               }
+           }
+       }
+       if (inplace) {
+           if (CONSP(cons2))
+               RPLACD(cons2, NIL);
+           if (result == NIL)
+               result = result2;
+           else
+               RPLACD(cons, result2);
+       }
+    }
+    else if ((function == NSETDIFFERENCE || function == NINTERSECTION) &&
+            CONSP(cons))
+       RPLACD(cons, NIL);
+
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+Lisp_Loop(LispBuiltin *builtin)
+/*
+ loop &rest body
+ */
+{
+    LispObj *code, *result;
+    LispBlock *block;
+
+    LispObj *body;
+
+    body = ARGUMENT(0);
+
+    result = NIL;
+    block = LispBeginBlock(NIL, LispBlockTag);
+    if (setjmp(block->jmp) == 0) {
+       for (;;)
+           for (code = body; CONSP(code); code = CDR(code))
+               (void)EVAL(CAR(code));
+    }
+    LispEndBlock(block);
+    result = lisp__data.block.block_ret;
+
+    return (result);
+}
+
+/* XXX This function is broken, needs a review
+ (being delayed until true array/vectors be implemented) */
+LispObj *
+Lisp_MakeArray(LispBuiltin *builtin)
+/*
+ make-array dimensions &key element-type initial-element initial-contents
+                           adjustable fill-pointer displaced-to
+                           displaced-index-offset
+ */
+{
+    long rank = 0, count = 1, offset, zero, c;
+    LispObj *obj, *dim, *array;
+    LispType type;
+
+    LispObj *dimensions, *element_type, *initial_element, *initial_contents,
+           *displaced_to, *displaced_index_offset;
+
+    dim = array = NIL;
+    type = LispNil_t;
+
+    displaced_index_offset = ARGUMENT(7);
+    displaced_to = ARGUMENT(6);
+    initial_contents = ARGUMENT(3);
+    initial_element = ARGUMENT(2);
+    element_type = ARGUMENT(1);
+    dimensions = ARGUMENT(0);
+
+    if (INDEXP(dimensions)) {
+       dim = CONS(dimensions, NIL);
+       rank = 1;
+       count = FIXNUM_VALUE(dimensions);
+    }
+    else if (CONSP(dimensions)) {
+       dim = dimensions;
+
+       for (rank = 0; CONSP(dim); rank++, dim = CDR(dim)) {
+           obj = CAR(dim);
+           CHECK_INDEX(obj);
+           count *= FIXNUM_VALUE(obj);
+       }
+       dim = dimensions;
+    }
+    else if (dimensions == NIL) {
+       dim = NIL;
+       rank = count = 0;
+    }
+    else
+       LispDestroy("%s: %s is a bad array dimension",
+                   STRFUN(builtin), STROBJ(dimensions));
+
+    /* check element-type */
+    if (element_type != UNSPEC) {
+       if (element_type == T)
+           type = LispNil_t;
+       else if (!SYMBOLP(element_type))
+           LispDestroy("%s: unsupported element type %s",
+                       STRFUN(builtin), STROBJ(element_type));
+       else {
+           Atom_id atom = ATOMID(element_type);
+
+           if (atom == Satom)
+               type = LispAtom_t;
+           else if (atom == Sinteger)
+               type = LispInteger_t;
+           else if (atom == Scharacter)
+               type = LispSChar_t;
+           else if (atom == Sstring)
+               type = LispString_t;
+           else if (atom == Slist)
+               type = LispCons_t;
+           else if (atom == Sopaque)
+               type = LispOpaque_t;
+           else
+               LispDestroy("%s: unsupported element type %s",
+                           STRFUN(builtin), ATOMID(element_type)->value);
+       }
+    }
+
+    /* check initial-contents */
+    if (rank) {
+       CHECK_LIST(initial_contents);
+    }
+
+    /* check displaced-to */
+    if (displaced_to != UNSPEC) {
+       CHECK_ARRAY(displaced_to);
+    }
+
+    /* check displaced-index-offset */
+    offset = -1;
+    if (displaced_index_offset != UNSPEC) {
+       CHECK_INDEX(displaced_index_offset);
+       offset = FIXNUM_VALUE(displaced_index_offset);
+    }
+
+    c = 0;
+    if (initial_element != UNSPEC)
+       ++c;
+    if (initial_contents != UNSPEC)
+       ++c;
+    if (displaced_to != UNSPEC || offset >= 0)
+       ++c;
+    if (c > 1)
+       LispDestroy("%s: more than one initialization specified",
+                   STRFUN(builtin));
+    if (initial_element == UNSPEC)
+       initial_element = NIL;
+
+    zero = count == 0;
+    if (displaced_to != UNSPEC) {
+       CHECK_ARRAY(displaced_to);
+       if (offset < 0)
+           offset = 0;
+       for (c = 1, obj = displaced_to->data.array.dim; obj != NIL;
+            obj = CDR(obj))
+           c *= FIXNUM_VALUE(CAR(obj));
+       if (c < count + offset)
+           LispDestroy("%s: array-total-size + displaced-index-offset "
+                       "exceeds total size", STRFUN(builtin));
+       for (c = 0, array = displaced_to->data.array.list; c < offset; c++)
+           array = CDR(array);
+    }
+    else if (initial_contents != UNSPEC) {
+       CHECK_CONS(initial_contents);
+       if (rank == 0)
+           array = initial_contents;
+       else if (rank == 1) {
+           for (array = initial_contents, c = 0; c < count;
+                array = CDR(array), c++)
+               if (!CONSP(array))
+                   LispDestroy("%s: bad argument or size %s",
+                               STRFUN(builtin), STROBJ(array));
+           if (array != NIL)
+               LispDestroy("%s: bad argument or size %s",
+                           STRFUN(builtin), STROBJ(array));
+           array = initial_contents;
+       }
+       else {
+           LispObj *err = NIL;
+           /* check if list matches */
+           int i, j, k, *dims, *loop;
+
+           /* create iteration variables */
+           dims = LispMalloc(sizeof(int) * rank);
+           loop = LispCalloc(1, sizeof(int) * (rank - 1));
+           for (i = 0, obj = dim; CONSP(obj); i++, obj = CDR(obj))
+               dims[i] = FIXNUM_VALUE(CAR(obj));
+
+           /* check if list matches specified dimensions */
+           while (loop[0] < dims[0]) {
+               for (obj = initial_contents, i = 0; i < rank - 1; i++) {
+                   for (j = 0; j < loop[i]; j++)
+                       obj = CDR(obj);
+                   err = obj;
+                   if (!CONSP(obj = CAR(obj)))
+                       goto make_array_error;
+                   err = obj;
+               }
+               --i;
+               for (;;) {
+                   ++loop[i];
+                   if (i && loop[i] >= dims[i])
+                       loop[i] = 0;
+                   else
+                       break;
+                   --i;
+               }
+               for (k = 0; k < dims[rank - 1]; obj = CDR(obj), k++) {
+                   if (!CONSP(obj))
+                       goto make_array_error;
+               }
+               if (obj == NIL)
+                   continue;
+make_array_error:
+               LispFree(dims);
+               LispFree(loop);
+               LispDestroy("%s: bad argument or size %s",
+                           STRFUN(builtin), STROBJ(err));
+           }
+
+           /* list is correct, use it to fill initial values */
+
+           /* reset loop */
+           memset(loop, 0, sizeof(int) * (rank - 1));
+
+           GCDisable();
+           /* fill array with supplied values */
+           array = NIL;
+           while (loop[0] < dims[0]) {
+               for (obj = initial_contents, i = 0; i < rank - 1; i++) {
+                   for (j = 0; j < loop[i]; j++)
+                       obj = CDR(obj);
+                   obj = CAR(obj);
+               }
+               --i;
+               for (;;) {
+                   ++loop[i];
+                   if (i && loop[i] >= dims[i])
+                       loop[i] = 0;
+                   else
+                       break;
+                   --i;
+               }
+               for (k = 0; k < dims[rank - 1]; obj = CDR(obj), k++) {
+                   if (array == NIL)
+                       array = CONS(CAR(obj), NIL);
+                   else {
+                       RPLACD(array, CONS(CAR(array), CDR(array)));
+                       RPLACA(array, CAR(obj));
+                   }
+               }
+           }
+           LispFree(dims);
+           LispFree(loop);
+           array = LispReverse(array);
+           GCEnable();
+       }
+    }
+    else {
+       GCDisable();
+       /* allocate array */
+       if (count) {
+           --count;
+           array = CONS(initial_element, NIL);
+           while (count) {
+               RPLACD(array, CONS(CAR(array), CDR(array)));
+               RPLACA(array, initial_element);
+               count--;
+           }
+       }
+       GCEnable();
+    }
+
+    obj = LispNew(array, dim);
+    obj->type = LispArray_t;
+    obj->data.array.list = array;
+    obj->data.array.dim = dim;
+    obj->data.array.rank = rank;
+    obj->data.array.type = type;
+    obj->data.array.zero = zero;
+
+    return (obj);
+}
+
+LispObj *
+Lisp_MakeList(LispBuiltin *builtin)
+/*
+ make-list size &key initial-element
+ */
+{
+    GC_ENTER();
+    long count;
+    LispObj *result, *cons;
+
+    LispObj *size, *initial_element;
+
+    initial_element = ARGUMENT(1);
+    size = ARGUMENT(0);
+
+    CHECK_INDEX(size);
+    count = FIXNUM_VALUE(size);
+
+    if (count == 0)
+       return (NIL);
+    if (initial_element == UNSPEC)
+       initial_element = NIL;
+
+    result = cons = CONS(initial_element, NIL);
+    GC_PROTECT(result);
+    for (; count > 1; count--) {
+       RPLACD(cons, CONS(initial_element, NIL));
+       cons = CDR(cons);
+    }
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+Lisp_MakeSymbol(LispBuiltin *builtin)
+/*
+ make-symbol name
+ */
+{
+    LispObj *name, *symbol;
+
+    name = ARGUMENT(0);
+    CHECK_STRING(name);
+
+    symbol = UNINTERNED_ATOM(THESTR(name));
+    symbol->data.atom->unreadable = !LispCheckAtomString(THESTR(name));
+
+    return (symbol);
+}
+
+LispObj *
+Lisp_Makunbound(LispBuiltin *builtin)
+/*
+ makunbound symbol
+ */
+{
+    LispObj *symbol;
+
+    symbol = ARGUMENT(0);
+
+    CHECK_SYMBOL(symbol);
+    LispUnsetVar(symbol);
+
+    return (symbol);
+}
+
+LispObj *
+Lisp_Mapc(LispBuiltin *builtin)
+/*
+ mapc function list &rest more-lists
+ */
+{
+    return (LispMapc(builtin, 0));
+}
+
+LispObj *
+Lisp_Mapcar(LispBuiltin *builtin)
+/*
+ mapcar function list &rest more-lists
+ */
+{
+    return (LispMapc(builtin, 1));
+}
+
+/* Like nconc but ignore non list arguments */
+LispObj *
+LispMapnconc(LispObj *list)
+{
+    LispObj *result = NIL;
+
+    if (CONSP(list)) {
+       LispObj *cons, *head, *tail;
+
+       cons = NIL;
+       for (; CONSP(CDR(list)); list = CDR(list)) {
+           head = CAR(list);
+           if (CONSP(head)) {
+               for (tail = head; CONSP(CDR(tail)); tail = CDR(tail))
+                   ;
+               if (cons != NIL)
+                   RPLACD(cons, head);
+               else
+                   result = head;
+               cons = tail;
+           }
+       }
+       head = CAR(list);
+       if (CONSP(head)) {
+           if (cons != NIL)
+               RPLACD(cons, head);
+           else
+               result = head;
+       }
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Mapcan(LispBuiltin *builtin)
+/*
+ mapcan function list &rest more-lists
+ */
+{
+    return (LispMapnconc(LispMapc(builtin, 1)));
+}
+
+static LispObj *
+LispMapc(LispBuiltin *builtin, int mapcar)
+{
+    GC_ENTER();
+    long i, offset, count, length;
+    LispObj *result = NIL, *cons, *arguments, *acons, *rest, *alist, *value;
+    LispObj *stk[8], **cdrs;
+
+    LispObj *function, *list, *more_lists;
+
+    more_lists = ARGUMENT(2);
+    list = ARGUMENT(1);
+    function = ARGUMENT(0);
+
+    /* Result will be no longer than this */
+    for (length = 0, alist = list; CONSP(alist); length++, alist = CDR(alist))
+       ;
+
+    /* If first argument is not a list... */
+    if (length == 0)
+       return (NIL);
+
+    /* At least one argument will be passed to function, count how many
+     * extra arguments will be used, and calculate result length. */
+    count = 0;
+    for (rest = more_lists; CONSP(rest); rest = CDR(rest), count++) {
+
+       /* Check if extra list is really a list, and if it is smaller
+        * than the first list */
+       for (i = 0, alist = CAR(rest);
+            i < length && CONSP(alist);
+            i++, alist = CDR(alist))
+           ;
+
+       /* If it is not a true list */
+       if (i == 0)
+           return (NIL);
+
+       /* If it is smaller than the currently calculated result length */
+       if (i < length)
+           length = i;
+    }
+
+    if (mapcar) {
+       /* Initialize gc protected object cells for resulting list */
+       result = cons = CONS(NIL, NIL);
+       GC_PROTECT(result);
+    }
+    else
+       result = cons = list;
+
+    if (count >= sizeof(stk) / sizeof(stk[0]))
+       cdrs = LispMalloc(count * sizeof(LispObj*));
+    else
+       cdrs = &stk[0];
+    for (i = 0, rest = more_lists; i < count; i++, rest = CDR(rest))
+       cdrs[i] = CAR(rest);
+
+    /* Initialize gc protected object cells for argument list */
+    arguments = acons = CONS(NIL, NIL);
+    GC_PROTECT(arguments);
+
+    /* Allocate space for extra arguments */
+    for (i = 0; i < count; i++) {
+       RPLACD(acons, CONS(NIL, NIL));
+       acons = CDR(acons);
+    }
+
+    /* For every element of the list that will be used */
+    for (offset = 0;; list = CDR(list)) {
+       acons = arguments;
+
+       /* Add first argument */
+       RPLACA(acons, CAR(list));
+       acons = CDR(acons);
+
+       /* For every extra list argument */
+       for (i = 0; i < count; i++) {
+           alist = cdrs[i];
+           cdrs[i] = CDR(cdrs[i]);
+
+           /* Add element to argument list */
+           RPLACA(acons, CAR(alist));
+           acons = CDR(acons);
+       }
+
+       value = APPLY(function, arguments);
+
+       if (mapcar) {
+           /* Store result */
+           RPLACA(cons, value);
+
+           /* Allocate new result cell */
+           if (++offset < length) {
+               RPLACD(cons, CONS(NIL, NIL));
+               cons = CDR(cons);
+           }
+           else
+               break;
+       }
+       else if (++offset >= length)
+           break;
+    }
+
+    /* Unprotect argument and result list */
+    GC_LEAVE();
+    if (cdrs != &stk[0])
+       LispFree(cdrs);
+
+    return (result);
+}
+
+static LispObj *
+LispMapl(LispBuiltin *builtin, int maplist)
+{
+    GC_ENTER();
+    long i, offset, count, length;
+    LispObj *result = NIL, *cons, *arguments, *acons, *rest, *alist, *value;
+    LispObj *stk[8], **cdrs;
+
+    LispObj *function, *list, *more_lists;
+
+    more_lists = ARGUMENT(2);
+    list = ARGUMENT(1);
+    function = ARGUMENT(0);
+
+    /* count is the number of lists, length is the length of the result */
+    for (length = 0, alist = list; CONSP(alist); length++, alist = CDR(alist))
+       ;
+
+    /* first argument is not a list */
+    if (length == 0)
+       return (NIL);
+
+    /* check remaining arguments */
+    for (count = 0, rest = more_lists; CONSP(rest); rest = CDR(rest), count++) {
+       for (i = 0, alist = CAR(rest);
+            i < length && CONSP(alist);
+            i++, alist = CDR(alist))
+           ;
+       /* argument is not a list */
+       if (i == 0)
+           return (NIL);
+       /* result will have the length of the smallest list */
+       if (i < length)
+           length = i;
+    }
+
+    /* result will be a list */
+    if (maplist) {
+       result = cons = CONS(NIL, NIL);
+       GC_PROTECT(result);
+    }
+    else
+       result = cons = list;
+
+    if (count >= sizeof(stk) / sizeof(stk[0]))
+       cdrs = LispMalloc(count * sizeof(LispObj*));
+    else
+       cdrs = &stk[0];
+    for (i = 0, rest = more_lists; i < count; i++, rest = CDR(rest))
+       cdrs[i] = CAR(rest);
+
+    /* initialize argument list */
+    arguments = acons = CONS(NIL, NIL);
+    GC_PROTECT(arguments);
+    for (i = 0; i < count; i++) {
+       RPLACD(acons, CONS(NIL, NIL));
+       acons = CDR(acons);
+    }
+
+    /* for every used list element */
+    for (offset = 0;; list = CDR(list)) {
+       acons = arguments;
+
+       /* first argument */
+       RPLACA(acons, list);
+       acons = CDR(acons);
+
+       /* for every extra list */
+       for (i = 0; i < count; i++) {
+           RPLACA(acons, cdrs[i]);
+           cdrs[i] = CDR(cdrs[i]);
+           acons = CDR(acons);
+       }
+
+       value = APPLY(function, arguments);
+
+       if (maplist) {
+           /* store result */
+           RPLACA(cons, value);
+
+           /* allocate new cell */
+           if (++offset < length) {
+               RPLACD(cons, CONS(NIL, NIL));
+               cons = CDR(cons);
+           }
+           else
+               break;
+       }
+       else if (++offset >= length)
+           break;
+    }
+
+    GC_LEAVE();
+    if (cdrs != &stk[0])
+       LispFree(cdrs);
+
+    return (result);
+}
+
+LispObj *
+Lisp_Mapl(LispBuiltin *builtin)
+/*
+ mapl function list &rest more-lists
+ */
+{
+    return (LispMapl(builtin, 0));
+}
+
+LispObj *
+Lisp_Maplist(LispBuiltin *builtin)
+/*
+ maplist function list &rest more-lists
+ */
+{
+    return (LispMapl(builtin, 1));
+}
+
+LispObj *
+Lisp_Mapcon(LispBuiltin *builtin)
+/*
+ mapcon function list &rest more-lists
+ */
+{
+    return (LispMapnconc(LispMapl(builtin, 1)));
+}
+
+LispObj *
+Lisp_Member(LispBuiltin *builtin)
+/*
+ member item list &key test test-not key
+ */
+{
+    int code, expect;
+    LispObj *compare, *lambda;
+    LispObj *item, *list, *test, *test_not, *key;
+
+    key = ARGUMENT(4);
+    test_not = ARGUMENT(3);
+    test = ARGUMENT(2);
+    list = ARGUMENT(1);
+    item = ARGUMENT(0);
+
+    if (list == NIL)
+       return (NIL);
+    CHECK_CONS(list);
+
+    CHECK_TEST();
+    if (key == UNSPEC) {
+       if (code == FEQ) {
+           for (; CONSP(list); list = CDR(list))
+               if (item == CAR(list))
+                   return (list);
+       }
+       else {
+           for (; CONSP(list); list = CDR(list))
+               if ((FCOMPARE(lambda, item, CAR(list), code)) == expect)
+                   return (list);
+       }
+    }
+    else {
+       if (code == FEQ) {
+           for (; CONSP(list); list = CDR(list))
+               if (item == APPLY1(key, CAR(list)))
+                   return (list);
+       }
+       else {
+           for (; CONSP(list); list = CDR(list)) {
+               compare = APPLY1(key, CAR(list));
+               if ((FCOMPARE(lambda, item, compare, code)) == expect)
+                   return (list);
+           }
+       }
+    }
+    /* check if is a proper list */
+    CHECK_LIST(list);
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_MemberIf(LispBuiltin *builtin)
+/*
+ member-if predicate list &key key
+ */
+{
+    return (LispAssocOrMember(builtin, MEMBER, IF));
+}
+
+LispObj *
+Lisp_MemberIfNot(LispBuiltin *builtin)
+/*
+ member-if-not predicate list &key key
+ */
+{
+    return (LispAssocOrMember(builtin, MEMBER, IFNOT));
+}
+
+LispObj *
+Lisp_MultipleValueBind(LispBuiltin *builtin)
+/*
+ multiple-value-bind symbols values &rest body
+ */
+{
+    int i, head = lisp__data.env.length;
+    LispObj *result, *symbol, *value;
+
+    LispObj *symbols, *values, *body;
+
+    body = ARGUMENT(2);
+    values = ARGUMENT(1);
+    symbols = ARGUMENT(0);
+
+    result = EVAL(values);
+    for (i = -1; CONSP(symbols); symbols = CDR(symbols), i++) {
+       symbol = CAR(symbols);
+       CHECK_SYMBOL(symbol);
+       CHECK_CONSTANT(symbol);
+       if (i >= 0 && i < RETURN_COUNT)
+           value = RETURN(i);
+       else if (i < 0)
+           value = result;
+       else
+           value = NIL;
+       LispAddVar(symbol, value);
+       ++lisp__data.env.head;
+    }
+
+    /* Execute code with binded variables (if any) */
+    for (result = NIL; CONSP(body); body = CDR(body))
+       result = EVAL(CAR(body));
+
+    lisp__data.env.head = lisp__data.env.length = head;
+
+    return (result);
+}
+
+LispObj *
+Lisp_MultipleValueCall(LispBuiltin *builtin)
+/*
+ multiple-value-call function &rest form
+ */
+{
+    GC_ENTER();
+    int i;
+    LispObj *arguments, *cons, *result;
+
+    LispObj *function, *form;
+
+    form = ARGUMENT(1);
+    function = ARGUMENT(0);
+
+    /* build argument list */
+    arguments = cons = NIL;
+    for (; CONSP(form); form = CDR(form)) {
+       RETURN_COUNT = 0;
+       result = EVAL(CAR(form));
+       if (RETURN_COUNT >= 0) {
+           if (arguments == NIL) {
+               arguments = cons = CONS(result, NIL);
+               GC_PROTECT(arguments);
+           }
+           else {
+               RPLACD(cons, CONS(result, NIL));
+               cons = CDR(cons);
+           }
+           for (i = 0; i < RETURN_COUNT; i++) {
+               RPLACD(cons, CONS(RETURN(i), NIL));
+               cons = CDR(cons);
+           }
+       }
+    }
+
+    /* apply function */
+    if (POINTERP(function) && !XSYMBOLP(function) && !XFUNCTIONP(function)) {
+       function = EVAL(function);
+       GC_PROTECT(function);
+    }
+    result = APPLY(function, arguments);
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+Lisp_MultipleValueProg1(LispBuiltin *builtin)
+/*
+ multiple-value-prog1 first-form &rest form
+ */
+{
+    GC_ENTER();
+    int i, count;
+    LispObj *values, *cons;
+
+    LispObj *first_form, *form;
+
+    form = ARGUMENT(1);
+    first_form = ARGUMENT(0);
+
+    values = EVAL(first_form);
+    if (!CONSP(form))
+       return (values);
+
+    cons = NIL;
+    count = RETURN_COUNT;
+    if (count < 0)
+       values = NIL;
+    else if (count == 0) {
+       GC_PROTECT(values);
+    }
+    else {
+       values = cons = CONS(values, NIL);
+       GC_PROTECT(values);
+       for (i = 0; i < count; i++) {
+           RPLACD(cons, CONS(RETURN(i), NIL));
+           cons = CDR(cons);
+       }
+    }
+
+    for (; CONSP(form); form = CDR(form))
+       EVAL(CAR(form));
+
+    RETURN_COUNT = count;
+    if (count > 0) {
+       for (i = 0, cons = CDR(values); CONSP(cons); cons = CDR(cons), i++)
+           RETURN(i) = CAR(cons);
+       values = CAR(values);
+    }
+    GC_LEAVE();
+
+    return (values);
+}
+
+LispObj *
+Lisp_MultipleValueList(LispBuiltin *builtin)
+/*
+ multiple-value-list form
+ */
+{
+    int i;
+    GC_ENTER();
+    LispObj *form, *result, *cons;
+
+    form = ARGUMENT(0);
+
+    result = EVAL(form);
+
+    if (RETURN_COUNT < 0)
+       return (NIL);
+
+    result = cons = CONS(result, NIL);
+    GC_PROTECT(result);
+    for (i = 0; i < RETURN_COUNT; i++) {
+       RPLACD(cons, CONS(RETURN(i), NIL));
+       cons = CDR(cons);
+    }
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+Lisp_MultipleValueSetq(LispBuiltin *builtin)
+/*
+ multiple-value-setq symbols form
+ */
+{
+    int i;
+    LispObj *result, *symbol, *value;
+
+    LispObj *symbols, *form;
+
+    form = ARGUMENT(1);
+    symbols = ARGUMENT(0);
+
+    CHECK_LIST(symbols);
+    result = EVAL(form);
+    if (CONSP(symbols)) {
+       symbol = CAR(symbols);
+       CHECK_SYMBOL(symbol);
+       CHECK_CONSTANT(symbol);
+       LispSetVar(symbol, result);
+       symbols = CDR(symbols);
+    }
+    for (i = 0; CONSP(symbols); symbols = CDR(symbols), i++) {
+       symbol = CAR(symbols);
+       CHECK_SYMBOL(symbol);
+       CHECK_CONSTANT(symbol);
+       if (i < RETURN_COUNT && RETURN_COUNT > 0)
+           value = RETURN(i);
+       else
+           value = NIL;
+       LispSetVar(symbol, value);
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Nconc(LispBuiltin *builtin)
+/*
+ nconc &rest lists
+ */
+{
+    LispObj *list, *lists, *cons, *head, *tail;
+
+    lists = ARGUMENT(0);
+
+    /* skip any initial empty lists */
+    for (; CONSP(lists); lists = CDR(lists))
+       if (CAR(lists) != NIL)
+           break;
+
+    /* don't check if a proper list */
+    if (!CONSP(lists))
+       return (lists);
+
+    /* setup to concatenate lists */
+    list = CAR(lists);
+    CHECK_CONS(list);
+    for (cons = list; CONSP(CDR(cons)); cons = CDR(cons))
+       ;
+
+    /* if only two lists */
+    lists = CDR(lists);
+    if (!CONSP(lists)) {
+       RPLACD(cons, lists);
+
+       return (list);
+    }
+
+    /* concatenate */
+    for (; CONSP(CDR(lists)); lists = CDR(lists)) {
+       head = CAR(lists);
+       if (head == NIL)
+           continue;
+       CHECK_CONS(head);
+       for (tail = head; CONSP(CDR(tail)); tail = CDR(tail))
+           ;
+       RPLACD(cons, head);
+       cons = tail;
+    }
+    /* add last list */
+    RPLACD(cons, CAR(lists));
+
+    return (list);
+}
+
+LispObj *
+Lisp_Nreverse(LispBuiltin *builtin)
+/*
+ nreverse sequence
+ */
+{
+    return (LispXReverse(builtin, 1));
+}
+
+LispObj *
+Lisp_NsetDifference(LispBuiltin *builtin)
+/*
+ nset-difference list1 list2 &key test test-not key
+ */
+{
+    return (LispListSet(builtin, NSETDIFFERENCE));
+}
+
+LispObj *
+Lisp_Nsubstitute(LispBuiltin *builtin)
+/*
+ nsubstitute newitem olditem sequence &key from-end test test-not start end count key
+ */
+{
+    return (LispDeleteRemoveXSubstitute(builtin, NSUBSTITUTE, NONE));
+}
+
+LispObj *
+Lisp_NsubstituteIf(LispBuiltin *builtin)
+/*
+ nsubstitute-if newitem test sequence &key from-end start end count key
+ */
+{
+    return (LispDeleteRemoveXSubstitute(builtin, NSUBSTITUTE, IF));
+}
+
+LispObj *
+Lisp_NsubstituteIfNot(LispBuiltin *builtin)
+/*
+ nsubstitute-if-not newitem test sequence &key from-end start end count key
+ */
+{
+    return (LispDeleteRemoveXSubstitute(builtin, NSUBSTITUTE, IFNOT));
+}
+
+LispObj *
+Lisp_Nth(LispBuiltin *builtin)
+/*
+ nth index list
+ */
+{
+    long position;
+    LispObj *oindex, *list;
+
+    list = ARGUMENT(1);
+    oindex = ARGUMENT(0);
+
+    CHECK_INDEX(oindex);
+    position = FIXNUM_VALUE(oindex);
+
+    if (list == NIL)
+       return (NIL);
+
+    CHECK_CONS(list);
+    for (; position > 0; position--) {
+       if (!CONSP(list))
+           return (NIL);
+       list = CDR(list);
+    }
+
+    return (CONSP(list) ? CAR(list) : NIL);
+}
+
+LispObj *
+Lisp_Nthcdr(LispBuiltin *builtin)
+/*
+ nthcdr index list
+ */
+{
+    long position;
+    LispObj *oindex, *list;
+
+    list = ARGUMENT(1);
+    oindex = ARGUMENT(0);
+
+    CHECK_INDEX(oindex);
+    position = FIXNUM_VALUE(oindex);
+
+    if (list == NIL)
+       return (NIL);
+    CHECK_CONS(list);
+
+    for (; position > 0; position--) {
+       if (!CONSP(list))
+           return (NIL);
+       list = CDR(list);
+    }
+
+    return (list);
+}
+
+LispObj *
+Lisp_NthValue(LispBuiltin *builtin)
+/*
+ nth-value index form
+ */
+{
+    long i;
+    LispObj *oindex, *form, *result;
+
+    form = ARGUMENT(1);
+    oindex = ARGUMENT(0);
+
+    oindex = EVAL(oindex);
+    CHECK_INDEX(oindex);
+    i = FIXNUM_VALUE(oindex) - 1;
+
+    result = EVAL(form);
+    if (RETURN_COUNT < 0 || i >= RETURN_COUNT)
+       result = NIL;
+    else if (i >= 0)
+       result = RETURN(i);
+
+    return (result);
+}
+
+LispObj *
+Lisp_Null(LispBuiltin *builtin)
+/*
+ null list
+ */
+{
+    LispObj *list;
+
+    list = ARGUMENT(0);
+
+    return (list == NIL ? T : NIL);
+}
+
+LispObj *
+Lisp_Or(LispBuiltin *builtin)
+/*
+ or &rest args
+ */
+{
+    LispObj *result = NIL, *args;
+
+    args = ARGUMENT(0);
+
+    for (; CONSP(args); args = CDR(args)) {
+       result = EVAL(CAR(args));
+       if (result != NIL)
+           break;
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Pairlis(LispBuiltin *builtin)
+/*
+ pairlis key data &optional alist
+ */
+{
+    LispObj *result, *cons;
+
+    LispObj *key, *data, *alist;
+
+    alist = ARGUMENT(2);
+    data = ARGUMENT(1);
+    key = ARGUMENT(0);
+
+    if (CONSP(key) && CONSP(data)) {
+       GC_ENTER();
+
+       result = cons = CONS(CONS(CAR(key), CAR(data)), NIL);
+       GC_PROTECT(result);
+       key = CDR(key);
+       data = CDR(data);
+       for (; CONSP(key) && CONSP(data); key = CDR(key), data = CDR(data)) {
+           RPLACD(cons, CONS(CONS(CAR(key), CAR(data)), NIL));
+           cons = CDR(cons);
+       }
+       if (CONSP(key) || CONSP(data))
+           LispDestroy("%s: different length lists", STRFUN(builtin));
+       GC_LEAVE();
+       if (alist != UNSPEC)
+           RPLACD(cons, alist);
+    }
+    else
+       result = alist == UNSPEC ? NIL : alist;
+
+    return (result);
+}
+
+static LispObj *
+LispFindOrPosition(LispBuiltin *builtin,
+                  int function, int comparison)
+/*
+ find item sequence &key from-end test test-not start end key
+ find-if predicate sequence &key from-end start end key
+ find-if-not predicate sequence &key from-end start end key
+ position item sequence &key from-end test test-not start end key
+ position-if predicate sequence &key from-end start end key
+ position-if-not predicate sequence &key from-end start end key
+ */
+{
+    int code = 0, istring, expect, value;
+    char *string = NULL;
+    long offset = -1, start, end, length, i = comparison == NONE ? 7 : 5;
+    LispObj *cmp, *element, **objects = NULL;
+
+    LispObj *item, *predicate, *sequence, *from_end,
+           *test, *test_not, *ostart, *oend, *key;
+
+    key = ARGUMENT(i);         --i;
+    oend = ARGUMENT(i);                --i;
+    ostart = ARGUMENT(i);      --i;
+    if (comparison == NONE) {
+       test_not = ARGUMENT(i); --i;
+       test = ARGUMENT(i);     --i;
+    }
+    else
+       test_not = test = UNSPEC;
+    from_end = ARGUMENT(i);    --i;
+    if (from_end == UNSPEC)
+       from_end = NIL;
+    sequence = ARGUMENT(i);    --i;
+    if (comparison == NONE) {
+       item = ARGUMENT(i);
+       predicate = Oeql;
+    }
+    else {
+       predicate = ARGUMENT(i);
+       item = NIL;
+    }
+
+    LispCheckSequenceStartEnd(builtin, sequence, ostart, oend,
+                             &start, &end, &length);
+
+    if (sequence == NIL)
+       return (NIL);
+
+    /* Cannot specify both :test and :test-not */
+    if (test != UNSPEC && test_not != UNSPEC)
+       LispDestroy("%s: specify either :TEST or :TEST-NOT", STRFUN(builtin));
+
+    expect = 1;
+    if (comparison == NONE) {
+       if (test != UNSPEC)
+           predicate = test;
+       else if (test_not != UNSPEC) {
+           predicate = test_not;
+           expect = 0;
+       }
+       FUNCTION_CHECK(predicate);
+       code = FCODE(predicate);
+    }
+
+    cmp = element = NIL;
+    istring = STRINGP(sequence);
+    if (istring)
+       string = THESTR(sequence);
+    else {
+       if (!CONSP(sequence))
+           sequence = sequence->data.array.list;
+       for (i = 0; i < start; i++)
+           sequence = CDR(sequence);
+    }
+
+    if ((length = end - start) == 0)
+       return (NIL);
+
+    if (from_end != NIL && !istring) {
+       objects = LispMalloc(sizeof(LispObj*) * length);
+       for (i = length - 1; i >= 0; i--, sequence = CDR(sequence))
+           objects[i] = CAR(sequence);
+    }
+
+    for (i = 0; i < length; i++) {
+       if (istring)
+           element = SCHAR(string[from_end == NIL ? i + start : end - i - 1]);
+       else
+           element = from_end == NIL ? CAR(sequence) : objects[i];
+
+       if (key != UNSPEC)
+           cmp = APPLY1(key, element);
+       else
+           cmp = element;
+
+       /* Update list */
+       if (!istring && from_end == NIL)
+           sequence = CDR(sequence);
+
+       if (comparison == NONE)
+           value = FCOMPARE(predicate, item, cmp, code);
+       else
+           value = APPLY1(predicate, cmp) != NIL;
+
+       if ((!value &&
+            (comparison == IFNOT ||
+             (comparison == NONE && !expect))) ||
+           (value &&
+            (comparison == IF ||
+             (comparison == NONE && expect)))) {
+           offset = from_end == NIL ? i + start : end - i - 1;
+           break;
+       }
+    }
+
+    if (from_end != NIL && !istring)
+       LispFree(objects);
+
+    return (offset == -1 ? NIL : function == FIND ? element : FIXNUM(offset));
+}
+
+LispObj *
+Lisp_Pop(LispBuiltin *builtin)
+/*
+ pop place
+ */
+{
+    LispObj *result, *value;
+
+    LispObj *place;
+
+    place = ARGUMENT(0);
+
+    if (SYMBOLP(place)) {
+       result = LispGetVar(place);
+       if (result == NULL)
+           LispDestroy("EVAL: the variable %s is unbound", STROBJ(place));
+       CHECK_CONSTANT(place);
+       if (result != NIL) {
+           CHECK_CONS(result);
+           value = CDR(result);
+           result = CAR(result);
+       }
+       else
+           value = NIL;
+       LispSetVar(place, value);
+    }
+    else {
+       GC_ENTER();
+       LispObj quote;
+
+       result = EVAL(place);
+       if (result != NIL) {
+           CHECK_CONS(result);
+           value = CDR(result);
+           GC_PROTECT(value);
+           result = CAR(result);
+       }
+       else
+           value = NIL;
+       quote.type = LispQuote_t;
+       quote.data.quote = value;
+       APPLY2(Osetf, place, &quote);
+       GC_LEAVE();
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Position(LispBuiltin *builtin)
+/*
+ position item sequence &key from-end test test-not start end key
+ */
+{
+    return (LispFindOrPosition(builtin, POSITION, NONE));
+}
+
+LispObj *
+Lisp_PositionIf(LispBuiltin *builtin)
+/*
+ position-if predicate sequence &key from-end start end key
+ */
+{
+    return (LispFindOrPosition(builtin, POSITION, IF));
+}
+
+LispObj *
+Lisp_PositionIfNot(LispBuiltin *builtin)
+/*
+ position-if-not predicate sequence &key from-end start end key
+ */
+{
+    return (LispFindOrPosition(builtin, POSITION, IFNOT));
+}
+
+LispObj *
+Lisp_Proclaim(LispBuiltin *builtin)
+/*
+ proclaim declaration
+ */
+{
+    LispObj *arguments, *object;
+    char *operation;
+
+    LispObj *declaration;
+
+    declaration = ARGUMENT(0);
+
+    CHECK_CONS(declaration);
+
+    arguments = declaration;
+    object = CAR(arguments);
+    CHECK_SYMBOL(object);
+
+    operation = ATOMID(object)->value;
+    if (strcmp(operation, "SPECIAL") == 0) {
+       for (arguments = CDR(arguments); CONSP(arguments);
+            arguments = CDR(arguments)) {
+           object = CAR(arguments);
+           CHECK_SYMBOL(object);
+           LispProclaimSpecial(object, NULL, NIL);
+       }
+    }
+    else if (strcmp(operation, "TYPE") == 0) {
+       /* XXX no type checking yet, but should be added */
+    }
+    /* else do nothing */
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_Prog1(LispBuiltin *builtin)
+/*
+ prog1 first &rest body
+ */
+{
+    GC_ENTER();
+    LispObj *result;
+
+    LispObj *first, *body;
+
+    body = ARGUMENT(1);
+    first = ARGUMENT(0);
+
+    result = EVAL(first);
+
+    GC_PROTECT(result);
+    for (; CONSP(body); body = CDR(body))
+       (void)EVAL(CAR(body));
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+Lisp_Prog2(LispBuiltin *builtin)
+/*
+ prog2 first second &rest body
+ */
+{
+    GC_ENTER();
+    LispObj *result;
+
+    LispObj *first, *second, *body;
+
+    body = ARGUMENT(2);
+    second = ARGUMENT(1);
+    first = ARGUMENT(0);
+
+    (void)EVAL(first);
+    result = EVAL(second);
+    GC_PROTECT(result);
+    for (; CONSP(body); body = CDR(body))
+       (void)EVAL(CAR(body));
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+Lisp_Progn(LispBuiltin *builtin)
+/*
+ progn &rest body
+ */
+{
+    LispObj *result = NIL;
+
+    LispObj *body;
+
+    body = ARGUMENT(0);
+
+    for (; CONSP(body); body = CDR(body))
+       result = EVAL(CAR(body));
+
+    return (result);
+}
+
+/*
+ *  This does what I believe is the expected behaviour (or at least
+ * acceptable for the the interpreter), if the code being executed
+ * ever tries to change/bind a progv symbol, the symbol state will
+ * be restored when exiting the progv block, so, code like:
+ *     (progv '(*x*) '(1) (defvar *x* 10))
+ * when exiting the block, will have *x* unbound, and not a dynamic
+ * symbol; if it was already bound, will have the old value.
+ *  Symbols already dynamic can be freely changed, even unbounded in
+ * the progv block.
+ */
+LispObj *
+Lisp_Progv(LispBuiltin *builtin)
+/*
+ progv symbols values &rest body
+ */
+{
+    GC_ENTER();
+    int head = lisp__data.env.length, i, count, ostk[32], *offsets;
+    LispObj *result, *list, *symbol, *value;
+    int jumped;
+    char fstk[32], *flags;
+    LispBlock *block;
+    LispAtom *atom;
+
+    LispObj *symbols, *values, *body;
+
+    /* Possible states */
+#define DYNAMIC_SYMBOL         1
+#define GLOBAL_SYMBOL          2
+#define UNBOUND_SYMBOL         3
+
+    body = ARGUMENT(2);
+    values = ARGUMENT(1);
+    symbols = ARGUMENT(0);
+
+    /* get symbol names */
+    symbols = EVAL(symbols);
+    GC_PROTECT(symbols);
+
+    /* get symbol values */
+    values = EVAL(values);
+    GC_PROTECT(values);
+
+    /* count/check symbols and allocate space to remember symbol state */
+    for (count = 0, list = symbols; CONSP(list); count++, list = CDR(list)) {
+       symbol = CAR(list);
+       CHECK_SYMBOL(symbol);
+       CHECK_CONSTANT(symbol);
+    }
+    if (count > sizeof(fstk)) {
+       flags = LispMalloc(count);
+       offsets = LispMalloc(count * sizeof(int));
+    }
+    else {
+       flags = &fstk[0];
+       offsets = &ostk[0];
+    }
+
+    /* store flags and save old value if required */
+    for (i = 0, list = symbols; i < count; i++, list = CDR(list)) {
+       atom = CAR(list)->data.atom;
+       if (atom->dyn)
+           flags[i] = DYNAMIC_SYMBOL;
+       else if (atom->a_object) {
+           flags[i] = GLOBAL_SYMBOL;
+           offsets[i] = lisp__data.protect.length;
+           GC_PROTECT(atom->property->value);
+       }
+       else
+           flags[i] = UNBOUND_SYMBOL;
+    }
+
+    /* bind the symbols */
+    for (i = 0, list = symbols; i < count; i++, list = CDR(list)) {
+       symbol = CAR(list);
+       atom = symbol->data.atom;
+       if (CONSP(values)) {
+           value = CAR(values);
+           values = CDR(values);
+       }
+       else
+           value = NIL;
+       if (flags[i] != DYNAMIC_SYMBOL) {
+           if (!atom->a_object)
+               LispSetAtomObjectProperty(atom, value);
+           else
+               SETVALUE(atom, value);
+       }
+       else
+           LispAddVar(symbol, value);
+    }
+    /* bind dynamic symbols */
+    lisp__data.env.head = lisp__data.env.length;
+
+    jumped = 0;
+    result = NIL;
+    block = LispBeginBlock(NIL, LispBlockProtect);
+    if (setjmp(block->jmp) == 0) {
+       for (; CONSP(body); body = CDR(body))
+           result = EVAL(CAR(body));
+    }
+
+    /* restore symbols */
+    for (i = 0, list = symbols; i < count; i++, list = CDR(list)) {
+       symbol = CAR(list);
+       atom = symbol->data.atom;
+       if (flags[i] != DYNAMIC_SYMBOL) {
+           if (flags[i] == UNBOUND_SYMBOL)
+               LispUnsetVar(symbol);
+           else {
+               /* restore global symbol value */
+               LispSetAtomObjectProperty(atom, lisp__data.protect.objects
+                                         [offsets[i]]);
+               atom->dyn = 0;
+           }
+       }
+    }
+    /* unbind dynamic symbols */
+    lisp__data.env.head = lisp__data.env.length = head;
+    GC_LEAVE();
+
+    if (count > sizeof(fstk)) {
+       LispFree(flags);
+       LispFree(offsets);
+    }
+
+    LispEndBlock(block);
+    if (!lisp__data.destroyed) {
+       if (jumped)
+           result = lisp__data.block.block_ret;
+    }
+    else {
+       /* check if there is an unwind-protect block */
+       LispBlockUnwind(NULL);
+
+       /* no unwind-protect block, return to the toplevel */
+       LispDestroy(".");
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Provide(LispBuiltin *builtin)
+/*
+ provide module
+ */
+{
+    LispObj *module, *obj;
+
+    module = ARGUMENT(0);
+
+    CHECK_STRING(module);
+    for (obj = MOD; obj != NIL; obj = CDR(obj)) {
+       if (STRLEN(CAR(obj)) == STRLEN(module) &&
+           memcmp(THESTR(CAR(obj)), THESTR(module), STRLEN(module)) == 0)
+           return (module);
+    }
+
+    if (MOD == NIL)
+       MOD = CONS(module, NIL);
+    else {
+       RPLACD(MOD, CONS(CAR(MOD), CDR(MOD)));
+       RPLACA(MOD, module);
+    }
+
+    LispSetVar(lisp__data.modules, MOD);
+
+    return (MOD);
+}
+
+LispObj *
+Lisp_Push(LispBuiltin *builtin)
+/*
+ push item place
+ */
+{
+    LispObj *result, *list;
+
+    LispObj *item, *place;
+
+    place = ARGUMENT(1);
+    item = ARGUMENT(0);
+
+    item = EVAL(item);
+
+    if (SYMBOLP(place)) {
+       list = LispGetVar(place);
+       if (list == NULL)
+           LispDestroy("EVAL: the variable %s is unbound", STROBJ(place));
+       CHECK_CONSTANT(place);
+       LispSetVar(place, result = CONS(item, list));
+    }
+    else {
+       GC_ENTER();
+       LispObj quote;
+
+       list = EVAL(place);
+       result = CONS(item, list);
+       GC_PROTECT(result);
+       quote.type = LispQuote_t;
+       quote.data.quote = result;
+       APPLY2(Osetf, place, &quote);
+       GC_LEAVE();
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Pushnew(LispBuiltin *builtin)
+/*
+ pushnew item place &key key test test-not
+ */
+{
+    GC_ENTER();
+    LispObj *result, *list;
+
+    LispObj *item, *place, *key, *test, *test_not;
+
+    test_not = ARGUMENT(4);
+    test = ARGUMENT(3);
+    key = ARGUMENT(2);
+    place = ARGUMENT(1);
+    item = ARGUMENT(0);
+
+    /* Evaluate place */
+    if (SYMBOLP(place)) {
+       list = LispGetVar(place);
+       if (list == NULL)
+           LispDestroy("EVAL: the variable %s is unbound", STROBJ(place));
+       /* Do error checking now. */
+       CHECK_CONSTANT(place);
+    }
+    else
+       /* It is possible that list is not gc protected? */
+       list = EVAL(place);
+
+    item = EVAL(item);
+    GC_PROTECT(item);
+    if (key != UNSPEC) {
+       key = EVAL(key);
+       GC_PROTECT(key);
+    }
+    if (test != UNSPEC) {
+       test = EVAL(test);
+       GC_PROTECT(test);
+    }
+    else if (test_not != UNSPEC) {
+       test_not = EVAL(test_not);
+       GC_PROTECT(test_not);
+    }
+
+    result = LispAdjoin(builtin, item, list, key, test, test_not);
+
+    /* Item already in list */
+    if (result == list) {
+       GC_LEAVE();
+
+       return (result);
+    }
+
+    if (SYMBOLP(place)) {
+       CHECK_CONSTANT(place);
+       LispSetVar(place, result);
+    }
+    else {
+       LispObj quote;
+
+       GC_PROTECT(result);
+       quote.type = LispQuote_t;
+       quote.data.quote = result;
+       APPLY2(Osetf, place, &quote);
+    }
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+Lisp_Quit(LispBuiltin *builtin)
+/*
+ quit &optional status
+ */
+{
+    int status = 0;
+    LispObj *ostatus;
+
+    ostatus = ARGUMENT(0);
+
+    if (FIXNUMP(ostatus))
+       status = (int)FIXNUM_VALUE(ostatus);
+    else if (ostatus != UNSPEC)
+       LispDestroy("%s: bad exit status argument %s",
+                   STRFUN(builtin), STROBJ(ostatus));
+
+    exit(status);
+}
+
+LispObj *
+Lisp_Quote(LispBuiltin *builtin)
+/*
+ quote object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (object);
+}
+
+LispObj *
+Lisp_Replace(LispBuiltin *builtin)
+/*
+ replace sequence1 sequence2 &key start1 end1 start2 end2
+ */
+{
+    long length, length1, length2, start1, end1, start2, end2;
+    LispObj *sequence1, *sequence2, *ostart1, *oend1, *ostart2, *oend2;
+
+    oend2 = ARGUMENT(5);
+    ostart2 = ARGUMENT(4);
+    oend1 = ARGUMENT(3);
+    ostart1 = ARGUMENT(2);
+    sequence2 = ARGUMENT(1);
+    sequence1 = ARGUMENT(0);
+
+    LispCheckSequenceStartEnd(builtin, sequence1, ostart1, oend1,
+                             &start1, &end1, &length1);
+    LispCheckSequenceStartEnd(builtin, sequence2, ostart2, oend2,
+                             &start2, &end2, &length2);
+
+    if (start1 == end1 || start2 == end2)
+       return (sequence1);
+
+    length = end1 - start1;
+    if (length > end2 - start2)
+       length = end2 - start2;
+
+    if (STRINGP(sequence1)) {
+       CHECK_STRING_WRITABLE(sequence1);
+       if (!STRINGP(sequence2))
+           LispDestroy("%s: cannot store %s in %s",
+                       STRFUN(builtin), STROBJ(sequence2), THESTR(sequence1));
+
+       memmove(THESTR(sequence1) + start1, THESTR(sequence2) + start2, length);
+    }
+    else {
+       int i;
+       LispObj *from, *to;
+
+       if (ARRAYP(sequence1))
+           sequence1 = sequence1->data.array.list;
+       if (ARRAYP(sequence2))
+           sequence2 = sequence2->data.array.list;
+
+       /* adjust pointers */
+       for (i = 0, from = sequence2; i < start2; i++, from = CDR(from))
+           ;
+       for (i = 0, to = sequence1; i < start1; i++, to = CDR(to))
+           ;
+
+       /* copy data */
+       for (i = 0; i < length; i++, from = CDR(from), to = CDR(to))
+           RPLACA(to, CAR(from));
+    }
+
+    return (sequence1);
+}
+
+static LispObj *
+LispDeleteOrRemoveDuplicates(LispBuiltin *builtin, int function)
+/*
+ delete-duplicates sequence &key from-end test test-not start end key
+ remove-duplicates sequence &key from-end test test-not start end key
+ */
+{
+    GC_ENTER();
+    int code, expect, value = 0;
+    long i, j, start, end, length, count;
+    LispObj *lambda, *result, *cons, *compare;
+
+    LispObj *sequence, *from_end, *test, *test_not, *ostart, *oend, *key;
+
+    key = ARGUMENT(6);
+    oend = ARGUMENT(5);
+    ostart = ARGUMENT(4);
+    test_not = ARGUMENT(3);
+    test = ARGUMENT(2);
+    from_end = ARGUMENT(1);
+    if (from_end == UNSPEC)
+       from_end = NIL;
+    sequence = ARGUMENT(0);
+
+    LispCheckSequenceStartEnd(builtin, sequence, ostart, oend,
+                             &start, &end, &length);
+
+    /* Check if need to do something */
+    if (start == end)
+       return (sequence);
+
+    CHECK_TEST();
+
+    /* Initialize */
+    count = 0;
+
+    result = cons = NIL;
+    if (STRINGP(sequence)) {
+       char *ptr, *string, *buffer = LispMalloc(length + 1);
+
+       /* Use same code, update start/end offsets */
+       if (from_end != NIL) {
+           i = length - start;
+           start = length - end;
+           end = i;
+       }
+
+       if (from_end == NIL)
+           string = THESTR(sequence);
+       else {
+           /* Make a reversed copy of the sequence */
+           string = LispMalloc(length + 1);
+           for (ptr = THESTR(sequence) + length - 1, i = 0; i < length; i++)
+               string[i] = *ptr--;
+           string[i] = '\0';
+       }
+
+       ptr = buffer;
+       /* Copy leading bytes */
+       for (i = 0; i < start; i++)
+           *ptr++ = string[i];
+
+       compare = SCHAR(string[i]);
+       if (key != UNSPEC)
+           compare = APPLY1(key, compare);
+       result = cons = CONS(compare, NIL);
+       GC_PROTECT(result);
+       for (++i; i < end; i++) {
+           compare = SCHAR(string[i]);
+           if (key != UNSPEC)
+               compare = APPLY1(key, compare);
+           RPLACD(cons, CONS(compare, NIL));
+           cons = CDR(cons);
+       }
+
+       for (i = start; i < end; i++, result = CDR(result)) {
+           compare = CAR(result);
+           for (j = i + 1, cons = CDR(result); j < end; j++, cons = CDR(cons)) {
+               value = FCOMPARE(lambda, compare, CAR(cons), code);
+               if (value == expect)
+                   break;
+           }
+           if (value != expect)
+               *ptr++ = string[i];
+           else
+               ++count;
+       }
+
+       if (count) {
+           /* Copy ending bytes */
+           for (; i <= length; i++)   /* Also copy the ending nul */
+               *ptr++ = string[i];
+
+           if (from_end == NIL)
+               ptr = buffer;
+           else {
+               for (i = 0, ptr = buffer + strlen(buffer);
+                    ptr > buffer;
+                    i++)
+                   string[i] = *--ptr;
+               string[i] = '\0';
+               ptr = string;
+               LispFree(buffer);
+           }
+           if (function == REMOVE)
+               result = STRING2(ptr);
+           else {
+               CHECK_STRING_WRITABLE(sequence);
+               result = sequence;
+               free(THESTR(result));
+               THESTR(result) = ptr;
+               LispMused(ptr);
+           }
+       }
+       else {
+           result = sequence;
+           if (from_end != NIL)
+               LispFree(string);
+       }
+    }
+    else {
+       long xlength = end - start;
+       LispObj *list, *object, **kobjects = NULL, **xobjects;
+       LispObj **objects = LispMalloc(sizeof(LispObj*) * xlength);
+
+       if (!CONSP(sequence))
+           object = sequence->data.array.list;
+       else
+           object = sequence;
+       list = object;
+
+       for (i = 0; i < start; i++)
+           object = CDR(object);
+
+       /* Put data in a vector */
+       if (from_end == NIL) {
+           for (i = 0; i < xlength; i++, object = CDR(object))
+               objects[i] = CAR(object);
+       }
+       else {
+           for (i = xlength - 1; i >= 0; i--, object = CDR(object))
+               objects[i] = CAR(object);
+       }
+
+       /* Apply key predicate if required */
+       if (key != UNSPEC) {
+           kobjects = LispMalloc(sizeof(LispObj*) * xlength);
+           for (i = 0; i < xlength; i++) {
+               kobjects[i] = APPLY1(key, objects[i]);
+               GC_PROTECT(kobjects[i]);
+           }
+           xobjects = kobjects;
+       }
+       else
+           xobjects = objects;
+
+       /* Check if needs to remove something */
+       for (i = 0; i < xlength; i++) {
+           compare = xobjects[i];
+           for (j = i + 1; j < xlength; j++) {
+               value = FCOMPARE(lambda, compare, xobjects[j], code);
+               if (value == expect) {
+                   objects[i] = NULL;
+                   ++count;
+                   break;
+               }
+           }
+       }
+
+       if (count) {
+           /* Create/set result list */
+           object = list;
+
+           if (start) {
+               /* Skip first elements of resulting list */
+               if (function == REMOVE) {
+                   result = cons = CONS(CAR(object), NIL);
+                   GC_PROTECT(result);
+                   for (i = 1, object = CDR(object);
+                        i < start;
+                        i++, object = CDR(object)) {
+                       RPLACD(cons, CONS(CAR(object), NIL));
+                       cons = CDR(cons);
+                   }
+               }
+               else {
+                   result = cons = object;
+                   for (i = 1; i < start; i++, cons = CDR(cons))
+                       ;
+               }
+           }
+           else if (function == DELETE)
+               result = list;
+
+           /* Skip initial removed elements */
+           if (function == REMOVE) {
+               for (i = 0; objects[i] == NULL && i < xlength; i++)
+                   ;
+           }
+           else
+               i = 0;
+
+           if (i < xlength) {
+               int xstart, xlimit, xinc;
+
+               if (from_end == NIL) {
+                   xstart = i;
+                   xlimit = xlength;
+                   xinc = 1;
+               }
+               else {
+                   xstart = xlength - 1;
+                   xlimit = i - 1;
+                   xinc = -1;
+               }
+
+               if (function == REMOVE) {
+                   for (i = xstart; i != xlimit; i += xinc) {
+                       if (objects[i] != NULL) {
+                           if (result == NIL) {
+                               result = cons = CONS(objects[i], NIL);
+                               GC_PROTECT(result);
+                           }
+                           else {
+                               RPLACD(cons, CONS(objects[i], NIL));
+                               cons = CDR(cons);
+                           }
+                       }
+                   }
+               }
+               else {
+                   /* Delete duplicates */
+                   for (i = xstart; i != xlimit; i += xinc) {
+                       if (objects[i] == NULL) {
+                           if (cons == NIL) {
+                               if (CONSP(CDR(result))) {
+                                   RPLACA(result, CADR(result));
+                                   RPLACD(result, CDDR(result));
+                               }
+                               else {
+                                   RPLACA(result, CDR(result));
+                                   RPLACD(result, NIL);
+                               }
+                           }
+                           else {
+                               if (CONSP(CDR(cons)))
+                                   RPLACD(cons, CDDR(cons));
+                               else
+                                   RPLACD(cons, NIL);
+                           }
+                       }
+                       else {
+                           if (cons == NIL)
+                               cons = result;
+                           else
+                               cons = CDR(cons);
+                       }
+                   }
+               }
+           }
+           if (end < length && function == REMOVE) {
+               for (i = start; i < end; i++, object = CDR(object))
+                   ;
+               if (result == NIL) {
+                   result = cons = CONS(CAR(object), NIL);
+                   GC_PROTECT(result);
+                   ++i;
+                   object = CDR(object);
+               }
+               for (; i < length; i++, object = CDR(object)) {
+                   RPLACD(cons, CONS(CAR(object), NIL));
+                   cons = CDR(cons);
+               }
+           }
+       }
+       else
+           result = sequence;
+       LispFree(objects);
+       if (key != UNSPEC)
+           LispFree(kobjects);
+
+       if (count && !CONSP(sequence)) {
+           if (function == REMOVE)
+               result = VECTOR(result);
+           else {
+               length = FIXNUM_VALUE(CAR(sequence->data.array.dim)) - count;
+               CAR(sequence->data.array.dim) = FIXNUM(length);
+               result = sequence;
+           }
+       }
+    }
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+Lisp_RemoveDuplicates(LispBuiltin *builtin)
+/*
+ remove-duplicates sequence &key from-end test test-not start end key
+ */
+{
+    return (LispDeleteOrRemoveDuplicates(builtin, REMOVE));
+}
+
+static LispObj *
+LispDeleteRemoveXSubstitute(LispBuiltin *builtin,
+                           int function, int comparison)
+/*
+ delete item sequence &key from-end test test-not start end count key
+ delete-if predicate sequence &key from-end start end count key
+ delete-if-not predicate sequence &key from-end start end count key
+ remove item sequence &key from-end test test-not start end count key
+ remove-if predicate sequence &key from-end start end count key
+ remove-if-not predicate sequence &key from-end start end count key
+ substitute newitem olditem sequence &key from-end test test-not start end count key
+ substitute-if newitem test sequence &key from-end start end count key
+ substitute-if-not newitem test sequence &key from-end start end count key
+ nsubstitute newitem olditem sequence &key from-end test test-not start end count key
+ nsubstitute-if newitem test sequence &key from-end start end count key
+ nsubstitute-if-not newitem test sequence &key from-end start end count key
+ */
+{
+    GC_ENTER();
+    int code, expect, value, inplace, substitute;
+    long i, j, start, end, length, copy, count, xstart, xend, xinc, xlength;
+
+    LispObj *result, *compare;
+
+    LispObj *item, *newitem, *lambda, *sequence, *from_end,
+           *test, *test_not, *ostart, *oend, *ocount, *key;
+
+    substitute = function == SUBSTITUTE || function == NSUBSTITUTE;
+    if (!substitute)
+       i = comparison == NONE ? 8 : 6;
+    else /* substitute */
+       i = comparison == NONE ? 9 : 7;
+
+    /* Get function arguments */
+    key = ARGUMENT(i);                 --i;
+    ocount = ARGUMENT(i);              --i;
+    oend = ARGUMENT(i);                        --i;
+    ostart = ARGUMENT(i);              --i;
+    if (comparison == NONE) {
+       test_not = ARGUMENT(i);         --i;
+       test = ARGUMENT(i);             --i;
+    }
+    else
+       test_not = test = UNSPEC;
+    from_end = ARGUMENT(i);            --i;
+    if (from_end == UNSPEC)
+       from_end = NIL;
+    sequence = ARGUMENT(i);            --i;
+    if (comparison != NONE) {
+       lambda = ARGUMENT(i);   --i;
+       if (substitute)
+           newitem = ARGUMENT(0);
+       else
+           newitem = NIL;
+       item = NIL;
+    }
+    else {
+       lambda = NIL;
+       if (substitute) {
+           item = ARGUMENT(1);
+           newitem = ARGUMENT(0);
+       }
+       else {
+           item = ARGUMENT(0);
+           newitem = NIL;
+       }
+    }
+
+    /* Check if argument is a valid sequence, and if start/end
+     * are correctly specified. */
+    LispCheckSequenceStartEnd(builtin, sequence, ostart, oend,
+                             &start, &end, &length);
+
+    /* Check count argument */
+    if (ocount == UNSPEC) {
+       count = length;
+       /* Doesn't matter, but left to right should be slightly faster */
+       from_end = NIL;
+    }
+    else {
+       CHECK_INDEX(ocount);
+       count = FIXNUM_VALUE(ocount);
+    }
+
+    /* Check if need to do something */
+    if (start == end || count == 0)
+       return (sequence);
+
+    CHECK_TEST_0();
+
+    /* Resolve comparison function, and expected result of comparison */
+    if (comparison == NONE) {
+       if (test_not == UNSPEC) {
+           if (test == UNSPEC)
+               lambda = Oeql;
+           else
+               lambda = test;
+           expect = 1;
+       }
+       else {
+           lambda = test_not;
+           expect = 0;
+       }
+       FUNCTION_CHECK(lambda);
+    }
+    else
+       expect = comparison == IFNOT ? 0 : 1;
+
+    /* Check for fast path to comparison function */
+    code = FCODE(lambda);
+
+    /* Initialize for loop */
+    copy = count;
+    result = sequence;
+    inplace = function == DELETE || function == NSUBSTITUTE;
+    xlength = end - start;
+
+    /* String is easier */
+    if (STRINGP(sequence)) {
+       char *buffer, *string;
+
+       if (comparison == NONE) {
+           CHECK_SCHAR(item);
+       }
+       if (substitute) {
+           CHECK_SCHAR(newitem);
+       }
+
+       if (from_end == NIL) {
+           xstart = start;
+           xend = end;
+           xinc = 1;
+       }
+       else {
+           xstart = end - 1;
+           xend = start - 1;
+           xinc = -1;
+       }
+
+       string = THESTR(sequence);
+       buffer = LispMalloc(length + 1);
+
+       /* Copy leading bytes, if any */
+       for (i = 0; i < start; i++)
+           buffer[i] = string[i];
+
+       for (j = xstart; i != xend && count > 0; i += xinc) {
+           compare = SCHAR(string[i]);
+           if (key != UNSPEC) {
+               compare = APPLY1(key, compare);
+               /* Value returned by the key predicate may not be protected */
+               GC_PROTECT(compare);
+               if (comparison == NONE)
+                   value = FCOMPARE(lambda, item, compare, code);
+               else
+                   value = APPLY1(lambda, compare) != NIL;
+               /* Unprotect value returned by the key predicate */
+               GC_LEAVE();
+           }
+           else {
+               if (comparison == NONE)
+                   value = FCOMPARE(lambda, item, compare, code);
+               else
+                   value = APPLY1(lambda, compare) != NIL;
+           }
+
+           if (value != expect) {
+               buffer[j] = string[i];
+               j += xinc;
+           }
+           else {
+               if (substitute) {
+                   buffer[j] = SCHAR_VALUE(newitem);
+                   j += xinc;
+               }
+               else
+                   --count;
+           }
+       }
+
+       if (count != copy && from_end != NIL)
+           memmove(buffer + start, buffer + copy - count, count);
+
+       /* Copy remaining bytes, if any */
+       for (; i < length; i++, j++)
+           buffer[j] = string[i];
+       buffer[j] = '\0';
+
+       xlength = length - (copy - count);
+       if (inplace) {
+           CHECK_STRING_WRITABLE(sequence);
+           /* result is a pointer to sequence */
+           LispFree(THESTR(sequence));
+           LispMused(buffer);
+           THESTR(sequence) = buffer;
+           STRLEN(sequence) = xlength;
+       }
+       else
+           result = LSTRING2(buffer, xlength);
+    }
+
+    /* If inplace, need to update CAR and CDR of sequence */
+    else {
+       LispObj *list, *object;
+       LispObj **objects = LispMalloc(sizeof(LispObj*) * xlength);
+
+       if (!CONSP(sequence))
+           list = sequence->data.array.list;
+       else
+           list = sequence;
+
+       /* Put data in a vector */
+       for (i = 0, object = list; i < start; i++)
+           object = CDR(object);
+
+       for (i = 0; i < xlength; i++, object = CDR(object))
+           objects[i] = CAR(object);
+
+       if (from_end == NIL) {
+           xstart = 0;
+           xend = xlength;
+           xinc = 1;
+       }
+       else {
+           xstart = xlength - 1;
+           xend = -1;
+           xinc = -1;
+       }
+
+       /* Check if needs to remove something */
+       for (i = xstart; i != xend && count > 0; i += xinc) {
+           compare = objects[i];
+           if (key != UNSPEC) {
+               compare = APPLY1(key, compare);
+               GC_PROTECT(compare);
+               if (comparison == NONE)
+                   value = FCOMPARE(lambda, item, compare, code);
+               else
+                   value = APPLY1(lambda, compare) != NIL;
+               GC_LEAVE();
+           }
+           else {
+               if (comparison == NONE)
+                   value = FCOMPARE(lambda, item, compare, code);
+               else
+                   value = APPLY1(lambda, compare) != NIL;
+           }
+           if (value == expect) {
+               if (substitute)
+                   objects[i] = newitem;
+               else
+                   objects[i] = NULL;
+               --count;
+           }
+       }
+
+       if (copy != count) {
+           LispObj *cons = NIL;
+
+           i = 0;
+           object = list;
+           if (inplace) {
+               /* While result is NIL, skip initial elements of sequence */
+               result = start ? list : NIL;
+
+               /* Skip initial elements, if any */
+               for (; i < start; i++, cons = object, object = CDR(object))
+                   ;
+           }
+           /* Copy initial elements, if any */
+           else {
+               result = NIL;
+               if (start) {
+                   result = cons = CONS(CAR(list), NIL);
+                   GC_PROTECT(result);
+                   for (++i, object = CDR(list);
+                        i < start;
+                        i++, object = CDR(object)) {
+                       RPLACD(cons, CONS(CAR(object), NIL));
+                       cons = CDR(cons);
+                   }
+               }
+           }
+
+           /* Skip initial removed elements, if any */
+           for (i = 0; i < xlength && objects[i] == NULL; i++)
+               ;
+
+           for (i = 0; i < xlength; i++, object = CDR(object)) {
+               if (objects[i]) {
+                   if (inplace) {
+                       if (result == NIL)
+                           result = cons = object;
+                       else {
+                           RPLACD(cons, object);
+                           cons = CDR(cons);
+                       }
+                       if (function == NSUBSTITUTE)
+                           RPLACA(cons, objects[i]);
+                   }
+                   else {
+                       if (result == NIL) {
+                           result = cons = CONS(objects[i], NIL);
+                           GC_PROTECT(result);
+                       }
+                       else {
+                           RPLACD(cons, CONS(objects[i], NIL));
+                           cons = CDR(cons);
+                       }
+                   }
+               }
+           }
+
+           if (inplace) {
+               if (result == NIL)
+                   result = object;
+               else
+                   RPLACD(cons, object);
+
+               if (!CONSP(sequence)) {
+                   result = sequence;
+                   CAR(result)->data.array.dim =
+                       FIXNUM(length - (copy - count));
+               }
+           }
+           else if (end < length) {
+               i = end;
+               /* Copy ending elements, if any */
+               if (result == NIL) {
+                   result = cons = CONS(CAR(object), NIL);
+                   GC_PROTECT(result);
+                   object = CDR(object);
+                   i++;
+               }
+               for (; i < length; i++, object = CDR(object)) {
+                   RPLACD(cons, CONS(CAR(object), NIL));
+                   cons = CDR(cons);
+               }
+           }
+       }
+
+       /* Release comparison vector */
+       LispFree(objects);
+    }
+
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+Lisp_Remove(LispBuiltin *builtin)
+/*
+ remove item sequence &key from-end test test-not start end count key
+ */
+{
+    return (LispDeleteRemoveXSubstitute(builtin, REMOVE, NONE));
+}
+
+LispObj *
+Lisp_RemoveIf(LispBuiltin *builtin)
+/*
+ remove-if predicate sequence &key from-end start end count key
+ */
+{
+    return (LispDeleteRemoveXSubstitute(builtin, REMOVE, IF));
+}
+
+LispObj *
+Lisp_RemoveIfNot(LispBuiltin *builtin)
+/*
+ remove-if-not predicate sequence &key from-end start end count key
+ */
+{
+    return (LispDeleteRemoveXSubstitute(builtin, REMOVE, IFNOT));
+}
+
+LispObj *
+Lisp_Remprop(LispBuiltin *builtin)
+/*
+ remprop symbol indicator
+ */
+{
+    LispObj *symbol, *indicator;
+
+    indicator = ARGUMENT(1);
+    symbol = ARGUMENT(0);
+
+    CHECK_SYMBOL(symbol);
+
+    return (LispRemAtomProperty(symbol->data.atom, indicator));
+}
+
+LispObj *
+Lisp_Return(LispBuiltin *builtin)
+/*
+ return &optional result
+ */
+{
+    unsigned blevel = lisp__data.block.block_level;
+
+    LispObj *result;
+
+    result = ARGUMENT(0);
+
+    while (blevel) {
+       LispBlock *block = lisp__data.block.block[--blevel];
+
+       if (block->type == LispBlockClosure)
+           /* if reached a function call */
+           break;
+       if (block->type == LispBlockTag && block->tag == NIL) {
+           lisp__data.block.block_ret = result == UNSPEC ? NIL : EVAL(result);
+           LispBlockUnwind(block);
+           BLOCKJUMP(block);
+       }
+    }
+    LispDestroy("%s: no visible NIL block", STRFUN(builtin));
+
+    /*NOTREACHED*/
+    return (NIL);
+}
+
+LispObj *
+Lisp_ReturnFrom(LispBuiltin *builtin)
+/*
+ return-from name &optional result
+ */
+{
+    unsigned blevel = lisp__data.block.block_level;
+
+    LispObj *name, *result;
+
+    result = ARGUMENT(1);
+    name = ARGUMENT(0);
+
+    if (name != NIL && name != T && !SYMBOLP(name))
+       LispDestroy("%s: %s is not a valid block name",
+                   STRFUN(builtin), STROBJ(name));
+
+    while (blevel) {
+       LispBlock *block = lisp__data.block.block[--blevel];
+
+       if (name == block->tag &&
+           (block->type == LispBlockTag || block->type == LispBlockClosure)) {
+           lisp__data.block.block_ret = result == UNSPEC ? NIL : EVAL(result);
+           LispBlockUnwind(block);
+           BLOCKJUMP(block);
+       }
+       if (block->type == LispBlockClosure)
+           /* can use return-from only in the current function */
+           break;
+    }
+    LispDestroy("%s: no visible block named %s",
+               STRFUN(builtin), STROBJ(name));
+
+    /*NOTREACHED*/
+    return (NIL);
+}
+
+static LispObj *
+LispXReverse(LispBuiltin *builtin, int inplace)
+/*
+ nreverse sequence
+ reverse sequence
+ */
+{
+    long length;
+    LispObj *list, *result = NIL;
+
+    LispObj *sequence;
+
+    sequence = ARGUMENT(0);
+
+    /* Do error checking for arrays and object type. */
+    length = LispLength(sequence);
+    if (length <= 1)
+       return (sequence);
+
+    switch (XOBJECT_TYPE(sequence)) {
+       case LispString_t: {
+           long i;
+           char *from, *to;
+
+           from = THESTR(sequence) + length - 1;
+           if (inplace) {
+               char temp;
+
+               CHECK_STRING_WRITABLE(sequence);
+               to = THESTR(sequence);
+               for (i = 0; i < length / 2; i++) {
+                   temp = to[i];
+                   to[i] = from[-i];
+                   from[-i] = temp;
+               }
+               result = sequence;
+           }
+           else {
+               to = LispMalloc(length + 1);
+               to[length] = '\0';
+               for (i = 0; i < length; i++)
+                   to[i] = from[-i];
+               result = STRING2(to);
+           }
+       }   return (result);
+       case LispCons_t:
+           if (inplace) {
+               long i, j;
+               LispObj *temp;
+
+               /* For large lists this can be very slow, but for small
+                * amounts of data, this avoid allocating a buffer to
+                * to store the CAR of the sequence. This is only done
+                * to not destroy the contents of a variable.
+                */
+               for (i = 0, list = sequence;
+                    i < (length + 1) / 2;
+                    i++, list = CDR(list))
+                   ;
+               length /= 2;
+               for (i = 0; i < length; i++, list = CDR(list)) {
+                   for (j = length - i - 1, result = sequence;
+                        j > 0;
+                        j--, result = CDR(result))
+                       ;
+                   temp = CAR(list);
+                   RPLACA(list, CAR(result));
+                   RPLACA(result, temp);
+               }
+               return (sequence);
+           }
+           list = sequence;
+           break;
+       case LispArray_t:
+           if (inplace) {
+               sequence->data.array.list =
+                   LispReverse(sequence->data.array.list);
+               return (sequence);
+           }
+           list = sequence->data.array.list;
+           break;
+       default:        /* LispNil_t */
+           return (result);
+    }
+
+    {
+       GC_ENTER();
+       LispObj *cons;
+
+       result = cons = CONS(CAR(list), NIL);
+       GC_PROTECT(result);
+       for (list = CDR(list); CONSP(list); list = CDR(list)) {
+           RPLACD(cons, CONS(CAR(list), NIL));
+           cons = CDR(cons);
+       }
+       result = LispReverse(result);
+
+       GC_LEAVE();
+    }
+
+    if (ARRAYP(sequence)) {
+       list = result;
+
+       result = LispNew(list, NIL);
+       result->type = LispArray_t;
+       result->data.array.list = list;
+       result->data.array.dim = sequence->data.array.dim;
+       result->data.array.rank = sequence->data.array.rank;
+       result->data.array.type = sequence->data.array.type;
+       result->data.array.zero = sequence->data.array.zero;
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Reverse(LispBuiltin *builtin)
+/*
+ reverse sequence
+ */
+{
+    return (LispXReverse(builtin, 0));
+}
+
+LispObj *
+Lisp_Rplaca(LispBuiltin *builtin)
+/*
+ rplaca place value
+ */
+{
+    LispObj *place, *value;
+
+    value = ARGUMENT(1);
+    place = ARGUMENT(0);
+
+    CHECK_CONS(place);
+    RPLACA(place, value);
+
+    return (place);
+}
+
+LispObj *
+Lisp_Rplacd(LispBuiltin *builtin)
+/*
+ rplacd place value
+ */
+{
+    LispObj *place, *value;
+
+    value = ARGUMENT(1);
+    place = ARGUMENT(0);
+
+    CHECK_CONS(place);
+    RPLACD(place, value);
+
+    return (place);
+}
+
+LispObj *
+Lisp_Search(LispBuiltin *builtin)
+/*
+ search sequence1 sequence2 &key from-end test test-not key start1 start2 end1 end2
+ */
+{
+    int code = 0, expect, value;
+    long start1, start2, end1, end2, length1, length2, off1, off2, offset = -1;
+    LispObj *cmp1, *cmp2, *list1 = NIL, *lambda;
+    SeqInfo seq1, seq2;
+
+    LispObj *sequence1, *sequence2, *from_end, *test, *test_not,
+           *key, *ostart1, *ostart2, *oend1, *oend2;
+
+    oend2 = ARGUMENT(9);
+    oend1 = ARGUMENT(8);
+    ostart2 = ARGUMENT(7);
+    ostart1 = ARGUMENT(6);
+    key = ARGUMENT(5);
+    test_not = ARGUMENT(4);
+    test = ARGUMENT(3);
+    from_end = ARGUMENT(2);
+    sequence2 = ARGUMENT(1);
+    sequence1 = ARGUMENT(0);
+
+    LispCheckSequenceStartEnd(builtin, sequence1, ostart1, oend1,
+                             &start1, &end1, &length1);
+    LispCheckSequenceStartEnd(builtin, sequence2, ostart2, oend2,
+                             &start2, &end2, &length2);
+
+    /* Check for special conditions */
+    if (start1 == end1)
+       return (FIXNUM(end2));
+    else if (start2 == end2)
+       return (start1 == end1 ? FIXNUM(start2) : NIL);
+
+    CHECK_TEST();
+
+    if (from_end == UNSPEC)
+       from_end = NIL;
+
+    SETSEQ(seq1, sequence1);
+    SETSEQ(seq2, sequence2);
+
+    length1 = end1 - start1;
+    length2 = end2 - start2;
+
+    /* update start of sequences */
+    if (start1) {
+       if (seq1.type == LispString_t)
+           seq1.data.string += start1;
+       else {
+           for (cmp1 = seq1.data.list; start1; cmp1 = CDR(cmp1), --start1)
+               ;
+           seq1.data.list = cmp1;
+       }
+       end1 = length1;
+    }
+    if (start2) {
+       if (seq2.type == LispString_t)
+           seq2.data.string += start2;
+       else {
+           for (cmp2 = seq2.data.list; start2; cmp2 = CDR(cmp2), --start2)
+               ;
+           seq2.data.list = cmp2;
+       }
+       end2 = length2;
+    }
+
+    /* easier case */
+    if (from_end == NIL) {
+       LispObj *list2 = NIL;
+
+       /* while a match is possible */
+       while (end2 - start2 >= length1) {
+
+           /* prepare to search */
+           off1 = 0;
+           off2 = start2;
+           if (seq1.type != LispString_t)
+               list1 = seq1.data.list;
+           if (seq2.type != LispString_t)
+               list2 = seq2.data.list;
+
+           /* for every element that must match in sequence1 */
+           while (off1 < length1) {
+               if (seq1.type == LispString_t)
+                   cmp1 = SCHAR(seq1.data.string[off1]);
+               else
+                   cmp1 = CAR(list1);
+               if (seq2.type == LispString_t)
+                   cmp2 = SCHAR(seq2.data.string[off2]);
+               else
+                   cmp2 = CAR(list2);
+               if (key != UNSPEC) {
+                   cmp1 = APPLY1(key, cmp1);
+                   cmp2 = APPLY1(key, cmp2);
+               }
+
+               /* compare elements */
+               value = FCOMPARE(lambda, cmp1, cmp2, code);
+               if (value != expect)
+                   break;
+
+               /* update offsets/sequence pointers */
+               ++off1;
+               ++off2;
+               if (seq1.type != LispString_t)
+                   list1 = CDR(list1);
+               if (seq2.type != LispString_t)
+                   list2 = CDR(list2);
+           }
+
+           /* if everything matched */
+           if (off1 == end1) {
+               offset = off2 - length1;
+               break;
+           }
+
+           /* update offset/sequence2 pointer */
+           ++start2;
+           if (seq2.type != LispString_t)
+               seq2.data.list = CDR(seq2.data.list);
+       }
+    }
+    else {
+       /* allocate vector if required, only list2 requires it.
+        * list1 can be traversed forward */
+       if (seq2.type != LispString_t) {
+           cmp2 = seq2.data.list;
+           seq2.data.vector = LispMalloc(sizeof(LispObj*) * length2);
+           for (off2 = 0; off2 < end2; off2++, cmp2 = CDR(cmp2))
+               seq2.data.vector[off2] = CAR(cmp2);
+       }
+
+       /* while a match is possible */
+       while (end2 >= length1) {
+
+           /* prepare to search */
+           off1 = 0;
+           off2 = end2 - length1;
+           if (seq1.type != LispString_t)
+               list1 = seq1.data.list;
+
+           /* for every element that must match in sequence1 */
+           while (off1 < end1) {
+               if (seq1.type == LispString_t)
+                   cmp1 = SCHAR(seq1.data.string[off1]);
+               else
+                   cmp1 = CAR(list1);
+               if (seq2.type == LispString_t)
+                   cmp2 = SCHAR(seq2.data.string[off2]);
+               else
+                   cmp2 = seq2.data.vector[off2];
+               if (key != UNSPEC) {
+                   cmp1 = APPLY1(key, cmp1);
+                   cmp2 = APPLY1(key, cmp2);
+               }
+
+               /* Compare elements */
+               value = FCOMPARE(lambda, cmp1, cmp2, code);
+               if (value != expect)
+                   break;
+
+               /* Update offsets */
+               ++off1;
+               ++off2;
+               if (seq1.type != LispString_t)
+                   list1 = CDR(list1);
+           }
+
+           /* If all elements matched */
+           if (off1 == end1) {
+               offset = off2 - length1;
+               break;
+           }
+
+           /* Update offset */
+           --end2;
+       }
+
+       if (seq2.type != LispString_t)
+           LispFree(seq2.data.vector);
+    }
+
+    return (offset == -1 ? NIL : FIXNUM(offset));
+}
+
+/*
+ * ext::getenv
+ */
+LispObj *
+Lisp_Setenv(LispBuiltin *builtin)
+/*
+ setenv name value &optional overwrite
+ */
+{
+    char *name, *value;
+
+    LispObj *oname, *ovalue, *overwrite;
+
+    overwrite = ARGUMENT(2);
+    ovalue = ARGUMENT(1);
+    oname = ARGUMENT(0);
+
+    CHECK_STRING(oname);
+    name = THESTR(oname);
+
+    CHECK_STRING(ovalue);
+    value = THESTR(ovalue);
+
+    setenv(name, value, overwrite != UNSPEC && overwrite != NIL);
+    value = getenv(name);
+
+    return (value ? STRING(value) : NIL);
+}
+
+LispObj *
+Lisp_Set(LispBuiltin *builtin)
+/*
+ set symbol value
+ */
+{
+    LispAtom *atom;
+    LispObj *symbol, *value;
+
+    value = ARGUMENT(1);
+    symbol = ARGUMENT(0);
+
+    CHECK_SYMBOL(symbol);
+    atom = symbol->data.atom;
+    if (atom->dyn)
+       LispSetVar(symbol, value);
+    else if (atom->watch || !atom->a_object)
+       LispSetAtomObjectProperty(atom, value);
+    else {
+       CHECK_CONSTANT(symbol);
+       SETVALUE(atom, value);
+    }
+
+    return (value);
+}
+
+LispObj *
+Lisp_SetDifference(LispBuiltin *builtin)
+/*
+ set-difference list1 list2 &key test test-not key
+ */
+{
+    return (LispListSet(builtin, SETDIFFERENCE));
+}
+
+LispObj *
+Lisp_SetExclusiveOr(LispBuiltin *builtin)
+/*
+ set-exclusive-or list1 list2 &key test test-not key
+ */
+{
+    return (LispListSet(builtin, SETEXCLUSIVEOR));
+}
+
+LispObj *
+Lisp_NsetExclusiveOr(LispBuiltin *builtin)
+/*
+ nset-exclusive-or list1 list2 &key test test-not key
+ */
+{
+    return (LispListSet(builtin, NSETEXCLUSIVEOR));
+}
+
+LispObj *
+Lisp_SetQ(LispBuiltin *builtin)
+/*
+ setq &rest form
+ */
+{
+    LispObj *result, *variable, *form;
+
+    form = ARGUMENT(0);
+
+    result = NIL;
+    for (; CONSP(form); form = CDR(form)) {
+       variable = CAR(form);
+       CHECK_SYMBOL(variable);
+       CHECK_CONSTANT(variable);
+       form = CDR(form);
+       if (!CONSP(form))
+           LispDestroy("%s: odd number of arguments", STRFUN(builtin));
+       result = EVAL(CAR(form));
+       LispSetVar(variable, result);
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Psetq(LispBuiltin *builtin)
+/*
+ psetq &rest form
+ */
+{
+    GC_ENTER();
+    int base = gc__protect;
+    LispObj *value, *symbol, *list, *form;
+
+    form = ARGUMENT(0);
+
+    /* parallel setq, first pass evaluate values and basic error checking */
+    for (list = form; CONSP(list); list = CDR(list)) {
+       symbol = CAR(list);
+       CHECK_SYMBOL(symbol);
+       list = CDR(list);
+       if (!CONSP(list))
+           LispDestroy("%s: odd number of arguments", STRFUN(builtin));
+       value = EVAL(CAR(list));
+       GC_PROTECT(value);
+    }
+
+    /* second pass, assign values */
+    for (; CONSP(form); form = CDDR(form)) {
+       symbol = CAR(form);
+       CHECK_CONSTANT(symbol);
+       LispSetVar(symbol, lisp__data.protect.objects[base++]);
+    }
+    GC_LEAVE();
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_Setf(LispBuiltin *builtin)
+/*
+ setf &rest form
+ */
+{
+    LispAtom *atom;
+    LispObj *setf, *place, *value, *result = NIL, *data;
+
+    LispObj *form;
+
+    form = ARGUMENT(0);
+
+    for (; CONSP(form); form = CDR(form)) {
+       place = CAR(form);
+       form = CDR(form);
+       if (!CONSP(form))
+           LispDestroy("%s: odd number of arguments", STRFUN(builtin));
+       value = CAR(form);
+
+       if (!POINTERP(place))
+           goto invalid_place;
+       if (XSYMBOLP(place)) {
+           CHECK_CONSTANT(place);
+           result = EVAL(value);
+           (void)LispSetVar(place, result);
+       }
+       else if (XCONSP(place)) {
+           /* it really should not be required to protect any object
+            * evaluated here, but is done for safety in case one of
+            * the evaluated forms returns data not gc protected, what
+            * could cause surprises if the object is garbage collected
+            * before finishing setf. */
+           GC_ENTER();
+
+           setf = CAR(place);
+           if (!SYMBOLP(setf))
+               goto invalid_place;
+           if (!CONSP(CDR(place)))
+               goto invalid_place;
+
+           value = EVAL(value);
+           GC_PROTECT(value);
+
+           atom = setf->data.atom;
+           if (atom->a_defsetf == 0) {
+               if (atom->a_defstruct &&
+                   atom->property->structure.function >= 0) {
+                   /* Use a default setf method for the structure field, as
+                    * if this definition have been done
+                    *  (defsetf THE-STRUCT-FIELD (struct) (value)
+                    *   `(lisp::struct-store 'THE-STRUCT-FIELD ,struct ,value))
+                    */
+                   place = CDR(place);
+                   data = CAR(place);
+                   if (CONSP(CDR(place)))
+                       goto invalid_place;
+                   data = EVAL(data);
+                   GC_PROTECT(data);
+                   result = APPLY3(Ostruct_store, setf, data, value);
+                   GC_LEAVE();
+                   continue;
+               }
+               /* Must also expand macros */
+               else if (atom->a_function &&
+                        atom->property->fun.function->funtype == LispMacro) {
+                   result = LispRunSetfMacro(atom, CDR(place), value);
+                   continue;
+               }
+               goto invalid_place;
+           }
+
+           place = CDR(place);
+           setf = setf->data.atom->property->setf;
+           if (SYMBOLP(setf)) {
+               LispObj *arguments, *cons;
+
+               if (!CONSP(CDR(place))) {
+                   arguments = EVAL(CAR(place));
+                   GC_PROTECT(arguments);
+                   result = APPLY2(setf, arguments, value);
+               }
+               else if (!CONSP(CDDR(place))) {
+                   arguments = EVAL(CAR(place));
+                   GC_PROTECT(arguments);
+                   cons = EVAL(CADR(place));
+                   GC_PROTECT(cons);
+                   result = APPLY3(setf, arguments, cons, value);
+               }
+               else {
+                   arguments = cons = CONS(EVAL(CAR(place)), NIL);
+                   GC_PROTECT(arguments);
+                   for (place = CDR(place); CONSP(place); place = CDR(place)) {
+                       RPLACD(cons, CONS(EVAL(CAR(place)), NIL));
+                       cons = CDR(cons);
+                   }
+                   RPLACD(cons, CONS(value, NIL));
+                   result = APPLY(setf, arguments);
+               }
+           }
+           else
+               result = LispRunSetf(atom->property->salist, setf, place, value);
+           GC_LEAVE();
+       }
+       else
+           goto invalid_place;
+    }
+
+    return (result);
+invalid_place:
+    LispDestroy("%s: %s is an invalid place", STRFUN(builtin), STROBJ(place));
+    /*NOTREACHED*/
+    return (NIL);
+}
+
+LispObj *
+Lisp_Psetf(LispBuiltin *builtin)
+/*
+ psetf &rest form
+ */
+{
+    int base;
+    GC_ENTER();
+    LispAtom *atom;
+    LispObj *setf, *place = NIL, *value, *data;
+
+    LispObj *form;
+
+    form = ARGUMENT(0);
+
+    /* parallel setf, first pass evaluate values and basic error checking */
+    base = gc__protect;
+    for (setf = form; CONSP(setf); setf = CDR(setf)) {
+       if (!POINTERP(CAR(setf)))
+           goto invalid_place;
+       setf = CDR(setf);
+       if (!CONSP(setf))
+           LispDestroy("%s: odd number of arguments", STRFUN(builtin));
+       value = EVAL(CAR(setf));
+       GC_PROTECT(value);
+    }
+
+    /* second pass, assign values */
+    for (; CONSP(form); form = CDDR(form)) {
+       place = CAR(form);
+       value = lisp__data.protect.objects[base++];
+
+       if (XSYMBOLP(place)) {
+           CHECK_CONSTANT(place);
+           (void)LispSetVar(place, value);
+       }
+       else if (XCONSP(place)) {
+           LispObj *arguments, *cons;
+           int xbase = lisp__data.protect.length;
+
+           setf = CAR(place);
+           if (!SYMBOLP(setf))
+               goto invalid_place;
+           if (!CONSP(CDR(place)))
+               goto invalid_place;
+
+           atom = setf->data.atom;
+           if (atom->a_defsetf == 0) {
+               if (atom->a_defstruct &&
+                   atom->property->structure.function >= 0) {
+                   place = CDR(place);
+                   data = CAR(place);
+                   if (CONSP(CDR(place)))
+                       goto invalid_place;
+                   data = EVAL(data);
+                   GC_PROTECT(data);
+                   (void)APPLY3(Ostruct_store, setf, data, value);
+                   lisp__data.protect.length = xbase;
+                   continue;
+               }
+               else if (atom->a_function &&
+                        atom->property->fun.function->funtype == LispMacro) {
+                   (void)LispRunSetfMacro(atom, CDR(place), value);
+                   lisp__data.protect.length = xbase;
+                   continue;
+               }
+               goto invalid_place;
+           }
+
+           place = CDR(place);
+           setf = setf->data.atom->property->setf;
+           if (SYMBOLP(setf)) {
+               if (!CONSP(CDR(place))) {
+                   arguments = EVAL(CAR(place));
+                   GC_PROTECT(arguments);
+                   (void)APPLY2(setf, arguments, value);
+               }
+               else if (!CONSP(CDDR(place))) {
+                   arguments = EVAL(CAR(place));
+                   GC_PROTECT(arguments);
+                   cons = EVAL(CADR(place));
+                   GC_PROTECT(cons);
+                   (void)APPLY3(setf, arguments, cons, value);
+               }
+               else {
+                   arguments = cons = CONS(EVAL(CAR(place)), NIL);
+                   GC_PROTECT(arguments);
+                   for (place = CDR(place); CONSP(place); place = CDR(place)) {
+                       RPLACD(cons, CONS(EVAL(CAR(place)), NIL));
+                       cons = CDR(cons);
+                   }
+                   RPLACD(cons, CONS(value, NIL));
+                   (void)APPLY(setf, arguments);
+               }
+               lisp__data.protect.length = xbase;
+           }
+           else
+               (void)LispRunSetf(atom->property->salist, setf, place, value);
+       }
+       else
+           goto invalid_place;
+    }
+    GC_LEAVE();
+
+    return (NIL);
+invalid_place:
+    LispDestroy("%s: %s is an invalid place", STRFUN(builtin), STROBJ(place));
+    /*NOTREACHED*/
+    return (NIL);
+}
+
+LispObj *
+Lisp_Sleep(LispBuiltin *builtin)
+/*
+ sleep seconds
+ */
+{
+    long sec, msec;
+    double value, dsec;
+
+    LispObj *seconds;
+
+    seconds = ARGUMENT(0);
+
+    value = -1.0;
+    switch (OBJECT_TYPE(seconds)) {
+       case LispFixnum_t:
+           value = FIXNUM_VALUE(seconds);
+           break;
+       case LispDFloat_t:
+           value = DFLOAT_VALUE(seconds);
+           break;
+       default:
+           break;
+    }
+
+    if (value < 0.0 || value > MOST_POSITIVE_FIXNUM)
+       LispDestroy("%s: %s is not a positive fixnum",
+                   STRFUN(builtin), STROBJ(seconds));
+
+    msec = modf(value, &dsec) * 1e6;
+    sec = dsec;
+
+    if (sec)
+       sleep(sec);
+    if (msec)
+       usleep(msec);
+
+    return (NIL);
+}
+
+/*
+ *   This function is called recursively, but the contents of "list2" are
+ * kept gc protected until it returns to LispSort. This is required partly
+ * because the "gc protection logic" protects an object, not the contents
+ * of the c pointer.
+ */
+static LispObj *
+LispMergeSort(LispObj *list, LispObj *predicate, LispObj *key, int code)
+{
+    int protect;
+    LispObj *list1, *list2, *left, *right, *result, *cons;
+
+    /* Check if list length is larger than 1 */
+    if (!CONSP(list) || !CONSP(CDR(list)))
+       return (list);
+
+    list1 = list2 = list;
+    for (;;) {
+       list = CDR(list);
+       if (!CONSP(list))
+           break;
+       list = CDR(list);
+       if (!CONSP(list))
+           break;
+       list2 = CDR(list2);
+    }
+    cons = list2;
+    list2 = CDR(list2);
+    RPLACD(cons, NIL);
+
+    protect = 0;
+    if (lisp__data.protect.length + 2 >= lisp__data.protect.space)
+       LispMoreProtects();
+    lisp__data.protect.objects[lisp__data.protect.length++] = list2;
+    list1 = LispMergeSort(list1, predicate, key, code);
+    list2 = LispMergeSort(list2, predicate, key, code);
+
+    left = CAR(list1);
+    right = CAR(list2);
+    if (key != UNSPEC) {
+       protect = lisp__data.protect.length;
+       left = APPLY1(key, left);
+       lisp__data.protect.objects[protect] = left;
+       right = APPLY1(key, right);
+       lisp__data.protect.objects[protect + 1] = right;
+    }
+
+    result = NIL;
+    for (;;) {
+       if ((FCOMPARE(predicate, left, right, code)) == 0 &&
+           (FCOMPARE(predicate, right, left, code)) == 1) {
+           /* right is "smaller" */
+           if (result == NIL)
+               result = list2;
+           else
+               RPLACD(cons, list2);
+           cons = list2;
+           list2 = CDR(list2);
+           if (!CONSP(list2)) {
+               RPLACD(cons, list1);
+               break;
+           }
+           right = CAR(list2);
+           if (key != UNSPEC) {
+               right = APPLY1(key, right);
+               lisp__data.protect.objects[protect + 1] = right;
+           }
+       }
+       else {
+           /* left is "smaller" */
+           if (result == NIL)
+               result = list1;
+           else
+               RPLACD(cons, list1);
+           cons = list1;
+           list1 = CDR(list1);
+           if (!CONSP(list1)) {
+               RPLACD(cons, list2);
+               break;
+           }
+           left = CAR(list1);
+           if (key != UNSPEC) {
+               left = APPLY1(key, left);
+               lisp__data.protect.objects[protect] = left;
+           }
+       }
+    }
+    if (key != UNSPEC)
+       lisp__data.protect.length = protect;
+
+    return (result);
+}
+
+/* XXX The first version made a copy of the list and then adjusted
+ *     the CARs of the list. To minimize GC time now it is now doing
+ *     the sort inplace. So, instead of writing just (sort variable)
+ *     now it is required to write (setq variable (sort variable))
+ *     if the variable should always keep all elements.
+ */
+LispObj *
+Lisp_Sort(LispBuiltin *builtin)
+/*
+ sort sequence predicate &key key
+ */
+{
+    GC_ENTER();
+    int istring, code;
+    long length;
+    char *string;
+
+    LispObj *list, *work, *cons = NULL;
+
+    LispObj *sequence, *predicate, *key;
+
+    key = ARGUMENT(2);
+    predicate = ARGUMENT(1);
+    sequence = ARGUMENT(0);
+
+    length = LispLength(sequence);
+    if (length < 2)
+       return (sequence);
+
+    list = sequence;
+    istring = XSTRINGP(sequence);
+    if (istring) {
+       CHECK_STRING_WRITABLE(sequence);
+       /* Convert string to list */
+       string = THESTR(sequence);
+       work = cons = CONS(SCHAR(string[0]), NIL);
+       GC_PROTECT(work);
+       for (++string; *string; ++string) {
+           RPLACD(cons, CONS(SCHAR(*string), NIL));
+           cons = CDR(cons);
+       }
+    }
+    else if (ARRAYP(list))
+       work = list->data.array.list;
+    else
+       work = list;
+
+    FUNCTION_CHECK(predicate);
+    code = FCODE(predicate);
+    work = LispMergeSort(work, predicate, key, code);
+
+    if (istring) {
+       /* Convert list to string */
+       string = THESTR(sequence);
+       for (; CONSP(work); ++string, work = CDR(work))
+           *string = SCHAR_VALUE(CAR(work));
+    }
+    else if (ARRAYP(list))
+       list->data.array.list = work;
+    else
+       sequence = work;
+    GC_LEAVE();
+
+    return (sequence);
+}
+
+LispObj *
+Lisp_Subseq(LispBuiltin *builtin)
+/*
+ subseq sequence start &optional end
+ */
+{
+    long start, end, length, seqlength;
+
+    LispObj *sequence, *ostart, *oend, *result;
+
+    oend = ARGUMENT(2);
+    ostart = ARGUMENT(1);
+    sequence = ARGUMENT(0);
+
+    LispCheckSequenceStartEnd(builtin, sequence, ostart, oend,
+                             &start, &end, &length);
+
+    seqlength = end - start;
+
+    if (sequence == NIL)
+       result = NIL;
+    else if (XSTRINGP(sequence)) {
+       char *string = LispMalloc(seqlength + 1);
+
+       memcpy(string, THESTR(sequence) + start, seqlength);
+       string[seqlength] = '\0';
+       result = STRING2(string);
+    }
+    else {
+       GC_ENTER();
+       LispObj *object;
+
+       if (end > start) {
+           /* list or array */
+           int count;
+           LispObj *cons;
+
+           if (ARRAYP(sequence))
+               object = sequence->data.array.list;
+           else
+               object = sequence;
+           /* goto first element to copy */
+           for (count = 0; count < start; count++, object = CDR(object))
+               ;
+           result = cons = CONS(CAR(object), NIL);
+           GC_PROTECT(result);
+           for (++count, object = CDR(object); count < end; count++,
+                object = CDR(object)) {
+               RPLACD(cons, CONS(CAR(object), NIL));
+               cons = CDR(cons);
+           }
+       }
+       else
+           result = NIL;
+
+       if (ARRAYP(sequence)) {
+           object = LispNew(NIL, NIL);
+           GC_PROTECT(object);
+           object->type = LispArray_t;
+           object->data.array.list = result;
+           object->data.array.dim = CONS(FIXNUM(seqlength), NIL);
+           object->data.array.rank = 1;
+           object->data.array.type = sequence->data.array.type;
+           object->data.array.zero = length == 0;
+           result = object;
+       }
+       GC_LEAVE();
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Subsetp(LispBuiltin *builtin)
+/*
+ subsetp list1 list2 &key test test-not key
+ */
+{
+    return (LispListSet(builtin, SUBSETP));
+}
+
+
+LispObj *
+Lisp_Substitute(LispBuiltin *builtin)
+/*
+ substitute newitem olditem sequence &key from-end test test-not start end count key
+ */
+{
+    return (LispDeleteRemoveXSubstitute(builtin, SUBSTITUTE, NONE));
+}
+
+LispObj *
+Lisp_SubstituteIf(LispBuiltin *builtin)
+/*
+ substitute-if newitem test sequence &key from-end start end count key
+ */
+{
+    return (LispDeleteRemoveXSubstitute(builtin, SUBSTITUTE, IF));
+}
+
+LispObj *
+Lisp_SubstituteIfNot(LispBuiltin *builtin)
+/*
+ substitute-if-not newitem test sequence &key from-end start end count key
+ */
+{
+    return (LispDeleteRemoveXSubstitute(builtin, SUBSTITUTE, IFNOT));
+}
+
+LispObj *
+Lisp_Symbolp(LispBuiltin *builtin)
+/*
+ symbolp object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (SYMBOLP(object) ? T : NIL);
+}
+
+LispObj *
+Lisp_SymbolFunction(LispBuiltin *builtin)
+/*
+ symbol-function symbol
+ */
+{
+    LispObj *symbol;
+
+    symbol = ARGUMENT(0);
+    CHECK_SYMBOL(symbol);
+
+    return (LispSymbolFunction(symbol));
+}
+
+LispObj *
+Lisp_SymbolName(LispBuiltin *builtin)
+/*
+ symbol-name symbol
+ */
+{
+    LispObj *symbol;
+
+    symbol = ARGUMENT(0);
+    CHECK_SYMBOL(symbol);
+
+    return (LispSymbolName(symbol));
+}
+
+LispObj *
+Lisp_SymbolPackage(LispBuiltin *builtin)
+/*
+ symbol-package symbol
+ */
+{
+    LispObj *symbol;
+
+    symbol = ARGUMENT(0);
+    CHECK_SYMBOL(symbol);
+
+    symbol = symbol->data.atom->package;
+
+    return (symbol ? symbol : NIL);
+}
+
+LispObj *
+Lisp_SymbolPlist(LispBuiltin *builtin)
+/*
+ symbol-plist symbol
+ */
+{
+    LispObj *symbol;
+
+    symbol = ARGUMENT(0);
+
+    CHECK_SYMBOL(symbol);
+
+    return (symbol->data.atom->a_property ?
+           symbol->data.atom->property->properties : NIL);
+}
+
+LispObj *
+Lisp_SymbolValue(LispBuiltin *builtin)
+/*
+ symbol-value symbol
+ */
+{
+    LispAtom *atom;
+    LispObj *symbol;
+
+    symbol = ARGUMENT(0);
+
+    CHECK_SYMBOL(symbol);
+    atom = symbol->data.atom;
+    if (!atom->a_object || atom->property->value == UNBOUND) {
+       if (atom->package == lisp__data.keyword)
+           return (symbol);
+       LispDestroy("%s: the symbol %s has no value",
+                   STRFUN(builtin), STROBJ(symbol));
+    }
+
+    return (atom->dyn ? LispGetVar(symbol) : atom->property->value);
+}
+
+LispObj *
+Lisp_Tagbody(LispBuiltin *builtin)
+/*
+ tagbody &rest body
+ */
+{
+    GC_ENTER();
+    int stack, lex, length;
+    LispObj *list, *body, *ptr, *tag, *labels, *map, **p_body;
+    LispBlock *block;
+
+    body = ARGUMENT(0);
+
+    /* Save environment information */
+    stack = lisp__data.stack.length;
+    lex = lisp__data.env.lex;
+    length = lisp__data.env.length;
+
+    /* Since the body may be large, and the code may iterate several
+     * thousand times, it is not a bad idea to avoid checking all
+     * elements of the body to verify if it is a tag. */
+    for (labels = map = NIL, ptr = body; CONSP(ptr); ptr = CDR(ptr)) {
+       tag = CAR(ptr);
+       switch (OBJECT_TYPE(tag)) {
+           case LispNil_t:
+           case LispAtom_t:
+           case LispFixnum_t:
+               /* Don't allow duplicated labels */
+               for (list = labels; CONSP(list); list = CDDR(list)) {
+                   if (CAR(list) == tag)
+                       LispDestroy("%s: tag %s specified more than once",
+                                   STRFUN(builtin), STROBJ(tag));
+               }
+               if (labels == NIL) {
+                   labels = CONS(tag, CONS(NIL, NIL));
+                   map = CDR(labels);
+                   GC_PROTECT(labels);
+               }
+               else {
+                   RPLACD(map, CONS(tag, CONS(NIL, NIL)));
+                   map = CDDR(map);
+               }
+               break;
+           case LispCons_t:
+               /* Restart point for tag */
+               if (map != NIL && CAR(map) == NIL)
+                   RPLACA(map, ptr);
+               break;
+           default:
+               break;
+       }
+    }
+    /* Check for consecutive labels without code between them */
+    for (ptr = labels; CONSP(ptr); ptr = CDDR(ptr)) {
+       if (CADR(ptr) == NIL) {
+           for (map = CDDR(ptr); CONSP(map); map = CDDR(map)) {
+               if (CADR(map) != NIL) {
+                   RPLACA(CDR(ptr), CADR(map));
+                   break;
+               }
+           }
+       }
+    }
+
+    /* Initialize */
+    list = body;
+    p_body = &body;
+    block = LispBeginBlock(NIL, LispBlockBody);
+
+    /* Loop */
+    if (setjmp(block->jmp) != 0) {
+       /* Restore environment */
+       lisp__data.stack.length = stack;
+       lisp__data.env.lex = lex;
+       lisp__data.env.head = lisp__data.env.length = length;
+
+       tag = lisp__data.block.block_ret;
+       for (ptr = labels; CONSP(ptr); ptr = CDDR(ptr)) {
+           map = CAR(ptr);
+           if (map == tag)
+               break;
+       }
+
+       if (!CONSP(ptr))
+           LispDestroy("%s: no such tag %s", STRFUN(builtin), STROBJ(tag));
+
+       *p_body = CADR(ptr);
+    }
+
+    /* Execute code */
+    for (; CONSP(body); body = CDR(body)) {
+       LispObj *form = CAR(body);
+
+       if (CONSP(form))
+           EVAL(form);
+    }
+    /* If got here, (go) not called, else, labels will be candidate to gc
+     * when GC_LEAVE() be called by the code in the bottom of the stack. */
+    GC_LEAVE();
+
+    /* Finished */
+    LispEndBlock(block);
+
+    /* Always return NIL */
+    return (NIL);
+}
+
+LispObj *
+Lisp_The(LispBuiltin *builtin)
+/*
+ the value-type form
+ */
+{
+    LispObj *value_type, *form;
+
+    form = ARGUMENT(1);
+    value_type = ARGUMENT(0);
+
+    form = EVAL(form);
+
+    return (LispCoerce(builtin, form, value_type));
+}
+
+LispObj *
+Lisp_Throw(LispBuiltin *builtin)
+/*
+ throw tag result
+ */
+{
+    unsigned blevel = lisp__data.block.block_level;
+
+    LispObj *tag, *result;
+
+    result = ARGUMENT(1);
+    tag = ARGUMENT(0);
+
+    tag = EVAL(tag);
+
+    if (blevel == 0)
+       LispDestroy("%s: not within a block", STRFUN(builtin));
+
+    while (blevel) {
+       LispBlock *block = lisp__data.block.block[--blevel];
+
+       if (block->type == LispBlockCatch && tag == block->tag) {
+           lisp__data.block.block_ret = EVAL(result);
+           LispBlockUnwind(block);
+           BLOCKJUMP(block);
+       }
+    }
+    LispDestroy("%s: %s is not a valid tag", STRFUN(builtin), STROBJ(tag));
+
+    /*NOTREACHED*/
+    return (NIL);
+}
+
+static LispObj *
+LispTreeEqual(LispObj *left, LispObj *right, LispObj *test, int expect)
+{
+    LispObj *cmp_left, *cmp_right;
+
+    if ((OBJECT_TYPE(left)) ^ (OBJECT_TYPE(right)))
+       return (NIL);
+    if (CONSP(left)) {
+       for (; CONSP(left) && CONSP(right);
+            left = CDR(left), right = CDR(right)) {
+           cmp_left = CAR(left);
+           cmp_right = CAR(right);
+           if ((OBJECT_TYPE(cmp_left)) ^ (OBJECT_TYPE(cmp_right)))
+               return (NIL);
+           if (CONSP(cmp_left)) {
+               if (LispTreeEqual(cmp_left, cmp_right, test, expect) == NIL)
+                   return (NIL);
+           }
+           else {
+               if (POINTERP(cmp_left) &&
+                   (XQUOTEP(cmp_left) || XBACKQUOTEP(cmp_left))) {
+                   cmp_left = cmp_left->data.quote;
+                   cmp_right = cmp_right->data.quote;
+               }
+               else if (COMMAP(cmp_left)) {
+                   cmp_left = cmp_left->data.comma.eval;
+                   cmp_right = cmp_right->data.comma.eval;
+               }
+               if ((APPLY2(test, cmp_left, cmp_right) != NIL) != expect)
+                   return (NIL);
+           }
+       }
+       if ((OBJECT_TYPE(left)) ^ (OBJECT_TYPE(right)))
+           return (NIL);
+    }
+
+    if (POINTERP(left) && (XQUOTEP(left) || XBACKQUOTEP(left))) {
+       left = left->data.quote;
+       right = right->data.quote;
+    }
+    else if (COMMAP(left)) {
+       left = left->data.comma.eval;
+       right = right->data.comma.eval;
+    }
+
+    return ((APPLY2(test, left, right) != NIL) == expect ? T : NIL);
+}
+
+LispObj *
+Lisp_TreeEqual(LispBuiltin *builtin)
+/*
+ tree-equal tree-1 tree-2 &key test test-not
+ */
+{
+    int expect;
+    LispObj *compare;
+
+    LispObj *tree_1, *tree_2, *test, *test_not;
+
+    test_not = ARGUMENT(3);
+    test = ARGUMENT(2);
+    tree_2 = ARGUMENT(1);
+    tree_1 = ARGUMENT(0);
+
+    CHECK_TEST_0();
+    if (test_not != UNSPEC) {
+       expect = 0;
+       compare = test_not;
+    }
+    else {
+       if (test == UNSPEC)
+           test = Oeql;
+       expect = 1;
+       compare = test;
+    }
+
+    return (LispTreeEqual(tree_1, tree_2, compare, expect));
+}
+
+LispObj *
+Lisp_Typep(LispBuiltin *builtin)
+/*
+ typep object type
+ */
+{
+    LispObj *result = NULL;
+
+    LispObj *object, *type;
+
+    type = ARGUMENT(1);
+    object = ARGUMENT(0);
+
+    if (SYMBOLP(type)) {
+       Atom_id atom = ATOMID(type);
+
+       if (OBJECT_TYPE(object) == LispStruct_t)
+           result = ATOMID(CAR(object->data.struc.def)) == atom ? T : NIL;
+       else if (type->data.atom->a_defstruct &&
+                type->data.atom->property->structure.function == STRUCT_NAME)
+           result = NIL;
+       else if (atom == Snil)
+           result = object == NIL ? T : NIL;
+       else if (atom == St)
+           result = object == T ? T : NIL;
+       else if (atom == Satom)
+           result = !CONSP(object) ? T : NIL;
+       else if (atom == Ssymbol)
+           result = SYMBOLP(object) || object == NIL || object == T ? T : NIL;
+       else if (atom == Sinteger)
+           result = INTEGERP(object) ? T : NIL;
+       else if (atom == Srational)
+           result = RATIONALP(object) ? T : NIL;
+       else if (atom == Scons || atom == Slist)
+           result = CONSP(object) ? T : NIL;
+       else if (atom == Sstring)
+           result = STRINGP(object) ? T : NIL;
+       else if (atom == Scharacter)
+           result = SCHARP(object) ? T : NIL;
+       else if (atom == Scomplex)
+           result = COMPLEXP(object) ? T : NIL;
+       else if (atom == Svector || atom == Sarray)
+           result = ARRAYP(object) ? T : NIL;
+       else if (atom == Skeyword)
+           result = KEYWORDP(object) ? T : NIL;
+       else if (atom == Sfunction)
+           result = LAMBDAP(object) ? T : NIL;
+       else if (atom == Spathname)
+           result = PATHNAMEP(object) ? T : NIL;
+       else if (atom == Sopaque)
+           result = OPAQUEP(object) ? T : NIL;
+    }
+    else if (CONSP(type)) {
+       if (OBJECT_TYPE(object) == LispStruct_t &&
+           SYMBOLP(CAR(type)) && ATOMID(CAR(type)) == Sstruct &&
+           SYMBOLP(CAR(CDR(type))) && CDR(CDR(type)) == NIL) {
+           result = ATOMID(CAR(object->data.struc.def)) ==
+                    ATOMID(CAR(CDR(type))) ? T : NIL;
+       }
+    }
+    else if (type == NIL)
+       result = object == NIL ? T : NIL;
+    else if (type == T)
+       result = object == T ? T : NIL;
+    if (result == NULL)
+       LispDestroy("%s: bad type specification %s",
+                   STRFUN(builtin), STROBJ(type));
+
+    return (result);
+}
+
+LispObj *
+Lisp_Union(LispBuiltin *builtin)
+/*
+ union list1 list2 &key test test-not key
+ */
+{
+    return (LispListSet(builtin, UNION));
+}
+
+LispObj *
+Lisp_Nunion(LispBuiltin *builtin)
+/*
+ nunion list1 list2 &key test test-not key
+ */
+{
+    return (LispListSet(builtin, NUNION));
+}
+
+LispObj *
+Lisp_Unless(LispBuiltin *builtin)
+/*
+ unless test &rest body
+ */
+{
+    LispObj *result, *test, *body;
+
+    body = ARGUMENT(1);
+    test = ARGUMENT(0);
+
+    result = NIL;
+    test = EVAL(test);
+    RETURN_COUNT = 0;
+    if (test == NIL) {
+       for (; CONSP(body); body = CDR(body))
+           result = EVAL(CAR(body));
+    }
+
+    return (result);
+}
+
+/*
+ * ext::until
+ */
+LispObj *
+Lisp_Until(LispBuiltin *builtin)
+/*
+ until test &rest body
+ */
+{
+    LispObj *result, *test, *body, *prog;
+
+    body = ARGUMENT(1);
+    test = ARGUMENT(0);
+
+    result = NIL;
+    for (;;) {
+       if ((result = EVAL(test)) == NIL) {
+           for (prog = body; CONSP(prog); prog = CDR(prog))
+               (void)EVAL(CAR(prog));
+       }
+       else
+           break;
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_UnwindProtect(LispBuiltin *builtin)
+/*
+ unwind-protect protect &rest cleanup
+ */
+{
+    LispObj *result, **presult = &result;
+    int did_jump, *pdid_jump = &did_jump, destroyed;
+    LispBlock *block;
+
+    LispObj *protect, *cleanup, **pcleanup = &cleanup;
+
+    cleanup = ARGUMENT(1);
+    protect = ARGUMENT(0);
+
+    /* run protected code */
+    *presult = NIL;
+    *pdid_jump = 1;
+    block = LispBeginBlock(NIL, LispBlockProtect);
+    if (setjmp(block->jmp) == 0) {
+       *presult = EVAL(protect);
+       *pdid_jump = 0;
+    }
+    LispEndBlock(block);
+    if (!lisp__data.destroyed && *pdid_jump)
+       *presult = lisp__data.block.block_ret;
+
+    destroyed = lisp__data.destroyed;
+    lisp__data.destroyed = 0;
+
+    /* run cleanup, unprotected code */
+    if (CONSP(*pcleanup))
+       for (; CONSP(cleanup); cleanup = CDR(cleanup))
+           (void)EVAL(CAR(cleanup));
+
+    if (destroyed) {
+       /* in case there is another unwind-protect */
+       LispBlockUnwind(NULL);
+       /* if not, just return to the toplevel */
+       lisp__data.destroyed = 1;
+       LispDestroy(".");
+    }
+
+    return (result);
+}
+
+static LispObj *
+LispValuesList(LispBuiltin *builtin, int check_list)
+{
+    long i, count;
+    LispObj *result;
+
+    LispObj *list;
+
+    list = ARGUMENT(0);
+
+    count = LispLength(list) - 1;
+
+    if (count >= 0) {
+       result = CAR(list);
+       if ((RETURN_CHECK(count)) != count)
+           LispDestroy("%s: too many values", STRFUN(builtin));
+       RETURN_COUNT = count;
+       for (i = 0, list = CDR(list); count && CONSP(list);
+            count--, i++, list = CDR(list))
+           RETURN(i) = CAR(list);
+       if (check_list) {
+           CHECK_LIST(list);
+       }
+    }
+    else {
+       RETURN_COUNT = -1;
+       result = NIL;
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Values(LispBuiltin *builtin)
+/*
+ values &rest objects
+ */
+{
+    return (LispValuesList(builtin, 0));
+}
+
+LispObj *
+Lisp_ValuesList(LispBuiltin *builtin)
+/*
+ values-list list
+ */
+{
+    return (LispValuesList(builtin, 1));
+}
+
+LispObj *
+Lisp_Vector(LispBuiltin *builtin)
+/*
+ vector &rest objects
+ */
+{
+    LispObj *objects;
+
+    objects = ARGUMENT(0);
+
+    return (VECTOR(objects));
+}
+
+LispObj *
+Lisp_When(LispBuiltin *builtin)
+/*
+ when test &rest body
+ */
+{
+    LispObj *result, *test, *body;
+
+    body = ARGUMENT(1);
+    test = ARGUMENT(0);
+
+    result = NIL;
+    test = EVAL(test);
+    RETURN_COUNT = 0;
+    if (test != NIL) {
+       for (; CONSP(body); body = CDR(body))
+           result = EVAL(CAR(body));
+    }
+
+    return (result);
+}
+
+/*
+ * ext::while
+ */
+LispObj *
+Lisp_While(LispBuiltin *builtin)
+/*
+ while test &rest body
+ */
+{
+    LispObj *test, *body, *prog;
+
+    body = ARGUMENT(1);
+    test = ARGUMENT(0);
+
+    for (;;) {
+       if (EVAL(test) != NIL) {
+           for (prog = body; CONSP(prog); prog = CDR(prog))
+               (void)EVAL(CAR(prog));
+       }
+       else
+           break;
+    }
+
+    return (NIL);
+}
+
+/*
+ * ext::unsetenv
+ */
+LispObj *
+Lisp_Unsetenv(LispBuiltin *builtin)
+/*
+ unsetenv name
+ */
+{
+    char *name;
+
+    LispObj *oname;
+
+    oname = ARGUMENT(0);
+
+    CHECK_STRING(oname);
+    name = THESTR(oname);
+
+    unsetenv(name);
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_XeditEltStore(LispBuiltin *builtin)
+/*
+ lisp::elt-store sequence index value
+ */
+{
+    int length, offset;
+
+    LispObj *sequence, *oindex, *value;
+
+    value = ARGUMENT(2);
+    oindex = ARGUMENT(1);
+    sequence = ARGUMENT(0);
+
+    CHECK_INDEX(oindex);
+    offset = FIXNUM_VALUE(oindex);
+    length = LispLength(sequence);
+
+    if (offset >= length)
+       LispDestroy("%s: index %d too large for sequence length %d",
+                   STRFUN(builtin), offset, length);
+
+    if (STRINGP(sequence)) {
+       int ch;
+
+       CHECK_STRING_WRITABLE(sequence);
+       CHECK_SCHAR(value);
+       ch = SCHAR_VALUE(value);
+       if (ch < 0 || ch > 255)
+           LispDestroy("%s: cannot represent character %d",
+                       STRFUN(builtin), ch);
+       THESTR(sequence)[offset] = ch;
+    }
+    else {
+       if (ARRAYP(sequence))
+           sequence = sequence->data.array.list;
+
+       for (; offset > 0; offset--, sequence = CDR(sequence))
+           ;
+       RPLACA(sequence, value);
+    }
+
+    return (value);
+}
+
+LispObj *
+Lisp_XeditPut(LispBuiltin *builtin)
+/*
+ lisp::put symbol indicator value
+ */
+{
+    LispObj *symbol, *indicator, *value;
+
+    value = ARGUMENT(2);
+    indicator = ARGUMENT(1);
+    symbol = ARGUMENT(0);
+
+    CHECK_SYMBOL(symbol);
+
+    return (CAR(LispPutAtomProperty(symbol->data.atom, indicator, value)));
+}
+
+LispObj *
+Lisp_XeditSetSymbolPlist(LispBuiltin *builtin)
+/*
+ lisp::set-symbol-plist symbol list
+ */
+{
+    LispObj *symbol, *list;
+
+    list = ARGUMENT(1);
+    symbol = ARGUMENT(0);
+
+    CHECK_SYMBOL(symbol);
+
+    return (LispReplaceAtomPropertyList(symbol->data.atom, list));
+}
+
+LispObj *
+Lisp_XeditVectorStore(LispBuiltin *builtin)
+/*
+ lisp::vector-store array &rest values
+ */
+{
+    LispObj *value, *list, *object;
+    long rank, count, sequence, offset, accum;
+
+    LispObj *array, *values;
+
+    values = ARGUMENT(1);
+    array = ARGUMENT(0);
+
+    /* check for errors */
+    for (rank = 0, list = values;
+        CONSP(list) && CONSP(CDR(list));
+        list = CDR(list), rank++) {
+       CHECK_INDEX(CAR(values));
+    }
+
+    if (rank == 0)
+       LispDestroy("%s: too few subscripts", STRFUN(builtin));
+    value = CAR(list);
+
+    if (STRINGP(array) && rank == 1) {
+       long ch;
+       long length = STRLEN(array);
+       long offset = FIXNUM_VALUE(CAR(values));
+
+       CHECK_SCHAR(value);
+       CHECK_STRING_WRITABLE(array);
+       ch = SCHAR_VALUE(value);
+       if (offset >= length)
+           LispDestroy("%s: index %ld too large for sequence length %ld",
+                       STRFUN(builtin), offset, length);
+
+       if (ch < 0 || ch > 255)
+           LispDestroy("%s: cannot represent character %ld",
+                       STRFUN(builtin), ch);
+       THESTR(array)[offset] = ch;
+
+       return (value);
+    }
+
+    CHECK_ARRAY(array);
+    if (rank != array->data.array.rank)
+       LispDestroy("%s: too %s subscripts", STRFUN(builtin),
+                   rank < array->data.array.rank ? "few" : "many");
+
+    for (list = values, object = array->data.array.dim;
+        CONSP(CDR(list));
+        list = CDR(list), object = CDR(object)) {
+       if (FIXNUM_VALUE(CAR(list)) >= FIXNUM_VALUE(CAR(object)))
+           LispDestroy("%s: %ld is out of range, index %ld",
+                       STRFUN(builtin),
+                       FIXNUM_VALUE(CAR(list)),
+                       FIXNUM_VALUE(CAR(object)));
+    }
+
+    for (count = sequence = 0, list = values;
+        CONSP(CDR(list));
+        list = CDR(list), sequence++) {
+       for (offset = 0, object = array->data.array.dim;
+            offset < sequence; object = CDR(object), offset++)
+           ;
+       for (accum = 1, object = CDR(object); CONSP(object);
+            object = CDR(object))
+           accum *= FIXNUM_VALUE(CAR(object));
+       count += accum * FIXNUM_VALUE(CAR(list));
+    }
+
+    for (array = array->data.array.list; count > 0; array = CDR(array), count--)
+       ;
+
+    RPLACA(array, value);
+
+    return (value);
+}
+
+LispObj *
+Lisp_XeditDocumentationStore(LispBuiltin *builtin)
+/*
+ lisp::documentation-store symbol type string
+ */
+{
+    LispDocType_t doc_type;
+
+    LispObj *symbol, *type, *string;
+
+    string = ARGUMENT(2);
+    type = ARGUMENT(1);
+    symbol = ARGUMENT(0);
+
+    CHECK_SYMBOL(symbol);
+
+    /* type is checked in LispDocumentationType() */
+    doc_type = LispDocumentationType(builtin, type);
+
+    if (string == NIL)
+       /* allow explicitly releasing memory used for documentation */
+       LispRemDocumentation(symbol, doc_type);
+    else {
+       CHECK_STRING(string);
+       LispAddDocumentation(symbol, string, doc_type);
+    }
+
+    return (string);
+}
diff --git a/xedit/lisp/core.h b/xedit/lisp/core.h
new file mode 100644 (file)
index 0000000..bd911d4
--- /dev/null
@@ -0,0 +1,221 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/core.h,v 1.35tsi Exp $ */
+
+#ifndef Lisp_core_h
+#define Lisp_core_h
+
+#include "lisp/internal.h"
+
+void LispCoreInit(void);
+
+LispObj *Lisp_Acons(LispBuiltin*);
+LispObj *Lisp_Adjoin(LispBuiltin*);
+LispObj *Lisp_Append(LispBuiltin*);
+LispObj *Lisp_And(LispBuiltin*);
+LispObj *Lisp_Aref(LispBuiltin*);
+LispObj *Lisp_Assoc(LispBuiltin*);
+LispObj *Lisp_AssocIf(LispBuiltin*);
+LispObj *Lisp_AssocIfNot(LispBuiltin*);
+LispObj *Lisp_Apply(LispBuiltin*);
+LispObj *Lisp_Atom(LispBuiltin*);
+LispObj *Lisp_Block(LispBuiltin*);
+LispObj *Lisp_Boundp(LispBuiltin*);
+LispObj *Lisp_Butlast(LispBuiltin*);
+LispObj *Lisp_Nbutlast(LispBuiltin*);
+LispObj *Lisp_Car(LispBuiltin*);
+LispObj *Lisp_Case(LispBuiltin*);
+LispObj *Lisp_Catch(LispBuiltin*);
+LispObj *Lisp_Cdr(LispBuiltin*);
+LispObj *Lisp_C_r(LispBuiltin*);
+LispObj *Lisp_Coerce(LispBuiltin*);
+LispObj *Lisp_Cond(LispBuiltin*);
+LispObj *Lisp_Cons(LispBuiltin*);
+LispObj *Lisp_Consp(LispBuiltin*);
+LispObj *Lisp_Constantp(LispBuiltin*);
+LispObj *Lisp_CopyAlist(LispBuiltin*);
+LispObj *Lisp_CopyList(LispBuiltin*);
+LispObj *Lisp_CopyTree(LispBuiltin*);
+LispObj *Lisp_Defconstant(LispBuiltin*);
+LispObj *Lisp_Defmacro(LispBuiltin*);
+LispObj *Lisp_Defun(LispBuiltin*);
+LispObj *Lisp_Defsetf(LispBuiltin*);
+LispObj *Lisp_Defparameter(LispBuiltin*);
+LispObj *Lisp_Defvar(LispBuiltin*);
+LispObj *Lisp_Delete(LispBuiltin*);
+LispObj *Lisp_DeleteDuplicates(LispBuiltin*);
+LispObj *Lisp_DeleteIf(LispBuiltin*);
+LispObj *Lisp_DeleteIfNot(LispBuiltin*);
+LispObj *Lisp_Do(LispBuiltin*);
+LispObj *Lisp_DoP(LispBuiltin*);
+LispObj *Lisp_Documentation(LispBuiltin*);
+LispObj *Lisp_DoList(LispBuiltin*);
+LispObj *Lisp_DoTimes(LispBuiltin*);
+LispObj *Lisp_Elt(LispBuiltin*);
+LispObj *Lisp_Endp(LispBuiltin*);
+LispObj *Lisp_Eq(LispBuiltin*);
+LispObj *Lisp_Eql(LispBuiltin*);
+LispObj *Lisp_Equal(LispBuiltin*);
+LispObj *Lisp_Equalp(LispBuiltin*);
+LispObj *Lisp_Error(LispBuiltin*);
+LispObj *Lisp_Eval(LispBuiltin*);
+LispObj *Lisp_Every(LispBuiltin*);
+LispObj *Lisp_Some(LispBuiltin*);
+LispObj *Lisp_Notevery(LispBuiltin*);
+LispObj *Lisp_Notany(LispBuiltin*);
+LispObj *Lisp_Fboundp(LispBuiltin*);
+LispObj *Lisp_Find(LispBuiltin*);
+LispObj *Lisp_FindIf(LispBuiltin*);
+LispObj *Lisp_FindIfNot(LispBuiltin*);
+LispObj *Lisp_Fill(LispBuiltin*);
+LispObj *Lisp_Fmakunbound(LispBuiltin*);
+LispObj *Lisp_Functionp(LispBuiltin*);
+LispObj *Lisp_Funcall(LispBuiltin*);
+LispObj *Lisp_Gc(LispBuiltin*);
+LispObj *Lisp_Gensym(LispBuiltin*);
+LispObj *Lisp_Get(LispBuiltin*);
+LispObj *Lisp_Getenv(LispBuiltin*);
+LispObj *Lisp_Go(LispBuiltin*);
+LispObj *Lisp_If(LispBuiltin*);
+LispObj *Lisp_IgnoreErrors(LispBuiltin*);
+LispObj *Lisp_Intersection(LispBuiltin*);
+LispObj *Lisp_Nintersection(LispBuiltin*);
+LispObj *Lisp_Keywordp(LispBuiltin*);
+LispObj *Lisp_Lambda(LispBuiltin*);
+LispObj *Lisp_Last(LispBuiltin*);
+LispObj *Lisp_Let(LispBuiltin*);
+LispObj *Lisp_Length(LispBuiltin*);
+LispObj *Lisp_LetP(LispBuiltin*);
+LispObj *Lisp_List(LispBuiltin*);
+LispObj *Lisp_ListLength(LispBuiltin*);
+LispObj *Lisp_ListP(LispBuiltin*);
+LispObj *Lisp_Listp(LispBuiltin*);
+LispObj *Lisp_Loop(LispBuiltin*);
+LispObj *Lisp_MakeArray(LispBuiltin*);
+LispObj *Lisp_MakeList(LispBuiltin*);
+LispObj *Lisp_MakeSymbol(LispBuiltin*);
+LispObj *Lisp_Makunbound(LispBuiltin*);
+LispObj *Lisp_Mapc(LispBuiltin*);
+LispObj *Lisp_Mapcar(LispBuiltin*);
+LispObj *Lisp_Mapcan(LispBuiltin*);
+LispObj *Lisp_Mapl(LispBuiltin*);
+LispObj *Lisp_Maplist(LispBuiltin*);
+LispObj *Lisp_Mapcon(LispBuiltin*);
+LispObj *Lisp_Member(LispBuiltin*);
+LispObj *Lisp_MemberIf(LispBuiltin*);
+LispObj *Lisp_MemberIfNot(LispBuiltin*);
+LispObj *Lisp_MultipleValueBind(LispBuiltin*);
+LispObj *Lisp_MultipleValueCall(LispBuiltin*);
+LispObj *Lisp_MultipleValueProg1(LispBuiltin*);
+LispObj *Lisp_MultipleValueList(LispBuiltin*);
+LispObj *Lisp_MultipleValueSetq(LispBuiltin*);
+LispObj *Lisp_Nconc(LispBuiltin*);
+LispObj *Lisp_Nreverse(LispBuiltin*);
+LispObj *Lisp_NsetDifference(LispBuiltin*);
+LispObj *Lisp_Nsubstitute(LispBuiltin*);
+LispObj *Lisp_NsubstituteIf(LispBuiltin*);
+LispObj *Lisp_NsubstituteIfNot(LispBuiltin*);
+LispObj *Lisp_Nth(LispBuiltin*);
+LispObj *Lisp_Nthcdr(LispBuiltin*);
+LispObj *Lisp_NthValue(LispBuiltin*);
+LispObj *Lisp_Null(LispBuiltin*);
+LispObj *Lisp_Or(LispBuiltin*);
+LispObj *Lisp_Pairlis(LispBuiltin*);
+LispObj *Lisp_Pop(LispBuiltin*);
+LispObj *Lisp_Position(LispBuiltin*);
+LispObj *Lisp_PositionIf(LispBuiltin*);
+LispObj *Lisp_PositionIfNot(LispBuiltin*);
+LispObj *Lisp_Proclaim(LispBuiltin*);
+LispObj *Lisp_Prog1(LispBuiltin*);
+LispObj *Lisp_Prog2(LispBuiltin*);
+LispObj *Lisp_Progn(LispBuiltin*);
+LispObj *Lisp_Progv(LispBuiltin*);
+LispObj *Lisp_Provide(LispBuiltin*);
+LispObj *Lisp_Push(LispBuiltin*);
+LispObj *Lisp_Pushnew(LispBuiltin*);
+LispObj *Lisp_Quit(LispBuiltin*);
+LispObj *Lisp_Quote(LispBuiltin*);
+LispObj *Lisp_Remove(LispBuiltin*);
+LispObj *Lisp_RemoveDuplicates(LispBuiltin*);
+LispObj *Lisp_RemoveIf(LispBuiltin*);
+LispObj *Lisp_RemoveIfNot(LispBuiltin*);
+LispObj *Lisp_Remprop(LispBuiltin*);
+LispObj *Lisp_Replace(LispBuiltin*);
+LispObj *Lisp_Return(LispBuiltin*);
+LispObj *Lisp_ReturnFrom(LispBuiltin*);
+LispObj *Lisp_Reverse(LispBuiltin*);
+LispObj *Lisp_Rplaca(LispBuiltin*);
+LispObj *Lisp_Rplacd(LispBuiltin*);
+LispObj *Lisp_Search(LispBuiltin*);
+LispObj *Lisp_Setenv(LispBuiltin*);
+LispObj *Lisp_Set(LispBuiltin*);
+LispObj *Lisp_SetDifference(LispBuiltin*);
+LispObj *Lisp_SetExclusiveOr(LispBuiltin*);
+LispObj *Lisp_NsetExclusiveOr(LispBuiltin*);
+LispObj *Lisp_Setf(LispBuiltin*);
+LispObj *Lisp_Psetf(LispBuiltin*);
+LispObj *Lisp_SetQ(LispBuiltin*);
+LispObj *Lisp_Psetq(LispBuiltin*);
+LispObj *Lisp_Sleep(LispBuiltin*);
+LispObj *Lisp_Sort(LispBuiltin*);
+LispObj *Lisp_Subseq(LispBuiltin*);
+LispObj *Lisp_Subsetp(LispBuiltin*);
+LispObj *Lisp_Substitute(LispBuiltin*);
+LispObj *Lisp_SubstituteIf(LispBuiltin*);
+LispObj *Lisp_SubstituteIfNot(LispBuiltin*);
+LispObj *Lisp_Symbolp(LispBuiltin*);
+LispObj *Lisp_SymbolFunction(LispBuiltin*);
+LispObj *Lisp_SymbolName(LispBuiltin*);
+LispObj *Lisp_SymbolPackage(LispBuiltin*);
+LispObj *Lisp_SymbolPlist(LispBuiltin*);
+LispObj *Lisp_SymbolValue(LispBuiltin*);
+LispObj *Lisp_Tagbody(LispBuiltin*);
+LispObj *Lisp_Throw(LispBuiltin*);
+LispObj *Lisp_The(LispBuiltin*);
+LispObj *Lisp_TreeEqual(LispBuiltin*);
+LispObj *Lisp_Typep(LispBuiltin*);
+LispObj *Lisp_Union(LispBuiltin*);
+LispObj *Lisp_Nunion(LispBuiltin*);
+LispObj *Lisp_Unless(LispBuiltin*);
+LispObj *Lisp_Until(LispBuiltin*);
+LispObj *Lisp_Unsetenv(LispBuiltin*);
+LispObj *Lisp_UnwindProtect(LispBuiltin*);
+LispObj *Lisp_Values(LispBuiltin*);
+LispObj *Lisp_ValuesList(LispBuiltin*);
+LispObj *Lisp_Vector(LispBuiltin*);
+LispObj *Lisp_When(LispBuiltin*);
+LispObj *Lisp_While(LispBuiltin*);
+LispObj *Lisp_XeditEltStore(LispBuiltin*);
+LispObj *Lisp_XeditPut(LispBuiltin*);
+LispObj *Lisp_XeditSetSymbolPlist(LispBuiltin*);
+LispObj *Lisp_XeditVectorStore(LispBuiltin*);
+LispObj *Lisp_XeditDocumentationStore(LispBuiltin*);
+
+#endif
diff --git a/xedit/lisp/debugger.c b/xedit/lisp/debugger.c
new file mode 100644 (file)
index 0000000..c9de39d
--- /dev/null
@@ -0,0 +1,828 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/debugger.c,v 1.24tsi Exp $ */
+
+#include <ctype.h>
+#include "lisp/io.h"
+#include "lisp/debugger.h"
+#include "lisp/write.h"
+
+#ifdef DEBUGGER
+#define DebuggerHelp           0
+#define DebuggerAbort          1
+#define DebuggerBacktrace      2
+#define DebuggerContinue       3
+#define DebuggerFinish         4
+#define DebuggerFrame          5
+#define DebuggerNext           6
+#define DebuggerPrint          7
+#define DebuggerStep           8
+#define DebuggerBreak          9
+#define DebuggerDelete         10
+#define DebuggerDown           11
+#define DebuggerUp             12
+#define DebuggerInfo           13
+#define DebuggerWatch          14
+
+#define DebuggerInfoBreakpoints        0
+#define DebuggerInfoBacktrace  1
+
+/*
+ * Prototypes
+ */
+static char *format_integer(int);
+static void LispDebuggerCommand(LispObj *obj);
+
+/*
+ * Initialization
+ */
+static struct {
+    char *name;
+    int action;
+} commands[] = {
+    {"help",           DebuggerHelp},
+    {"abort",          DebuggerAbort},
+    {"backtrace",      DebuggerBacktrace},
+    {"b",              DebuggerBreak},
+    {"break",          DebuggerBreak},
+    {"bt",             DebuggerBacktrace},
+    {"continue",       DebuggerContinue},
+    {"d",              DebuggerDelete},
+    {"delete",         DebuggerDelete},
+    {"down",           DebuggerDown},
+    {"finish",         DebuggerFinish},
+    {"frame",          DebuggerFrame},
+    {"info",           DebuggerInfo},
+    {"n",              DebuggerNext},
+    {"next",           DebuggerNext},
+    {"print",          DebuggerPrint},
+    {"run",            DebuggerContinue},
+    {"s",              DebuggerStep},
+    {"step",           DebuggerStep},
+    {"up",             DebuggerUp},
+    {"watch",          DebuggerWatch},
+};
+
+static struct {
+    char *name;
+    int subaction;
+} info_commands[] = {
+    {"breakpoints",    DebuggerInfoBreakpoints},
+    {"stack",          DebuggerInfoBacktrace},
+    {"watchpoints",    DebuggerInfoBreakpoints},
+};
+
+static char debugger_help[] =
+"Available commands are:\n\
+\n\
+help           - This message.\n\
+abort          - Abort the current execution, and return to toplevel.\n\
+backtrace, bt  - Print backtrace.\n\
+b, break       - Set breakpoint at function name argument.\n\
+continue       - Continue execution.\n\
+d, delete      - Delete breakpoint(s), all breakpoint if no arguments given.\n\
+down           - Set environment to frame called by the current one.\n\
+finish         - Executes until current form is finished.\n\
+frame          - Set environment to selected frame.\n\
+info           - Prints information about the debugger state.\n\
+n, next                - Evaluate next form.\n\
+print          - Print value of variable name argument.\n\
+run            - Continue execution.\n\
+s, step                - Evaluate next form, stopping on any subforms.\n\
+up             - Set environment to frame that called the current one.\n\
+\n\
+Commands may be abbreviated.\n";
+
+static char debugger_info_help[] =
+"Available subcommands are:\n\
+\n\
+breakpoints    - List and prints status of breakpoints, and watchpoints.\n\
+stack          - Backtrace of stack.\n\
+watchpoints    - List and prints status of watchpoints, and breakpoints.\n\
+\n\
+Subcommands may be abbreviated.\n";
+
+/* Debugger variables layout (if you change it, update description):
+ *
+ * DBG
+ *     is a macro for lisp__data.dbglist
+ *     is a NIL terminated list
+ *     every element is a list in the format (NOT NIL terminated):
+ *     (list* NAM ARG ENV HED LEX)
+ *     where
+ *             NAM is an ATOM for the function/macro name
+ *                 or NIL for lambda expressions
+ *             ARG is NAM arguments (a LIST)
+ *             ENV is the value of lisp__data.stack.base (a FIXNUM)
+ *             LEN is the value of lisp__data.env.length (a FIXNUM)
+ *             LEX is the value of lisp__data.env.lex (a FIXNUM)
+ *     new elements are added to the beggining of the DBG list
+ *
+ * BRK
+ *     is macro for lisp__data.brklist
+ *     is a NIL terminated list
+ *     every element is a list in the format (NIL terminated):
+ *     (list NAM IDX TYP HIT VAR VAL FRM)
+ *     where
+ *             NAM is an ATOM for the name of the object at
+ *                 wich the breakpoint was added
+ *             IDX is a FIXNUM, the breakpoint number
+ *                 must be stored, as breakpoints may be deleted
+ *             TYP is a FIXNUM that must be an integer of enum LispBreakType
+ *             HIT is a FIXNUM, with the number of times this breakpoint was
+ *                 hitted.
+ *             VAR variable to watch a SYMBOL  (not needed for breakpoints)
+ *             VAL value of watched variable   (not needed for breakpoints)
+ *             FRM frame where variable started being watched
+ *                                             (not needed for breakpoints)
+ *     new elements are added to the end of the list
+ */
+
+/*
+ * Implementation
+ */
+void
+LispDebugger(LispDebugCall call, LispObj *name, LispObj *arg)
+{
+    int force = 0;
+    LispObj *obj, *prev;
+
+    switch (call) {
+       case LispDebugCallBegin:
+           ++lisp__data.debug_level;
+           GCDisable();
+           DBG = CONS(CONS(name, CONS(arg, CONS(FIXNUM(lisp__data.stack.base),
+                      CONS(FIXNUM(lisp__data.env.length),
+                           FIXNUM(lisp__data.env.lex))))), DBG);
+           GCEnable();
+           for (obj = BRK; obj != NIL; obj = CDR(obj))
+               if (ATOMID(CAR(CAR(obj))) == ATOMID(name) &&
+                   FIXNUM_VALUE(CAR(CDR(CDR(CAR(obj))))) ==
+                   LispDebugBreakFunction)
+                   break;
+           if (obj != NIL) {
+               long counter;
+
+               /* if not at a fresh line */
+               if (LispGetColumn(NIL))
+                   LispFputc(Stdout, '\n');
+               LispFputs(Stdout, "BREAK #");
+               LispWriteObject(NIL, CAR(CDR(CAR(obj))));
+               LispFputs(Stdout, "> (");
+               LispWriteObject(NIL, CAR(CAR(DBG)));
+               LispFputc(Stdout, ' ');
+               LispWriteObject(NIL, CAR(CDR(CAR(DBG))));
+               LispFputs(Stdout, ")\n");
+               force = 1;
+               /* update hits counter */
+               counter = FIXNUM_VALUE(CAR(CDR(CDR(CDR(CAR(obj))))));
+               CAR(CDR(CDR(CDR(CAR(obj))))) FIXNUM(counter + 1);
+           }
+           break;
+       case LispDebugCallEnd:
+           DBG = CDR(DBG);
+           if (lisp__data.debug_level < lisp__data.debug_step)
+               lisp__data.debug_step = lisp__data.debug_level;
+           --lisp__data.debug_level;
+           break;
+       case LispDebugCallFatal:
+           LispDebuggerCommand(NIL);
+           return;
+       case LispDebugCallWatch:
+           break;
+    }
+
+    /* didn't return, check watchpoints */
+    if (call == LispDebugCallEnd || call == LispDebugCallWatch) {
+watch_again:
+       for (prev = obj = BRK; obj != NIL; prev = obj, obj = CDR(obj)) {
+           if (FIXNUM_VALUE(CAR(CDR(CDR(CAR(obj))))) ==
+               LispDebugBreakVariable) {
+               /* the variable */
+               LispObj *wat = CAR(CDR(CDR(CDR(CDR(CAR(obj))))));
+               void *sym = LispGetVarAddr(CAAR(obj));
+               LispObj *frm = CAR(CDR(CDR(CDR(CDR(CDR(CDR(CAR(obj))))))));
+
+               if ((sym == NULL && lisp__data.debug_level <= 0) ||
+                   (sym != wat->data.opaque.data &&
+                    FIXNUM_VALUE(frm) > lisp__data.debug_level)) {
+                   LispFputs(Stdout, "WATCH #");
+                   LispFputs(Stdout, format_integer(FIXNUM_VALUE(CAR(CDR(CAR(obj))))));
+                   LispFputs(Stdout, "> ");
+                   LispFputs(Stdout, STRPTR(CAR(CAR(obj))));
+                   LispFputs(Stdout, " deleted. Variable does not exist anymore.\n");
+                   /* force debugger to stop */
+                   force = 1;
+                   if (obj == prev) {
+                       BRK = CDR(BRK);
+                       goto watch_again;
+                   }
+                   else
+                       RPLACD(prev, CDR(obj));
+                   obj = prev;
+               }
+               else {
+                   /* current value */
+                   LispObj *cur = *(LispObj**)wat->data.opaque.data;
+                   /* last value */
+                   LispObj *val = CAR(CDR(CDR(CDR(CDR(CDR(CAR(obj)))))));
+                   if (XEQUAL(val, cur) == NIL) {
+                       long counter;
+
+                       LispFputs(Stdout, "WATCH #");
+                       LispFputs(Stdout, format_integer(FIXNUM_VALUE(CAR(CDR(CAR(obj))))));
+                       LispFputs(Stdout, "> ");
+                       LispFputs(Stdout, STRPTR(CAR(CAR(obj))));
+                       LispFputc(Stdout, '\n');
+
+                       LispFputs(Stdout, "OLD: ");
+                       LispWriteObject(NIL, val);
+
+                       LispFputs(Stdout, "\nNEW: ");
+                       LispWriteObject(NIL, cur);
+                       LispFputc(Stdout, '\n');
+
+                       /* update current value */
+                       CAR(CDR(CDR(CDR(CDR(CDR(CAR(obj))))))) = cur;
+                       /* update hits counter */
+                       counter = FIXNUM_VALUE(CAR(CDR(CDR(CDR(CAR(obj))))));
+                       CAR(CDR(CDR(CDR(CAR(obj))))) = FIXNUM(counter + 1);
+                       /* force debugger to stop */
+                       force = 1;
+                   }
+               }
+           }
+       }
+
+       if (call == LispDebugCallWatch)
+           /* special call, just don't keep gc protected variables that may be
+            * using a lot of memory... */
+           return;
+    }
+
+    switch (lisp__data.debug) {
+       case LispDebugUnspec:
+           LispDebuggerCommand(NIL);
+           goto debugger_done;
+       case LispDebugRun:
+           if (force)
+               LispDebuggerCommand(NIL);
+           goto debugger_done;
+       case LispDebugFinish:
+           if (!force &&
+               (call != LispDebugCallEnd ||
+                lisp__data.debug_level != lisp__data.debug_step))
+               goto debugger_done;
+           break;
+       case LispDebugNext:
+           if (call == LispDebugCallBegin) {
+               if (!force && lisp__data.debug_level != lisp__data.debug_step)
+                   goto debugger_done;
+           }
+           else if (call == LispDebugCallEnd) {
+               if (!force && lisp__data.debug_level >= lisp__data.debug_step)
+                   goto debugger_done;
+           }
+           break;
+       case LispDebugStep:
+           break;
+    }
+
+    if (call == LispDebugCallBegin) {
+       LispFputc(Stdout, '#');
+       LispFputs(Stdout, format_integer(lisp__data.debug_level));
+       LispFputs(Stdout, "> (");
+       LispWriteObject(NIL, CAR(CAR(DBG)));
+       LispFputc(Stdout, ' ');
+       LispWriteObject(NIL, CAR(CDR(CAR(DBG))));
+       LispFputs(Stdout, ")\n");
+       LispDebuggerCommand(NIL);
+    }
+    else if (call == LispDebugCallEnd) {
+       LispFputc(Stdout, '#');
+       LispFputs(Stdout, format_integer(lisp__data.debug_level + 1));
+       LispFputs(Stdout, "= ");
+       LispWriteObject(NIL, arg);
+       LispFputc(Stdout, '\n');
+       LispDebuggerCommand(NIL);
+    }
+    else if (force)
+       LispDebuggerCommand(arg);
+
+debugger_done:
+    return;
+}
+
+static void
+LispDebuggerCommand(LispObj *args)
+{
+    LispObj *obj, *frm, *curframe;
+    int i = 0, frame, matches, action = -1, subaction = 0;
+    char *cmd, *arg, *ptr, line[256];
+
+    int envbase = lisp__data.stack.base,
+       envlen = lisp__data.env.length,
+       envlex = lisp__data.env.lex;
+
+    frame = lisp__data.debug_level;
+    curframe = CAR(DBG);
+
+    line[0] = '\0';
+    arg = line;
+    for (;;) {
+       LispFputs(Stdout, DBGPROMPT);
+       LispFflush(Stdout);
+       if (LispFgets(Stdin, line, sizeof(line)) == NULL) {
+           LispFputc(Stdout, '\n');
+           return;
+       }
+       /* get command */
+       ptr = line;
+       while (*ptr && isspace(*ptr))
+           ++ptr;
+       cmd = ptr;
+       while (*ptr && !isspace(*ptr))
+           ++ptr;
+       if (*ptr)
+           *ptr++ = '\0';
+
+       if (*cmd) {     /* if *cmd is nul, then arg may be still set */
+           /* get argument(s) */
+           while (*ptr && isspace(*ptr))
+               ++ptr;
+           arg = ptr;
+           /* goto end of line */
+           if (*ptr) {
+               while (*ptr)
+                   ++ptr;
+               --ptr;
+               while (*ptr && isspace(*ptr))
+                   --ptr;
+               if (*ptr)
+                   *++ptr = '\0';
+           }
+       }
+
+       if (*cmd == '\0') {
+           if (action < 0) {
+               if (lisp__data.debug == LispDebugFinish)
+                   action = DebuggerFinish;
+               else if (lisp__data.debug == LispDebugNext)
+                   action = DebuggerNext;
+               else if (lisp__data.debug == LispDebugStep)
+                   action = DebuggerStep;
+               else if (lisp__data.debug == LispDebugRun)
+                   action = DebuggerContinue;
+               else
+                   continue;
+           }
+       }
+       else {
+           for (i = matches = 0; i < sizeof(commands) / sizeof(commands[0]);
+                i++) {
+               char *str = commands[i].name;
+
+               ptr = cmd;
+               while (*ptr && *ptr == *str) {
+                   ++ptr;
+                   ++str;
+               }
+               if (*ptr == '\0') {
+                   action = commands[i].action;
+                   if (*str == '\0') {
+                       matches = 1;
+                       break;
+                   }
+                   ++matches;
+               }
+           }
+           if (matches == 0) {
+               LispFputs(Stdout, "* Command unknown: ");
+               LispFputs(Stdout, cmd);
+               LispFputs(Stdout, ". Type help for help.\n");
+               continue;
+           }
+           else if (matches > 1) {
+               LispFputs(Stdout, "* Command is ambiguous: ");
+               LispFputs(Stdout, cmd);
+               LispFputs(Stdout, ". Type help for help.\n");
+               continue;
+           }
+       }
+
+       switch (action) {
+           case DebuggerHelp:
+               LispFputs(Stdout, debugger_help);
+               break;
+           case DebuggerInfo:
+               if (*arg == '\0') {
+                   LispFputs(Stdout, debugger_info_help);
+                   break;
+               }
+
+               for (i = matches = 0;
+                    i < sizeof(info_commands) / sizeof(info_commands[0]);
+                    i++) {
+                   char *str = info_commands[i].name;
+
+                   ptr = arg;
+                   while (*ptr && *ptr == *str) {
+                       ++ptr;
+                       ++str;
+                   }
+                   if (*ptr == '\0') {
+                       subaction = info_commands[i].subaction;
+                       if (*str == '\0') {
+                           matches = 1;
+                           break;
+                       }
+                       ++matches;
+                   }
+               }
+               if (matches == 0) {
+                   LispFputs(Stdout, "* Command unknown: ");
+                   LispFputs(Stdout, arg);
+                   LispFputs(Stdout, ". Type info for help.\n");
+                   continue;
+               }
+               else if (matches > 1) {
+                   LispFputs(Stdout, "* Command is ambiguous: ");
+                   LispFputs(Stdout, arg);
+                   LispFputs(Stdout, ". Type info for help.\n");
+                   continue;
+               }
+
+               switch (subaction) {
+                   case DebuggerInfoBreakpoints:
+                       LispFputs(Stdout, "Num\tHits\tType\t\tWhat\n");
+                       for (obj = BRK; obj != NIL; obj = CDR(obj)) {
+                           /* breakpoint number */
+                           LispFputc(Stdout, '#');
+                           LispWriteObject(NIL, CAR(CDR(CAR(obj))));
+
+                           /* number of hits */
+                           LispFputc(Stdout, '\t');
+                           LispWriteObject(NIL, CAR(CDR(CDR(CDR(CAR(obj))))));
+
+                           /* breakpoint type */
+                           LispFputc(Stdout, '\t');
+                           switch ((int)FIXNUM_VALUE(CAR(CDR(CDR(CAR(obj)))))) {
+                               case LispDebugBreakFunction:
+                                   LispFputs(Stdout, "Function");
+                                   break;
+                               case LispDebugBreakVariable:
+                                   LispFputs(Stdout, "Variable");
+                                   break;
+                           }
+
+                           /* breakpoint object */
+                           LispFputc(Stdout, '\t');
+                           LispWriteObject(NIL, CAR(CAR(obj)));
+                           LispFputc(Stdout, '\n');
+                       }
+                       break;
+                   case DebuggerInfoBacktrace:
+                       goto debugger_print_backtrace;
+               }
+               break;
+           case DebuggerAbort:
+               while (lisp__data.mem.level) {
+                   --lisp__data.mem.level;
+                   if (lisp__data.mem.mem[lisp__data.mem.level])
+                       free(lisp__data.mem.mem[lisp__data.mem.level]);
+               }
+               lisp__data.mem.index = 0;
+               LispTopLevel();
+               if (!lisp__data.running) {
+                   LispMessage("*** Fatal: nowhere to longjmp.");
+                   abort();
+               }
+               /* don't need to restore environment */
+               siglongjmp(lisp__data.jmp, 1);
+               /*NOTREACHED*/
+               break;
+           case DebuggerBreak:
+               for (ptr = arg; *ptr; ptr++) {
+                   if (isspace(*ptr))
+                       break;
+                   else
+                       *ptr = toupper(*ptr);
+               }
+
+               if (!*arg || *ptr || strchr(arg, '(') || strchr(arg, '(') ||
+                   strchr(arg, ';')) {
+                   LispFputs(Stdout, "* Bad function name '");
+                   LispFputs(Stdout, arg);
+                   LispFputs(Stdout, "' specified.\n");
+               }
+               else {
+                   for (obj = frm = BRK; obj != NIL; frm = obj, obj = CDR(obj))
+                       ;
+                   i = lisp__data.debug_break;
+                   ++lisp__data.debug_break;
+                   GCDisable();
+                   obj = CONS(ATOM(arg),
+                              CONS(FIXNUM(i),
+                                   CONS(FIXNUM(LispDebugBreakFunction),
+                                        CONS(FIXNUM(0), NIL))));
+                   if (BRK == NIL)
+                       BRK = CONS(obj, NIL);
+                   else
+                       RPLACD(frm, CONS(obj, NIL));
+                   GCEnable();
+               }
+               break;
+           case DebuggerWatch: {
+               void *sym;
+               int vframe;
+               LispObj *val, *atom;
+
+               /* make variable name uppercase, an ATOM */
+               ptr = arg;
+               while (*ptr) {
+                   *ptr = toupper(*ptr);
+                   ++ptr;
+               }
+               atom = ATOM(arg);
+               val = LispGetVar(atom);
+               if (val == NULL) {
+                   LispFputs(Stdout, "* No variable named '");
+                   LispFputs(Stdout, arg);
+                   LispFputs(Stdout, "' in the selected frame.\n");
+                   break;
+               }
+
+               /* variable is available at the current frame */
+               sym = LispGetVarAddr(atom);
+
+               /* find the lowest frame where the variable is visible */
+               vframe = 0;
+               if (frame > 0) {
+                   for (; vframe < frame; vframe++) {
+                       for (frm = DBG, i = lisp__data.debug_level; i > vframe;
+                            frm = CDR(frm), i--)
+                           ;
+                       obj = CAR(frm);
+                       lisp__data.stack.base = FIXNUM_VALUE(CAR(CDR(CDR(obj))));
+                       lisp__data.env.length = FIXNUM_VALUE(CAR(CDR(CDR(CDR(obj)))));
+                       lisp__data.env.lex = FIXNUM_VALUE(CDR(CDR(CDR(CDR(obj)))));
+
+                       if (LispGetVarAddr(atom) == sym)
+                           /* got variable initial frame */
+                           break;
+                   }
+                   vframe = i;
+                   if (vframe != frame) {
+                       /* restore environment */
+                       for (frm = DBG, i = lisp__data.debug_level; i > frame;
+                            frm = CDR(frm), i--)
+                           ;
+                       obj = CAR(frm);
+                       lisp__data.stack.base = FIXNUM_VALUE(CAR(CDR(CDR(obj))));
+                       lisp__data.env.length = FIXNUM_VALUE(CAR(CDR(CDR(CDR(obj)))));
+                       lisp__data.env.lex = FIXNUM_VALUE(CDR(CDR(CDR(CDR(obj)))));
+                   }
+               }
+
+               i = lisp__data.debug_break;
+               ++lisp__data.debug_break;
+               for (obj = frm = BRK; obj != NIL; frm = obj, obj = CDR(obj))
+                   ;
+
+               GCDisable();
+               obj = CONS(atom,                                        /* NAM */
+                          CONS(FIXNUM(i),                              /* IDX */
+                               CONS(FIXNUM(LispDebugBreakVariable),    /* TYP */
+                                    CONS(FIXNUM(0),                    /* HIT */
+                                         CONS(OPAQUE(sym, 0),          /* VAR */
+                                              CONS(val,                /* VAL */
+                                                   CONS(FIXNUM(vframe),/* FRM */
+                                                             NIL)))))));
+
+               /* add watchpoint */
+               if (BRK == NIL)
+                   BRK = CONS(obj, NIL);
+               else
+                   RPLACD(frm, CONS(obj, NIL));
+               GCEnable();
+           }   break;
+           case DebuggerDelete:
+               if (*arg == 0) {
+                   int confirm = 0;
+
+                   for (;;) {
+                       int ch;
+
+                       LispFputs(Stdout, "* Delete all breakpoints? (y or n) ");
+                       LispFflush(Stdout);
+                       if ((ch = LispFgetc(Stdin)) == '\n')
+                           continue;
+                       while ((i = LispFgetc(Stdin)) != '\n' && i != EOF)
+                           ;
+                       if (tolower(ch) == 'n')
+                           break;
+                       else if (tolower(ch) == 'y') {
+                           confirm = 1;
+                           break;
+                       }
+                   }
+                   if (confirm)
+                       BRK = NIL;
+               }
+               else {
+                   for (ptr = arg; *ptr;) {
+                       while (*ptr && isdigit(*ptr))
+                           ++ptr;
+                       if (*ptr && !isspace(*ptr)) {
+                           *ptr = '\0';
+                           LispFputs(Stdout, "* Bad breakpoint number '");
+                           LispFputs(Stdout, arg);
+                           LispFputs(Stdout, "' specified.\n");
+                           break;
+                       }
+                       i = atoi(arg);
+                       for (obj = frm = BRK; frm != NIL;
+                            obj = frm, frm = CDR(frm))
+                           if (FIXNUM_VALUE(CAR(CDR(CAR(frm)))) == i)
+                               break;
+                       if (frm == NIL) {
+                           LispFputs(Stdout, "* No breakpoint number ");
+                           LispFputs(Stdout, arg);
+                           LispFputs(Stdout, " available.\n");
+                           break;
+                       }
+                       if (obj == frm)
+                           BRK = CDR(BRK);
+                       else
+                           RPLACD(obj, CDR(frm));
+                       while (*ptr && isspace(*ptr))
+                           ++ptr;
+                       arg = ptr;
+                   }
+               }
+               break;
+           case DebuggerFrame:
+               i = -1;
+               ptr = arg;
+               if (*ptr) {
+                   i = 0;
+                   while (*ptr && isdigit(*ptr)) {
+                       i *= 10;
+                       i += *ptr - '0';
+                       ++ptr;
+                   }
+                   if (*ptr) {
+                       LispFputs(Stdout, "* Frame identifier must "
+                               "be a positive number.\n");
+                       break;
+                   }
+               }
+               else
+                   goto debugger_print_frame;
+               if (i >= 0 && i <= lisp__data.debug_level)
+                   goto debugger_new_frame;
+               LispFputs(Stdout, "* No such frame ");
+               LispFputs(Stdout, format_integer(i));
+               LispFputs(Stdout, ".\n");
+               break;
+           case DebuggerDown:
+               if (frame + 1 > lisp__data.debug_level) {
+                   LispFputs(Stdout, "* Cannot go down.\n");
+                   break;
+               }
+               i = frame + 1;
+               goto debugger_new_frame;
+               break;
+           case DebuggerUp:
+               if (frame == 0) {
+                   LispFputs(Stdout, "* Cannot go up.\n");
+                   break;
+               }
+               i = frame - 1;
+               goto debugger_new_frame;
+               break;
+           case DebuggerPrint:
+               ptr = arg;
+               while (*ptr) {
+                   *ptr = toupper(*ptr);
+                   ++ptr;
+               }
+               obj = LispGetVar(ATOM(arg));
+               if (obj != NULL) {
+                   LispWriteObject(NIL, obj);
+                   LispFputc(Stdout, '\n');
+               }
+               else {
+                   LispFputs(Stdout, "* No variable named '");
+                   LispFputs(Stdout, arg);
+                   LispFputs(Stdout, "' in the selected frame.\n");
+               }
+               break;
+           case DebuggerBacktrace:
+debugger_print_backtrace:
+               if (DBG == NIL) {
+                   LispFputs(Stdout, "* No stack.\n");
+                   break;
+               }
+               DBG = LispReverse(DBG);
+               for (obj = DBG, i = 0; obj != NIL; obj = CDR(obj), i++) {
+                   frm = CAR(obj);
+                   LispFputc(Stdout, '#');
+                   LispFputs(Stdout, format_integer(i));
+                   LispFputs(Stdout, "> (");
+                   LispWriteObject(NIL, CAR(frm));
+                   LispFputc(Stdout, ' ');
+                   LispWriteObject(NIL, CAR(CDR(frm)));
+                   LispFputs(Stdout, ")\n");
+               }
+               DBG = LispReverse(DBG);
+               break;
+           case DebuggerContinue:
+               lisp__data.debug = LispDebugRun;
+               goto debugger_command_done;
+           case DebuggerFinish:
+               if (lisp__data.debug != LispDebugFinish) {
+                   lisp__data.debug_step = lisp__data.debug_level - 2;
+                   lisp__data.debug = LispDebugFinish;
+               }
+               else
+                   lisp__data.debug_step = lisp__data.debug_level - 1;
+               goto debugger_command_done;
+           case DebuggerNext:
+               if (lisp__data.debug != LispDebugNext) {
+                   lisp__data.debug = LispDebugNext;
+                   lisp__data.debug_step = lisp__data.debug_level + 1;
+               }
+               goto debugger_command_done;
+           case DebuggerStep:
+               lisp__data.debug = LispDebugStep;
+               goto debugger_command_done;
+       }
+       continue;
+
+debugger_new_frame:
+       /* goto here with i as the new frame value, after error checking */
+       if (i != frame) {
+           frame = i;
+           for (frm = DBG, i = lisp__data.debug_level;
+                i > frame; frm = CDR(frm), i--)
+               ;
+           curframe = CAR(frm);
+           lisp__data.stack.base = FIXNUM_VALUE(CAR(CDR(CDR(curframe))));
+           lisp__data.env.length = FIXNUM_VALUE(CAR(CDR(CDR(CDR(curframe)))));
+           lisp__data.env.lex = FIXNUM_VALUE(CDR(CDR(CDR(CDR(curframe)))));
+       }
+debugger_print_frame:
+       LispFputc(Stdout, '#');
+       LispFputs(Stdout, format_integer(frame));
+       LispFputs(Stdout, "> (");
+       LispWriteObject(NIL, CAR(curframe));
+       LispFputc(Stdout, ' ');
+       LispWriteObject(NIL, CAR(CDR(curframe)));
+       LispFputs(Stdout, ")\n");
+    }
+
+debugger_command_done:
+    lisp__data.stack.base = envbase;
+    lisp__data.env.length = envlen;
+    lisp__data.env.lex = envlex;
+}
+
+static char *
+format_integer(int integer)
+{
+    static char buffer[16];
+
+    sprintf(buffer, "%d", integer);
+
+    return (buffer);
+}
+
+#endif /* DEBUGGER */
diff --git a/xedit/lisp/debugger.h b/xedit/lisp/debugger.h
new file mode 100644 (file)
index 0000000..0af5134
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/debugger.h,v 1.7tsi Exp $ */
+
+#ifndef Lisp_debugger_h
+#define Lisp_debugger_h
+
+/*
+ * Definitions
+ */
+#define        DBGPROMPT       "DEBUG> "
+#ifdef DEBUGGER
+
+/*
+ * Types
+ */
+typedef enum _LispDebugState {
+    LispDebugUnspec,   /* initial state */
+    LispDebugRun,      /* just run, until breakpoint or error */
+    LispDebugFinish,   /* evaluates until selected form is finished */
+    LispDebugNext,     /* evaluate form */
+    LispDebugStep      /* evaluate form, and step on subforms */
+} LispDebugState;
+
+typedef enum _LispDebugCall {
+    LispDebugCallBegin,
+    LispDebugCallEnd,
+    LispDebugCallFatal,
+    LispDebugCallWatch /* just remove watched variables that lost context */
+} LispDebugCall;
+
+typedef enum _LispDebugBreak {
+    LispDebugBreakFunction,
+    LispDebugBreakVariable
+} LispDebugBreak;
+
+#include "lisp/private.h"
+
+/*
+ * Prototypes
+ */
+void LispDebugger(LispDebugCall, LispObj*, LispObj*);
+
+#endif /* DEBUGGER */
+#endif /* Lisp_debugger_h */
diff --git a/xedit/lisp/env.c b/xedit/lisp/env.c
new file mode 100644 (file)
index 0000000..e87793a
--- /dev/null
@@ -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$ */
+
+
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+
+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/xedit/lisp/format.c b/xedit/lisp/format.c
new file mode 100644 (file)
index 0000000..ab85565
--- /dev/null
@@ -0,0 +1,2121 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/format.c,v 1.29tsi Exp $ */
+
+#include "lisp/io.h"
+#include "lisp/write.h"
+#include "lisp/format.h"
+#include <ctype.h>
+
+#define MAXFMT                 8
+#define NOERROR                        0
+
+/* parse error codes */
+#define PARSE_2MANYPARM                1       /* too many directive parameters */
+#define PARSE_2MANYATS         2       /* more than one @ in directive */
+#define PARSE_2MANYCOLS                3       /* more than one : in directive */
+#define PARSE_NOARGSLEFT       4       /* no arguments left to format */
+#define PARSE_BADFMTARG                5       /* argument is not an integer or char */
+#define PARSE_BADDIRECTIVE     6       /* unknown format directive */
+#define PARSE_BADINTEGER       7       /* bad integer representation */
+
+/* merge error codes */
+#define MERGE_2MANY            1       /* too many parameters to directive */
+#define MERGE_NOCHAR           2       /* parameter must be a character */
+#define MERGE_NOINT            3       /* parameter must be an integer */
+
+/* generic error codes */
+#define GENERIC_RADIX          1       /* radix not in range 2-36 */
+#define GENERIC_NEGATIVE       2       /* parameter is negative */
+#define GENERIC_BADSTRING      3       /* argument is not a string */
+#define GENERIC_BADLIST                4       /* argument is not a list */
+
+#define IF_SPECIFIED(arg)      (arg).specified ? &((arg).value) : NULL
+
+#define UPANDOUT_NORMAL                1
+#define UPANDOUT_COLLON                2
+#define UPANDOUT_HASH          4       /* only useful inside a ~{ iteration
+                                        * forces loop finalization. */
+
+#define ITERATION_NORMAL       1
+#define ITERATION_LAST         2
+
+/*
+ * Types
+ */
+/* parameter to format */
+typedef struct {
+    unsigned int achar : 1;    /* value was specified as a character */
+    unsigned int specified : 1;        /* set if value was specified */
+    unsigned int offset : 30;  /* offset in format string, for error printing */
+    int value;
+} FmtArg;
+
+/* information about format parameters */
+typedef struct {
+    unsigned int atsign : 1;   /* @ specified */
+    unsigned int collon : 1;   /* : specified */
+    unsigned int command : 8;  /* the format command */
+    unsigned int count : 4;    /* number of arguments processed */
+    unsigned int offset : 10;  /* offset in format string, for error printing */
+    char *base, *format;
+    FmtArg arguments[MAXFMT];
+} FmtArgs;
+
+/* used for combining default format parameter values */
+typedef struct {
+    int achar;
+    int value;
+} FmtDef;
+
+/* number of default format parameter values and defaults */
+typedef struct {
+    int count;
+    FmtDef defaults[MAXFMT];
+} FmtDefs;
+
+/* used on recursive calls to LispFormat */
+typedef struct {
+    FmtArgs args;
+    LispObj *base_arguments;   /* pointer to first format argument */
+    int total_arguments;       /* number of objects in base_arguments */
+    char **format;             /* if need to update format string pointer */
+    LispObj **object;          /* CAR(arguments), for plural check */
+    LispObj **arguments;       /* current element of base_arguments */
+    int *num_arguments;                /* number of arguments after arguments */
+    int upandout;              /* information for recursive calls */
+    int iteration;             /* only set if in ~:{... or ~:@{ and in the
+                                * last argument list, hint for upandout */
+} FmtInfo;
+
+/*
+ * Prototypes
+ */
+static void merge_arguments(FmtArgs*, FmtDefs*, int*);
+static char *parse_arguments(char*, FmtArgs*, int*, LispObj**, int*);
+static void merge_error(FmtArgs*, int);
+static void parse_error(FmtArgs*, int);
+static void generic_error(FmtArgs*, int);
+static void format_error(FmtArgs*, char*);
+
+static int format_object(LispObj*, LispObj*);
+
+static void format_ascii(LispObj*, LispObj*, FmtArgs*);
+static void format_in_radix(LispObj*, LispObj*, int, FmtArgs*);
+static void format_radix_special(LispObj*, LispObj*, FmtArgs*);
+static void format_roman(LispObj*, LispObj*, FmtArgs*);
+static void format_english(LispObj*, LispObj*, FmtArgs*);
+static void format_character(LispObj*, LispObj*, FmtArgs*);
+static void format_fixed_float(LispObj*, LispObj*, FmtArgs*);
+static void format_exponential_float(LispObj*, LispObj*, FmtArgs*);
+static void format_general_float(LispObj*, LispObj*, FmtArgs*);
+static void format_dollar_float(LispObj*, LispObj*, FmtArgs*);
+static void format_tabulate(LispObj*, FmtArgs*);
+
+static void format_goto(FmtInfo*);
+static void format_indirection(LispObj*, LispObj*, FmtInfo*);
+
+static void list_formats(FmtInfo*, int, char**, char***, int*, int*, int*, int*);
+static void free_formats(char**, int);
+
+static void format_case_conversion(LispObj*, FmtInfo*);
+static void format_conditional(LispObj*, FmtInfo*);
+static void format_iterate(LispObj*, FmtInfo*);
+static void format_justify(LispObj*, FmtInfo*);
+
+static void LispFormat(LispObj*, FmtInfo*);
+
+/*
+ * Initialization
+ */
+static FmtDefs AsciiDefs = {
+    4,
+    {
+       {0, 0},                 /* mincol */
+       {0, 1},                 /* colinc */
+       {0, 0},                 /* minpad */
+       {1, ' '},               /* padchar */
+    },
+};
+
+static FmtDefs IntegerDefs = {
+    4,
+    {
+       {0, 0},                 /* mincol */
+       {1, ' '},               /* padchar */
+       {1, ','},               /* commachar */
+       {0, 3},                 /* commainterval */
+    },
+};
+
+static FmtDefs RadixDefs = {
+    5,
+    {
+       {0, 10},                /* radix */
+       {0, 0},                 /* mincol */
+       {1, ' '},               /* padchar */
+       {1, ','},               /* commachar */
+       {0, 3},                 /* commainterval */
+    },
+};
+
+static FmtDefs NoneDefs = {
+    0,
+};
+
+static FmtDefs FixedFloatDefs = {
+    5,
+    {
+       {0, 0},                 /* w */
+       {0, 16},                /* d */
+       {0, 0},                 /* k */
+       {1, '\0'},              /* overflowchar */
+       {1, ' '},               /* padchar */
+    },
+};
+
+static FmtDefs ExponentialFloatDefs = {
+    7,
+    {
+       {0, 0},                 /* w */
+       {0, 16},                /* d */
+       {0, 0},                 /* e */
+       {0, 1},                 /* k */
+       {1, '\0'},              /* overflowchar */
+       {1, ' '},               /* padchar */
+       {1, 'E'},               /* exponentchar */
+       /* XXX if/when more than one float format,
+        * should default to object type */
+    },
+};
+
+static FmtDefs DollarFloatDefs = {
+    4,
+    {
+       {0, 2},                 /* d */
+       {0, 1},                 /* n */
+       {0, 0},                 /* w */
+       {1, ' '},               /* padchar */
+    },
+};
+
+static FmtDefs OneDefs = {
+    1,
+    {
+       {0, 1},
+    },
+};
+
+static FmtDefs TabulateDefs = {
+    2,
+    {
+       {0, 0},                 /* colnum */
+       {0, 1},                 /* colinc */
+    },
+};
+
+extern LispObj *Oprint_escape;
+
+/*
+ * Implementation
+ */
+static void
+merge_arguments(FmtArgs *arguments, FmtDefs *defaults, int *code)
+{
+    int count;
+    FmtDef *defaul;
+    FmtArg *argument;
+
+    defaul = &(defaults->defaults[0]);
+    argument = &(arguments->arguments[0]);
+    for (count = 0; count < defaults->count; count++, argument++, defaul++) {
+       if (count >= arguments->count)
+           argument->specified = 0;
+       if (argument->specified) {
+           if (argument->achar != defaul->achar) {
+               *code = defaul->achar ? MERGE_NOCHAR : MERGE_NOINT;
+               arguments->offset = argument->offset;
+               return;
+           }
+       }
+       else {
+           argument->specified = 0;
+           argument->achar = defaul->achar;
+           argument->value = defaul->value;
+       }
+    }
+
+    /* check if extra arguments were provided */
+    if (arguments->count > defaults->count)
+       *code = MERGE_2MANY;
+}
+
+/* the pointer arguments may be null, useful when just testing/parsing
+ * the directive parameters */
+static char *
+parse_arguments(char *format, FmtArgs *arguments,
+               int *num_objects, LispObj **objects, int *code)
+{
+    int test;
+    char *ptr;
+    FmtArg *argument;
+    unsigned int tmpcmd = 0;
+
+    /* initialize */
+    test = objects == NULL || code == NULL || num_objects == NULL;
+    ptr = format;
+    argument = &(arguments->arguments[0]);
+    arguments->atsign = arguments->collon = arguments->command = 0;
+
+    /* parse format parameters */
+    for (arguments->count = 0;; arguments->count++) {
+       arguments->offset = ptr - format + 1;
+       if (arguments->count >= MAXFMT) {
+           if (!test)
+               *code = PARSE_2MANYPARM;
+           return (ptr);
+       }
+       if (*ptr == '\'') {             /* character parameter value */
+           ++ptr;                      /* skip ' */
+           argument->achar = argument->specified = 1;
+           argument->value = *ptr++;
+       }
+       else if (*ptr == ',') {         /* use default parameter value */
+           argument->achar = 0;
+           argument->specified = 0;
+           /* don't increment ptr, will be incremented below */
+       }
+       else if (*ptr == '#') {         /* number of arguments is value */
+           ++ptr;                      /* skip # */
+           argument->achar = 0;
+           argument->specified = 1;
+           if (!test)
+               argument->value = *num_objects;
+       }
+       else if (*ptr == 'v' ||
+                *ptr == 'V') {         /* format object argument is value */
+           LispObj *object;
+
+           ++ptr;                      /* skip V */
+           if (!test) {
+               if (!CONSP(*objects)) {
+                   *code = PARSE_NOARGSLEFT;
+                   return (ptr);
+               }
+               object = CAR((*objects));
+               if (FIXNUMP(object)) {
+                   argument->achar = 0;
+                   argument->specified = 1;
+                   argument->value = FIXNUM_VALUE(object);
+               }
+               else if (SCHARP(object)) {
+                   argument->achar = argument->specified = 1;
+                   argument->value = SCHAR_VALUE(object);
+               }
+               else {
+                   *code = PARSE_BADFMTARG;
+                   return (ptr);
+               }
+               *objects = CDR(*objects);
+               --*num_objects;
+           }
+       }
+       else if (isdigit(*ptr) ||
+               *ptr == '-' || *ptr == '+') {   /* integer parameter value */
+           int sign;
+
+           argument->achar = 0;
+           argument->specified = 1;
+           if (!isdigit(*ptr)) {
+               sign = *ptr++ == '-';
+           }
+           else
+               sign = 0;
+           if (!test && !isdigit(*ptr)) {
+               *code = PARSE_BADINTEGER;
+               return (ptr);
+           }
+           argument->value = *ptr++ - '0';
+           while (isdigit(*ptr)) {
+               argument->value = (argument->value * 10) + (*ptr++ - '0');
+               if (argument->value > 65536) {
+                   if (!test) {
+                       *code = PARSE_BADINTEGER;
+                       return (ptr);
+                   }
+               }
+           }
+           if (sign)
+               argument->value = -argument->value;
+       }
+       else                            /* no more arguments to format */
+           break;
+
+       if (*ptr == ',')
+           ++ptr;
+
+       /* remember offset of format parameter, for better error printing */
+       argument->offset = arguments->offset;
+       argument++;
+    }
+
+    /* check for extra flags */
+    for (;;) {
+       if (*ptr == '@') {              /* check for special parameter atsign */
+           if (arguments->atsign) {
+               if (!test) {
+                   *code = PARSE_2MANYATS;
+                   return (ptr);
+               }
+           }
+           ++ptr;
+           ++arguments->offset;
+           arguments->atsign = 1;
+       }
+       else if (*ptr == ':') {         /* check for special parameter collon */
+           if (arguments->collon) {
+               if (!test) {
+                   *code = PARSE_2MANYCOLS;
+                   return (ptr);
+               }
+           }
+           ++ptr;
+           ++arguments->offset;
+           arguments->collon = 1;
+       }
+       else                            /* next value is format command */
+           break;
+    }
+
+    if (!test)
+       *code = NOERROR;
+    arguments->command = *ptr++;
+    tmpcmd = arguments->command;
+    if (islower(tmpcmd))
+       arguments->command = toupper(tmpcmd);
+    ++arguments->offset;
+
+    return (ptr);
+}
+
+static void
+parse_error(FmtArgs *args, int code)
+{
+    static char *errors[] = {
+       NULL,
+       "too many parameters to directive",
+       "too many @ parameters",
+       "too many : parameters",
+       "no arguments left to format",
+       "argument is not a fixnum integer or a character",
+       "unknown format directive",
+       "parameter is not a fixnum integer",
+    };
+
+    format_error(args, errors[code]);
+}
+
+static void
+merge_error(FmtArgs *args, int code)
+{
+    static char *errors[] = {
+       NULL,
+       "too many parameters to directive",
+       "argument must be a character",
+       "argument must be a fixnum integer",
+    };
+
+    format_error(args, errors[code]);
+}
+
+static void
+generic_error(FmtArgs *args, int code)
+{
+    static char *errors[] = {
+       NULL,
+       "radix must be in the range 2 to 36, inclusive",
+       "parameter must be positive",
+       "argument must be a string",
+       "argument must be a list",
+    };
+
+    format_error(args, errors[code]);
+}
+
+static void
+format_error(FmtArgs *args, char *str)
+{
+    char *message;
+    int errorlen, formatlen;
+
+    /* number of bytes of format to be printed */
+    formatlen = (args->format - args->base) + args->offset;
+
+    /* length of specific error message */
+    errorlen = strlen(str) + 1;                        /* plus '\n' */
+
+    /* XXX allocate string with LispMalloc,
+     * so that it will be freed in LispTopLevel */
+    message = LispMalloc(formatlen + errorlen + 1);
+
+    sprintf(message, "%s\n", str);
+    memcpy(message + errorlen, args->base, formatlen);
+    message[errorlen + formatlen] = '\0';
+
+    LispDestroy("FORMAT: %s", message);
+}
+
+static int
+format_object(LispObj *stream, LispObj *object)
+{
+    int length;
+
+    length = LispWriteObject(stream, object);
+
+    return (length);
+}
+
+static void
+format_ascii(LispObj *stream, LispObj *object, FmtArgs *args)
+{
+    GC_ENTER();
+    LispObj *string = NIL;
+    int length = 0,
+       atsign = args->atsign,
+       collon = args->collon,
+       mincol = args->arguments[0].value,
+       colinc = args->arguments[1].value,
+       minpad = args->arguments[2].value,
+       padchar = args->arguments[3].value;
+
+    /* check/correct arguments */
+    if (mincol < 0)
+       mincol = 0;
+    if (colinc < 0)
+       colinc = 1;
+    if (minpad < 0)
+       minpad = 0;
+    /* XXX pachar can be the null character? */
+
+    if (object == NIL)
+       length = collon ? 2 : 3;            /* () or NIL */
+
+    /* left padding */
+    if (atsign) {
+       /* if length not yet known */
+       if (object == NIL) {
+           string = LSTRINGSTREAM("", STREAM_READ | STREAM_WRITE, 0);
+           GC_PROTECT(string);
+           length = LispWriteObject(string, object);
+       }
+
+       /* output minpad characters at left */
+       if (minpad) {
+           length += minpad;
+           LispWriteChars(stream, padchar, minpad);
+       }
+
+       if (colinc) {
+           /* puts colinc spaces at a time,
+            * until at least mincol chars out */
+           while (length < mincol) {
+               LispWriteChars(stream, padchar, colinc);
+               length += colinc;
+           }
+       }
+    }
+
+    if (object == NIL) {
+       if (collon)
+           LispWriteStr(stream, "()", 2);
+       else
+           LispWriteStr(stream,  Snil->value, 3);
+    }
+    else {
+       /* if string is not NIL, atsign was specified
+        * and object printed to string */
+       if (string == NIL)
+           length = format_object(stream, object);
+       else {
+           int size;
+           char *str = LispGetSstring(SSTREAMP(string), &size);
+
+           LispWriteStr(stream, str, size);
+       }
+    }
+
+    /* right padding */
+    if (!atsign) {
+       /* output minpad characters at left */
+       if (minpad) {
+           length += minpad;
+           LispWriteChars(stream, padchar, minpad);
+       }
+       if (colinc) {
+           /* puts colinc spaces at a time,
+            * until at least mincol chars out */
+           while (length < mincol) {
+               LispWriteChars(stream, padchar, colinc);
+               length += colinc;
+           }
+       }
+    }
+
+    GC_LEAVE();
+}
+
+/* assumes radix is 0 or in range 2 - 36 */
+static void
+format_in_radix(LispObj *stream, LispObj *object, int radix, FmtArgs *args)
+{
+    if (INTEGERP(object)) {
+       int i, atsign, collon, mincol, padchar, commachar, commainterval;
+
+       i = (radix == 0);
+       atsign = args->atsign;
+       collon = args->collon;
+       if (radix == 0) {
+           radix = args->arguments[0].value;
+           if (radix < 2 || radix > 36) {
+               args->offset = args->arguments[0].offset;
+               generic_error(args, GENERIC_RADIX);
+           }
+       }
+       mincol = args->arguments[i++].value;
+       padchar = args->arguments[i++].value;
+       commachar = args->arguments[i++].value;
+       commainterval = args->arguments[i++].value;
+
+       LispFormatInteger(stream, object, radix, atsign, collon,
+                         mincol, padchar, commachar, commainterval);
+    }
+    else
+       format_object(stream, object);
+}
+
+static void
+format_radix_special(LispObj *stream, LispObj *object, FmtArgs *args)
+{
+    if (FIXNUMP(object)) {
+       if (args->atsign)
+           format_roman(stream, object, args);
+       else
+           format_english(stream, object, args);
+    }
+    else
+       format_object(stream, object);
+}
+
+static void
+format_roman(LispObj *stream, LispObj *object, FmtArgs *args)
+{
+    long value = 0;
+    int cando, new_roman = args->collon == 0;
+
+    if (FIXNUMP(object)) {
+       value = FIXNUM_VALUE(object);
+       if (new_roman)
+           cando = value >= 1 && value <= 3999;
+       else
+           cando = value >= 1 && value <= 4999;
+    }
+    else
+       cando = 0;
+
+    if (cando)
+       LispFormatRomanInteger(stream, value, new_roman);
+    else
+       format_object(stream, object);
+}
+
+static void
+format_english(LispObj *stream, LispObj *object, FmtArgs *args)
+{
+    int cando;
+    long number = 0;
+
+    if (FIXNUMP(object)) {
+       number = FIXNUM_VALUE(object);
+       cando = number >= -999999999 && number <= 999999999;
+    }
+    else
+       cando = 0;
+
+    if (cando)
+       LispFormatEnglishInteger(stream, number, args->collon);
+    else
+       format_object(stream, object);
+}
+
+static void
+format_character(LispObj *stream, LispObj *object, FmtArgs *args)
+{
+    if (SCHARP(object))
+       LispFormatCharacter(stream, object, args->atsign, args->collon);
+    else
+       format_object(stream, object);
+}
+
+static void
+format_fixed_float(LispObj *stream, LispObj *object, FmtArgs *args)
+{
+    if (FLOATP(object))
+       LispFormatFixedFloat(stream, object, args->atsign,
+                            args->arguments[0].value,
+                            IF_SPECIFIED(args->arguments[1]),
+                            args->arguments[2].value,
+                            args->arguments[3].value,
+                            args->arguments[4].value);
+    else
+       format_object(stream, object);
+}
+
+static void
+format_exponential_float(LispObj *stream, LispObj *object, FmtArgs *args)
+{
+    if (FLOATP(object))
+       LispFormatExponentialFloat(stream, object, args->atsign,
+                                  args->arguments[0].value,
+                                  IF_SPECIFIED(args->arguments[1]),
+                                  args->arguments[2].value,
+                                  args->arguments[3].value,
+                                  args->arguments[4].value,
+                                  args->arguments[5].value,
+                                  args->arguments[6].value);
+    else
+       format_object(stream, object);
+}
+
+static void
+format_general_float(LispObj *stream, LispObj *object, FmtArgs *args)
+{
+    if (FLOATP(object))
+       LispFormatGeneralFloat(stream, object, args->atsign,
+                               args->arguments[0].value,
+                               IF_SPECIFIED(args->arguments[1]),
+                               args->arguments[2].value,
+                               args->arguments[3].value,
+                               args->arguments[4].value,
+                               args->arguments[5].value,
+                               args->arguments[6].value);
+    else
+       format_object(stream, object);
+}
+
+static void
+format_dollar_float(LispObj *stream, LispObj *object, FmtArgs *args)
+{
+    if (FLOATP(object))
+       LispFormatDollarFloat(stream, object,
+                             args->atsign, args->collon,
+                             args->arguments[0].value,
+                             args->arguments[1].value,
+                             args->arguments[2].value,
+                             args->arguments[3].value);
+    else
+       format_object(stream, object);
+}
+
+static void
+format_tabulate(LispObj *stream, FmtArgs *args)
+{
+    int atsign = args->atsign,
+       colnum = args->arguments[0].value,
+       colinc = args->arguments[1].value,
+       column;
+
+    column = LispGetColumn(stream);
+
+    if (atsign) {
+       /* relative tabulation */
+       if (colnum > 0) {
+           LispWriteChars(stream, ' ', colnum);
+           column += colnum;
+       }
+       /* tabulate until at a multiple of colinc */
+       if (colinc > 0)
+           LispWriteChars(stream, ' ', colinc - (column % colinc));
+    }
+    else {
+       /* if colinc not specified, just move to given column */
+       if (colinc <= 0)
+           LispWriteChars(stream, ' ', column - colnum);
+       else {
+           /* always output at least colinc spaces */
+           do {
+               LispWriteChars(stream, ' ', colinc);
+               colnum -= colinc;
+           } while (colnum > column);
+       }
+    }
+}
+
+static void
+format_goto(FmtInfo *info)
+{
+    int count, num_arguments;
+    LispObj *object, *arguments;
+
+    /* number of arguments to ignore or goto offset */
+    count = info->args.arguments[0].value;
+    if (count < 0)
+       generic_error(&(info->args), GENERIC_NEGATIVE);
+
+    if (info->args.atsign) {
+       /* absolute goto */
+
+       /* if not specified, defaults to zero */
+       if (!(info->args.arguments[0].specified))
+           count = 0;
+
+       /* if offset too large */
+       if (count > info->total_arguments)
+           parse_error(&(info->args), PARSE_NOARGSLEFT);
+       else if (count != info->total_arguments - *(info->num_arguments)) {
+           /* calculate new parameters */
+           object = NIL;
+           arguments = info->base_arguments;
+           num_arguments = info->total_arguments - count;
+
+           for (; count > 0; count--, arguments = CDR(arguments))
+               object = CAR(arguments);
+
+           /* update format information */
+           *(info->object) = object;
+           *(info->arguments) = arguments;
+           *(info->num_arguments) = num_arguments;
+       }
+    }
+    else if (count) {
+       /* relative goto, ignore or go back count arguments */
+
+       /* prepare to update parameters */
+       arguments = *(info->arguments);
+       num_arguments = *(info->num_arguments);
+
+       /* go back count arguments? */
+       if (info->args.collon)
+           count = -count;
+
+       num_arguments -= count;
+
+       if (count > 0) {
+           if (count > *(info->num_arguments))
+               parse_error(&(info->args), PARSE_NOARGSLEFT);
+
+           object = *(info->object);
+           for (; count > 0; count--, arguments = CDR(arguments))
+               object = CAR(arguments);
+       }
+       else {          /* count < 0 */
+           if (info->total_arguments + count - *(info->num_arguments) < 0)
+               parse_error(&(info->args), PARSE_NOARGSLEFT);
+
+           object = NIL;
+           arguments = info->base_arguments;
+           for (count = 0; count < info->total_arguments - num_arguments;
+               count++, arguments = CDR(arguments))
+               object = CAR(arguments);
+       }
+
+       /* update format parameters */
+       *(info->object) = object;
+       *(info->arguments) = arguments;
+       *(info->num_arguments) = num_arguments;
+    }
+}
+
+static void
+format_indirection(LispObj *stream, LispObj *format, FmtInfo *info)
+{
+    char *string;
+    LispObj *object;
+    FmtInfo indirect_info;
+
+    if (!STRINGP(format))
+       generic_error(&(info->args), GENERIC_BADSTRING);
+    string = THESTR(format);
+
+    /* most information is the same */
+    memcpy(&indirect_info, info, sizeof(FmtInfo));
+
+    /* set new format string */
+    indirect_info.args.base = indirect_info.args.format = string;
+    indirect_info.format = &string;
+
+    if (info->args.atsign) {
+       /* use current arguments */
+
+       /* do the indirect format */
+       LispFormat(stream, &indirect_info);
+    }
+    else {
+       /* next argument is the recursive call arguments */
+
+       int num_arguments;
+
+       /* it is valid to not have a list following string, as string may
+        * not have format directives */
+       if (CONSP(*(indirect_info.arguments)))
+           object = CAR(*(indirect_info.arguments));
+       else
+           object = NIL;
+
+       if (!LISTP(object) || !CONSP(*(info->arguments)))
+           generic_error(&(info->args), GENERIC_BADLIST);
+
+       /* update information now */
+       *(info->object) = object;
+       *(info->arguments) = CDR(*(info->arguments));
+       *(info->num_arguments) -= 1;
+
+       /* set arguments for recursive call */
+       indirect_info.base_arguments = object;
+       indirect_info.arguments = &object;
+       for (num_arguments = 0; CONSP(object); object = CDR(object))
+           ++num_arguments;
+
+       /* note that indirect_info.arguments is a pointer to "object",
+        * keep it pointing to the correct object */
+       object = indirect_info.base_arguments;
+       indirect_info.total_arguments = num_arguments;
+       indirect_info.num_arguments = &num_arguments;
+
+       /* do the indirect format */
+       LispFormat(stream, &indirect_info);
+    }
+}
+
+/* update pointers to a list of format strings:
+ *     for '(' and '{' only one list is required
+ *     for '[' and '<' more than one may be returned
+ *     has_default is only meaningful for '[' and '<'
+ *     comma_width and line_width are only meaningful to '<', and
+ *         only valid if has_default set
+ * if the string is finished prematurely, LispDestroy is called
+ * format_ptr is updated to the correct pointer in the "main" format string
+ */
+static void
+list_formats(FmtInfo *info, int command, char **format_ptr,
+            char ***format_list, int *format_count, int *has_default,
+            int *comma_width, int *line_width)
+{
+    /* instead of processing the directives recursively, just separate the
+     * input formats in separate strings, then see if one of then need to
+     * be used */
+    FmtArgs args;
+    int counters[] = {  0,   0,   0,   0};
+                   /* '[', '(', '{', '<' */
+    char *format, *next_format, *start, **formats;
+    int num_formats, format_index, separator, add_format;
+
+    /* initialize */
+    formats = NULL;
+    num_formats = format_index = 0;
+    if (has_default != NULL)
+       *has_default = 0;
+    if (comma_width != NULL)
+       *comma_width = 0;
+    if (line_width != NULL)
+       *line_width = 0;
+    format = start = next_format = *format_ptr;
+    switch (command) {
+       case '[': counters[0] = 1; format_index = 0; break;
+       case '(': counters[1] = 1; format_index = 1; break;
+       case '{': counters[2] = 1; format_index = 2; break;
+       case '<': counters[3] = 1; format_index = 3; break;
+    }
+
+#define        LIST_FORMATS_ADD        1
+#define        LIST_FORMATS_DONE       2
+
+    /* fill list of format options to conditional */
+    while (*format) {
+       if (*format == '~') {
+           separator = add_format = 0;
+           args.format = format + 1;
+           next_format = parse_arguments(format + 1, &args, NULL, NULL, NULL);
+           switch (args.command) {
+               case '[': ++counters[0];    break;
+               case ']': --counters[0];    break;
+               case '(': ++counters[1];    break;
+               case ')': --counters[1];    break;
+               case '{': ++counters[2];    break;
+               case '}': --counters[2];    break;
+               case '<': ++counters[3];    break;
+               case '>': --counters[3];    break;
+               case ';': separator = 1;    break;
+           }
+
+           /* check if a new format string must be added */
+           if (separator && counters[format_index] == 1 &&
+               (command == '[' || command == '<'))
+               add_format = LIST_FORMATS_ADD;
+           else if (counters[format_index] == 0)
+               add_format = LIST_FORMATS_DONE;
+
+           if (add_format) {
+               int length = format - start;
+
+               formats = LispRealloc(formats,
+                                     (num_formats + 1) * sizeof(char*));
+
+               formats[num_formats] = LispMalloc(length + 1);
+               strncpy(formats[num_formats], start, length);
+               formats[num_formats][length] = '\0';
+               ++num_formats;
+               /* loop finished? */
+               if (add_format == LIST_FORMATS_DONE)
+                   break;
+               else if (command == '[' && has_default != NULL)
+                   /* will be set only for the last parameter, what is
+                    * expected, just don't warn about it in the incorrect
+                    * place */
+                   *has_default = args.collon != 0;
+               else if (command == '<' && num_formats == 1) {
+                   /* if the first parameter to '<', there may be overrides
+                    * to comma-width and line-width */
+                   if (args.collon && has_default != NULL) {
+                       *has_default = 1;
+                       if (comma_width != NULL &&
+                           args.arguments[0].specified &&
+                           !args.arguments[0].achar)
+                           *comma_width = args.arguments[0].value;
+                       if (line_width != NULL &&
+                           args.arguments[1].specified &&
+                           !args.arguments[1].achar)
+                           *line_width = args.arguments[1].value;
+                   }
+               }
+               start = next_format;
+           }
+           format = next_format;
+       }
+       else
+           ++format;
+    }
+
+    /* check if format string did not finish prematurely */
+    if (counters[format_index] != 0) {
+       char error_message[64];
+
+       sprintf(error_message, "expecting ~%c", command);
+       format_error(&(info->args), error_message);
+    }
+
+    /* update pointers */
+    *format_list = formats;
+    *format_count = num_formats;
+    *format_ptr = next_format;
+}
+
+static void
+free_formats(char **formats, int num_formats)
+{
+    if (num_formats) {
+       while (--num_formats >= 0)
+           LispFree(formats[num_formats]);
+       LispFree(formats);
+    }
+}
+
+static void
+format_case_conversion(LispObj *stream, FmtInfo *info)
+{
+    GC_ENTER();
+    LispObj *string;
+    FmtInfo case_info;
+    char *str, *ptr;
+    char *format, *next_format, **formats;
+    int atsign, collon, num_formats, length;
+
+    atsign = info->args.atsign;
+    collon = info->args.collon;
+
+    /* output to a string, before case conversion */
+    string = LSTRINGSTREAM("", STREAM_READ | STREAM_WRITE, 0);
+    GC_PROTECT(string);
+
+    /* most information is the same */
+    memcpy(&case_info, info, sizeof(FmtInfo));
+
+    /* list formats */
+    next_format = *(info->format);
+    list_formats(info, '(', &next_format, &formats, &num_formats,
+                NULL, NULL, NULL);
+
+    /* set new format string */
+    format = formats[0];
+    case_info.args.base = case_info.args.format = format;
+    case_info.format = &format;
+
+    /* format text to string */
+    LispFormat(string, &case_info);
+
+    str = ptr = LispGetSstring(SSTREAMP(string), &length);
+
+    /* do case conversion */
+    if (!atsign && !collon) {
+       /* convert all upercase to lowercase */
+       for (; *ptr; ptr++) {
+           if (isupper(*ptr))
+               *ptr = tolower(*ptr);
+       }
+    }
+    else if (atsign && collon) {
+       /* convert all lowercase to upercase */
+       for (; *ptr; ptr++) {
+           if (islower(*ptr))
+               *ptr = toupper(*ptr);
+       }
+    }
+    else {
+       int upper = 1;
+
+       /* skip non-alphanumeric characters */
+       for (; *ptr; ptr++)
+           if (isalnum(*ptr))
+               break;
+
+       /* capitalize words */
+       for (; *ptr; ptr++) {
+           if (isalnum(*ptr)) {
+               if (upper) {
+                   if (islower(*ptr))
+                       *ptr = toupper(*ptr);
+                   upper = 0;
+               }
+               else if (isupper(*ptr))
+                   *ptr = tolower(*ptr);
+           }
+           else
+               upper = collon;
+               /* if collon, capitalize all words, else just first word */
+       }
+    }
+
+    /* output case converted string */
+    LispWriteStr(stream, str, length);
+
+    /* temporary string stream is not necessary anymore */
+    GC_LEAVE();
+
+    /* free temporary memory */
+    free_formats(formats, num_formats);
+
+    /* this information always updated */
+    *(info->format) = next_format;
+}
+
+static void
+format_conditional(LispObj *stream, FmtInfo *info)
+{
+    LispObj *object, *arguments;
+    char *format, *next_format, **formats;
+    int choice, num_formats, has_default, num_arguments;
+
+    /* save information that may change */
+    object = *(info->object);
+    arguments = *(info->arguments);
+    num_arguments = *(info->num_arguments);
+
+    /* initialize */
+    choice = -1;
+    next_format = *(info->format);
+
+    /* list formats */
+    list_formats(info, '[',
+                &next_format, &formats, &num_formats, &has_default, NULL, NULL);
+
+    /* ~:[false;true] */
+    if (info->args.collon) {
+       /* one argument always consumed */
+       if (!CONSP(arguments))
+           parse_error(&(info->args), PARSE_NOARGSLEFT);
+       object = CAR(arguments);
+       arguments = CDR(arguments);
+       --num_arguments;
+       choice = object == NIL ? 0 : 1;
+    }
+    /* ~@[true] */
+    else if (info->args.atsign) {
+       /* argument consumed only if nil, but one must be available */
+       if (!CONSP(arguments))
+           parse_error(&(info->args), PARSE_NOARGSLEFT);
+       if (CAR(arguments) != NIL)
+           choice = 0;
+       else {
+           object = CAR(arguments);
+           arguments = CDR(arguments);
+           --num_arguments;
+       }
+    }
+    /* ~n[...~] */
+    else if (info->args.arguments[0].specified)
+       /* no arguments consumed */
+       choice = info->args.arguments[0].value;
+    /* ~[...~] */
+    else {
+       /* one argument consumed, it is the index in the available formats */
+       if (!CONSP(arguments))
+           parse_error(&(info->args), PARSE_NOARGSLEFT);
+       object = CAR(arguments);
+       arguments = CDR(arguments);
+       --num_arguments;
+       /* no error if it isn't a number? */
+       if (FIXNUMP(object))
+           choice = FIXNUM_VALUE(object);
+    }
+
+    /* update anything that may have changed */
+    *(info->object) = object;
+    *(info->arguments) = arguments;
+    *(info->num_arguments) = num_arguments;
+
+    /* if choice is out of range check if there is a default choice */
+    if (has_default && (choice < 0 || choice >= num_formats))
+       choice = num_formats - 1;
+
+    /* if one of the formats must be parsed */
+    if (choice >= 0 && choice < num_formats) {
+       FmtInfo conditional_info;
+
+       /* most information is the same */
+       memcpy(&conditional_info, info, sizeof(FmtInfo));
+
+       /* set new format string */
+       format = formats[choice];
+       conditional_info.args.base = conditional_info.args.format = format;
+       conditional_info.format = &format;
+
+       /* do the conditional format */
+       LispFormat(stream, &conditional_info);
+    }
+
+    /* free temporary memory */
+    free_formats(formats, num_formats);
+
+    /* this information always updated */
+    *(info->format) = next_format;
+}
+
+static void
+format_iterate(LispObj *stream, FmtInfo *info)
+{
+    FmtInfo iterate_info;
+    LispObj *object, *arguments, *iarguments, *iobject;
+    char *format, *next_format, *loop_format, **formats;
+    int num_arguments, iterate, iterate_max, has_max, has_min, inum_arguments,
+       num_formats;
+
+    /* save information that may change */
+    object = *(info->object);
+    arguments = *(info->arguments);
+    num_arguments = *(info->num_arguments);
+
+    /* initialize */
+    iterate = has_min = 0;
+    next_format = *(info->format);
+
+    /* if has_max set, iterate at most iterate_max times */
+    has_max = info->args.arguments[0].specified;
+    iterate_max = info->args.arguments[0].value;
+
+    /* list formats */
+    list_formats(info, '{', &next_format, &formats, &num_formats,
+                NULL, NULL, NULL);
+    loop_format = formats[0];
+
+    /* most information is the same */
+    memcpy(&iterate_info, info, sizeof(FmtInfo));
+
+    /* ~{...~} */
+    if (!info->args.atsign && !info->args.collon) {
+       /* next argument is the argument list for the iteration */
+
+       /* fetch argument list, must exist */
+       if (!CONSP(arguments))
+           parse_error(&(info->args), PARSE_NOARGSLEFT);
+       iarguments = object = CAR(arguments);
+       object = CAR(arguments);
+       arguments = CDR(arguments);
+       --num_arguments;
+
+       inum_arguments = 0;
+       if (CONSP(object)) {
+           /* count arguments to format */
+           for (iobject = object; CONSP(iobject); iobject = CDR(iobject))
+               ++inum_arguments;
+       }
+       else if (object != NIL)
+           generic_error(&(info->args), GENERIC_BADLIST);
+
+       iobject = NIL;
+
+       /* set new arguments to recursive calls */
+       iarguments = object;
+       iterate_info.base_arguments = iarguments;
+       iterate_info.total_arguments = inum_arguments;
+       iterate_info.object = &iobject;
+       iterate_info.arguments = &iarguments;
+       iterate_info.num_arguments = &inum_arguments;
+
+       /* iterate */
+       for (;; iterate++) {
+           /* if maximum iterations done or all arguments consumed */
+           if (has_max && iterate > iterate_max)
+               break;
+           else if (inum_arguments == 0 && (!has_min || iterate > 0))
+               break;
+
+           format = loop_format;
+
+           /* set new format string */
+           iterate_info.args.base = iterate_info.args.format = format;
+           iterate_info.format = &format;
+
+           /* information for possible ~^, in this case ~:^ is a noop */
+           iterate_info.iteration = ITERATION_NORMAL;
+
+           /* do the format */
+           LispFormat(stream, &iterate_info);
+
+           /* check for forced loop break */
+           if (iterate_info.upandout & UPANDOUT_HASH)
+               break;
+       }
+    }
+    /* ~:@{...~} */
+    else if (info->args.atsign && info->args.collon) {
+       /* every following argument is the argument list for the iteration */
+
+       /* iterate */
+       for (;; iterate++) {
+           /* if maximum iterations done or all arguments consumed */
+           if (has_max && iterate > iterate_max)
+               break;
+           else if (num_arguments == 0 && (!has_min || iterate > 0))
+               break;
+
+           /* fetch argument list, must exist */
+           if (!CONSP(arguments))
+               parse_error(&(info->args), PARSE_NOARGSLEFT);
+           iarguments = object = CAR(arguments);
+           object = CAR(arguments);
+           arguments = CDR(arguments);
+           --num_arguments;
+
+           inum_arguments = 0;
+           if (CONSP(object)) {
+               /* count arguments to format */
+               for (iobject = object; CONSP(iobject); iobject = CDR(iobject))
+                   ++inum_arguments;
+           }
+           else if (object != NIL)
+               generic_error(&(info->args), GENERIC_BADLIST);
+
+           iobject = NIL;
+
+           /* set new arguments to recursive calls */
+           iarguments = object;
+           iterate_info.base_arguments = iarguments;
+           iterate_info.total_arguments = inum_arguments;
+           iterate_info.object = &iobject;
+           iterate_info.arguments = &iarguments;
+           iterate_info.num_arguments = &inum_arguments;
+
+           format = loop_format;
+
+           /* set new format string */
+           iterate_info.args.base = iterate_info.args.format = format;
+           iterate_info.format = &format;
+
+           /* information for possible ~^ */
+           iterate_info.iteration =
+               num_arguments > 0 ? ITERATION_NORMAL : ITERATION_LAST;
+
+           /* do the format */
+           LispFormat(stream, &iterate_info);
+
+           /* check for forced loop break */
+           if (iterate_info.upandout & UPANDOUT_HASH)
+               break;
+       }
+    }
+    /* ~:{...~} */
+    else if (info->args.collon) {
+       /* next argument is a list of lists */
+
+       LispObj *sarguments, *sobject;
+       int snum_arguments;
+
+       /* fetch argument list, must exist */
+       if (!CONSP(arguments))
+           parse_error(&(info->args), PARSE_NOARGSLEFT);
+       sarguments = object = CAR(arguments);
+       object = CAR(arguments);
+       arguments = CDR(arguments);
+       --num_arguments;
+
+       snum_arguments = 0;
+       if (CONSP(object)) {
+           /* count arguments to format */
+           for (sobject = object; CONSP(sobject); sobject = CDR(sobject))
+               ++snum_arguments;
+       }
+       else
+           generic_error(&(info->args), GENERIC_BADLIST);
+
+       /* iterate */
+       for (;; iterate++) {
+           /* if maximum iterations done or all arguments consumed */
+           if (has_max && iterate > iterate_max)
+               break;
+           else if (snum_arguments == 0 && (!has_min || iterate > 0))
+               break;
+
+           /* fetch argument list, must exist */
+           if (!CONSP(sarguments))
+               parse_error(&(info->args), PARSE_NOARGSLEFT);
+           iarguments = sobject = CAR(sarguments);
+           sobject = CAR(sarguments);
+           sarguments = CDR(sarguments);
+           --snum_arguments;
+
+           inum_arguments = 0;
+           if (CONSP(object)) {
+               /* count arguments to format */
+               for (iobject = sobject; CONSP(iobject); iobject = CDR(iobject))
+                   ++inum_arguments;
+           }
+           else if (sobject != NIL)
+               generic_error(&(info->args), GENERIC_BADLIST);
+
+           iobject = NIL;
+
+           /* set new arguments to recursive calls */
+           iarguments = sobject;
+           iterate_info.base_arguments = iarguments;
+           iterate_info.total_arguments = inum_arguments;
+           iterate_info.object = &iobject;
+           iterate_info.arguments = &iarguments;
+           iterate_info.num_arguments = &inum_arguments;
+
+           format = loop_format;
+
+           /* set new format string */
+           iterate_info.args.base = iterate_info.args.format = format;
+           iterate_info.format = &format;
+
+           /* information for possible ~^ */
+           iterate_info.iteration =
+               snum_arguments > 0 ? ITERATION_NORMAL : ITERATION_LAST;
+
+           /* do the format */
+           LispFormat(stream, &iterate_info);
+
+           /* check for forced loop break */
+           if (iterate_info.upandout & UPANDOUT_HASH)
+               break;
+       }
+    }
+    /* ~@{...~} */
+    else if (info->args.atsign) {
+       /* current argument list is used */
+
+       /* set new arguments to recursive calls */
+       iterate_info.base_arguments = info->base_arguments;
+       iterate_info.total_arguments = info->total_arguments;
+       iterate_info.object = &object;
+       iterate_info.arguments = &arguments;
+       iterate_info.num_arguments = &num_arguments;
+
+       for (;; iterate++) {
+           /* if maximum iterations done or all arguments consumed */
+           if (has_max && iterate > iterate_max)
+               break;
+           else if (num_arguments == 0 && (!has_min || iterate > 0))
+               break;
+
+           format = loop_format;
+
+           /* set new format string */
+           iterate_info.args.base = iterate_info.args.format = format;
+           iterate_info.format = &format;
+
+           /* information for possible ~^, in this case ~:^ is a noop */
+           iterate_info.iteration = ITERATION_NORMAL;
+
+           /* do the format */
+           LispFormat(stream, &iterate_info);
+
+           /* check for forced loop break */
+           if (iterate_info.upandout & UPANDOUT_HASH)
+               break;
+       }
+    }
+
+    /* free temporary memory */
+    free_formats(formats, num_formats);
+
+    /* update anything that may have changed */
+    *(info->object) = object;
+    *(info->arguments) = arguments;
+    *(info->num_arguments) = num_arguments;
+
+    /* this information always updated */
+    *(info->format) = next_format;
+}
+
+static void
+format_justify(LispObj *stream, FmtInfo *info)
+{
+    GC_ENTER();
+    FmtInfo justify_info;
+    char **formats, *format, *next_format, *str;
+    LispObj *string, *strings = NIL, *cons;
+    int atsign = info->args.atsign,
+       collon = info->args.collon,
+       mincol = info->args.arguments[0].value,
+       colinc = info->args.arguments[1].value,
+       minpad = info->args.arguments[2].value,
+       padchar = info->args.arguments[3].value;
+    int i, k, total_length, length, padding, num_formats, has_default,
+       comma_width, line_width, size, extra;
+
+    next_format = *(info->format);
+
+    /* list formats */
+    list_formats(info, '<', &next_format, &formats, &num_formats,
+                &has_default, &comma_width, &line_width);
+
+    /* initialize list of strings streams */
+    if (num_formats) {
+       string = LSTRINGSTREAM("", STREAM_READ | STREAM_WRITE, 0);
+       strings = cons = CONS(string, NIL);
+       GC_PROTECT(strings);
+       for (i = 1; i < num_formats; i++) {
+           string = LSTRINGSTREAM("", STREAM_READ | STREAM_WRITE, 0);
+           RPLACD(cons, CONS(string, NIL));
+           cons = CDR(cons);
+       }
+    }
+
+    /* most information is the same */
+    memcpy(&justify_info, info, sizeof(FmtInfo));
+
+    /* loop formating strings */
+    for (i = 0, cons = strings; i < num_formats; i++, cons = CDR(cons)) {
+       /* set new format string */
+       format = formats[i];
+       justify_info.args.base = justify_info.args.format = format;
+       justify_info.format = &format;
+
+       /* format string, maybe consuming arguments */
+       LispFormat(CAR(cons), &justify_info);
+
+       /* if format was aborted, it is discarded */
+       if (justify_info.upandout)
+           RPLACA(cons, NIL);
+       /* check if the entire "main" iteration must be aborted */
+       if (justify_info.upandout & UPANDOUT_COLLON) {
+           for (cons = CDR(cons); i < num_formats; i++, cons = CDR(cons))
+               RPLACA(cons, NIL);
+           break;
+       }
+    }
+
+    /* free temporary format strings */
+    free_formats(formats, num_formats);
+
+    /* remove aborted formats */
+       /* first remove leading discarded formats */
+    if (CAR(strings) == NIL) {
+       while (CAR(strings) == NIL) {
+           strings = CDR(strings);
+           --num_formats;
+       }
+       /* keep strings gc protected, discarding first entries */
+       lisp__data.protect.objects[gc__protect] = strings;
+    }
+       /* now remove intermediary discarded formats */
+    cons = strings;
+    while (CONSP(cons)) {
+       if (CONSP(CDR(cons)) && CAR(CDR(cons)) == NIL) {
+           RPLACD(cons, CDR(CDR(cons)));
+           --num_formats;
+       }
+       else
+           cons = CDR(cons);
+    }
+
+    /* calculate total length required for output */
+    if (has_default)
+       cons = CDR(strings);    /* if has_defaults, strings is surely a list */
+    else
+       cons = strings;
+    for (total_length = 0; CONSP(cons); cons = CDR(cons))
+       total_length += SSTREAMP(CAR(cons))->length;
+
+    /* initialize pointer to string streams */
+    if (has_default)
+       cons = CDR(strings);
+    else
+       cons = strings;
+
+    /* check if padding will need to be printed */
+    extra = 0;
+    padding = mincol - total_length;
+    if (padding < 0)
+       k = padding = 0;
+    else {
+       int num_fields = num_formats - (has_default != 0);
+
+       if (num_fields > 1) {
+           /* check if padding is distributed in num_fields or
+            * num_fields - 1 steps */
+           if (!collon)
+               --num_fields;
+       }
+
+       if (num_fields)
+           k = padding / num_fields;
+       else
+           k = padding;
+
+       if (k <= 0)
+           k = colinc;
+       else if (colinc)
+           k = k + (k % colinc);
+       extra = mincol - (num_fields * k + total_length);
+       if (extra < 0)
+           extra = 0;
+    }
+    if (padding && k < minpad) {
+       k = minpad;
+       if (colinc)
+           k = k + (k % colinc);
+    }
+
+    /* first check for the special case of only one string being justified */
+    if (num_formats - has_default == 1) {
+       if (has_default && line_width > 0 && comma_width >= 0 &&
+           total_length + comma_width > line_width) {
+           str = LispGetSstring(SSTREAMP(CAR(strings)), &size);
+           LispWriteStr(stream, str, size);
+       }
+       string = has_default ? CAR(CDR(strings)) : CAR(strings);
+       /* check if need left padding */
+       if (k && !atsign) {
+           LispWriteChars(stream, padchar, k);
+           k = 0;
+       }
+       /* check for centralizing text */
+       else if (k && atsign && collon) {
+           LispWriteChars(stream, padchar, k / 2 + ((k / 2) & 1));
+           k -= k / 2;
+       }
+       str = LispGetSstring(SSTREAMP(string), &size);
+       LispWriteStr(stream, str, size);
+       /* if any padding remaining */
+       if (k)
+           LispWriteChars(stream, padchar, k);
+    }
+    else {
+       LispObj *result;
+       int last, spaces_before, padout;
+
+       /* if has default, need to check output length */
+       if (has_default && line_width > 0 && comma_width >= 0) {
+           result = LSTRINGSTREAM("", STREAM_READ | STREAM_WRITE, 0);
+           GC_PROTECT(result);
+       }
+       /* else write directly to stream */
+       else
+           result = stream;
+
+       /* loop printing justified text */
+           /* padout controls padding for cases where padding is
+            * is separated in n-1 chunks, where n is the number of
+            * formatted strings.
+            */
+       for (i = padout = 0; CONSP(cons); i++, cons = CDR(cons), --extra) {
+           string = CAR(cons);
+           last = !CONSP(CDR(cons));
+
+           spaces_before = (i != 0 || collon) && (!last || !atsign);
+
+           if (!spaces_before) {
+               /* check for special case */
+               if (last && atsign && collon && padding > 0) {
+                   int spaces;
+
+                   spaces = minpad > colinc ? minpad : colinc;
+                   LispWriteChars(result, padchar, spaces + (extra > 0));
+                   k -= spaces;
+               }
+               str = LispGetSstring(SSTREAMP(string), &size);
+               LispWriteStr(result, str, size);
+               padout = 0;
+           }
+           if (!padout)
+               LispWriteChars(result, padchar, k + (extra > 0));
+           padout = k;
+           /* if not first string, or if left padding specified */
+           if (spaces_before) {
+               str = LispGetSstring(SSTREAMP(string), &size);
+               LispWriteStr(result, str, size);
+               padout = 0;
+           }
+           padding -= k;
+       }
+
+       if (has_default && line_width > 0 && comma_width >= 0) {
+           length = SSTREAMP(result)->length + LispGetColumn(stream);
+
+           /* if current line is too large */
+           if (has_default && length + comma_width > line_width) {
+               str = LispGetSstring(SSTREAMP(CAR(strings)), &size);
+               LispWriteStr(stream, str, size);
+           }
+
+           /* write result to stream */
+           str = LispGetSstring(SSTREAMP(result), &size);
+           LispWriteStr(stream, str, size);
+       }
+    }
+
+    /* unprotect string streams from GC */
+    GC_LEAVE();
+
+    /* this information always updated */
+    *(info->format) = next_format;
+}
+
+static void
+LispFormat(LispObj *stream, FmtInfo *info)
+{
+    FmtArgs *args;
+    FmtDefs *defs = NULL;
+    LispObj *object, *arguments;
+    char stk[256], *format, *next_format;
+    int length, num_arguments, code, need_update, need_argument, hash, head;
+
+    /* arguments that will be updated on function exit */
+    format = *(info->format);
+    object = *(info->object);
+    arguments = *(info->arguments);
+    num_arguments = *(info->num_arguments);
+
+    /* initialize */
+    length = 0;
+    args = &(info->args);
+    info->upandout = 0;
+
+    while (*format) {
+       if (*format == '~') {
+           /* flush non formatted characters */
+           if (length) {
+               LispWriteStr(stream, stk, length);
+               length = 0;
+           }
+
+           need_argument = need_update = hash = 0;
+
+           /* parse parameters */
+           args->format = format + 1;
+           next_format = parse_arguments(format + 1, args, &num_arguments,
+                                         &arguments, &code);
+           if (code != NOERROR)
+               parse_error(args, code);
+
+           /* check parameters */
+           switch (args->command) {
+               case 'A': case 'S':
+                   defs = &AsciiDefs;
+                   break;
+               case 'B': case 'O': case 'D': case 'X':
+                   defs = &IntegerDefs;
+                   break;
+               case 'R':
+                   defs = &RadixDefs;
+                   break;
+               case 'P': case 'C':
+                   defs = &NoneDefs;
+                   break;
+               case 'F':
+                   defs = &FixedFloatDefs;
+                   break;
+               case 'E': case 'G':
+                   defs = &ExponentialFloatDefs;
+                   break;
+               case '$':
+                   defs = &DollarFloatDefs;
+                   break;
+               case '%': case '&': case '|': case '~': case '\n':
+                   defs = &OneDefs;
+                   break;
+               case 'T':
+                   defs = &TabulateDefs;
+                   break;
+               case '*':
+                   defs = &OneDefs;
+                   break;
+               case '?': case '(':
+                   defs = &NoneDefs;
+                   break;
+               case ')':
+                   /* this is never seen, processed in format_case_conversion */
+                   format_error(args, "no match for directive ~)");
+               case '[':
+                   defs = &OneDefs;
+                   break;
+               case ']':
+                   /* this is never seen, processed in format_conditional */
+                   format_error(args, "no match for directive ~]");
+               case '{':
+                   defs = &OneDefs;
+                   break;
+               case '}':
+                   /* this is never seen, processed in format_iterate */
+                   format_error(args, "no match for directive ~}");
+               case '<':
+                   defs = &AsciiDefs;
+                   break;
+               case '>':
+                   /* this is never seen, processed in format_justify */
+                   format_error(args, "no match for directive ~>");
+               case ';':
+                   /* this is never seen here */
+                   format_error(args, "misplaced directive ~;");
+               case '#':
+                   /* special handling for ~#^ */
+                   if (*next_format == '^') {
+                       ++next_format;
+                       hash = 1;
+                       defs = &NoneDefs;
+                       args->command = '^';
+                       break;
+                   }
+                   parse_error(args, PARSE_BADDIRECTIVE);
+               case '^':
+                   defs = &NoneDefs;
+                   break;
+               default:
+                   parse_error(args, PARSE_BADDIRECTIVE);
+                   break;
+           }
+           merge_arguments(args, defs, &code);
+           if (code != NOERROR)
+               merge_error(args, code);
+
+           /* check if an argument is required by directive */
+           switch (args->command) {
+               case 'A': case 'S':
+               case 'B': case 'O': case 'D': case 'X': case 'R':
+                   need_argument = 1;
+                   break;
+               case 'P':
+                   /* if collon specified, plural is the last print argument */
+                   need_argument = !args->collon;
+                   break;
+               case 'C':
+                   need_argument = 1;
+                   break;
+               case 'F': case 'E': case 'G': case '$':
+                   need_argument = 1;
+                   break;
+               case '%': case '&': case '|': case '~': case '\n':
+                   break;
+               case 'T':
+                   break;
+               case '*':                       /* check arguments below */
+                   need_update = 1;
+                   break;
+               case '?':
+                   need_argument = need_update = 1;
+                   break;
+               case '(': case '[': case '{': case '<':
+                   need_update = 1;
+                   break;
+               case '^':
+                   break;
+           }
+           if (need_argument) {
+               if (!CONSP(arguments))
+                   parse_error(args, PARSE_NOARGSLEFT);
+               object = CAR(arguments);
+               arguments = CDR(arguments);
+               --num_arguments;
+           }
+
+           /* will do recursive calls that change info */
+           if (need_update) {
+               *(info->format) = next_format;
+               *(info->object) = object;
+               *(info->arguments) = arguments;
+               *(info->num_arguments) = num_arguments;
+           }
+
+           /* everything seens fine, print the format directive */
+           switch (args->command) {
+               case 'A':
+                   head = lisp__data.env.length;
+                   LispAddVar(Oprint_escape, NIL);
+                   ++lisp__data.env.head;
+                   format_ascii(stream, object, args);
+                   lisp__data.env.head = lisp__data.env.length = head;
+                   break;
+               case 'S':
+                   head = lisp__data.env.length;
+                   LispAddVar(Oprint_escape, T);
+                   ++lisp__data.env.head;
+                   format_ascii(stream, object, args);
+                   lisp__data.env.head = lisp__data.env.length = head;
+                   break;
+               case 'B':
+                   format_in_radix(stream, object, 2, args);
+                   break;
+               case 'O':
+                   format_in_radix(stream, object, 8, args);
+                   break;
+               case 'D':
+                   format_in_radix(stream, object, 10, args);
+                   break;
+               case 'X':
+                   format_in_radix(stream, object, 16, args);
+                   break;
+               case 'R':
+                   /* if a single argument specified */
+                   if (args->count)
+                       format_in_radix(stream, object, 0, args);
+                   else
+                       format_radix_special(stream, object, args);
+                   break;
+               case 'P':
+                   if (args->atsign) {
+                       if (FIXNUMP(object) && FIXNUM_VALUE(object) == 1)
+                           LispWriteChar(stream, 'y');
+                       else
+                           LispWriteStr(stream, "ies", 3);
+                   }
+                   else if (!FIXNUMP(object) || FIXNUM_VALUE(object) != 1)
+                       LispWriteChar(stream, 's');
+                   break;
+               case 'C':
+                   format_character(stream, object, args);
+                   break;
+               case 'F':
+                   format_fixed_float(stream, object, args);
+                   break;
+               case 'E':
+                   format_exponential_float(stream, object, args);
+                   break;
+               case 'G':
+                   format_general_float(stream, object, args);
+                   break;
+               case '$':
+                   format_dollar_float(stream, object, args);
+                   break;
+               case '&':
+                   if (LispGetColumn(stream) == 0)
+                       --args->arguments[0].value;
+               case '%':
+                   LispWriteChars(stream, '\n', args->arguments[0].value);
+                   break;
+               case '|':
+                   LispWriteChars(stream, '\f', args->arguments[0].value);
+                   break;
+               case '~':
+                   LispWriteChars(stream, '~', args->arguments[0].value);
+                   break;
+               case '\n':
+                   if (!args->collon) {
+                       if (args->atsign)
+                           LispWriteChar(stream, '\n');
+                       /* ignore newline and following spaces */
+                       while (*next_format && isspace(*next_format))
+                           ++next_format;
+                   }
+                   break;
+               case 'T':
+                   format_tabulate(stream, args);
+                   break;
+               case '*':
+                   format_goto(info);
+                   break;
+               case '?':
+                   format_indirection(stream, object, info);
+                   need_update = 1;
+                   break;
+               case '(':
+                   format_case_conversion(stream, info);
+                   /* next_format if far from what is set now */
+                   next_format = *(info->format);
+                   break;
+               case '[':
+                   format_conditional(stream, info);
+                   /* next_format if far from what is set now */
+                   next_format = *(info->format);
+                   break;
+               case '{':
+                   format_iterate(stream, info);
+                   /* next_format if far from what is set now */
+                   next_format = *(info->format);
+                   break;
+               case '<':
+                   format_justify(stream, info);
+                   /* next_format if far from what is set now */
+                   next_format = *(info->format);
+                   break;
+               case '^':
+                   if (args->collon) {
+                       if (hash && num_arguments == 0) {
+                           info->upandout = UPANDOUT_HASH;
+                           goto format_up_and_out;
+                       }
+                       if (info->iteration &&
+                           info->iteration == ITERATION_NORMAL)
+                       /* not exactly an error, but in this case,
+                        * command is ignored */
+                           break;
+                       info->upandout = UPANDOUT_COLLON;
+                       goto format_up_and_out;
+                   }
+                   else if (num_arguments == 0) {
+                       info->upandout = UPANDOUT_NORMAL;
+                       goto format_up_and_out;
+                   }
+                   break;
+           }
+
+           if (need_update) {
+               object = *(info->object);
+               arguments = *(info->arguments);
+               num_arguments = *(info->num_arguments);
+           }
+
+           format = next_format;
+       }
+       else {
+           if (length >= sizeof(stk)) {
+               LispWriteStr(stream, stk, length);
+               length = 0;
+           }
+           stk[length++] = *format++;
+       }
+    }
+
+    /* flush any peding output */
+    if (length)
+       LispWriteStr(stream, stk, length);
+
+format_up_and_out:
+    /* update for recursive call */
+    *(info->format) = format;
+    *(info->object) = object;
+    *(info->arguments) = arguments;
+    *(info->num_arguments) = num_arguments;
+}
+
+LispObj *
+Lisp_Format(LispBuiltin *builtin)
+/*
+ format destination control-string &rest arguments
+ */
+{
+    GC_ENTER();
+    FmtInfo info;
+    LispObj *object;
+    char *control_string;
+    int num_arguments;
+
+    LispObj *stream, *format, *arguments;
+
+    arguments = ARGUMENT(2);
+    format = ARGUMENT(1);
+    stream = ARGUMENT(0);
+
+    /* check format and stream */
+    CHECK_STRING(format);
+    if (stream == NIL) {       /* return a string */
+       stream = LSTRINGSTREAM("", STREAM_READ | STREAM_WRITE, 0);
+       GC_PROTECT(stream);
+    }
+    else if (stream == T ||    /* print directly to *standard-output* */
+            stream == STANDARD_OUTPUT)
+       stream = NIL;
+    else {
+       CHECK_STREAM(stream);
+       if (!stream->data.stream.writable)
+           LispDestroy("%s: stream %s is not writable",
+                       STRFUN(builtin), STROBJ(stream));
+    }
+
+    /* count number of arguments */
+    for (object = arguments, num_arguments = 0; CONSP(object);
+        object = CDR(object), num_arguments++)
+       ;
+
+    /* initialize plural/argument info */
+    object = NIL;
+
+    /* the format string */
+    control_string = THESTR(format);
+
+    /* arguments to recursive calls */
+    info.args.base = control_string;
+    info.base_arguments = arguments;
+    info.total_arguments = num_arguments;
+    info.format = &control_string;
+    info.object = &object;
+    info.arguments = &arguments;
+    info.num_arguments = &num_arguments;
+    info.iteration = 0;
+
+    /* format arguments */
+    LispFormat(stream, &info);
+
+    /* if printing to stdout */
+    if (stream == NIL)
+       LispFflush(Stdout);
+    /* else if printing to string-stream, return a string */
+    else if (stream->data.stream.type == LispStreamString) {
+       int length;
+       char *string;
+
+       string = LispGetSstring(SSTREAMP(stream), &length);
+       stream = LSTRING(string, length);
+    }
+
+    GC_LEAVE();
+
+    return (stream);
+}
diff --git a/xedit/lisp/format.h b/xedit/lisp/format.h
new file mode 100644 (file)
index 0000000..3db8136
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/format.h,v 1.3tsi Exp $ */
+
+#ifndef Lisp_format_h
+#define Lisp_format_h
+
+#include "lisp/private.h"
+
+/*
+ * Prototypes
+ */
+LispObj *Lisp_Format(LispBuiltin*);
+
+#endif /* Lisp_format_h */
diff --git a/xedit/lisp/hash.c b/xedit/lisp/hash.c
new file mode 100644 (file)
index 0000000..a6b91ec
--- /dev/null
@@ -0,0 +1,659 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/hash.c,v 1.5 2003/04/27 18:17:32 tsi Exp $ */
+
+#include "lisp/hash.h"
+
+/* A simple hash-table implementation
+ * TODO: implement SXHASH and WITH-HASH-TABLE-ITERATOR
+ * May need a rewrite for better performance, and will
+ * need a rewrite if images/bytecode saved on disk.
+ */
+
+#define        GET_HASH        1
+#define PUT_HASH       2
+#define REM_HASH       3
+
+/*
+ * Prototypes
+ */
+static unsigned long LispHashKey(LispObj*, int);
+static LispObj *LispHash(LispBuiltin*, int);
+static void LispRehash(LispHashTable*);
+static void LispFreeHashEntries(LispHashEntry*, long);
+
+/*
+ * Initialization
+ */
+extern LispObj *Oeq, *Oeql, *Oequal, *Oequalp;
+
+/*  Hash tables will have one of these sizes, unless the user
+ * specified a very large size */
+static long some_primes[] = {
+       5,   11,   17,   23,
+      31,   47,   71,   97,
+     139,  199,  307,  401,
+     607,  809, 1213, 1619,
+    2437, 3251, 4889, 6521
+};
+
+/*
+ * Implementation
+ */
+static unsigned long
+LispHashKey(LispObj *object, int function)
+{
+    mpi *bigi;
+    char *string;
+    long i, length;
+    unsigned long key = ((unsigned long)object) >> 4;
+
+    /* Must be the same object for EQ */
+    if (function == FEQ)
+       goto hash_key_done;
+
+    if (function == FEQUALP) {
+       switch (OBJECT_TYPE(object)) {
+           case LispSChar_t:
+               key = (unsigned long)toupper(SCHAR_VALUE(object));
+               goto hash_key_done;
+           case LispString_t:
+               string = THESTR(object);
+               length = STRLEN(object);
+               if (length > 32)
+                   length = 32;
+               for (i = 0, key = 0; i < length; i++)
+                   key = (key << 1) ^ toupper(string[i]);
+               goto hash_key_done;
+           default:
+               break;
+       }
+    }
+
+    /* Function is EQL, EQUAL or EQUALP */
+    switch (OBJECT_TYPE(object)) {
+       case LispFixnum_t:
+       case LispSChar_t:
+           key = (unsigned long)FIXNUM_VALUE(object);
+           goto hash_key_done;
+       case LispInteger_t:
+           key = (unsigned long)INT_VALUE(object);
+           goto hash_key_done;
+       case LispRatio_t:
+           key = (object->data.ratio.numerator << 16) ^
+                  object->data.ratio.denominator;
+           goto hash_key_done;
+       case LispDFloat_t:
+           key = (unsigned long)DFLOAT_VALUE(object);
+           break;
+       case LispComplex_t:
+           key = (LispHashKey(object->data.complex.imag, function) << 16) ^
+                  LispHashKey(object->data.complex.real, function);
+           goto hash_key_done;
+       case LispBignum_t:
+           bigi = object->data.mp.integer;
+           length = bigi->size;
+           if (length > 8)
+               length = 8;
+           key = bigi->sign;
+           for (i = 0; i < length; i++)
+               key = (key << 8) ^ bigi->digs[i];
+           goto hash_key_done;
+       case LispBigratio_t:
+           bigi = mpr_num(object->data.mp.ratio);
+           length = bigi->size;
+           if (length > 4)
+               length = 4;
+           key = bigi->sign;
+           for (i = 0; i < length; i++)
+               key = (key << 4) ^ bigi->digs[i];
+           bigi = mpr_den(object->data.mp.ratio);
+           length = bigi->size;
+           if (length > 4)
+               length = 4;
+           for (i = 0; i < length; i++)
+               key = (key << 4) ^ bigi->digs[i];
+           goto hash_key_done;
+       default:
+           break;
+    }
+
+    /* Anything else must be the same object for EQL */
+    if (function == FEQL)
+       goto hash_key_done;
+
+    switch (OBJECT_TYPE(object)) {
+       case LispString_t:
+           string = THESTR(object);
+           length = STRLEN(object);
+           for (i = 0, key = 0; i < length; i++)
+               key = (key << 1) ^ string[i];
+           break;
+       case LispCons_t:
+           key = (LispHashKey(CAR(object), function) << 16) ^
+                  LispHashKey(CDR(object), function);
+           break;
+       case LispQuote_t:
+       case LispBackquote_t:
+       case LispPathname_t:
+           key = LispHashKey(object->data.pathname, function);
+           break;
+       case LispRegex_t:
+           key = LispHashKey(object->data.regex.pattern, function);
+           break;
+       default:
+           break;
+    }
+
+hash_key_done:
+    return (key);
+}
+
+static LispObj *
+LispHash(LispBuiltin *builtin, int code)
+{
+    LispHashEntry *entry;
+    LispHashTable *hash;
+    unsigned long key;
+    LispObj *result;
+    int found;
+    long i;
+
+    LispObj *okey, *hash_table, *value;
+
+    if (code == REM_HASH)
+       value = NIL;
+    else {
+       value = ARGUMENT(2);
+       if (value == UNSPEC)
+           value = NIL;
+    }
+    hash_table = ARGUMENT(1);
+    okey = ARGUMENT(0);
+
+    CHECK_HASHTABLE(hash_table);
+
+    /* get hash entry */
+    hash = hash_table->data.hash.table;
+    key = LispHashKey(okey, hash->function) % hash->num_entries;
+    entry = hash->entries + key;
+
+    /* search entry in the hash table */
+    if (entry->count == 0)
+       i = 0;
+    else {
+       if (hash->function == FEQ) {
+           for (i = entry->cache; i >= 0; i--) {
+               if (entry->keys[i] == okey)
+                   goto found_key;
+           }
+           for (i = entry->cache + 1; i < entry->count; i++) {
+               if (entry->keys[i] == okey)
+                   break;
+           }
+       }
+       else {
+           for (i = entry->cache; i >= 0; i--) {
+               if (LispObjectCompare(entry->keys[i], okey,
+                                     hash->function) == T)
+                   goto found_key;
+           }
+           for (i = entry->cache + 1; i < entry->count; i++) {
+               if (LispObjectCompare(entry->keys[i], okey,
+                                     hash->function) == T)
+                   break;
+           }
+       }
+    }
+
+found_key:
+    result = value;
+    if ((found = i < entry->count) == 0)
+       i = entry->count;
+
+    switch (code) {
+       case GET_HASH:
+           RETURN_COUNT = 1;
+           if (found) {
+               RETURN(0) = T;
+               entry->cache = i;
+               result = entry->values[i];
+           }
+           else
+               RETURN(0) = NIL;
+           break;
+       case PUT_HASH:
+           entry->cache = i;
+           if (found)
+               /* Just replace current entry */
+               entry->values[i] = value;
+           else {
+               if ((i % 4) == 0) {
+                   LispObj **keys, **values;
+
+                   keys = realloc(entry->keys, sizeof(LispObj*) * (i + 4));
+                   if (keys == NULL)
+                       LispDestroy("out of memory");
+                   values = realloc(entry->values, sizeof(LispObj*) * (i + 4));
+                   if (values == NULL) {
+                       free(keys);
+                       LispDestroy("out of memory");
+                   }
+                   entry->keys = keys;
+                   entry->values = values;
+               }
+               entry->keys[i] = okey;
+               entry->values[i] = value;
+               ++entry->count;
+               ++hash->count;
+               if (hash->count > hash->rehash_threshold * hash->num_entries)
+                   LispRehash(hash);
+           }
+           break;
+       case REM_HASH:
+           if (found) {
+               result = T;
+               --entry->count;
+               --hash->count;
+               if (i < entry->count) {
+                   memmove(entry->keys + i, entry->keys + i + 1,
+                           (entry->count - i) * sizeof(LispObj*));
+                   memmove(entry->values + i, entry->values + i + 1,
+                           (entry->count - i) * sizeof(LispObj*));
+               }
+               if (entry->cache && entry->cache == entry->count)
+                   --entry->cache;
+           }
+           break;
+    }
+
+    return (result);
+}
+
+static void
+LispRehash(LispHashTable *hash)
+{
+    unsigned long key;
+    LispHashEntry *entries, *nentry, *entry, *last;
+    long i, size = hash->num_entries * hash->rehash_size;
+
+    for (i = 0; i < sizeof(some_primes) / sizeof(some_primes[0]); i++)
+       if (some_primes[i] >= size) {
+           size = some_primes[i];
+           break;
+       }
+
+    entries = calloc(1, sizeof(LispHashEntry) * size);
+    if (entries == NULL)
+       goto out_of_memory;
+
+    for (entry = hash->entries, last = entry + hash->num_entries;
+        entry < last; entry++) {
+       for (i = 0; i < entry->count; i++) {
+           key = LispHashKey(entry->keys[i], hash->function) % size;
+           nentry = entries + key;
+           if ((nentry->count % 4) == 0) {
+               LispObj **keys, **values;
+
+               keys = realloc(nentry->keys, sizeof(LispObj*) *
+                              (nentry->count + 4));
+               if (keys == NULL)
+                   goto out_of_memory;
+               values = realloc(nentry->values, sizeof(LispObj*) *
+                                (nentry->count + 4));
+               if (values == NULL) {
+                   free(keys);
+                   goto out_of_memory;
+               }
+               nentry->keys = keys;
+               nentry->values = values;
+           }
+           nentry->keys[nentry->count] = entry->keys[i];
+           nentry->values[nentry->count] = entry->values[i];
+           ++nentry->count;
+
+       }
+    }
+    LispFreeHashEntries(hash->entries, hash->num_entries);
+    hash->entries = entries;
+    hash->num_entries = size;
+    return;
+
+out_of_memory:
+    if (entries)
+       LispFreeHashEntries(entries, size);
+    LispDestroy("out of memory");
+}
+
+static void
+LispFreeHashEntries(LispHashEntry *entries, long num_entries)
+{
+    LispHashEntry *entry, *last;
+
+    for (entry = entries, last = entry + num_entries; entry < last; entry++) {
+       free(entry->keys);
+       free(entry->values);
+    }
+    free(entries);
+}
+
+void
+LispFreeHashTable(LispHashTable *hash)
+{
+    LispFreeHashEntries(hash->entries, hash->num_entries);
+    free(hash);
+}
+
+LispObj *
+Lisp_Clrhash(LispBuiltin *builtin)
+/*
+ clrhash hash-table
+ */
+{
+    LispHashTable *hash;
+    LispHashEntry *entry, *last;
+
+    LispObj *hash_table = ARGUMENT(0);
+
+    CHECK_HASHTABLE(hash_table);
+
+    hash = hash_table->data.hash.table;
+    for (entry = hash->entries, last = entry + hash->num_entries;
+       entry < last; entry++) {
+       free(entry->keys);
+       free(entry->values);
+       entry->keys = entry->values = NULL;
+       entry->count = entry->cache = 0;
+    }
+    hash->count = 0;
+
+    return (hash_table);
+}
+
+LispObj *
+Lisp_Gethash(LispBuiltin *builtin)
+/*
+ gethash key hash-table &optional default
+ */
+{
+    return (LispHash(builtin, GET_HASH));
+}
+
+LispObj *
+Lisp_HashTableP(LispBuiltin *builtin)
+/*
+ hash-table-p object
+ */
+{
+    LispObj *object = ARGUMENT(0);
+
+    return (HASHTABLEP(object) ? T : NIL);
+}
+
+LispObj *
+Lisp_HashTableCount(LispBuiltin *builtin)
+/*
+ hash-table-count hash-table
+ */
+{
+    LispObj *hash_table = ARGUMENT(0);
+
+    CHECK_HASHTABLE(hash_table);
+
+    return (FIXNUM(hash_table->data.hash.table->count));
+}
+
+LispObj *
+Lisp_HashTableRehashSize(LispBuiltin *builtin)
+/*
+ hash-table-rehash-size hash-table
+ */
+{
+    LispObj *hash_table = ARGUMENT(0);
+
+    CHECK_HASHTABLE(hash_table);
+
+    return (DFLOAT(hash_table->data.hash.table->rehash_size));
+}
+
+LispObj *
+Lisp_HashTableRehashThreshold(LispBuiltin *builtin)
+/*
+ hash-table-rehash-threshold hash-table
+ */
+{
+    LispObj *hash_table = ARGUMENT(0);
+
+    CHECK_HASHTABLE(hash_table);
+
+    return (DFLOAT(hash_table->data.hash.table->rehash_threshold));
+}
+
+LispObj *
+Lisp_HashTableSize(LispBuiltin *builtin)
+/*
+ hash-table-size hash-table
+ */
+{
+    LispObj *hash_table = ARGUMENT(0);
+
+    CHECK_HASHTABLE(hash_table);
+
+    return (FIXNUM(hash_table->data.hash.table->num_entries));
+}
+
+LispObj *
+Lisp_HashTableTest(LispBuiltin *builtin)
+/*
+ hash-table-test hash-table
+ */
+{
+    LispObj *hash_table = ARGUMENT(0);
+
+    CHECK_HASHTABLE(hash_table);
+
+    return (hash_table->data.hash.test);
+}
+
+LispObj *
+Lisp_Maphash(LispBuiltin *builtin)
+/*
+ maphash function hash-table
+ */
+{
+    long i;
+    LispHashEntry *entry, *last;
+
+    LispObj *function, *hash_table;
+
+    hash_table = ARGUMENT(1);
+    function = ARGUMENT(0);
+
+    CHECK_HASHTABLE(hash_table);
+
+    for (entry = hash_table->data.hash.table->entries,
+        last = entry + hash_table->data.hash.table->num_entries;
+        entry < last; entry++) {
+       for (i = 0; i < entry->count; i++)
+           APPLY2(function, entry->keys[i], entry->values[i]);
+    }
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_MakeHashTable(LispBuiltin *builtin)
+/*
+ make-hash-table &key test size rehash-size rehash-threshold initial-contents
+ */
+{
+    int function = FEQL;
+    unsigned long i, isize, xsize;
+    double drsize, drthreshold;
+    LispHashTable *hash_table;
+    LispObj *cons, *result;
+
+    LispObj *test, *size, *rehash_size, *rehash_threshold, *initial_contents;
+
+    initial_contents = ARGUMENT(4);
+    rehash_threshold = ARGUMENT(3);
+    rehash_size = ARGUMENT(2);
+    size = ARGUMENT(1);
+    test = ARGUMENT(0);
+
+    if (test != UNSPEC) {
+       if (FUNCTIONP(test))
+           test = test->data.atom->object;
+       if (test == Oeq)
+           function = FEQ;
+       else if (test == Oeql)
+           function = FEQL;
+       else if (test == Oequal)
+           function = FEQUAL;
+       else if (test == Oequalp)
+           function = FEQUALP;
+       else
+           LispDestroy("%s: :TEST must be EQ, EQL, EQUAL, "
+                       "or EQUALP, not %s", STRFUN(builtin), STROBJ(test));
+    }
+    else
+       test = Oeql;
+
+    if (size != UNSPEC) {
+       CHECK_INDEX(size);
+       isize = FIXNUM_VALUE(size);
+    }
+    else
+       isize = 1;
+
+    if (rehash_size != UNSPEC) {
+       CHECK_DFLOAT(rehash_size);
+       if (DFLOAT_VALUE(rehash_size) <= 1.0)
+           LispDestroy("%s: :REHASH-SIZE must a float > 1, not %s",
+                       STRFUN(builtin), STROBJ(rehash_size));
+       drsize = DFLOAT_VALUE(rehash_size);
+    }
+    else
+       drsize = 1.5;
+
+    if (rehash_threshold != UNSPEC) {
+       CHECK_DFLOAT(rehash_threshold);
+       if (DFLOAT_VALUE(rehash_threshold) < 0.0 ||
+           DFLOAT_VALUE(rehash_threshold) > 1.0)
+           LispDestroy("%s: :REHASH-THRESHOLD must a float "
+                       "in the range 0.0 - 1.0, not %s",
+                       STRFUN(builtin), STROBJ(rehash_threshold));
+       drthreshold = DFLOAT_VALUE(rehash_threshold);
+    }
+    else
+       drthreshold = 0.75;
+
+    if (initial_contents == UNSPEC)
+       initial_contents = NIL;
+    CHECK_LIST(initial_contents);
+    for (xsize = 0, cons = initial_contents;
+        CONSP(cons);
+        xsize++, cons = CDR(cons))
+       CHECK_CONS(CAR(cons));
+
+    if (xsize > isize)
+       isize = xsize;
+
+    for (i = 0; i < sizeof(some_primes) / sizeof(some_primes[0]); i++)
+       if (some_primes[i] >= isize) {
+           isize = some_primes[i];
+           break;
+       }
+
+    hash_table = LispMalloc(sizeof(LispHashTable));
+    hash_table->entries = LispCalloc(1, sizeof(LispHashEntry) * isize);
+    hash_table->num_entries = isize;
+    hash_table->count = 0;
+    hash_table->function = function;
+    hash_table->rehash_size = drsize;
+    hash_table->rehash_threshold = drthreshold;
+
+    result = LispNew(NIL, NIL);
+    result->type = LispHashTable_t;
+    result->data.hash.table = hash_table;
+    result->data.hash.test = test;
+
+    LispMused(hash_table);
+    LispMused(hash_table->entries);
+
+    if (initial_contents != UNSPEC) {
+       unsigned long key;
+       LispHashEntry *entry;
+
+       for (cons = initial_contents; CONSP(cons); cons = CDR(cons)) {
+           key = LispHashKey(CAAR(cons), function) % isize;
+           entry = hash_table->entries + key;
+
+           if ((entry->count % 4) == 0) {
+               LispObj **keys, **values;
+
+               keys = realloc(entry->keys, sizeof(LispObj*) * (i + 4));
+               if (keys == NULL)
+                   LispDestroy("out of memory");
+               values = realloc(entry->values, sizeof(LispObj*) * (i + 4));
+               if (values == NULL) {
+                   free(keys);
+                   LispDestroy("out of memory");
+               }
+               entry->keys = keys;
+               entry->values = values;
+           }
+           entry->keys[entry->count] = CAAR(cons);
+           entry->values[entry->count] = CDAR(cons);
+           ++entry->count;
+       }
+       hash_table->count = xsize;
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Remhash(LispBuiltin *builtin)
+/*
+ remhash key hash-table
+ */
+{
+    return (LispHash(builtin, REM_HASH));
+}
+
+LispObj *
+Lisp_XeditPuthash(LispBuiltin *builtin)
+/*
+ lisp::puthash key hash-table value
+ */
+{
+    return (LispHash(builtin, PUT_HASH));
+}
diff --git a/xedit/lisp/hash.h b/xedit/lisp/hash.h
new file mode 100644 (file)
index 0000000..be74f11
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/hash.h,v 1.2tsi Exp $ */
+
+#ifndef Lisp_hash_h
+#define Lisp_hash_h
+
+#include "lisp/private.h"
+
+typedef struct _LispHashEntry {
+    LispObj **keys;
+    LispObj **values;
+    long cache;
+    long count;
+} LispHashEntry;
+
+struct _LispHashTable {
+    LispHashEntry *entries;
+    long num_entries;
+    long count;
+    int function;              /* Function is EQ, EQL, EQUAL, or EQUALP */
+    double rehash_size;
+    double rehash_threshold;
+};
+
+/*
+ * Prototypes
+ */
+void LispFreeHashTable(LispHashTable*);
+
+LispObj *Lisp_Clrhash(LispBuiltin*);
+LispObj *Lisp_Gethash(LispBuiltin*);
+LispObj *Lisp_HashTableCount(LispBuiltin*);
+LispObj *Lisp_HashTableP(LispBuiltin*);
+LispObj *Lisp_HashTableRehashSize(LispBuiltin*);
+LispObj *Lisp_HashTableRehashThreshold(LispBuiltin*);
+LispObj *Lisp_HashTableSize(LispBuiltin*);
+LispObj *Lisp_HashTableTest(LispBuiltin*);
+LispObj *Lisp_Maphash(LispBuiltin*);
+LispObj *Lisp_MakeHashTable(LispBuiltin*);
+LispObj *Lisp_Remhash(LispBuiltin*);
+LispObj *Lisp_XeditPuthash(LispBuiltin*);
+
+#endif /* Lisp_hash_h */
diff --git a/xedit/lisp/helper.c b/xedit/lisp/helper.c
new file mode 100644 (file)
index 0000000..be3ee7b
--- /dev/null
@@ -0,0 +1,1126 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/helper.c,v 1.50 2003/05/27 22:27:03 tsi Exp $ */
+
+#include "lisp/helper.h"
+#include "lisp/pathname.h"
+#include "lisp/package.h"
+#include "lisp/read.h"
+#include "lisp/stream.h"
+#include "lisp/write.h"
+#include "lisp/hash.h"
+#include <ctype.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <math.h>
+#include <sys/stat.h>
+
+/*
+ * Prototypes
+ */
+static LispObj *LispReallyDo(LispBuiltin*, int);
+static LispObj *LispReallyDoListTimes(LispBuiltin*, int);
+
+/* in math.c */
+extern LispObj *LispFloatCoerce(LispBuiltin*, LispObj*);
+
+/*
+ * Implementation
+ */
+LispObj *
+LispObjectCompare(LispObj *left, LispObj *right, int function)
+{
+    LispType ltype, rtype;
+    LispObj *result = left == right ? T : NIL;
+
+    /* If left and right are the same object, or if function is EQ */
+    if (result == T || function == FEQ)
+       return (result);
+
+    ltype = OBJECT_TYPE(left);
+    rtype = OBJECT_TYPE(right);
+
+    /* Equalp requires that numeric objects be compared by value, and
+     * strings or characters comparison be case insenstive */
+    if (function == FEQUALP) {
+       switch (ltype) {
+           case LispFixnum_t:
+           case LispInteger_t:
+           case LispBignum_t:
+           case LispDFloat_t:
+           case LispRatio_t:
+           case LispBigratio_t:
+           case LispComplex_t:
+               switch (rtype) {
+                   case LispFixnum_t:
+                   case LispInteger_t:
+                   case LispBignum_t:
+                   case LispDFloat_t:
+                   case LispRatio_t:
+                   case LispBigratio_t:
+                   case LispComplex_t:
+                       result = APPLY2(Oequal_, left, right);
+                       break;
+                   default:
+                       break;
+               }
+               goto compare_done;
+           case LispSChar_t:
+               if (rtype == LispSChar_t &&
+                   toupper(SCHAR_VALUE(left)) == toupper(SCHAR_VALUE(right)))
+                   result = T;
+               goto compare_done;
+           case LispString_t:
+               if (rtype == LispString_t && STRLEN(left) == STRLEN(right)) {
+                   long i = STRLEN(left);
+                   char *sl = THESTR(left), *sr = THESTR(right);
+
+                   for (--i; i >= 0; i--)
+                       if (toupper(sl[i]) != toupper(sr[i]))
+                           break;
+                   if (i < 0)
+                       result = T;
+               }
+               goto compare_done;
+           case LispArray_t:
+               if (rtype == LispArray_t &&
+                   left->data.array.type == right->data.array.type &&
+                   left->data.array.rank == right->data.array.rank &&
+                   LispObjectCompare(left->data.array.dim,
+                                     right->data.array.dim,
+                                     FEQUAL) != NIL) {
+                   LispObj *llist = left->data.array.list,
+                           *rlist = right->data.array.list;
+
+                   for (; CONSP(llist); llist = CDR(llist), rlist = CDR(rlist))
+                       if (LispObjectCompare(CAR(llist), CAR(rlist),
+                                             FEQUALP) == NIL)
+                           break;
+                   if (!CONSP(llist))
+                       result = T;
+               }
+               goto compare_done;
+           case LispStruct_t:
+               if (rtype == LispStruct_t &&
+                   left->data.struc.def == right->data.struc.def) {
+                   LispObj *lfield = left->data.struc.fields,
+                           *rfield = right->data.struc.fields;
+
+                   for (; CONSP(lfield);
+                        lfield = CDR(lfield), rfield = CDR(rfield)) {
+                       if (LispObjectCompare(CAR(lfield), CAR(rfield),
+                                             FEQUALP) != T)
+                           break;
+                   }
+                   if (!CONSP(lfield))
+                       result = T;
+               }
+               goto compare_done;
+           case LispHashTable_t:
+               if (rtype == LispHashTable_t &&
+                   left->data.hash.table->count ==
+                   right->data.hash.table->count &&
+                   left->data.hash.test == right->data.hash.test) {
+                   unsigned long i;
+                   LispObj *test = left->data.hash.test;
+                   LispHashEntry *lentry = left->data.hash.table->entries,
+                                 *llast = lentry +
+                                          left->data.hash.table->num_entries,
+                                 *rentry = right->data.hash.table->entries;
+
+                   for (; lentry < llast; lentry++, rentry++) {
+                       if (lentry->count != rentry->count)
+                           break;
+                       for (i = 0; i < lentry->count; i++) {
+                           if (APPLY2(test,
+                                      lentry->keys[i],
+                                      rentry->keys[i]) == NIL ||
+                               LispObjectCompare(lentry->values[i],
+                                                 rentry->values[i],
+                                                 FEQUALP) == NIL)
+                               break;
+                       }
+                       if (i < lentry->count)
+                           break;
+                   }
+                   if (lentry == llast)
+                       result = T;
+               }
+               goto compare_done;
+           default:
+               break;
+       }
+    }
+
+    /* Function is EQL or EQUAL, or EQUALP on arguments with the same rules */
+    if (ltype == rtype) {
+       switch (ltype) {
+           case LispFixnum_t:
+           case LispSChar_t:
+               if (FIXNUM_VALUE(left) == FIXNUM_VALUE(right))
+                   result = T;
+               break;
+           case LispInteger_t:
+               if (INT_VALUE(left) == INT_VALUE(right))
+                   result = T;
+               break;
+           case LispDFloat_t:
+               if (DFLOAT_VALUE(left) == DFLOAT_VALUE(right))
+                   result = T;
+               break;
+           case LispRatio_t:
+               if (left->data.ratio.numerator ==
+                   right->data.ratio.numerator &&
+                   left->data.ratio.denominator ==
+                   right->data.ratio.denominator)
+                   result = T;
+               break;
+           case LispComplex_t:
+               if (LispObjectCompare(left->data.complex.real,
+                                     right->data.complex.real,
+                                     function) == T &&
+                   LispObjectCompare(left->data.complex.imag,
+                                     right->data.complex.imag,
+                                     function) == T)
+                   result = T;
+               break;
+           case LispBignum_t:
+               if (mpi_cmp(left->data.mp.integer, right->data.mp.integer) == 0)
+                   result = T;
+               break;
+           case LispBigratio_t:
+               if (mpr_cmp(left->data.mp.ratio, right->data.mp.ratio) == 0)
+                   result = T;
+               break;
+           default:
+               break;
+       }
+
+       /* Next types must be the same object for EQL */
+       if (function == FEQL)
+           goto compare_done;
+
+       switch (ltype) {
+           case LispString_t:
+               if (STRLEN(left) == STRLEN(right) &&
+                   memcmp(THESTR(left), THESTR(right), STRLEN(left)) == 0)
+                   result = T;
+               break;
+           case LispCons_t:
+               if (LispObjectCompare(CAR(left), CAR(right), function) == T &&
+                   LispObjectCompare(CDR(left), CDR(right), function) == T)
+                   result = T;
+               break;
+           case LispQuote_t:
+           case LispBackquote_t:
+           case LispPathname_t:
+               result = LispObjectCompare(left->data.pathname,
+                                          right->data.pathname, function);
+               break;
+           case LispLambda_t:
+               result = LispObjectCompare(left->data.lambda.name,
+                                          right->data.lambda.name,
+                                          function);
+               break;
+           case LispOpaque_t:
+               if (left->data.opaque.data == right->data.opaque.data)
+                   result = T;
+               break;
+           case LispRegex_t:
+               /* If the regexs are guaranteed to generate the same matches */
+               if (left->data.regex.options == right->data.regex.options)
+                   result = LispObjectCompare(left->data.regex.pattern,
+                                              right->data.regex.pattern,
+                                              function);
+               break;
+           default:
+               break;
+       }
+    }
+
+compare_done:
+    return (result);
+}
+
+void
+LispCheckSequenceStartEnd(LispBuiltin *builtin,
+                         LispObj *sequence, LispObj *start, LispObj *end,
+                         long *pstart, long *pend, long *plength)
+{
+    /* Calculate length of sequence and check it's type */
+    *plength = LispLength(sequence);
+
+    /* Check start argument */
+    if (start == UNSPEC || start == NIL)
+       *pstart = 0;
+    else {
+       CHECK_INDEX(start);
+       *pstart = FIXNUM_VALUE(start);
+    }
+
+    /* Check end argument */
+    if (end == UNSPEC || end == NIL)
+       *pend = *plength;
+    else {
+       CHECK_INDEX(end);
+       *pend = FIXNUM_VALUE(end);
+    }
+
+    /* Check start argument */
+    if (*pstart > *pend)
+       LispDestroy("%s: :START %ld is larger than :END %ld",
+                   STRFUN(builtin), *pstart, *pend);
+
+    /* Check end argument */
+    if (*pend > *plength)
+       LispDestroy("%s: :END %ld is larger then sequence length %ld",
+                   STRFUN(builtin), *pend, *plength);
+}
+
+long
+LispLength(LispObj *sequence)
+{
+    long length;
+
+    if (sequence == NIL)
+       return (0);
+    switch (OBJECT_TYPE(sequence)) {
+       case LispString_t:
+           length = STRLEN(sequence);
+           break;
+       case LispArray_t:
+           if (sequence->data.array.rank != 1)
+               goto not_a_sequence;
+           sequence = sequence->data.array.list;
+           /*FALLTROUGH*/
+       case LispCons_t:
+           for (length = 0;
+                CONSP(sequence);
+                length++, sequence = CDR(sequence))
+               ;
+           break;
+       default:
+not_a_sequence:
+           LispDestroy("LENGTH: %s is not a sequence", STROBJ(sequence));
+           /*NOTREACHED*/
+           length = 0;
+    }
+
+    return (length);
+}
+
+LispObj *
+LispCharacterCoerce(LispBuiltin *builtin, LispObj *object)
+{
+    if (SCHARP(object))
+       return (object);
+    else if (STRINGP(object) && STRLEN(object) == 1)
+       return (SCHAR(THESTR(object)[0]));
+    else if (SYMBOLP(object) && ATOMID(object)->value[1] == '\0')
+       return (SCHAR(ATOMID(object)->value[0]));
+    else if (INDEXP(object)) {
+       int c = FIXNUM_VALUE(object);
+
+       if (c <= 0xff)
+           return (SCHAR(c));
+    }
+    else if (object == T)
+       return (SCHAR('T'));
+
+    LispDestroy("%s: cannot convert %s to character",
+               STRFUN(builtin), STROBJ(object));
+    /*NOTREACHED*/
+    return (NIL);
+}
+
+LispObj *
+LispStringCoerce(LispBuiltin *builtin, LispObj *object)
+{
+    if (STRINGP(object))
+       return (object);
+    else if (SYMBOLP(object))
+       return (LispSymbolName(object));
+    else if (SCHARP(object)) {
+       char string[1];
+
+       string[0] = SCHAR_VALUE(object);
+       return (LSTRING(string, 1));
+    }
+    else if (object == NIL)
+       return (LSTRING(Snil->value, 3));
+    else if (object == T)
+       return (LSTRING(St->value, 1));
+    else
+       LispDestroy("%s: cannot convert %s to string",
+                   STRFUN(builtin), STROBJ(object));
+    /*NOTREACHED*/
+    return (NIL);
+}
+
+LispObj *
+LispCoerce(LispBuiltin *builtin,
+          LispObj *object, LispObj *result_type)
+{
+    LispObj *result = NIL;
+    LispType type = LispNil_t;
+
+    if (result_type == NIL)
+       /* not even NIL can be converted to NIL? */
+       LispDestroy("%s: cannot convert %s to NIL",
+                   STRFUN(builtin), STROBJ(object));
+
+    else if (result_type == T)
+       /* no conversion */
+       return (object);
+
+    else if (!SYMBOLP(result_type))
+       /* only know about simple types */
+       LispDestroy("%s: bad argument %s",
+                   STRFUN(builtin), STROBJ(result_type));
+
+    else {
+       /* check all known types */
+
+       Atom_id atom = ATOMID(result_type);
+
+       if (atom == Satom) {
+           if (CONSP(object))
+               goto coerce_fail;
+           return (object);
+       }
+       /* only convert ATOM to SYMBOL */
+
+       if (atom == Sfloat)
+           type = LispDFloat_t;
+       else if (atom == Sinteger)
+           type = LispInteger_t;
+       else if (atom == Scons || atom == Slist) {
+           if (object == NIL)
+               return (object);
+           type = LispCons_t;
+       }
+       else if (atom == Sstring)
+           type = LispString_t;
+       else if (atom == Scharacter)
+           type = LispSChar_t;
+       else if (atom == Scomplex)
+           type = LispComplex_t;
+       else if (atom == Svector || atom == Sarray)
+           type = LispArray_t;
+       else if (atom == Sopaque)
+           type = LispOpaque_t;
+       else if (atom == Srational)
+           type = LispRatio_t;
+       else if (atom == Spathname)
+           type = LispPathname_t;
+       else
+           LispDestroy("%s: invalid type specification %s",
+                       STRFUN(builtin), ATOMID(result_type)->value);
+    }
+
+    if (OBJECT_TYPE(object) == LispOpaque_t) {
+       switch (type) {
+           case LispAtom_t:
+               result = ATOM(object->data.opaque.data);
+               break;
+           case LispString_t:
+               result = STRING(object->data.opaque.data);
+               break;
+           case LispSChar_t:
+               result = SCHAR((unsigned long)object->data.opaque.data);
+               break;
+           case LispDFloat_t:
+               result = DFLOAT((double)((long)object->data.opaque.data));
+               break;
+           case LispInteger_t:
+               result = INTEGER(((long)object->data.opaque.data));
+               break;
+           case LispOpaque_t:
+               result = OPAQUE(object->data.opaque.data, 0);
+               break;
+           default:
+               goto coerce_fail;
+               break;
+       }
+    }
+
+    else if (OBJECT_TYPE(object) != type) {
+       switch (type) {
+           case LispInteger_t:
+               if (INTEGERP(object))
+                   result = object;
+               else if (DFLOATP(object)) {
+                   if ((long)DFLOAT_VALUE(object) == DFLOAT_VALUE(object))
+                       result = INTEGER((long)DFLOAT_VALUE(object));
+                   else {
+                       mpi *integer = LispMalloc(sizeof(mpi));
+
+                       mpi_init(integer);
+                       mpi_setd(integer, DFLOAT_VALUE(object));
+                       if (mpi_getd(integer) != DFLOAT_VALUE(object)) {
+                           mpi_clear(integer);
+                           LispFree(integer);
+                           goto coerce_fail;
+                       }
+                       result = BIGNUM(integer);
+                   }
+               }
+               else
+                   goto coerce_fail;
+               break;
+           case LispRatio_t:
+               if (DFLOATP(object)) {
+                   mpr *ratio = LispMalloc(sizeof(mpr));
+
+                   mpr_init(ratio);
+                   mpr_setd(ratio, DFLOAT_VALUE(object));
+                   if (mpr_fiti(ratio)) {
+                       result = RATIO(mpi_geti(mpr_num(ratio)),
+                                      mpi_geti(mpr_den(ratio)));
+                       mpr_clear(ratio);
+                       LispFree(ratio);
+                   }
+                   else
+                       result = BIGRATIO(ratio);
+               }
+               else if (RATIONALP(object))
+                   result = object;
+               else
+                   goto coerce_fail;
+               break;
+           case LispDFloat_t:
+               result = LispFloatCoerce(builtin, object);
+               break;
+           case LispComplex_t:
+               if (NUMBERP(object))
+                   result = object;
+               else
+                   goto coerce_fail;
+               break;
+           case LispString_t:
+               if (object == NIL)
+                   result = STRING("");
+               else
+                   result = LispStringCoerce(builtin, object);
+               break;
+           case LispSChar_t:
+               result = LispCharacterCoerce(builtin, object);
+               break;
+           case LispArray_t:
+               if (LISTP(object))
+                   result = VECTOR(object);
+               else
+                   goto coerce_fail;
+               break;
+           case LispCons_t:
+               if (ARRAYP(object) && object->data.array.rank == 1)
+                   result = object->data.array.list;
+               else
+                   goto coerce_fail;
+               break;
+           case LispPathname_t:
+               result = APPLY1(Oparse_namestring, object);
+               break;
+           default:
+               goto coerce_fail;
+       }
+    }
+    else
+       result = object;
+
+    return (result);
+
+coerce_fail:
+    LispDestroy("%s: cannot convert %s to %s",
+               STRFUN(builtin), STROBJ(object), ATOMID(result_type)->value);
+    /* NOTREACHED */
+    return (NIL);
+}
+
+static LispObj *
+LispReallyDo(LispBuiltin *builtin, int refs)
+/*
+ do init test &rest body
+ do* init test &rest body
+ */
+{
+    GC_ENTER();
+    int stack, lex, head;
+    LispObj *list, *symbol, *value, *values, *cons;
+
+    LispObj *init, *test, *body;
+
+    body = ARGUMENT(2);
+    test = ARGUMENT(1);
+    init = ARGUMENT(0);
+
+    if (!CONSP(test))
+       LispDestroy("%s: end test condition must be a list, not %s",
+                   STRFUN(builtin), STROBJ(init));
+
+    CHECK_LIST(init);
+
+    /* Save state */
+    stack = lisp__data.stack.length;
+    lex = lisp__data.env.lex;
+    head = lisp__data.env.length;
+
+    values = cons = NIL;
+    for (list = init; CONSP(list); list = CDR(list)) {
+       symbol = CAR(list);
+       if (!SYMBOLP(symbol)) {
+           CHECK_CONS(symbol);
+           value = CDR(symbol);
+           symbol = CAR(symbol);
+           CHECK_SYMBOL(symbol);
+           CHECK_CONS(value);
+           value = EVAL(CAR(value));
+       }
+       else
+           value = NIL;
+
+       CHECK_CONSTANT(symbol);
+
+       LispAddVar(symbol, value);
+
+       /* Bind variable now */
+       if (refs) {
+           ++lisp__data.env.head;
+       }
+       else {
+           if (values == NIL) {
+               values = cons = CONS(NIL, NIL);
+               GC_PROTECT(values);
+           }
+           else {
+               RPLACD(cons, CONS(NIL, NIL));
+               cons = CDR(cons);
+           }
+       }
+    }
+    if (!refs)
+       lisp__data.env.head = lisp__data.env.length;
+
+    for (;;) {
+       if (EVAL(CAR(test)) != NIL)
+           break;
+
+       /* TODO Run this code in an implicit tagbody */
+       for (list = body; CONSP(list); list = CDR(list))
+           (void)EVAL(CAR(list));
+
+       /* Error checking already done in the initialization */
+       for (list = init, cons = values; CONSP(list); list = CDR(list)) {
+           symbol = CAR(list);
+           if (CONSP(symbol)) {
+               value = CDDR(symbol);
+               symbol = CAR(symbol);
+               if (CONSP(value))
+                   value = EVAL(CAR(value));
+               else
+                   value = NIL;
+           }
+           else
+               value = NIL;
+
+           if (refs)
+               LispSetVar(symbol, value);
+           else {
+               RPLACA(cons, value);
+               cons = CDR(cons);
+           }
+       }
+       if (!refs) {
+           for (list = init, cons = values;
+                CONSP(list);
+                list = CDR(list), cons = CDR(cons)) {
+               symbol = CAR(list);
+               if (CONSP(symbol)) {
+                   if (CONSP(CDR(symbol)))
+                       LispSetVar(CAR(symbol), CAR(cons));
+               }
+           }
+       }
+    }
+
+    if (CONSP(CDR(test)))
+       value = EVAL(CADR(test));
+    else
+       value = NIL;
+
+    /* Restore state */
+    lisp__data.stack.length = stack;
+    lisp__data.env.lex = lex;
+    lisp__data.env.head = lisp__data.env.length = head;
+    GC_LEAVE();
+
+    return (value);
+}
+
+LispObj *
+LispDo(LispBuiltin *builtin, int refs)
+/*
+ do init test &rest body
+ do* init test &rest body
+ */
+{
+    int jumped;
+    LispObj *result;
+    LispBlock *block;
+
+    jumped = 1;
+    result = NIL;
+    block = LispBeginBlock(NIL, LispBlockTag);
+    if (setjmp(block->jmp) == 0) {
+       result = LispReallyDo(builtin, refs);
+       jumped = 0;
+    }
+    LispEndBlock(block);
+    if (jumped)
+       result = lisp__data.block.block_ret;
+
+    return (result);
+}
+
+static LispObj *
+LispReallyDoListTimes(LispBuiltin *builtin, int times)
+/*
+ dolist init &rest body
+ dotimes init &rest body
+ */
+{
+    GC_ENTER();
+    int head = lisp__data.env.length;
+    long count = 0, end = 0;
+    LispObj *symbol, *value = NIL, *result = NIL, *init, *body, *object;
+
+    body = ARGUMENT(1);
+    init = ARGUMENT(0);
+
+    /* Parse arguments */
+    CHECK_CONS(init);
+    symbol = CAR(init);
+    CHECK_SYMBOL(symbol);
+    init = CDR(init);
+
+    if (init == NIL) {
+       if (times)
+           LispDestroy("%s: NIL is not a number", STRFUN(builtin));
+    }
+    else {
+       CHECK_CONS(init);
+       value = CAR(init);
+       init = CDR(init);
+       if (init != NIL) {
+           CHECK_CONS(init);
+           result = CAR(init);
+       }
+
+       value = EVAL(value);
+
+       if (times) {
+           CHECK_INDEX(value);
+           end = FIXNUM_VALUE(value);
+       }
+       else {
+           CHECK_LIST(value);
+           /* Protect iteration control from gc */
+           GC_PROTECT(value);
+       }
+    }
+
+    /* The variable is only bound inside the loop, so it is safe to optimize
+     * it out if there is no code to execute. But the result form may reference
+     * the bound variable. */
+    if (!CONSP(body)) {
+       if (times)
+           count = end;
+       else
+           value = NIL;
+    }
+
+    /* Initialize counter */
+    CHECK_CONSTANT(symbol);
+    if (times)
+       LispAddVar(symbol, FIXNUM(count));
+    else
+       LispAddVar(symbol, CONSP(value) ? CAR(value) : value);
+    ++lisp__data.env.head;
+
+    if (!CONSP(body) || (times && count >= end) || (!times && !CONSP(value)))
+       goto loop_done;
+
+    /* Execute iterations */
+    for (;;) {
+       for (object = body; CONSP(object); object = CDR(object))
+           (void)EVAL(CAR(object));
+
+       /* Update symbols and check exit condition */
+       if (times) {
+           ++count;
+           LispSetVar(symbol, FIXNUM(count));
+           if (count >= end)
+               break;
+       }
+       else {
+           value = CDR(value);
+           if (!CONSP(value)) {
+               LispSetVar(symbol, NIL);
+               break;
+           }
+           LispSetVar(symbol, CAR(value));
+       }
+    }
+
+loop_done:
+    result = EVAL(result);
+    lisp__data.env.head = lisp__data.env.length = head;
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+LispDoListTimes(LispBuiltin *builtin, int times)
+/*
+ dolist init &rest body
+ dotimes init &rest body
+ */
+{
+    int did_jump, *pdid_jump = &did_jump;
+    LispObj *result, **presult = &result;
+    LispBlock *block;
+
+    *presult = NIL;
+    *pdid_jump = 1;
+    block = LispBeginBlock(NIL, LispBlockTag);
+    if (setjmp(block->jmp) == 0) {
+       result = LispReallyDoListTimes(builtin, times);
+       did_jump = 0;
+    }
+    LispEndBlock(block);
+    if (did_jump)
+       result = lisp__data.block.block_ret;
+
+    return (result);
+}
+
+LispObj *
+LispLoadFile(LispObj *filename, int verbose, int print, int ifdoesnotexist)
+{
+    LispObj *stream, *cod, *obj, *result;
+    int ch;
+
+    LispObj *savepackage;
+    LispPackage *savepack;
+
+    if (verbose)
+       LispMessage("; Loading %s", THESTR(filename));
+
+    if (ifdoesnotexist) {
+       GC_ENTER();
+       result = CONS(filename, CONS(Kif_does_not_exist, CONS(Kerror, NIL)));
+       GC_PROTECT(result);
+       stream = APPLY(Oopen, result);
+       GC_LEAVE();
+    }
+    else
+       stream = APPLY1(Oopen, filename);
+
+    if (stream == NIL)
+       return (NIL);
+
+    result = NIL;
+    LispPushInput(stream);
+    ch = LispGet();
+    if (ch != '#')
+       LispUnget(ch);
+    else if ((ch = LispGet()) == '!') {
+       for (;;) {
+           ch = LispGet();
+           if (ch == '\n' || ch == EOF)
+               break;
+       }
+    }
+    else {
+       LispUnget(ch);
+       LispUnget('#');
+    }
+
+    /* Save package environment */
+    savepackage = PACKAGE;
+    savepack = lisp__data.pack;
+
+    cod = COD;
+
+    /*CONSTCOND*/
+    while (1) {
+       if ((obj = LispRead()) != NULL) {
+           result = EVAL(obj);
+           COD = cod;
+           if (print) {
+               int i;
+
+               if (RETURN_COUNT >= 0)
+                   LispPrint(result, NIL, 1);
+               for (i = 0; i < RETURN_COUNT; i++)
+                   LispPrint(RETURN(i), NIL, 1);
+           }
+       }
+       if (lisp__data.eof)
+           break;
+    }
+    LispPopInput(stream);
+
+    /* Restore package environment */
+    PACKAGE = savepackage;
+    lisp__data.pack = savepack;
+
+    APPLY1(Oclose, stream);
+
+    return (T);
+}
+
+void
+LispGetStringArgs(LispBuiltin *builtin,
+                 char **string1, char **string2,
+                 long *start1, long *end1, long *start2, long *end2)
+{
+    long length1, length2;
+    LispObj *ostring1, *ostring2, *ostart1, *oend1, *ostart2, *oend2;
+
+    oend2 = ARGUMENT(5);
+    ostart2 = ARGUMENT(4);
+    oend1 = ARGUMENT(3);
+    ostart1 = ARGUMENT(2);
+    ostring2 = ARGUMENT(1);
+    ostring1 = ARGUMENT(0);
+
+    CHECK_STRING(ostring1);
+    *string1 = THESTR(ostring1);
+    length1 = STRLEN(ostring1);
+
+    CHECK_STRING(ostring2);
+    *string2 = THESTR(ostring2);
+    length2 = STRLEN(ostring2);
+
+    if (ostart1 == UNSPEC)
+       *start1 = 0;
+    else {
+       CHECK_INDEX(ostart1);
+       *start1 = FIXNUM_VALUE(ostart1);
+    }
+    if (oend1 == UNSPEC)
+       *end1 = length1;
+    else {
+       CHECK_INDEX(oend1);
+       *end1 = FIXNUM_VALUE(oend1);
+    }
+
+    if (ostart2 == UNSPEC)
+       *start2 = 0;
+    else {
+       CHECK_INDEX(ostart2);
+       *start2 = FIXNUM_VALUE(ostart2);
+    }
+
+    if (oend2 == UNSPEC)
+       *end2 = length2;
+    else {
+       CHECK_INDEX(oend2);
+       *end2 = FIXNUM_VALUE(oend2);
+    }
+
+    if (*start1 > *end1)
+       LispDestroy("%s: :START1 %ld larger than :END1 %ld",
+                   STRFUN(builtin), *start1, *end1);
+    if (*start2 > *end2)
+       LispDestroy("%s: :START2 %ld larger than :END2 %ld",
+                   STRFUN(builtin), *start2, *end2);
+    if (*end1 > length1)
+       LispDestroy("%s: :END1 %ld larger than string length %ld",
+                   STRFUN(builtin), *end1, length1);
+    if (*end2 > length2)
+       LispDestroy("%s: :END2 %ld larger than string length %ld",
+                   STRFUN(builtin), *end2, length2);
+}
+
+LispObj *
+LispPathnameField(int field, int string)
+{
+    int offset = field;
+    LispObj *pathname, *result, *object;
+
+    pathname = ARGUMENT(0);
+
+    if (!PATHNAMEP(pathname))
+       pathname = APPLY1(Oparse_namestring, pathname);
+
+    result = pathname->data.pathname;
+    while (offset) {
+       result = CDR(result);
+       --offset;
+    }
+    object = result;
+    result = CAR(result);
+
+    if (string) {
+       if (!STRINGP(result)) {
+           if (result == NIL)
+               result = STRING("");
+           else if (field == PATH_DIRECTORY) {
+               char *name = THESTR(CAR(pathname->data.pathname)), *ptr;
+
+               ptr = strrchr(name, PATH_SEP);
+               if (ptr) {
+                   int length = ptr - name + 1;
+                   char data[PATH_MAX];
+
+                   if (length > PATH_MAX - 1)
+                       length = PATH_MAX - 1;
+                   strncpy(data, name, length);
+                   data[length] = '\0';
+                   result = STRING(data);
+               }
+               else
+                   result = STRING("");
+           }
+           else
+               result = Kunspecific;
+       }
+       else if (field == PATH_NAME) {
+           object = CAR(CDR(object));
+           if (STRINGP(object)) {
+               int length;
+               char name[PATH_MAX + 1];
+
+               strcpy(name, THESTR(result));
+               length = STRLEN(result);
+               if (length + 1 < sizeof(name)) {
+                   name[length++] = PATH_TYPESEP;
+                   name[length] = '\0';
+               }
+               if (STRLEN(object) + length < sizeof(name))
+                   strcpy(name + length, THESTR(object));
+               /* else LispDestroy ... */
+               result = STRING(name);
+           }
+       }
+    }
+
+    return (result);
+}
+
+LispObj *
+LispProbeFile(LispBuiltin *builtin, int probe)
+{
+    GC_ENTER();
+    LispObj *result;
+    char *name = NULL, resolved[PATH_MAX + 1];
+    struct stat st;
+
+    LispObj *pathname;
+
+    pathname = ARGUMENT(0);
+
+    if (!POINTERP(pathname))
+       goto bad_pathname;
+
+    if (XSTRINGP(pathname))
+       name = THESTR(pathname);
+    else if (XPATHNAMEP(pathname))
+       name = THESTR(CAR(pathname->data.pathname));
+    else if (STREAMP(pathname) && pathname->data.stream.type == LispStreamFile)
+       name = THESTR(CAR(pathname->data.stream.pathname->data.pathname));
+
+#ifndef __UNIXOS2__
+    if (realpath(name, &resolved[0]) == NULL ||
+       stat(resolved, &st)) {
+#else
+    if ((name == NULL) || stat(resolved, &st)) {
+#endif
+       if (probe)
+           return (NIL);
+       LispDestroy("%s: realpath(\"%s\"): %s",
+                   STRFUN(builtin), name, strerror(errno));
+    }
+
+    if (S_ISDIR(st.st_mode)) {
+       int length = strlen(resolved);
+
+       if (!length || resolved[length - 1] != PATH_SEP) {
+           resolved[length++] = PATH_SEP;
+           resolved[length] = '\0';
+       }
+    }
+
+    result = STRING(resolved);
+    GC_PROTECT(result);
+    result = APPLY1(Oparse_namestring, result);
+    GC_LEAVE();
+
+    return (result);
+
+bad_pathname:
+    LispDestroy("%s: bad pathname %s", STRFUN(builtin), STROBJ(pathname));
+    /*NOTREACHED*/
+    return (NIL);
+}
+
+LispObj *
+LispWriteString_(LispBuiltin *builtin, int newline)
+/*
+ write-line string &optional output-stream &key start end
+ write-string string &optional output-stream &key start end
+ */
+{
+    char *text;
+    long start, end, length;
+
+    LispObj *string, *output_stream, *ostart, *oend;
+
+    oend = ARGUMENT(3);
+    ostart = ARGUMENT(2);
+    output_stream = ARGUMENT(1);
+    string = ARGUMENT(0);
+
+    CHECK_STRING(string);
+    LispCheckSequenceStartEnd(builtin, string, ostart, oend,
+                             &start, &end, &length);
+    if (output_stream == UNSPEC)
+       output_stream = NIL;
+    text = THESTR(string);
+    if (end > start)
+       LispWriteStr(output_stream, text + start, end - start);
+    if (newline)
+       LispWriteChar(output_stream, '\n');
+
+    return (string);
+}
diff --git a/xedit/lisp/helper.h b/xedit/lisp/helper.h
new file mode 100644 (file)
index 0000000..797fa3b
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/helper.h,v 1.15tsi Exp $ */
+
+#ifndef Lisp_helper_h
+#define Lisp_helper_h
+
+#include "lisp/private.h"
+
+/*
+ * Prototypes
+ */
+void LispCheckSequenceStartEnd(LispBuiltin*, LispObj*,
+                              LispObj*, LispObj*, long*, long*, long*);
+long LispLength(LispObj*);
+LispObj *LispCharacterCoerce(LispBuiltin*, LispObj*);
+LispObj *LispStringCoerce(LispBuiltin*, LispObj*);
+LispObj *LispCoerce(LispBuiltin*, LispObj*, LispObj*);
+
+/*
+ do init test &rest body
+ do* init test &rest body
+ */
+LispObj *LispDo(LispBuiltin*, int);
+
+/*
+ dolist init &rest body
+ dotimes init &rest body
+ */
+LispObj *LispDoListTimes(LispBuiltin*, int);
+
+#define FEQ    1
+#define FEQL   2
+#define FEQUAL 3
+#define FEQUALP        4
+LispObj *LispObjectCompare(LispObj*, LispObj*, int);
+#define XEQ(x, y)      LispObjectCompare(x, y, FEQ)
+#define XEQL(x, y)     LispObjectCompare(x, y, FEQL)
+#define XEQUAL(x, y)   LispObjectCompare(x, y, FEQUAL)
+#define XEQUALP(x, y)  LispObjectCompare(x, y, FEQUALP)
+
+LispObj *LispLoadFile(LispObj*, int, int, int);
+
+/*
+ string= string1 string2 &key start1 end1 start2 end2
+ string< string1 string2 &key start1 end1 start2 end2
+ string> string1 string2 &key start1 end1 start2 end2
+ string<= string1 string2 &key start1 end1 start2 end2
+ string>= string1 string2 &key start1 end1 start2 end2
+ string/= string1 string2 &key start1 end1 start2 end2
+ string-equal string1 string2 &key start1 end1 start2 end2
+ string-lessp string1 string2 &key start1 end1 start2 end2
+ string-greaterp string1 string2 &key start1 end1 start2 end2
+ string-not-lessp string1 string2 &key start1 end1 start2 end2
+ string-not-greaterp string1 string2 &key start1 end1 start2 end2
+ string-not-equal string1 string2 &key start1 end1 start2 end2
+*/
+void LispGetStringArgs(LispBuiltin*,
+                       char**, /* string1 */
+                       char**, /* string2 */
+                       long*,  /* start1 */
+                       long*,  /* end1 */
+                       long*,  /* start2 */
+                       long*); /* end2 */
+
+/*
+ pathname-host pathname
+ pathname-device pathname
+ pathname-directory pathname
+ pathname-name pathname
+ pathname-type pathname
+ pathname-version pathname
+ */
+LispObj *LispPathnameField(int, int);
+
+/*
+ truename pathname
+ probe-file pathname
+ */
+LispObj *LispProbeFile(LispBuiltin*, int);
+
+/*
+ write-string string &optional output-stream &key start end
+ write-line string &optional output-stream &key start end
+ */
+LispObj *LispWriteString_(LispBuiltin*, int);
+
+#endif /* Lisp_helper_h */
diff --git a/xedit/lisp/internal.h b/xedit/lisp/internal.h
new file mode 100644 (file)
index 0000000..2ca4991
--- /dev/null
@@ -0,0 +1,800 @@
+/* $XdotOrg: xc/programs/xedit/lisp/internal.h,v 1.2 2004/04/23 19:54:44 eich Exp $ */
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/internal.h,v 1.50tsi Exp $ */
+
+#ifndef Lisp_internal_h
+#define Lisp_internal_h
+
+#include <stdio.h>
+#include "lisp/lisp.h"
+
+#include "mp.h"
+#include "re.h"
+
+#include "util.h"
+
+/*
+ * Defines
+ */
+typedef struct _LispMac LispMac;
+
+#define STREAM_READ            0x01
+#define STREAM_WRITE           0x02
+#define STREAM_BINARY          0x20
+
+#define RPLACA(cons, object)   (CAR(cons) = object)
+#define RPLACD(cons, object)   (CDR(cons) = object)
+
+#define        CAR(list)               ((list)->data.cons.car)
+#define        CAAR(list)              ((list)->data.cons.car->data.cons.car)
+#define        CADR(list)              ((list)->data.cons.cdr->data.cons.car)
+#define CDR(list)              ((list)->data.cons.cdr)
+#define CDAR(list)             ((list)->data.cons.car->data.cons.cdr)
+#define CDDR(list)             ((list)->data.cons.cdr->data.cons.cdr)
+#define CONS(car, cdr)         LispNewCons(car, cdr)
+#define EVAL(list)             LispEval(list)
+#define APPLY(fun, args)       LispFuncall(fun, args, 0)
+#define APPLY1(fun, arg)       LispApply1(fun, arg)
+#define APPLY2(fun, arg1, arg2)        LispApply2(fun, arg1, arg2)
+#define APPLY3(f, a1, a2, a3)  LispApply3(f, a1, a2, a3)
+#define EXECUTE(string)                LispExecute(string)
+#define SYMBOL(atom)           LispNewSymbol(atom)
+#define ATOM(string)           LispNewAtom(string, 1)
+#define UNINTERNED_ATOM(string)        LispNewAtom(string, 0)
+#define FUNCTION(symbol)       LispNewFunction(symbol)
+#define FUNCTION_QUOTE(symbol) LispNewFunctionQuote(symbol)
+
+       /* atom string is a static variable */
+#define ATOM2(string)          LispNewSymbol(LispGetPermAtom(string))
+
+       /* make a gc never released variable with a static string argument */
+#define STATIC_ATOM(string)    LispNewStaticAtom(string)
+
+#define STRING(str)            LispNewString(str, strlen(str), 0)
+#define LSTRING(str, size)     LispNewString(str, size, 0)
+
+       /* string must be from the LispXXX allocation functions,
+        * and LispMused not yet called on it */
+#define STRING2(str)           LispNewString(str, strlen(str), 1)
+#define LSTRING2(str, size)    LispNewString(str, size, 1)
+
+#define VECTOR(objects)                LispNewVector(objects)
+
+       /* STRINGSTREAM2 and LSTRINGSTREAM2 require that the
+        * string be allocated from the LispXXX allocation functions,
+        * and LispMused not yet called on it */
+#define STRINGSTREAM(str, flag)                        \
+       LispNewStringStream(str, flag, strlen(str), 0)
+#define STRINGSTREAM2(str, flag)               \
+       LispNewStringStream(str, flag, strlen(str), 1)
+#define LSTRINGSTREAM(str, flag, length)       \
+       LispNewStringStream(str, flag, length, 0)
+#define LSTRINGSTREAM2(str, flag, length)      \
+       LispNewStringStream(str, flag, length, 1)
+
+#define FILESTREAM(file, path, flag)   \
+       LispNewFileStream(file, path, flag)
+#define PIPESTREAM(file, path, flag)   \
+       LispNewPipeStream(file, path, flag)
+
+#define CHECKO(obj, typ)                                               \
+       ((obj)->type == LispOpaque_t &&                                 \
+        ((obj)->data.opaque.type == typ || (obj)->data.opaque.type == 0))
+#define PROTECT(key, list)     LispProtect(key, list)
+#define UPROTECT(key, list)    LispUProtect(key, list)
+
+/* create a new unique static atom string */
+#define GETATOMID(string)      LispGetAtomKey(string, 1)
+
+#define        GCDisable()             ++gcpro
+#define        GCEnable()              --gcpro
+
+
+/* pointer to something unique to all atoms with the same print representation */
+#define ATOMID(object)         (object)->data.atom->key
+
+
+
+#define NIL_BIT                        0x01
+#define FIXNUM_BIT             0x02
+#define FIXNUM_MASK            0x03
+#define SCHAR_BIT              0x04
+#define SCHAR_MASK             0x05
+#define BIT_COUNT              4
+#define BIT_MASK               0x0f
+#define POINTERP(object)                                               \
+    (((unsigned long)(object) & NIL_BIT) == 0)
+
+#define MOST_POSITIVE_FIXNUM   ((1L << (sizeof(long) * 8 - 5)) - 1)
+#define MOST_NEGATIVE_FIXNUM   (-1L << (sizeof(long) * 8 - 5))
+
+#define SCHAR(value)                                                   \
+    ((LispObj*)(((long)(value) << BIT_COUNT) | SCHAR_MASK))
+#define SCHAR_VALUE(object)    FIXNUM_VALUE(object)
+#define SCHARP(object)                                                 \
+    (((unsigned long)(object) & BIT_MASK) == SCHAR_MASK)
+#define CHECK_SCHAR(object)                                            \
+    if (!SCHARP(object))                                               \
+       LispDestroy("%s: %s is not a character",                        \
+                   STRFUN(builtin), STROBJ(object))
+
+#define XOBJECT_TYPE(object)   ((object)->type)
+#define OBJECT_TYPE(object)    (POINTERP(object) ?                     \
+                               XOBJECT_TYPE(object) :                  \
+                               (LispType)((long)(object) & BIT_MASK))
+
+
+#define NIL                    (LispObj*)0x00000001
+#define T                      (LispObj*)0x00000011
+#define DOT                    (LispObj*)0x00000021
+/* unmatched ')' */
+#define        EOLIST                  (LispObj*)0x00000031
+#define READLABEL_MASK         0x00000041
+/* unspecified argument */
+#define UNSPEC                 (LispObj*)0x00000051
+#define INVALIDP(object)                                               \
+    ((object) == NULL || (object) == EOLIST || (object) == DOT)
+
+
+/* cons */
+#define XCONSP(object)         ((object)->type == LispCons_t)
+#define CONSP(object)          (POINTERP(object) && XCONSP(object))
+#define CHECK_CONS(object)                                             \
+    if (!CONSP(object))                                                        \
+       LispDestroy("%s: %s is not of type cons",                       \
+                   STRFUN(builtin), STROBJ(object))
+#define LISTP(object)          (object == NIL || CONSP(object))
+#define CHECK_LIST(object)                                             \
+    if (!LISTP(object))                                                        \
+       LispDestroy("%s: %s is not a list",                             \
+                   STRFUN(builtin), STROBJ(object))
+
+/* fixnum */
+#define FIXNUM(value)                                                  \
+    ((LispObj*)(((long)(value) << BIT_COUNT) | FIXNUM_MASK))
+#define FIXNUM_VALUE(object)   ((long)(object) >> BIT_COUNT)
+#define FIXNUMP(object)                                                        \
+    (((unsigned long)(object) & BIT_MASK) == FIXNUM_MASK)
+#define CHECK_FIXNUM(object)                                           \
+    if (!FIXNUMP(object))                                              \
+       LispDestroy("%s: %s is not a fixnum",                           \
+                   STRFUN(builtin), STROBJ(object))
+#define INDEXP(object)                                                 \
+    (FIXNUMP(object) && FIXNUM_VALUE(object) >= 0)
+#define CHECK_INDEX(object)                                            \
+    if (!INDEXP(object))                                               \
+       LispDestroy("%s: %s is not a positive fixnum",                  \
+                   STRFUN(builtin), STROBJ(object))
+
+
+/* long int integer */
+#define XINTP(object)          ((object)->type == LispInteger_t)
+#define INTP(objet)            (POINTERP(object) && XINTP(object))
+#define INT_VALUE(object)      (object)->data.integer
+
+
+/* values that fit in a machine long int but not in a fixnum */
+#define LONGINTP(object)                                               \
+    (POINTERP(object) ? XINTP(object) : FIXNUMP(object))
+#define LONGINT_VALUE(object)                                          \
+    (POINTERP(object) ? INT_VALUE(object) : FIXNUM_VALUE(object))
+#define CHECK_LONGINT(object)                                          \
+    if (!LONGINTP(object))                                             \
+       LispDestroy("%s: %s is not an integer",                         \
+                   STRFUN(builtin), STROBJ(object))
+
+
+/* bignum */
+#define XBIGNUMP(object)       ((object)->type == LispBignum_t)
+#define BIGNUMP(object)                (POINTERP(object) && XBIGNUMP(object))
+#define BIGNUM(object)         LispNewBignum(object)
+
+
+/* generic integer */
+#define INTEGER(integer)       LispNewInteger(integer)
+#define INTEGERP(object)                                               \
+    (POINTERP(object) ? XINTP(object) || XBIGNUMP(object) : FIXNUMP(object))
+#define CHECK_INTEGER(object)                                          \
+    if (!INTEGERP(object))                                             \
+       LispDestroy("%s: %s is not an integer",                         \
+                   STRFUN(builtin), STROBJ(object))
+
+
+/* ratio */
+#define XRATIOP(object)                ((object)->type == LispRatio_t)
+#define RATIOP(object)         (POINTERP(object) && XRATIOP(object))
+#define RATIO(num, den)                LispNewRatio(num, den)
+
+
+/* bigratio */
+#define XBIGRATIOP(object)     ((object)->type == LispBigratio_t)
+#define BIGRATIOP(object)      (POINTERP(object) && XBIGRATIOP(object))
+#define BIGRATIO(ratio)                LispNewBigratio(ratio)
+
+
+/* generic rational */
+#define RATIONALP(object)                                              \
+    (POINTERP(object) ? XINTP(object) || XRATIOP(object) ||            \
+                       XBIGNUMP(object) || XBIGRATIOP(object) :        \
+                       FIXNUMP(object))
+
+
+/* double float */
+#define XDFLOATP(object)       ((object)->type == LispDFloat_t)
+#define DFLOATP(object)                (POINTERP(object) && XDFLOATP(object))
+#define DFLOAT_VALUE(object)   (object)->data.dfloat
+#define CHECK_DFLOAT(object)                                           \
+    if (!DFLOATP(object))                                              \
+       LispDestroy("%s: %s is not a float number",                     \
+                   STRFUN(builtin), STROBJ(object))
+#define DFLOAT(value)          LispNewDFloat(value)
+
+
+/* generic float - currently only double float supported */
+#define FLOATP(object)         DFLOATP(object)
+
+
+/* real number */
+#define REALP(object)                                                  \
+    (POINTERP(object) ? XINTP(object) || XDFLOATP(object) ||           \
+                       XRATIOP(object) || XBIGNUMP(object) ||          \
+                       XBIGRATIOP(object) :                            \
+                       FIXNUMP(object))
+#define CHECK_REAL(object)                                             \
+    if (!REALP(object))                                                        \
+       LispDestroy("%s: %s is not a real number",                      \
+                   STRFUN(builtin), STROBJ(object))
+
+
+/* complex */
+#define XCOMPLEXP(object)      ((object)->type == LispComplex_t)
+#define COMPLEXP(object)       (POINTERP(object) && XCOMPLEXP(object))
+#define COMPLEX(real, imag)    LispNewComplex(real, imag)
+
+
+/* generic number */
+#define NUMBERP(object)                                                        \
+    (POINTERP(object) ? XINTP(object) || XDFLOATP(object) ||           \
+                       XRATIOP(object) || XBIGNUMP(object) ||          \
+                       XBIGRATIOP(object) || XCOMPLEXP(object) :       \
+                       FIXNUMP(object))
+#define CHECK_NUMBER(object)                                           \
+    if (!NUMBERP(object))                                              \
+       LispDestroy("%s: %s is not a number",                           \
+                   STRFUN(builtin), STROBJ(object))
+
+
+/* symbol */
+#define XSYMBOLP(object)       ((object)->type == LispAtom_t)
+#define SYMBOLP(object)                (POINTERP(object) && XSYMBOLP(object))
+#define CHECK_SYMBOL(object)                                           \
+    if (!SYMBOLP(object))                                              \
+       LispDestroy("%s: %s is not a symbol",                           \
+                   STRFUN(builtin), STROBJ(object))
+
+
+/* keyword */
+#define XKEYWORDP(object)                                              \
+    ((object)->data.atom->package == lisp__data.keyword)
+#define KEYWORDP(object)                                               \
+    (POINTERP(object) && XSYMBOLP(object) && XKEYWORDP(object))
+#define KEYWORD(string)                LispNewKeyword(string)
+#define CHECK_KEYWORD(object)                                          \
+    if (!KEYWORDP(object))                                             \
+       LispDestroy("%s: %s is not a keyword",                          \
+                   STRFUN(builtin), STROBJ(object))
+#define CHECK_CONSTANT(object)                                         \
+    if ((object)->data.atom->constant)                                 \
+       LispDestroy("%s: %s is a constant",                             \
+                   STRFUN(builtin), STROBJ(object))
+
+#define SETVALUE(atom, object) ((atom)->property->value = object)
+
+
+/* function */
+#define XFUNCTIONP(object)     ((object)->type == LispFunction_t)
+#define FUNCTIONP(object)      (POINTERP(object) && XFUNCTIONP(object))
+
+
+/* lambda */
+#define XLAMBDAP(object)       ((object)->type == LispLambda_t)
+#define LAMBDAP(object)                (POINTERP(object) && XLAMBDAP(object))
+
+
+/* string - currently only simple 8 bit characters */
+#define XSTRINGP(object)       ((object)->type == LispString_t)
+#define STRINGP(object)                (POINTERP(object) && XSTRINGP(object))
+#define THESTR(object)         (object)->data.string.string
+#define STRLEN(object)         (object)->data.string.length
+#define CHECK_STRING(object)                                           \
+    if (!STRINGP(object))                                              \
+       LispDestroy("%s: %s is not a string",                           \
+                   STRFUN(builtin), STROBJ(object))
+#define CHECK_STRING_WRITABLE(object)                                  \
+    if (!object->data.string.writable)                                 \
+       LispDestroy("%s: %s is readonly",                               \
+                   STRFUN(builtin), STROBJ(object))
+
+
+/* array/vector */
+#define XARRAYP(object)                ((object)->type == LispArray_t)
+#define ARRAYP(object)         (POINTERP(object) && XARRAYP(object))
+#define CHECK_ARRAY(object)                                            \
+    if (!ARRAYP(object))                                               \
+       LispDestroy("%s: %s is not an array",                           \
+                   STRFUN(builtin), STROBJ(object))
+
+
+/* quote */
+#define XQUOTEP(object)                ((object)->type == LispQuote_t)
+#define QUOTEP(object)         (POINTERP(object) && XQUOTEP(object))
+#define QUOTE(object)          LispNewQuote(object)
+
+#define XBACKQUOTEP(object)    ((object)->type == LispBackquote_t)
+#define BACKQUOTEP(object)     (POINTERP(object) && XBACKQUOTEP(object))
+#define BACKQUOTE(object)      LispNewBackquote(object)
+
+#define XCOMMAP(object)                ((object)->type == LispComma_t)
+#define COMMAP(object)         (POINTERP(object) && XCOMMAP(object))
+#define COMMA(object, at)      LispNewComma(object, at)
+
+
+/* package */
+#define XPACKAGEP(object)      ((object)->type == LispPackage_t)
+#define PACKAGEP(object)       (POINTERP(object) && XPACKAGEP(object))
+
+
+/* pathname */
+#define XPATHNAMEP(object)     ((object)->type == LispPathname_t)
+#define PATHNAMEP(object)      (POINTERP(object) && XPATHNAMEP(object))
+#define PATHNAME(object)       LispNewPathname(object)
+#define CHECK_PATHNAME(object)                                         \
+    if (!PATHNAMEP(object))                                            \
+       LispDestroy("%s: %s is not a pathname",                         \
+                   STRFUN(builtin), STROBJ(object))
+
+
+/* stream */
+#define XSTREAMP(object)       ((object)->type == LispStream_t)
+#define STREAMP(object)                (POINTERP(object) && XSTREAMP(object))
+#define CHECK_STREAM(object)                                           \
+    if (!STREAMP(object))                                              \
+       LispDestroy("%s: %s is not a stream",                           \
+                   STRFUN(builtin), STROBJ(object))
+
+
+/* hastable */
+#define XHASHTABLEP(object)    ((object)->type == LispHashTable_t)
+#define HASHTABLEP(object)     (POINTERP(object) && XHASHTABLEP(object))
+#define CHECK_HASHTABLE(object)                                                \
+    if (!HASHTABLEP(object))                                           \
+       LispDestroy("%s: %s is not a hash-table",                       \
+                   STRFUN(builtin), STROBJ(object))
+
+
+/* regex */
+#define XREGEXP(object)                ((object)->type == LispRegex_t)
+#define REGEXP(object)         (POINTERP(object) && XREGEXP(object))
+#define CHECK_REGEX(object)                                            \
+    if (!REGEXP(object))                                               \
+       LispDestroy("%s: %s is not a regexp",                           \
+                   STRFUN(builtin), STROBJ(object))
+
+
+/* bytecode */
+#define XBYTECODEP(object)     ((object)->type == LispBytecode_t)
+#define BYTECODEP(object)      (POINTERP(object) && XBYTECODEP(object))
+
+
+/* opaque */
+#define XOPAQUEP(object)       ((object)->type == LispOpaque_t)
+#define OPAQUEP(object)                (POINTERP(object) && XOPAQUEP(object))
+#define OPAQUE(data, type)     LispNewOpaque((void*)((long)data), type)
+
+
+
+#define SSTREAMP(str)          ((str)->data.stream.source.string)
+
+#define FSTREAMP(str)          ((str)->data.stream.source.file)
+
+#define PSTREAMP(str)          ((str)->data.stream.source.program)
+#define PIDPSTREAMP(str)       ((str)->data.stream.source.program->pid)
+#define IPSTREAMP(str)         ((str)->data.stream.source.program->input)
+#define OPSTREAMP(str)         ((str)->data.stream.source.program->output)
+#define EPSTREAMP(str)         \
+       FSTREAMP((str)->data.stream.source.program->errorp)
+
+#define LispFileno(file)       ((file)->descriptor)
+
+#define STRFUN(builtin)                ATOMID(builtin->symbol)->value
+#define STROBJ(obj)            LispStrObj(obj)
+
+/* fetch builtin function/macro argument value
+ */
+#define ARGUMENT(index)                                                        \
+       lisp__data.stack.values[lisp__data.stack.base + (index)]
+
+#define RETURN(index)  lisp__data.returns.values[(index)]
+#define RETURN_COUNT   lisp__data.returns.count
+#define RETURN_CHECK(value)                                            \
+    value < MULTIPLE_VALUES_LIMIT ?                                    \
+       value : MULTIPLE_VALUES_LIMIT
+
+#define GC_ENTER()             int gc__protect = lisp__data.protect.length
+
+#define GC_PROTECT(object)                                             \
+    if (lisp__data.protect.length >= lisp__data.protect.space)         \
+       LispMoreProtects();                                             \
+    lisp__data.protect.objects[lisp__data.protect.length++] = object
+
+#define GC_LEAVE()             lisp__data.protect.length = gc__protect
+
+
+#define ERROR_CHECK_SPECIAL_FORM(atom)                                 \
+    if ((atom)->property->fun.builtin->compile)                                \
+       LispDestroy("%s: the special form %s cannot be redefined",      \
+                   STRFUN(builtin), (atom)->key->value)
+
+
+
+#define CONSTANTP(object)                                              \
+    (!POINTERP(object) ||                                              \
+     XOBJECT_TYPE(object) < LispAtom_t ||                              \
+     (XSYMBOLP(object) && XKEYWORDP(object)))
+
+/* slightly faster test, since keywords are very uncommon as eval arguments */
+#define NCONSTANTP(object)                                             \
+    (OBJECT_TYPE(object) >= LispAtom_t)
+
+
+/*
+ * Types
+ */
+typedef struct _LispObj LispObj;
+typedef struct _LispAtom LispAtom;
+typedef struct _LispBuiltin LispBuiltin;
+typedef struct _LispModuleData LispModuleData;
+typedef struct _LispFile LispFile;
+typedef struct _LispString LispString;
+typedef struct _LispPackage LispPackage;
+typedef struct _LispBytecode LispBytecode;
+typedef struct _LispHashTable LispHashTable;
+
+/* Bytecode compiler data */
+typedef struct _LispCom LispCom;
+
+typedef hash_key *Atom_id;
+
+typedef enum _LispType {
+    /* objects encoded in the LispObj pointer */
+    LispNil_t = 1,
+    LispFixnum_t = 3,
+    LispSChar_t = 5,
+
+    /* objects that have a structure */
+    LispInteger_t = 16,
+    LispDFloat_t,
+    LispString_t,
+    LispRatio_t,
+    LispOpaque_t,
+
+    /* simple access for marking */
+    LispBignum_t,
+    LispBigratio_t,
+
+    LispAtom_t,
+    LispFunction_t,
+    LispFunctionQuote_t,
+
+    LispLambda_t,
+
+    LispComplex_t,
+    LispCons_t,
+    LispQuote_t,
+    LispArray_t,
+    LispStruct_t,
+    LispStream_t,
+    LispBackquote_t,
+    LispComma_t,
+    LispPathname_t,
+    LispPackage_t,
+    LispRegex_t,
+    LispBytecode_t,
+    LispHashTable_t
+} LispType;
+
+typedef enum _LispFunType {
+    LispLambda,
+    LispFunction,
+    LispMacro,
+    LispSetf
+} LispFunType;
+
+typedef enum _LispStreamType {
+    LispStreamString,
+    LispStreamFile,
+    LispStreamStandard,
+    LispStreamPipe
+} LispStreamType;
+
+typedef struct {
+    int pid;                   /* process id of program */
+    LispFile *input;           /* if READABLE: stdout of program */
+    LispFile *output;          /* if WRITABLE: stdin of program */
+    LispObj *errorp;           /* ALWAYS (ONLY) READABLE: stderr of program */
+} LispPipe;
+
+/* silly IBM compiler */
+#ifdef AIXV5 /* probably want !gcc too */
+#define LispType int
+#define LispFunType int
+#define LispStreamType int
+#endif
+
+struct _LispObj {
+    LispType type : 6;
+    unsigned int mark : 1;     /* gc protected */
+    unsigned int prot: 1;      /* protection for constant/unamed variables */
+    LispFunType funtype : 4;   /* this is subject to change in the future */
+    union {
+       LispAtom *atom;
+       struct {
+           char *string;
+           long length;
+           unsigned int writable : 1;
+       } string;
+       long integer;
+       double dfloat;
+       LispObj *quote;
+       LispObj *pathname;      /* don't use quote generic name,
+                                * to avoid confusing code */
+       struct {
+           long numerator;
+           long denominator;
+       } ratio;
+       union {
+           mpi *integer;
+           mpr *ratio;
+       } mp;
+       struct {
+           LispObj *real;
+           LispObj *imag;
+       } complex;
+       struct {
+           LispObj *car;
+           LispObj *cdr;
+       } cons;
+       struct {
+           LispObj *name;
+           LispObj *code;
+           LispObj *data;              /* extra data to protect */
+       } lambda;
+       struct {
+           LispObj *list;              /* stored as a linear list */
+           LispObj *dim;               /* dimensions of array */
+           unsigned int rank : 8;      /* i.e. array-rank-limit => 256 */
+           unsigned int type : 7;      /* converted to LispType, if not
+                                        * Lisp_Nil_t only accepts given
+                                        * type in array fields */
+           unsigned int zero : 1;      /* at least one of the dimensions
+                                        * is zero */
+       } array;
+       struct {
+           LispObj *fields;    /* structure fields */
+           LispObj *def;       /* structure definition */
+       } struc;
+       struct {
+           union {
+               LispFile *file;
+               LispPipe *program;
+               LispString *string;
+           } source;
+           LispObj *pathname;
+           LispStreamType type : 6;
+           unsigned int readable : 1;
+           unsigned int writable : 1;
+       } stream;
+       struct {
+           void *data;
+           int type;
+       } opaque;
+       struct {
+           LispObj *eval;
+           int atlist;
+       } comma;
+       struct {
+           LispObj *name;
+           LispObj *nicknames;
+           LispPackage *package;
+       } package;
+       struct {
+           re_cod *regex;
+           LispObj *pattern;           /* regex string */
+           int options;                /* regex compile flags */
+       } regex;
+       struct {
+           LispBytecode *bytecode;
+           LispObj *code;              /* object used to generate bytecode */
+           LispObj *name;              /* name of function, or NIL */
+       } bytecode;
+       struct {
+           LispHashTable *table;
+           LispObj *test;
+       } hash;
+    } data;
+};
+#ifdef AIXV5
+#undef LispType
+#undef LispFunType
+#undef LispStreamType
+#endif
+
+typedef        LispObj *(*LispFunPtr)(LispBuiltin*);
+typedef void (*LispComPtr)(LispCom*, LispBuiltin*);
+
+struct _LispBuiltin {
+    /* these fields must be set */
+    LispFunType type;
+    LispFunPtr function;
+    char *declaration;
+
+    /* this field is optional, set if the function returns multiple values */
+    int multiple_values;
+
+    /* this field is also optional, set if the function should not be exported */
+    int internal;
+
+    /* this optional field points to a function of the bytecode compiler */
+    LispComPtr compile;
+
+    /* this field is set at runtime */
+    LispObj *symbol;
+};
+
+typedef int (*LispLoadModule)(void);
+typedef int (*LispUnloadModule)(void);
+
+#define LISP_MODULE_VERSION            1
+struct _LispModuleData {
+    int version;
+    LispLoadModule load;
+    LispUnloadModule unload;
+};
+
+/*
+ * Prototypes
+ */
+LispObj *LispEval(LispObj*);
+LispObj *LispFuncall(LispObj*, LispObj*, int);
+LispObj *LispApply1(LispObj*, LispObj*);
+LispObj *LispApply2(LispObj*, LispObj*, LispObj*);
+LispObj *LispApply3(LispObj*, LispObj*, LispObj*, LispObj*);
+
+LispObj *LispNew(LispObj*, LispObj*);
+LispObj *LispNewSymbol(LispAtom*);
+LispObj *LispNewAtom(char*, int);
+LispObj *LispNewFunction(LispObj*);
+LispObj *LispNewFunctionQuote(LispObj*);
+LispObj *LispNewStaticAtom(char*);
+LispObj *LispNewDFloat(double);
+LispObj *LispNewString(char*, long, int);
+LispObj *LispNewInteger(long);
+LispObj *LispNewRatio(long, long);
+LispObj *LispNewVector(LispObj*);
+LispObj *LispNewQuote(LispObj*);
+LispObj *LispNewBackquote(LispObj*);
+LispObj *LispNewComma(LispObj*, int);
+LispObj *LispNewCons(LispObj*, LispObj*);
+LispObj *LispNewLambda(LispObj*, LispObj*, LispObj*, LispFunType);
+LispObj *LispNewStruct(LispObj*, LispObj*);
+LispObj *LispNewComplex(LispObj*, LispObj*);
+LispObj *LispNewOpaque(void*, int);
+LispObj *LispNewKeyword(char*);
+LispObj *LispNewPathname(LispObj*);
+LispObj *LispNewStringStream(char*, int, long, int);
+LispObj *LispNewFileStream(LispFile*, LispObj*, int);
+LispObj *LispNewPipeStream(LispPipe*, LispObj*, int);
+LispObj *LispNewBignum(mpi*);
+LispObj *LispNewBigratio(mpr*);
+
+LispAtom *LispGetAtom(char*);
+
+/* This function does not allocate a copy of it's argument, but the argument
+ * itself. The argument string should never change. */
+LispAtom *LispGetPermAtom(char*);
+
+void *LispMalloc(size_t);
+void *LispCalloc(size_t, size_t);
+void *LispRealloc(void*, size_t);
+char *LispStrdup(char*);
+void LispFree(void*);
+/* LispMused means memory is now safe from LispDestroy, and should not be
+ * freed in case of an error */
+void LispMused(void*);
+
+void LispGC(LispObj*, LispObj*);
+
+char *LispStrObj(LispObj*);
+
+#ifdef __GNUC__
+#define PRINTF_FORMAT  __attribute__ ((format (printf, 1, 2)))
+#else
+#define PRINTF_FORMAT  /**/
+#endif
+void LispDestroy(char *fmt, ...) PRINTF_FORMAT;
+       /* continuable error */
+void LispContinuable(char *fmt, ...) PRINTF_FORMAT;
+void LispMessage(char *fmt, ...) PRINTF_FORMAT;
+void LispWarning(char *fmt, ...) PRINTF_FORMAT;
+#undef PRINTF_FORMAT
+
+LispObj *LispSetVariable(LispObj*, LispObj*, char*, int);
+
+int LispRegisterOpaqueType(char*);
+
+int LispPrintString(LispObj*, char*);
+
+void LispProtect(LispObj*, LispObj*);
+void LispUProtect(LispObj*, LispObj*);
+
+/* this function should be called when a module is loaded, and is called
+ * when loading the interpreter */
+void LispAddBuiltinFunction(LispBuiltin*);
+
+/*
+ * Initialization
+ */
+extern LispObj *UNBOUND;
+extern int gcpro;
+
+extern LispObj *Okey, *Orest, *Ooptional, *Oaux, *Olambda;
+extern Atom_id Snil, St, Skey, Srest, Soptional, Saux;
+extern Atom_id Sand, Sor, Snot;
+extern Atom_id Satom, Ssymbol, Sinteger, Scharacter, Sstring, Slist,
+              Scons, Svector, Sarray, Sstruct, Skeyword, Sfunction, Spathname,
+              Srational, Sfloat, Scomplex, Sopaque, Sdefault;
+
+extern LispObj *Ocomplex, *Oformat, *Kunspecific;
+
+extern LispObj *Omake_array, *Kinitial_contents, *Osetf;
+extern Atom_id Svariable, Sstructure, Stype, Ssetf;
+
+extern Atom_id Smake_struct, Sstruct_access, Sstruct_store, Sstruct_type;
+extern LispObj *Omake_struct, *Ostruct_access, *Ostruct_store, *Ostruct_type;
+
+extern LispObj *Oparse_namestring, *Kerror, *Kabsolute, *Krelative, *Oopen,
+              *Oclose, *Kif_does_not_exist;
+
+extern LispObj *Oequal_;
+
+extern LispFile *Stdout, *Stdin, *Stderr;
+
+#endif /* Lisp_internal_h */
diff --git a/xedit/lisp/io.c b/xedit/lisp/io.c
new file mode 100644 (file)
index 0000000..3a33855
--- /dev/null
@@ -0,0 +1,717 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/io.c,v 1.16tsi Exp $ */
+
+#include "lisp/io.h"
+#include <errno.h>
+#include <fcntl.h>
+#include <stdarg.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+/* Match the FILE_XXX flags */
+#define READ_BIT       0x01
+#define WRITE_BIT      0x02
+#define APPEND_BIT     0x04
+#define BUFFERED_BIT   0x08
+#define UNBUFFERED_BIT 0x10
+#define BINARY_BIT     0x20
+
+/*
+ * Prototypes
+ */
+static int calculate_line(void*, int);
+static int calculate_column(void*, int, int);
+
+/*
+ * Initialization
+ */
+extern int pagesize;
+
+/*
+ * Implementation
+ */
+int
+LispGet(void)
+{
+    int ch = EOF;
+    LispUngetInfo *unget = lisp__data.unget[lisp__data.iunget];
+
+    if (unget->offset)
+       ch = ((unsigned char*)unget->buffer)[--unget->offset];
+    else if (SINPUT->data.stream.readable) {
+       LispFile *file = NULL;
+
+       switch (SINPUT->data.stream.type) {
+           case LispStreamStandard:
+           case LispStreamFile:
+               file = FSTREAMP(SINPUT);
+               break;
+           case LispStreamPipe:
+               file = IPSTREAMP(SINPUT);
+               break;
+           case LispStreamString:
+               ch = LispSgetc(SSTREAMP(SINPUT));
+               break;
+           default:
+               ch = EOF;
+               break;
+       }
+       if (file != NULL) {
+           if (file->nonblock) {
+               if (fcntl(file->descriptor, F_SETFL, 0) < 0)
+                   LispDestroy("fcntl: %s", strerror(errno));
+               file->nonblock = 0;
+           }
+           ch = LispFgetc(file);
+       }
+    }
+    else
+       LispDestroy("cannot read from *STANDARD-INPUT*");
+
+    if (ch == EOF)
+       lisp__data.eof = 1;
+
+    return (ch);
+}
+
+int
+LispUnget(int ch)
+{
+    LispUngetInfo *unget = lisp__data.unget[lisp__data.iunget];
+
+    if (unget->offset == sizeof(unget->buffer)) {
+       LispWarning("character %c lost at LispUnget()", unget->buffer[0]);
+       memmove(unget->buffer, unget->buffer + 1, unget->offset - 1);
+       unget->buffer[unget->offset - 1] = ch;
+    }
+    else
+       unget->buffer[unget->offset++] = ch;
+
+    return (ch);
+}
+
+void
+LispPushInput(LispObj *stream)
+{
+    if (!STREAMP(stream) || !stream->data.stream.readable)
+       LispDestroy("bad stream at PUSH-INPUT");
+    lisp__data.input_list = CONS(stream, lisp__data.input_list);
+    SINPUT = stream;
+    if (lisp__data.iunget + 1 == lisp__data.nunget) {
+       LispUngetInfo **info =
+           realloc(lisp__data.unget,
+                   sizeof(LispUngetInfo) * (lisp__data.nunget + 1));
+
+       if (!info ||
+           (info[lisp__data.nunget] =
+            calloc(1, sizeof(LispUngetInfo))) == NULL)
+           LispDestroy("out of memory");
+       lisp__data.unget = info;
+       ++lisp__data.nunget;
+    }
+    ++lisp__data.iunget;
+    memset(lisp__data.unget[lisp__data.iunget], '\0', sizeof(LispUngetInfo));
+    lisp__data.eof = 0;
+}
+
+void
+LispPopInput(LispObj *stream)
+{
+    if (!CONSP(lisp__data.input_list) || stream != CAR(lisp__data.input_list))
+       LispDestroy("bad stream at POP-INPUT");
+    lisp__data.input_list = CDR(lisp__data.input_list);
+    SINPUT = CONSP(lisp__data.input_list) ?
+    CAR(lisp__data.input_list) : lisp__data.input_list;
+    --lisp__data.iunget;
+    lisp__data.eof = 0;
+}
+
+/*
+ * Low level functions
+ */
+static int
+calculate_line(void *data, int size)
+{
+    int line = 0;
+    char *str, *ptr;
+
+    for (str = (char*)data, ptr = (char*)data + size; str < ptr; str++)
+       if (*ptr == '\n')
+           ++line;
+
+    return (line);
+}
+
+static int
+calculate_column(void *data, int size, int column)
+{
+    char *str, *ptr;
+
+    /* search for newline in data */
+    for (str = (char*)data, ptr = (char*)data + size - 1; ptr >= str; ptr--)
+       if (*ptr == '\n')
+           break;
+
+    /* newline found */
+    if (ptr >= str)
+       return (size - (ptr - str) - 1);
+
+    /* newline not found */
+    return (column + size);
+}
+
+LispFile *
+LispFdopen(int descriptor, int mode)
+{
+    LispFile *file = calloc(1, sizeof(LispFile));
+
+    if (file) {
+       struct stat st;
+
+       file->descriptor = descriptor;
+       file->readable = (mode & READ_BIT) != 0;
+       file->writable = (mode & WRITE_BIT) != 0;
+
+       if (fstat(descriptor, &st) == 0)
+           file->regular = S_ISREG(st.st_mode);
+       else
+           file->regular = 0;
+
+       file->buffered = (mode & BUFFERED_BIT) != 0;
+       if ((mode & UNBUFFERED_BIT) == 0)
+           file->buffered = file->regular;
+
+       if (file->buffered) {
+           file->buffer = malloc(pagesize);
+           if (file->buffer == NULL)
+               file->buffered = 0;
+       }
+       file->line = 1;
+       file->binary = (mode & BINARY_BIT) != 0;
+       file->io_write = write;
+    }
+
+    return (file);
+}
+
+LispFile *
+LispFopen(char *path, int mode)
+{
+    LispFile *file;
+    int descriptor;
+    int flags = O_NOCTTY;
+
+    /* check read/write attributes */
+    if ((mode & (READ_BIT | WRITE_BIT)) == (READ_BIT | WRITE_BIT))
+       flags |= O_RDWR;
+    else if (mode & READ_BIT)
+       flags |= O_RDONLY;
+    else if (mode & WRITE_BIT)
+       flags |= O_WRONLY;
+
+    /* create if does not exist */
+    if (mode & WRITE_BIT) {
+       flags |= O_CREAT;
+
+       /* append if exists? */
+       if (mode & APPEND_BIT)
+           flags |= O_APPEND;
+       else
+           flags |= O_TRUNC;
+    }
+
+    /* open file */
+    descriptor = open(path, flags, 0666);
+    if (descriptor < 0)
+       return (NULL);
+
+    /* initialize LispFile structure */
+    file = LispFdopen(descriptor, mode);
+    if (file == NULL)
+       close(descriptor);
+
+    return (file);
+}
+
+void
+LispFclose(LispFile *file)
+{
+    /* flush any pending output */
+    LispFflush(file);
+    /* cleanup */
+    close(file->descriptor);
+    if (file->buffer)
+       free(file->buffer);
+    free(file);
+}
+
+io_write_fn
+LispSetFileWrite(LispFile *file, io_write_fn new_write)
+{
+    io_write_fn old_write = file->io_write;
+
+    file->io_write = new_write;
+
+    return (old_write);
+}
+
+int
+LispFflush(LispFile *file)
+{
+    if (file->writable && file->length) {
+       int length = (*file->io_write)(file->descriptor,
+                                      file->buffer, file->length);
+
+       if (length > 0) {
+           if (file->length > length)
+               memmove(file->buffer, file->buffer + length,
+                       file->length - length);
+           file->length -= length;
+       }
+       return (length);
+    }
+
+    return (0);
+}
+
+int
+LispFungetc(LispFile *file, int ch)
+{
+    if (file->readable) {
+       file->available = 1;
+       file->unget = ch;
+       /* this should never happen */
+       if (ch == '\n' && !file->binary)
+           --file->line;
+    }
+
+    return (ch);
+}
+
+int
+LispFgetc(LispFile *file)
+{
+    int ch;
+
+    if (file->readable) {
+       unsigned char c;
+
+       if (file->available) {
+           ch = file->unget;
+           file->available = 0;
+       }
+       else if (file->buffered) {
+           if (file->writable) {
+               LispFflush(file);
+               if (read(file->descriptor, &c, 1) == 1)
+                   ch = c;
+               else
+                   ch = EOF;
+           }
+           else {
+               if (file->offset < file->length)
+                   ch = ((unsigned char*)file->buffer)[file->offset++];
+               else {
+                   int length = read(file->descriptor,
+                                     file->buffer, pagesize);
+
+                   if (length >= 0)
+                       file->length = length;
+                   else
+                       file->length = 0;
+                   file->offset = 0;
+                   if (file->length)
+                       ch = ((unsigned char*)file->buffer)[file->offset++];
+                   else
+                       ch = EOF;
+               }
+           }
+       }
+       else if (read(file->descriptor, &c, 1) == 1)
+           ch = c;
+       else
+           ch = EOF;
+    }
+    else
+       ch = EOF;
+
+    if (ch == '\n' && !file->binary)
+       ++file->line;
+
+    return (ch);
+}
+
+int
+LispFputc(LispFile *file, int ch)
+{
+    if (file->writable) {
+       unsigned char c = ch;
+
+       if (file->buffered) {
+           if (file->length + 1 >= pagesize)
+               LispFflush(file);
+           file->buffer[file->length++] = c;
+       }
+       else if ((*file->io_write)(file->descriptor, &c, 1) != 1)
+           ch = EOF;
+
+       if (!file->binary) {
+           /* update column number */
+           if (ch == '\n')
+               file->column = 0;
+           else
+               ++file->column;
+       }
+    }
+
+    return (ch);
+}
+
+int
+LispSgetc(LispString *string)
+{
+    int ch;
+
+    if (string->input >= string->length)
+       return (EOF);                   /* EOF reading from string */
+
+    ch = ((unsigned char*)string->string)[string->input++];
+    if (ch == '\n' && !string->binary)
+       ++string->line;
+
+    return (ch);
+}
+
+int
+LispSputc(LispString *string, int ch)
+{
+    if (string->output + 1 >= string->space) {
+       if (string->fixed)
+           return (EOF);
+       else {
+           char *tmp = realloc(string->string, string->space + pagesize);
+
+           if (tmp == NULL)
+               return (EOF);
+           string->string = tmp;
+           string->space += pagesize;
+       }
+    }
+
+    string->string[string->output++] = ch;
+    if (string->length < string->output)
+       string->length = string->output;
+
+    /* update column number */
+    if (!string->binary) {
+       if (ch == '\n')
+           string->column = 0;
+       else
+           ++string->column;
+    }
+
+    return (ch);
+}
+
+char *
+LispFgets(LispFile *file, char *string, int size)
+{
+    int ch, offset = 0;
+
+    if (size < 1)
+       return (string);
+
+    for (;;) {
+       if (offset + 1 >= size)
+           break;
+       if ((ch = LispFgetc(file)) == EOF)
+           break;
+       string[offset++] = ch;
+       /* line number is calculated in LispFgetc */
+       if (ch == '\n')
+           break;
+    }
+    string[offset] = '\0';
+
+    return (offset ? string : NULL);
+}
+
+int
+LispFputs(LispFile *file, char *buffer)
+{
+    return (LispFwrite(file, buffer, strlen(buffer)));
+}
+
+int
+LispSputs(LispString *string, char *buffer)
+{
+    return (LispSwrite(string, buffer, strlen(buffer)));
+}
+
+int
+LispFread(LispFile *file, void *data, int size)
+{
+    int bytes, length;
+    char *buffer;
+
+    if (!file->readable)
+       return (EOF);
+
+    if (size <= 0)
+       return (size);
+
+    length = 0;
+    buffer = (char*)data;
+
+    /* check if there is an unget character */
+    if (file->available) {
+       *buffer++ = file->unget;
+       file->available = 0;
+       if (--size == 0) {
+           if (file->unget == '\n' && !file->binary)
+               ++file->line;
+
+           return (1);
+       }
+
+       length = 1;
+    }
+
+    if (file->buffered) {
+       void *base_data = (char*)data - length;
+
+       if (file->writable) {
+           LispFflush(file);
+           bytes = read(file->descriptor, buffer, size);
+           if (bytes < 0)
+               bytes = 0;
+           if (!file->binary)
+               file->line += calculate_line(base_data, length + bytes);
+
+           return (length + bytes);
+       }
+
+       /* read anything that is in the buffer */
+       if (file->offset < file->length) {
+           bytes = file->length - file->offset;
+           if (bytes > size)
+               bytes = size;
+           memcpy(buffer, file->buffer + file->offset, bytes);
+           buffer += bytes;
+           file->offset += bytes;
+           size -= bytes;
+       }
+
+       /* if there is still something to read */
+       if (size) {
+           bytes = read(file->descriptor, buffer, size);
+           if (bytes < 0)
+               bytes = 0;
+
+           length += bytes;
+       }
+
+       if (!file->binary)
+           file->line += calculate_line(base_data, length);
+
+       return (length);
+    }
+
+    bytes = read(file->descriptor, buffer, size);
+    if (bytes < 0)
+       bytes = 0;
+    if (!file->binary)
+       file->line += calculate_line(buffer - length, length + bytes);
+
+    return (length + bytes);
+}
+
+int
+LispFwrite(LispFile *file, void *data, int size)
+{
+    if (!file->writable || size < 0)
+       return (EOF);
+
+    if (!file->binary)
+       file->column = calculate_column(data, size, file->column);
+
+    if (file->buffered) {
+       int length, bytes;
+       char *buffer = (char*)data;
+
+       length = 0;
+       if (size + file->length > pagesize) {
+           /* fill remaining space in buffer and flush */
+           bytes = pagesize - file->length;
+           memcpy(file->buffer + file->length, buffer, bytes);
+           file->length += bytes;
+           LispFflush(file);
+
+           /* check if all data was written */
+           if (file->length)
+               return (pagesize - file->length);
+
+           length = bytes;
+           buffer += bytes;
+           size -= bytes;
+       }
+
+       while (size > pagesize) {
+           /* write multiple of pagesize */
+           bytes = (*file->io_write)(file->descriptor, buffer,
+                                     size - (size % pagesize));
+           if (bytes <= 0)
+               return (length);
+
+           length += bytes;
+           buffer += bytes;
+           size -= bytes;
+       }
+
+       if (size) {
+           /* keep remaining data in buffer */
+           switch (size) {
+               case 8:
+                   file->buffer[file->length++] = *buffer++;
+               case 7:
+                   file->buffer[file->length++] = *buffer++;
+               case 6:
+                   file->buffer[file->length++] = *buffer++;
+               case 5:
+                   file->buffer[file->length++] = *buffer++;
+               case 4:
+                   file->buffer[file->length++] = *buffer++;
+               case 3:
+                   file->buffer[file->length++] = *buffer++;
+               case 2:
+                   file->buffer[file->length++] = *buffer++;
+               case 1:
+                   file->buffer[file->length++] = *buffer++;
+                   break;
+               default:
+                   memcpy(file->buffer + file->length, buffer, size);
+                   file->length += size;
+                   break;
+           }
+           length += size;
+       }
+
+       return (length);
+    }
+
+    return ((*file->io_write)(file->descriptor, data, size));
+}
+
+int
+LispSwrite(LispString *string, void *data, int size)
+{
+    int bytes;
+
+    if (size < 0)
+       return (EOF);
+
+    if (string->output + size >= string->space) {
+       if (string->fixed) {
+           /* leave space for a ending nul character */
+           bytes = string->space - string->output - 1;
+
+           if (bytes < size)
+               size = bytes;
+
+           if (size <= 0)
+               return (-1);
+       }
+       else {
+           char *tmp;
+
+           bytes = string->space + size;
+           bytes += pagesize - (bytes % pagesize);
+           tmp = realloc(string->string, bytes);
+
+           if (tmp == NULL)
+               return (-1);
+
+           string->string = tmp;
+           string->space = bytes;
+       }
+    }
+    memcpy(string->string + string->output, data, size);
+    string->output += size;
+    if (string->length < string->output)
+       string->length = string->output;
+
+    if (!string->binary)
+       string->column = calculate_column(data, size, string->column);
+
+    return (size);
+}
+
+char *
+LispGetSstring(LispString *string, int *length)
+{
+    if (string->string == NULL || string->length <= 0) {
+       *length = 0;
+
+       return ("");
+    }
+    *length = string->length;
+    if (string->string[string->length -1] != '\0') {
+       if (string->length < string->space)
+           string->string[string->length] = '\0';
+       else if (string->fixed && string->space)
+           string->string[string->space - 1] = '\0';
+       else {
+           char *tmp = realloc(string->string, string->space + pagesize);
+
+           if (tmp == NULL)
+               string->string[string->space - 1] = '\0';
+           else {
+               string->string = tmp;
+               string->space += pagesize;
+               string->string[string->length] = '\0';
+           }
+       }
+    }
+
+    return (string->string);
+}
+
+int
+LispRename(char *from, char *to)
+{
+    return (rename(from, to));
+}
+
+int
+LispUnlink(char *name)
+{
+    return (unlink(name));
+}
diff --git a/xedit/lisp/io.h b/xedit/lisp/io.h
new file mode 100644 (file)
index 0000000..2bb8c4d
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/io.h,v 1.9tsi Exp $ */
+
+#ifndef Lisp_io_h
+#define Lisp_io_h
+
+#include "lisp/private.h"
+
+#define        FILE_READ       0x01
+#define FILE_WRITE     0x02
+#define FILE_IO                0x03
+#define FILE_APPEND    0x06    /* append mode, write bit also set */
+#define FILE_BUFFERED  0x08    /* force buffered mode */
+#define FILE_UNBUFFERED        0x10    /* force unbuffered mode */
+#define FILE_BINARY    0x20
+
+/*
+ * Types
+ */
+typedef ssize_t (*io_write_fn)(int, const void*, size_t);
+
+struct _LispFile {
+    char *buffer;
+    int line;                  /* input line number */
+    int column;                        /* output column number */
+    int descriptor;
+    int length;                        /* number of bytes used */
+    int offset;                        /* read/write offset */
+    int unget : 8;             /* unread char */
+    unsigned int readable : 1;
+    unsigned int writable : 1;
+    unsigned int regular : 1;  /* regular file */
+    unsigned int buffered : 1;
+    unsigned int available : 1;        /* unget field holds a char */
+    unsigned int nonblock : 1; /* in nonblock mode */
+    unsigned int binary : 1;   /* if set, don't calculate column/line-number */
+    io_write_fn io_write;
+};
+
+struct _LispString {
+    char *string;
+    int line;                  /* input line number */
+    int column;                        /* output column number */
+    int space;                 /* number of bytes alocated */
+    int length;                        /* number of bytes used */
+    int input;                 /* input offset, for read operations */
+    int output;                        /* output offset, for write operations */
+    unsigned int fixed : 1;    /* if set, don't try to reallocate string */
+    unsigned int binary : 1;   /* if set, don't calculate column/line-number */
+};
+
+/*
+ * Prototypes
+ */
+       /* higher level functions */
+int LispGet(void);
+int LispUnget(int);
+void LispPushInput(LispObj*);
+void LispPopInput(LispObj*);
+
+       /* functions that read/write using the LispFile structure */
+LispFile *LispFdopen(int, int);
+LispFile *LispFopen(char*, int);
+void LispFclose(LispFile*);
+int LispFflush(LispFile*);
+int LispFungetc(LispFile*, int);
+int LispFgetc(LispFile*);
+int LispFputc(LispFile*, int);
+char *LispFgets(LispFile*, char*, int);
+int LispFputs(LispFile*, char*);
+int LispFread(LispFile*, void*, int);
+int LispFwrite(LispFile*, void*, int);
+int LispRename(char*, char*);
+int LispUnlink(char*);
+
+       /* io wrappers */
+io_write_fn LispSetFileWrite(LispFile*, io_write_fn);
+
+       /* functions that read/write using the LispString structure */
+int LispSgetc(LispString*);
+int LispSputc(LispString*, int);
+int LispSputs(LispString*, char*);
+int LispSwrite(LispString*, void*, int);
+
+char *LispGetSstring(LispString*, int*);
+
+#endif /* Lisp_io_h */
diff --git a/xedit/lisp/lisp.c b/xedit/lisp/lisp.c
new file mode 100644 (file)
index 0000000..4b393c1
--- /dev/null
@@ -0,0 +1,5491 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/lisp.c,v 1.87tsi Exp $ */
+
+#include <stdlib.h>
+#include <string.h>
+#ifdef sun
+#include <strings.h>
+#endif
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdarg.h>
+#include <signal.h>
+#include <sys/wait.h>
+
+#ifndef X_NOT_POSIX
+#include <unistd.h>    /* for sysconf(), and getpagesize() */
+#endif
+
+#if defined(linux)
+#define HAS_GETPAGESIZE
+#define HAS_SC_PAGESIZE        /* _SC_PAGESIZE may be an enum for Linux */
+#endif
+
+#if defined(CSRG_BASED)
+#define HAS_GETPAGESIZE
+#endif
+
+#if defined(sun)
+#define HAS_GETPAGESIZE
+#endif
+
+#if defined(QNX4)
+#define HAS_GETPAGESIZE
+#endif
+
+#if defined(__QNXNTO__)
+#define HAS_SC_PAGESIZE
+#endif
+
+#include "lisp/bytecode.h"
+
+#include "lisp/read.h"
+#include "lisp/format.h"
+#include "lisp/math.h"
+#include "lisp/hash.h"
+#include "lisp/package.h"
+#include "lisp/pathname.h"
+#include "lisp/regex.h"
+#include "lisp/require.h"
+#include "lisp/stream.h"
+#include "lisp/struct.h"
+#include "lisp/time.h"
+#include "lisp/write.h"
+#include <math.h>
+
+typedef struct {
+    LispObj **objects;
+    LispObj *freeobj;
+    int nsegs;
+    int nobjs;
+    int nfree;
+} LispObjSeg;
+
+/*
+ * Prototypes
+ */
+static void Lisp__GC(LispObj*, LispObj*);
+static LispObj *Lisp__New(LispObj*, LispObj*);
+
+/* run a user function, to be called only by LispEval */
+static LispObj *LispRunFunMac(LispObj*, LispObj*, int, int);
+
+/* expands and executes a setf method, to be called only by Lisp_Setf */
+LispObj *LispRunSetf(LispArgList*, LispObj*, LispObj*, LispObj*);
+LispObj *LispRunSetfMacro(LispAtom*, LispObj*, LispObj*);
+
+/* increases storage size for environment */
+void LispMoreEnvironment(void);
+
+/* increases storage size for stack of builtin arguments */
+void LispMoreStack(void);
+
+/* increases storage size for global variables */
+void LispMoreGlobals(LispPackage*);
+
+#ifdef __GNUC__
+static INLINE LispObj *LispDoGetVar(LispObj*);
+#endif
+static INLINE void LispDoAddVar(LispObj*, LispObj*);
+
+/* Helper for importing symbol(s) functions,
+ * Search for the specified object in the current package */
+static INLINE LispObj *LispGetVarPack(LispObj*);
+
+/* create environment for function call */
+static int LispMakeEnvironment(LispArgList*, LispObj*, LispObj*, int, int);
+
+       /* if not already in keyword package, move atom to keyword package */
+static LispObj *LispCheckKeyword(LispObj*);
+
+       /* builtin backquote parsing */
+static LispObj *LispEvalBackquoteObject(LispObj*, int, int);
+       /* used also by the bytecode compiler */
+LispObj *LispEvalBackquote(LispObj*, int);
+
+       /* create or change object property */
+void LispSetAtomObjectProperty(LispAtom*, LispObj*);
+       /* remove object property */
+static void LispRemAtomObjectProperty(LispAtom*);
+
+       /* allocates a new LispProperty for the given atom */
+static void LispAllocAtomProperty(LispAtom*);
+       /* Increment reference count of atom property */
+static void LispIncrementAtomReference(LispAtom*);
+       /* Decrement reference count of atom property */
+static void LispDecrementAtomReference(LispAtom*);
+       /* Removes all atom properties */
+static void LispRemAtomAllProperties(LispAtom*);
+
+static LispObj *LispAtomPropertyFunction(LispAtom*, LispObj*, int);
+
+static INLINE void LispCheckMemLevel(void);
+
+void LispAllocSeg(LispObjSeg*, int);
+static INLINE void LispMark(LispObj*);
+
+/* functions, macros, setf methods, and structure definitions */
+static INLINE void LispProt(LispObj*);
+
+static LispObj *LispCheckNeedProtect(LispObj*);
+
+static
+#ifdef SIGNALRETURNSINT
+int
+#else
+void
+#endif
+LispSignalHandler(int);
+
+/*
+ * Initialization
+ */
+LispMac lisp__data;
+
+static LispObj lispunbound = {LispNil_t};
+LispObj *UNBOUND = &lispunbound;
+
+static volatile int lisp__disable_int;
+static volatile int lisp__interrupted;
+
+LispObj *Okey, *Orest, *Ooptional, *Oaux, *Olambda;
+
+Atom_id Snil, St;
+Atom_id Saux, Skey, Soptional, Srest;
+Atom_id Satom, Ssymbol, Sinteger, Scharacter, Sstring, Slist,
+       Scons, Svector, Sarray, Sstruct, Skeyword, Sfunction, Spathname,
+       Srational, Sfloat, Scomplex, Sopaque, Sdefault;
+
+LispObj *Oformat, *Kunspecific;
+LispObj *Oexpand_setf_method;
+
+static LispProperty noproperty;
+LispProperty *NOPROPERTY = &noproperty;
+static int segsize, minfree;
+int pagesize, gcpro;
+
+static LispObjSeg objseg = {NULL, NIL};
+static LispObjSeg atomseg = {NULL, NIL};
+
+int LispArgList_t;
+
+LispFile *Stdout, *Stdin, *Stderr;
+
+static LispBuiltin lispbuiltins[] = {
+    {LispFunction, Lisp_Mul, "* &rest numbers"},
+    {LispFunction, Lisp_Plus, "+ &rest numbers"},
+    {LispFunction, Lisp_Minus, "- number &rest more-numbers"},
+    {LispFunction, Lisp_Div, "/ number &rest more-numbers"},
+    {LispFunction, Lisp_OnePlus, "1+ number"},
+    {LispFunction, Lisp_OneMinus, "1- number"},
+    {LispFunction, Lisp_Less, "< number &rest more-numbers"},
+    {LispFunction, Lisp_LessEqual, "<= number &rest more-numbers"},
+    {LispFunction, Lisp_Equal_, "= number &rest more-numbers"},
+    {LispFunction, Lisp_Greater, "> number &rest more-numbers"},
+    {LispFunction, Lisp_GreaterEqual, ">= number &rest more-numbers"},
+    {LispFunction, Lisp_NotEqual, "/= number &rest more-numbers"},
+    {LispFunction, Lisp_Max, "max number &rest more-numbers"},
+    {LispFunction, Lisp_Min, "min number &rest more-numbers"},
+    {LispFunction, Lisp_Abs, "abs number"},
+    {LispFunction, Lisp_Acons, "acons key datum alist"},
+    {LispFunction, Lisp_Adjoin, "adjoin item list &key key test test-not"},
+    {LispFunction, Lisp_AlphaCharP, "alpha-char-p char"},
+    {LispMacro, Lisp_And, "and &rest args", 1, 0, Com_And},
+    {LispFunction, Lisp_Append, "append &rest lists"},
+    {LispFunction, Lisp_Apply, "apply function arg &rest more-args", 1},
+    {LispFunction, Lisp_Aref, "aref array &rest subscripts"},
+    {LispFunction, Lisp_Assoc, "assoc item list &key test test-not key"},
+    {LispFunction, Lisp_AssocIf, "assoc-if predicate list &key key"},
+    {LispFunction, Lisp_AssocIfNot, "assoc-if-not predicate list &key key"},
+    {LispFunction, Lisp_Atom, "atom object"},
+    {LispMacro, Lisp_Block, "block name &rest body", 1, 0, Com_Block},
+    {LispFunction, Lisp_BothCaseP, "both-case-p character"},
+    {LispFunction, Lisp_Boundp, "boundp symbol"},
+    {LispFunction, Lisp_Butlast, "butlast list &optional count"},
+    {LispFunction, Lisp_Nbutlast, "nbutlast list &optional count"},
+    {LispFunction, Lisp_Car, "car list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_Car, "first list", 0, 0, Com_C_r},
+    {LispMacro, Lisp_Case, "case keyform &rest body"},
+    {LispMacro, Lisp_Catch, "catch tag &rest body", 1},
+    {LispFunction, Lisp_Cdr, "cdr list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_Cdr, "rest list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_Ceiling, "ceiling number &optional divisor", 1},
+    {LispFunction, Lisp_Fceiling, "fceiling number &optional divisor", 1},
+    {LispFunction, Lisp_Char, "char string index"},
+    {LispFunction, Lisp_Char, "schar simple-string index"},
+    {LispFunction, Lisp_CharLess, "char< character &rest more-characters"},
+    {LispFunction, Lisp_CharLessEqual, "char<= character &rest more-characters"},
+    {LispFunction, Lisp_CharEqual_, "char= character &rest more-characters"},
+    {LispFunction, Lisp_CharGreater, "char> character &rest more-characters"},
+    {LispFunction, Lisp_CharGreaterEqual, "char>= character &rest more-characters"},
+    {LispFunction, Lisp_CharNotEqual_, "char/= character &rest more-characters"},
+    {LispFunction, Lisp_CharLessp, "char-lessp character &rest more-characters"},
+    {LispFunction, Lisp_CharNotGreaterp, "char-not-greaterp character &rest more-characters"},
+    {LispFunction, Lisp_CharEqual, "char-equal character &rest more-characters"},
+    {LispFunction, Lisp_CharGreaterp, "char-greaterp character &rest more-characters"},
+    {LispFunction, Lisp_CharNotLessp, "char-not-lessp character &rest more-characters"},
+    {LispFunction, Lisp_CharNotEqual, "char-not-equal character &rest more-characters"},
+    {LispFunction, Lisp_CharDowncase, "char-downcase character"},
+    {LispFunction, Lisp_CharInt, "char-code character"},
+    {LispFunction, Lisp_CharInt, "char-int character"},
+    {LispFunction, Lisp_CharUpcase, "char-upcase character"},
+    {LispFunction, Lisp_Character, "character object"},
+    {LispFunction, Lisp_Characterp, "characterp object"},
+    {LispFunction, Lisp_Clrhash, "clrhash hash-table"},
+    {LispFunction, Lisp_IntChar, "code-char integer"},
+    {LispFunction, Lisp_Coerce, "coerce object result-type"},
+    {LispFunction, Lisp_Compile, "compile name &optional definition", 1},
+    {LispFunction, Lisp_Complex, "complex realpart &optional imagpart"},
+    {LispMacro, Lisp_Cond, "cond &rest body", 0, 0, Com_Cond},
+    {LispFunction, Lisp_Cons, "cons car cdr", 0, 0, Com_Cons},
+    {LispFunction, Lisp_Consp, "consp object", 0, 0, Com_Consp},
+    {LispFunction, Lisp_Constantp, "constantp form &optional environment"},
+    {LispFunction, Lisp_Conjugate, "conjugate number"},
+    {LispFunction, Lisp_Complexp, "complexp object"},
+    {LispFunction, Lisp_CopyAlist, "copy-alist list"},
+    {LispFunction, Lisp_CopyList, "copy-list list"},
+    {LispFunction, Lisp_CopyTree, "copy-tree list"},
+    {LispFunction, Lisp_Close, "close stream &key abort"},
+    {LispFunction, Lisp_C_r, "caar list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "cadr list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "cdar list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "cddr list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "caaar list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "caadr list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "cadar list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "caddr list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "cdaar list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "cdadr list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "cddar list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "cdddr list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "caaaar list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "caaadr list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "caadar list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "caaddr list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "cadaar list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "cadadr list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "caddar list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "cadddr list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "cdaaar list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "cdaadr list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "cdadar list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "cdaddr list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "cddaar list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "cddadr list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "cdddar list", 0, 0, Com_C_r},
+    {LispFunction, Lisp_C_r, "cddddr list", 0, 0, Com_C_r},
+    {LispMacro, Lisp_Decf, "decf place &optional delta"},
+    {LispMacro, Lisp_Defconstant, "defconstant name initial-value &optional documentation"},
+    {LispMacro, Lisp_Defmacro, "defmacro name lambda-list &rest body"},
+    {LispMacro, Lisp_Defstruct, "defstruct name &rest description"},
+    {LispMacro, Lisp_Defun, "defun name lambda-list &rest body"},
+    {LispMacro, Lisp_Defsetf, "defsetf function lambda-list &rest body"},
+    {LispMacro, Lisp_Defparameter, "defparameter name initial-value &optional documentation"},
+    {LispMacro, Lisp_Defvar, "defvar name &optional initial-value documentation"},
+    {LispFunction, Lisp_Delete, "delete item sequence &key from-end test test-not start end count key"},
+    {LispFunction, Lisp_DeleteDuplicates, "delete-duplicates sequence &key from-end test test-not start end key"},
+    {LispFunction, Lisp_DeleteIf, "delete-if predicate sequence &key from-end start end count key"},
+    {LispFunction, Lisp_DeleteIfNot, "delete-if-not predicate sequence &key from-end start end count key"},
+    {LispFunction, Lisp_DeleteFile, "delete-file filename"},
+    {LispFunction, Lisp_Denominator, "denominator rational"},
+    {LispFunction, Lisp_DigitChar, "digit-char weight &optional radix"},
+    {LispFunction, Lisp_DigitCharP, "digit-char-p character &optional radix"},
+    {LispFunction, Lisp_Directory, "directory pathname &key all if-cannot-read"},
+    {LispFunction, Lisp_DirectoryNamestring, "directory-namestring pathname"},
+    {LispFunction, Lisp_Disassemble, "disassemble function"},
+    {LispMacro, Lisp_Do, "do init test &rest body"},
+    {LispMacro, Lisp_DoP, "do* init test &rest body"},
+    {LispFunction, Lisp_Documentation, "documentation symbol type"},
+    {LispMacro, Lisp_DoList, "dolist init &rest body", 0, 0, Com_Dolist},
+    {LispMacro, Lisp_DoTimes, "dotimes init &rest body"},
+    {LispMacro, Lisp_DoAllSymbols, "do-all-symbols init &rest body"},
+    {LispMacro, Lisp_DoExternalSymbols, "do-external-symbols init &rest body"},
+    {LispMacro, Lisp_DoSymbols, "do-symbols init &rest body"},
+    {LispFunction, Lisp_Elt, "elt sequence index"},
+    {LispFunction, Lisp_Endp, "endp object"},
+    {LispFunction, Lisp_EnoughNamestring, "enough-namestring pathname &optional defaults"},
+    {LispFunction, Lisp_Eq, "eq left right", 0, 0, Com_Eq},
+    {LispFunction, Lisp_Eql, "eql left right", 0, 0, Com_Eq},
+    {LispFunction, Lisp_Equal, "equal left right", 0, 0, Com_Eq},
+    {LispFunction, Lisp_Equalp, "equalp left right", 0, 0, Com_Eq},
+    {LispFunction, Lisp_Error, "error control-string &rest arguments"},
+    {LispFunction, Lisp_Evenp, "evenp integer"},
+    {LispFunction, Lisp_Export, "export symbols &optional package"},
+    {LispFunction, Lisp_Eval, "eval form"},
+    {LispFunction, Lisp_Every, "every predicate sequence &rest more-sequences"},
+    {LispFunction, Lisp_Some, "some predicate sequence &rest more-sequences"},
+    {LispFunction, Lisp_Notevery, "notevery predicate sequence &rest more-sequences"},
+    {LispFunction, Lisp_Notany, "notany predicate sequence &rest more-sequences"},
+    {LispFunction, Lisp_Fboundp, "fboundp symbol"},
+    {LispFunction, Lisp_Find, "find item sequence &key from-end test test-not start end key"},
+    {LispFunction, Lisp_FindIf, "find-if predicate sequence &key from-end start end key"},
+    {LispFunction, Lisp_FindIfNot, "find-if-not predicate sequence &key from-end start end key"},
+    {LispFunction, Lisp_FileNamestring, "file-namestring pathname"},
+    {LispFunction, Lisp_Fill, "fill sequence item &key start end"},
+    {LispFunction, Lisp_FindAllSymbols, "find-all-symbols string-or-symbol"},
+    {LispFunction, Lisp_FindSymbol, "find-symbol string &optional package", 1},
+    {LispFunction, Lisp_FindPackage, "find-package name"},
+    {LispFunction, Lisp_Float, "float number &optional other"},
+    {LispFunction, Lisp_Floatp, "floatp object"},
+    {LispFunction, Lisp_Floor, "floor number &optional divisor", 1},
+    {LispFunction, Lisp_Ffloor, "ffloor number &optional divisor", 1},
+    {LispFunction, Lisp_Fmakunbound, "fmakunbound symbol"},
+    {LispFunction, Lisp_Format, "format destination control-string &rest arguments"},
+    {LispFunction, Lisp_FreshLine, "fresh-line &optional output-stream"},
+    {LispFunction, Lisp_Funcall, "funcall function &rest arguments", 1},
+    {LispFunction, Lisp_Functionp, "functionp object"},
+    {LispFunction, Lisp_Gc, "gc &optional car cdr"},
+    {LispFunction, Lisp_Gcd, "gcd &rest integers"},
+    {LispFunction, Lisp_Gensym, "gensym &optional arg"},
+    {LispFunction, Lisp_Get, "get symbol indicator &optional default"},
+    {LispFunction, Lisp_Gethash, "gethash key hash-table &optional default", 1},
+    {LispMacro, Lisp_Go, "go tag", 0, 0, Com_Go},
+    {LispFunction, Lisp_GraphicCharP, "graphic-char-p char"},
+    {LispFunction, Lisp_HashTableP, "hash-table-p object"},
+    {LispFunction, Lisp_HashTableCount, "hash-table-count hash-table"},
+    {LispFunction, Lisp_HashTableRehashSize, "hash-table-rehash-size hash-table"},
+    {LispFunction, Lisp_HashTableRehashThreshold, "hash-table-rehash-threshold hash-table"},
+    {LispFunction, Lisp_HashTableSize, "hash-table-size hash-table"},
+    {LispFunction, Lisp_HashTableTest, "hash-table-test hash-table"},
+    {LispFunction, Lisp_HostNamestring, "host-namestring pathname"},
+    {LispMacro, Lisp_If, "if test then &optional else", 0, 0, Com_If},
+    {LispMacro, Lisp_IgnoreErrors, "ignore-errors &rest body", 1},
+    {LispFunction, Lisp_Imagpart, "imagpart number"},
+    {LispMacro, Lisp_InPackage, "in-package name"},
+    {LispMacro, Lisp_Incf, "incf place &optional delta"},
+    {LispFunction, Lisp_Import, "import symbols &optional package"},
+    {LispFunction, Lisp_InputStreamP, "input-stream-p stream"},
+    {LispFunction, Lisp_IntChar, "int-char integer"},
+    {LispFunction, Lisp_Integerp, "integerp object"},
+    {LispFunction, Lisp_Intern, "intern string &optional package", 1},
+    {LispFunction, Lisp_Intersection, "intersection list1 list2 &key test test-not key"},
+    {LispFunction, Lisp_Nintersection, "nintersection list1 list2 &key test test-not key"},
+    {LispFunction, Lisp_Isqrt, "isqrt natural"},
+    {LispFunction, Lisp_Keywordp, "keywordp object"},
+    {LispFunction, Lisp_Last, "last list &optional count", 0, 0, Com_Last},
+    {LispMacro, Lisp_Lambda, "lambda lambda-list &rest body"},
+    {LispFunction, Lisp_Lcm, "lcm &rest integers"},
+    {LispFunction, Lisp_Length, "length sequence", 0, 0, Com_Length},
+    {LispMacro, Lisp_Let, "let init &rest body", 1, 0, Com_Let},
+    {LispMacro, Lisp_LetP, "let* init &rest body", 1, 0, Com_Letx},
+    {LispFunction, Lisp_ListP, "list* object &rest more-objects"},
+    {LispFunction, Lisp_ListAllPackages, "list-all-packages"},
+    {LispFunction, Lisp_List, "list &rest args"},
+    {LispFunction, Lisp_ListLength, "list-length list"},
+    {LispFunction, Lisp_Listp, "listp object", 0, 0, Com_Listp},
+    {LispFunction, Lisp_Listen, "listen &optional input-stream"},
+    {LispFunction, Lisp_Load, "load filename &key verbose print if-does-not-exist"},
+    {LispFunction, Lisp_Logand, "logand &rest integers"},
+    {LispFunction, Lisp_Logeqv, "logeqv &rest integers"},
+    {LispFunction, Lisp_Logior, "logior &rest integers"},
+    {LispFunction, Lisp_Lognot, "lognot integer"},
+    {LispFunction, Lisp_Logxor, "logxor &rest integers"},
+    {LispMacro, Lisp_Loop, "loop &rest body", 0, 0, Com_Loop},
+    {LispFunction, Lisp_LowerCaseP, "lower-case-p character"},
+    {LispFunction, Lisp_MakeArray, "make-array dimensions &key element-type initial-element initial-contents adjustable fill-pointer displaced-to displaced-index-offset"},
+    {LispFunction, Lisp_MakeHashTable, "make-hash-table &key test size rehash-size rehash-threshold initial-contents"},
+    {LispFunction, Lisp_MakeList, "make-list size &key initial-element"},
+    {LispFunction, Lisp_MakePackage, "make-package package-name &key nicknames use"},
+    {LispFunction, Lisp_MakePathname, "make-pathname &key host device directory name type version defaults"},
+    {LispFunction, Lisp_MakeString, "make-string size &key initial-element element-type"},
+    {LispFunction, Lisp_MakeSymbol, "make-symbol name"},
+    {LispFunction, Lisp_MakeStringInputStream, "make-string-input-stream string &optional start end"},
+    {LispFunction, Lisp_MakeStringOutputStream, "make-string-output-stream &key element-type"},
+    {LispFunction, Lisp_GetOutputStreamString, "get-output-stream-string string-output-stream"},
+    {LispFunction, Lisp_Makunbound, "makunbound symbol"},
+    {LispFunction, Lisp_Mapc, "mapc function list &rest more-lists"},
+    {LispFunction, Lisp_Mapcar, "mapcar function list &rest more-lists"},
+    {LispFunction, Lisp_Mapcan, "mapcan function list &rest more-lists"},
+    {LispFunction, Lisp_Maphash, "maphash function hash-table"},
+    {LispFunction, Lisp_Mapl, "mapl function list &rest more-lists"},
+    {LispFunction, Lisp_Maplist, "maplist function list &rest more-lists"},
+    {LispFunction, Lisp_Mapcon, "mapcon function list &rest more-lists"},
+    {LispFunction, Lisp_Member, "member item list &key test test-not key"},
+    {LispFunction, Lisp_MemberIf, "member-if predicate list &key key"},
+    {LispFunction, Lisp_MemberIfNot, "member-if-not predicate list &key key"},
+    {LispFunction, Lisp_Minusp, "minusp number"},
+    {LispFunction, Lisp_Mod, "mod number divisor"},
+    {LispMacro, Lisp_MultipleValueBind, "multiple-value-bind symbols values &rest body"},
+    {LispMacro, Lisp_MultipleValueCall, "multiple-value-call function &rest form", 1},
+    {LispMacro, Lisp_MultipleValueProg1, "multiple-value-prog1 first-form &rest form", 1},
+    {LispMacro, Lisp_MultipleValueList, "multiple-value-list form"},
+    {LispMacro, Lisp_MultipleValueSetq, "multiple-value-setq symbols form"},
+    {LispFunction, Lisp_Nconc, "nconc &rest lists"},
+    {LispFunction, Lisp_Nreverse, "nreverse sequence"},
+    {LispFunction, Lisp_NsetDifference, "nset-difference list1 list2 &key test test-not key"},
+    {LispFunction, Lisp_Nsubstitute, "nsubstitute newitem olditem sequence &key from-end test test-not start end count key"},
+    {LispFunction, Lisp_NsubstituteIf, "nsubstitute-if newitem test sequence &key from-end start end count key"},
+    {LispFunction, Lisp_NsubstituteIfNot, "nsubstitute-if-not newitem test sequence &key from-end start end count key"},
+    {LispFunction, Lisp_Nth, "nth index list"},
+    {LispFunction, Lisp_Nthcdr, "nthcdr index list", 0, 0, Com_Nthcdr},
+    {LispMacro, Lisp_NthValue, "nth-value index form"},
+    {LispFunction, Lisp_Numerator, "numerator rational"},
+    {LispFunction, Lisp_Namestring, "namestring pathname"},
+    {LispFunction, Lisp_Null, "not arg", 0, 0, Com_Null},
+    {LispFunction, Lisp_Null, "null list", 0, 0, Com_Null},
+    {LispFunction, Lisp_Numberp, "numberp object", 0, 0, Com_Numberp},
+    {LispFunction, Lisp_Oddp, "oddp integer"},
+    {LispFunction, Lisp_Open, "open filename &key direction element-type if-exists if-does-not-exist external-format"},
+    {LispFunction, Lisp_OpenStreamP, "open-stream-p stream"},
+    {LispMacro, Lisp_Or, "or &rest args", 1, 0, Com_Or},
+    {LispFunction, Lisp_OutputStreamP, "output-stream-p stream"},
+    {LispFunction, Lisp_Packagep, "packagep object"},
+    {LispFunction, Lisp_PackageName, "package-name package"},
+    {LispFunction, Lisp_PackageNicknames, "package-nicknames package"},
+    {LispFunction, Lisp_PackageUseList, "package-use-list package"},
+    {LispFunction, Lisp_PackageUsedByList, "package-used-by-list package"},
+    {LispFunction, Lisp_Pairlis, "pairlis key data &optional alist"},
+    {LispFunction, Lisp_ParseInteger, "parse-integer string &key start end radix junk-allowed", 1},
+    {LispFunction, Lisp_ParseNamestring, "parse-namestring object &optional host defaults &key start end junk-allowed", 1},
+    {LispFunction, Lisp_PathnameHost, "pathname-host pathname"},
+    {LispFunction, Lisp_PathnameDevice, "pathname-device pathname"},
+    {LispFunction, Lisp_PathnameDirectory, "pathname-directory pathname"},
+    {LispFunction, Lisp_PathnameName, "pathname-name pathname"},
+    {LispFunction, Lisp_PathnameType, "pathname-type pathname"},
+    {LispFunction, Lisp_PathnameVersion, "pathname-version pathname"},
+    {LispFunction, Lisp_Pathnamep, "pathnamep object"},
+    {LispFunction, Lisp_Plusp, "plusp number"},
+    {LispMacro, Lisp_Pop, "pop place"},
+    {LispFunction, Lisp_Position, "position item sequence &key from-end test test-not start end key"},
+    {LispFunction, Lisp_PositionIf, "position-if predicate sequence &key from-end start end key"},
+    {LispFunction, Lisp_PositionIfNot, "position-if-not predicate sequence &key from-end start end key"},
+    {LispFunction, Lisp_Prin1, "prin1 object &optional output-stream"},
+    {LispFunction, Lisp_Princ, "princ object &optional output-stream"},
+    {LispFunction, Lisp_Print, "print object &optional output-stream"},
+    {LispFunction, Lisp_ProbeFile, "probe-file pathname"},
+    {LispFunction, Lisp_Proclaim, "proclaim declaration"},
+    {LispMacro, Lisp_Prog1, "prog1 first &rest body"},
+    {LispMacro, Lisp_Prog2, "prog2 first second &rest body"},
+    {LispMacro, Lisp_Progn, "progn &rest body", 1, 0, Com_Progn},
+    {LispMacro, Lisp_Progv, "progv symbols values &rest body", 1},
+    {LispFunction, Lisp_Provide, "provide module"},
+    {LispMacro, Lisp_Push, "push item place"},
+    {LispMacro, Lisp_Pushnew, "pushnew item place &key key test test-not"},
+    {LispFunction, Lisp_Quit, "quit &optional status"},
+    {LispMacro, Lisp_Quote, "quote object"},
+    {LispFunction, Lisp_Rational, "rational number"},
+    {LispFunction, Lisp_Rationalp, "rationalp object"},
+    {LispFunction, Lisp_Read, "read &optional input-stream eof-error-p eof-value recursive-p"},
+    {LispFunction, Lisp_ReadChar, "read-char &optional input-stream eof-error-p eof-value recursive-p"},
+    {LispFunction, Lisp_ReadCharNoHang, "read-char-no-hang &optional input-stream eof-error-p eof-value recursive-p"},
+    {LispFunction, Lisp_ReadLine, "read-line &optional input-stream eof-error-p eof-value recursive-p", 1},
+    {LispFunction, Lisp_Realpart, "realpart number"},
+    {LispFunction, Lisp_Replace, "replace sequence1 sequence2 &key start1 end1 start2 end2"},
+    {LispFunction, Lisp_ReadFromString, "read-from-string string &optional eof-error-p eof-value &key start end preserve-whitespace", 1},
+    {LispFunction, Lisp_Require, "require module &optional pathname"},
+    {LispFunction, Lisp_Rem, "rem number divisor"},
+    {LispFunction, Lisp_Remhash, "remhash key hash-table"},
+    {LispFunction, Lisp_Remove, "remove item sequence &key from-end test test-not start end count key"},
+    {LispFunction, Lisp_RemoveDuplicates, "remove-duplicates sequence &key from-end test test-not start end key"},
+    {LispFunction, Lisp_RemoveIf, "remove-if predicate sequence &key from-end start end count key"},
+    {LispFunction, Lisp_RemoveIfNot, "remove-if-not predicate sequence &key from-end start end count key"},
+    {LispFunction, Lisp_Remprop, "remprop symbol indicator"},
+    {LispFunction, Lisp_RenameFile, "rename-file filename new-name", 1},
+    {LispMacro, Lisp_Return, "return &optional result", 1, 0, Com_Return},
+    {LispMacro, Lisp_ReturnFrom, "return-from name &optional result", 1, 0, Com_ReturnFrom},
+    {LispFunction, Lisp_Reverse, "reverse sequence"},
+    {LispFunction, Lisp_Round, "round number &optional divisor", 1},
+    {LispFunction, Lisp_Fround, "fround number &optional divisor", 1},
+    {LispFunction, Lisp_Rplaca, "rplaca place value", 0, 0, Com_Rplac_},
+    {LispFunction, Lisp_Rplacd, "rplacd place value", 0, 0, Com_Rplac_},
+    {LispFunction, Lisp_Search, "search sequence1 sequence2 &key from-end test test-not key start1 start2 end1 end2"},
+    {LispFunction, Lisp_Set, "set symbol value"},
+    {LispFunction, Lisp_SetDifference, "set-difference list1 list2 &key test test-not key"},
+    {LispFunction, Lisp_SetExclusiveOr, "set-exclusive-or list1 list2 &key test test-not key"},
+    {LispFunction, Lisp_NsetExclusiveOr, "nset-exclusive-or list1 list2 &key test test-not key"},
+    {LispMacro, Lisp_Setf, "setf &rest form"},
+    {LispMacro, Lisp_Psetf, "psetf &rest form"},
+    {LispMacro, Lisp_SetQ, "setq &rest form", 0, 0, Com_Setq},
+    {LispMacro, Lisp_Psetq, "psetq &rest form"},
+    {LispFunction, Lisp_Sleep, "sleep seconds"},
+    {LispFunction, Lisp_Sort, "sort sequence predicate &key key"},
+    {LispFunction, Lisp_Sqrt, "sqrt number"},
+    {LispFunction, Lisp_Elt, "svref sequence index"},
+    {LispFunction, Lisp_Sort, "stable-sort sequence predicate &key key"},
+    {LispFunction, Lisp_Streamp, "streamp object"},
+    {LispFunction, Lisp_String, "string object"},
+    {LispFunction, Lisp_Stringp, "stringp object"},
+    {LispFunction, Lisp_StringEqual_, "string= string1 string2 &key start1 end1 start2 end2"},
+    {LispFunction, Lisp_StringLess, "string< string1 string2 &key start1 end1 start2 end2"},
+    {LispFunction, Lisp_StringGreater, "string> string1 string2 &key start1 end1 start2 end2"},
+    {LispFunction, Lisp_StringLessEqual, "string<= string1 string2 &key start1 end1 start2 end2"},
+    {LispFunction, Lisp_StringGreaterEqual, "string>= string1 string2 &key start1 end1 start2 end2"},
+    {LispFunction, Lisp_StringNotEqual_, "string/= string1 string2 &key start1 end1 start2 end2"},
+    {LispFunction, Lisp_StringConcat, "string-concat &rest strings"},
+    {LispFunction, Lisp_StringEqual, "string-equal string1 string2 &key start1 end1 start2 end2"},
+    {LispFunction, Lisp_StringGreaterp, "string-greaterp string1 string2 &key start1 end1 start2 end2"},
+    {LispFunction, Lisp_StringNotEqual, "string-not-equal string1 string2 &key start1 end1 start2 end2"},
+    {LispFunction, Lisp_StringNotGreaterp, "string-not-greaterp string1 string2 &key start1 end1 start2 end2"},
+    {LispFunction, Lisp_StringNotLessp, "string-not-lessp string1 string2 &key start1 end1 start2 end2"},
+    {LispFunction, Lisp_StringLessp, "string-lessp string1 string2 &key start1 end1 start2 end2"},
+    {LispFunction, Lisp_StringTrim, "string-trim character-bag string"},
+    {LispFunction, Lisp_StringLeftTrim, "string-left-trim character-bag string"},
+    {LispFunction, Lisp_StringRightTrim, "string-right-trim character-bag string"},
+    {LispFunction, Lisp_StringUpcase, "string-upcase string &key start end"},
+    {LispFunction, Lisp_NstringUpcase, "nstring-upcase string &key start end"},
+    {LispFunction, Lisp_StringDowncase, "string-downcase string &key start end"},
+    {LispFunction, Lisp_NstringDowncase, "nstring-downcase string &key start end"},
+    {LispFunction, Lisp_StringCapitalize, "string-capitalize string &key start end"},
+    {LispFunction, Lisp_NstringCapitalize, "nstring-capitalize string &key start end"},
+    {LispFunction, Lisp_Subseq, "subseq sequence start &optional end"},
+    {LispFunction, Lisp_Subsetp, "subsetp list1 list2 &key test test-not key"},
+    {LispFunction, Lisp_Substitute, "substitute newitem olditem sequence &key from-end test test-not start end count key"},
+    {LispFunction, Lisp_SubstituteIf, "substitute-if newitem test sequence &key from-end start end count key"},
+    {LispFunction, Lisp_SubstituteIfNot, "substitute-if-not newitem test sequence &key from-end start end count key"},
+    {LispFunction, Lisp_SymbolFunction, "symbol-function symbol"},
+    {LispFunction, Lisp_SymbolName, "symbol-name symbol"},
+    {LispFunction, Lisp_Symbolp, "symbolp object"},
+    {LispFunction, Lisp_SymbolPlist, "symbol-plist symbol"},
+    {LispFunction, Lisp_SymbolPackage, "symbol-package symbol"},
+    {LispFunction, Lisp_SymbolValue, "symbol-value symbol"},
+    {LispMacro, Lisp_Tagbody, "tagbody &rest body", 0, 0, Com_Tagbody},
+    {LispFunction, Lisp_Terpri, "terpri &optional output-stream"},
+    {LispFunction, Lisp_Typep, "typep object type"},
+    {LispMacro, Lisp_The, "the value-type form"},
+    {LispMacro, Lisp_Throw, "throw tag result", 1},
+    {LispMacro, Lisp_Time, "time form"},
+    {LispFunction, Lisp_Truename, "truename pathname"},
+    {LispFunction, Lisp_TreeEqual, "tree-equal tree-1 tree-2 &key test test-not"},
+    {LispFunction, Lisp_Truncate, "truncate number &optional divisor", 1},
+    {LispFunction, Lisp_Ftruncate, "ftruncate number &optional divisor", 1},
+    {LispFunction, Lisp_Unexport, "unexport symbols &optional package"},
+    {LispFunction, Lisp_Union, "union list1 list2 &key test test-not key"},
+    {LispFunction, Lisp_Nunion, "nunion list1 list2 &key test test-not key"},
+    {LispMacro, Lisp_Unless, "unless test &rest body", 1, 0, Com_Unless},
+    {LispFunction, Lisp_UserHomedirPathname, "user-homedir-pathname &optional host"},
+    {LispMacro, Lisp_UnwindProtect, "unwind-protect protect &rest cleanup"},
+    {LispFunction, Lisp_UpperCaseP, "upper-case-p character"},
+    {LispFunction, Lisp_Values, "values &rest objects", 1},
+    {LispFunction, Lisp_ValuesList, "values-list list", 1},
+    {LispFunction, Lisp_Vector, "vector &rest objects"},
+    {LispMacro, Lisp_When, "when test &rest body", 1, 0, Com_When},
+    {LispFunction, Lisp_Write, " write object &key case circle escape length level lines pretty readably right-margin stream"},
+    {LispFunction, Lisp_WriteChar, "write-char string &optional output-stream"},
+    {LispFunction, Lisp_WriteLine, "write-line string &optional output-stream &key start end"},
+    {LispFunction, Lisp_WriteString, "write-string string &optional output-stream &key start end"},
+    {LispFunction, Lisp_XeditCharStore, "lisp::char-store string index value", 0, 1},
+    {LispFunction, Lisp_XeditEltStore, "lisp::elt-store sequence index value", 0, 1},
+    {LispFunction, Lisp_XeditMakeStruct, "lisp::make-struct atom &rest init", 0, 1},
+    {LispFunction, Lisp_XeditPut, " lisp::put symbol indicator value", 0, 1},
+    {LispFunction, Lisp_XeditPuthash, "lisp::puthash key hash-table value", 0, 1},
+    {LispFunction, Lisp_XeditSetSymbolPlist, "lisp::set-symbol-plist symbol list", 0, 1},
+    {LispFunction, Lisp_XeditStructAccess, "lisp::struct-access atom struct", 0, 1},
+    {LispFunction, Lisp_XeditStructType, "lisp::struct-type atom struct", 0, 1},
+    {LispFunction, Lisp_XeditStructStore, "lisp::struct-store atom struct value", 0, 1},
+    {LispFunction, Lisp_XeditVectorStore, "lisp::vector-store array &rest values", 0, 1},
+    {LispFunction, Lisp_XeditDocumentationStore, "lisp::documentation-store symbol type string", 0, 1},
+    {LispFunction, Lisp_Zerop, "zerop number"},
+};
+
+static LispBuiltin extbuiltins[] = {
+    {LispFunction, Lisp_Getenv, "getenv name"},
+    {LispFunction, Lisp_MakePipe, "make-pipe command-line &key direction element-type external-format"},
+    {LispFunction, Lisp_PipeBroken, "pipe-broken pipe-stream"},
+    {LispFunction, Lisp_PipeErrorStream, "pipe-error-stream pipe-stream"},
+    {LispFunction, Lisp_PipeInputDescriptor, "pipe-input-descriptor pipe-stream"},
+    {LispFunction, Lisp_PipeErrorDescriptor, "pipe-error-descriptor pipe-stream"},
+    {LispFunction, Lisp_Recomp, "re-comp pattern &key nospec icase nosub newline"},
+    {LispFunction, Lisp_Reexec, "re-exec regex string &key count start end notbol noteol"},
+    {LispFunction, Lisp_Rep, "re-p object"},
+    {LispFunction, Lisp_Setenv, "setenv name value &optional overwrite"},
+    {LispFunction, Lisp_Unsetenv, "unsetenv name"},
+    {LispFunction, Lisp_NstringTrim, "nstring-trim character-bag string"},
+    {LispFunction, Lisp_NstringLeftTrim, "nstring-left-trim character-bag string"},
+    {LispFunction, Lisp_NstringRightTrim, "nstring-right-trim character-bag string"},
+    {LispMacro, Lisp_Until, "until test &rest body", 0, 0, Com_Until},
+    {LispMacro, Lisp_While, "while test &rest body", 0, 0, Com_While},
+};
+
+/* byte code function argument list for functions that don't change it's
+ * &REST argument list. */
+extern LispObj x_cons[8];
+
+/*
+ * Implementation
+ */
+static int
+LispGetPageSize(void)
+{
+    static int pagesize = -1;
+
+    if (pagesize != -1)
+       return pagesize;
+
+    /* Try each supported method in the preferred order */
+
+#if defined(_SC_PAGESIZE) || defined(HAS_SC_PAGESIZE)
+    pagesize = sysconf(_SC_PAGESIZE);
+#endif
+
+#ifdef _SC_PAGE_SIZE
+    if (pagesize == -1)
+       pagesize = sysconf(_SC_PAGE_SIZE);
+#endif
+
+#ifdef HAS_GETPAGESIZE
+    if (pagesize == -1)
+       pagesize = getpagesize();
+#endif
+
+#ifdef PAGE_SIZE
+    if (pagesize == -1)
+       pagesize = PAGE_SIZE;
+#endif
+
+    if (pagesize < sizeof(LispObj) * 16)
+       pagesize = sizeof(LispObj) * 16;        /* need a reasonable sane size */
+
+    return pagesize;
+}
+
+void
+LispDestroy(char *fmt, ...)
+{
+    static char Error[] = "*** ";
+
+    if (!lisp__data.destroyed) {
+       char string[128];
+       va_list ap;
+
+       va_start(ap, fmt);
+       vsnprintf(string, sizeof(string), fmt, ap);
+       va_end(ap);
+
+       if (!lisp__data.ignore_errors) {
+           if (Stderr->column)
+               LispFputc(Stderr, '\n');
+           LispFputs(Stderr, Error);
+           LispFputs(Stderr, string);
+           LispFputc(Stderr, '\n');
+           LispFflush(Stderr);
+       }
+       else
+           lisp__data.error_condition = STRING(string);
+
+#ifdef DEBUGGER
+       if (lisp__data.debugging) {
+           LispDebugger(LispDebugCallWatch, NIL, NIL);
+           LispDebugger(LispDebugCallFatal, NIL, NIL);
+       }
+#endif
+
+       lisp__data.destroyed = 1;
+       LispBlockUnwind(NULL);
+       if (lisp__data.errexit)
+           exit(1);
+    }
+
+#ifdef DEBUGGER
+    if (lisp__data.debugging) {
+       /* when stack variables could be changed, this must be also changed! */
+       lisp__data.debug_level = -1;
+       lisp__data.debug = LispDebugUnspec;
+    }
+#endif
+
+    while (lisp__data.mem.level) {
+       --lisp__data.mem.level;
+       if (lisp__data.mem.mem[lisp__data.mem.level])
+           free(lisp__data.mem.mem[lisp__data.mem.level]);
+    }
+    lisp__data.mem.index = 0;
+
+    /* If the package was changed and an error happened */
+    PACKAGE = lisp__data.savepackage;
+    lisp__data.pack = lisp__data.savepack;
+
+    LispTopLevel();
+
+    if (!lisp__data.running) {
+       static char Fatal[] = "*** Fatal: nowhere to longjmp.\n";
+
+       LispFputs(Stderr, Fatal);
+       LispFflush(Stderr);
+       abort();
+    }
+
+    siglongjmp(lisp__data.jmp, 1);
+}
+
+void
+LispContinuable(char *fmt, ...)
+{
+    va_list ap;
+    char string[128];
+    static char Error[] = "*** Error: ";
+
+    if (Stderr->column)
+       LispFputc(Stderr, '\n');
+    LispFputs(Stderr, Error);
+    va_start(ap, fmt);
+    vsnprintf(string, sizeof(string), fmt, ap);
+    va_end(ap);
+    LispFputs(Stderr, string);
+    LispFputc(Stderr, '\n');
+    LispFputs(Stderr, "Type 'continue' if you want to proceed: ");
+    LispFflush(Stderr);
+
+    /* NOTE: does not check if stdin is a tty */
+    if (LispFgets(Stdin, string, sizeof(string)) &&
+       strcmp(string, "continue\n") == 0)
+       return;
+
+    LispDestroy("aborted on continuable error");
+}
+
+void
+LispMessage(char *fmt, ...)
+{
+    va_list ap;
+    char string[128];
+
+    if (Stderr->column)
+       LispFputc(Stderr, '\n');
+    va_start(ap, fmt);
+    vsnprintf(string, sizeof(string), fmt, ap);
+    va_end(ap);
+    LispFputs(Stderr, string);
+    LispFputc(Stderr, '\n');
+    LispFflush(Stderr);
+}
+
+void
+LispWarning(char *fmt, ...)
+{
+    va_list ap;
+    char string[128];
+    static char Warning[] = "*** Warning: ";
+
+    if (Stderr->column)
+       LispFputc(Stderr, '\n');
+    LispFputs(Stderr, Warning);
+    va_start(ap, fmt);
+    vsnprintf(string, sizeof(string), fmt, ap);
+    va_end(ap);
+    LispFputs(Stderr, string);
+    LispFputc(Stderr, '\n');
+    LispFflush(Stderr);
+}
+
+void
+LispTopLevel(void)
+{
+    int count;
+
+    COD = NIL;
+#ifdef DEBUGGER
+    if (lisp__data.debugging) {
+       DBG = NIL;
+       if (lisp__data.debug == LispDebugFinish)
+           lisp__data.debug = LispDebugUnspec;
+       lisp__data.debug_level = -1;
+       lisp__data.debug_step = 0;
+    }
+#endif
+    gcpro = 0;
+    lisp__data.block.block_level = 0;
+    if (lisp__data.block.block_size) {
+       while (lisp__data.block.block_size)
+           free(lisp__data.block.block[--lisp__data.block.block_size]);
+       free(lisp__data.block.block);
+       lisp__data.block.block = NULL;
+    }
+
+    lisp__data.destroyed = lisp__data.ignore_errors = 0;
+
+    if (CONSP(lisp__data.input_list)) {
+       LispUngetInfo **info, *unget = lisp__data.unget[0];
+
+       while (CONSP(lisp__data.input_list))
+           lisp__data.input_list = CDR(lisp__data.input_list);
+       SINPUT = lisp__data.input_list;
+       while (lisp__data.nunget > 1)
+           free(lisp__data.unget[--lisp__data.nunget]);
+       if ((info = realloc(lisp__data.unget, sizeof(LispUngetInfo*))) != NULL)
+           lisp__data.unget = info;
+       lisp__data.unget[0] = unget;
+       lisp__data.iunget = 0;
+       lisp__data.eof = 0;
+    }
+
+    for (count = 0; lisp__data.mem.level;) {
+       --lisp__data.mem.level;
+       if (lisp__data.mem.mem[lisp__data.mem.level]) {
+           ++count;
+#if 0
+           printf("LEAK: %p\n", lisp__data.mem.mem[lisp__data.mem.level]);
+#endif
+       }
+    }
+    lisp__data.mem.index = 0;
+    if (count)
+       LispWarning("%d raw memory pointer(s) left. Probably a leak.", count);
+
+    lisp__data.stack.base = lisp__data.stack.length =
+       lisp__data.env.lex = lisp__data.env.length = lisp__data.env.head = 0;
+    RETURN_COUNT = 0;
+    lisp__data.protect.length = 0;
+
+    lisp__data.savepackage = PACKAGE;
+    lisp__data.savepack = lisp__data.pack;
+
+    lisp__disable_int = lisp__interrupted = 0;
+}
+
+void
+LispGC(LispObj *car, LispObj *cdr)
+{
+    Lisp__GC(car, cdr);
+}
+
+static void
+Lisp__GC(LispObj *car, LispObj *cdr)
+{
+    register LispObj *entry, *last, *freeobj, **pentry, **eentry;
+    register int nfree;
+    unsigned i, j;
+    LispAtom *atom;
+    struct timeval start, end;
+#ifdef DEBUG
+    long sec, msec;
+    int count = objseg.nfree;
+#else
+    long msec;
+#endif
+
+    if (gcpro)
+       return;
+
+    DISABLE_INTERRUPTS();
+
+    nfree = 0;
+    freeobj = NIL;
+
+    ++lisp__data.gc.count;
+
+#ifdef DEBUG
+    gettimeofday(&start, NULL);
+#else
+    if (lisp__data.gc.timebits)
+       gettimeofday(&start, NULL);
+#endif
+
+    /*  Need to measure timings again to check if it is not better/faster
+     * to just mark these fields as any other data, as the interface was
+     * changed to properly handle circular lists in the function body itself.
+     */
+    if (lisp__data.gc.immutablebits) {
+       for (j = 0; j < objseg.nsegs; j++) {
+           for (entry = objseg.objects[j], last = entry + segsize;
+                entry < last; entry++)
+               entry->prot = 0;
+       }
+    }
+
+    /* Protect all packages */
+    for (entry = PACK; CONSP(entry); entry = CDR(entry)) {
+       LispObj *package = CAR(entry);
+       LispPackage *pack = package->data.package.package;
+
+       /* Protect cons cell */
+       entry->mark = 1;
+
+       /* Protect the package cell */
+       package->mark = 1;
+
+       /* Protect package name */
+       package->data.package.name->mark = 1;
+
+       /* Protect package nicknames */
+       LispMark(package->data.package.nicknames);
+
+       /* Protect global symbols */
+       for (pentry = pack->glb.pairs, eentry = pentry + pack->glb.length;
+           pentry < eentry; pentry++)
+           LispMark((*pentry)->data.atom->property->value);
+
+       /* Traverse atom list, protecting properties, and function/structure
+        * definitions if lisp__data.gc.immutablebits set */
+       for (atom = (LispAtom *)hash_iter_first(pack->atoms);
+            atom;
+            atom = (LispAtom *)hash_iter_next(pack->atoms)) {
+           if (atom->property != NOPROPERTY) {
+               if (atom->a_property)
+                   LispMark(atom->property->properties);
+               if (lisp__data.gc.immutablebits) {
+                   if (atom->a_function || atom->a_compiled)
+                       LispProt(atom->property->fun.function);
+                   if (atom->a_defsetf)
+                       LispProt(atom->property->setf);
+                   if (atom->a_defstruct)
+                       LispProt(atom->property->structure.definition);
+               }
+           }
+       }
+    }
+
+    /* protect environment */
+    for (pentry = lisp__data.env.values,
+        eentry = pentry + lisp__data.env.length;
+        pentry < eentry; pentry++)
+       LispMark(*pentry);
+
+    /* protect multiple return values */
+    for (pentry = lisp__data.returns.values,
+        eentry = pentry + lisp__data.returns.count;
+        pentry < eentry; pentry++)
+       LispMark(*pentry);
+
+    /* protect stack of arguments to builtin functions */
+    for (pentry = lisp__data.stack.values,
+        eentry = pentry + lisp__data.stack.length;
+        pentry < eentry; pentry++)
+       LispMark(*pentry);
+
+    /* protect temporary data used by builtin functions */
+    for (pentry = lisp__data.protect.objects,
+        eentry = pentry + lisp__data.protect.length;
+        pentry < eentry; pentry++)
+       LispMark(*pentry);
+
+    for (i = 0; i < sizeof(x_cons) / sizeof(x_cons[0]); i++)
+       x_cons[i].mark = 0;
+
+    LispMark(COD);
+#ifdef DEBUGGER
+    LispMark(DBG);
+    LispMark(BRK);
+#endif
+    LispMark(PRO);
+    LispMark(lisp__data.input_list);
+    LispMark(lisp__data.output_list);
+    LispMark(car);
+    LispMark(cdr);
+
+    for (j = 0; j < objseg.nsegs; j++) {
+       for (entry = objseg.objects[j], last = entry + segsize;
+            entry < last; entry++) {
+           if (entry->prot)
+               continue;
+           else if (entry->mark)
+               entry->mark = 0;
+           else {
+               switch (XOBJECT_TYPE(entry)) {
+                   case LispString_t:
+                       free(THESTR(entry));
+                       entry->type = LispCons_t;
+                       break;
+                   case LispStream_t:
+                       switch (entry->data.stream.type) {
+                           case LispStreamString:
+                               free(SSTREAMP(entry)->string);
+                               free(SSTREAMP(entry));
+                               break;
+                           case LispStreamFile:
+                               if (FSTREAMP(entry))
+                                   LispFclose(FSTREAMP(entry));
+                               break;
+                           case LispStreamPipe:
+                               /* XXX may need special handling if child hangs */
+                               if (PSTREAMP(entry)) {
+                                   if (IPSTREAMP(entry))
+                                       LispFclose(IPSTREAMP(entry));
+                                   if (OPSTREAMP(entry))
+                                       LispFclose(OPSTREAMP(entry));
+                                   /* don't bother with error stream, will also
+                                    * freed in this GC call, maybe just out
+                                    * of order */
+                                   if (PIDPSTREAMP(entry) > 0) {
+                                       kill(PIDPSTREAMP(entry), SIGTERM);
+                                       waitpid(PIDPSTREAMP(entry), NULL, 0);
+                                   }
+                                   free(PSTREAMP(entry));
+                               }
+                               break;
+                           default:
+                               break;
+                       }
+                       entry->type = LispCons_t;
+                       break;
+                   case LispBignum_t:
+                       mpi_clear(entry->data.mp.integer);
+                       free(entry->data.mp.integer);
+                       entry->type = LispCons_t;
+                       break;
+                   case LispBigratio_t:
+                       mpr_clear(entry->data.mp.ratio);
+                       free(entry->data.mp.ratio);
+                       entry->type = LispCons_t;
+                       break;
+                   case LispLambda_t:
+                       if (!SYMBOLP(entry->data.lambda.name))
+                           LispFreeArgList((LispArgList*)
+                               entry->data.lambda.name->data.opaque.data);
+                       entry->type = LispCons_t;
+                       break;
+                   case LispRegex_t:
+                       refree(entry->data.regex.regex);
+                       free(entry->data.regex.regex);
+                       entry->type = LispCons_t;
+                       break;
+                   case LispBytecode_t:
+                       free(entry->data.bytecode.bytecode->code);
+                       free(entry->data.bytecode.bytecode);
+                       entry->type = LispCons_t;
+                       break;
+                   case LispHashTable_t:
+                       LispFreeHashTable(entry->data.hash.table);
+                       entry->type = LispCons_t;
+                       break;
+                   case LispCons_t:
+                       break;
+                   default:
+                       entry->type = LispCons_t;
+                       break;
+               }
+               CDR(entry) = freeobj;
+               freeobj = entry;
+               ++nfree;
+           }
+       }
+    }
+
+    objseg.nfree = nfree;
+    objseg.freeobj = freeobj;
+
+    lisp__data.gc.immutablebits = 0;
+
+#ifdef DEBUG
+    gettimeofday(&end, NULL);
+    sec = end.tv_sec - start.tv_sec;
+    msec = end.tv_usec - start.tv_usec;
+    if (msec < 0) {
+       --sec;
+       msec += 1000000;
+    }
+    LispMessage("gc: "
+               "%ld sec, %ld msec, "
+               "%d recovered, %d free, %d protected, %d total",
+               sec, msec,
+               objseg.nfree - count, objseg.nfree,
+               objseg.nobjs - objseg.nfree, objseg.nobjs);
+#else
+    if (lisp__data.gc.timebits) {
+       gettimeofday(&end, NULL);
+       if ((msec = end.tv_usec - start.tv_usec) < 0)
+           msec += 1000000;
+       lisp__data.gc.gctime += msec;
+    }
+#endif
+
+    ENABLE_INTERRUPTS();
+}
+
+static INLINE void
+LispCheckMemLevel(void)
+{
+    int i;
+
+    /* Check for a free slot before the end. */
+    for (i = lisp__data.mem.index; i < lisp__data.mem.level; i++)
+       if (lisp__data.mem.mem[i] == NULL) {
+           lisp__data.mem.index = i;
+           return;
+       }
+
+    /* Check for a free slot in the beginning */
+    for (i = 0; i < lisp__data.mem.index; i++)
+       if (lisp__data.mem.mem[i] == NULL) {
+           lisp__data.mem.index = i;
+           return;
+       }
+
+    lisp__data.mem.index = lisp__data.mem.level;
+    ++lisp__data.mem.level;
+    if (lisp__data.mem.index < lisp__data.mem.space)
+       /* There is free space to store pointer. */
+       return;
+    else {
+       void **ptr = (void**)realloc(lisp__data.mem.mem,
+                                    (lisp__data.mem.space + 16) *
+                                    sizeof(void*));
+
+       if (ptr == NULL)
+           LispDestroy("out of memory");
+       lisp__data.mem.mem = ptr;
+       lisp__data.mem.space += 16;
+    }
+}
+
+void
+LispMused(void *pointer)
+{
+    int i;
+
+    DISABLE_INTERRUPTS();
+    for (i = lisp__data.mem.index; i >= 0; i--)
+       if (lisp__data.mem.mem[i] == pointer) {
+           lisp__data.mem.mem[i] = NULL;
+           lisp__data.mem.index = i;
+           goto mused_done;
+       }
+
+    for (i = lisp__data.mem.level - 1; i > lisp__data.mem.index; i--)
+       if (lisp__data.mem.mem[i] == pointer) {
+           lisp__data.mem.mem[i] = NULL;
+           lisp__data.mem.index = i;
+           break;
+       }
+
+mused_done:
+    ENABLE_INTERRUPTS();
+}
+
+void *
+LispMalloc(size_t size)
+{
+    void *pointer;
+
+    DISABLE_INTERRUPTS();
+    LispCheckMemLevel();
+    if ((pointer = malloc(size)) == NULL)
+       LispDestroy("out of memory, couldn't allocate %lu bytes",
+                   (unsigned long)size);
+
+    lisp__data.mem.mem[lisp__data.mem.index] = pointer;
+    ENABLE_INTERRUPTS();
+
+    return (pointer);
+}
+
+void *
+LispCalloc(size_t nmemb, size_t size)
+{
+    void *pointer;
+
+    DISABLE_INTERRUPTS();
+    LispCheckMemLevel();
+    if ((pointer = calloc(nmemb, size)) == NULL)
+       LispDestroy("out of memory, couldn't allocate %lu bytes",
+                   (unsigned long)size);
+
+    lisp__data.mem.mem[lisp__data.mem.index] = pointer;
+    ENABLE_INTERRUPTS();
+
+    return (pointer);
+}
+
+void *
+LispRealloc(void *pointer, size_t size)
+{
+    void *ptr;
+    int i;
+
+    DISABLE_INTERRUPTS();
+    if (pointer != NULL) {
+       for (i = lisp__data.mem.index; i >= 0; i--)
+           if (lisp__data.mem.mem[i] == pointer)
+               goto index_found;
+
+       for (i = lisp__data.mem.index + 1; i < lisp__data.mem.level; i++)
+           if (lisp__data.mem.mem[i] == pointer)
+               goto index_found;
+
+    }
+    LispCheckMemLevel();
+    i = lisp__data.mem.index;
+
+index_found:
+    if ((ptr = realloc(pointer, size)) == NULL)
+       LispDestroy("out of memory, couldn't realloc");
+
+    lisp__data.mem.mem[i] = ptr;
+    ENABLE_INTERRUPTS();
+
+    return (ptr);
+}
+
+char *
+LispStrdup(char *str)
+{
+    char *ptr = LispMalloc(strlen(str) + 1);
+
+    strcpy(ptr, str);
+
+    return (ptr);
+}
+
+void
+LispFree(void *pointer)
+{
+    int i;
+
+    DISABLE_INTERRUPTS();
+    for (i = lisp__data.mem.index; i >= 0; i--)
+       if (lisp__data.mem.mem[i] == pointer) {
+           lisp__data.mem.mem[i] = NULL;
+           lisp__data.mem.index = i;
+           goto free_done;
+       }
+
+    for (i = lisp__data.mem.level - 1; i > lisp__data.mem.index; i--)
+       if (lisp__data.mem.mem[i] == pointer) {
+           lisp__data.mem.mem[i] = NULL;
+           lisp__data.mem.index = i;
+           break;
+       }
+
+free_done:
+    free(pointer);
+    ENABLE_INTERRUPTS();
+}
+
+LispObj *
+LispSetVariable(LispObj *var, LispObj *val, char *fname, int eval)
+{
+    if (!SYMBOLP(var))
+       LispDestroy("%s: %s is not a symbol", fname, STROBJ(var));
+    if (eval)
+       val = EVAL(val);
+
+    return (LispSetVar(var, val));
+}
+
+int
+LispRegisterOpaqueType(char *desc)
+{
+    int length;
+    LispOpaque *opaque;
+
+    length = strlen(desc);
+    opaque = (LispOpaque *)hash_check(lisp__data.opqs, desc, length);
+
+    if (opaque == NULL) {
+       opaque = (LispOpaque*)LispMalloc(sizeof(LispOpaque));
+       opaque->desc = (hash_key*)LispCalloc(1, sizeof(hash_key));
+       opaque->desc->value = LispStrdup(desc);
+       opaque->desc->length = length;
+       hash_put(lisp__data.opqs, (hash_entry *)opaque);
+       LispMused(opaque->desc->value);
+       LispMused(opaque->desc);
+       LispMused(opaque);
+       opaque->type = ++lisp__data.opaque;
+    }
+
+    return (opaque->type);
+}
+
+char *
+LispIntToOpaqueType(int type)
+{
+    LispOpaque *opaque;
+
+    if (type) {
+       for (opaque = (LispOpaque *)hash_iter_first(lisp__data.opqs);
+            opaque;
+            opaque = (LispOpaque *)hash_iter_next(lisp__data.opqs)) {
+           if (opaque->type == type)
+               return (opaque->desc->value);
+       }
+       LispDestroy("Opaque type %d not registered", type);
+    }
+
+    return (Snil->value);
+}
+
+hash_key *
+LispGetAtomKey(char *string, int perm)
+{
+    int length;
+    hash_entry *entry;
+
+    length = strlen(string);
+    entry = hash_check(lisp__data.strings, string, length);
+    if (entry == NULL) {
+       entry = LispCalloc(1, sizeof(hash_entry));
+       entry->key = LispCalloc(1, sizeof(hash_key));
+       if (perm)
+           entry->key->value = string;
+       else
+           entry->key->value = LispStrdup(string);
+       entry->key->length = length;
+
+       hash_put(lisp__data.strings, entry);
+       if (!perm)
+           LispMused(entry->key->value);
+       LispMused(entry->key);
+       LispMused(entry);
+    }
+
+    return (entry->key);
+}
+
+LispAtom *
+LispDoGetAtom(char *str, int perm)
+{
+    int length;
+    LispAtom *atom;
+
+    length = strlen(str);
+    atom = (LispAtom *)hash_check(lisp__data.pack->atoms, str, length);
+
+    if (atom == NULL) {
+       atom = (LispAtom*)LispCalloc(1, sizeof(LispAtom));
+       atom->key = LispGetAtomKey(str, perm);
+       hash_put(lisp__data.pack->atoms, (hash_entry *)atom);
+       atom->property = NOPROPERTY;
+       LispMused(atom);
+    }
+
+    return (atom);
+}
+
+static void
+LispAllocAtomProperty(LispAtom *atom)
+{
+    LispProperty *property;
+
+    if (atom->property != NOPROPERTY)
+       LispDestroy("internal error at ALLOC-ATOM-PROPERTY");
+
+    property = LispCalloc(1, sizeof(LispProperty));
+    LispMused(property);
+    atom->property = property;
+    property->package = lisp__data.pack;
+    if (atom->package == NULL)
+       atom->package = PACKAGE;
+
+    LispIncrementAtomReference(atom);
+}
+
+static void
+LispIncrementAtomReference(LispAtom *atom)
+{
+    if (atom->property != NOPROPERTY)
+       /* if atom->property is NOPROPERTY, this is an unbound symbol */
+       ++atom->property->refcount;
+}
+
+/* Assumes atom property is not NOPROPERTY */
+static void
+LispDecrementAtomReference(LispAtom *atom)
+{
+    if (atom->property == NOPROPERTY)
+       /* if atom->property is NOPROPERTY, this is an unbound symbol */
+       return;
+
+    if (atom->property->refcount <= 0)
+       LispDestroy("internal error at DECREMENT-ATOM-REFERENCE");
+
+    --atom->property->refcount;
+
+    if (atom->property->refcount == 0) {
+       LispRemAtomAllProperties(atom);
+       free(atom->property);
+       atom->property = NOPROPERTY;
+    }
+}
+
+static void
+LispRemAtomAllProperties(LispAtom *atom)
+{
+    if (atom->property != NOPROPERTY) {
+       if (atom->a_object)
+           LispRemAtomObjectProperty(atom);
+       if (atom->a_function) {
+           lisp__data.gc.immutablebits = 1;
+           LispRemAtomFunctionProperty(atom);
+       }
+       else if (atom->a_compiled) {
+           lisp__data.gc.immutablebits = 1;
+           LispRemAtomCompiledProperty(atom);
+       }
+       else if (atom->a_builtin) {
+           lisp__data.gc.immutablebits = 1;
+           LispRemAtomBuiltinProperty(atom);
+       }
+       if (atom->a_defsetf) {
+           lisp__data.gc.immutablebits = 1;
+           LispRemAtomSetfProperty(atom);
+       }
+       if (atom->a_defstruct) {
+           lisp__data.gc.immutablebits = 1;
+           LispRemAtomStructProperty(atom);
+       }
+    }
+}
+
+void
+LispSetAtomObjectProperty(LispAtom *atom, LispObj *object)
+{
+    if (atom->property == NOPROPERTY)
+       LispAllocAtomProperty(atom);
+    else if (atom->watch) {
+       if (atom->object == lisp__data.package) {
+           if (!PACKAGEP(object))
+               LispDestroy("Symbol %s must be a package, not %s",
+                           ATOMID(lisp__data.package)->value, STROBJ(object));
+           lisp__data.pack = object->data.package.package;
+       }
+    }
+
+    atom->a_object = 1;
+    SETVALUE(atom, object);
+}
+
+static void
+LispRemAtomObjectProperty(LispAtom *atom)
+{
+    if (atom->a_object) {
+       atom->a_object = 0;
+       atom->property->value = NULL;
+    }
+}
+
+void
+LispSetAtomCompiledProperty(LispAtom *atom, LispObj *bytecode)
+{
+    if (atom->property == NOPROPERTY)
+       LispAllocAtomProperty(atom);
+
+    lisp__data.gc.immutablebits = 1;
+    if (atom->a_builtin) {
+       atom->a_builtin = 0;
+       LispFreeArgList(atom->property->alist);
+    }
+    else
+       atom->a_function = 0;
+    atom->a_compiled = 1;
+    atom->property->fun.function = bytecode;
+}
+
+void
+LispRemAtomCompiledProperty(LispAtom *atom)
+{
+    if (atom->a_compiled) {
+       lisp__data.gc.immutablebits = 1;
+       atom->property->fun.function = NULL;
+       atom->a_compiled = 0;
+       LispFreeArgList(atom->property->alist);
+       atom->property->alist = NULL;
+    }
+}
+
+void
+LispSetAtomFunctionProperty(LispAtom *atom, LispObj *function,
+                           LispArgList *alist)
+{
+    if (atom->property == NOPROPERTY)
+       LispAllocAtomProperty(atom);
+
+    lisp__data.gc.immutablebits = 1;
+    if (atom->a_function == 0 && atom->a_builtin == 0 && atom->a_compiled == 0)
+       atom->a_function = 1;
+    else {
+       if (atom->a_builtin) {
+           atom->a_builtin = 0;
+           LispFreeArgList(atom->property->alist);
+       }
+       else
+           atom->a_compiled = 0;
+       atom->a_function = 1;
+    }
+
+    atom->property->fun.function = function;
+    atom->property->alist = alist;
+}
+
+void
+LispRemAtomFunctionProperty(LispAtom *atom)
+{
+    if (atom->a_function) {
+       lisp__data.gc.immutablebits = 1;
+       atom->property->fun.function = NULL;
+       atom->a_function = 0;
+       LispFreeArgList(atom->property->alist);
+       atom->property->alist = NULL;
+    }
+}
+
+void
+LispSetAtomBuiltinProperty(LispAtom *atom, LispBuiltin *builtin,
+                          LispArgList *alist)
+{
+    if (atom->property == NOPROPERTY)
+       LispAllocAtomProperty(atom);
+
+    lisp__data.gc.immutablebits = 1;
+    if (atom->a_builtin == 0 && atom->a_function == 0)
+       atom->a_builtin = 1;
+    else {
+       if (atom->a_function) {
+           atom->a_function = 0;
+           LispFreeArgList(atom->property->alist);
+       }
+    }
+
+    atom->property->fun.builtin = builtin;
+    atom->property->alist = alist;
+}
+
+void
+LispRemAtomBuiltinProperty(LispAtom *atom)
+{
+    if (atom->a_builtin) {
+       lisp__data.gc.immutablebits = 1;
+       atom->property->fun.function = NULL;
+       atom->a_builtin = 0;
+       LispFreeArgList(atom->property->alist);
+       atom->property->alist = NULL;
+    }
+}
+
+void
+LispSetAtomSetfProperty(LispAtom *atom, LispObj *setf, LispArgList *alist)
+{
+    if (atom->property == NOPROPERTY)
+       LispAllocAtomProperty(atom);
+
+    lisp__data.gc.immutablebits = 1;
+    if (atom->a_defsetf)
+       LispFreeArgList(atom->property->salist);
+
+    atom->a_defsetf = 1;
+    atom->property->setf = setf;
+    atom->property->salist = alist;
+}
+
+void
+LispRemAtomSetfProperty(LispAtom *atom)
+{
+    if (atom->a_defsetf) {
+       lisp__data.gc.immutablebits = 1;
+       atom->property->setf = NULL;
+       atom->a_defsetf = 0;
+       LispFreeArgList(atom->property->salist);
+       atom->property->salist = NULL;
+    }
+}
+
+void
+LispSetAtomStructProperty(LispAtom *atom, LispObj *def, int fun)
+{
+    if (fun > 0xff)
+       /* Not suported by the bytecode compiler... */
+       LispDestroy("SET-ATOM-STRUCT-PROPERTY: "
+                   "more than 256 fields not supported");
+
+    if (atom->property == NOPROPERTY)
+       LispAllocAtomProperty(atom);
+
+    lisp__data.gc.immutablebits = 1;
+    atom->a_defstruct = 1;
+    atom->property->structure.definition = def;
+    atom->property->structure.function = fun;
+}
+
+void
+LispRemAtomStructProperty(LispAtom *atom)
+{
+    if (atom->a_defstruct) {
+       lisp__data.gc.immutablebits = 1;
+       atom->property->structure.definition = NULL;
+       atom->a_defstruct = 0;
+    }
+}
+
+LispAtom *
+LispGetAtom(char *str)
+{
+    return (LispDoGetAtom(str, 0));
+}
+
+LispAtom *
+LispGetPermAtom(char *str)
+{
+    return (LispDoGetAtom(str, 1));
+}
+
+#define GET_PROPERTY   0
+#define ADD_PROPERTY   1
+#define REM_PROPERTY   2
+static LispObj *
+LispAtomPropertyFunction(LispAtom *atom, LispObj *key, int function)
+{
+    LispObj *list = NIL, *result = NIL;
+
+    if (function == ADD_PROPERTY) {
+       if (atom->property == NOPROPERTY)
+           LispAllocAtomProperty(atom);
+       if (atom->property->properties == NULL) {
+           atom->a_property = 1;
+           atom->property->properties = NIL;
+       }
+    }
+
+    if (atom->a_property) {
+       LispObj *base;
+
+       for (base = list = atom->property->properties;
+            CONSP(list);
+            list = CDR(list)) {
+           if (key == CAR(list)) {
+               result = CDR(list);
+               break;
+           }
+           base = list;
+           list = CDR(list);
+           if (!CONSP(list))
+               LispDestroy("%s: %s has an odd property list length",
+                           STROBJ(atom->object),
+                           function == REM_PROPERTY ? "REMPROP" : "GET");
+       }
+       if (CONSP(list) && function == REM_PROPERTY) {
+           if (!CONSP(CDR(list)))
+               LispDestroy("REMPROP: %s has an odd property list length",
+                           STROBJ(atom->object));
+           if (base == list)
+               atom->property->properties = CDDR(list);
+           else
+               RPLACD(CDR(base), CDDR(list));
+       }
+    }
+
+    if (!CONSP(list)) {
+       if (function == ADD_PROPERTY) {
+           atom->property->properties =
+               CONS(key, CONS(NIL, atom->property->properties));
+           result = CDR(atom->property->properties);
+       }
+    }
+    else if (function == REM_PROPERTY)
+       result = T;
+
+    return (result);
+}
+
+LispObj *
+LispGetAtomProperty(LispAtom *atom, LispObj *key)
+{
+    return (LispAtomPropertyFunction(atom, key, GET_PROPERTY));
+}
+
+LispObj *
+LispPutAtomProperty(LispAtom *atom, LispObj *key, LispObj *value)
+{
+    LispObj *result = LispAtomPropertyFunction(atom, key, ADD_PROPERTY);
+
+    RPLACA(result, value);
+
+    return (result);
+}
+
+LispObj *
+LispRemAtomProperty(LispAtom *atom, LispObj *key)
+{
+    return (LispAtomPropertyFunction(atom, key, REM_PROPERTY));
+}
+
+LispObj *
+LispReplaceAtomPropertyList(LispAtom *atom, LispObj *list)
+{
+    if (atom->property == NOPROPERTY)
+       LispAllocAtomProperty(atom);
+    if (atom->property->properties == NULL)
+       atom->a_property = 1;
+    atom->property->properties = list;
+
+    return (list);
+}
+#undef GET_PROPERTY
+#undef ADD_PROPERTY
+#undef REM_PROPERTY
+
+
+/* Used to make sure that when defining a function like:
+ *     (defun my-function (... &key key1 key2 key3 ...)
+ * key1, key2, and key3 will be in the keyword package
+ */
+static LispObj *
+LispCheckKeyword(LispObj *keyword)
+{
+    if (KEYWORDP(keyword))
+       return (keyword);
+
+    return (KEYWORD(ATOMID(keyword)->value));
+}
+
+void
+LispUseArgList(LispArgList *alist)
+{
+    if (alist->normals.num_symbols)
+       LispMused(alist->normals.symbols);
+    if (alist->optionals.num_symbols) {
+       LispMused(alist->optionals.symbols);
+       LispMused(alist->optionals.defaults);
+       LispMused(alist->optionals.sforms);
+    }
+    if (alist->keys.num_symbols) {
+       LispMused(alist->keys.symbols);
+       LispMused(alist->keys.defaults);
+       LispMused(alist->keys.sforms);
+       LispMused(alist->keys.keys);
+    }
+    if (alist->auxs.num_symbols) {
+       LispMused(alist->auxs.symbols);
+       LispMused(alist->auxs.initials);
+    }
+    LispMused(alist);
+}
+
+void
+LispFreeArgList(LispArgList *alist)
+{
+    if (alist->normals.num_symbols)
+       LispFree(alist->normals.symbols);
+    if (alist->optionals.num_symbols) {
+       LispFree(alist->optionals.symbols);
+       LispFree(alist->optionals.defaults);
+       LispFree(alist->optionals.sforms);
+    }
+    if (alist->keys.num_symbols) {
+       LispFree(alist->keys.symbols);
+       LispFree(alist->keys.defaults);
+       LispFree(alist->keys.sforms);
+       LispFree(alist->keys.keys);
+    }
+    if (alist->auxs.num_symbols) {
+       LispFree(alist->auxs.symbols);
+       LispFree(alist->auxs.initials);
+    }
+    LispFree(alist);
+}
+
+static LispObj *
+LispCheckNeedProtect(LispObj *object)
+{
+    if (object) {
+       switch (OBJECT_TYPE(object)) {
+           case LispNil_t:
+           case LispAtom_t:
+           case LispFunction_t:
+           case LispFixnum_t:
+           case LispSChar_t:
+               return (NULL);
+           default:
+               return (object);
+       }
+    }
+    return (NULL);
+}
+
+LispObj *
+LispListProtectedArguments(LispArgList *alist)
+{
+    int i;
+    GC_ENTER();
+    LispObj *arguments, *cons, *obj, *prev;
+
+    arguments = cons = prev = NIL;
+    for (i = 0; i < alist->optionals.num_symbols; i++) {
+       if ((obj = LispCheckNeedProtect(alist->optionals.defaults[i])) != NULL) {
+           if (arguments == NIL) {
+               arguments = cons = prev = CONS(obj, NIL);
+               GC_PROTECT(arguments);
+           }
+           else {
+               RPLACD(cons, CONS(obj, NIL));
+               prev = cons;
+               cons = CDR(cons);
+           }
+       }
+    }
+    for (i = 0; i < alist->keys.num_symbols; i++) {
+       if ((obj = LispCheckNeedProtect(alist->keys.defaults[i])) != NULL) {
+           if (arguments == NIL) {
+               arguments = cons = prev = CONS(obj, NIL);
+               GC_PROTECT(arguments);
+           }
+           else {
+               RPLACD(cons, CONS(obj, NIL));
+               prev = cons;
+               cons = CDR(cons);
+           }
+       }
+    }
+    for (i = 0; i < alist->auxs.num_symbols; i++) {
+       if ((obj = LispCheckNeedProtect(alist->auxs.initials[i])) != NULL) {
+           if (arguments == NIL) {
+               arguments = cons = prev = CONS(obj, NIL);
+               GC_PROTECT(arguments);
+           }
+           else {
+               RPLACD(cons, CONS(obj, NIL));
+               prev = cons;
+               cons = CDR(cons);
+           }
+       }
+    }
+    GC_LEAVE();
+
+    /* Don't add a NIL cell at the end, to save some space */
+    if (arguments != NIL) {
+       if (arguments == cons)
+           arguments = CAR(cons);
+       else
+           CDR(prev) = CAR(cons);
+    }
+
+    return (arguments);
+}
+
+LispArgList *
+LispCheckArguments(LispFunType type, LispObj *list, char *name, int builtin)
+{
+    static char *types[4] = {"LAMBDA-LIST", "FUNCTION", "MACRO", "SETF-METHOD"};
+    static char *fnames[4] = {"LAMBDA", "DEFUN", "DEFMACRO", "DEFSETF"};
+#define IKEY           0
+#define IOPTIONAL      1
+#define IREST          2
+#define IAUX           3
+    static char *keys[4] = {"&KEY", "&OPTIONAL", "&REST", "&AUX"};
+    int rest, optional, key, aux, count;
+    LispArgList *alist;
+    LispObj *spec, *sform, *defval, *default_value;
+    char description[8], *desc;
+
+/* If LispRealloc fails, the previous memory will be released
+ * in LispTopLevel, unless LispMused was called on the pointer */
+#define REALLOC_OBJECTS(pointer, count)                \
+    pointer = LispRealloc(pointer, (count) * sizeof(LispObj*))
+
+    alist = LispCalloc(1, sizeof(LispArgList));
+    if (!CONSP(list)) {
+       if (list != NIL)
+           LispDestroy("%s %s: %s cannot be a %s argument list",
+                       fnames[type], name, STROBJ(list), types[type]);
+       alist->description = GETATOMID("")->value;
+
+       return (alist);
+    }
+
+    default_value = builtin ? UNSPEC : NIL;
+
+    description[0] = '\0';
+    desc = description;
+    rest = optional = key = aux = 0;
+    for (; CONSP(list); list = CDR(list)) {
+       spec = CAR(list);
+
+       if (CONSP(spec)) {
+           if (builtin)
+               LispDestroy("builtin function argument cannot have default value");
+           if (aux) {
+               if (!SYMBOLP(CAR(spec)) ||
+                   (CDR(spec) != NIL && CDDR(spec) != NIL))
+                   LispDestroy("%s %s: bad &AUX argument %s",
+                               fnames[type], name, STROBJ(spec));
+               defval = CDR(spec) != NIL ? CADR(spec) : NIL;
+               count = alist->auxs.num_symbols;
+               REALLOC_OBJECTS(alist->auxs.symbols, count + 1);
+               REALLOC_OBJECTS(alist->auxs.initials, count + 1);
+               alist->auxs.symbols[count] = CAR(spec);
+               alist->auxs.initials[count] = defval;
+               ++alist->auxs.num_symbols;
+               if (count == 0)
+                   *desc++ = 'a';
+               ++alist->num_arguments;
+           }
+           else if (rest)
+               LispDestroy("%s %s: syntax error parsing %s",
+                           fnames[type], name, keys[IREST]);
+           else if (key) {
+               LispObj *akey = CAR(spec);
+
+               defval = default_value;
+               sform = NULL;
+               if (CONSP(akey)) {
+                   /* check for special case, as in:
+                    *  (defun a (&key ((key name) 'default-value)) name)
+                    *  (a 'key 'test)  => TEST
+                    *  (a)             => DEFAULT-VALUE
+                    */
+                   if (!SYMBOLP(CAR(akey)) || !CONSP(CDR(akey)) ||
+                       !SYMBOLP(CADR(akey)) || CDDR(akey) != NIL ||
+                       (CDR(spec) != NIL && CDDR(spec) != NIL))
+                       LispDestroy("%s %s: bad special &KEY %s",
+                                   fnames[type], name, STROBJ(spec));
+                   if (CDR(spec) != NIL)
+                       defval = CADR(spec);
+                   spec = CADR(akey);
+                   akey = CAR(akey);
+               }
+               else {
+                   akey = NULL;
+
+                   if (!SYMBOLP(CAR(spec)))
+                       LispDestroy("%s %s: %s cannot be a %s argument name",
+                                   fnames[type], name,
+                                   STROBJ(CAR(spec)), types[type]);
+                   /* check if default value provided, and optionally a `svar' */
+                   else if (CDR(spec) != NIL && (!CONSP(CDR(spec)) ||
+                             (CDDR(spec) != NIL &&
+                              (!SYMBOLP(CAR(CDDR(spec))) ||
+                               CDR(CDDR(spec)) != NIL))))
+                       LispDestroy("%s %s: bad argument specification %s",
+                                   fnames[type], name, STROBJ(spec));
+                   if (CONSP(CDR(spec))) {
+                       defval = CADR(spec);
+                       if (CONSP(CDDR(spec)))
+                           sform = CAR(CDDR(spec));
+                   }
+                   /* Add to keyword package, and set the keyword in the
+                    * argument list, so that a function argument keyword
+                    * will reference the same object, and make comparison
+                    * simpler. */
+                   spec = LispCheckKeyword(CAR(spec));
+               }
+
+               count = alist->keys.num_symbols;
+               REALLOC_OBJECTS(alist->keys.keys, count + 1);
+               REALLOC_OBJECTS(alist->keys.defaults, count + 1);
+               REALLOC_OBJECTS(alist->keys.sforms, count + 1);
+               REALLOC_OBJECTS(alist->keys.symbols, count + 1);
+               alist->keys.symbols[count] = spec;
+               alist->keys.defaults[count] = defval;
+               alist->keys.sforms[count] = sform;
+               alist->keys.keys[count] = akey;
+               ++alist->keys.num_symbols;
+               if (count == 0)
+                   *desc++ = 'k';
+               alist->num_arguments += 1 + (sform != NULL);
+           }
+           else if (optional) {
+               defval = default_value;
+               sform = NULL;
+
+               if (!SYMBOLP(CAR(spec)))
+                   LispDestroy("%s %s: %s cannot be a %s argument name",
+                               fnames[type], name,
+                               STROBJ(CAR(spec)), types[type]);
+               /* check if default value provided, and optionally a `svar' */
+               else if (CDR(spec) != NIL && (!CONSP(CDR(spec)) ||
+                         (CDDR(spec) != NIL &&
+                          (!SYMBOLP(CAR(CDDR(spec))) ||
+                           CDR(CDDR(spec)) != NIL))))
+                   LispDestroy("%s %s: bad argument specification %s",
+                               fnames[type], name, STROBJ(spec));
+               if (CONSP(CDR(spec))) {
+                   defval = CADR(spec);
+                   if (CONSP(CDDR(spec)))
+                       sform = CAR(CDDR(spec));
+               }
+               spec = CAR(spec);
+
+               count = alist->optionals.num_symbols;
+               REALLOC_OBJECTS(alist->optionals.symbols, count + 1);
+               REALLOC_OBJECTS(alist->optionals.defaults, count + 1);
+               REALLOC_OBJECTS(alist->optionals.sforms, count + 1);
+               alist->optionals.symbols[count] = spec;
+               alist->optionals.defaults[count] = defval;
+               alist->optionals.sforms[count] = sform;
+               ++alist->optionals.num_symbols;
+               if (count == 0)
+                   *desc++ = 'o';
+               alist->num_arguments += 1 + (sform != NULL);
+           }
+
+           /* Normal arguments cannot have default value */
+           else
+               LispDestroy("%s %s: syntax error parsing %s",
+                           fnames[type], name, STROBJ(spec));
+       }
+
+       /* spec must be an atom, excluding keywords */
+       else if (!SYMBOLP(spec) || KEYWORDP(spec))
+           LispDestroy("%s %s: %s cannot be a %s argument",
+                       fnames[type], name, STROBJ(spec), types[type]);
+       else {
+           Atom_id atom = ATOMID(spec);
+
+           if (atom->value[0] == '&') {
+               if (atom == Srest) {
+                   if (rest || aux || CDR(list) == NIL || !SYMBOLP(CADR(list))
+                       /* only &aux allowed after &rest */
+                       || (CDDR(list) != NIL && !SYMBOLP(CAR(CDDR(list))) &&
+                           ATOMID(CAR(CDDR(list))) != Saux))
+                       LispDestroy("%s %s: syntax error parsing %s",
+                                   fnames[type], name, ATOMID(spec)->value);
+                   if (key)
+                       LispDestroy("%s %s: %s not allowed after %s",
+                                   fnames[type], name, keys[IREST], keys[IKEY]);
+                   rest = 1;
+                   continue;
+               }
+
+               else if (atom == Skey) {
+                   if (rest || aux)
+                       LispDestroy("%s %s: %s not allowed after %s",
+                                   fnames[type], name, ATOMID(spec)->value,
+                                   rest ? keys[IREST] : keys[IAUX]);
+                   key = 1;
+                   continue;
+               }
+
+               else if (atom == Soptional) {
+                   if (rest || optional || aux || key)
+                       LispDestroy("%s %s: %s not allowed after %s",
+                                   fnames[type], name, ATOMID(spec)->value,
+                                   rest ? keys[IREST] :
+                                       optional ?
+                                       keys[IOPTIONAL] :
+                                           aux ? keys[IAUX] : keys[IKEY]);
+                   optional = 1;
+                   continue;
+               }
+
+               else if (atom == Saux) {
+                   /* &AUX must be the last keyword parameter */
+                   if (aux)
+                       LispDestroy("%s %s: syntax error parsing %s",
+                                   fnames[type], name, ATOMID(spec)->value);
+                   else if (builtin)
+                       LispDestroy("builtin function cannot have &AUX arguments");
+                   aux = 1;
+                   continue;
+               }
+
+               /* Untill more lambda-list keywords supported, don't allow
+                * argument names starting with the '&' character */
+               else
+                   LispDestroy("%s %s: %s not allowed/implemented",
+                               fnames[type], name, ATOMID(spec)->value);
+           }
+
+           /* Add argument to alist */
+           if (aux) {
+               count = alist->auxs.num_symbols;
+               REALLOC_OBJECTS(alist->auxs.symbols, count + 1);
+               REALLOC_OBJECTS(alist->auxs.initials, count + 1);
+               alist->auxs.symbols[count] = spec;
+               alist->auxs.initials[count] = default_value;
+               ++alist->auxs.num_symbols;
+               if (count == 0)
+                   *desc++ = 'a';
+               ++alist->num_arguments;
+           }
+           else if (rest) {
+               alist->rest = spec;
+               *desc++ = 'r';
+               ++alist->num_arguments;
+           }
+           else if (key) {
+               /* Add to keyword package, and set the keyword in the
+                * argument list, so that a function argument keyword
+                * will reference the same object, and make comparison
+                * simpler. */
+               spec = LispCheckKeyword(spec);
+               count = alist->keys.num_symbols;
+               REALLOC_OBJECTS(alist->keys.keys, count + 1);
+               REALLOC_OBJECTS(alist->keys.defaults, count + 1);
+               REALLOC_OBJECTS(alist->keys.sforms, count + 1);
+               REALLOC_OBJECTS(alist->keys.symbols, count + 1);
+               alist->keys.symbols[count] = spec;
+               alist->keys.defaults[count] = default_value;
+               alist->keys.sforms[count] = NULL;
+               alist->keys.keys[count] = NULL;
+               ++alist->keys.num_symbols;
+               if (count == 0)
+                   *desc++ = 'k';
+               ++alist->num_arguments;
+           }
+           else if (optional) {
+               count = alist->optionals.num_symbols;
+               REALLOC_OBJECTS(alist->optionals.symbols, count + 1);
+               REALLOC_OBJECTS(alist->optionals.defaults, count + 1);
+               REALLOC_OBJECTS(alist->optionals.sforms, count + 1);
+               alist->optionals.symbols[count] = spec;
+               alist->optionals.defaults[count] = default_value;
+               alist->optionals.sforms[count] = NULL;
+               ++alist->optionals.num_symbols;
+               if (count == 0)
+                   *desc++ = 'o';
+               ++alist->num_arguments;
+           }
+           else {
+               count = alist->normals.num_symbols;
+               REALLOC_OBJECTS(alist->normals.symbols, count + 1);
+               alist->normals.symbols[count] = spec;
+               ++alist->normals.num_symbols;
+               if (count == 0)
+                   *desc++ = '.';
+               ++alist->num_arguments;
+           }
+       }
+    }
+
+    /* Check for dotted argument list */
+    if (list != NIL)
+       LispDestroy("%s %s: %s cannot end %s arguments",
+                   fnames[type], name, STROBJ(list), types[type]);
+
+    *desc = '\0';
+    alist->description = LispGetAtomKey(description, 0)->value;
+
+    return (alist);
+}
+
+void
+LispAddBuiltinFunction(LispBuiltin *builtin)
+{
+    static LispObj stream;
+    static LispString string;
+    static int first = 1;
+    LispObj *name, *obj, *list, *cons, *code;
+    LispAtom *atom;
+    LispArgList *alist;
+    int length = lisp__data.protect.length;
+
+    if (first) {
+       stream.type = LispStream_t;
+       stream.data.stream.source.string = &string;
+       stream.data.stream.pathname = NIL;
+       stream.data.stream.type = LispStreamString;
+       stream.data.stream.readable = 1;
+       stream.data.stream.writable = 0;
+       string.output = 0;
+       first = 0;
+    }
+    string.string = builtin->declaration;
+    string.length = strlen(builtin->declaration);
+    string.input = 0;
+
+    code = COD;
+    LispPushInput(&stream);
+    name = LispRead();
+    list = cons = CONS(name, NIL);
+    if (length + 1 >= lisp__data.protect.space)
+       LispMoreProtects();
+    lisp__data.protect.objects[lisp__data.protect.length++] = list;
+    while ((obj = LispRead()) != NULL) {
+       RPLACD(cons, CONS(obj, NIL));
+       cons = CDR(cons);
+    }
+    LispPopInput(&stream);
+
+    atom = name->data.atom;
+    alist = LispCheckArguments(builtin->type, CDR(list), atom->key->value, 1);
+    builtin->symbol = CAR(list);
+    LispSetAtomBuiltinProperty(atom, builtin, alist);
+    LispUseArgList(alist);
+
+    /* Make function a extern symbol, unless told to not do so */
+    if (!builtin->internal)
+       LispExportSymbol(name);
+
+    lisp__data.protect.length = length;
+    COD = code;                        /* LispRead protect data in COD */
+}
+
+void
+LispAllocSeg(LispObjSeg *seg, int cellcount)
+{
+    unsigned int i;
+    LispObj **list, *obj;
+
+    DISABLE_INTERRUPTS();
+    while (seg->nfree < cellcount) {
+       if ((obj = (LispObj*)calloc(1, sizeof(LispObj) * segsize)) == NULL) {
+           ENABLE_INTERRUPTS();
+           LispDestroy("out of memory");
+       }
+       if ((list = (LispObj**)realloc(seg->objects,
+           sizeof(LispObj*) * (seg->nsegs + 1))) == NULL) {
+           free(obj);
+           ENABLE_INTERRUPTS();
+           LispDestroy("out of memory");
+       }
+       seg->objects = list;
+       seg->objects[seg->nsegs] = obj;
+
+       seg->nfree += segsize;
+       seg->nobjs += segsize;
+       for (i = 1; i < segsize; i++, obj++) {
+           /* Objects of type cons are the most used, save some time
+            * by not setting it's type in LispNewCons. */
+           obj->type = LispCons_t;
+           CDR(obj) = obj + 1;
+       }
+       obj->type = LispCons_t;
+       CDR(obj) = seg->freeobj;
+       seg->freeobj = seg->objects[seg->nsegs];
+       ++seg->nsegs;
+    }
+#ifdef DEBUG
+    LispMessage("gc: %d cell(s) allocated at %d segment(s)",
+               seg->nobjs, seg->nsegs);
+#endif
+    ENABLE_INTERRUPTS();
+}
+
+static INLINE void
+LispMark(register LispObj *object)
+{
+mark_again:
+    switch (OBJECT_TYPE(object)) {
+       case LispNil_t:
+       case LispAtom_t:
+       case LispFixnum_t:
+       case LispSChar_t:
+       case LispFunction_t:
+           return;
+       case LispLambda_t:
+           if (OPAQUEP(object->data.lambda.name))
+               object->data.lambda.name->mark = 1;
+           object->mark = 1;
+           LispMark(object->data.lambda.data);
+           object = object->data.lambda.code;
+           goto mark_cons;
+       case LispQuote_t:
+       case LispBackquote_t:
+       case LispFunctionQuote_t:
+           object->mark = 1;
+           object = object->data.quote;
+           goto mark_again;
+       case LispPathname_t:
+           object->mark = 1;
+           object = object->data.pathname;
+           goto mark_again;
+       case LispComma_t:
+           object->mark = 1;
+           object = object->data.comma.eval;
+           goto mark_again;
+       case LispComplex_t:
+           if (POINTERP(object->data.complex.real))
+               object->data.complex.real->mark = 1;
+           if (POINTERP(object->data.complex.imag))
+               object->data.complex.imag->mark = 1;
+           break;
+       case LispCons_t:
+mark_cons:
+           for (; CONSP(object) && !object->mark; object = CDR(object)) {
+               object->mark = 1;
+               switch (OBJECT_TYPE(CAR(object))) {
+                   case LispNil_t:
+                   case LispAtom_t:
+                   case LispFixnum_t:
+                   case LispSChar_t:
+                   case LispPackage_t:         /* protected in gc */
+                       break;
+                   case LispInteger_t:
+                   case LispDFloat_t:
+                   case LispString_t:
+                   case LispRatio_t:
+                   case LispOpaque_t:
+                   case LispBignum_t:
+                   case LispBigratio_t:
+                       CAR(object)->mark = 1;
+                       break;
+                   default:
+                       LispMark(CAR(object));
+                       break;
+               }
+           }
+           if (POINTERP(object) && !object->mark)
+               goto mark_again;
+           return;
+       case LispArray_t:
+           LispMark(object->data.array.list);
+           object->mark = 1;
+           object = object->data.array.dim;
+           goto mark_cons;
+       case LispStruct_t:
+           object->mark = 1;
+           object = object->data.struc.fields;
+           goto mark_cons;
+       case LispStream_t:
+mark_stream:
+           LispMark(object->data.stream.pathname);
+           if (object->data.stream.type == LispStreamPipe) {
+               object->mark = 1;
+               object = object->data.stream.source.program->errorp;
+               goto mark_stream;
+           }
+           break;
+       case LispRegex_t:
+           object->data.regex.pattern->mark = 1;
+           break;
+       case LispBytecode_t:
+           object->mark = 1;
+           object = object->data.bytecode.code;
+           goto mark_again;
+       case LispHashTable_t: {
+           unsigned long i;
+           LispHashEntry *entry = object->data.hash.table->entries,
+                         *last = entry + object->data.hash.table->num_entries;
+
+           if (object->mark)
+               return;
+           object->mark = 1;
+           for (; entry < last; entry++) {
+               for (i = 0; i < entry->count; i++) {
+                   switch (OBJECT_TYPE(entry->keys[i])) {
+                       case LispNil_t:
+                       case LispAtom_t:
+                       case LispFixnum_t:
+                       case LispSChar_t:
+                       case LispFunction_t:
+                       case LispPackage_t:
+                           break;
+                       case LispInteger_t:
+                       case LispDFloat_t:
+                       case LispString_t:
+                       case LispRatio_t:
+                       case LispOpaque_t:
+                       case LispBignum_t:
+                       case LispBigratio_t:
+                           entry->keys[i]->mark = 1;
+                           break;
+                       default:
+                           LispMark(entry->keys[i]);
+                           break;
+                   }
+                   switch (OBJECT_TYPE(entry->values[i])) {
+                       case LispNil_t:
+                       case LispAtom_t:
+                       case LispFixnum_t:
+                       case LispSChar_t:
+                       case LispFunction_t:
+                       case LispPackage_t:
+                           break;
+                       case LispInteger_t:
+                       case LispDFloat_t:
+                       case LispString_t:
+                       case LispRatio_t:
+                       case LispOpaque_t:
+                       case LispBignum_t:
+                       case LispBigratio_t:
+                           entry->values[i]->mark = 1;
+                           break;
+                       default:
+                           LispMark(entry->values[i]);
+                           break;
+                   }
+               }
+           }
+       }   return;
+       default:
+           break;
+    }
+    object->mark = 1;
+}
+
+static INLINE void
+LispProt(register LispObj *object)
+{
+prot_again:
+    switch (OBJECT_TYPE(object)) {
+       case LispNil_t:
+       case LispAtom_t:
+       case LispFixnum_t:
+       case LispSChar_t:
+       case LispFunction_t:
+           return;
+       case LispLambda_t:
+           if (OPAQUEP(object->data.lambda.name))
+               object->data.lambda.name->prot = 1;
+           object->prot = 1;
+           LispProt(object->data.lambda.data);
+           object = object->data.lambda.code;
+           goto prot_cons;
+       case LispQuote_t:
+       case LispBackquote_t:
+       case LispFunctionQuote_t:
+           object->prot = 1;
+           object = object->data.quote;
+           goto prot_again;
+       case LispPathname_t:
+           object->prot = 1;
+           object = object->data.pathname;
+           goto prot_again;
+       case LispComma_t:
+           object->prot = 1;
+           object = object->data.comma.eval;
+           goto prot_again;
+       case LispComplex_t:
+           if (POINTERP(object->data.complex.real))
+               object->data.complex.real->prot = 1;
+           if (POINTERP(object->data.complex.imag))
+               object->data.complex.imag->prot = 1;
+           break;
+       case LispCons_t:
+prot_cons:
+           for (; CONSP(object) && !object->prot; object = CDR(object)) {
+               object->prot = 1;
+               switch (OBJECT_TYPE(CAR(object))) {
+                   case LispNil_t:
+                   case LispAtom_t:
+                   case LispFixnum_t:
+                   case LispSChar_t:
+                   case LispFunction_t:
+                   case LispPackage_t:         /* protected in gc */
+                       break;
+                   case LispInteger_t:
+                   case LispDFloat_t:
+                   case LispString_t:
+                   case LispRatio_t:
+                   case LispOpaque_t:
+                   case LispBignum_t:
+                   case LispBigratio_t:
+                       CAR(object)->prot = 1;
+                       break;
+                   default:
+                       LispProt(CAR(object));
+                       break;
+               }
+           }
+           if (POINTERP(object) && !object->prot)
+               goto prot_again;
+           return;
+       case LispArray_t:
+           LispProt(object->data.array.list);
+           object->prot = 1;
+           object = object->data.array.dim;
+           goto prot_cons;
+       case LispStruct_t:
+           object->prot = 1;
+           object = object->data.struc.fields;
+           goto prot_cons;
+       case LispStream_t:
+prot_stream:
+           LispProt(object->data.stream.pathname);
+           if (object->data.stream.type == LispStreamPipe) {
+               object->prot = 1;
+               object = object->data.stream.source.program->errorp;
+               goto prot_stream;
+           }
+           break;
+       case LispRegex_t:
+           object->data.regex.pattern->prot = 1;
+           break;
+       case LispBytecode_t:
+           object->prot = 1;
+           object = object->data.bytecode.code;
+           goto prot_again;
+       case LispHashTable_t: {
+           unsigned long i;
+           LispHashEntry *entry = object->data.hash.table->entries,
+                         *last = entry + object->data.hash.table->num_entries;
+
+           if (object->prot)
+               return;
+           object->prot = 1;
+           for (; entry < last; entry++) {
+               for (i = 0; i < entry->count; i++) {
+                   switch (OBJECT_TYPE(entry->keys[i])) {
+                       case LispNil_t:
+                       case LispAtom_t:
+                       case LispFixnum_t:
+                       case LispSChar_t:
+                       case LispFunction_t:
+                       case LispPackage_t:
+                           break;
+                       case LispInteger_t:
+                       case LispDFloat_t:
+                       case LispString_t:
+                       case LispRatio_t:
+                       case LispOpaque_t:
+                       case LispBignum_t:
+                       case LispBigratio_t:
+                           entry->keys[i]->prot = 1;
+                           break;
+                       default:
+                           LispProt(entry->keys[i]);
+                           break;
+                   }
+                   switch (OBJECT_TYPE(entry->values[i])) {
+                       case LispNil_t:
+                       case LispAtom_t:
+                       case LispFixnum_t:
+                       case LispSChar_t:
+                       case LispFunction_t:
+                       case LispPackage_t:
+                           break;
+                       case LispInteger_t:
+                       case LispDFloat_t:
+                       case LispString_t:
+                       case LispRatio_t:
+                       case LispOpaque_t:
+                       case LispBignum_t:
+                       case LispBigratio_t:
+                           entry->values[i]->prot = 1;
+                           break;
+                       default:
+                           LispProt(entry->values[i]);
+                           break;
+                   }
+               }
+           }
+       }   return;
+       default:
+           break;
+    }
+    object->prot = 1;
+}
+
+void
+LispProtect(LispObj *key, LispObj *list)
+{
+    PRO = CONS(CONS(key, list), PRO);
+}
+
+void
+LispUProtect(LispObj *key, LispObj *list)
+{
+    LispObj *prev, *obj;
+
+    for (prev = obj = PRO; obj != NIL; prev = obj, obj = CDR(obj))
+       if (CAR(CAR(obj)) == key && CDR(CAR(obj)) == list) {
+           if (obj == PRO)
+               PRO = CDR(PRO);
+           else
+               CDR(prev) = CDR(obj);
+           return;
+       }
+
+    LispDestroy("no match for %s, at UPROTECT", STROBJ(key));
+}
+
+static LispObj *
+Lisp__New(LispObj *car, LispObj *cdr)
+{
+    int cellcount;
+    LispObj *obj;
+
+    Lisp__GC(car, cdr);
+#if 0
+    lisp__data.gc.average = (objseg.nfree + lisp__data.gc.average) >> 1;
+    if (lisp__data.gc.average < minfree) {
+       if (lisp__data.gc.expandbits < 6)
+           ++lisp__data.gc.expandbits;
+    }
+    else if (lisp__data.gc.expandbits)
+       --lisp__data.gc.expandbits;
+    /* For 32 bit computers, where sizeof(LispObj) == 16,
+     * minfree is set to 1024, and expandbits limited to 6,
+     * the maximum extra memory requested here should be 1Mb
+     */
+    cellcount = minfree << lisp__data.gc.expandbits;
+#else
+    /* Try to keep at least 3 times more free cells than the de number
+     * of used cells in the freelist, to amenize the cost of the gc time,
+     * in the, currently, very simple gc strategy code. */
+    cellcount = (objseg.nobjs - objseg.nfree) * 3;
+    cellcount = cellcount + (minfree - (cellcount % minfree));
+#endif
+
+    if (objseg.freeobj == NIL || objseg.nfree < cellcount)
+       LispAllocSeg(&objseg, cellcount);
+
+    obj = objseg.freeobj;
+    objseg.freeobj = CDR(obj);
+    --objseg.nfree;
+    
+    return (obj);
+}
+
+LispObj *
+LispNew(LispObj *car, LispObj *cdr)
+{
+    LispObj *obj = objseg.freeobj;
+
+    if (obj == NIL)
+       obj = Lisp__New(car, cdr);
+    else {
+       objseg.freeobj = CDR(obj);
+       --objseg.nfree;
+    }
+    
+    return (obj);
+}
+
+LispObj *
+LispNewAtom(char *str, int intern)
+{
+    LispObj *object;
+    LispAtom *atom = LispDoGetAtom(str, 0);
+
+    if (atom->object) {
+       if (intern && atom->package == NULL)
+           atom->package = PACKAGE;
+
+       return (atom->object);
+    }
+
+    if (atomseg.freeobj == NIL)
+       LispAllocSeg(&atomseg, pagesize);
+    object = atomseg.freeobj;
+    atomseg.freeobj = CDR(object);
+    --atomseg.nfree;
+
+    object->type = LispAtom_t;
+    object->data.atom = atom;
+    atom->object = object;
+    if (intern)
+       atom->package = PACKAGE;
+
+    return (object);
+}
+
+LispObj *
+LispNewStaticAtom(char *str)
+{
+    LispObj *object;
+    LispAtom *atom = LispDoGetAtom(str, 1);
+
+    object = LispNewSymbol(atom);
+
+    return (object);
+}
+
+LispObj *
+LispNewSymbol(LispAtom *atom)
+{
+    if (atom->object) {
+       if (atom->package == NULL)
+           atom->package = PACKAGE;
+
+       return (atom->object);
+    }
+    else {
+       LispObj *symbol;
+
+       if (atomseg.freeobj == NIL)
+           LispAllocSeg(&atomseg, pagesize);
+       symbol = atomseg.freeobj;
+       atomseg.freeobj = CDR(symbol);
+       --atomseg.nfree;
+
+       symbol->type = LispAtom_t;
+       symbol->data.atom = atom;
+       atom->object = symbol;
+       atom->package = PACKAGE;
+
+       return (symbol);
+    }
+}
+
+/* function representation is created on demand and never released,
+ * even if the function is undefined and never defined again */
+LispObj *
+LispNewFunction(LispObj *symbol)
+{
+    LispObj *function;
+
+    if (symbol->data.atom->function)
+       return (symbol->data.atom->function);
+
+    if (symbol->data.atom->package == NULL)
+       symbol->data.atom->package = PACKAGE;
+
+    if (atomseg.freeobj == NIL)
+       LispAllocSeg(&atomseg, pagesize);
+    function = atomseg.freeobj;
+    atomseg.freeobj = CDR(function);
+    --atomseg.nfree;
+
+    function->type = LispFunction_t;
+    function->data.atom = symbol->data.atom;
+    symbol->data.atom->function = function;
+
+    return (function);
+}
+
+/* symbol name representation is created on demand and never released */
+LispObj *
+LispSymbolName(LispObj *symbol)
+{
+    LispObj *name;
+    LispAtom *atom = symbol->data.atom;
+
+    if (atom->name)
+       return (atom->name);
+
+    if (atomseg.freeobj == NIL)
+       LispAllocSeg(&atomseg, pagesize);
+    name = atomseg.freeobj;
+    atomseg.freeobj = CDR(name);
+    --atomseg.nfree;
+
+    name->type = LispString_t;
+    THESTR(name) = atom->key->value;
+    STRLEN(name) = atom->key->length;
+    name->data.string.writable = 0;
+    atom->name = name;
+
+    return (name);
+}
+
+LispObj *
+LispNewFunctionQuote(LispObj *object)
+{
+    LispObj *quote = LispNew(object, NIL);
+
+    quote->type = LispFunctionQuote_t;
+    quote->data.quote = object;
+
+    return (quote);
+}
+
+LispObj *
+LispNewDFloat(double value)
+{
+    LispObj *dfloat = objseg.freeobj;
+
+    if (dfloat == NIL)
+       dfloat = Lisp__New(NIL, NIL);
+    else {
+       objseg.freeobj = CDR(dfloat);
+       --objseg.nfree;
+    }
+    dfloat->type = LispDFloat_t;
+    dfloat->data.dfloat = value;
+
+    return (dfloat);
+}
+
+LispObj *
+LispNewString(char *str, long length, int alloced)
+{
+    char *cstring;
+    LispObj *string = objseg.freeobj;
+
+    if (string == NIL)
+       string = Lisp__New(NIL, NIL);
+    else {
+       objseg.freeobj = CDR(string);
+       --objseg.nfree;
+    }
+    if (alloced)
+       cstring = str;
+    else {
+       cstring = LispMalloc(length + 1);
+       memcpy(cstring, str, length);
+       cstring[length] = '\0';
+    }
+    LispMused(cstring);
+    string->type = LispString_t;
+    THESTR(string) = cstring;
+    STRLEN(string) = length;
+    string->data.string.writable = 1;
+
+    return (string);
+}
+
+LispObj *
+LispNewComplex(LispObj *realpart, LispObj *imagpart)
+{
+    LispObj *complexp = objseg.freeobj;
+
+    if (complexp == NIL)
+       complexp = Lisp__New(realpart, imagpart);
+    else {
+       objseg.freeobj = CDR(complexp);
+       --objseg.nfree;
+    }
+    complexp->type = LispComplex_t;
+    complexp->data.complex.real = realpart;
+    complexp->data.complex.imag = imagpart;
+
+    return (complexp);
+}
+
+LispObj *
+LispNewInteger(long integer)
+{
+    if (integer > MOST_POSITIVE_FIXNUM || integer < MOST_NEGATIVE_FIXNUM) {
+       LispObj *object = objseg.freeobj;
+
+       if (object == NIL)
+           object = Lisp__New(NIL, NIL);
+       else {
+           objseg.freeobj = CDR(object);
+           --objseg.nfree;
+       }
+       object->type = LispInteger_t;
+       object->data.integer = integer;
+
+       return (object);
+    }
+    return (FIXNUM(integer));
+}
+
+LispObj *
+LispNewRatio(long num, long den)
+{
+    LispObj *ratio = objseg.freeobj;
+
+    if (ratio == NIL)
+       ratio = Lisp__New(NIL, NIL);
+    else {
+       objseg.freeobj = CDR(ratio);
+       --objseg.nfree;
+    }
+    ratio->type = LispRatio_t;
+    ratio->data.ratio.numerator = num;
+    ratio->data.ratio.denominator = den;
+
+    return (ratio);
+}
+
+LispObj *
+LispNewVector(LispObj *objects)
+{
+    GC_ENTER();
+    long count;
+    LispObj *array, *dimension;
+
+    for (count = 0, array = objects; CONSP(array); count++, array = CDR(array))
+       ;
+
+    GC_PROTECT(objects);
+    dimension = CONS(FIXNUM(count), NIL);
+    array = LispNew(objects, dimension);
+    array->type = LispArray_t;
+    array->data.array.list = objects;
+    array->data.array.dim = dimension;
+    array->data.array.rank = 1;
+    array->data.array.type = LispNil_t;
+    array->data.array.zero = count == 0;
+    GC_LEAVE();
+
+    return (array);
+}
+
+LispObj *
+LispNewQuote(LispObj *object)
+{
+    LispObj *quote = LispNew(object, NIL);
+
+    quote->type = LispQuote_t;
+    quote->data.quote = object;
+
+    return (quote);
+}
+
+LispObj *
+LispNewBackquote(LispObj *object)
+{
+    LispObj *backquote = LispNew(object, NIL);
+
+    backquote->type = LispBackquote_t;
+    backquote->data.quote = object;
+
+    return (backquote);
+}
+
+LispObj *
+LispNewComma(LispObj *object, int atlist)
+{
+    LispObj *comma = LispNew(object, NIL);
+
+    comma->type = LispComma_t;
+    comma->data.comma.eval = object;
+    comma->data.comma.atlist = atlist;
+
+    return (comma);
+}
+
+LispObj *
+LispNewCons(LispObj *car, LispObj *cdr)
+{
+    LispObj *cons = objseg.freeobj;
+
+    if (cons == NIL)
+       cons = Lisp__New(car, cdr);
+    else {
+       objseg.freeobj = CDR(cons);
+       --objseg.nfree;
+    }
+    CAR(cons) = car;
+    CDR(cons) = cdr;
+
+    return (cons);
+}
+
+LispObj *
+LispNewLambda(LispObj *name, LispObj *code, LispObj *data, LispFunType type)
+{
+    LispObj *fun = LispNew(data, code);
+
+    fun->type = LispLambda_t;
+    fun->funtype = type;
+    fun->data.lambda.name = name;
+    fun->data.lambda.code = code;
+    fun->data.lambda.data = data;
+
+    return (fun);
+}
+
+LispObj *
+LispNewStruct(LispObj *fields, LispObj *def)
+{
+    LispObj *struc = LispNew(fields, def);
+
+    struc->type = LispStruct_t;
+    struc->data.struc.fields = fields;
+    struc->data.struc.def = def;
+
+    return (struc);
+}
+
+LispObj *
+LispNewOpaque(void *data, int type)
+{
+    LispObj *opaque = LispNew(NIL, NIL);
+
+    opaque->type = LispOpaque_t;
+    opaque->data.opaque.data = data;
+    opaque->data.opaque.type = type;
+
+    return (opaque);
+}
+
+/* string argument must be static, or allocated */
+LispObj *
+LispNewKeyword(char *string)
+{
+    LispObj *keyword;
+
+    if (PACKAGE != lisp__data.keyword) {
+       LispObj *savepackage;
+       LispPackage *savepack;
+
+       /* Save package environment */
+       savepackage = PACKAGE;
+       savepack = lisp__data.pack;
+
+       /* Change package environment */
+       PACKAGE = lisp__data.keyword;
+       lisp__data.pack = lisp__data.key;
+
+       /* Create symbol in keyword package */
+       keyword = LispNewStaticAtom(string);
+
+       /* Restore package environment */
+       PACKAGE = savepackage;
+       lisp__data.pack = savepack;
+    }
+    else
+       /* Just create symbol in keyword package */
+       keyword = LispNewStaticAtom(string);
+
+    /* Export keyword symbol */
+    LispExportSymbol(keyword);
+
+    /* All keywords are constants */
+    keyword->data.atom->constant = 1;
+
+    /* XXX maybe should bound the keyword to itself, but that would
+     * require allocating a LispProperty structure for every keyword */
+
+    return (keyword);
+}
+
+LispObj *
+LispNewPathname(LispObj *obj)
+{
+    LispObj *path = LispNew(obj, NIL);
+
+    path->type = LispPathname_t;
+    path->data.pathname = obj;
+
+    return (path);
+}
+
+LispObj *
+LispNewStringStream(char *string, int flags, long length, int alloced)
+{
+    LispObj *stream = LispNew(NIL, NIL);
+
+    SSTREAMP(stream) = LispCalloc(1, sizeof(LispString));
+    if (alloced)
+       SSTREAMP(stream)->string = string;
+    else {
+       SSTREAMP(stream)->string = LispMalloc(length + 1);
+       memcpy(SSTREAMP(stream)->string, string, length);
+       SSTREAMP(stream)->string[length] = '\0';
+    }
+
+    stream->type = LispStream_t;
+
+    SSTREAMP(stream)->length = length;
+    LispMused(SSTREAMP(stream));
+    LispMused(SSTREAMP(stream)->string);
+    stream->data.stream.type = LispStreamString;
+    stream->data.stream.readable = (flags & STREAM_READ) != 0;
+    stream->data.stream.writable = (flags & STREAM_WRITE) != 0;
+    SSTREAMP(stream)->space = length + 1;
+
+    stream->data.stream.pathname = NIL;
+
+    return (stream);
+}
+
+LispObj *
+LispNewFileStream(LispFile *file, LispObj *path, int flags)
+{
+    LispObj *stream = LispNew(NIL, NIL);
+
+    stream->type = LispStream_t;
+    FSTREAMP(stream) = file;
+    stream->data.stream.pathname = path;
+    stream->data.stream.type = LispStreamFile;
+    stream->data.stream.readable = (flags & STREAM_READ) != 0;
+    stream->data.stream.writable = (flags & STREAM_WRITE) != 0;
+
+    return (stream);
+}
+
+LispObj *
+LispNewPipeStream(LispPipe *program, LispObj *path, int flags)
+{
+    LispObj *stream = LispNew(NIL, NIL);
+
+    stream->type = LispStream_t;
+    PSTREAMP(stream) = program;
+    stream->data.stream.pathname = path;
+    stream->data.stream.type = LispStreamPipe;
+    stream->data.stream.readable = (flags & STREAM_READ) != 0;
+    stream->data.stream.writable = (flags & STREAM_WRITE) != 0;
+
+    return (stream);
+}
+
+LispObj *
+LispNewStandardStream(LispFile *file, LispObj *description, int flags)
+{
+    LispObj *stream = LispNew(NIL, NIL);
+
+    stream->type = LispStream_t;
+    FSTREAMP(stream) = file;
+    stream->data.stream.pathname = description;
+    stream->data.stream.type = LispStreamStandard;
+    stream->data.stream.readable = (flags & STREAM_READ) != 0;
+    stream->data.stream.writable = (flags & STREAM_WRITE) != 0;
+
+    return (stream);
+}
+
+LispObj *
+LispNewBignum(mpi *bignum)
+{
+    LispObj *integer = LispNew(NIL, NIL);
+
+    integer->type = LispBignum_t;
+    integer->data.mp.integer = bignum;
+    LispMused(bignum->digs);
+    LispMused(bignum);
+
+    return (integer);
+}
+
+LispObj *
+LispNewBigratio(mpr *bigratio)
+{
+    LispObj *ratio = LispNew(NIL, NIL);
+
+    ratio->type = LispBigratio_t;
+    ratio->data.mp.ratio = bigratio;
+    LispMused(mpr_num(bigratio)->digs);
+    LispMused(mpr_den(bigratio)->digs);
+    LispMused(bigratio);
+
+    return (ratio);
+}
+
+/* name must be of type LispString_t */
+LispObj *
+LispNewPackage(LispObj *name, LispObj *nicknames)
+{
+    LispObj *package = LispNew(name, nicknames);
+    LispPackage *pack = LispCalloc(1, sizeof(LispPackage));
+
+    package->type = LispPackage_t;
+    package->data.package.name = name;
+    package->data.package.nicknames = nicknames;
+    package->data.package.package = pack;
+
+    package->data.package.package->atoms = hash_new(STRTBLSZ, NULL);
+
+    LispMused(pack);
+
+    return (package);
+}
+
+LispObj *
+LispSymbolFunction(LispObj *symbol)
+{
+    LispAtom *atom = symbol->data.atom;
+
+    if ((atom->a_builtin &&
+        atom->property->fun.builtin->type == LispFunction) ||
+       (atom->a_function &&
+        atom->property->fun.function->funtype == LispFunction) ||
+       (atom->a_defstruct &&
+        atom->property->structure.function != STRUCT_NAME) ||
+       /* XXX currently bytecode is only generated for functions */
+       atom->a_compiled)
+       symbol = FUNCTION(symbol);
+    else
+       LispDestroy("SYMBOL-FUNCTION: %s is not a function", STROBJ(symbol));
+
+    return (symbol);
+}
+
+
+static INLINE LispObj *
+LispGetVarPack(LispObj *symbol)
+{
+    LispAtom *atom;
+
+    atom = (LispAtom *)hash_get(lisp__data.pack->atoms,
+                                symbol->data.atom->key);
+
+    return (atom ? atom->object : NULL);
+}
+
+/* package must be of type LispPackage_t */
+void
+LispUsePackage(LispObj *package)
+{
+    LispAtom *atom;
+    LispPackage *pack;
+    LispObj **pentry, **eentry;
+
+    /* Already using its own symbols... */
+    if (package == PACKAGE)
+       return;
+
+    /* Check if package not already in use-package list */
+    for (pentry = lisp__data.pack->use.pairs,
+        eentry = pentry + lisp__data.pack->use.length;
+        pentry < eentry; pentry++)
+       if (*pentry == package)
+       return;
+
+    /* Remember this package is in the use-package list */
+    if (lisp__data.pack->use.length + 1 >= lisp__data.pack->use.space) {
+       LispObj **pairs = realloc(lisp__data.pack->use.pairs,
+                                 (lisp__data.pack->use.space + 1) *
+                                 sizeof(LispObj*));
+
+       if (pairs == NULL)
+           LispDestroy("out of memory");
+
+       lisp__data.pack->use.pairs = pairs;
+       ++lisp__data.pack->use.space;
+    }
+    lisp__data.pack->use.pairs[lisp__data.pack->use.length++] = package;
+
+    /* Import all extern symbols from package */
+    pack = package->data.package.package;
+
+    /* Traverse atom list, searching for extern symbols */
+    for (atom = (LispAtom *)hash_iter_first(pack->atoms);
+        atom;
+        atom = (LispAtom *)hash_iter_next(pack->atoms)) {
+       if (atom->ext)
+           LispImportSymbol(atom->object);
+    }
+}
+
+/* symbol must be of type LispAtom_t */
+void
+LispImportSymbol(LispObj *symbol)
+{
+    int increment;
+    LispAtom *atom;
+    LispObj *current;
+
+    current = LispGetVarPack(symbol);
+    if (current == NULL || current->data.atom->property == NOPROPERTY) {
+       /* No conflicts */
+
+       if (symbol->data.atom->a_object) {
+           /* If it is a bounded variable */
+           if (lisp__data.pack->glb.length + 1 >= lisp__data.pack->glb.space)
+               LispMoreGlobals(lisp__data.pack);
+           lisp__data.pack->glb.pairs[lisp__data.pack->glb.length++] = symbol;
+       }
+
+       /* Create copy of atom in current package */
+       atom = LispDoGetAtom(ATOMID(symbol)->value, 0);
+       /*   Need to create a copy because if anything new is atached to the
+        * property, the current package is the owner, not the previous one. */
+
+       /* And reference the same properties */
+       atom->property = symbol->data.atom->property;
+
+       increment = 1;
+    }
+    else if (current->data.atom->property != symbol->data.atom->property) {
+       /* Symbol already exists in the current package,
+        * but does not reference the same variable */
+       LispContinuable("Symbol %s already defined in package %s. Redefine?",
+                       ATOMID(symbol)->value, THESTR(PACKAGE->data.package.name));
+
+       atom = current->data.atom;
+
+       /* Continued from error, redefine variable */
+       LispDecrementAtomReference(atom);
+       atom->property = symbol->data.atom->property;
+       
+       atom->a_object = atom->a_function = atom->a_builtin =
+           atom->a_property = atom->a_defsetf = atom->a_defstruct = 0;
+
+       increment = 1;
+    }
+    else {
+       /* Symbol is already available in the current package, just update */
+       atom = current->data.atom;
+
+       increment = 0;
+    }
+
+    /* If importing an important system variable */
+    atom->watch = symbol->data.atom->watch;
+
+    /* Update constant flag */
+    atom->constant = symbol->data.atom->constant;
+
+    /* Set home-package and unique-atom associated with symbol */
+    atom->package = symbol->data.atom->package;
+    atom->object = symbol->data.atom->object;
+
+    if (symbol->data.atom->a_object)
+       atom->a_object = 1;
+    if (symbol->data.atom->a_function)
+       atom->a_function = 1;
+    else if (symbol->data.atom->a_builtin)
+       atom->a_builtin = 1;
+    else if (symbol->data.atom->a_compiled)
+       atom->a_compiled = 1;
+    if (symbol->data.atom->a_property)
+       atom->a_property = 1;
+    if (symbol->data.atom->a_defsetf)
+       atom->a_defsetf = 1;
+    if (symbol->data.atom->a_defstruct)
+       atom->a_defstruct = 1;
+
+    if (increment)
+       /* Increase reference count, more than one package using the symbol */
+       LispIncrementAtomReference(symbol->data.atom);
+}
+
+/* symbol must be of type LispAtom_t */
+void
+LispExportSymbol(LispObj *symbol)
+{
+    /* This does not automatically export symbols to another package using
+     * the symbols of the current package */
+    symbol->data.atom->ext = 1;
+}
+
+#ifdef __GNUC__
+LispObj *
+LispGetVar(LispObj *atom)
+{
+    return (LispDoGetVar(atom));
+}
+
+static INLINE LispObj *
+LispDoGetVar(LispObj *atom)
+#else
+#define LispDoGetVar LispGetVar
+LispObj *
+LispGetVar(LispObj *atom)
+#endif
+{
+    LispAtom *name;
+    int i, base, offset;
+    Atom_id id;
+
+    name = atom->data.atom;
+    if (name->constant && name->package == lisp__data.keyword)
+       return (atom);
+
+    /* XXX offset should be stored elsewhere, it is unique, like the string
+     * pointer. Unless a multi-thread interface is implemented (where
+     * multiple stacks would be required, the offset value should be
+     * stored with the string, so that a few cpu cicles could be saved
+     * by initializing the value to -1, and only searching for the symbol
+     * binding if it is not -1, and if no binding is found, because the
+     * lexical scope was left, reset offset to -1. */
+    offset = name->offset;
+    id = name->key;
+    base = lisp__data.env.lex;
+    i = lisp__data.env.head - 1;
+
+    if (offset <= i && (offset >= base || name->dyn) &&
+       lisp__data.env.names[offset] == id)
+       return (lisp__data.env.values[offset]);
+
+    for (; i >= base; i--)
+       if (lisp__data.env.names[i] == id) {
+           name->offset = i;
+
+           return (lisp__data.env.values[i]);
+       }
+
+    if (name->dyn) {
+       /* Keep searching as maybe a rebound dynamic variable */
+       for (; i >= 0; i--)
+           if (lisp__data.env.names[i] == id) {
+               name->offset = i;
+
+           return (lisp__data.env.values[i]);
+       }
+
+       if (name->a_object) {
+           /* Check for a symbol defined as special, but not yet bound. */
+           if (name->property->value == UNBOUND)
+               return (NULL);
+
+           return (name->property->value);
+       }
+    }
+
+    return (name->a_object ? name->property->value : NULL);
+}
+
+#ifdef DEBUGGER
+/* Same code as LispDoGetVar, but returns the address of the pointer to
+ * the object value. Used only by the debugger */
+void *
+LispGetVarAddr(LispObj *atom)
+{
+    LispAtom *name;
+    int i, base;
+    Atom_id id;
+
+    name = atom->data.atom;
+    if (name->constant && name->package == lisp__data.keyword)
+       return (&atom);
+
+    id = name->string;
+
+    i = lisp__data.env.head - 1;
+    for (base = lisp__data.env.lex; i >= base; i--)
+       if (lisp__data.env.names[i] == id)
+           return (&(lisp__data.env.values[i]));
+
+    if (name->dyn) {
+       for (; i >= 0; i--)
+           if (lisp__data.env.names[i] == id)
+               return (&(lisp__data.env.values[i]));
+
+       if (name->a_object) {
+           /* Check for a symbol defined as special, but not yet bound */
+           if (name->property->value == UNBOUND)
+               return (NULL);
+
+           return (&(name->property->value));
+       }
+    }
+
+    return (name->a_object ? &(name->property->value) : NULL);
+}
+#endif
+
+/* Only removes global variables. To be called by makunbound
+ * Local variables are unbounded once their block is closed anyway.
+ */
+void
+LispUnsetVar(LispObj *atom)
+{
+    LispAtom *name = atom->data.atom;
+
+    if (name->package) {
+       int i;
+       LispPackage *pack = name->package->data.package.package;
+
+       for (i = pack->glb.length - 1; i > 0; i--)
+           if (pack->glb.pairs[i] == atom) {
+               LispRemAtomObjectProperty(name);
+               --pack->glb.length;
+               if (i < pack->glb.length)
+                   memmove(pack->glb.pairs + i, pack->glb.pairs + i + 1,
+                           sizeof(LispObj*) * (pack->glb.length - i));
+
+               /* unset hint about dynamically binded variable */
+               if (name->dyn)
+                   name->dyn = 0;
+               break;
+           }
+    }
+}
+
+LispObj *
+LispAddVar(LispObj *atom, LispObj *obj)
+{
+    if (lisp__data.env.length >= lisp__data.env.space)
+       LispMoreEnvironment();
+
+    LispDoAddVar(atom, obj);
+
+    return (obj);
+}
+
+static INLINE void
+LispDoAddVar(LispObj *symbol, LispObj *value)
+{
+    LispAtom *atom = symbol->data.atom;
+
+    atom->offset = lisp__data.env.length;
+    lisp__data.env.values[lisp__data.env.length] = value;
+    lisp__data.env.names[lisp__data.env.length++] = atom->key;
+}
+
+LispObj *
+LispSetVar(LispObj *atom, LispObj *obj)
+{
+    LispPackage *pack;
+    LispAtom *name;
+    int i, base, offset;
+    Atom_id id;
+
+    name = atom->data.atom;
+    offset = name->offset;
+    id = name->key;
+    base = lisp__data.env.lex;
+    i = lisp__data.env.head - 1;
+
+    if (offset <= i && (offset >= base || name->dyn) &&
+       lisp__data.env.names[offset] == id)
+       return (lisp__data.env.values[offset] = obj);
+
+    for (; i >= base; i--)
+       if (lisp__data.env.names[i] == id) {
+           name->offset = i;
+
+           return (lisp__data.env.values[i] = obj);
+       }
+
+    if (name->dyn) {
+       for (; i >= 0; i--)
+           if (lisp__data.env.names[i] == id)
+               return (lisp__data.env.values[i] = obj);
+
+       if (name->watch) {
+           LispSetAtomObjectProperty(name, obj);
+
+           return (obj);
+       }
+
+       return (SETVALUE(name, obj));
+    }
+
+    if (name->a_object) {
+       if (name->watch) {
+           LispSetAtomObjectProperty(name, obj);
+
+           return (obj);
+       }
+
+       return (SETVALUE(name, obj));
+    }
+
+    LispSetAtomObjectProperty(name, obj);
+
+    pack = name->package->data.package.package;
+    if (pack->glb.length >= pack->glb.space)
+       LispMoreGlobals(pack);
+
+    pack->glb.pairs[pack->glb.length++] = atom;
+
+    return (obj);
+}
+
+void
+LispProclaimSpecial(LispObj *atom, LispObj *value, LispObj *doc)
+{
+    int i = 0, dyn, glb;
+    LispAtom *name;
+    LispPackage *pack;
+
+    glb = 0;
+    name = atom->data.atom;
+    pack = name->package->data.package.package;
+    dyn = name->dyn;
+
+    if (!dyn) {
+       /* Note: don't check if a local variable already is using the symbol */
+       for (i = pack->glb.length - 1; i >= 0; i--)
+           if (pack->glb.pairs[i] == atom) {
+               glb = 1;
+               break;
+           }
+    }
+
+    if (dyn) {
+       if (name->property->value == UNBOUND && value)
+           /* if variable was just made special, but not bounded */
+           LispSetAtomObjectProperty(name, value);
+    }
+    else if (glb)
+       /* Already a global variable, but not marked as special.
+        * Set hint about dynamically binded variable. */
+       name->dyn = 1;
+    else {
+       /* create new special variable */
+       LispSetAtomObjectProperty(name, value ? value : UNBOUND);
+
+       if (pack->glb.length >= pack->glb.space)
+           LispMoreGlobals(pack);
+
+       pack->glb.pairs[pack->glb.length] = atom;
+       ++pack->glb.length;
+       /* set hint about possibly dynamically binded variable */
+       name->dyn = 1;
+    }
+
+    if (doc != NIL)
+       LispAddDocumentation(atom, doc, LispDocVariable);
+}
+
+void
+LispDefconstant(LispObj *atom, LispObj *value, LispObj *doc)
+{
+    int i;
+    LispAtom *name = atom->data.atom;
+    LispPackage *pack = name->package->data.package.package;
+
+    /* Unset hint about dynamically binded variable, if set. */
+    name->dyn = 0;
+
+    /* Check if variable is bounded as a global variable */
+    for (i = pack->glb.length - 1; i >= 0; i--)
+       if (pack->glb.pairs[i] == atom)
+           break;
+
+    if (i < 0) {
+       /* Not a global variable */
+       if (pack->glb.length >= pack->glb.space)
+           LispMoreGlobals(pack);
+
+       pack->glb.pairs[pack->glb.length] = atom;
+       ++pack->glb.length;
+    }
+
+    /* If already a constant variable */
+    if (name->constant && name->a_object && name->property->value != value)
+       LispWarning("constant %s is being redefined", STROBJ(atom));
+    else
+       name->constant = 1;
+
+    /* Set constant value */
+    LispSetAtomObjectProperty(name, value);
+
+    if (doc != NIL)
+       LispAddDocumentation(atom, doc, LispDocVariable);
+}
+
+void
+LispAddDocumentation(LispObj *symbol, LispObj *documentation, LispDocType_t type)
+{
+    int length;
+    char *string;
+    LispAtom *atom;
+    LispObj *object;
+
+    if (!SYMBOLP(symbol) || !STRINGP(documentation))
+       LispDestroy("DOCUMENTATION: invalid argument");
+
+    atom = symbol->data.atom;
+    if (atom->documentation[type])
+       LispRemDocumentation(symbol, type);
+
+    /* allocate documentation in atomseg */
+    if (atomseg.freeobj == NIL)
+       LispAllocSeg(&atomseg, pagesize);
+    length = STRLEN(documentation);
+    string = LispMalloc(length);
+    memcpy(string, THESTR(documentation), length);
+    string[length] = '\0';
+    object = atomseg.freeobj;
+    atomseg.freeobj = CDR(object);
+    --atomseg.nfree;
+
+    object->type = LispString_t;
+    THESTR(object) = string;
+    STRLEN(object) = length;
+    object->data.string.writable = 0;
+    atom->documentation[type] = object;
+    LispMused(string);
+}
+
+void
+LispRemDocumentation(LispObj *symbol, LispDocType_t type)
+{
+    LispAtom *atom;
+
+    if (!SYMBOLP(symbol))
+       LispDestroy("DOCUMENTATION: invalid argument");
+
+    atom = symbol->data.atom;
+    if (atom->documentation[type]) {
+       /* reclaim object to atomseg */
+       free(THESTR(atom->documentation[type]));
+       CDR(atom->documentation[type]) = atomseg.freeobj;
+       atomseg.freeobj = atom->documentation[type];
+       atom->documentation[type] = NULL;
+       ++atomseg.nfree;
+    }
+}
+
+LispObj *
+LispGetDocumentation(LispObj *symbol, LispDocType_t type)
+{
+    LispAtom *atom;
+
+    if (!SYMBOLP(symbol))
+       LispDestroy("DOCUMENTATION: invalid argument");
+
+    atom = symbol->data.atom;
+
+    return (atom->documentation[type] ? atom->documentation[type] : NIL);
+}
+
+LispObj *
+LispReverse(LispObj *list)
+{
+    LispObj *tmp, *res = NIL;
+
+    while (list != NIL) {
+       tmp = CDR(list);
+       CDR(list) = res;
+       res = list;
+       list = tmp;
+    }
+
+    return (res);
+}
+
+LispBlock *
+LispBeginBlock(LispObj *tag, LispBlockType type)
+{
+    LispBlock *block;
+    unsigned blevel = lisp__data.block.block_level + 1;
+
+    if (blevel > lisp__data.block.block_size) {
+       LispBlock **blk;
+
+       if (blevel > MAX_STACK_DEPTH)
+           LispDestroy("stack overflow");
+
+       DISABLE_INTERRUPTS();
+       blk = realloc(lisp__data.block.block, sizeof(LispBlock*) * (blevel + 1));
+
+       block = NULL;
+       if (blk == NULL || (block = malloc(sizeof(LispBlock))) == NULL) {
+           ENABLE_INTERRUPTS();
+           LispDestroy("out of memory");
+       }
+       lisp__data.block.block = blk;
+       lisp__data.block.block[lisp__data.block.block_size] = block;
+       lisp__data.block.block_size = blevel;
+       ENABLE_INTERRUPTS();
+    }
+    block = lisp__data.block.block[lisp__data.block.block_level];
+    if (type == LispBlockCatch && !CONSTANTP(tag)) {
+       tag = EVAL(tag);
+       lisp__data.protect.objects[lisp__data.protect.length++] = tag;
+    }
+    block->type = type;
+    block->tag = tag;
+    block->stack = lisp__data.stack.length;
+    block->protect = lisp__data.protect.length;
+    block->block_level = lisp__data.block.block_level;
+
+    lisp__data.block.block_level = blevel;
+
+#ifdef DEBUGGER
+    if (lisp__data.debugging) {
+       block->debug_level = lisp__data.debug_level;
+       block->debug_step = lisp__data.debug_step;
+    }
+#endif
+
+    return (block);
+}
+
+void
+LispEndBlock(LispBlock *block)
+{
+    lisp__data.protect.length = block->protect;
+    lisp__data.block.block_level = block->block_level;
+
+#ifdef DEBUGGER
+    if (lisp__data.debugging) {
+       if (lisp__data.debug_level >= block->debug_level) {
+           while (lisp__data.debug_level > block->debug_level) {
+               DBG = CDR(DBG);
+               --lisp__data.debug_level;
+           }
+       }
+       lisp__data.debug_step = block->debug_step;
+    }
+#endif
+}
+
+void
+LispBlockUnwind(LispBlock *block)
+{
+    LispBlock *unwind;
+    int blevel = lisp__data.block.block_level;
+
+    while (blevel > 0) {
+       unwind = lisp__data.block.block[--blevel];
+       if (unwind->type == LispBlockProtect) {
+           BLOCKJUMP(unwind);
+       }
+       if (unwind == block)
+           /* jump above unwind block */
+           break;
+    }
+}
+
+static LispObj *
+LispEvalBackquoteObject(LispObj *argument, int list, int quote)
+{
+    LispObj *result = argument, *object;
+
+    if (!POINTERP(argument))
+       return (argument);
+
+    else if (XCOMMAP(argument)) {
+       /* argument may need to be evaluated */
+
+       int atlist;
+
+       if (!list && argument->data.comma.atlist)
+           /* cannot append, not in a list */
+           LispDestroy("EVAL: ,@ only allowed on lists");
+
+       --quote;
+       if (quote < 0)
+           LispDestroy("EVAL: comma outside of backquote");
+
+       result = object = argument->data.comma.eval;
+       atlist = COMMAP(object) && object->data.comma.atlist;
+
+       if (POINTERP(result) && (XCOMMAP(result) || XBACKQUOTEP(result)))
+           /* nested commas, reduce 1 level, or backquote,
+            * don't call LispEval or quote argument will be reset */
+           result = LispEvalBackquoteObject(object, 0, quote);
+
+       else if (quote == 0)
+          /* just evaluate it */
+           result = EVAL(result);
+
+       if (quote != 0)
+           result = result == object ? argument : COMMA(result, atlist);
+    }
+
+    else if (XBACKQUOTEP(argument)) {
+       object = argument->data.quote;
+
+       result = LispEvalBackquote(object, quote + 1);
+       if (quote)
+           result = result == object ? argument : BACKQUOTE(result);
+    }
+
+    else if (XQUOTEP(argument) && POINTERP(argument->data.quote) &&
+            (XCOMMAP(argument->data.quote) ||
+             XBACKQUOTEP(argument->data.quote) ||
+             XCONSP(argument->data.quote))) {
+       /* ensures `',sym to be the same as `(quote ,sym) */
+       object = argument->data.quote;
+
+       result = LispEvalBackquote(argument->data.quote, quote);
+       result = result == object ? argument : QUOTE(result);
+    }
+
+    return (result);
+}
+
+LispObj *
+LispEvalBackquote(LispObj *argument, int quote)
+{
+    int protect;
+    LispObj *result, *object, *cons, *cdr;
+
+    if (!CONSP(argument))
+       return (LispEvalBackquoteObject(argument, 0, quote));
+
+    result = cdr = NIL;
+    protect = lisp__data.protect.length;
+
+    /* always generate a new list for the result, even if nothing
+     * is evaluated. It is not expected to use backqoutes when
+     * not required. */
+
+    /* reserve a GC protected slot for the result */
+    if (protect + 1 >= lisp__data.protect.space)
+       LispMoreProtects();
+    lisp__data.protect.objects[lisp__data.protect.length++] = NIL;
+
+    for (cons = argument; ; cons = CDR(cons)) {
+       /* if false, last argument, and if cons is not NIL, a dotted list */
+       int list = CONSP(cons), insert;
+
+       if (list)
+           object = CAR(cons);
+       else
+           object = cons;
+
+       if (COMMAP(object))
+           /* need to insert list elements in result, not just cons it? */
+           insert = object->data.comma.atlist;
+       else
+           insert = 0;
+
+       /* evaluate object, if required */
+       if (CONSP(object))
+           object = LispEvalBackquote(object, quote);
+       else
+           object = LispEvalBackquoteObject(object, insert, quote);
+
+       if (result == NIL) {
+           /* if starting result list */
+           if (!insert) {
+               if (list)
+                   result = cdr = CONS(object, NIL);
+               else
+                   result = cdr = object;
+               /* gc protect result */
+               lisp__data.protect.objects[protect] = result;
+           }
+           else {
+               if (!CONSP(object)) {
+                   result = cdr = object;
+                   /* gc protect result */
+                   lisp__data.protect.objects[protect] = result;
+               }
+               else {
+                   result = cdr = CONS(CAR(object), NIL);
+                   /* gc protect result */
+                   lisp__data.protect.objects[protect] = result;
+
+                   /* add remaining elements to result */
+                   for (object = CDR(object);
+                        CONSP(object);
+                        object = CDR(object)) {
+                       RPLACD(cdr, CONS(CAR(object), NIL));
+                       cdr = CDR(cdr);
+                   }
+                   if (object != NIL) {
+                       /* object was a dotted list */
+                       RPLACD(cdr, object);
+                       cdr = CDR(cdr);
+                   }
+               }
+           }
+       }
+       else {
+           if (!CONSP(cdr))
+               LispDestroy("EVAL: cannot append to %s", STROBJ(cdr));
+
+           if (!insert) {
+               if (list) {
+                   RPLACD(cdr, CONS(object, NIL));
+                   cdr = CDR(cdr);
+               }
+               else {
+                   RPLACD(cdr, object);
+                   cdr = object;
+               }
+           }
+           else {
+               if (!CONSP(object)) {
+                   RPLACD(cdr, object);
+                   /* if object is NIL, it is a empty list appended, not
+                    * creating a dotted list. */
+                   if (object != NIL)
+                       cdr = object;
+               }
+               else {
+                   for (; CONSP(object); object = CDR(object)) {
+                       RPLACD(cdr, CONS(CAR(object), NIL));
+                       cdr = CDR(cdr);
+                   }
+                   if (object != NIL) {
+                       /* object was a dotted list */
+                       RPLACD(cdr, object);
+                       cdr = CDR(cdr);
+                   }
+               }
+           }
+       }
+
+       /* if last argument list element processed */
+       if (!list)
+           break;
+    }
+
+    lisp__data.protect.length = protect;
+
+    return (result);
+}
+
+void
+LispMoreEnvironment(void)
+{
+    Atom_id *names;
+    LispObj **values;
+
+    DISABLE_INTERRUPTS();
+    names = realloc(lisp__data.env.names,
+                   (lisp__data.env.space + 256) * sizeof(Atom_id));
+    if (names != NULL) {
+       values = realloc(lisp__data.env.values,
+                        (lisp__data.env.space + 256) * sizeof(LispObj*));
+       if (values != NULL) {
+           lisp__data.env.names = names;
+           lisp__data.env.values = values;
+           lisp__data.env.space += 256;
+           ENABLE_INTERRUPTS();
+           return;
+       }
+       else
+           free(names);
+    }
+    ENABLE_INTERRUPTS();
+    LispDestroy("out of memory");
+}
+
+void
+LispMoreStack(void)
+{
+    LispObj **values;
+
+    DISABLE_INTERRUPTS();
+    values = realloc(lisp__data.stack.values,
+                    (lisp__data.stack.space + 256) * sizeof(LispObj*));
+    if (values == NULL) {
+       ENABLE_INTERRUPTS();
+       LispDestroy("out of memory");
+    }
+    lisp__data.stack.values = values;
+    lisp__data.stack.space += 256;
+    ENABLE_INTERRUPTS();
+}
+
+void
+LispMoreGlobals(LispPackage *pack)
+{
+    LispObj **pairs;
+
+    DISABLE_INTERRUPTS();
+    pairs = realloc(pack->glb.pairs,
+                   (pack->glb.space + 256) * sizeof(LispObj*));
+    if (pairs == NULL) {
+       ENABLE_INTERRUPTS();
+       LispDestroy("out of memory");
+    }
+    pack->glb.pairs = pairs;
+    pack->glb.space += 256;
+    ENABLE_INTERRUPTS();
+}
+
+void
+LispMoreProtects(void)
+{
+    LispObj **objects;
+
+    DISABLE_INTERRUPTS();
+    objects = realloc(lisp__data.protect.objects,
+                     (lisp__data.protect.space + 256) * sizeof(LispObj*));
+    if (objects == NULL) {
+       ENABLE_INTERRUPTS();
+       LispDestroy("out of memory");
+    }
+    lisp__data.protect.objects = objects;
+    lisp__data.protect.space += 256;
+    ENABLE_INTERRUPTS();
+}
+
+static int
+LispMakeEnvironment(LispArgList *alist, LispObj *values,
+                   LispObj *name, int eval, int builtin)
+{
+    char *desc;
+    int i, count, base;
+    LispObj **symbols, **defaults, **sforms;
+
+#define BUILTIN_ARGUMENT(value)                                \
+    lisp__data.stack.values[lisp__data.stack.length++] = value
+
+/* If the index value is from register variables, this
+ * can save some cpu time. Useful for normal arguments
+ * that are the most common, and thus the ones that
+ * consume more time in LispMakeEnvironment. */
+#define BUILTIN_NO_EVAL_ARGUMENT(index, value)         \
+    lisp__data.stack.values[index] = value
+
+#define NORMAL_ARGUMENT(symbol, value)                 \
+    LispDoAddVar(symbol, value)
+
+    if (builtin) {
+       base = lisp__data.stack.length;
+       if (base + alist->num_arguments > lisp__data.stack.space) {
+           do
+               LispMoreStack();
+           while (base + alist->num_arguments > lisp__data.stack.space);
+       }
+    }
+    else {
+       base = lisp__data.env.length;
+       if (base + alist->num_arguments > lisp__data.env.space) {
+           do
+               LispMoreEnvironment();
+           while (base + alist->num_arguments > lisp__data.env.space);
+       }
+    }
+
+    desc = alist->description;
+    switch (*desc++) {
+       case '.':
+           goto normal_label;
+       case 'o':
+           goto optional_label;
+       case 'k':
+           goto key_label;
+       case 'r':
+           goto rest_label;
+       case 'a':
+           goto aux_label;
+       default:
+           goto done_label;
+    }
+
+
+    /* Code below is done in several almost identical loops, to avoid
+     * checking the value of the arguments eval and builtin too much times */
+
+
+    /* Normal arguments */
+normal_label:
+    i = 0;
+    count = alist->normals.num_symbols;
+    if (builtin) {
+       if (eval) {
+           for (; i < count && CONSP(values); i++, values = CDR(values)) {
+               BUILTIN_ARGUMENT(EVAL(CAR(values)));
+           }
+       }
+       else {
+           for (; i < count && CONSP(values); i++, values = CDR(values)) {
+               BUILTIN_NO_EVAL_ARGUMENT(base + i, CAR(values));
+           }
+           /* macro BUILTIN_NO_EVAL_ARGUMENT does not update
+            * lisp__data.stack.length, as there is no risk of GC while
+            * adding the arguments. */
+           lisp__data.stack.length += i;
+       }
+    }
+    else {
+       symbols = alist->normals.symbols;
+       if (eval) {
+           for (; i < count && CONSP(values); i++, values = CDR(values)) {
+               NORMAL_ARGUMENT(symbols[i], EVAL(CAR(values)));
+           }
+       }
+       else {
+           for (; i < count && CONSP(values); i++, values = CDR(values)) {
+               NORMAL_ARGUMENT(symbols[i], CAR(values));
+           }
+       }
+    }
+    if (i < count)
+       LispDestroy("%s: too few arguments", STROBJ(name));
+
+    switch (*desc++) {
+       case 'o':
+           goto optional_label;
+       case 'k':
+           goto key_label;
+       case 'r':
+           goto rest_label;
+       case 'a':
+           goto aux_label;
+       default:
+           goto done_label;
+    }
+
+    /* &OPTIONAL */
+optional_label:
+    i = 0;
+    count = alist->optionals.num_symbols;
+    defaults = alist->optionals.defaults;
+    sforms = alist->optionals.sforms;
+    if (builtin) {
+       if (eval) {
+           for (; i < count && CONSP(values); i++, values = CDR(values))
+               BUILTIN_ARGUMENT(EVAL(CAR(values)));
+           for (; i < count; i++)
+               BUILTIN_ARGUMENT(UNSPEC);
+       }
+       else {
+           for (; i < count && CONSP(values); i++, values = CDR(values))
+               BUILTIN_ARGUMENT(CAR(values));
+           for (; i < count; i++)
+               BUILTIN_ARGUMENT(UNSPEC);
+       }
+    }
+    else {
+       symbols = alist->optionals.symbols;
+       if (eval) {
+           for (; i < count && CONSP(values); i++, values = CDR(values)) {
+               NORMAL_ARGUMENT(symbols[i], EVAL(CAR(values)));
+               if (sforms[i]) {
+                   NORMAL_ARGUMENT(sforms[i], T);
+               }
+           }
+       }
+       else {
+           for (; i < count && CONSP(values); i++, values = CDR(values)) {
+               NORMAL_ARGUMENT(symbols[i], CAR(values));
+               if (sforms[i]) {
+                   NORMAL_ARGUMENT(sforms[i], T);
+               }
+           }
+       }
+
+       /* default arguments are evaluated for macros */
+       for (; i < count; i++) {
+           if (!CONSTANTP(defaults[i])) {
+               int head = lisp__data.env.head;
+               int lex = lisp__data.env.lex;
+
+               lisp__data.env.lex = base;
+               lisp__data.env.head = lisp__data.env.length;
+               NORMAL_ARGUMENT(symbols[i], EVAL(defaults[i]));
+               lisp__data.env.head = head;
+               lisp__data.env.lex = lex;
+           }
+           else {
+               NORMAL_ARGUMENT(symbols[i], defaults[i]);
+           }
+           if (sforms[i]) {
+               NORMAL_ARGUMENT(sforms[i], NIL);
+           }
+       }
+    }
+    switch (*desc++) {
+       case 'k':
+           goto key_label;
+       case 'r':
+           goto rest_label;
+       case 'a':
+           goto aux_label;
+       default:
+           goto done_label;
+    }
+
+    /* &KEY */
+key_label:
+    {
+       int argc, nused;
+       LispObj *val, *karg, **keys;
+
+       /* Count number of remaining arguments */
+       for (karg = values, argc = 0; CONSP(karg); karg = CDR(karg), argc++) {
+           karg = CDR(karg);
+           if (!CONSP(karg))
+               LispDestroy("%s: &KEY needs arguments as pairs",
+                           STROBJ(name));
+       }
+
+
+       /* OPTIMIZATION:
+        * Builtin functions require that the keyword be in the keyword package.
+        * User functions don't need the arguments being pushed in the stack
+        * in the declared order (bytecode expects it...).
+        * XXX Error checking should be done elsewhere, code may be looping
+        * and doing error check here may consume too much cpu time.
+        * XXX Would also be good to already have the arguments specified in
+        * the correct order.
+        */
+
+
+       nused = 0;
+       val = NIL;
+       count = alist->keys.num_symbols;
+       symbols = alist->keys.symbols;
+       defaults = alist->keys.defaults;
+       sforms = alist->keys.sforms;
+       if (builtin) {
+
+           /* Arguments must be created in the declared order */
+           i = 0;
+           if (eval) {
+               for (; i < count; i++) {
+                   for (karg = values; CONSP(karg); karg = CDDR(karg)) {
+                       /* This is only true if both point to the
+                        * same symbol in the keyword package. */
+                       if (symbols[i] == CAR(karg)) {
+                           if (karg == values)
+                               values = CDDR(values);
+                           ++nused;
+                           BUILTIN_ARGUMENT(EVAL(CADR(karg)));
+                           goto keyword_builtin_eval_used_label;
+                       }
+                   }
+                   BUILTIN_ARGUMENT(UNSPEC);
+keyword_builtin_eval_used_label:;
+               }
+           }
+           else {
+               for (; i < count; i++) {
+                   for (karg = values; CONSP(karg); karg = CDDR(karg)) {
+                       if (symbols[i] == CAR(karg)) {
+                           if (karg == values)
+                               values = CDDR(values);
+                           ++nused;
+                           BUILTIN_ARGUMENT(CADR(karg));
+                           goto keyword_builtin_used_label;
+                       }
+                   }
+                   BUILTIN_ARGUMENT(UNSPEC);
+keyword_builtin_used_label:;
+               }
+           }
+
+           if (argc != nused) {
+               /* Argument(s) may be incorrectly specified, or specified
+                * twice (what is not an error). */
+               for (karg = values; CONSP(karg); karg = CDDR(karg)) {
+                   val = CAR(karg);
+                   if (KEYWORDP(val)) {
+                       for (i = 0; i < count; i++)
+                           if (symbols[i] == val)
+                               break;
+                   }
+                   else
+                       /* Just make the error test true */
+                       i = count;
+
+                   if (i == count)
+                       goto invalid_keyword_label;
+               }
+           }
+       }
+
+#if 0
+       else {
+           /* The base offset of the atom in the stack, to check for
+            * keywords specified twice. */
+           LispObj *symbol;
+           int offset = lisp__data.env.length;
+
+           keys = alist->keys.keys;
+           for (karg = values; CONSP(karg); karg = CDDR(karg)) {
+               symbol = CAR(karg);
+               if (SYMBOLP(symbol)) {
+                   /* Must be a keyword, but even if it is a keyword, may
+                    * be a typo, so assume it is correct. If it is not
+                    * in the argument list, it is an error. */
+                   for (i = 0; i < count; i++) {
+                       if (!keys[i] && symbols[i] == symbol) {
+                           LispAtom *atom = symbol->data.atom;
+
+                           /* Symbol found in the argument list. */
+                           if (atom->offset >= offset &&
+                               atom->offset < offset + nused &&
+                               lisp__data.env.names[atom->offset] ==
+                               atom->string)
+                               /* Specified more than once... */
+                               goto keyword_duplicated_label;
+                           break;
+                       }
+                   }
+               }
+               else {
+                   Atom_id id;
+
+                   if (!QUOTEP(symbol) || !SYMBOLP(val = symbol->data.quote)) {
+                       /* Bad argument. */
+                       val = symbol;
+                       goto invalid_keyword_label;
+                   }
+
+                   id = ATOMID(val);
+                   for (i = 0; i < count; i++) {
+                       if (keys[i] && ATOMID(keys[i]) == id) {
+                           LispAtom *atom = val->data.atom;
+
+                           /* Symbol found in the argument list. */
+                           if (atom->offset >= offset &&
+                               atom->offset < offset + nused &&
+                               lisp__data.env.names[atom->offset] ==
+                               atom->string)
+                               /* Specified more than once... */
+                               goto keyword_duplicated_label;
+                           break;
+                       }
+                   }
+               }
+               if (i == count) {
+                   /* Argument specification not found. */
+                   val = symbol;
+                   goto invalid_keyword_label;
+               }
+               ++nused;
+               if (eval) {
+                   NORMAL_ARGUMENT(symbols[i], EVAL(CADR(karg)));
+               }
+               else {
+                   NORMAL_ARGUMENT(symbols[i], CADR(karg));
+               }
+               if (sforms[i]) {
+                   NORMAL_ARGUMENT(sforms[i], T);
+               }
+keyword_duplicated_label:;
+           }
+
+           /* Add variables that were not specified in the function call. */
+           if (nused < count) {
+               int j;
+
+               for (i = 0; i < count; i++) {
+                   Atom_id id = ATOMID(symbols[i]);
+
+                   for (j = offset + nused - 1; j >= offset; j--) {
+                       if (lisp__data.env.names[j] == id)
+                           break;
+                   }
+
+                   if (j < offset) {
+                       /* Argument not specified. Use default value */
+
+                       /* default arguments are evaluated for macros */
+                       if (!CONSTANTP(defaults[i])) {
+                           int head = lisp__data.env.head;
+                           int lex = lisp__data.env.lex;
+
+                           lisp__data.env.lex = base;
+                           lisp__data.env.head = lisp__data.env.length;
+                           NORMAL_ARGUMENT(symbols[i], EVAL(defaults[i]));
+                           lisp__data.env.head = head;
+                           lisp__data.env.lex = lex;
+                       }
+                       else {
+                           NORMAL_ARGUMENT(symbols[i], defaults[i]);
+                       }
+                       if (sforms[i]) {
+                           NORMAL_ARGUMENT(sforms[i], NIL);
+                       }
+                   }
+               }
+           }
+       }
+#else
+       else {
+           int varset;
+
+           sforms = alist->keys.sforms;
+           keys = alist->keys.keys;
+
+           /* Add variables */
+           for (i = 0; i < alist->keys.num_symbols; i++) {
+               val = defaults[i];
+               varset = 0;
+               if (keys[i]) {
+                   Atom_id atom = ATOMID(keys[i]);
+
+                   /* Special keyword specification, need to compare ATOMID
+                    * and keyword specification must be a quoted object */
+                   for (karg = values; CONSP(karg); karg = CDR(karg)) {
+                       val = CAR(karg);
+                       if (QUOTEP(val) && atom == ATOMID(val->data.quote)) {
+                           val = CADR(karg);
+                           varset = 1;
+                           ++nused;
+                           break;
+                       }
+                       karg = CDR(karg);
+                   }
+               }
+
+               else {
+                   /* Normal keyword specification, can compare object pointers,
+                    * as they point to the same object in the keyword package */
+                   for (karg = values; CONSP(karg); karg = CDR(karg)) {
+                       /* Don't check if argument is a valid keyword or
+                        * special quoted keyword */
+                       if (symbols[i] == CAR(karg)) {
+                           val = CADR(karg);
+                           varset = 1;
+                           ++nused;
+                           break;
+                       }
+                       karg = CDR(karg);
+                   }
+               }
+
+               /* Add the variable to environment */
+               if (varset) {
+                   NORMAL_ARGUMENT(symbols[i], eval ? EVAL(val) : val);
+                   if (sforms[i]) {
+                       NORMAL_ARGUMENT(sforms[i], T);
+                   }
+               }
+               else {
+                   /* default arguments are evaluated for macros */
+                   if (!CONSTANTP(val)) {
+                       int head = lisp__data.env.head;
+                       int lex = lisp__data.env.lex;
+
+                       lisp__data.env.lex = base;
+                       lisp__data.env.head = lisp__data.env.length;
+                       NORMAL_ARGUMENT(symbols[i], EVAL(val));
+                       lisp__data.env.head = head;
+                       lisp__data.env.lex = lex;
+                   }
+                   else {
+                       NORMAL_ARGUMENT(symbols[i], val);
+                   }
+                   if (sforms[i]) {
+                       NORMAL_ARGUMENT(sforms[i], NIL);
+                   }
+               }
+           }
+
+           if (argc != nused) {
+               /* Argument(s) may be incorrectly specified, or specified
+                * twice (what is not an error). */
+               for (karg = values; CONSP(karg); karg = CDDR(karg)) {
+                   val = CAR(karg);
+                   if (KEYWORDP(val)) {
+                       for (i = 0; i < count; i++)
+                           if (symbols[i] == val)
+                               break;
+                   }
+                   else if (QUOTEP(val) && SYMBOLP(val->data.quote)) {
+                       Atom_id atom = ATOMID(val->data.quote);
+
+                       for (i = 0; i < count; i++)
+                           if (ATOMID(keys[i]) == atom)
+                               break;
+                   }
+                   else
+                       /* Just make the error test true */
+                       i = count;
+
+                   if (i == count)
+                       goto invalid_keyword_label;
+               }
+           }
+       }
+#endif
+       goto check_aux_label;
+
+invalid_keyword_label:
+       {
+           /* If not in argument specification list... */
+           char function_name[36];
+
+           strcpy(function_name, STROBJ(name));
+           LispDestroy("%s: %s is an invalid keyword",
+                       function_name, STROBJ(val));
+       }
+    }
+
+check_aux_label:
+    if (*desc == 'a') {
+       /* &KEY uses all remaining arguments */
+       values = NIL;
+       goto aux_label;
+    }
+    goto finished_label;
+
+    /* &REST */
+rest_label:
+    if (!CONSP(values)) {
+       if (builtin) {
+           BUILTIN_ARGUMENT(values);
+       }
+       else {
+           NORMAL_ARGUMENT(alist->rest, values);
+       }
+       values = NIL;
+    }
+    /* always allocate a new list, don't know if it will be retained */
+    else if (eval) {
+       LispObj *cons;
+
+       cons = CONS(EVAL(CAR(values)), NIL);
+       if (builtin) {
+           BUILTIN_ARGUMENT(cons);
+       }
+       else {
+           NORMAL_ARGUMENT(alist->rest, cons);
+       }
+       values = CDR(values);
+       for (; CONSP(values); values = CDR(values)) {
+           RPLACD(cons, CONS(EVAL(CAR(values)), NIL));
+           cons = CDR(cons);
+       }
+    }
+    else {
+       LispObj *cons;
+
+       cons = CONS(CAR(values), NIL);
+       if (builtin) {
+           BUILTIN_ARGUMENT(cons);
+       }
+       else {
+           NORMAL_ARGUMENT(alist->rest, cons);
+       }
+       values = CDR(values);
+       for (; CONSP(values); values = CDR(values)) {
+           RPLACD(cons, CONS(CAR(values), NIL));
+           cons = CDR(cons);
+       }
+    }
+    if (*desc != 'a')
+       goto finished_label;
+
+    /* &AUX */
+aux_label:
+    i = 0;
+    count = alist->auxs.num_symbols;
+    defaults = alist->auxs.initials;
+    symbols = alist->auxs.symbols;
+    {
+       int lex = lisp__data.env.lex;
+
+       lisp__data.env.lex = base;
+       lisp__data.env.head = lisp__data.env.length;
+       for (; i < count; i++) {
+           NORMAL_ARGUMENT(symbols[i], EVAL(defaults[i]));
+           ++lisp__data.env.head;
+       }
+       lisp__data.env.lex = lex;
+    }
+
+done_label:
+    if (CONSP(values))
+       LispDestroy("%s: too many arguments", STROBJ(name));
+
+finished_label:
+    if (builtin)
+       lisp__data.stack.base = base;
+    else {
+       lisp__data.env.head = lisp__data.env.length;
+    }
+#undef BULTIN_ARGUMENT
+#undef NORMAL_ARGUMENT
+#undef BUILTIN_NO_EVAL_ARGUMENT
+
+    return (base);
+}
+
+LispObj *
+LispFuncall(LispObj *function, LispObj *arguments, int eval)
+{
+    LispAtom *atom;
+    LispArgList *alist;
+    LispBuiltin *builtin;
+    LispObj *lambda, *result;
+    int macro, base;
+
+#ifdef DEBUGGER
+    if (lisp__data.debugging)
+       LispDebugger(LispDebugCallBegin, function, arguments);
+#endif
+
+    switch (OBJECT_TYPE(function)) {
+       case LispFunction_t:
+           function = function->data.atom->object;
+       case LispAtom_t:
+           atom = function->data.atom;
+           if (atom->a_builtin) {
+               builtin = atom->property->fun.builtin;
+
+               if (eval)
+                   eval = builtin->type != LispMacro;
+               base = LispMakeEnvironment(atom->property->alist,
+                                          arguments, function, eval, 1);
+               if (builtin->multiple_values) {
+                   RETURN_COUNT = 0;
+                   result = builtin->function(builtin);
+               }
+               else {
+                   result = builtin->function(builtin);
+                   RETURN_COUNT = 0;
+               }
+               lisp__data.stack.base = lisp__data.stack.length = base;
+           }
+           else if (atom->a_compiled) {
+               int lex = lisp__data.env.lex;
+               lambda = atom->property->fun.function;
+               alist = atom->property->alist;
+
+               base = LispMakeEnvironment(alist, arguments, function, eval, 0);
+               lisp__data.env.lex = base;
+               result = LispExecuteBytecode(lambda);
+               lisp__data.env.lex = lex;
+               lisp__data.env.head = lisp__data.env.length = base;
+           }
+           else if (atom->a_function) {
+               lambda = atom->property->fun.function;
+               macro = lambda->funtype == LispMacro;
+               alist = atom->property->alist;
+
+               lambda = lambda->data.lambda.code;
+               if (eval)
+                   eval = !macro;
+               base = LispMakeEnvironment(alist, arguments, function, eval, 0);
+               result = LispRunFunMac(function, lambda, macro, base);
+           }
+           else if (atom->a_defstruct &&
+                    atom->property->structure.function != STRUCT_NAME) {
+               LispObj cons;
+
+               if (atom->property->structure.function == STRUCT_CONSTRUCTOR)
+                   atom = Omake_struct->data.atom;
+               else if (atom->property->structure.function == STRUCT_CHECK)
+                   atom = Ostruct_type->data.atom;
+               else
+                   atom = Ostruct_access->data.atom;
+               builtin = atom->property->fun.builtin;
+
+               cons.type = LispCons_t;
+               cons.data.cons.cdr = arguments;
+               if (eval) {
+                   LispObj quote;
+
+                   quote.type = LispQuote_t;
+                   quote.data.quote = function;
+                   cons.data.cons.car = &quote;
+                   base = LispMakeEnvironment(atom->property->alist,
+                                              &cons, function, 1, 1);
+               }
+               else {
+                   cons.data.cons.car = function;
+                   base = LispMakeEnvironment(atom->property->alist,
+                                              &cons, function, 0, 1);
+               }
+               result = builtin->function(builtin);
+               RETURN_COUNT = 0;
+               lisp__data.stack.length = base;
+           }
+           else {
+               LispDestroy("EVAL: the function %s is not defined",
+                           STROBJ(function));
+               /*NOTREACHED*/
+               result = NIL;
+           }
+           break;
+       case LispLambda_t:
+           lambda = function->data.lambda.code;
+           alist = (LispArgList*)function->data.lambda.name->data.opaque.data;
+           base = LispMakeEnvironment(alist, arguments, function, eval, 0);
+           result = LispRunFunMac(function, lambda, 0, base);
+           break;
+       case LispCons_t:
+           if (CAR(function) == Olambda) {
+               function = EVAL(function);
+               if (LAMBDAP(function)) {
+                   GC_ENTER();
+
+                   GC_PROTECT(function);
+                   lambda = function->data.lambda.code;
+                   alist = (LispArgList*)function->data.lambda.name->data.opaque.data;
+                   base = LispMakeEnvironment(alist, arguments, NIL, eval, 0);
+                   result = LispRunFunMac(NIL, lambda, 0, base);
+                   GC_LEAVE();
+                   break;
+               }
+           }
+       default:
+           LispDestroy("EVAL: %s is invalid as a function",
+                       STROBJ(function));
+           /*NOTREACHED*/
+           result = NIL;
+           break;
+    }
+
+#ifdef DEBUGGER
+    if (lisp__data.debugging)
+       LispDebugger(LispDebugCallEnd, function, result);
+#endif
+
+    return (result);
+}
+
+LispObj *
+LispEval(LispObj *object)
+{
+    LispObj *result;
+
+    switch (OBJECT_TYPE(object)) {
+       case LispAtom_t:
+           if ((result = LispDoGetVar(object)) == NULL)
+               LispDestroy("EVAL: the variable %s is unbound", STROBJ(object));
+           break;
+       case LispCons_t:
+           result = LispFuncall(CAR(object), CDR(object), 1);
+           break;
+       case LispQuote_t:
+           result = object->data.quote;
+           break;
+       case LispFunctionQuote_t:
+           result = object->data.quote;
+           if (SYMBOLP(result))
+               result = LispSymbolFunction(result);
+           else if (CONSP(result) && CAR(result) == Olambda)
+               result = EVAL(result);
+           else
+               LispDestroy("FUNCTION: %s is not a function", STROBJ(result));
+           break;
+       case LispBackquote_t:
+           result = LispEvalBackquote(object->data.quote, 1);
+           break;
+       case LispComma_t:
+           LispDestroy("EVAL: comma outside of backquote");
+       default:
+           result = object;
+           break;
+    }
+
+    return (result);
+}
+
+LispObj *
+LispApply1(LispObj *function, LispObj *argument)
+{
+    LispObj arguments;
+
+    arguments.type = LispCons_t;
+    arguments.data.cons.car = argument;
+    arguments.data.cons.cdr = NIL;
+
+    return (LispFuncall(function, &arguments, 0));
+}
+
+LispObj *
+LispApply2(LispObj *function, LispObj *argument1, LispObj *argument2)
+{
+    LispObj arguments, cdr;
+
+    arguments.type = cdr.type = LispCons_t;
+    arguments.data.cons.car = argument1;
+    arguments.data.cons.cdr = &cdr;
+    cdr.data.cons.car = argument2;
+    cdr.data.cons.cdr = NIL;
+
+    return (LispFuncall(function, &arguments, 0));
+}
+
+LispObj *
+LispApply3(LispObj *function, LispObj *arg1, LispObj *arg2, LispObj *arg3)
+{
+    LispObj arguments, car, cdr;
+
+    arguments.type = car.type = cdr.type = LispCons_t;
+    arguments.data.cons.car = arg1;
+    arguments.data.cons.cdr = &car;
+    car.data.cons.car = arg2;
+    car.data.cons.cdr = &cdr;
+    cdr.data.cons.car = arg3;
+    cdr.data.cons.cdr = NIL;
+
+    return (LispFuncall(function, &arguments, 0));
+}
+
+static LispObj *
+LispRunFunMac(LispObj *name, LispObj *code, int macro, int base)
+{
+    LispObj *result = NIL;
+
+    if (!macro) {
+       int lex = lisp__data.env.lex;
+       int did_jump = 1;
+       LispBlock *block;
+
+       block = LispBeginBlock(name, LispBlockClosure);
+       lisp__data.env.lex = base;
+       if (setjmp(block->jmp) == 0) {
+           for (; CONSP(code); code = CDR(code))
+               result = EVAL(CAR(code));
+           did_jump = 0;
+       }
+       LispEndBlock(block);
+       if (did_jump)
+           result = lisp__data.block.block_ret;
+       lisp__data.env.lex = lex;
+       lisp__data.env.head = lisp__data.env.length = base;
+    }
+    else {
+       GC_ENTER();
+
+       for (; CONSP(code); code = CDR(code))
+           result = EVAL(CAR(code));
+       /* FIXME this does not work if macro has &aux variables,
+        * but there are several other missing features, like
+        * destructuring and more lambda list keywords still missing.
+        * TODO later.
+        */
+       lisp__data.env.head = lisp__data.env.length = base;
+
+       GC_PROTECT(result);
+       result = EVAL(result);
+       GC_LEAVE();
+    }
+
+    return (result);
+}
+
+LispObj *
+LispRunSetf(LispArgList *alist, LispObj *setf, LispObj *place, LispObj *value)
+{
+    GC_ENTER();
+    LispObj *store, *code, *expression, *result, quote;
+    int base;
+
+    code = setf->data.lambda.code;
+    store = setf->data.lambda.data;
+
+    quote.type = LispQuote_t;
+    quote.data.quote = value;
+    LispDoAddVar(CAR(store), &quote);
+    ++lisp__data.env.head;
+    base = LispMakeEnvironment(alist, place, Oexpand_setf_method, 0, 0);
+
+    /* build expansion macro */
+    expression = NIL;
+    for (; CONSP(code); code = CDR(code))
+       expression = EVAL(CAR(code));
+
+    /* Minus 1 to pop the added variable */
+    lisp__data.env.head = lisp__data.env.length = base - 1;
+
+    /* protect expansion, and executes it */
+    GC_PROTECT(expression);
+    result = EVAL(expression);
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+LispRunSetfMacro(LispAtom *atom, LispObj *arguments, LispObj *value)
+{
+    int base;
+    GC_ENTER();
+    LispObj *place, *body, *result, quote;
+
+    place = NIL;
+    base = LispMakeEnvironment(atom->property->alist,
+                              arguments, atom->object, 0, 0);
+    body = atom->property->fun.function->data.lambda.code;
+
+    /* expand macro body */
+    for (; CONSP(body); body = CDR(body))
+       place = EVAL(CAR(body));
+
+    /* protect expansion */
+    GC_PROTECT(place);
+
+    /* restore environment */
+    lisp__data.env.head = lisp__data.env.length = base;
+
+    /* value is already evaluated */
+    quote.type = LispQuote_t;
+    quote.data.quote = value;
+
+    /* call setf again */
+    result = APPLY2(Osetf, place, &quote);
+
+    GC_LEAVE();
+
+    return (result);
+}
+
+char *
+LispStrObj(LispObj *object)
+{
+    static int first = 1;
+    static char buffer[34];
+    static LispObj stream;
+    static LispString string;
+
+    if (first) {
+       stream.type = LispStream_t;
+       stream.data.stream.source.string = &string;
+       stream.data.stream.pathname = NIL;
+       stream.data.stream.type = LispStreamString;
+       stream.data.stream.readable = 0;
+       stream.data.stream.writable = 1;
+
+       string.string = buffer;
+       string.fixed = 1;
+       string.space = sizeof(buffer) - 1;
+       first = 0;
+    }
+
+    string.length = string.output = 0;
+
+    LispWriteObject(&stream, object);
+
+    /* make sure string is nul terminated */
+    string.string[string.length] = '\0';
+    if (string.length >= 32) {
+       if (buffer[0] == '(')
+           strcpy(buffer + 27, "...)");
+       else
+           strcpy(buffer + 28, "...");
+    }
+
+    return (buffer);
+}
+
+void
+LispPrint(LispObj *object, LispObj *stream, int newline)
+{
+    if (stream != NIL && !STREAMP(stream)) {
+       LispDestroy("PRINT: %s is not a stream", STROBJ(stream));
+    }
+    if (newline && LispGetColumn(stream))
+       LispWriteChar(stream, '\n');
+    LispWriteObject(stream, object);
+    if (stream == NIL || (stream->data.stream.type == LispStreamStandard &&
+       stream->data.stream.source.file == Stdout))
+       LispFflush(Stdout);
+}
+
+void
+LispUpdateResults(LispObj *cod, LispObj *res)
+{
+    LispSetVar(RUN[2], LispGetVar(RUN[1]));
+    LispSetVar(RUN[1], LispGetVar(RUN[0]));
+    LispSetVar(RUN[0], cod);
+
+    LispSetVar(RES[2], LispGetVar(RES[1]));
+    LispSetVar(RES[1], LispGetVar(RES[0]));
+    LispSetVar(RES[0], res);
+}
+
+#ifdef SIGNALRETURNSINT
+int
+#else
+void
+#endif
+LispSignalHandler(int signum)
+{
+    LispSignal(signum);
+#ifdef SIGNALRETURNSINT
+    return (0);
+#endif
+}
+
+void
+LispSignal(int signum)
+{
+    char *errstr;
+    char buffer[32];
+
+    if (lisp__disable_int) {
+       lisp__interrupted = signum;
+       return;
+    }
+    switch (signum) {
+       case SIGINT:
+           errstr = "interrupted";
+           break;
+       case SIGFPE:
+           errstr = "floating point exception";
+           break;
+       default:
+           sprintf(buffer, "signal %d received", signum);
+           errstr = buffer;
+           break;
+    }
+    LispDestroy(errstr);
+}
+
+void
+LispDisableInterrupts(void)
+{
+    ++lisp__disable_int;
+}
+
+void
+LispEnableInterrupts(void)
+{
+    --lisp__disable_int;
+    if (lisp__disable_int <= 0 && lisp__interrupted)
+       LispSignal(lisp__interrupted);
+}
+
+void
+LispMachine(void)
+{
+    LispObj *cod, *obj;
+
+    lisp__data.sigint = signal(SIGINT, LispSignalHandler);
+    lisp__data.sigfpe = signal(SIGFPE, LispSignalHandler);
+
+    /*CONSTCOND*/
+    while (1) {
+       if (sigsetjmp(lisp__data.jmp, 1) == 0) {
+           lisp__data.running = 1;
+           if (lisp__data.interactive && lisp__data.prompt) {
+               LispFputs(Stdout, lisp__data.prompt);
+               LispFflush(Stdout);
+           }
+           if ((cod = LispRead()) != NULL) {
+               obj = EVAL(cod);
+               if (lisp__data.interactive) {
+                   if (RETURN_COUNT >= 0)
+                       LispPrint(obj, NIL, 1);
+                   if (RETURN_COUNT > 0) {
+                       int i;
+
+                       for (i = 0; i < RETURN_COUNT; i++)
+                           LispPrint(RETURN(i), NIL, 1);
+                   }
+                   LispUpdateResults(cod, obj);
+                   if (LispGetColumn(NIL))
+                       LispWriteChar(NIL, '\n');
+               }
+           }
+           LispTopLevel();
+       }
+       if (lisp__data.eof)
+           break;
+    }
+
+    signal(SIGINT, lisp__data.sigint);
+    signal(SIGFPE, lisp__data.sigfpe);
+
+    lisp__data.running = 0;
+}
+
+void *
+LispExecute(char *str)
+{
+    static LispObj stream;
+    static LispString string;
+    static int first = 1;
+
+    int running = lisp__data.running;
+    LispObj *result, *cod, *obj, **presult = &result;
+
+    if (str == NULL || *str == '\0')
+       return (NIL);
+
+    *presult = NIL;
+
+    if (first) {
+       stream.type = LispStream_t;
+       stream.data.stream.source.string = &string;
+       stream.data.stream.pathname = NIL;
+       stream.data.stream.type = LispStreamString;
+       stream.data.stream.readable = 1;
+       stream.data.stream.writable = 0;
+       string.output = 0;
+       first = 0;
+    }
+    string.string = str;
+    string.length = strlen(str);
+    string.input = 0;
+
+    LispPushInput(&stream);
+    if (!running) {
+       lisp__data.running = 1;
+       if (sigsetjmp(lisp__data.jmp, 1) != 0)
+           return (NULL);
+    }
+
+    cod = COD;
+    /*CONSTCOND*/
+    while (1) {
+       if ((obj = LispRead()) != NULL) {
+           result = EVAL(obj);
+           COD = cod;
+       }
+       if (lisp__data.eof)
+           break;
+    }
+    LispPopInput(&stream);
+
+    lisp__data.running = running;
+
+    return (result);
+}
+
+void
+LispBegin(void)
+{
+    int i;
+    LispAtom *atom;
+    char results[4];
+    LispObj *object, *path, *ext;
+
+    pagesize = LispGetPageSize();
+    segsize = pagesize / sizeof(LispObj);
+
+    lisp__data.strings = hash_new(STRTBLSZ, NULL);
+    lisp__data.opqs = hash_new(STRTBLSZ, NULL);
+
+    /* Initialize memory management */
+    lisp__data.mem.mem = (void**)calloc(lisp__data.mem.space = 16,
+                                       sizeof(void*));
+    lisp__data.mem.index = lisp__data.mem.level = 0;
+
+    /* Allow LispGetVar to check ATOMID() of unbound symbols */
+    UNBOUND->data.atom = (LispAtom*)LispCalloc(1, sizeof(LispAtom));
+    LispMused(UNBOUND->data.atom);
+    noproperty.value = UNBOUND;
+
+    if (Stdin == NULL)
+       Stdin = LispFdopen(0, FILE_READ);
+    if (Stdout == NULL)
+       Stdout = LispFdopen(1, FILE_WRITE | FILE_BUFFERED);
+    if (Stderr == NULL)
+       Stderr = LispFdopen(2, FILE_WRITE);
+
+    /* minimum number of free cells after GC
+     * if sizeof(LispObj) == 16, than a minfree of 1024 would try to keep
+     * at least 16Kb of free cells.
+     */
+    minfree = 1024;
+
+    MOD = COD = PRO = NIL;
+#ifdef DEBUGGER
+    DBG = BRK = NIL;
+#endif
+
+    /* allocate initial object cells */
+    LispAllocSeg(&objseg, minfree);
+    LispAllocSeg(&atomseg, pagesize);
+    lisp__data.gc.average = segsize;
+
+    /* Don't allow gc in initialization */
+    GCDisable();
+
+    /* Initialize package system, the current package is LISP. Order of
+     * initialization is very important here */
+    lisp__data.lisp = LispNewPackage(STRING("LISP"),
+                                    CONS(STRING("COMMON-LISP"), NIL));
+
+    /* Make LISP package the current one */
+    lisp__data.pack = lisp__data.savepack =
+       lisp__data.lisp->data.package.package;
+
+    /* Allocate space in LISP package */
+    LispMoreGlobals(lisp__data.pack);
+
+    /* Allocate  space for multiple value return values */
+    lisp__data.returns.values = malloc(MULTIPLE_VALUES_LIMIT *
+                                      (sizeof(LispObj*)));
+
+    /*  Create the first atom, do it "by hand" because macro "PACKAGE"
+     * cannot yet be used. */
+    atom = LispGetPermAtom("*PACKAGE*");
+    lisp__data.package = atomseg.freeobj;
+    atomseg.freeobj = CDR(atomseg.freeobj);
+    --atomseg.nfree;
+    lisp__data.package->type = LispAtom_t;
+    lisp__data.package->data.atom = atom;
+    atom->object = lisp__data.package;
+    atom->package = lisp__data.lisp;
+
+    /* Set package list, to be used by (gc) and (list-all-packages) */
+    PACK = CONS(lisp__data.lisp, NIL);
+
+    /* Make *PACKAGE* a special variable */
+    LispProclaimSpecial(lisp__data.package, lisp__data.lisp, NIL);
+
+       /* Value of macro "PACKAGE" is now properly available */
+
+    /* Changing *PACKAGE* is like calling (in-package) */
+    lisp__data.package->data.atom->watch = 1;
+
+    /* And available to other packages */
+    LispExportSymbol(lisp__data.package);
+
+    /* Initialize stacks */
+    LispMoreEnvironment();
+    LispMoreStack();
+
+    /* Create the KEYWORD package */
+    Skeyword = GETATOMID("KEYWORD");
+    object = LispNewPackage(STRING(Skeyword->value),
+                           CONS(STRING(""), NIL));
+
+    /* Update list of packages */
+    PACK = CONS(object, PACK);
+
+    /* Allow easy access to the keyword package */
+    lisp__data.keyword = object;
+    lisp__data.key = object->data.package.package;
+
+    /* Initialize some static important symbols */
+    Olambda            = STATIC_ATOM("LAMBDA");
+    LispExportSymbol(Olambda);
+    Okey               = STATIC_ATOM("&KEY");
+    LispExportSymbol(Okey);
+    Orest              = STATIC_ATOM("&REST");
+    LispExportSymbol(Orest);
+    Ooptional          = STATIC_ATOM("&OPTIONAL");
+    LispExportSymbol(Ooptional);
+    Oaux               = STATIC_ATOM("&AUX");
+    LispExportSymbol(Oaux);
+    Kunspecific                = KEYWORD("UNSPECIFIC");
+    Oformat            = STATIC_ATOM("FORMAT");
+    Oexpand_setf_method        = STATIC_ATOM("EXPAND-SETF-METHOD");
+
+    Omake_struct       = STATIC_ATOM("MAKE-STRUCT");
+    Ostruct_access     = STATIC_ATOM("STRUCT-ACCESS");
+    Ostruct_store      = STATIC_ATOM("STRUCT-STORE");
+    Ostruct_type       = STATIC_ATOM("STRUCT-TYPE");
+    Smake_struct       = ATOMID(Omake_struct);
+    Sstruct_access     = ATOMID(Ostruct_access);
+    Sstruct_store      = ATOMID(Ostruct_store);
+    Sstruct_type       = ATOMID(Ostruct_type);
+
+    /* Initialize some static atom ids */
+    Snil               = GETATOMID("NIL");
+    St                 = GETATOMID("T");
+    Saux               = ATOMID(Oaux);
+    Skey               = ATOMID(Okey);
+    Soptional          = ATOMID(Ooptional);
+    Srest              = ATOMID(Orest);
+    Sand               = GETATOMID("AND");
+    Sor                        = GETATOMID("OR");
+    Snot               = GETATOMID("NOT");
+    Satom              = GETATOMID("ATOM");
+    Ssymbol            = GETATOMID("SYMBOL");
+    Sinteger           = GETATOMID("INTEGER");
+    Scharacter         = GETATOMID("CHARACTER");
+    Sstring            = GETATOMID("STRING");
+    Slist              = GETATOMID("LIST");
+    Scons              = GETATOMID("CONS");
+    Svector            = GETATOMID("VECTOR");
+    Sarray             = GETATOMID("ARRAY");
+    Sstruct            = GETATOMID("STRUCT");
+    Sfunction          = GETATOMID("FUNCTION");
+    Spathname          = GETATOMID("PATHNAME");
+    Srational          = GETATOMID("RATIONAL");
+    Sfloat             = GETATOMID("FLOAT");
+    Scomplex           = GETATOMID("COMPLEX");
+    Sopaque            = GETATOMID("OPAQUE");
+    Sdefault           = GETATOMID("DEFAULT");
+
+    LispArgList_t      = LispRegisterOpaqueType("LispArgList*");
+
+    lisp__data.unget = malloc(sizeof(LispUngetInfo*));
+    lisp__data.unget[0] = calloc(1, sizeof(LispUngetInfo));
+    lisp__data.nunget = 1;
+
+    lisp__data.standard_input = ATOM2("*STANDARD-INPUT*");
+    SINPUT = STANDARDSTREAM(Stdin, lisp__data.standard_input, STREAM_READ);
+    lisp__data.interactive = 1;
+    LispProclaimSpecial(lisp__data.standard_input,
+                       lisp__data.input_list = SINPUT, NIL);
+    LispExportSymbol(lisp__data.standard_input);
+
+    lisp__data.standard_output = ATOM2("*STANDARD-OUTPUT*");
+    SOUTPUT = STANDARDSTREAM(Stdout, lisp__data.standard_output, STREAM_WRITE);
+    LispProclaimSpecial(lisp__data.standard_output,
+                       lisp__data.output_list = SOUTPUT, NIL);
+    LispExportSymbol(lisp__data.standard_output);
+
+    object = ATOM2("*STANDARD-ERROR*");
+    lisp__data.error_stream = STANDARDSTREAM(Stderr, object, STREAM_WRITE);
+    LispProclaimSpecial(object, lisp__data.error_stream, NIL);
+    LispExportSymbol(object);
+
+    lisp__data.modules = ATOM2("*MODULES*");
+    LispProclaimSpecial(lisp__data.modules, MOD, NIL);
+    LispExportSymbol(lisp__data.modules);
+
+    object = CONS(KEYWORD("UNIX"), CONS(KEYWORD("XEDIT"), NIL));
+    lisp__data.features = ATOM2("*FEATURES*");
+    LispProclaimSpecial(lisp__data.features, object, NIL);
+    LispExportSymbol(lisp__data.features);
+
+    object = ATOM2("MULTIPLE-VALUES-LIMIT");
+    LispDefconstant(object, FIXNUM(MULTIPLE_VALUES_LIMIT + 1), NIL);
+    LispExportSymbol(object);
+
+    /* Reenable gc */
+    GCEnable();
+
+    LispBytecodeInit();
+    LispPackageInit();
+    LispCoreInit();
+    LispMathInit();
+    LispPathnameInit();
+    LispStreamInit();
+    LispRegexInit();
+    LispWriteInit();
+
+    lisp__data.prompt = isatty(0) ? "> " : NULL;
+
+    lisp__data.errexit = !lisp__data.interactive;
+
+    if (lisp__data.interactive) {
+       /* add +, ++, +++, *, **, and *** */
+       for (i = 0; i < 3; i++) {
+           results[i] = '+';
+           results[i + 1] = '\0';
+           RUN[i] = ATOM(results);
+           LispSetVar(RUN[i], NIL);
+           LispExportSymbol(RUN[i]);
+       }
+       for (i = 0; i < 3; i++) {
+           results[i] = '*';
+           results[i + 1] = '\0';
+           RES[i] = ATOM(results);
+           LispSetVar(RES[i], NIL);
+           LispExportSymbol(RES[i]);
+       }
+    }
+    else
+       RUN[0] = RUN[1] = RUN[2] = RES[0] = RES[1] = RES[2] = NIL;
+
+    /* Add LISP builtin functions */
+    for (i = 0; i < sizeof(lispbuiltins) / sizeof(lispbuiltins[0]); i++)
+       LispAddBuiltinFunction(&lispbuiltins[i]);
+
+    EXECUTE("(require \"lisp\")");
+
+    object = ATOM2("*DEFAULT-PATHNAME-DEFAULTS*");
+#ifdef LISPDIR
+    {
+       int length;
+       char *pathname = LISPDIR;
+
+       length = strlen(pathname);
+       if (length && pathname[length - 1] != '/') {
+           pathname = LispMalloc(length + 2);
+
+           strcpy(pathname, LISPDIR);
+           strcpy(pathname + length, "/");
+           path = LSTRING2(pathname, length + 1);
+       }
+       else
+           path = LSTRING(pathname, length);
+    }
+#else
+    path = STRING("");
+#endif
+    GCDisable();
+    LispProclaimSpecial(object, APPLY1(Oparse_namestring, path), NIL);
+    LispExportSymbol(object);
+    GCEnable();
+
+    /* Create and make EXT the current package */
+    PACKAGE = ext = LispNewPackage(STRING("EXT"), NIL);
+    lisp__data.pack = lisp__data.savepack = PACKAGE->data.package.package;
+
+    /* Update list of packages */
+    PACK = CONS(ext, PACK);
+
+    /* Import LISP external symbols in EXT package */
+    LispUsePackage(lisp__data.lisp);
+
+    /* Add EXT non standard builtin functions */
+    for (i = 0; i < sizeof(extbuiltins) / sizeof(extbuiltins[0]); i++)
+       LispAddBuiltinFunction(&extbuiltins[i]);
+
+    /* Create and make USER the current package */
+    GCDisable();
+    PACKAGE = LispNewPackage(STRING("USER"),
+                            CONS(STRING("COMMON-LISP-USER"), NIL));
+    GCEnable();
+    lisp__data.pack = lisp__data.savepack = PACKAGE->data.package.package;
+
+    /* Update list of packages */
+    PACK = CONS(PACKAGE, PACK);
+
+    /* USER package inherits all LISP external symbols */
+    LispUsePackage(lisp__data.lisp);
+    /* And all EXT external symbols */
+    LispUsePackage(ext);
+
+    LispTopLevel();
+}
+
+void
+LispEnd(void)
+{
+    /* XXX needs to free all used memory, not just close file descriptors */
+}
+
+void
+LispSetPrompt(char *prompt)
+{
+    lisp__data.prompt = prompt;
+}
+
+void
+LispSetInteractive(int interactive)
+{
+    lisp__data.interactive = !!interactive;
+}
+
+void
+LispSetExitOnError(int errexit)
+{
+    lisp__data.errexit = !!errexit;
+}
+
+void
+LispDebug(int enable)
+{
+    lisp__data.debugging = !!enable;
+
+#ifdef DEBUGGER
+    /* assumes we are at the toplevel */
+    DBG = BRK = NIL;
+    lisp__data.debug_level = -1;
+    lisp__data.debug_step = 0;
+#endif
+}
diff --git a/xedit/lisp/lisp.h b/xedit/lisp/lisp.h
new file mode 100644 (file)
index 0000000..baabb85
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/lisp.h,v 1.4 2002/07/16 05:19:39 paulo Exp $ */
+
+#ifndef Lisp_lisp_h
+#define Lisp_lisp_h
+
+void LispBegin(void);
+void LispEnd(void);
+void *LispExecute(char*);
+void LispMachine(void);
+void LispSetPrompt(char*);
+void LispSetInteractive(int);
+void LispSetExitOnError(int);
+void LispDebug(int);           /* argument is boolean to enable/disable */
+
+#endif /* Lisp_lisp_h */
diff --git a/xedit/lisp/lsp.c b/xedit/lisp/lsp.c
new file mode 100644 (file)
index 0000000..17c24e9
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/lsp.c,v 1.7tsi Exp $ */
+
+#include <stdio.h>
+#include <string.h>
+#include "lisp/lisp.h"
+
+#ifdef NEED_STRCASECMP
+int strcasecmp(const char *s1, const char *s2);
+int strncasecmp(const char *s1, const char *s2, size_t n);
+#endif
+#ifdef NEED_REALPATH
+#include <sys/param.h>
+#if defined(ISC)
+#ifndef MAXPATHLEN
+#define MAXPATHLEN      1024
+#endif
+#endif
+char *realpath(const char *pathname, char resolvedname[MAXPATHLEN]);
+#endif
+
+int
+main(int argc, char *argv[])
+{
+    int i;
+
+    LispBegin();
+
+    i = 1;
+    if (argc > 1 && strcmp(argv[1], "-d") == 0) {
+       LispDebug(1);
+       ++i;
+    }
+
+    if (i < argc) {
+       char buffer[2048];
+
+       for (; i < argc; i++) {
+           snprintf(buffer, sizeof(buffer),
+                    "(load \"%s\" :if-does-not-exist :error)",
+                    argv[i]);
+           LispExecute(buffer);
+       }
+    }
+    else
+       LispMachine();
+
+    LispEnd();
+
+    return (0);
+}
diff --git a/xedit/lisp/math.c b/xedit/lisp/math.c
new file mode 100644 (file)
index 0000000..bdca034
--- /dev/null
@@ -0,0 +1,1477 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/math.c,v 1.23tsi Exp $ */
+
+#include "lisp/math.h"
+#include "lisp/private.h"
+
+#ifdef __UNIXOS2__
+# define finite(x) isfinite(x)
+#endif
+
+/*
+ * Prototypes
+ */
+static LispObj *LispDivide(LispBuiltin*, int, int);
+
+/*
+ * Initialization
+ */
+static LispObj *obj_zero, *obj_one;
+LispObj *Ocomplex, *Oequal_;
+
+LispObj *Oshort_float, *Osingle_float, *Odouble_float, *Olong_float;
+
+Atom_id Sdefault_float_format;
+
+/*
+ * Implementation
+ */
+#include "lisp/mathimp.c"
+
+void
+LispMathInit(void)
+{
+    LispObj *object, *result;
+
+    mp_set_malloc(LispMalloc);
+    mp_set_calloc(LispCalloc);
+    mp_set_realloc(LispRealloc);
+    mp_set_free(LispFree);
+
+    number_init();
+    obj_zero = FIXNUM(0);
+    obj_one = FIXNUM(1);
+
+    Oequal_            = STATIC_ATOM("=");
+    Ocomplex           = STATIC_ATOM(Scomplex->value);
+    Oshort_float       = STATIC_ATOM("SHORT-FLOAT");
+    LispExportSymbol(Oshort_float);
+    Osingle_float      = STATIC_ATOM("SINGLE-FLOAT");
+    LispExportSymbol(Osingle_float);
+    Odouble_float      = STATIC_ATOM("DOUBLE-FLOAT");
+    LispExportSymbol(Odouble_float);
+    Olong_float                = STATIC_ATOM("LONG-FLOAT");
+    LispExportSymbol(Olong_float);
+
+    object             = STATIC_ATOM("*DEFAULT-FLOAT-FORMAT*");
+    LispProclaimSpecial(object, Odouble_float, NIL);
+    LispExportSymbol(object);
+    Sdefault_float_format = ATOMID(object);
+
+    object             = STATIC_ATOM("PI");
+    result = number_pi();
+    LispProclaimSpecial(object, result, NIL);
+    LispExportSymbol(object);
+
+    object             = STATIC_ATOM("MOST-POSITIVE-FIXNUM");
+    LispDefconstant(object, FIXNUM(MOST_POSITIVE_FIXNUM), NIL);
+    LispExportSymbol(object);
+
+    object             = STATIC_ATOM("MOST-NEGATIVE-FIXNUM");
+    LispDefconstant(object, FIXNUM(MOST_NEGATIVE_FIXNUM), NIL);
+    LispExportSymbol(object);
+}
+
+LispObj *
+Lisp_Mul(LispBuiltin *builtin)
+/*
+ * &rest numbers
+ */
+{
+    n_number num;
+    LispObj *number, *numbers;
+
+    numbers = ARGUMENT(0);
+
+    if (CONSP(numbers)) {
+       number = CAR(numbers);
+
+       numbers = CDR(numbers);
+       if (!CONSP(numbers)) {
+           CHECK_NUMBER(number);
+           return (number);
+       }
+    }
+    else
+       return (FIXNUM(1));
+
+    set_number_object(&num, number);
+    do {
+       mul_number_object(&num, CAR(numbers));
+       numbers = CDR(numbers);
+    } while (CONSP(numbers));
+
+    return (make_number_object(&num));
+}
+
+LispObj *
+Lisp_Plus(LispBuiltin *builtin)
+/*
+ + &rest numbers
+ */
+{
+    n_number num;
+    LispObj *number, *numbers;
+
+    numbers = ARGUMENT(0);
+
+    if (CONSP(numbers)) {
+       number = CAR(numbers);
+
+       numbers = CDR(numbers);
+       if (!CONSP(numbers)) {
+           CHECK_NUMBER(number);
+           return (number);
+       }
+    }
+    else
+       return (FIXNUM(0));
+
+    set_number_object(&num, number);
+    do {
+       add_number_object(&num, CAR(numbers));
+       numbers = CDR(numbers);
+    } while (CONSP(numbers));
+
+    return (make_number_object(&num));
+}
+
+LispObj *
+Lisp_Minus(LispBuiltin *builtin)
+/*
+ - number &rest more_numbers
+ */
+{
+    n_number num;
+    LispObj *number, *more_numbers;
+
+    more_numbers = ARGUMENT(1);
+    number = ARGUMENT(0);
+
+    set_number_object(&num, number);
+    if (!CONSP(more_numbers)) {
+       neg_number(&num);
+
+       return (make_number_object(&num));
+    }
+    do {
+       sub_number_object(&num, CAR(more_numbers));
+       more_numbers = CDR(more_numbers);
+    } while (CONSP(more_numbers));
+
+    return (make_number_object(&num));
+}
+
+LispObj *
+Lisp_Div(LispBuiltin *builtin)
+/*
+ / number &rest more_numbers
+ */
+{
+    n_number num;
+    LispObj *number, *more_numbers;
+
+    more_numbers = ARGUMENT(1);
+    number = ARGUMENT(0);
+
+    if (CONSP(more_numbers))
+       set_number_object(&num, number);
+    else {
+       num.complex = 0;
+       num.real.type = N_FIXNUM;
+       num.real.data.fixnum = 1;
+       goto div_one_argument;
+    }
+
+    for (;;) {
+       number = CAR(more_numbers);
+       more_numbers = CDR(more_numbers);
+
+div_one_argument:
+       div_number_object(&num, number);
+       if (!CONSP(more_numbers))
+           break;
+    }
+
+    return (make_number_object(&num));
+}
+
+LispObj *
+Lisp_OnePlus(LispBuiltin *builtin)
+/*
+ 1+ number
+ */
+{
+    n_number num;
+    LispObj *number;
+
+    number = ARGUMENT(0);
+    num.complex = 0;
+    num.real.type = N_FIXNUM;
+    num.real.data.fixnum = 1;
+    add_number_object(&num, number);
+
+    return (make_number_object(&num));
+}
+
+LispObj *
+Lisp_OneMinus(LispBuiltin *builtin)
+/*
+ 1- number
+ */
+{
+    n_number num;
+    LispObj *number;
+
+    number = ARGUMENT(0);
+    num.complex = 0;
+    num.real.type = N_FIXNUM;
+    num.real.data.fixnum = -1;
+    add_number_object(&num, number);
+
+    return (make_number_object(&num));
+}
+
+LispObj *
+Lisp_Less(LispBuiltin *builtin)
+/*
+ < number &rest more-numbers
+ */
+{
+    LispObj *compare, *number, *more_numbers;
+
+    more_numbers = ARGUMENT(1);
+    compare = ARGUMENT(0);
+
+    if (CONSP(more_numbers)) {
+       do {
+           number = CAR(more_numbers);
+           if (cmp_object_object(compare, number, 1) >= 0)
+               return (NIL);
+           compare = number;
+           more_numbers = CDR(more_numbers);
+       } while (CONSP(more_numbers));
+    }
+    else {
+       CHECK_REAL(compare);
+    }
+
+    return (T);
+}
+
+LispObj *
+Lisp_LessEqual(LispBuiltin *builtin)
+/*
+ <= number &rest more-numbers
+ */
+{
+    LispObj *compare, *number, *more_numbers;
+
+    more_numbers = ARGUMENT(1);
+    compare = ARGUMENT(0);
+
+    if (CONSP(more_numbers)) {
+       do {
+           number = CAR(more_numbers);
+           if (cmp_object_object(compare, number, 1) > 0)
+               return (NIL);
+           compare = number;
+           more_numbers = CDR(more_numbers);
+       } while (CONSP(more_numbers));
+    }
+    else {
+       CHECK_REAL(compare);
+    }
+
+    return (T);
+}
+
+LispObj *
+Lisp_Equal_(LispBuiltin *builtin)
+/*
+ = number &rest more-numbers
+ */
+{
+    LispObj *compare, *number, *more_numbers;
+
+    more_numbers = ARGUMENT(1);
+    compare = ARGUMENT(0);
+
+    if (CONSP(more_numbers)) {
+       do {
+           number = CAR(more_numbers);
+           if (cmp_object_object(compare, number, 0) != 0)
+               return (NIL);
+           compare = number;
+           more_numbers = CDR(more_numbers);
+       } while (CONSP(more_numbers));
+    }
+    else {
+       CHECK_REAL(compare);
+    }
+
+    return (T);
+}
+
+LispObj *
+Lisp_Greater(LispBuiltin *builtin)
+/*
+ > number &rest more-numbers
+ */
+{
+    LispObj *compare, *number, *more_numbers;
+
+    more_numbers = ARGUMENT(1);
+    compare = ARGUMENT(0);
+
+    if (CONSP(more_numbers)) {
+       do {
+           number = CAR(more_numbers);
+           if (cmp_object_object(compare, number, 1) <= 0)
+               return (NIL);
+           compare = number;
+           more_numbers = CDR(more_numbers);
+       } while (CONSP(more_numbers));
+    }
+    else {
+       CHECK_REAL(compare);
+    }
+
+    return (T);
+}
+
+LispObj *
+Lisp_GreaterEqual(LispBuiltin *builtin)
+/*
+ >= number &rest more-numbers
+ */
+{
+    LispObj *compare, *number, *more_numbers;
+
+    more_numbers = ARGUMENT(1);
+    compare = ARGUMENT(0);
+
+    if (CONSP(more_numbers)) {
+       do {
+           number = CAR(more_numbers);
+           if (cmp_object_object(compare, number, 1) < 0)
+               return (NIL);
+           compare = number;
+           more_numbers = CDR(more_numbers);
+       } while (CONSP(more_numbers));
+    }
+    else {
+       CHECK_REAL(compare);
+    }
+
+    return (T);
+}
+
+LispObj *
+Lisp_NotEqual(LispBuiltin *builtin)
+/*
+ /= number &rest more-numbers
+ */
+{
+    LispObj *object, *compare, *number, *more_numbers;
+
+    more_numbers = ARGUMENT(1);
+    number = ARGUMENT(0);
+
+    if (!CONSP(more_numbers)) {
+       CHECK_REAL(number);
+
+       return (T);
+    }
+
+    /* compare all numbers */
+    while (1) {
+       compare = number;
+       for (object = more_numbers; CONSP(object); object = CDR(object)) {
+           number = CAR(object);
+
+           if (cmp_object_object(compare, number, 0) == 0)
+               return (NIL);
+       }
+       if (CONSP(more_numbers)) {
+           number = CAR(more_numbers);
+           more_numbers = CDR(more_numbers);
+       }
+       else
+           break;
+    }
+
+    return (T);
+}
+
+LispObj *
+Lisp_Min(LispBuiltin *builtin)
+/*
+ min number &rest more-numbers
+ */
+{
+    LispObj *result, *number, *more_numbers;
+
+    more_numbers = ARGUMENT(1);
+    result = ARGUMENT(0);
+
+    if (CONSP(more_numbers)) {
+       do {
+           number = CAR(more_numbers);
+           if (cmp_object_object(result, number, 1) > 0)
+               result = number;
+           more_numbers = CDR(more_numbers);
+       } while (CONSP(more_numbers));
+    }
+    else {
+       CHECK_REAL(result);
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Max(LispBuiltin *builtin)
+/*
+ max number &rest more-numbers
+ */
+{
+    LispObj *result, *number, *more_numbers;
+
+    more_numbers = ARGUMENT(1);
+    result = ARGUMENT(0);
+
+    if (CONSP(more_numbers)) {
+       do {
+           number = CAR(more_numbers);
+           if (cmp_object_object(result, number, 1) < 0)
+               result = number;
+           more_numbers = CDR(more_numbers);
+       } while (CONSP(more_numbers));
+    }
+    else {
+       CHECK_REAL(result);
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Abs(LispBuiltin *builtin)
+/*
+ abs number
+ */
+{
+    LispObj *result, *number;
+
+    result = number = ARGUMENT(0);
+
+    switch (OBJECT_TYPE(number)) {
+       case LispFixnum_t:
+       case LispInteger_t:
+       case LispBignum_t:
+       case LispDFloat_t:
+       case LispRatio_t:
+       case LispBigratio_t:
+           if (cmp_real_object(&zero, number) > 0) {
+               n_real real;
+
+               set_real_object(&real, number);
+               neg_real(&real);
+               result = make_real_object(&real);
+           }
+           break;
+       case LispComplex_t: {
+           n_number num;
+
+           set_number_object(&num, number);
+           abs_number(&num);
+           result = make_number_object(&num);
+       }   break;
+       default:
+           fatal_builtin_object_error(builtin, number, NOT_A_NUMBER);
+           break;
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Complex(LispBuiltin *builtin)
+/*
+ complex realpart &optional imagpart
+ */
+{
+    LispObj *realpart, *imagpart;
+
+    imagpart = ARGUMENT(1);
+    realpart = ARGUMENT(0);
+
+    CHECK_REAL(realpart);
+
+    if (imagpart == UNSPEC)
+       return (realpart);
+    else {
+       CHECK_REAL(imagpart);
+    }
+    if (!FLOATP(imagpart) && cmp_real_object(&zero, imagpart) == 0)
+       return (realpart);
+
+    return (COMPLEX(realpart, imagpart));
+}
+
+LispObj *
+Lisp_Complexp(LispBuiltin *builtin)
+/*
+ complexp object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (COMPLEXP(object) ? T : NIL);
+}
+
+LispObj *
+Lisp_Conjugate(LispBuiltin *builtin)
+/*
+ conjugate number
+ */
+{
+    n_number num;
+    LispObj *number, *realpart, *imagpart;
+
+    number = ARGUMENT(0);
+
+    CHECK_NUMBER(number);
+
+    if (REALP(number))
+       return (number);
+
+    realpart = OCXR(number);
+    num.complex = 0;
+    num.real.type = N_FIXNUM;
+    num.real.data.fixnum = -1;
+    mul_number_object(&num, OCXI(number));
+    imagpart = make_number_object(&num);
+
+    return (COMPLEX(realpart, imagpart));
+}
+
+LispObj *
+Lisp_Decf(LispBuiltin *builtin)
+/*
+ decf place &optional delta
+ */
+{
+    n_number num;
+    LispObj *place, *delta, *number;
+
+    delta = ARGUMENT(1);
+    place = ARGUMENT(0);
+
+    if (SYMBOLP(place)) {
+       number = LispGetVar(place);
+       if (number == NULL)
+           LispDestroy("EVAL: the variable %s is unbound", STROBJ(place));
+    }
+    else
+       number = EVAL(place);
+
+    if (delta != UNSPEC) {
+       LispObj *operand;
+
+       operand = EVAL(delta);
+       set_number_object(&num, number);
+       sub_number_object(&num, operand);
+       number = make_number_object(&num);
+    }
+    else {
+       num.complex = 0;
+       num.real.type = N_FIXNUM;
+       num.real.data.fixnum = -1;
+       add_number_object(&num, number);
+       number = make_number_object(&num);
+    }
+
+    if (SYMBOLP(place)) {
+       CHECK_CONSTANT(place);
+       LispSetVar(place, number);
+    }
+    else {
+       GC_ENTER();
+
+       GC_PROTECT(number);
+       (void)APPLY2(Osetf, place, number);
+       GC_LEAVE();
+    }
+
+    return (number);
+}
+
+LispObj *
+Lisp_Denominator(LispBuiltin *builtin)
+/*
+ denominator rational
+ */
+{
+    LispObj *result, *rational;
+
+    rational = ARGUMENT(0);
+
+    switch (OBJECT_TYPE(rational)) {
+       case LispFixnum_t:
+       case LispInteger_t:
+       case LispBignum_t:
+           result = FIXNUM(1);
+           break;
+       case LispRatio_t:
+           result = INTEGER(OFRD(rational));
+           break;
+       case LispBigratio_t:
+           if (mpi_fiti(OBRD(rational)))
+               result = INTEGER(mpi_geti(OBRD(rational)));
+           else {
+               mpi *den = XALLOC(mpi);
+
+               mpi_init(den);
+               mpi_set(den, OBRD(rational));
+               result = BIGNUM(den);
+           }
+           break;
+       default:
+           LispDestroy("%s: %s is not a rational number",
+                       STRFUN(builtin), STROBJ(rational));
+           /*NOTREACHED*/
+           result = NIL;
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Evenp(LispBuiltin *builtin)
+/*
+ evenp integer
+ */
+{
+    LispObj *result, *integer;
+
+    integer = ARGUMENT(0);
+
+    switch (OBJECT_TYPE(integer)) {
+       case LispFixnum_t:
+           result = FIXNUM_VALUE(integer) % 2 ? NIL : T;
+           break;
+       case LispInteger_t:
+           result = INT_VALUE(integer) % 2 ? NIL : T;
+           break;
+       case LispBignum_t:
+           result = mpi_remi(OBI(integer), 2) ? NIL : T;
+           break;
+       default:
+           fatal_builtin_object_error(builtin, integer, NOT_AN_INTEGER);
+           /*NOTREACHED*/
+           result = NIL;
+    }
+
+    return (result);
+}
+
+/* only one float format */
+LispObj *
+Lisp_Float(LispBuiltin *builtin)
+/*
+ float number &optional other
+ */
+{
+    LispObj *number, *other;
+
+    other = ARGUMENT(1);
+    number = ARGUMENT(0);
+
+    if (other != UNSPEC) {
+       CHECK_DFLOAT(other);
+    }
+
+    return (LispFloatCoerce(builtin, number));
+}
+
+LispObj *
+LispFloatCoerce(LispBuiltin *builtin, LispObj *number)
+{
+    double value;
+
+    switch (OBJECT_TYPE(number)) {
+       case LispFixnum_t:
+           value = FIXNUM_VALUE(number);
+           break;
+       case LispInteger_t:
+           value = INT_VALUE(number);
+           break;
+       case LispBignum_t:
+           value = mpi_getd(OBI(number));
+           break;
+       case LispDFloat_t:
+           return (number);
+       case LispRatio_t:
+           value = (double)OFRN(number) / (double)OFRD(number);
+           break;
+       case LispBigratio_t:
+           value = mpr_getd(OBR(number));
+           break;
+       default:
+           value = 0.0;
+           fatal_builtin_object_error(builtin, number, NOT_A_REAL_NUMBER);
+           break;
+    }
+
+    if (!finite(value))
+       fatal_error(FLOATING_POINT_OVERFLOW);
+
+    return (DFLOAT(value));
+}
+
+LispObj *
+Lisp_Floatp(LispBuiltin *builtin)
+/*
+ floatp object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (FLOATP(object) ? T : NIL);
+}
+
+LispObj *
+Lisp_Gcd(LispBuiltin *builtin)
+/*
+ gcd &rest integers
+ */
+{
+    n_real real;
+    LispObj *integers, *integer, *operand;
+
+    integers = ARGUMENT(0);
+
+    if (!CONSP(integers))
+       return (FIXNUM(0));
+
+    integer = CAR(integers);
+
+    CHECK_INTEGER(integer);
+    set_real_object(&real, integer);
+    integers = CDR(integers);
+
+    for (; CONSP(integers); integers = CDR(integers)) {
+       operand = CAR(integers);
+       gcd_real_object(&real, operand);
+    }
+    abs_real(&real);
+
+    return (make_real_object(&real));
+}
+
+LispObj *
+Lisp_Imagpart(LispBuiltin *builtin)
+/*
+ imagpart number
+ */
+{
+    LispObj *number;
+
+    number = ARGUMENT(0);
+
+    if (COMPLEXP(number))
+       return (OCXI(number));
+    else {
+       CHECK_REAL(number);
+    }
+
+    return (FIXNUM(0));
+}
+
+LispObj *
+Lisp_Incf(LispBuiltin *builtin)
+/*
+ incf place &optional delta
+ */
+{
+    n_number num;
+    LispObj *place, *delta, *number;
+
+    delta = ARGUMENT(1);
+    place = ARGUMENT(0);
+
+    if (SYMBOLP(place)) {
+       number = LispGetVar(place);
+       if (number == NULL)
+           LispDestroy("EVAL: the variable %s is unbound", STROBJ(place));
+    }
+    else
+       number = EVAL(place);
+
+    if (delta != UNSPEC) {
+       LispObj *operand;
+
+       operand = EVAL(delta);
+       set_number_object(&num, number);
+       add_number_object(&num, operand);
+       number = make_number_object(&num);
+    }
+    else {
+       num.complex = 0;
+       num.real.type = N_FIXNUM;
+       num.real.data.fixnum = 1;
+       add_number_object(&num, number);
+       number = make_number_object(&num);
+    }
+
+    if (SYMBOLP(place)) {
+       CHECK_CONSTANT(place);
+       LispSetVar(place, number);
+    }
+    else {
+       GC_ENTER();
+
+       GC_PROTECT(number);
+       (void)APPLY2(Osetf, place, number);
+       GC_LEAVE();
+    }
+
+    return (number);
+}
+
+LispObj *
+Lisp_Integerp(LispBuiltin *builtin)
+/*
+ integerp object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (INTEGERP(object) ? T : NIL);
+}
+
+LispObj *
+Lisp_Isqrt(LispBuiltin *builtin)
+/*
+ isqrt natural
+ */
+{
+    LispObj *natural, *result;
+
+    natural = ARGUMENT(0);
+
+    if (cmp_object_object(natural, obj_zero, 1) < 0)
+       goto not_a_natural_number;
+
+    switch (OBJECT_TYPE(natural)) {
+       case LispFixnum_t:
+           result = FIXNUM((long)floor(sqrt(FIXNUM_VALUE(natural))));
+           break;
+       case LispInteger_t:
+           result = INTEGER((long)floor(sqrt(INT_VALUE(natural))));
+           break;
+       case LispBignum_t: {
+           mpi *bigi;
+
+           bigi = XALLOC(mpi);
+           mpi_init(bigi);
+           mpi_sqrt(bigi, OBI(natural));
+           if (mpi_fiti(bigi)) {
+               result = INTEGER(mpi_geti(bigi));
+               mpi_clear(bigi);
+               XFREE(bigi);
+           }
+           else
+               result = BIGNUM(bigi);
+       }   break;
+       default:
+           goto not_a_natural_number;
+    }
+
+    return (result);
+
+not_a_natural_number:
+    LispDestroy("%s: %s is not a natural number",
+               STRFUN(builtin), STROBJ(natural));
+    /*NOTREACHED*/
+    return (NIL);
+}
+
+LispObj *
+Lisp_Lcm(LispBuiltin *builtin)
+/*
+ lcm &rest integers
+ */
+{
+    n_real real, gcd;
+    LispObj *integers, *operand;
+
+    integers = ARGUMENT(0);
+
+    if (!CONSP(integers))
+       return (FIXNUM(1));
+
+    operand = CAR(integers);
+
+    CHECK_INTEGER(operand);
+    set_real_object(&real, operand);
+    integers = CDR(integers);
+
+    gcd.type = N_FIXNUM;
+    gcd.data.fixnum = 0;
+
+    for (; CONSP(integers); integers = CDR(integers)) {
+       operand = CAR(integers);
+
+       if (real.type == N_FIXNUM && real.data.fixnum == 0)
+           break;
+
+       /* calculate gcd before changing integer */
+       clear_real(&gcd);
+       set_real_real(&gcd, &real);
+       gcd_real_object(&gcd, operand);
+
+       /* calculate lcm */
+       mul_real_object(&real, operand);
+       div_real_real(&real, &gcd);
+    }
+    clear_real(&gcd);
+    abs_real(&real);
+
+    return (make_real_object(&real));
+}
+
+LispObj *
+Lisp_Logand(LispBuiltin *builtin)
+/*
+ logand &rest integers
+ */
+{
+    n_real real;
+
+    LispObj *integers;
+
+    integers = ARGUMENT(0);
+
+    real.type = N_FIXNUM;
+    real.data.fixnum = -1;
+
+    for (; CONSP(integers); integers = CDR(integers))
+       and_real_object(&real, CAR(integers));
+
+    return (make_real_object(&real));
+}
+
+LispObj *
+Lisp_Logeqv(LispBuiltin *builtin)
+/*
+ logeqv &rest integers
+ */
+{
+    n_real real;
+
+    LispObj *integers;
+
+    integers = ARGUMENT(0);
+
+    real.type = N_FIXNUM;
+    real.data.fixnum = -1;
+
+    for (; CONSP(integers); integers = CDR(integers))
+       eqv_real_object(&real, CAR(integers));
+
+    return (make_real_object(&real));
+}
+
+LispObj *
+Lisp_Logior(LispBuiltin *builtin)
+/*
+ logior &rest integers
+ */
+{
+    n_real real;
+
+    LispObj *integers;
+
+    integers = ARGUMENT(0);
+
+    real.type = N_FIXNUM;
+    real.data.fixnum = 0;
+
+    for (; CONSP(integers); integers = CDR(integers))
+       ior_real_object(&real, CAR(integers));
+
+    return (make_real_object(&real));
+}
+
+LispObj *
+Lisp_Lognot(LispBuiltin *builtin)
+/*
+ lognot integer
+ */
+{
+    n_real real;
+
+    LispObj *integer;
+
+    integer = ARGUMENT(0);
+
+    CHECK_INTEGER(integer);
+
+    set_real_object(&real, integer);
+    not_real(&real);
+
+    return (make_real_object(&real));
+}
+
+LispObj *
+Lisp_Logxor(LispBuiltin *builtin)
+/*
+ logxor &rest integers
+ */
+{
+    n_real real;
+
+    LispObj *integers;
+
+    integers = ARGUMENT(0);
+
+    real.type = N_FIXNUM;
+    real.data.fixnum = 0;
+
+    for (; CONSP(integers); integers = CDR(integers))
+       xor_real_object(&real, CAR(integers));
+
+    return (make_real_object(&real));
+}
+
+LispObj *
+Lisp_Minusp(LispBuiltin *builtin)
+/*
+ minusp number
+ */
+{
+    LispObj *number;
+
+    number = ARGUMENT(0);
+
+    CHECK_REAL(number);
+
+    return (cmp_real_object(&zero, number) > 0 ? T : NIL);
+}
+
+LispObj *
+Lisp_Mod(LispBuiltin *builtin)
+/*
+ mod number divisor
+ */
+{
+    LispObj *result;
+
+    LispObj *number, *divisor;
+
+    divisor = ARGUMENT(1);
+    number = ARGUMENT(0);
+
+    if (INTEGERP(number) && INTEGERP(divisor)) {
+       n_real real;
+
+       set_real_object(&real, number);
+       mod_real_object(&real, divisor);
+       result = make_real_object(&real);
+    }
+    else {
+       n_number num;
+
+       set_number_object(&num, number);
+       divide_number_object(&num, divisor, NDIVIDE_FLOOR, 0);
+       result = make_real_object(&(num.imag));
+       clear_real(&(num.real));
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Numberp(LispBuiltin *builtin)
+/*
+ numberp object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (NUMBERP(object) ? T : NIL);
+}
+
+LispObj *
+Lisp_Numerator(LispBuiltin *builtin)
+/*
+ numerator rational
+ */
+{
+    LispObj *result, *rational;
+
+    rational = ARGUMENT(0);
+
+    switch (OBJECT_TYPE(rational)) {
+       case LispFixnum_t:
+       case LispInteger_t:
+       case LispBignum_t:
+           result = rational;
+           break;
+       case LispRatio_t:
+           result = INTEGER(OFRN(rational));
+           break;
+       case LispBigratio_t:
+           if (mpi_fiti(OBRN(rational)))
+               result = INTEGER(mpi_geti(OBRN(rational)));
+           else {
+               mpi *num = XALLOC(mpi);
+
+               mpi_init(num);
+               mpi_set(num, OBRN(rational));
+               result = BIGNUM(num);
+           }
+           break;
+       default:
+           LispDestroy("%s: %s is not a rational number",
+                       STRFUN(builtin), STROBJ(rational));
+           /*NOTREACHED*/
+           result = NIL;
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Oddp(LispBuiltin *builtin)
+/*
+ oddp integer
+ */
+{
+    LispObj *result, *integer;
+
+    integer = ARGUMENT(0);
+
+    switch (OBJECT_TYPE(integer)) {
+       case LispFixnum_t:
+           result = FIXNUM_VALUE(integer) % 2 ? T : NIL;
+           break;
+       case LispInteger_t:
+           result = INT_VALUE(integer) % 2 ? T : NIL;
+           break;
+       case LispBignum_t:
+           result = mpi_remi(OBI(integer), 2) ? T : NIL;
+           break;
+       default:
+           fatal_builtin_object_error(builtin, integer, NOT_AN_INTEGER);
+           /*NOTREACHED*/
+           result = NIL;
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Plusp(LispBuiltin *builtin)
+/*
+ plusp number
+ */
+{
+    LispObj *number;
+
+    number = ARGUMENT(0);
+
+    CHECK_REAL(number);
+
+    return (cmp_real_object(&zero, number) < 0 ? T : NIL);
+}
+
+LispObj *
+Lisp_Rational(LispBuiltin *builtin)
+/*
+ rational number
+ */
+{
+    LispObj *number;
+
+    number = ARGUMENT(0);
+
+    if (DFLOATP(number)) {
+       double numerator = ODF(number);
+
+       if ((long)numerator == numerator)
+           number = INTEGER(numerator);
+       else {
+           n_real real;
+           mpr *bigr = XALLOC(mpr);
+
+           mpr_init(bigr);
+           mpr_setd(bigr, numerator);
+           real.type = N_BIGRATIO;
+           real.data.bigratio = bigr;
+           rbr_canonicalize(&real);
+           number = make_real_object(&real);
+       }
+    }
+    else {
+       CHECK_REAL(number);
+    }
+
+    return (number);
+}
+
+LispObj *
+Lisp_Rationalp(LispBuiltin *builtin)
+/*
+ rationalp object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (RATIONALP(object) ? T : NIL);
+}
+
+LispObj *
+Lisp_Realpart(LispBuiltin *builtin)
+/*
+ realpart number
+ */
+{
+    LispObj *number;
+
+    number = ARGUMENT(0);
+
+    if (COMPLEXP(number))
+       return (OCXR(number));
+    else {
+       CHECK_REAL(number);
+    }
+
+    return (number);
+}
+
+LispObj *
+Lisp_Rem(LispBuiltin *builtin)
+/*
+ rem number divisor
+ */
+{
+    LispObj *result;
+
+    LispObj *number, *divisor;
+
+    divisor = ARGUMENT(1);
+    number = ARGUMENT(0);
+
+    if (INTEGERP(number) && INTEGERP(divisor)) {
+       n_real real;
+
+       set_real_object(&real, number);
+       rem_real_object(&real, divisor);
+       result = make_real_object(&real);
+    }
+    else {
+       n_number num;
+
+       set_number_object(&num, number);
+       divide_number_object(&num, divisor, NDIVIDE_TRUNC, 0);
+       result = make_real_object(&(num.imag));
+       clear_real(&(num.real));
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Sqrt(LispBuiltin *builtin)
+/*
+ sqrt number
+ */
+{
+    n_number num;
+    LispObj *number;
+
+    number = ARGUMENT(0);
+
+    set_number_object(&num, number);
+    sqrt_number(&num);
+
+    return (make_number_object(&num));
+}
+
+LispObj *
+Lisp_Zerop(LispBuiltin *builtin)
+/*
+ zerop number
+ */
+{
+    LispObj *result, *number;
+
+    number = ARGUMENT(0);
+
+    switch (OBJECT_TYPE(number)) {
+       case LispFixnum_t:
+       case LispInteger_t:
+       case LispBignum_t:
+       case LispDFloat_t:
+       case LispRatio_t:
+       case LispBigratio_t:
+           result = cmp_real_object(&zero, number) == 0 ? T : NIL;
+           break;
+       case LispComplex_t:
+           result = cmp_real_object(&zero, OCXR(number)) == 0 &&
+                    cmp_real_object(&zero, OCXI(number)) == 0 ? T : NIL;
+           break;
+       default:
+           fatal_builtin_object_error(builtin, number, NOT_A_NUMBER);
+           /*NOTREACHED*/
+           result = NIL;
+    }
+
+    return (result);
+}
+
+static LispObj *
+LispDivide(LispBuiltin *builtin, int fun, int flo)
+{
+    n_number num;
+    LispObj *number, *divisor;
+
+    divisor = ARGUMENT(1);
+    number = ARGUMENT(0);
+
+    RETURN_COUNT = 1;
+
+    if (cmp_real_object(&zero, number) == 0) {
+       if (divisor != NIL) {
+           CHECK_REAL(divisor);
+       }
+
+       return (RETURN(0) = obj_zero);
+    }
+
+    if (divisor == UNSPEC)
+       divisor = obj_one;
+
+    set_number_object(&num, number);
+    if (num.complex)
+       fatal_builtin_object_error(builtin, divisor, NOT_A_REAL_NUMBER);
+
+    divide_number_object(&num, divisor, fun, flo);
+    RETURN(0) = make_real_object(&(num.imag));
+
+    return (make_real_object(&(num.real)));
+}
+
+LispObj *
+Lisp_Ceiling(LispBuiltin *builtin)
+/*
+ ceiling number &optional divisor
+ */
+{
+    return (LispDivide(builtin, NDIVIDE_CEIL, 0));
+}
+
+LispObj *
+Lisp_Fceiling(LispBuiltin *builtin)
+/*
+ fceiling number &optional divisor
+ */
+{
+    return (LispDivide(builtin, NDIVIDE_CEIL, 1));
+}
+
+LispObj *
+Lisp_Floor(LispBuiltin *builtin)
+/*
+ floor number &optional divisor
+ */
+{
+    return (LispDivide(builtin, NDIVIDE_FLOOR, 0));
+}
+
+LispObj *
+Lisp_Ffloor(LispBuiltin *builtin)
+/*
+ ffloor number &optional divisor
+ */
+{
+    return (LispDivide(builtin, NDIVIDE_FLOOR, 1));
+}
+
+LispObj *
+Lisp_Round(LispBuiltin *builtin)
+/*
+ round number &optional divisor
+ */
+{
+    return (LispDivide(builtin, NDIVIDE_ROUND, 0));
+}
+
+LispObj *
+Lisp_Fround(LispBuiltin *builtin)
+/*
+ fround number &optional divisor
+ */
+{
+    return (LispDivide(builtin, NDIVIDE_ROUND, 1));
+}
+
+LispObj *
+Lisp_Truncate(LispBuiltin *builtin)
+/*
+ truncate number &optional divisor
+ */
+{
+    return (LispDivide(builtin, NDIVIDE_TRUNC, 0));
+}
+
+LispObj *
+Lisp_Ftruncate(LispBuiltin *builtin)
+/*
+ ftruncate number &optional divisor
+ */
+{
+    return (LispDivide(builtin, NDIVIDE_TRUNC, 1));
+}
diff --git a/xedit/lisp/math.h b/xedit/lisp/math.h
new file mode 100644 (file)
index 0000000..b067c9e
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/math.h,v 1.6tsi Exp $ */
+
+#ifndef Lisp_math_h
+#define Lisp_math_h
+
+#include "lisp/internal.h"
+#include "mp.h"
+
+void LispMathInit(void);
+LispObj *LispFloatCoerce(LispBuiltin*, LispObj*);
+
+LispObj *Lisp_Mul(LispBuiltin*);
+LispObj *Lisp_Plus(LispBuiltin*);
+LispObj *Lisp_Minus(LispBuiltin*);
+LispObj *Lisp_Div(LispBuiltin*);
+LispObj *Lisp_OnePlus(LispBuiltin*);
+LispObj *Lisp_OneMinus(LispBuiltin*);
+LispObj *Lisp_Less(LispBuiltin*);
+LispObj *Lisp_LessEqual(LispBuiltin*);
+LispObj *Lisp_Equal_(LispBuiltin*);
+LispObj *Lisp_Greater(LispBuiltin*);
+LispObj *Lisp_GreaterEqual(LispBuiltin*);
+LispObj *Lisp_NotEqual(LispBuiltin*);
+LispObj *Lisp_Max(LispBuiltin*);
+LispObj *Lisp_Min(LispBuiltin*);
+LispObj *Lisp_Mod(LispBuiltin*);
+LispObj *Lisp_Abs(LispBuiltin*);
+LispObj *Lisp_Complex(LispBuiltin*);
+LispObj *Lisp_Complexp(LispBuiltin*);
+LispObj *Lisp_Conjugate(LispBuiltin*);
+LispObj *Lisp_Decf(LispBuiltin*);
+LispObj *Lisp_Denominator(LispBuiltin*);
+LispObj *Lisp_Evenp(LispBuiltin*);
+LispObj *Lisp_Float(LispBuiltin*);
+LispObj *Lisp_Floatp(LispBuiltin*);
+LispObj *Lisp_Gcd(LispBuiltin*);
+LispObj *Lisp_Imagpart(LispBuiltin*);
+LispObj *Lisp_Incf(LispBuiltin*);
+LispObj *Lisp_Integerp(LispBuiltin*);
+LispObj *Lisp_Isqrt(LispBuiltin*);
+LispObj *Lisp_Lcm(LispBuiltin*);
+LispObj *Lisp_Logand(LispBuiltin*);
+LispObj *Lisp_Logeqv(LispBuiltin*);
+LispObj *Lisp_Logior(LispBuiltin*);
+LispObj *Lisp_Lognot(LispBuiltin*);
+LispObj *Lisp_Logxor(LispBuiltin*);
+LispObj *Lisp_Minusp(LispBuiltin*);
+LispObj *Lisp_Numberp(LispBuiltin*);
+LispObj *Lisp_Numerator(LispBuiltin*);
+LispObj *Lisp_Oddp(LispBuiltin*);
+LispObj *Lisp_Plusp(LispBuiltin*);
+LispObj *Lisp_Rational(LispBuiltin*);
+#if 0
+LispObj *Lisp_Rationalize(LispBuiltin*);
+#endif
+LispObj *Lisp_Rationalp(LispBuiltin*);
+LispObj *Lisp_Realpart(LispBuiltin*);
+LispObj *Lisp_Rem(LispBuiltin*);
+LispObj *Lisp_Sqrt(LispBuiltin*);
+LispObj *Lisp_Zerop(LispBuiltin*);
+LispObj *Lisp_Ceiling(LispBuiltin*);
+LispObj *Lisp_Fceiling(LispBuiltin*);
+LispObj *Lisp_Floor(LispBuiltin*);
+LispObj *Lisp_Ffloor(LispBuiltin*);
+LispObj *Lisp_Round(LispBuiltin*);
+LispObj *Lisp_Fround(LispBuiltin*);
+LispObj *Lisp_Truncate(LispBuiltin*);
+LispObj *Lisp_Ftruncate(LispBuiltin*);
+
+
+#endif /* Lisp_math_h */
diff --git a/xedit/lisp/mathimp.c b/xedit/lisp/mathimp.c
new file mode 100644 (file)
index 0000000..f5c098f
--- /dev/null
@@ -0,0 +1,5223 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/mathimp.c,v 1.14tsi Exp $ */
+
+
+/*
+ * Defines
+ */
+#ifdef __GNUC__
+#define CONST                  __attribute__ ((__const__))
+#else
+#define CONST                  /**/
+#endif
+
+/* mask for checking overflow on long operations */
+#ifdef LONG64
+#define FI_MASK                        0x4000000000000000L
+#define LONGSBITS              63
+#else
+#define FI_MASK                        0x40000000L
+#define LONGSBITS              31
+#endif
+
+#define N_FIXNUM               1
+#define N_BIGNUM               2
+#define N_FLONUM               3
+#define N_FIXRATIO             4
+#define N_BIGRATIO             5
+
+#define NOP_ADD                        1
+#define NOP_SUB                        2
+#define NOP_MUL                        3
+#define NOP_DIV                        4
+
+#define NDIVIDE_CEIL           1
+#define NDIVIDE_FLOOR          2
+#define NDIVIDE_ROUND          3
+#define NDIVIDE_TRUNC          4
+
+/* real part from number */
+#define NREAL(num)             &((num)->real)
+#define NRTYPE(num)            (num)->real.type
+#define NRFI(num)              (num)->real.data.fixnum
+#define NRBI(num)              (num)->real.data.bignum
+#define NRFF(num)              (num)->real.data.flonum
+#define NRFRN(Num)             (Num)->real.data.fixratio.num
+#define NRFRD(num)             (num)->real.data.fixratio.den
+#define NRBR(num)              (num)->real.data.bigratio
+#define NRBRN(num)             mpr_num(NRBR(num))
+#define NRBRD(num)             mpr_den(NRBR(num))
+
+#define NRCLEAR_BI(num)                mpi_clear(NRBI(num)); XFREE(NRBI(num))
+#define NRCLEAR_BR(num)                mpr_clear(NRBR(num)); XFREE(NRBR(num))
+
+/* imag part from number */
+#define NIMAG(num)             &((num)->imag)
+#define NITYPE(num)            (num)->imag.type
+#define NIFI(num)              (num)->imag.data.fixnum
+#define NIBI(num)              (num)->imag.data.bignum
+#define NIFF(num)              (num)->imag.data.flonum
+#define NIFRN(Num)             (Num)->imag.data.fixratio.num
+#define NIFRD(num)             (num)->imag.data.fixratio.den
+#define NIBR(num)              (num)->imag.data.bigratio
+#define NIBRN(obj)             mpr_num(NIBR(obj))
+#define NIBRD(obj)             mpr_den(NIBR(obj))
+
+/* real number fields */
+#define RTYPE(real)            (real)->type
+#define RFI(real)              (real)->data.fixnum
+#define RBI(real)              (real)->data.bignum
+#define RFF(real)              (real)->data.flonum
+#define RFRN(real)             (real)->data.fixratio.num
+#define RFRD(real)             (real)->data.fixratio.den
+#define RBR(real)              (real)->data.bigratio
+#define RBRN(real)             mpr_num(RBR(real))
+#define RBRD(real)             mpr_den(RBR(real))
+
+#define RINTEGERP(real)                                \
+    (RTYPE(real) == N_FIXNUM || RTYPE(real) == N_BIGNUM)
+
+#define RCLEAR_BI(real)                mpi_clear(RBI(real)); XFREE(RBI(real))
+#define RCLEAR_BR(real)                mpr_clear(RBR(real)); XFREE(RBR(real))
+
+/* numeric value from lisp object */
+#define OFI(object)            FIXNUM_VALUE(object)
+#define OII(object)            INT_VALUE(object)
+#define OBI(object)            (object)->data.mp.integer
+#define ODF(object)            DFLOAT_VALUE(object)
+#define OFRN(object)           (object)->data.ratio.numerator
+#define OFRD(object)           (object)->data.ratio.denominator
+#define OBR(object)            (object)->data.mp.ratio
+#define OBRN(object)           mpr_num(OBR(object))
+#define OBRD(object)           mpr_den(OBR(object))
+#define OCXR(object)           (object)->data.complex.real
+#define OCXI(object)           (object)->data.complex.imag
+
+#define XALLOC(type)           LispMalloc(sizeof(type))
+#define XFREE(ptr)             LispFree(ptr)
+
+
+/*
+ * Types
+ */
+typedef struct _n_real {
+    char type;
+    union {
+       long fixnum;
+       mpi *bignum;
+       double flonum;
+       struct {
+           long num;
+           long den;
+       } fixratio;
+       mpr *bigratio;
+    } data;
+} n_real;
+
+typedef struct _n_number {
+    char complex;
+    n_real real;
+    n_real imag;
+} n_number;
+
+
+/*
+ * Prototypes
+ */
+static void number_init(void);
+static LispObj *number_pi(void);
+
+static void set_real_real(n_real*, n_real*);
+static void set_real_object(n_real*, LispObj*);
+static void set_number_object(n_number*, LispObj*);
+static void clear_real(n_real*);
+static void clear_number(n_number*);
+
+static LispObj *make_real_object(n_real*);
+static LispObj *make_number_object(n_number*);
+
+static void fatal_error(int);
+static void fatal_object_error(LispObj*, int);
+static void fatal_builtin_object_error(LispBuiltin*, LispObj*, int);
+
+static double bi_getd(mpi*);
+static double br_getd(mpr*);
+
+/* add */
+static void add_real_object(n_real*, LispObj*);
+static void add_number_object(n_number*, LispObj*);
+
+/* sub */
+static void sub_real_object(n_real*, LispObj*);
+static void sub_number_object(n_number*, LispObj*);
+
+/* mul */
+static void mul_real_object(n_real*, LispObj*);
+static void mul_number_object(n_number*, LispObj*);
+
+/* div */
+static void div_real_object(n_real*, LispObj*);
+static void div_number_object(n_number*, LispObj*);
+
+/* compare */
+static int cmp_real_real(n_real*, n_real*);
+static int cmp_real_object(n_real*, LispObj*);
+#if 0  /* not used */
+static int cmp_number_object(n_number*, LispObj*);
+#endif
+static int cmp_object_object(LispObj*, LispObj*, int);
+
+/* fixnum */
+static INLINE int fi_fi_add_overflow(long, long) CONST;
+static INLINE int fi_fi_sub_overflow(long, long) CONST;
+static INLINE int fi_fi_mul_overflow(long, long) CONST;
+
+/* bignum */
+static void rbi_canonicalize(n_real*);
+
+/* ratio */
+static void rfr_canonicalize(n_real*);
+static void rbr_canonicalize(n_real*);
+
+/* complex */
+static void ncx_canonicalize(n_number*);
+
+/* abs */
+static void abs_real(n_real*);
+static void abs_number(n_number*);
+static void nabs_cx(n_number*);
+static INLINE void rabs_fi(n_real*);
+static INLINE void rabs_bi(n_real*);
+static INLINE void rabs_ff(n_real*);
+static INLINE void rabs_fr(n_real*);
+static INLINE void rabs_br(n_real*);
+
+/* neg */
+static void neg_real(n_real*);
+static void neg_number(n_number*);
+static void rneg_fi(n_real*);
+static INLINE void rneg_bi(n_real*);
+static INLINE void rneg_ff(n_real*);
+static INLINE void rneg_fr(n_real*);
+static INLINE void rneg_br(n_real*);
+
+/* sqrt */
+static void sqrt_real(n_real*);
+static void sqrt_number(n_number*);
+static void rsqrt_xi(n_real*);
+static void rsqrt_xr(n_real*);
+static void rsqrt_ff(n_real*);
+static void nsqrt_cx(n_number*);
+static void nsqrt_xi(n_number*);
+static void nsqrt_ff(n_number*);
+static void nsqrt_xr(n_number*);
+
+/* mod */
+static void mod_real_real(n_real*, n_real*);
+static void mod_real_object(n_real*, LispObj*);
+static void rmod_fi_fi(n_real*, long);
+static void rmod_fi_bi(n_real*, mpi*);
+static void rmod_bi_fi(n_real*, long);
+static void rmod_bi_bi(n_real*, mpi*);
+
+/* rem */
+static void rem_real_object(n_real*, LispObj*);
+static void rrem_fi_fi(n_real*, long);
+static void rrem_fi_bi(n_real*, mpi*);
+static void rrem_bi_fi(n_real*, long);
+static void rrem_bi_bi(n_real*, mpi*);
+
+/* gcd */
+static void gcd_real_object(n_real*, LispObj*);
+
+/* and */
+static void and_real_object(n_real*, LispObj*);
+
+/* eqv */
+static void eqv_real_object(n_real*, LispObj*);
+
+/* ior */
+static void ior_real_object(n_real*, LispObj*);
+
+/* not */
+static void not_real(n_real*);
+
+/* xor */
+static void xor_real_object(n_real*, LispObj*);
+
+/* divide */
+static void divide_number_object(n_number*, LispObj*, int, int);
+static void ndivide_xi_xi(n_number*, LispObj*, int, int);
+static void ndivide_flonum(n_number*, double, double, int, int);
+static void ndivide_xi_xr(n_number*, LispObj*, int, int);
+static void ndivide_xr_xi(n_number*, LispObj*, int, int);
+static void ndivide_xr_xr(n_number*, LispObj*, int, int);
+
+/* real complex */
+static void nadd_re_cx(n_number*, LispObj*);
+static void nsub_re_cx(n_number*, LispObj*);
+static void nmul_re_cx(n_number*, LispObj*);
+static void ndiv_re_cx(n_number*, LispObj*);
+
+/* complex real */
+static void nadd_cx_re(n_number*, LispObj*);
+static void nsub_cx_re(n_number*, LispObj*);
+static void nmul_cx_re(n_number*, LispObj*);
+static void ndiv_cx_re(n_number*, LispObj*);
+
+/* complex complex */
+static void nadd_cx_cx(n_number*, LispObj*);
+static void nsub_cx_cx(n_number*, LispObj*);
+static void nmul_cx_cx(n_number*, LispObj*);
+static void ndiv_cx_cx(n_number*, LispObj*);
+static int cmp_cx_cx(LispObj*, LispObj*);
+
+/* flonum flonum */
+static void radd_flonum(n_real*, double, double);
+static void rsub_flonum(n_real*, double, double);
+static void rmul_flonum(n_real*, double, double);
+static void rdiv_flonum(n_real*, double, double);
+static int cmp_flonum(double, double);
+
+/* fixnum fixnum */
+static void rop_fi_fi_bi(n_real*, long, int);
+static INLINE void radd_fi_fi(n_real*, long);
+static INLINE void rsub_fi_fi(n_real*, long);
+static INLINE void rmul_fi_fi(n_real*, long);
+static INLINE void rdiv_fi_fi(n_real*, long);
+static INLINE int cmp_fi_fi(long, long);
+static void ndivide_fi_fi(n_number*, long, int, int);
+
+/* fixnum bignum */
+static void rop_fi_bi_xi(n_real*, mpi*, int);
+static INLINE void radd_fi_bi(n_real*, mpi*);
+static INLINE void rsub_fi_bi(n_real*, mpi*);
+static INLINE void rmul_fi_bi(n_real*, mpi*);
+static void rdiv_fi_bi(n_real*, mpi*);
+static INLINE int cmp_fi_bi(long, mpi*);
+
+/* fixnum fixratio */
+static void rop_fi_fr_as_xr(n_real*, long, long, int);
+static void rop_fi_fr_md_xr(n_real*, long, long, int);
+static INLINE void radd_fi_fr(n_real*, long, long);
+static INLINE void rsub_fi_fr(n_real*, long, long);
+static INLINE void rmul_fi_fr(n_real*, long, long);
+static INLINE void rdiv_fi_fr(n_real*, long, long);
+static INLINE int cmp_fi_fr(long, long, long);
+
+/* fixnum bigratio */
+static void rop_fi_br_as_xr(n_real*, mpr*, int);
+static void rop_fi_br_md_xr(n_real*, mpr*, int);
+static INLINE void radd_fi_br(n_real*, mpr*);
+static INLINE void rsub_fi_br(n_real*, mpr*);
+static INLINE void rmul_fi_br(n_real*, mpr*);
+static INLINE void rdiv_fi_br(n_real*, mpr*);
+static INLINE int cmp_fi_br(long, mpr*);
+
+/* bignum fixnum */
+static INLINE void radd_bi_fi(n_real*, long);
+static INLINE void rsub_bi_fi(n_real*, long);
+static INLINE void rmul_bi_fi(n_real*, long);
+static void rdiv_bi_fi(n_real*, long);
+static INLINE int cmp_bi_fi(mpi*, long);
+
+/* bignum bignum */
+static INLINE void radd_bi_bi(n_real*, mpi*);
+static INLINE void rsub_bi_bi(n_real*, mpi*);
+static INLINE void rmul_bi_bi(n_real*, mpi*);
+static void rdiv_bi_bi(n_real*, mpi*);
+static INLINE int cmp_bi_bi(mpi*, mpi*);
+
+/* bignum fixratio */
+static void rop_bi_fr_as_xr(n_real*, long, long, int);
+static void rop_bi_fr_md_xr(n_real*, long, long, int);
+static INLINE void radd_bi_fr(n_real*, long, long);
+static INLINE void rsub_bi_fr(n_real*, long, long);
+static INLINE void rmul_bi_fr(n_real*, long, long);
+static INLINE void rdiv_bi_fr(n_real*, long, long);
+static int cmp_bi_fr(mpi*, long, long);
+
+/* bignum bigratio */
+static void rop_bi_br_as_xr(n_real*, mpr*, int);
+static void rop_bi_br_md_xr(n_real*, mpr*, int);
+static INLINE void radd_bi_br(n_real*, mpr*);
+static INLINE void rsub_bi_br(n_real*, mpr*);
+static INLINE void rmul_bi_br(n_real*, mpr*);
+static INLINE void rdiv_bi_br(n_real*, mpr*);
+static int cmp_bi_br(mpi*, mpr*);
+
+/* fixratio fixnum */
+static void rop_fr_fi_as_xr(n_real*, long, int);
+static void rop_fr_fi_md_xr(n_real*, long, int);
+static INLINE void radd_fr_fi(n_real*, long);
+static INLINE void rsub_fr_fi(n_real*, long);
+static INLINE void rmul_fr_fi(n_real*, long);
+static INLINE void rdiv_fr_fi(n_real*, long);
+static INLINE int cmp_fr_fi(long, long, long);
+
+/* fixratio bignum */
+static void rop_fr_bi_as_xr(n_real*, mpi*, int);
+static void rop_fr_bi_md_xr(n_real*, mpi*, int);
+static INLINE void radd_fr_bi(n_real*, mpi*);
+static INLINE void rsub_fr_bi(n_real*, mpi*);
+static INLINE void rmul_fr_bi(n_real*, mpi*);
+static INLINE void rdiv_fr_bi(n_real*, mpi*);
+static int cmp_fr_bi(long, long, mpi*);
+
+/* fixratio fixratio */
+static void rop_fr_fr_as_xr(n_real*, long, long, int);
+static void rop_fr_fr_md_xr(n_real*, long, long, int);
+static INLINE void radd_fr_fr(n_real*, long, long);
+static INLINE void rsub_fr_fr(n_real*, long, long);
+static INLINE void rmul_fr_fr(n_real*, long, long);
+static INLINE void rdiv_fr_fr(n_real*, long, long);
+static INLINE int cmp_fr_fr(long, long, long, long);
+
+/* fixratio bigratio */
+static void rop_fr_br_asmd_xr(n_real*, mpr*, int);
+static INLINE void radd_fr_br(n_real*, mpr*);
+static INLINE void rsub_fr_br(n_real*, mpr*);
+static INLINE void rmul_fr_br(n_real*, mpr*);
+static INLINE void rdiv_fr_br(n_real*, mpr*);
+static int cmp_fr_br(long, long, mpr*);
+
+/* bigratio fixnum */
+static void rop_br_fi_asmd_xr(n_real*, long, int);
+static INLINE void radd_br_fi(n_real*, long);
+static INLINE void rsub_br_fi(n_real*, long);
+static INLINE void rmul_br_fi(n_real*, long);
+static INLINE void rdiv_br_fi(n_real*, long);
+static int cmp_br_fi(mpr*, long);
+
+/* bigratio bignum */
+static void rop_br_bi_as_xr(n_real*, mpi*, int);
+static INLINE void radd_br_bi(n_real*, mpi*);
+static INLINE void rsub_br_bi(n_real*, mpi*);
+static INLINE void rmul_br_bi(n_real*, mpi*);
+static INLINE void rdiv_br_bi(n_real*, mpi*);
+static int cmp_br_bi(mpr*, mpi*);
+
+/* bigratio fixratio */
+static void rop_br_fr_asmd_xr(n_real*, long, long, int);
+static INLINE void radd_br_fr(n_real*, long, long);
+static INLINE void rsub_br_fr(n_real*, long, long);
+static INLINE void rmul_br_fr(n_real*, long, long);
+static INLINE void rdiv_br_fr(n_real*, long, long);
+static int cmp_br_fr(mpr*, long, long);
+
+/* bigratio bigratio */
+static INLINE void radd_br_br(n_real*, mpr*);
+static INLINE void rsub_br_br(n_real*, mpr*);
+static INLINE void rmul_br_br(n_real*, mpr*);
+static INLINE void rdiv_br_br(n_real*, mpr*);
+static INLINE int cmp_br_br(mpr*, mpr*);
+
+/*
+ * Initialization
+ */
+static n_real zero, one, two;
+
+static char *fatal_error_strings[] = {
+#define DIVIDE_BY_ZERO                 0
+    "divide by zero",
+#define FLOATING_POINT_OVERFLOW                1
+    "floating point overflow",
+#define FLOATING_POINT_EXCEPTION       2
+    "floating point exception"
+};
+
+static char *fatal_object_error_strings[] = {
+#define NOT_A_NUMBER                   0
+    "is not a number",
+#define NOT_A_REAL_NUMBER              1
+    "is not a real number",
+#define NOT_AN_INTEGER                 2
+    "is not an integer"
+};
+
+/*
+ * Implementation
+ */
+static void
+fatal_error(int num)
+{
+    LispDestroy(fatal_error_strings[num]);
+}
+
+static void
+fatal_object_error(LispObj *obj, int num)
+{
+    LispDestroy("%s %s", STROBJ(obj), fatal_object_error_strings[num]);
+}
+
+static void
+fatal_builtin_object_error(LispBuiltin *builtin, LispObj *obj, int num)
+{
+    LispDestroy("%s: %s %s", STRFUN(builtin), STROBJ(obj),
+               fatal_object_error_strings[num]);
+}
+
+static void
+number_init(void)
+{
+    zero.type = one.type = two.type = N_FIXNUM;
+    zero.data.fixnum = 0;
+    one.data.fixnum = 1;
+    two.data.fixnum = 2;
+}
+
+static double
+bi_getd(mpi *bignum)
+{
+    double value = mpi_getd(bignum);
+
+    if (!finite(value))
+       fatal_error(FLOATING_POINT_EXCEPTION);
+
+    return (value);
+}
+
+static double
+br_getd(mpr *bigratio)
+{
+    double value = mpr_getd(bigratio);
+
+    if (!finite(value))
+       fatal_error(FLOATING_POINT_EXCEPTION);
+
+    return (value);
+}
+
+static LispObj *
+number_pi(void)
+{
+    LispObj *result;
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+    result = DFLOAT(M_PI);
+
+    return (result);
+}
+
+static void
+set_real_real(n_real *real, n_real *val)
+{
+    switch (RTYPE(real) = RTYPE(val)) {
+       case N_FIXNUM:
+           RFI(real) = RFI(val);
+           break;
+       case N_BIGNUM:
+           RBI(real) = XALLOC(mpi);
+           mpi_init(RBI(real));
+           mpi_set(RBI(real), RBI(val));
+           break;
+       case N_FLONUM:
+           RFF(real) = RFF(val);
+           break;
+       case N_FIXRATIO:
+           RFRN(real) = RFRN(val);
+           RFRD(real) = RFRD(val);
+           break;
+       case N_BIGRATIO:
+           RBR(real) = XALLOC(mpr);
+           mpr_init(RBR(real));
+           mpr_set(RBR(real), RBR(val));
+           break;
+    }
+}
+
+static void
+set_real_object(n_real *real, LispObj *obj)
+{
+    switch (OBJECT_TYPE(obj)) {
+       case LispFixnum_t:
+           RTYPE(real) = N_FIXNUM;
+           RFI(real) = OFI(obj);
+           break;
+       case LispInteger_t:
+           RTYPE(real) = N_FIXNUM;
+           RFI(real) = OII(obj);
+           break;
+       case LispBignum_t:
+           RTYPE(real) = N_BIGNUM;
+           RBI(real) = XALLOC(mpi);
+           mpi_init(RBI(real));
+           mpi_set(RBI(real), OBI(obj));
+           break;
+       case LispDFloat_t:
+           RTYPE(real) = N_FLONUM;
+           RFF(real) = ODF(obj);
+           break;
+       case LispRatio_t:
+           RTYPE(real) = N_FIXRATIO;
+           RFRN(real) = OFRN(obj);
+           RFRD(real) = OFRD(obj);
+           break;
+       case LispBigratio_t:
+           RTYPE(real) = N_BIGRATIO;
+           RBR(real) = XALLOC(mpr);
+           mpr_init(RBR(real));
+           mpr_set(RBR(real), OBR(obj));
+           break;
+       default:
+           fatal_object_error(obj, NOT_A_REAL_NUMBER);
+           break;
+    }
+}
+
+static void
+set_number_object(n_number *num, LispObj *obj)
+{
+    switch (OBJECT_TYPE(obj)) {
+       case LispFixnum_t:
+           num->complex = 0;
+           NRTYPE(num) = N_FIXNUM;
+           NRFI(num) = OFI(obj);
+           break;
+       case LispInteger_t:
+           num->complex = 0;
+           NRTYPE(num) = N_FIXNUM;
+           NRFI(num) = OII(obj);
+           break;
+       case LispBignum_t:
+           num->complex = 0;
+           NRTYPE(num) = N_BIGNUM;
+           NRBI(num) = XALLOC(mpi);
+           mpi_init(NRBI(num));
+           mpi_set(NRBI(num), OBI(obj));
+           break;
+       case LispDFloat_t:
+           num->complex = 0;
+           NRTYPE(num) = N_FLONUM;
+           NRFF(num) = ODF(obj);
+           break;
+       case LispRatio_t:
+           num->complex = 0;
+           NRTYPE(num) = N_FIXRATIO;
+           NRFRN(num) = OFRN(obj);
+           NRFRD(num) = OFRD(obj);
+           break;
+       case LispBigratio_t:
+           num->complex = 0;
+           NRTYPE(num) = N_BIGRATIO;
+           NRBR(num) = XALLOC(mpr);
+           mpr_init(NRBR(num));
+           mpr_set(NRBR(num), OBR(obj));
+           break;
+       case LispComplex_t:
+           num->complex = 1;
+           set_real_object(NREAL(num), OCXR(obj));
+           set_real_object(NIMAG(num), OCXI(obj));
+           break;
+       default:
+           fatal_object_error(obj, NOT_A_NUMBER);
+           break;
+    }
+}
+
+static void
+clear_real(n_real *real)
+{
+    if (RTYPE(real) == N_BIGNUM) {
+       mpi_clear(RBI(real));
+       XFREE(RBI(real));
+    }
+    else if (RTYPE(real) == N_BIGRATIO) {
+       mpr_clear(RBR(real));
+       XFREE(RBR(real));
+    }
+}
+
+static void
+clear_number(n_number *num)
+{
+    clear_real(NREAL(num));
+    if (num->complex)
+       clear_real(NIMAG(num));
+}
+
+static LispObj *
+make_real_object(n_real *real)
+{
+    LispObj *obj;
+
+    switch (RTYPE(real)) {
+       case N_FIXNUM:
+           if (RFI(real) > MOST_POSITIVE_FIXNUM ||
+               RFI(real) < MOST_NEGATIVE_FIXNUM) {
+               obj = LispNew(NIL, NIL);
+               obj->type = LispInteger_t;
+               OII(obj) = RFI(real);
+           }
+           else
+               obj = FIXNUM(RFI(real));
+           break;
+       case N_BIGNUM:
+           obj = BIGNUM(RBI(real));
+           break;
+       case N_FLONUM:
+           obj = DFLOAT(RFF(real));
+           break;
+       case N_FIXRATIO:
+           obj = LispNew(NIL, NIL);
+           obj->type = LispRatio_t;
+           OFRN(obj) = RFRN(real);
+           OFRD(obj) = RFRD(real);
+           break;
+       case N_BIGRATIO:
+           obj = BIGRATIO(RBR(real));
+           break;
+       default:
+           obj = NIL;
+           break;
+    }
+
+    return (obj);
+}
+
+static LispObj *
+make_number_object(n_number *num)
+{
+    LispObj *obj;
+
+    if (num->complex) {
+       GC_ENTER();
+
+       obj = LispNew(NIL, NIL);
+       GC_PROTECT(obj);
+       OCXI(obj) = NIL;
+       obj->type = LispComplex_t;
+       OCXR(obj) = make_real_object(NREAL(num));
+       OCXI(obj) = make_real_object(NIMAG(num));
+       GC_LEAVE();
+    }
+    else {
+       switch (NRTYPE(num)) {
+           case N_FIXNUM:
+               if (NRFI(num) > MOST_POSITIVE_FIXNUM ||
+                   NRFI(num) < MOST_NEGATIVE_FIXNUM) {
+                   obj = LispNew(NIL, NIL);
+                   obj->type = LispInteger_t;
+                   OII(obj) = NRFI(num);
+               }
+               else
+                   obj = FIXNUM(NRFI(num));
+               break;
+           case N_BIGNUM:
+               obj = BIGNUM(NRBI(num));
+               break;
+           case N_FLONUM:
+               obj = DFLOAT(NRFF(num));
+               break;
+           case N_FIXRATIO:
+               obj = LispNew(NIL, NIL);
+               obj->type = LispRatio_t;
+               OFRN(obj) = NRFRN(num);
+               OFRD(obj) = NRFRD(num);
+               break;
+           case N_BIGRATIO:
+               obj = BIGRATIO(NRBR(num));
+               break;
+           default:
+               obj = NIL;
+               break;
+       }
+    }
+
+    return (obj);
+}
+
+#define DEFOP_REAL_REAL(OP)                                            \
+OP##_real_real(n_real *real, n_real *val)                              \
+{                                                                      \
+    switch (RTYPE(real)) {                                             \
+       case N_FIXNUM:                                                  \
+           switch (RTYPE(val)) {                                       \
+               case N_FIXNUM:                                          \
+                   r##OP##_fi_fi(real, RFI(val));                      \
+                   break;                                              \
+               case N_BIGNUM:                                          \
+                   r##OP##_fi_bi(real, RBI(val));                      \
+                   break;                                              \
+               case N_FLONUM:                                          \
+                   r##OP##_flonum(real, (double)RFI(real), RFF(val));  \
+                   break;                                              \
+               case N_FIXRATIO:                                        \
+                   r##OP##_fi_fr(real, RFRN(val), RFRD(val));          \
+                   break;                                              \
+               case N_BIGRATIO:                                        \
+                   r##OP##_fi_br(real, RBR(val));                      \
+                   break;                                              \
+           }                                                           \
+           break;                                                      \
+       case N_BIGNUM:                                                  \
+           switch (RTYPE(val)) {                                       \
+               case N_FIXNUM:                                          \
+                   r##OP##_bi_fi(real, RFI(val));                      \
+                   break;                                              \
+               case N_BIGNUM:                                          \
+                   r##OP##_bi_bi(real, RBI(val));                      \
+                   break;                                              \
+               case N_FLONUM:                                          \
+                   r##OP##_flonum(real, bi_getd(RBI(real)), RFF(val)); \
+                   break;                                              \
+               case N_FIXRATIO:                                        \
+                   r##OP##_bi_fr(real, RFRN(val), RFRD(val));          \
+                   break;                                              \
+               case N_BIGRATIO:                                        \
+                   r##OP##_bi_br(real, RBR(val));                      \
+                   break;                                              \
+           }                                                           \
+           break;                                                      \
+       case N_FLONUM:                                                  \
+           switch (RTYPE(val)) {                                       \
+               case N_FIXNUM:                                          \
+                   r##OP##_flonum(real, RFF(real), (double)RFI(val));  \
+                   break;                                              \
+               case N_BIGNUM:                                          \
+                   r##OP##_flonum(real, RFF(real), bi_getd(RBI(val))); \
+                   break;                                              \
+               case N_FLONUM:                                          \
+                   r##OP##_flonum(real, RFF(real), RFF(val));          \
+                   break;                                              \
+               case N_FIXRATIO:                                        \
+                   r##OP##_flonum(real, RFF(real),                     \
+                                (double)RFRN(val) / (double)RFRD(val));\
+                   break;                                              \
+               case N_BIGRATIO:                                        \
+                   r##OP##_flonum(real, RFF(real), br_getd(RBR(val))); \
+                   break;                                              \
+           }                                                           \
+           break;                                                      \
+       case N_FIXRATIO:                                                \
+           switch (RTYPE(val)) {                                       \
+               case N_FIXNUM:                                          \
+                   r##OP##_fr_fi(real, RFI(val));                      \
+                   break;                                              \
+               case N_BIGNUM:                                          \
+                   r##OP##_fr_bi(real, RBI(val));                      \
+                   break;                                              \
+               case N_FLONUM:                                          \
+                   r##OP##_flonum(real,                                \
+                               (double)RFRN(real) / (double)RFRD(real),\
+                               RFF(val));                              \
+                   break;                                              \
+               case N_FIXRATIO:                                        \
+                   r##OP##_fr_fr(real, RFRN(val), RFRD(val));          \
+                   break;                                              \
+               case N_BIGRATIO:                                        \
+                   r##OP##_fr_br(real, RBR(val));                      \
+                   break;                                              \
+           }                                                           \
+           break;                                                      \
+       case N_BIGRATIO:                                                \
+           switch (RTYPE(val)) {                                       \
+               case N_FIXNUM:                                          \
+                   r##OP##_br_fi(real, RFI(val));                      \
+                   break;                                              \
+               case N_BIGNUM:                                          \
+                   r##OP##_br_bi(real, RBI(val));                      \
+                   break;                                              \
+               case N_FLONUM:                                          \
+                   r##OP##_flonum(real, br_getd(RBR(real)), RFF(val)); \
+                   break;                                              \
+               case N_FIXRATIO:                                        \
+                   r##OP##_br_fr(real, RFRN(val), RFRD(val));          \
+                   break;                                              \
+               case N_BIGRATIO:                                        \
+                   r##OP##_br_br(real, RBR(val));                      \
+                   break;                                              \
+           }                                                           \
+           break;                                                      \
+    }                                                                  \
+}
+
+static void
+DEFOP_REAL_REAL(add)
+
+static void
+DEFOP_REAL_REAL(sub)
+
+static void
+DEFOP_REAL_REAL(div)
+
+static void
+DEFOP_REAL_REAL(mul)
+
+
+#define DEFOP_REAL_OBJECT(OP)                                          \
+OP##_real_object(n_real *real, LispObj *obj)                           \
+{                                                                      \
+    switch (OBJECT_TYPE(obj)) {                                                \
+       case LispFixnum_t:                                              \
+           switch (RTYPE(real)) {                                      \
+               case N_FIXNUM:                                          \
+                   r##OP##_fi_fi(real, OFI(obj));                      \
+                   break;                                              \
+               case N_BIGNUM:                                          \
+                   r##OP##_bi_fi(real, OFI(obj));                      \
+                   break;                                              \
+               case N_FLONUM:                                          \
+                   r##OP##_flonum(real, RFF(real), (double)OFI(obj));  \
+                   break;                                              \
+               case N_FIXRATIO:                                        \
+                   r##OP##_fr_fi(real, OFI(obj));                      \
+                   break;                                              \
+               case N_BIGRATIO:                                        \
+                   r##OP##_br_fi(real, OFI(obj));                      \
+                   break;                                              \
+           }                                                           \
+           break;                                                      \
+       case LispInteger_t:                                             \
+           switch (RTYPE(real)) {                                      \
+               case N_FIXNUM:                                          \
+                   r##OP##_fi_fi(real, OII(obj));                      \
+                   break;                                              \
+               case N_BIGNUM:                                          \
+                   r##OP##_bi_fi(real, OII(obj));                      \
+                   break;                                              \
+               case N_FLONUM:                                          \
+                   r##OP##_flonum(real, RFF(real), (double)OII(obj));  \
+                   break;                                              \
+               case N_FIXRATIO:                                        \
+                   r##OP##_fr_fi(real, OII(obj));                      \
+                   break;                                              \
+               case N_BIGRATIO:                                        \
+                   r##OP##_br_fi(real, OII(obj));                      \
+                   break;                                              \
+           }                                                           \
+           break;                                                      \
+       case LispBignum_t:                                              \
+           switch (RTYPE(real)) {                                      \
+               case N_FIXNUM:                                          \
+                   r##OP##_fi_bi(real, OBI(obj));                      \
+                   break;                                              \
+               case N_BIGNUM:                                          \
+                   r##OP##_bi_bi(real, OBI(obj));                      \
+                   break;                                              \
+               case N_FLONUM:                                          \
+                   r##OP##_flonum(real, RFF(real), bi_getd(OBI(obj))); \
+                   break;                                              \
+               case N_FIXRATIO:                                        \
+                   r##OP##_fr_bi(real, OBI(obj));                      \
+                   break;                                              \
+               case N_BIGRATIO:                                        \
+                   r##OP##_br_bi(real, OBI(obj));                      \
+                   break;                                              \
+           }                                                           \
+           break;                                                      \
+       case LispDFloat_t:                                              \
+           switch (RTYPE(real)) {                                      \
+               case N_FIXNUM:                                          \
+                   r##OP##_flonum(real, (double)RFI(real), ODF(obj));  \
+                   break;                                              \
+               case N_BIGNUM:                                          \
+                   r##OP##_flonum(real, bi_getd(RBI(real)), ODF(obj)); \
+                   break;                                              \
+               case N_FLONUM:                                          \
+                   r##OP##_flonum(real, RFF(real), ODF(obj));          \
+                   break;                                              \
+               case N_FIXRATIO:                                        \
+                   r##OP##_flonum(real,                                \
+                               (double)RFRN(real) / (double)RFRD(real),\
+                               ODF(obj));                              \
+                   break;                                              \
+               case N_BIGRATIO:                                        \
+                   r##OP##_flonum(real, br_getd(RBR(real)), ODF(obj)); \
+                   break;                                              \
+           }                                                           \
+           break;                                                      \
+       case LispRatio_t:                                               \
+           switch (RTYPE(real)) {                                      \
+               case N_FIXNUM:                                          \
+                   r##OP##_fi_fr(real, OFRN(obj), OFRD(obj));          \
+                   break;                                              \
+               case N_BIGNUM:                                          \
+                   r##OP##_bi_fr(real, OFRN(obj), OFRD(obj));          \
+                   break;                                              \
+               case N_FLONUM:                                          \
+                   r##OP##_flonum(real, RFF(real),                     \
+                               (double)OFRN(obj) / (double)OFRD(obj)); \
+                   break;                                              \
+               case N_FIXRATIO:                                        \
+                   r##OP##_fr_fr(real, OFRN(obj), OFRD(obj));          \
+                   break;                                              \
+               case N_BIGRATIO:                                        \
+                   r##OP##_br_fr(real, OFRN(obj), OFRD(obj));          \
+                   break;                                              \
+           }                                                           \
+           break;                                                      \
+       case LispBigratio_t:                                            \
+           switch (RTYPE(real)) {                                      \
+               case N_FIXNUM:                                          \
+                   r##OP##_fi_br(real, OBR(obj));                      \
+                   break;                                              \
+               case N_BIGNUM:                                          \
+                   r##OP##_bi_br(real, OBR(obj));                      \
+                   break;                                              \
+               case N_FLONUM:                                          \
+                   r##OP##_flonum(real, RFF(real), br_getd(OBR(obj))); \
+                   break;                                              \
+               case N_FIXRATIO:                                        \
+                   r##OP##_fr_br(real, OBR(obj));                      \
+                   break;                                              \
+               case N_BIGRATIO:                                        \
+                   r##OP##_br_br(real, OBR(obj));                      \
+                   break;                                              \
+           }                                                           \
+           break;                                                      \
+       default:                                                        \
+           fatal_object_error(obj, NOT_A_REAL_NUMBER);                 \
+           break;                                                      \
+    }                                                                  \
+}
+
+static void
+DEFOP_REAL_OBJECT(add)
+
+static void
+DEFOP_REAL_OBJECT(sub)
+
+static void
+DEFOP_REAL_OBJECT(div)
+
+static void
+DEFOP_REAL_OBJECT(mul)
+
+
+#define DEFOP_NUMBER_OBJECT(OP)                                                \
+OP##_number_object(n_number *num, LispObj *obj)                                \
+{                                                                      \
+    if (num->complex) {                                                        \
+       switch (OBJECT_TYPE(obj)) {                                     \
+           case LispFixnum_t:                                          \
+           case LispInteger_t:                                         \
+           case LispBignum_t:                                          \
+           case LispDFloat_t:                                          \
+           case LispRatio_t:                                           \
+           case LispBigratio_t:                                        \
+               n##OP##_cx_re(num, obj);                                \
+               break;                                                  \
+           case LispComplex_t:                                         \
+               n##OP##_cx_cx(num, obj);                                \
+               break;                                                  \
+           default:                                                    \
+               fatal_object_error(obj, NOT_A_NUMBER);                  \
+               break;                                                  \
+       }                                                               \
+    }                                                                  \
+    else {                                                             \
+       switch (OBJECT_TYPE(obj)) {                                     \
+           case LispFixnum_t:                                          \
+               switch (NRTYPE(num)) {                                  \
+                   case N_FIXNUM:                                      \
+                       r##OP##_fi_fi(NREAL(num), OFI(obj));            \
+                       break;                                          \
+                   case N_BIGNUM:                                      \
+                       r##OP##_bi_fi(NREAL(num), OFI(obj));            \
+                       break;                                          \
+                   case N_FLONUM:                                      \
+                       r##OP##_flonum(NREAL(num), NRFF(num),           \
+                                   (double)OFI(obj));                  \
+                       break;                                          \
+                   case N_FIXRATIO:                                    \
+                       r##OP##_fr_fi(NREAL(num), OFI(obj));            \
+                       break;                                          \
+                   case N_BIGRATIO:                                    \
+                       r##OP##_br_fi(NREAL(num), OFI(obj));            \
+                       break;                                          \
+               }                                                       \
+               break;                                                  \
+           case LispInteger_t:                                         \
+               switch (NRTYPE(num)) {                                  \
+                   case N_FIXNUM:                                      \
+                       r##OP##_fi_fi(NREAL(num), OII(obj));            \
+                       break;                                          \
+                   case N_BIGNUM:                                      \
+                       r##OP##_bi_fi(NREAL(num), OII(obj));            \
+                       break;                                          \
+                   case N_FLONUM:                                      \
+                       r##OP##_flonum(NREAL(num), NRFF(num),           \
+                                   (double)OII(obj));                  \
+                       break;                                          \
+                   case N_FIXRATIO:                                    \
+                       r##OP##_fr_fi(NREAL(num), OII(obj));            \
+                       break;                                          \
+                   case N_BIGRATIO:                                    \
+                       r##OP##_br_fi(NREAL(num), OII(obj));            \
+                       break;                                          \
+               }                                                       \
+               break;                                                  \
+           case LispBignum_t:                                          \
+               switch (NRTYPE(num)) {                                  \
+                   case N_FIXNUM:                                      \
+                       r##OP##_fi_bi(NREAL(num), OBI(obj));            \
+                       break;                                          \
+                   case N_BIGNUM:                                      \
+                       r##OP##_bi_bi(NREAL(num), OBI(obj));            \
+                       break;                                          \
+                   case N_FLONUM:                                      \
+                       r##OP##_flonum(NREAL(num), NRFF(num),           \
+                                      bi_getd(OBI(obj)));              \
+                       break;                                          \
+                   case N_FIXRATIO:                                    \
+                       r##OP##_fr_bi(NREAL(num), OBI(obj));            \
+                       break;                                          \
+                   case N_BIGRATIO:                                    \
+                       r##OP##_br_bi(NREAL(num), OBI(obj));            \
+                       break;                                          \
+               }                                                       \
+               break;                                                  \
+           case LispDFloat_t:                                          \
+               switch (NRTYPE(num)) {                                  \
+                   case N_FIXNUM:                                      \
+                       r##OP##_flonum(NREAL(num), (double)NRFI(num),   \
+                                   ODF(obj));                          \
+                       break;                                          \
+                   case N_BIGNUM:                                      \
+                       r##OP##_flonum(NREAL(num), bi_getd(NRBI(num)),  \
+                                   ODF(obj));                          \
+                       break;                                          \
+                   case N_FLONUM:                                      \
+                       r##OP##_flonum(NREAL(num), NRFF(num), ODF(obj));\
+                       break;                                          \
+                   case N_FIXRATIO:                                    \
+                       r##OP##_flonum(NREAL(num),                      \
+                                   (double)NRFRN(num) /                \
+                                   (double)NRFRD(num),                 \
+                                   ODF(obj));                          \
+                       break;                                          \
+                   case N_BIGRATIO:                                    \
+                       r##OP##_flonum(NREAL(num), br_getd(NRBR(num)),  \
+                                   ODF(obj));                          \
+                       break;                                          \
+               }                                                       \
+               break;                                                  \
+           case LispRatio_t:                                           \
+               switch (NRTYPE(num)) {                                  \
+                   case N_FIXNUM:                                      \
+                       r##OP##_fi_fr(NREAL(num), OFRN(obj), OFRD(obj));\
+                       break;                                          \
+                   case N_BIGNUM:                                      \
+                       r##OP##_bi_fr(NREAL(num), OFRN(obj), OFRD(obj));\
+                       break;                                          \
+                   case N_FLONUM:                                      \
+                       r##OP##_flonum(NREAL(num), NRFF(num),           \
+                                   (double)OFRN(obj) /                 \
+                                   (double)OFRD(obj));                 \
+                       break;                                          \
+                   case N_FIXRATIO:                                    \
+                       r##OP##_fr_fr(NREAL(num), OFRN(obj), OFRD(obj));\
+                       break;                                          \
+                   case N_BIGRATIO:                                    \
+                       r##OP##_br_fr(NREAL(num), OFRN(obj), OFRD(obj));\
+                       break;                                          \
+               }                                                       \
+               break;                                                  \
+           case LispBigratio_t:                                        \
+               switch (NRTYPE(num)) {                                  \
+                   case N_FIXNUM:                                      \
+                       r##OP##_fi_br(NREAL(num), OBR(obj));            \
+                       break;                                          \
+                   case N_BIGNUM:                                      \
+                       r##OP##_bi_br(NREAL(num), OBR(obj));            \
+                       break;                                          \
+                   case N_FLONUM:                                      \
+                       r##OP##_flonum(NREAL(num), NRFF(num),           \
+                                   br_getd(OBR(obj)));         \
+                       break;                                          \
+                   case N_FIXRATIO:                                    \
+                       r##OP##_fr_br(NREAL(num), OBR(obj));            \
+                       break;                                          \
+                   case N_BIGRATIO:                                    \
+                       r##OP##_br_br(NREAL(num), OBR(obj));            \
+                       break;                                          \
+               }                                                       \
+               break;                                                  \
+           case LispComplex_t:                                         \
+               n##OP##_re_cx(num, obj);                                \
+               break;                                                  \
+           default:                                                    \
+               fatal_object_error(obj, NOT_A_NUMBER);                  \
+               break;                                                  \
+       }                                                               \
+    }                                                                  \
+}
+
+static void
+DEFOP_NUMBER_OBJECT(add)
+
+static void
+DEFOP_NUMBER_OBJECT(sub)
+
+static void
+DEFOP_NUMBER_OBJECT(div)
+
+static void
+DEFOP_NUMBER_OBJECT(mul)
+
+
+/************************************************************************
+ * ABS
+ ************************************************************************/
+static void
+abs_real(n_real *real)
+{
+    switch (RTYPE(real)) {
+       case N_FIXNUM:          rabs_fi(real);  break;
+       case N_BIGNUM:          rabs_bi(real);  break;
+       case N_FLONUM:          rabs_ff(real);  break;
+       case N_FIXRATIO:        rabs_fr(real);  break;
+       case N_BIGRATIO:        rabs_br(real);  break;
+    }
+}
+
+static void
+abs_number(n_number *num)
+{
+    if (num->complex)
+       nabs_cx(num);
+    else {
+       switch (NRTYPE(num)) {
+           case N_FIXNUM:      rabs_fi(NREAL(num));    break;
+           case N_BIGNUM:      rabs_bi(NREAL(num));    break;
+           case N_FLONUM:      rabs_ff(NREAL(num));    break;
+           case N_FIXRATIO:    rabs_fr(NREAL(num));    break;
+           case N_BIGRATIO:    rabs_br(NREAL(num));    break;
+       }
+    }
+}
+
+static void
+nabs_cx(n_number *num)
+{
+    n_real temp;
+
+    abs_real(NREAL(num));
+    abs_real(NIMAG(num));
+
+    if (cmp_real_real(NREAL(num), NIMAG(num)) < 0) {
+       memcpy(&temp, NIMAG(num), sizeof(n_real));
+       memcpy(NIMAG(num), NREAL(num), sizeof(n_real));
+       memcpy(NREAL(num), &temp, sizeof(n_real));
+    }
+
+    if (cmp_real_real(NIMAG(num), &zero) == 0) {
+       num->complex = 0;
+       if (NITYPE(num) == N_FLONUM) {
+           /* change number type */
+           temp.type = N_FLONUM;
+           temp.data.flonum = 1.0;
+           mul_real_real(NREAL(num), &temp);
+       }
+       else
+           clear_real(NIMAG(num));
+    }
+    else {
+       div_real_real(NIMAG(num), NREAL(num));
+       set_real_real(&temp, NIMAG(num));
+       mul_real_real(NIMAG(num), &temp);
+       clear_real(&temp);
+
+       add_real_real(NIMAG(num), &one);
+       sqrt_real(NIMAG(num));
+
+       mul_real_real(NIMAG(num), NREAL(num));
+       clear_real(NREAL(num));
+       memcpy(NREAL(num), NIMAG(num), sizeof(n_real));
+       num->complex = 0;
+    }
+}
+
+static INLINE void
+rabs_fi(n_real *real)
+{
+    if (RFI(real) < 0)
+       rneg_fi(real);
+}
+
+static INLINE void
+rabs_bi(n_real *real)
+{
+    if (mpi_cmpi(RBI(real), 0) < 0)
+       mpi_neg(RBI(real), RBI(real));
+}
+
+static INLINE void
+rabs_ff(n_real *real)
+{
+    if (RFF(real) < 0.0)
+       RFF(real) = -RFF(real);
+}
+
+static INLINE void
+rabs_fr(n_real *real)
+{
+    if (RFRN(real) < 0)
+       rneg_fr(real);
+}
+
+static INLINE void
+rabs_br(n_real *real)
+{
+    if (mpi_cmpi(RBRN(real), 0) < 0)
+       mpi_neg(RBRN(real), RBRN(real));
+}
+
+
+/************************************************************************
+ * NEG
+ ************************************************************************/
+static void
+neg_real(n_real *real)
+{
+    switch (RTYPE(real)) {
+       case N_FIXNUM:          rneg_fi(real);  break;
+       case N_BIGNUM:          rneg_bi(real);  break;
+       case N_FLONUM:          rneg_ff(real);  break;
+       case N_FIXRATIO:        rneg_fr(real);  break;
+       case N_BIGRATIO:        rneg_br(real);  break;
+    }
+}
+
+static void
+neg_number(n_number *num)
+{
+    if (num->complex) {
+       neg_real(NREAL(num));
+       neg_real(NIMAG(num));
+    }
+    else {
+       switch (NRTYPE(num)) {
+           case N_FIXNUM:      rneg_fi(NREAL(num));    break;
+           case N_BIGNUM:      rneg_bi(NREAL(num));    break;
+           case N_FLONUM:      rneg_ff(NREAL(num));    break;
+           case N_FIXRATIO:    rneg_fr(NREAL(num));    break;
+           case N_BIGRATIO:    rneg_br(NREAL(num));    break;
+       }
+    }
+}
+
+static void
+rneg_fi(n_real *real)
+{
+    if (RFI(real) == MINSLONG) {
+       mpi *bigi = XALLOC(mpi);
+
+       mpi_init(bigi);
+       mpi_seti(bigi, RFI(real));
+       mpi_neg(bigi, bigi);
+       RTYPE(real) = N_BIGNUM;
+       RBI(real) = bigi;
+    }
+    else
+       RFI(real) = -RFI(real);
+}
+
+static INLINE void
+rneg_bi(n_real *real)
+{
+    mpi_neg(RBI(real), RBI(real));
+}
+
+static INLINE void
+rneg_ff(n_real *real)
+{
+    RFF(real) = -RFF(real);
+}
+
+static void
+rneg_fr(n_real *real)
+{
+    if (RFRN(real) == MINSLONG) {
+       mpr *bigr = XALLOC(mpr);
+
+       mpr_init(bigr);
+       mpr_seti(bigr, RFRN(real), RFRD(real));
+       mpi_neg(mpr_num(bigr), mpr_num(bigr));
+       RTYPE(real) = N_BIGRATIO;
+       RBR(real) = bigr;
+    }
+    else
+       RFRN(real) = -RFRN(real);
+}
+
+static INLINE void
+rneg_br(n_real *real)
+{
+    mpi_neg(RBRN(real), RBRN(real));
+}
+
+
+/************************************************************************
+ * SQRT
+ ************************************************************************/
+static void
+sqrt_real(n_real *real)
+{
+    switch (RTYPE(real)) {
+       case N_FIXNUM:
+       case N_BIGNUM:
+           rsqrt_xi(real);
+           break;
+       case N_FLONUM:
+           rsqrt_ff(real);
+           break;
+       case N_FIXRATIO:
+       case N_BIGRATIO:
+           rsqrt_xr(real);
+           break;
+    }
+}
+
+static void
+sqrt_number(n_number *num)
+{
+    if (num->complex)
+       nsqrt_cx(num);
+    else {
+       switch (NRTYPE(num)) {
+           case N_FIXNUM:
+           case N_BIGNUM:
+               nsqrt_xi(num);
+               break;
+           case N_FLONUM:
+               nsqrt_ff(num);
+               break;
+           case N_FIXRATIO:
+           case N_BIGRATIO:
+               nsqrt_xr(num);
+               break;
+       }
+    }
+}
+
+static void
+rsqrt_xi(n_real *real)
+{
+    int exact;
+    mpi bignum;
+
+    if (cmp_real_real(real, &zero) < 0)
+       fatal_error(FLOATING_POINT_EXCEPTION);
+
+    mpi_init(&bignum);
+    if (RTYPE(real) == N_BIGNUM)
+       exact = mpi_sqrt(&bignum, RBI(real));
+    else {
+       mpi tmp;
+
+       mpi_init(&tmp);
+       mpi_seti(&tmp, RFI(real));
+       exact = mpi_sqrt(&bignum, &tmp);
+       mpi_clear(&tmp);
+    }
+    if (exact) {
+       if (RTYPE(real) == N_BIGNUM) {
+           mpi_set(RBI(real), &bignum);
+           rbi_canonicalize(real);
+       }
+       else
+           RFI(real) = mpi_geti(&bignum);
+    }
+    else {
+       double value;
+
+       if (RTYPE(real) == N_BIGNUM) {
+           value = bi_getd(RBI(real));
+           RCLEAR_BI(real);
+       }
+       else
+           value = (double)RFI(real);
+
+       value = sqrt(value);
+       RTYPE(real) = N_FLONUM;
+       RFF(real) = value;
+    }
+    mpi_clear(&bignum);
+}
+
+static void
+rsqrt_xr(n_real *real)
+{
+    n_real num, den;
+
+    if (cmp_real_real(real, &zero) < 0)
+       fatal_error(FLOATING_POINT_EXCEPTION);
+
+    if (RTYPE(real) == N_FIXRATIO) {
+       num.type = den.type = N_FIXNUM;
+       num.data.fixnum = RFRN(real);
+       den.data.fixnum = RFRD(real);
+    }
+    else {
+       mpi *bignum;
+
+       if (mpi_fiti(RBRN(real))) {
+           num.type = N_FIXNUM;
+           num.data.fixnum = mpi_geti(RBRN(real));
+       }
+       else {
+           bignum = XALLOC(mpi);
+           mpi_init(bignum);
+           mpi_set(bignum, RBRN(real));
+           num.type = N_BIGNUM;
+           num.data.bignum = bignum;
+       }
+
+       if (mpi_fiti(RBRD(real))) {
+           den.type = N_FIXNUM;
+           den.data.fixnum = mpi_geti(RBRD(real));
+       }
+       else {
+           bignum = XALLOC(mpi);
+           mpi_init(bignum);
+           mpi_set(bignum, RBRD(real));
+           den.type = N_BIGNUM;
+           den.data.bignum = bignum;
+       }
+    }
+
+    rsqrt_xi(&num);
+    rsqrt_xi(&den);
+
+    clear_real(real);
+    memcpy(real, &num, sizeof(n_real));
+    div_real_real(real, &den);
+    clear_real(&den);
+}
+
+static void
+rsqrt_ff(n_real *real)
+{
+    if (RFF(real) < 0.0)
+       fatal_error(FLOATING_POINT_EXCEPTION);
+    RFF(real) = sqrt(RFF(real));
+}
+
+
+static void
+nsqrt_cx(n_number *num)
+{
+    n_number mag;
+    n_real *real, *imag;
+
+    real = &(mag.real);
+    imag = &(mag.imag);
+    set_real_real(real, NREAL(num));
+    set_real_real(imag, NIMAG(num));
+    mag.complex = 1;
+
+    nabs_cx(&mag);     /* this will free the imag part data */
+    if (cmp_real_real(real, &zero) == 0) {
+       clear_number(num);
+       memcpy(NREAL(num), real, sizeof(n_real));
+       clear_real(real);
+       num->complex = 0;
+       return;
+    }
+    else if (cmp_real_real(NREAL(num), &zero) > 0) {
+       /* R = sqrt((mag + Ra) / 2) */
+       add_real_real(NREAL(num), real);
+       clear_real(real);
+       div_real_real(NREAL(num), &two);
+       sqrt_real(NREAL(num));
+
+       /* I = Ia / R / 2 */
+       div_real_real(NIMAG(num), NREAL(num));
+       div_real_real(NIMAG(num), &two);
+    }
+    else {
+       /* remember old imag part */
+       memcpy(imag, NIMAG(num), sizeof(n_real));
+
+       /* I = sqrt((mag - Ra) / 2) */
+       memcpy(NIMAG(num), real, sizeof(n_real));
+       sub_real_real(NIMAG(num), NREAL(num));
+       div_real_real(NIMAG(num), &two);
+       sqrt_real(NIMAG(num));
+       if (cmp_real_real(imag, &zero) < 0)
+           neg_real(NIMAG(num));
+
+       /* R = Ia / I / 2 */
+       clear_real(NREAL(num));
+       /* start with old imag part */
+       memcpy(NREAL(num), imag, sizeof(n_real));
+       div_real_real(NREAL(num), NIMAG(num));
+       div_real_real(NREAL(num), &two);
+    }
+
+    ncx_canonicalize(num);
+}
+
+static void
+nsqrt_xi(n_number *num)
+{
+    if (cmp_real_real(NREAL(num), &zero) < 0) {
+       memcpy(NIMAG(num), NREAL(num), sizeof(n_real));
+       neg_real(NIMAG(num));
+       rsqrt_xi(NIMAG(num));
+       NRTYPE(num) = N_FIXNUM;
+       NRFI(num) = 0;
+       num->complex = 1;
+    }
+    else
+       rsqrt_xi(NREAL(num));
+}
+
+static void
+nsqrt_ff(n_number *num)
+{
+    double value;
+
+    if (NRFF(num) < 0.0) {
+       value = sqrt(-NRFF(num));
+
+       NITYPE(num) = N_FLONUM;
+       NIFF(num) = value;
+       NRTYPE(num) = N_FIXNUM;
+       NRFI(num) = 0;
+       num->complex = 1;
+    }
+    else {
+       value = sqrt(NRFF(num));
+       NRFF(num) = value;
+    }
+}
+
+static void
+nsqrt_xr(n_number *num)
+{
+    if (cmp_real_real(NREAL(num), &zero) < 0) {
+       memcpy(NIMAG(num), NREAL(num), sizeof(n_real));
+       neg_real(NIMAG(num));
+       rsqrt_xr(NIMAG(num));
+       NRTYPE(num) = N_FIXNUM;
+       NRFI(num) = 0;
+       num->complex = 1;
+    }
+    else
+       rsqrt_xr(NREAL(num));
+}
+
+
+/************************************************************************
+ * MOD
+ ************************************************************************/
+static void
+mod_real_real(n_real *real, n_real *val)
+{
+    /* Assume both operands are integers */
+    switch (RTYPE(real)) {
+       case N_FIXNUM:
+           switch (RTYPE(val)) {
+               case N_FIXNUM:
+                   rmod_fi_fi(real, RFI(val));
+                   break;
+               case N_BIGNUM:
+                   rmod_fi_bi(real, RBI(val));
+                   break;
+           }
+           break;
+       case N_BIGNUM:
+           switch (RTYPE(val)) {
+               case N_FIXNUM:
+                   rmod_bi_fi(real, RFI(val));
+                   break;
+               case N_BIGNUM:
+                   rmod_bi_bi(real, RBI(val));
+                   break;
+           }
+           break;
+    }
+}
+
+static void
+mod_real_object(n_real *real, LispObj *obj)
+{
+    switch (RTYPE(real)) {
+       case N_FIXNUM:
+           switch (OBJECT_TYPE(obj)) {
+               case LispFixnum_t:
+                   rmod_fi_fi(real, OFI(obj));
+                   return;
+               case LispInteger_t:
+                   rmod_fi_fi(real, OII(obj));
+                   return;
+               case LispBignum_t:
+                   rmod_fi_bi(real, OBI(obj));
+                   return;
+               default:
+                   break;
+           }
+           break;
+       case N_BIGNUM:
+           switch (OBJECT_TYPE(obj)) {
+               case LispFixnum_t:
+                   rmod_bi_fi(real, OFI(obj));
+                   return;
+               case LispInteger_t:
+                   rmod_bi_fi(real, OII(obj));
+                   return;
+               case LispBignum_t:
+                   rmod_bi_bi(real, OBI(obj));
+                   return;
+               default:
+                   break;
+           }
+           break;
+       /* Assume the n_real object is an integer */
+    }
+    fatal_object_error(obj, NOT_AN_INTEGER);
+}
+
+static void
+rmod_fi_fi(n_real *real, long fi)
+{
+    if (fi == 0)
+       fatal_error(DIVIDE_BY_ZERO);
+
+    if ((RFI(real) < 0) ^ (fi < 0))
+       RFI(real) = (RFI(real) % fi) + fi;
+    else if (RFI(real) == MINSLONG || fi == MINSLONG) {
+       mpi bignum;
+
+       mpi_init(&bignum);
+       mpi_seti(&bignum, RFI(real));
+       RFI(real) = mpi_modi(&bignum, fi);
+       mpi_clear(&bignum);
+    }
+    else
+       RFI(real) = RFI(real) % fi;
+}
+
+static void
+rmod_fi_bi(n_real *real, mpi *bignum)
+{
+    mpi *bigi;
+
+    if (mpi_cmpi(bignum, 0) == 0)
+       fatal_error(DIVIDE_BY_ZERO);
+
+    bigi = XALLOC(mpi);
+    mpi_init(bigi);
+    mpi_seti(bigi, RFI(real));
+    mpi_mod(bigi, bigi, bignum);
+    RTYPE(real) = N_BIGNUM;
+    RBI(real) = bigi;
+    rbi_canonicalize(real);
+}
+
+static void
+rmod_bi_fi(n_real *real, long fi)
+{
+    mpi iop;
+
+    if (fi == 0)
+       fatal_error(DIVIDE_BY_ZERO);
+
+    mpi_init(&iop);
+    mpi_seti(&iop, fi);
+    mpi_mod(RBI(real), RBI(real), &iop);
+    mpi_clear(&iop);
+    rbi_canonicalize(real);
+}
+
+static void
+rmod_bi_bi(n_real *real, mpi *bignum)
+{
+    if (mpi_cmpi(bignum, 0) == 0)
+       fatal_error(DIVIDE_BY_ZERO);
+
+    mpi_mod(RBI(real), RBI(real), bignum);
+    rbi_canonicalize(real);
+}
+
+/************************************************************************
+ * REM
+ ************************************************************************/
+static void
+rem_real_object(n_real *real, LispObj *obj)
+{
+    switch (RTYPE(real)) {
+       case N_FIXNUM:
+           switch (OBJECT_TYPE(obj)) {
+               case LispFixnum_t:
+                   rrem_fi_fi(real, OFI(obj));
+                   return;
+               case LispInteger_t:
+                   rrem_fi_fi(real, OII(obj));
+                   return;
+               case LispBignum_t:
+                   rrem_fi_bi(real, OBI(obj));
+                   return;
+               default:
+                   break;
+           }
+           break;
+       case N_BIGNUM:
+           switch (OBJECT_TYPE(obj)) {
+               case LispFixnum_t:
+                   rrem_bi_fi(real, OFI(obj));
+                   return;
+               case LispInteger_t:
+                   rrem_bi_fi(real, OII(obj));
+                   return;
+               case LispBignum_t:
+                   rrem_bi_bi(real, OBI(obj));
+                   return;
+               default:
+                   break;
+           }
+           break;
+       /* Assume the n_real object is an integer */
+    }
+    fatal_object_error(obj, NOT_AN_INTEGER);
+}
+
+static void
+rrem_fi_fi(n_real *real, long fi)
+{
+    if (fi == 0)
+       fatal_error(DIVIDE_BY_ZERO);
+
+    if (RFI(real) == MINSLONG || fi == MINSLONG) {
+       mpi bignum;
+
+       mpi_init(&bignum);
+       mpi_seti(&bignum, RFI(real));
+       RFI(real) = mpi_remi(&bignum, fi);
+       mpi_clear(&bignum);
+    }
+    else
+       RFI(real) = RFI(real) % fi;
+}
+
+static void
+rrem_fi_bi(n_real *real, mpi *bignum)
+{
+    mpi *bigi;
+
+    if (mpi_cmpi(bignum, 0) == 0)
+       fatal_error(DIVIDE_BY_ZERO);
+
+    bigi = XALLOC(mpi);
+    mpi_init(bigi);
+    mpi_seti(bigi, RFI(real));
+    mpi_rem(bigi, bigi, bignum);
+    RTYPE(real) = N_BIGNUM;
+    RBI(real) = bigi;
+    rbi_canonicalize(real);
+}
+
+static void
+rrem_bi_fi(n_real *real, long fi)
+{
+    mpi iop;
+
+    if (fi == 0)
+       fatal_error(DIVIDE_BY_ZERO);
+
+    mpi_init(&iop);
+    mpi_seti(&iop, fi);
+    mpi_rem(RBI(real), RBI(real), &iop);
+    mpi_clear(&iop);
+    rbi_canonicalize(real);
+}
+
+static void
+rrem_bi_bi(n_real *real, mpi *bignum)
+{
+    if (mpi_cmpi(bignum, 0) == 0)
+       fatal_error(DIVIDE_BY_ZERO);
+
+    mpi_rem(RBI(real), RBI(real), bignum);
+    rbi_canonicalize(real);
+}
+
+
+/************************************************************************
+ * GCD
+ ************************************************************************/
+static void
+gcd_real_object(n_real *real, LispObj *obj)
+{
+    if (!INTEGERP(obj))
+       fatal_object_error(obj, NOT_AN_INTEGER);
+
+    /* check for zero operand */
+    if (cmp_real_real(real, &zero) == 0)
+       set_real_object(real, obj);
+    else if (cmp_real_object(&zero, obj) != 0) {
+       n_real rest, temp;
+
+       set_real_object(&rest, obj);
+       for (;;) {
+           mod_real_real(&rest, real);
+           if (cmp_real_real(&rest, &zero) == 0)
+               break;
+           memcpy(&temp, real, sizeof(n_real));
+           memcpy(real, &rest, sizeof(n_real));
+           memcpy(&rest, &temp, sizeof(n_real));
+       }
+       clear_real(&rest);
+    }
+}
+
+/************************************************************************
+ * AND
+ ************************************************************************/
+static void
+and_real_object(n_real *real, LispObj *obj)
+{
+    mpi *bigi, iop;
+
+    switch (OBJECT_TYPE(obj)) {
+       case LispFixnum_t:
+           switch (RTYPE(real)) {
+               case N_FIXNUM:
+                   RFI(real) &= OFI(obj);
+                   break;
+               case N_BIGNUM:
+                   mpi_init(&iop);
+                   mpi_seti(&iop, OFI(obj));
+                   mpi_and(RBI(real), RBI(real), &iop);
+                   mpi_clear(&iop);
+                   rbi_canonicalize(real);
+                   break;
+           }
+           break;
+       case LispInteger_t:
+           switch (RTYPE(real)) {
+               case N_FIXNUM:
+                   RFI(real) &= OII(obj);
+                   break;
+               case N_BIGNUM:
+                   mpi_init(&iop);
+                   mpi_seti(&iop, OII(obj));
+                   mpi_and(RBI(real), RBI(real), &iop);
+                   mpi_clear(&iop);
+                   rbi_canonicalize(real);
+                   break;
+           }
+           break;
+       case LispBignum_t:
+           switch (RTYPE(real)) {
+               case N_FIXNUM:
+                   bigi = XALLOC(mpi);
+                   mpi_init(bigi);
+                   mpi_seti(bigi, RFI(real));
+                   mpi_and(bigi, bigi, OBI(obj));
+                   RTYPE(real) = N_BIGNUM;
+                   RBI(real) = bigi;
+                   rbi_canonicalize(real);
+                   break;
+               case N_BIGNUM:
+                   mpi_and(RBI(real), RBI(real), OBI(obj));
+                   rbi_canonicalize(real);
+                   break;
+           }
+           break;
+       default:
+           fatal_object_error(obj, NOT_AN_INTEGER);
+           break;
+    }
+}
+
+
+/************************************************************************
+ * EQV
+ ************************************************************************/
+static void
+eqv_real_object(n_real *real, LispObj *obj)
+{
+    mpi *bigi, iop;
+
+    switch (OBJECT_TYPE(obj)) {
+       case LispFixnum_t:
+           switch (RTYPE(real)) {
+               case N_FIXNUM:
+                   RFI(real) ^= ~OFI(obj);
+                   break;
+               case N_BIGNUM:
+                   mpi_init(&iop);
+                   mpi_seti(&iop, OFI(obj));
+                   mpi_com(&iop, &iop);
+                   mpi_xor(RBI(real), RBI(real), &iop);
+                   mpi_clear(&iop);
+                   rbi_canonicalize(real);
+                   break;
+           }
+           break;
+       case LispInteger_t:
+           switch (RTYPE(real)) {
+               case N_FIXNUM:
+                   RFI(real) ^= ~OII(obj);
+                   break;
+               case N_BIGNUM:
+                   mpi_init(&iop);
+                   mpi_seti(&iop, OII(obj));
+                   mpi_com(&iop, &iop);
+                   mpi_xor(RBI(real), RBI(real), &iop);
+                   mpi_clear(&iop);
+                   rbi_canonicalize(real);
+                   break;
+           }
+           break;
+       case LispBignum_t:
+           switch (RTYPE(real)) {
+               case N_FIXNUM:
+                   bigi = XALLOC(mpi);
+                   mpi_init(bigi);
+                   mpi_seti(bigi, RFI(real));
+                   mpi_com(bigi, bigi);
+                   mpi_xor(bigi, bigi, OBI(obj));
+                   RTYPE(real) = N_BIGNUM;
+                   RBI(real) = bigi;
+                   rbi_canonicalize(real);
+                   break;
+               case N_BIGNUM:
+                   mpi_com(RBI(real), RBI(real));
+                   mpi_xor(RBI(real), RBI(real), OBI(obj));
+                   rbi_canonicalize(real);
+                   break;
+           }
+           break;
+       default:
+           fatal_object_error(obj, NOT_AN_INTEGER);
+           break;
+    }
+}
+
+
+/************************************************************************
+ * IOR
+ ************************************************************************/
+static void
+ior_real_object(n_real *real, LispObj *obj)
+{
+    mpi *bigi, iop;
+
+    switch (OBJECT_TYPE(obj)) {
+       case LispFixnum_t:
+           switch (RTYPE(real)) {
+               case N_FIXNUM:
+                   RFI(real) |= OFI(obj);
+                   break;
+               case N_BIGNUM:
+                   mpi_init(&iop);
+                   mpi_seti(&iop, OFI(obj));
+                   mpi_ior(RBI(real), RBI(real), &iop);
+                   mpi_clear(&iop);
+                   rbi_canonicalize(real);
+                   break;
+           }
+           break;
+       case LispInteger_t:
+           switch (RTYPE(real)) {
+               case N_FIXNUM:
+                   RFI(real) |= OII(obj);
+                   break;
+               case N_BIGNUM:
+                   mpi_init(&iop);
+                   mpi_seti(&iop, OII(obj));
+                   mpi_ior(RBI(real), RBI(real), &iop);
+                   mpi_clear(&iop);
+                   rbi_canonicalize(real);
+                   break;
+           }
+           break;
+       case LispBignum_t:
+           switch (RTYPE(real)) {
+               case N_FIXNUM:
+                   bigi = XALLOC(mpi);
+                   mpi_init(bigi);
+                   mpi_seti(bigi, RFI(real));
+                   mpi_ior(bigi, bigi, OBI(obj));
+                   RTYPE(real) = N_BIGNUM;
+                   RBI(real) = bigi;
+                   rbi_canonicalize(real);
+                   break;
+               case N_BIGNUM:
+                   mpi_ior(RBI(real), RBI(real), OBI(obj));
+                   rbi_canonicalize(real);
+                   break;
+           }
+           break;
+       default:
+           fatal_object_error(obj, NOT_AN_INTEGER);
+           break;
+    }
+}
+
+
+/************************************************************************
+ * NOT
+ ************************************************************************/
+static void
+not_real(n_real *real)
+{
+    if (RTYPE(real) == N_FIXNUM)
+       RFI(real) = ~RFI(real);
+    else {
+       mpi_com(RBI(real), RBI(real));
+       rbi_canonicalize(real);
+    }
+}
+
+/************************************************************************
+ * XOR
+ ************************************************************************/
+static void
+xor_real_object(n_real *real, LispObj *obj)
+{
+    mpi *bigi, iop;
+
+    switch (OBJECT_TYPE(obj)) {
+       case LispFixnum_t:
+           switch (RTYPE(real)) {
+               case N_FIXNUM:
+                   RFI(real) ^= OFI(obj);
+                   break;
+               case N_BIGNUM:
+                   mpi_init(&iop);
+                   mpi_seti(&iop, OFI(obj));
+                   mpi_xor(RBI(real), RBI(real), &iop);
+                   mpi_clear(&iop);
+                   rbi_canonicalize(real);
+                   break;
+           }
+           break;
+       case LispInteger_t:
+           switch (RTYPE(real)) {
+               case N_FIXNUM:
+                   RFI(real) ^= OII(obj);
+                   break;
+               case N_BIGNUM:
+                   mpi_init(&iop);
+                   mpi_seti(&iop, OII(obj));
+                   mpi_xor(RBI(real), RBI(real), &iop);
+                   mpi_clear(&iop);
+                   rbi_canonicalize(real);
+                   break;
+           }
+           break;
+       case LispBignum_t:
+           switch (RTYPE(real)) {
+               case N_FIXNUM:
+                   bigi = XALLOC(mpi);
+                   mpi_init(bigi);
+                   mpi_seti(bigi, RFI(real));
+                   mpi_xor(bigi, bigi, OBI(obj));
+                   RTYPE(real) = N_BIGNUM;
+                   RBI(real) = bigi;
+                   rbi_canonicalize(real);
+                   break;
+               case N_BIGNUM:
+                   mpi_xor(RBI(real), RBI(real), OBI(obj));
+                   rbi_canonicalize(real);
+                   break;
+           }
+           break;
+       default:
+           fatal_object_error(obj, NOT_AN_INTEGER);
+           break;
+    }
+}
+
+
+/************************************************************************
+ * DIVIDE
+ ************************************************************************/
+static void
+divide_number_object(n_number *num, LispObj *obj, int fun, int flo)
+{
+    switch (OBJECT_TYPE(obj)) {
+       case LispFixnum_t:
+           switch (NRTYPE(num)) {
+               case N_FIXNUM:
+                   ndivide_fi_fi(num, OFI(obj), fun, flo);
+                   break;
+               case N_BIGNUM:
+                   ndivide_xi_xi(num, obj, fun, flo);
+                   break;
+               case N_FLONUM:
+                   ndivide_flonum(num, NRFF(num), (double)OFI(obj), fun, flo);
+                   break;
+               case N_FIXRATIO:
+               case N_BIGRATIO:
+                   ndivide_xr_xi(num, obj, fun, flo);
+                   break;
+           }
+           break;
+       case LispInteger_t:
+           switch (NRTYPE(num)) {
+               case N_FIXNUM:
+                   ndivide_fi_fi(num, OII(obj), fun, flo);
+                   break;
+               case N_BIGNUM:
+                   ndivide_xi_xi(num, obj, fun, flo);
+                   break;
+               case N_FLONUM:
+                   ndivide_flonum(num, NRFF(num), (double)OII(obj), fun, flo);
+                   break;
+               case N_FIXRATIO:
+               case N_BIGRATIO:
+                   ndivide_xr_xi(num, obj, fun, flo);
+                   break;
+           }
+           break;
+       case LispBignum_t:
+           switch (NRTYPE(num)) {
+               case N_FIXNUM:
+               case N_BIGNUM:
+                   ndivide_xi_xi(num, obj, fun, flo);
+                   break;
+               case N_FLONUM:
+                   ndivide_flonum(num, NRFF(num), bi_getd(OBI(obj)),
+                                  fun, flo);
+                   break;
+               case N_FIXRATIO:
+               case N_BIGRATIO:
+                   ndivide_xr_xi(num, obj, fun, flo);
+                   break;
+           }
+           break;
+       case LispDFloat_t:
+           switch (NRTYPE(num)) {
+               case N_FIXNUM:
+                   ndivide_flonum(num, (double)NRFI(num), ODF(obj),
+                                  fun, flo);
+                   break;
+               case N_BIGNUM:
+                   ndivide_flonum(num, bi_getd(NRBI(num)), ODF(obj),
+                                  fun, flo);
+                   break;
+               case N_FLONUM:
+                   ndivide_flonum(num, NRFF(num), ODF(obj), fun, flo);
+                   break;
+               case N_FIXRATIO:
+                   ndivide_flonum(num,
+                                  (double)NRFRN(num) / (double)NRFRD(num),
+                                  ODF(obj), fun, flo);
+                   break;
+               case N_BIGRATIO:
+                   ndivide_flonum(num, br_getd(NRBR(num)), ODF(obj),
+                                  fun, flo);
+                   break;
+           }
+           break;
+       case LispRatio_t:
+           switch (NRTYPE(num)) {
+               case N_FIXNUM:
+               case N_BIGNUM:
+                   ndivide_xi_xr(num, obj, fun, flo);
+                   break;
+               case N_FLONUM:
+                   ndivide_flonum(num, NRFF(num),
+                                  (double)OFRN(obj) / (double)OFRD(obj),
+                                  fun, flo);
+                   break;
+               case N_FIXRATIO:
+               case N_BIGRATIO:
+                   ndivide_xr_xr(num, obj, fun, flo);
+                   break;
+           }
+           break;
+       case LispBigratio_t:
+           switch (NRTYPE(num)) {
+               case N_FIXNUM:
+               case N_BIGNUM:
+                   ndivide_xi_xr(num, obj, fun, flo);
+                   break;
+               case N_FLONUM:
+                   ndivide_flonum(num, NRFF(num), br_getd(OBR(obj)),
+                                  fun, flo);
+                   break;
+               case N_FIXRATIO:
+               case N_BIGRATIO:
+                   ndivide_xr_xr(num, obj, fun, flo);
+                   break;
+           }
+           break;
+       default:
+           fatal_object_error(obj, NOT_A_REAL_NUMBER);
+           break;
+    }
+}
+
+
+/************************************************************************
+ * COMPARE
+ ************************************************************************/
+static int
+cmp_real_real(n_real *op1, n_real *op2)
+{
+    switch (RTYPE(op1)) {
+       case N_FIXNUM:
+           switch (RTYPE(op2)) {
+               case N_FIXNUM:
+                   return (cmp_fi_fi(RFI(op1), RFI(op2)));
+               case N_BIGNUM:
+                   return (cmp_fi_bi(RFI(op1), RBI(op2)));
+               case N_FLONUM:
+                   return (cmp_flonum((double)RFI(op1), RFF(op2)));
+               case N_FIXRATIO:
+                   return (cmp_fi_fr(RFI(op1), RFRN(op2), RFRD(op2)));
+               case N_BIGRATIO:
+                   return (cmp_fi_br(RFI(op1), RBR(op2)));
+           }
+           break;
+       case N_BIGNUM:
+           switch (RTYPE(op2)) {
+               case N_FIXNUM:
+                   return (cmp_bi_fi(RBI(op1), RFI(op2)));
+               case N_BIGNUM:
+                   return (cmp_bi_bi(RBI(op1), RBI(op2)));
+               case N_FLONUM:
+                   return (cmp_flonum(bi_getd(RBI(op1)), RFF(op2)));
+               case N_FIXRATIO:
+                   return (cmp_bi_fr(RBI(op1), RFRN(op2), RFRD(op2)));
+               case N_BIGRATIO:
+                   return (cmp_bi_br(RBI(op1), RBR(op2)));
+           }
+           break;
+       case N_FLONUM:
+           switch (RTYPE(op2)) {
+               case N_FIXNUM:
+                   return (cmp_flonum(RFF(op1), (double)RFI(op2)));
+               case N_BIGNUM:
+                   return (cmp_flonum(RFF(op1), bi_getd(RBI(op2))));
+               case N_FLONUM:
+                   return (cmp_flonum(RFF(op1), RFF(op2)));
+               case N_FIXRATIO:
+                   return (cmp_flonum(RFF(op1),
+                                      (double)RFRN(op2) / (double)RFRD(op2)));
+               case N_BIGRATIO:
+                   return (cmp_flonum(RFF(op1), br_getd(RBR(op2))));
+           }
+           break;
+       case N_FIXRATIO:
+           switch (RTYPE(op2)) {
+               case N_FIXNUM:
+                   return (cmp_fr_fi(RFRN(op1), RFRD(op1), RFI(op2)));
+               case N_BIGNUM:
+                   return (cmp_fr_bi(RFRN(op1), RFRD(op1), RBI(op2)));
+               case N_FLONUM:
+                   return (cmp_flonum((double)RFRN(op1) / (double)RFRD(op1),
+                                      RFF(op2)));
+               case N_FIXRATIO:
+                   return (cmp_fr_fr(RFRN(op1), RFRD(op1),
+                                     RFRN(op2), RFRD(op2)));
+               case N_BIGRATIO:
+                   return (cmp_fr_br(RFRN(op1), RFRD(op1), RBR(op2)));
+           }
+           break;
+       case N_BIGRATIO:
+           switch (RTYPE(op2)) {
+               case N_FIXNUM:
+                   return (cmp_br_fi(RBR(op1), RFI(op2)));
+               case N_BIGNUM:
+                   return (cmp_br_bi(RBR(op1), RBI(op2)));
+               case N_FLONUM:
+                   return (cmp_flonum(br_getd(RBR(op1)), RFF(op2)));
+               case N_FIXRATIO:
+                   return (cmp_br_fr(RBR(op1), RFRN(op2), RFRD(op2)));
+               case N_BIGRATIO:
+                   return (cmp_br_br(RBR(op1), RBR(op2)));
+           }
+    }
+
+    return (0);
+}
+
+static int
+cmp_real_object(n_real *op1, LispObj *op2)
+{
+    switch (OBJECT_TYPE(op2)) {
+       case LispFixnum_t:
+           switch (RTYPE(op1)) {
+               case N_FIXNUM:
+                   return (cmp_fi_fi(RFI(op1), OFI(op2)));
+               case N_BIGNUM:
+                   return (cmp_bi_fi(RBI(op1), OFI(op2)));
+               case N_FLONUM:
+                   return (cmp_flonum(RFF(op1), (double)OFI(op2)));
+               case N_FIXRATIO:
+                   return (cmp_fr_fi(RFRD(op1), RFRN(op1), OFI(op2)));
+               case N_BIGRATIO:
+                   return (cmp_br_fi(RBR(op1), OFI(op2)));
+           }
+           break;
+       case LispInteger_t:
+           switch (RTYPE(op1)) {
+               case N_FIXNUM:
+                   return (cmp_fi_fi(RFI(op1), OII(op2)));
+               case N_BIGNUM:
+                   return (cmp_bi_fi(RBI(op1), OII(op2)));
+               case N_FLONUM:
+                   return (cmp_flonum(RFF(op1), (double)OII(op2)));
+               case N_FIXRATIO:
+                   return (cmp_fr_fi(RFRD(op1), RFRN(op1), OII(op2)));
+               case N_BIGRATIO:
+                   return (cmp_br_fi(RBR(op1), OII(op2)));
+           }
+           break;
+       case LispBignum_t:
+           switch (RTYPE(op1)) {
+               case N_FIXNUM:
+                   return (cmp_fi_bi(RFI(op1), OBI(op2)));
+               case N_BIGNUM:
+                   return (cmp_bi_bi(RBI(op1), OBI(op2)));
+               case N_FLONUM:
+                   return (cmp_flonum(RFF(op1), bi_getd(OBI(op2))));
+               case N_FIXRATIO:
+                   return (cmp_fr_bi(RFRD(op1), RFRN(op1), OBI(op2)));
+               case N_BIGRATIO:
+                   return (cmp_br_bi(RBR(op1), OBI(op2)));
+           }
+           break;
+       case LispDFloat_t:
+           switch (RTYPE(op1)) {
+               case N_FIXNUM:
+                   return (cmp_flonum((double)RFI(op1), ODF(op2)));
+               case N_BIGNUM:
+                   return (cmp_flonum(bi_getd(RBI(op1)), ODF(op2)));
+               case N_FLONUM:
+                   return (cmp_flonum(RFF(op1), ODF(op2)));
+               case N_FIXRATIO:
+                   return (cmp_flonum((double)RFRN(op1) / (double)RFRD(op1),
+                                      ODF(op2)));
+               case N_BIGRATIO:
+                   return (cmp_flonum(br_getd(RBR(op1)), ODF(op2)));
+           }
+           break;
+       case LispRatio_t:
+           switch (RTYPE(op1)) {
+               case N_FIXNUM:
+                   return (cmp_fi_fr(RFI(op1), OFRN(op2), OFRD(op2)));
+               case N_BIGNUM:
+                   return (cmp_bi_fr(RBI(op1), OFRN(op2), OFRD(op2)));
+               case N_FLONUM:
+                   return (cmp_flonum(RFF(op1),
+                                      (double)OFRN(op2) / (double)OFRD(op2)));
+               case N_FIXRATIO:
+                   return (cmp_fr_fr(RFRN(op1), RFRD(op1),
+                                     OFRN(op2), OFRD(op2)));
+               case N_BIGRATIO:
+                   return (cmp_br_fr(RBR(op1), OFRN(op2), OFRD(op2)));
+           }
+           break;
+       case LispBigratio_t:
+           switch (RTYPE(op1)) {
+               case N_FIXNUM:
+                   return (cmp_fi_br(RFI(op1), OBR(op2)));
+               case N_BIGNUM:
+                   return (cmp_bi_br(RBI(op1), OBR(op2)));
+               case N_FLONUM:
+                   return (cmp_flonum(RFF(op1), br_getd(OBR(op2))));
+               case N_FIXRATIO:
+                   return (cmp_fr_br(RFRN(op1), RFRD(op1), OBR(op2)));
+               case N_BIGRATIO:
+                   return (cmp_br_br(RBR(op1), OBR(op2)));
+           }
+           break;
+       default:
+           fatal_object_error(op2, NOT_A_REAL_NUMBER);
+           break;
+    }
+
+    return (0);
+}
+
+#if 0          /* not used */
+static int
+cmp_number_object(n_number *op1, LispObj *op2)
+{
+    if (op1->complex) {
+       if (OBJECT_TYPE(op2) == LispComplex_t) {
+           if (cmp_real_object(NREAL(op1), OCXR(op2)) == 0)
+               return (cmp_real_object(NIMAG(op1), OCXI(op2)));
+           return (1);
+       }
+       else if (cmp_real_real(NIMAG(op1), &zero) == 0)
+           return (cmp_real_object(NREAL(op1), op2));
+       else
+           return (1);
+    }
+    else {
+       switch (OBJECT_TYPE(op2)) {
+           case LispFixnum_t:
+               switch (NRTYPE(op1)) {
+                   case N_FIXNUM:
+                       return (cmp_fi_fi(NRFI(op1), OFI(op2)));
+                   case N_BIGNUM:
+                       return (cmp_bi_fi(NRBI(op1), OFI(op2)));
+                   case N_FLONUM:
+                       return (cmp_flonum(NRFF(op1), (double)OFI(op2)));
+                   case N_FIXRATIO:
+                       return (cmp_fr_fi(NRFRD(op1), NRFRN(op1), OFI(op2)));
+                   case N_BIGRATIO:
+                       return (cmp_br_fi(NRBR(op1), OFI(op2)));
+               }
+               break;
+           case LispInteger_t:
+               switch (NRTYPE(op1)) {
+                   case N_FIXNUM:
+                       return (cmp_fi_fi(NRFI(op1), OII(op2)));
+                   case N_BIGNUM:
+                       return (cmp_bi_fi(NRBI(op1), OII(op2)));
+                   case N_FLONUM:
+                       return (cmp_flonum(NRFF(op1), (double)OII(op2)));
+                   case N_FIXRATIO:
+                       return (cmp_fr_fi(NRFRD(op1), NRFRN(op1), OII(op2)));
+                   case N_BIGRATIO:
+                       return (cmp_br_fi(NRBR(op1), OII(op2)));
+               }
+               break;
+           case LispBignum_t:
+               switch (NRTYPE(op1)) {
+                   case N_FIXNUM:
+                       return (cmp_fi_bi(NRFI(op1), OBI(op2)));
+                   case N_BIGNUM:
+                       return (cmp_bi_bi(NRBI(op1), OBI(op2)));
+                   case N_FLONUM:
+                       return (cmp_flonum(NRFF(op1), bi_getd(OBI(op2))));
+                   case N_FIXRATIO:
+                       return (cmp_fr_bi(NRFRD(op1), NRFRN(op1), OBI(op2)));
+                   case N_BIGRATIO:
+                       return (cmp_br_bi(NRBR(op1), OBI(op2)));
+               }
+               break;
+           case LispDFloat_t:
+               switch (NRTYPE(op1)) {
+                   case N_FIXNUM:
+                       return (cmp_flonum((double)NRFI(op1), ODF(op2)));
+                   case N_BIGNUM:
+                       return (cmp_flonum(bi_getd(NRBI(op1)), ODF(op2)));
+                   case N_FLONUM:
+                       return (cmp_flonum(NRFF(op1), ODF(op2)));
+                   case N_FIXRATIO:
+                       return (cmp_flonum((double)NRFRN(op1) /
+                                          (double)NRFRD(op1),
+                                          ODF(op2)));
+                   case N_BIGRATIO:
+                       return (cmp_flonum(br_getd(NRBR(op1)), ODF(op2)));
+               }
+               break;
+           case LispRatio_t:
+               switch (NRTYPE(op1)) {
+                   case N_FIXNUM:
+                       return (cmp_fi_fr(NRFI(op1), OFRN(op2), OFRD(op2)));
+                   case N_BIGNUM:
+                       return (cmp_bi_fr(NRBI(op1), OFRN(op2), OFRD(op2)));
+                   case N_FLONUM:
+                       return (cmp_flonum(NRFF(op1),
+                                          (double)OFRN(op2) / (double)OFRD(op2)));
+                   case N_FIXRATIO:
+                       return (cmp_fr_fr(NRFRN(op1), NRFRD(op1),
+                                         OFRN(op2), OFRD(op2)));
+                   case N_BIGRATIO:
+                       return (cmp_br_fr(NRBR(op1), OFRN(op2), OFRD(op2)));
+               }
+               break;
+           case LispBigratio_t:
+               switch (NRTYPE(op1)) {
+                   case N_FIXNUM:
+                       return (cmp_fi_br(NRFI(op1), OBR(op2)));
+                   case N_BIGNUM:
+                       return (cmp_bi_br(NRBI(op1), OBR(op2)));
+                   case N_FLONUM:
+                       return (cmp_flonum(NRFF(op1), br_getd(OBR(op2))));
+                   case N_FIXRATIO:
+                       return (cmp_fr_br(NRFRN(op1), NRFRD(op1), OBR(op2)));
+                   case N_BIGRATIO:
+                       return (cmp_br_br(NRBR(op1), OBR(op2)));
+               }
+               break;
+           case LispComplex_t:
+               if (cmp_real_object(&zero, OCXI(op2)) == 0)
+                   return (cmp_real_object(NREAL(op1), OCXR(op2)));
+               return (1);
+           default:
+               fatal_object_error(op2, NOT_A_NUMBER);
+               break;
+       }
+    }
+
+    return (0);
+}
+#endif
+
+static int
+cmp_object_object(LispObj *op1, LispObj *op2, int real)
+{
+    if (OBJECT_TYPE(op1) == LispComplex_t) {
+       if (real)
+           fatal_object_error(op1, NOT_A_REAL_NUMBER);
+       if (OBJECT_TYPE(op2) == LispComplex_t)
+           return (cmp_cx_cx(op1, op2));
+       else if (cmp_real_object(&zero, OCXI(op1)) == 0)
+           return (cmp_object_object(OCXR(op1), op2, real));
+       return (1);
+    }
+    else if (OBJECT_TYPE(op2) == LispComplex_t) {
+       if (real)
+           fatal_object_error(op1, NOT_A_REAL_NUMBER);
+       if (cmp_real_object(&zero, OCXI(op2)) == 0)
+           return (cmp_object_object(op1, OCXR(op2), real));
+       return (1);
+    }
+    else {
+       switch (OBJECT_TYPE(op1)) {
+           case LispFixnum_t:
+               switch (OBJECT_TYPE(op2)) {
+                   case LispFixnum_t:
+                       return (cmp_fi_fi(OFI(op1), OFI(op2)));
+                   case LispInteger_t:
+                       return (cmp_fi_fi(OFI(op1), OII(op2)));
+                   case LispBignum_t:
+                       return (cmp_fi_bi(OFI(op1), OBI(op2)));
+                   case LispDFloat_t:
+                       return (cmp_flonum((double)OFI(op1), ODF(op2)));
+                   case LispRatio_t:
+                       return (cmp_fi_fr(OFI(op1),
+                                         OFRN(op2), OFRD(op2)));
+                   case LispBigratio_t:
+                       return (cmp_fi_br(OFI(op1), OBR(op2)));
+                   default:
+                       break;
+               }
+               break;
+           case LispInteger_t:
+               switch (OBJECT_TYPE(op2)) {
+                   case LispFixnum_t:
+                       return (cmp_fi_fi(OII(op1), OFI(op2)));
+                   case LispInteger_t:
+                       return (cmp_fi_fi(OII(op1), OII(op2)));
+                   case LispBignum_t:
+                       return (cmp_fi_bi(OII(op1), OBI(op2)));
+                   case LispDFloat_t:
+                       return (cmp_flonum((double)OII(op1), ODF(op2)));
+                   case LispRatio_t:
+                       return (cmp_fi_fr(OII(op1),
+                                         OFRN(op2), OFRD(op2)));
+                   case LispBigratio_t:
+                       return (cmp_fi_br(OII(op1), OBR(op2)));
+                   default:
+                       break;
+               }
+               break;
+           case LispBignum_t:
+               switch (OBJECT_TYPE(op2)) {
+                   case LispFixnum_t:
+                       return (cmp_bi_fi(OBI(op1), OFI(op2)));
+                   case LispInteger_t:
+                       return (cmp_bi_fi(OBI(op1), OII(op2)));
+                   case LispBignum_t:
+                       return (cmp_bi_bi(OBI(op1), OBI(op2)));
+                   case LispDFloat_t:
+                       return (cmp_flonum(bi_getd(OBI(op1)), ODF(op2)));
+                   case LispRatio_t:
+                       return (cmp_bi_fr(OBI(op1),
+                                         OFRN(op2), OFRD(op2)));
+                   case LispBigratio_t:
+                       return (cmp_bi_br(OBI(op1), OBR(op2)));
+                   default:
+                       break;
+               }
+               break;
+           case LispDFloat_t:
+               switch (OBJECT_TYPE(op2)) {
+                   case LispFixnum_t:
+                       return (cmp_flonum(ODF(op1), (double)OFI(op2)));
+                   case LispInteger_t:
+                       return (cmp_flonum(ODF(op1), (double)OII(op2)));
+                   case LispBignum_t:
+                       return (cmp_flonum(ODF(op1), bi_getd(OBI(op2))));
+                   case LispDFloat_t:
+                       return (cmp_flonum(ODF(op1), ODF(op2)));
+                       break;
+                   case LispRatio_t:
+                       return (cmp_flonum(ODF(op1),
+                                          (double)OFRN(op2) /
+                                          (double)OFRD(op2)));
+                   case LispBigratio_t:
+                       return (cmp_flonum(ODF(op1), br_getd(OBR(op2))));
+                   default:
+                       break;
+               }
+               break;
+           case LispRatio_t:
+               switch (OBJECT_TYPE(op2)) {
+                   case LispFixnum_t:
+                       return (cmp_fr_fi(OFRN(op1), OFRD(op1), OFI(op2)));
+                   case LispInteger_t:
+                       return (cmp_fr_fi(OFRN(op1), OFRD(op1), OII(op2)));
+                   case LispBignum_t:
+                       return (cmp_fr_bi(OFRN(op1), OFRD(op1), OBI(op2)));
+                   case LispDFloat_t:
+                       return (cmp_flonum((double)OFRN(op1) /
+                                          (double)OFRD(op1),
+                                          ODF(op2)));
+                   case LispRatio_t:
+                       return (cmp_fr_fr(OFRN(op1), OFRD(op1),
+                                         OFRN(op2), OFRD(op2)));
+                   case LispBigratio_t:
+                       return (cmp_fr_br(OFRN(op1), OFRD(op1), OBR(op2)));
+                   default:
+                       break;
+               }
+               break;
+           case LispBigratio_t:
+               switch (OBJECT_TYPE(op2)) {
+                   case LispFixnum_t:
+                       return (cmp_br_fi(OBR(op1), OFI(op2)));
+                   case LispInteger_t:
+                       return (cmp_br_fi(OBR(op1), OII(op2)));
+                   case LispBignum_t:
+                       return (cmp_br_bi(OBR(op1), OBI(op2)));
+                   case LispDFloat_t:
+                       return (cmp_flonum(br_getd(OBR(op1)), ODF(op2)));
+                   case LispRatio_t:
+                       return (cmp_br_fr(OBR(op1), OFRN(op2), OFRD(op2)));
+                   case LispBigratio_t:
+                       return (cmp_br_br(OBR(op1), OBR(op2)));
+                   default:
+                       break;
+               }
+               break;
+           default:
+               fatal_object_error(op1, NOT_A_NUMBER);
+               break;
+       }
+    }
+
+    fatal_object_error(op2, NOT_A_NUMBER);
+    return (0);
+}
+
+
+/************************************************************************
+ * FIXNUM
+ ************************************************************************/
+/*
+ * check if op1 + op2 will overflow
+ */
+static INLINE int
+fi_fi_add_overflow(long op1, long op2)
+{
+    long op = op1 + op2;
+
+    return (op1 > 0 ? op2 > op : op2 < op);
+}
+
+/*
+ * check if op1 - op2 will overflow
+ */
+static INLINE int
+fi_fi_sub_overflow(long op1, long op2)
+{
+    long op = op1 - op2;
+
+    return (((op1 < 0) ^ (op2 < 0)) && ((op < 0) ^ (op1 < 0)));
+}
+
+/*
+ * check if op1 * op2 will overflow
+ */
+static INLINE int
+fi_fi_mul_overflow(long op1, long op2)
+{
+#ifndef LONG64
+    double op = (double)op1 * (double)op2;
+
+    return (op > 2147483647.0 || op < -2147483648.0);
+#else
+    int shift;
+    long mask;
+
+    if (op1 == 0 || op1 == 1 || op2 == 0 || op2 == 1)
+       return (0);
+
+    if (op1 == MINSLONG || op2 == MINSLONG)
+       return (1);
+
+    if (op1 < 0)
+       op1 = -op1;
+    if (op2 < 0)
+       op2 = -op2;
+
+    for (shift = 0, mask = FI_MASK; shift < LONGSBITS; shift++, mask >>= 1)
+       if (op1 & mask)
+           break;
+    ++shift;
+    for (mask = FI_MASK; shift < LONGSBITS; shift++, mask >>= 1)
+       if (op2 & mask)
+           break;
+
+    return (shift < LONGSBITS);
+#endif
+}
+
+
+/************************************************************************
+ * BIGNUM
+ ************************************************************************/
+static void
+rbi_canonicalize(n_real *real)
+{
+    if (mpi_fiti(RBI(real))) {
+       long fi = mpi_geti(RBI(real));
+
+       RTYPE(real) = N_FIXNUM;
+       mpi_clear(RBI(real));
+       XFREE(RBI(real));
+       RFI(real) = fi;
+    }
+}
+
+
+/************************************************************************
+ * RATIO
+ ************************************************************************/
+static void
+rfr_canonicalize(n_real *real)
+{
+    long num, numerator, den, denominator, rest;
+
+    num = numerator = RFRN(real);
+    den = denominator = RFRD(real);
+    if (denominator == 0)
+       fatal_error(DIVIDE_BY_ZERO);
+
+    if (num == MINSLONG || den == MINSLONG) {
+       mpr *bigratio = XALLOC(mpr);
+
+       mpr_init(bigratio);
+       mpr_seti(bigratio, num, den);
+       RTYPE(real) = N_BIGRATIO;
+       RBR(real) = bigratio;
+       rbr_canonicalize(real);
+       return;
+    }
+
+    if (num < 0)
+       num = -num;
+    else if (num == 0) {
+       RFI(real) = 0;
+       RTYPE(real) = N_FIXNUM;
+       return;
+    }
+    for (;;) {
+       if ((rest = den % num) == 0)
+           break;
+       den = num;
+       num = rest;
+    }
+    if (den != 1) {
+       denominator /= num;
+       numerator /= num;
+    }
+    if (denominator < 0) {
+       numerator = -numerator;
+       denominator = -denominator;
+    }
+    if (denominator == 1) {
+       RTYPE(real) = N_FIXNUM;
+       RFI(real) = numerator;
+    }
+    else {
+       RFRN(real) = numerator;
+       RFRD(real) = denominator;
+    }
+}
+
+static void
+rbr_canonicalize(n_real *real)
+{
+    int fitnum, fitden;
+    long numerator, denominator;
+
+    mpr_canonicalize(RBR(real));
+    fitnum = mpi_fiti(RBRN(real));
+    fitden = mpi_fiti(RBRD(real));
+    if (fitnum && fitden) {
+       numerator = mpi_geti(RBRN(real));
+       denominator = mpi_geti(RBRD(real));
+       mpr_clear(RBR(real));
+       XFREE(RBR(real));
+       if (numerator == 0) {
+           RFI(real) = 0;
+           RTYPE(real) = N_FIXNUM;
+       }
+       else if (denominator == 1) {
+           RTYPE(real) = N_FIXNUM;
+           RFI(real) = numerator;
+       }
+       else {
+           RTYPE(real) = N_FIXRATIO;
+           RFRN(real) = numerator;
+           RFRD(real) = denominator;
+       }
+    }
+    else if (fitden) {
+       denominator = mpi_geti(RBRD(real));
+       if (denominator == 1) {
+           mpi *bigi = XALLOC(mpi);
+
+           mpi_init(bigi);
+           mpi_set(bigi, RBRN(real));
+           mpr_clear(RBR(real));
+           XFREE(RBR(real));
+           RTYPE(real) = N_BIGNUM;
+           RBI(real) = bigi;
+       }
+       else if (denominator == 0)
+           fatal_error(DIVIDE_BY_ZERO);
+    }
+}
+
+
+/************************************************************************
+ * COMPLEX
+ ************************************************************************/
+static void
+ncx_canonicalize(n_number *num)
+{
+    if (NITYPE(num) == N_FIXNUM && NIFI(num) == 0)
+       num->complex = 0;
+}
+
+
+/************************************************************************
+ * DIVIDE
+ ************************************************************************/
+#define NDIVIDE_NOP    0
+#define NDIVIDE_ADD    1
+#define NDIVIDE_SUB    2
+static void
+ndivide_fi_fi(n_number *num, long div, int fun, int flo)
+{
+    long quo, rem;
+
+    if (NRFI(num) == MINSLONG || div == MINSLONG) {
+       LispObj integer;
+       mpi *bignum = XALLOC(mpi);
+
+       mpi_init(bignum);
+       mpi_seti(bignum, NRFI(num));
+       NRBI(num) = bignum;
+       NRTYPE(num) = N_BIGNUM;
+       integer.type = LispInteger_t;
+       integer.data.integer = div;
+       ndivide_xi_xi(num, &integer, fun, flo);
+       return;
+    }
+    else {
+       quo = NRFI(num) / div;
+       rem = NRFI(num) % div;
+    }
+
+    switch (fun) {
+       case NDIVIDE_CEIL:
+           if ((rem < 0 && div < 0) || (rem > 0 && div > 0)) {
+               ++quo;
+               rem -= div;
+           }
+           break;
+       case NDIVIDE_FLOOR:
+           if ((rem < 0 && div > 0) || (rem > 0 && div < 0)) {
+               --quo;
+               rem += div;
+           }
+           break;
+       case NDIVIDE_ROUND:
+           if (div > 0) {
+               if (rem > 0) {
+                   if (rem >= (div + 1) / 2) {
+                       ++quo;
+                       rem -= div;
+                   }
+               }
+               else {
+                   if (rem <= (-div - 1) / 2) {
+                       --quo;
+                       rem += div;
+                   }
+               }
+           }
+           else {
+               if (rem > 0) {
+                   if (rem >= (-div + 1) / 2) {
+                       --quo;
+                       rem += div;
+                   }
+               }
+               else {
+                   if (rem <= (div - 1) / 2) {
+                       ++quo;
+                       rem -= div;
+                   }
+               }
+           }
+           break;
+    }
+
+    NITYPE(num) = N_FIXNUM;
+    NIFI(num) = rem;
+    if (flo) {
+       NRTYPE(num) = N_FLONUM;
+       NRFF(num) = (double)quo;
+    }
+    else
+       NRFI(num) = quo;
+}
+
+static void
+ndivide_xi_xi(n_number *num, LispObj *div, int fun, int flo)
+{
+    LispType type = OBJECT_TYPE(div);
+    int state = NDIVIDE_NOP, dsign, rsign;
+    mpi *quo, *rem;
+
+    quo = XALLOC(mpi);
+    mpi_init(quo);
+    if (NRTYPE(num) == N_FIXNUM)
+       mpi_seti(quo, NRFI(num));
+    else
+       mpi_set(quo, NRBI(num));
+
+    rem = XALLOC(mpi);
+    mpi_init(rem);
+
+    switch (type) {
+       case LispFixnum_t:
+           mpi_seti(rem, OFI(div));
+           break;
+       case LispInteger_t:
+           mpi_seti(rem, OII(div));
+           break;
+       default:
+           mpi_set(rem, OBI(div));
+    }
+
+    dsign = mpi_sgn(rem);
+
+    mpi_divqr(quo, rem, quo, rem);
+    rsign = mpi_sgn(rem);
+
+    switch (fun) {
+       case NDIVIDE_CEIL:
+           if ((rsign < 0 && dsign < 0) || (rsign > 0 && dsign > 0))
+               state = NDIVIDE_ADD;
+           break;
+       case NDIVIDE_FLOOR:
+           if ((rsign < 0 && dsign > 0) || (rsign > 0 && dsign < 0))
+               state = NDIVIDE_SUB;
+           break;
+       case NDIVIDE_ROUND: {
+           mpi test;
+
+           mpi_init(&test);
+           switch (type) {
+               case LispFixnum_t:
+                   mpi_seti(&test, OFI(div));
+                   break;
+               case LispInteger_t:
+                   mpi_seti(&test, OII(div));
+                   break;
+               default:
+                   mpi_set(&test, OBI(div));
+           }
+           if (dsign > 0) {
+               if (rsign > 0) {
+                   mpi_addi(&test, &test, 1);
+                   mpi_divi(&test, &test, 2);
+                   if (mpi_cmp(rem, &test) >= 0)
+                       state = NDIVIDE_ADD;
+               }
+               else {
+                   mpi_neg(&test, &test);
+                   mpi_subi(&test, &test, 1);
+                   mpi_divi(&test, &test, 2);
+                   if (mpi_cmp(rem, &test) <= 0)
+                       state = NDIVIDE_SUB;
+               }
+           }
+           else {
+               if (rsign > 0) {
+                   mpi_neg(&test, &test);
+                   mpi_addi(&test, &test, 1);
+                   mpi_divi(&test, &test, 2);
+                   if (mpi_cmp(rem, &test) >= 0)
+                       state = NDIVIDE_SUB;
+               }
+               else {
+                   mpi_subi(&test, &test, 1);
+                   mpi_divi(&test, &test, 2);
+                   if (mpi_cmp(rem, &test) <= 0)
+                       state = NDIVIDE_ADD;
+               }
+           }
+           mpi_clear(&test);
+       }   break;
+    }
+
+    if (state == NDIVIDE_ADD) {
+       mpi_addi(quo, quo, 1);
+       switch (type) {
+           case LispFixnum_t:
+               mpi_subi(rem, rem, OFI(div));
+               break;
+           case LispInteger_t:
+               mpi_subi(rem, rem, OII(div));
+               break;
+           default:
+               mpi_sub(rem, rem, OBI(div));
+       }
+    }
+    else if (state == NDIVIDE_SUB) {
+       mpi_subi(quo, quo, 1);
+       switch (type) {
+           case LispFixnum_t:
+               mpi_addi(rem, rem, OFI(div));
+               break;
+           case LispInteger_t:
+               mpi_addi(rem, rem, OII(div));
+               break;
+           default:
+               mpi_add(rem, rem, OBI(div));
+       }
+    }
+
+    if (mpi_fiti(rem)) {
+       NITYPE(num) = N_FIXNUM;
+       NIFI(num) = mpi_geti(rem);
+       mpi_clear(rem);
+       XFREE(rem);
+    }
+    else {
+       NITYPE(num) = N_BIGNUM;
+       NIBI(num) = rem;
+    }
+
+    clear_real(NREAL(num));
+
+    if (flo) {
+       double dval = bi_getd(quo);
+
+       mpi_clear(quo);
+       XFREE(quo);
+       NRTYPE(num) = N_FLONUM;
+       NRFF(num) = dval;
+    }
+    else {
+       NRTYPE(num) = N_BIGNUM;
+       NRBI(num) = quo;
+       rbi_canonicalize(NREAL(num));
+    }
+}
+
+static void
+ndivide_flonum(n_number *number, double num, double div, int fun, int flo)
+{
+    double quo, rem, modp, tmp;
+
+    modp = modf(num / div, &quo);
+    rem = num - quo * div;
+
+    switch (fun) {
+       case NDIVIDE_CEIL:
+           if ((rem < 0.0 && div < 0.0) || (rem > 0.0 && div > 0.0)) {
+               quo += 1.0;
+               rem -= div;
+           }
+           break;
+       case NDIVIDE_FLOOR:
+           if ((rem < 0.0 && div > 0.0) || (rem > 0.0 && div < 0.0)) {
+               quo -= 1.0;
+               rem += div;
+           }
+           break;
+       case NDIVIDE_ROUND:
+           if (fabs(modp) != 0.5 || modf(quo * 0.5, &tmp) != 0.0) {
+               if (div > 0.0) {
+                   if (rem > 0.0) {
+                       if (rem >= div * 0.5) {
+                           quo += 1.0;
+                           rem -= div;
+                       }
+                   }
+                   else {
+                       if (rem <= div * -0.5) {
+                           quo -= 1.0;
+                           rem += div;
+                       }
+                   }
+               }
+               else {
+                   if (rem > 0.0) {
+                       if (rem >= div * -0.5) {
+                           quo -= 1.0;
+                           rem += div;
+                       }
+                   }
+                   else {
+                       if (rem <= div * 0.5) {
+                           quo += 1.0;
+                           rem -= div;
+                       }
+                   }
+               }
+           }
+           break;
+    }
+    if (!finite(quo) || !finite(rem))
+       fatal_error(FLOATING_POINT_OVERFLOW);
+
+    NITYPE(number) = N_FLONUM;
+    NIFF(number) = rem;
+
+    clear_real(NREAL(number));
+
+    if (flo) {
+       NRTYPE(number) = N_FLONUM;
+       NRFF(number) = quo;
+    }
+    else {
+       if ((long)quo == quo) {
+           NRTYPE(number) = N_FIXNUM;
+           NRFI(number) = (long)quo;
+       }
+       else {
+           mpi *bigi = XALLOC(mpi);
+
+           mpi_init(bigi);
+           mpi_setd(bigi, quo);
+           NRBI(number) = bigi;
+           NRTYPE(number) = N_BIGNUM;
+       }
+    }
+}
+
+static void
+ndivide_xi_xr(n_number *num, LispObj *div, int fun, int flo)
+{
+    int state = NDIVIDE_NOP, dsign, rsign;
+    mpi *quo;
+    mpr *rem;
+
+    quo = XALLOC(mpi);
+    mpi_init(quo);
+    if (NRTYPE(num) == N_FIXNUM)
+       mpi_seti(quo, NRFI(num));
+    else    
+       mpi_set(quo, NRBI(num));
+
+    rem = XALLOC(mpr);
+    mpr_init(rem);
+
+    if (XOBJECT_TYPE(div) == LispRatio_t)
+       mpr_seti(rem, OFRN(div), OFRD(div));
+    else
+       mpr_set(rem, OBR(div));
+    dsign = mpi_sgn(mpr_num(rem));
+    mpi_mul(quo, quo, mpr_den(rem));
+
+    mpi_divqr(quo, mpr_num(rem), quo, mpr_num(rem));
+    mpr_canonicalize(rem);
+
+    rsign = mpi_sgn(mpr_num(rem));
+    if (mpr_fiti(rem)) {
+       if (mpi_geti(mpr_den(rem)) == 1) {
+           NITYPE(num) = N_FIXNUM;
+           NIFI(num) = mpi_geti(mpr_num(rem));
+       }
+       else {
+           NITYPE(num) = N_FIXRATIO;
+           NIFRN(num) = mpi_geti(mpr_num(rem));
+           NIFRD(num) = mpi_geti(mpr_den(rem));
+       }
+       mpr_clear(rem);
+       XFREE(rem);     
+    }
+    else {
+       if (mpi_fiti(mpr_den(rem)) && mpi_geti(mpr_den(rem)) == 1) {
+           NITYPE(num) = N_BIGNUM;
+           NIBI(num) = mpr_num(rem);
+           mpi_clear(mpr_den(rem));
+           XFREE(rem);
+       }
+       else {
+           NITYPE(num) = N_BIGRATIO;
+           NIBR(num) = rem;
+       }
+    }
+
+    switch (fun) {
+       case NDIVIDE_CEIL:
+           if ((rsign < 0 && dsign < 0) || (rsign > 0 && dsign > 0))
+               state = NDIVIDE_ADD;
+           break;
+       case NDIVIDE_FLOOR:
+           if ((rsign < 0 && dsign > 0) || (rsign > 0 && dsign < 0))
+               state = NDIVIDE_SUB;
+           break;
+       case NDIVIDE_ROUND: {
+           n_real cmp;
+
+           set_real_object(&cmp, div);
+           div_real_real(&cmp, &two);
+           if (dsign > 0) {
+               if (rsign > 0) {
+                   if (cmp_real_real(NIMAG(num), &cmp) >= 0)
+                       state = NDIVIDE_ADD;
+               }
+               else {
+                   neg_real(&cmp);
+                   if (cmp_real_real(NIMAG(num), &cmp) <= 0)
+                       state = NDIVIDE_SUB;
+               }
+           }
+           else {
+               if (rsign > 0) {
+                   neg_real(&cmp);
+                   if (cmp_real_real(NIMAG(num), &cmp) >= 0)
+                       state = NDIVIDE_SUB;
+               }
+               else {
+                   if (cmp_real_real(NIMAG(num), &cmp) <= 0)
+                       state = NDIVIDE_ADD;
+               }
+           }
+           clear_real(&cmp);
+       }   break;
+    }
+
+    if (state == NDIVIDE_ADD) {
+       mpi_addi(quo, quo, 1);
+       sub_real_object(NIMAG(num), div);
+    }
+    else if (state == NDIVIDE_SUB) {
+       mpi_subi(quo, quo, 1);
+       add_real_object(NIMAG(num), div);
+    }
+
+    clear_real(NREAL(num));
+
+    if (flo) {
+       double dval = bi_getd(quo);
+
+       mpi_clear(quo);
+       XFREE(quo);
+       NRTYPE(num) = N_FLONUM;
+       NRFF(num) = dval;
+    }
+    else {
+       NRBI(num)  = quo;
+       NRTYPE(num) = N_BIGNUM;
+       rbi_canonicalize(NREAL(num));
+    }
+}
+
+static void
+ndivide_xr_xi(n_number *num, LispObj *div, int fun, int flo)
+{
+    LispType type = OBJECT_TYPE(div);
+    int state = NDIVIDE_NOP, dsign, rsign;
+    mpi *quo;
+    mpr *rem;
+
+    quo = XALLOC(mpi);
+    mpi_init(quo);
+    switch (type) {
+       case LispFixnum_t:
+           dsign = OFI(div) < 0 ? -1 : OFI(div) > 0 ? 1 : 0;
+           mpi_seti(quo, OFI(div));
+           break;
+       case LispInteger_t:
+           dsign = OII(div) < 0 ? -1 : OII(div) > 0 ? 1 : 0;
+           mpi_seti(quo, OII(div));
+           break;
+       default:
+           dsign = mpi_sgn(OBI(div));
+           mpi_set(quo, OBI(div));
+           break;
+    }
+
+    rem = XALLOC(mpr);
+    mpr_init(rem);
+    if (NRTYPE(num) == N_FIXRATIO) {
+       mpr_seti(rem, NRFRN(num), NRFRD(num));
+       mpi_muli(quo, quo, NRFRD(num));
+    }
+    else {
+       mpr_set(rem, NRBR(num));
+       mpi_mul(quo, quo, NRBRD(num));
+    }
+    mpi_divqr(quo, mpr_num(rem), mpr_num(rem), quo);
+    mpr_canonicalize(rem);
+
+    rsign = mpi_sgn(mpr_num(rem));
+    if (mpr_fiti(rem)) {
+       NITYPE(num) = N_FIXRATIO;
+       NIFRN(num) = mpi_geti(mpr_num(rem));
+       NIFRD(num) = mpi_geti(mpr_den(rem));
+       mpr_clear(rem);
+       XFREE(rem);
+    }
+    else {
+       NITYPE(num) = N_BIGRATIO;
+       NIBR(num) = rem;
+    }
+
+    switch (fun) {
+       case NDIVIDE_CEIL:
+           if ((rsign < 0 && dsign < 0) || (rsign > 0 && dsign > 0))
+               state = NDIVIDE_ADD;
+           break;
+       case NDIVIDE_FLOOR:
+           if ((rsign < 0 && dsign > 0) || (rsign > 0 && dsign < 0))
+               state = NDIVIDE_SUB;
+           break;
+       case NDIVIDE_ROUND: {
+           n_real cmp;
+
+           set_real_object(&cmp, div);
+           div_real_real(&cmp, &two);
+           if (dsign > 0) {
+               if (rsign > 0) {
+                   if (cmp_real_real(NIMAG(num), &cmp) >= 0)
+                       state = NDIVIDE_ADD;
+               }
+               else {
+                   neg_real(&cmp);
+                   if (cmp_real_real(NIMAG(num), &cmp) <= 0)
+                       state = NDIVIDE_SUB;
+               }
+           }
+           else {
+               if (rsign > 0) {
+                   neg_real(&cmp);
+                   if (cmp_real_real(NIMAG(num), &cmp) >= 0)
+                       state = NDIVIDE_SUB;
+               }
+               else {
+                   if (cmp_real_real(NIMAG(num), &cmp) <= 0)
+                       state = NDIVIDE_ADD;
+               }
+           }
+           clear_real(&cmp);
+       }   break;
+    }
+
+    if (state == NDIVIDE_ADD) {
+       mpi_addi(quo, quo, 1);
+       sub_real_object(NIMAG(num), div);
+    }
+    else if (state == NDIVIDE_SUB) {
+       mpi_subi(quo, quo, 1);
+       add_real_object(NIMAG(num), div);
+    }
+
+    clear_real(NREAL(num));
+
+    if (flo) {
+       double dval = bi_getd(quo);
+
+       mpi_clear(quo);
+       XFREE(quo);
+       NRTYPE(num) = N_FLONUM;
+       NRFF(num) = dval;
+    }
+    else {
+       NRBI(num) = quo;
+       NRTYPE(num) = N_BIGNUM;
+       rbi_canonicalize(NREAL(num));
+    }
+}
+
+static void
+ndivide_xr_xr(n_number *num, LispObj *div, int fun, int flo)
+{
+    int state = NDIVIDE_NOP, dsign, rsign, modp;
+    mpr *bigr;
+    mpi *bigi;
+
+    bigr = XALLOC(mpr);
+    mpr_init(bigr);
+    if (NRTYPE(num) == N_FIXRATIO)
+       mpr_seti(bigr, NRFRN(num), NRFRD(num));
+    else
+       mpr_set(bigr, NRBR(num));
+
+    NITYPE(num) = N_BIGRATIO;
+    NIBR(num) = bigr;
+
+    if (OBJECT_TYPE(div) == LispRatio_t) {
+       dsign = OFRN(div) < 0 ? -1 : OFRN(div) > 0 ? 1 : 0;
+       mpi_muli(mpr_num(bigr), mpr_num(bigr), OFRD(div));
+       mpi_muli(mpr_den(bigr), mpr_den(bigr), OFRN(div));
+    }
+    else {
+       dsign = mpi_sgn(OBRN(div));
+       mpr_div(bigr, bigr, OBR(div));
+    }
+    modp = mpi_fiti(mpr_den(bigr)) && mpi_geti(mpr_den(bigr)) == 2;
+
+    bigi = XALLOC(mpi);
+    mpi_init(bigi);
+    mpi_divqr(bigi, mpr_num(bigr), mpr_num(bigr), mpr_den(bigr));
+
+    if (OBJECT_TYPE(div) == LispRatio_t)
+       mpi_seti(mpr_den(bigr), OFRD(div));
+    else
+       mpi_set(mpr_den(bigr), OBRD(div));
+    if (NRTYPE(num) == N_FIXRATIO)
+       mpi_muli(mpr_den(bigr), mpr_den(bigr), NRFRD(num));
+    else
+       mpi_mul(mpr_den(bigr), mpr_den(bigr), NRBRD(num));
+
+    clear_real(NREAL(num));
+    NRTYPE(num) = N_BIGNUM;
+    NRBI(num) = bigi;
+
+    rbr_canonicalize(NIMAG(num));
+    rsign = cmp_real_real(NIMAG(num), &zero);
+
+    switch (fun) {
+       case NDIVIDE_CEIL:
+           if ((rsign < 0 && dsign < 0) || (rsign > 0 && dsign > 0))
+               state = NDIVIDE_ADD;
+           break;
+       case NDIVIDE_FLOOR:
+           if ((rsign < 0 && dsign > 0) || (rsign > 0 && dsign < 0))
+               state = NDIVIDE_SUB;
+           break;
+       case NDIVIDE_ROUND:
+           if (!modp || (bigi->digs[0] & 1) == 1) {
+               n_real cmp;
+
+               set_real_object(&cmp, div);
+               div_real_real(&cmp, &two);
+               if (dsign > 0) {
+                   if (rsign > 0) {
+                       if (cmp_real_real(NIMAG(num), &cmp) >= 0)
+                           state = NDIVIDE_ADD;
+                   }
+                   else {
+                       neg_real(&cmp);
+                       if (cmp_real_real(NIMAG(num), &cmp) <= 0)
+                           state = NDIVIDE_SUB;
+                   }
+               }
+               else {
+                   if (rsign > 0) {
+                       neg_real(&cmp);
+                       if (cmp_real_real(NIMAG(num), &cmp) >= 0)
+                           state = NDIVIDE_SUB;
+                   }
+                   else {
+                       if (cmp_real_real(NIMAG(num), &cmp) <= 0)
+                           state = NDIVIDE_ADD;
+                   }
+               }
+               clear_real(&cmp);
+           }
+           break;
+    }
+
+    if (state == NDIVIDE_ADD) {
+       add_real_real(NREAL(num), &one);
+       sub_real_object(NIMAG(num), div);
+    }
+    else if (state == NDIVIDE_SUB) {
+       sub_real_real(NREAL(num), &one);
+       add_real_object(NIMAG(num), div);
+    }
+
+    if (NRTYPE(num) == N_BIGNUM) {
+       if (flo) {
+           double dval = bi_getd(bigi);
+
+           mpi_clear(bigi);
+           XFREE(bigi);
+           NRTYPE(num) = N_FLONUM;
+           NRFF(num) = dval;
+       }
+       else
+           rbi_canonicalize(NREAL(num));
+    }
+    else if (flo) {
+       NRTYPE(num) = N_FLONUM;
+       NRFF(num) = (double)NRFI(num);
+    }
+}
+
+
+/************************************************************************
+ * REAL COMPLEX
+ ************************************************************************/
+static void
+nadd_re_cx(n_number *num, LispObj *comp)
+{
+/*
+       Ra+Rb Ib
+ */
+    /* Ra+Rb */
+    add_real_object(NREAL(num), OCXR(comp));
+
+    /* Ib */
+    set_real_object(NIMAG(num), OCXI(comp));
+
+    num->complex = 1;
+
+    ncx_canonicalize(num);
+}
+
+static void
+nsub_re_cx(n_number *num, LispObj *comp)
+{
+/*
+       Ra-Rb -Ib
+ */
+    /* Ra-Rb */
+    sub_real_object(NREAL(num), OCXR(comp));
+
+    /* -Ib */
+    NITYPE(num) = N_FIXNUM;
+    NIFI(num) = -1;
+    mul_real_object(NIMAG(num), OCXI(comp));
+
+    num->complex = 1;
+
+    ncx_canonicalize(num);
+}
+
+static void
+nmul_re_cx(n_number *num, LispObj *comp)
+{
+/*
+       Ra*Rb Ra*Ib
+ */
+    /* copy before change */
+    set_real_real(NIMAG(num), NREAL(num));
+
+    /* Ra*Rb */
+    mul_real_object(NREAL(num), OCXR(comp));
+
+    /* Ra*Ib */
+    mul_real_object(NIMAG(num), OCXI(comp));
+
+    num->complex = 1;
+
+    ncx_canonicalize(num);
+}
+
+static void
+ndiv_re_cx(n_number *num, LispObj *comp)
+{
+/*
+       Ra*Rb        -Ib*Ra
+       -----------  -----------
+       Rb*Rb+Ib*Ib  Rb*Rb+Ib*Ib
+ */
+    n_real div, temp;
+
+    /* Rb*Rb */
+    set_real_object(&div, OCXR(comp));
+    mul_real_object(&div, OCXR(comp));
+
+    /* Ib*Ib */
+    set_real_object(&temp, OCXI(comp));
+    mul_real_object(&temp, OCXI(comp));
+
+    /* Rb*Rb+Ib*Ib */
+    add_real_real(&div, &temp);
+    clear_real(&temp);
+
+    /* -Ib*Ra */
+    NITYPE(num) = N_FIXNUM;
+    NIFI(num) = -1;
+    mul_real_object(NIMAG(num), OCXI(comp));
+    mul_real_real(NIMAG(num), NREAL(num));
+
+    /* Ra*Rb */
+    mul_real_object(NREAL(num), OCXR(comp));
+
+    div_real_real(NREAL(num), &div);
+    div_real_real(NIMAG(num), &div);
+    clear_real(&div);
+
+    num->complex = 1;
+
+    ncx_canonicalize(num);
+}
+
+
+/************************************************************************
+ * COMPLEX REAL
+ ************************************************************************/
+static void
+nadd_cx_re(n_number *num, LispObj *re)
+{
+/*
+       Ra+Rb Ia
+ */
+    add_real_object(NREAL(num), re);
+
+    ncx_canonicalize(num);
+}
+
+static void
+nsub_cx_re(n_number *num, LispObj *re)
+{
+/*
+       Ra-Rb Ia
+ */
+    sub_real_object(NREAL(num), re);
+
+    ncx_canonicalize(num);
+}
+
+static void
+nmul_cx_re(n_number *num, LispObj *re)
+{
+/*
+       Ra*Rb Ia*Rb
+ */
+    mul_real_object(NREAL(num), re);
+    mul_real_object(NIMAG(num), re);
+
+    ncx_canonicalize(num);
+}
+
+static void
+ndiv_cx_re(n_number *num, LispObj *re)
+{
+/*
+       Ra/Rb Ia/Rb
+ */
+    div_real_object(NREAL(num), re);
+    div_real_object(NIMAG(num), re);
+
+    ncx_canonicalize(num);
+}
+
+
+/************************************************************************
+ * COMPLEX COMPLEX
+ ************************************************************************/
+static void
+nadd_cx_cx(n_number *num, LispObj *comp)
+{
+/*
+       Ra+Rb Ia+Ib
+ */
+    add_real_object(NREAL(num), OCXR(comp));
+    add_real_object(NIMAG(num), OCXI(comp));
+
+    ncx_canonicalize(num);
+}
+
+static void
+nsub_cx_cx(n_number *num, LispObj *comp)
+{
+/*
+       Ra-Rb Ia-Ib
+ */
+    sub_real_object(NREAL(num), OCXR(comp));
+    sub_real_object(NIMAG(num), OCXI(comp));
+
+    ncx_canonicalize(num);
+}
+
+static void
+nmul_cx_cx(n_number *num, LispObj *comp)
+{
+/*
+       Ra*Rb-Ia*Ib Ra*Ib+Ia*Rb
+ */
+    n_real IaIb, RaIb;
+
+    set_real_real(&IaIb, NIMAG(num));
+    mul_real_object(&IaIb, OCXI(comp));
+
+    set_real_real(&RaIb, NREAL(num));
+    mul_real_object(&RaIb, OCXI(comp));
+
+    /* Ra*Rb-Ia*Ib */
+    mul_real_object(NREAL(num), OCXR(comp));
+    sub_real_real(NREAL(num), &IaIb);
+    clear_real(&IaIb);
+
+    /* Ra*Ib+Ia*Rb */
+    mul_real_object(NIMAG(num), OCXR(comp));
+    add_real_real(NIMAG(num), &RaIb);
+    clear_real(&RaIb);
+
+    ncx_canonicalize(num);
+}
+
+static void
+ndiv_cx_cx(n_number *num, LispObj *comp)
+{
+/*
+       Ra*Rb+Ia*Ib  Ia*Rb-Ib*Ra
+       -----------  -----------
+       Rb*Rb+Ib*Ib  Rb*Rb+Ib*Ib
+ */
+    n_real temp1, temp2;
+
+    /* IaIb */
+    set_real_real(&temp1, NIMAG(num));
+    mul_real_object(&temp1, OCXI(comp));
+
+    /* IbRa */
+    set_real_real(&temp2, NREAL(num));
+    mul_real_object(&temp2, OCXI(comp));
+
+    /* Ra*Rb+Ia*Ib */
+    mul_real_object(NREAL(num), OCXR(comp));
+    add_real_real(NREAL(num), &temp1);
+    clear_real(&temp1);
+
+    /* Ia*Rb-Ib*Ra */
+    mul_real_object(NIMAG(num), OCXR(comp));
+    sub_real_real(NIMAG(num), &temp2);
+    clear_real(&temp2);
+
+
+    /* Rb*Rb */
+    set_real_object(&temp1, OCXR(comp));
+    mul_real_object(&temp1, OCXR(comp));
+
+    /* Ib*Ib */
+    set_real_object(&temp2, OCXI(comp));
+    mul_real_object(&temp2, OCXI(comp));
+
+    /* Rb*Rb+Ib*Ib */
+    add_real_real(&temp1, &temp2);
+    clear_real(&temp2);
+
+    div_real_real(NREAL(num), &temp1);
+    div_real_real(NIMAG(num), &temp1);
+    clear_real(&temp1);
+
+    ncx_canonicalize(num);
+}
+
+static int
+cmp_cx_cx(LispObj *op1, LispObj *op2)
+{
+    int cmp;
+
+    cmp = cmp_object_object(OCXR(op1), OCXR(op2), 1);
+    if (cmp == 0)
+       cmp = cmp_object_object(OCXI(op1), OCXI(op2), 1);
+
+    return (cmp);
+}
+
+
+/************************************************************************
+ * FLONUM FLONUM
+ ************************************************************************/
+static void
+radd_flonum(n_real *real, double op1, double op2)
+{
+    double value = op1 + op2;
+
+    if (!finite(value))
+       fatal_error(FLOATING_POINT_OVERFLOW);
+    switch (RTYPE(real)) {
+       case N_FIXNUM:
+       case N_FIXRATIO:
+           RTYPE(real) = N_FLONUM;
+           break;
+       case N_BIGNUM:
+           RCLEAR_BI(real);
+           RTYPE(real) = N_FLONUM;
+           break;
+       case N_BIGRATIO:
+           RCLEAR_BR(real);
+           RTYPE(real) = N_FLONUM;
+           break;
+    }
+    RFF(real) = value;
+}
+
+static void
+rsub_flonum(n_real *real, double op1, double op2)
+{
+    double value = op1 - op2;
+
+    if (!finite(value))
+       fatal_error(FLOATING_POINT_OVERFLOW);
+    switch (RTYPE(real)) {
+       case N_FIXNUM:
+       case N_FIXRATIO:
+           RTYPE(real) = N_FLONUM;
+           break;
+       case N_BIGNUM:
+           RCLEAR_BI(real);
+           RTYPE(real) = N_FLONUM;
+           break;
+       case N_BIGRATIO:
+           RCLEAR_BR(real);
+           RTYPE(real) = N_FLONUM;
+           break;
+    }
+    RFF(real) = value;
+}
+
+static void
+rmul_flonum(n_real *real, double op1, double op2)
+{
+    double value = op1 * op2;
+
+    if (!finite(value))
+       fatal_error(FLOATING_POINT_OVERFLOW);
+    switch (RTYPE(real)) {
+       case N_FIXNUM:
+       case N_FIXRATIO:
+           RTYPE(real) = N_FLONUM;
+           break;
+       case N_BIGNUM:
+           RCLEAR_BI(real);
+           RTYPE(real) = N_FLONUM;
+           break;
+       case N_BIGRATIO:
+           RCLEAR_BR(real);
+           RTYPE(real) = N_FLONUM;
+           break;
+    }
+    RFF(real) = value;
+}
+
+static void
+rdiv_flonum(n_real *real, double op1, double op2)
+{
+    double value;
+
+    if (op2 == 0.0)
+       fatal_error(DIVIDE_BY_ZERO);
+    value = op1 / op2;
+    if (!finite(value))
+       fatal_error(FLOATING_POINT_OVERFLOW);
+    switch (RTYPE(real)) {
+       case N_FIXNUM:
+       case N_FIXRATIO:
+           RTYPE(real) = N_FLONUM;
+           break;
+       case N_BIGNUM:
+           RCLEAR_BI(real);
+           RTYPE(real) = N_FLONUM;
+           break;
+       case N_BIGRATIO:
+           RCLEAR_BR(real);
+           RTYPE(real) = N_FLONUM;
+           break;
+    }
+    RFF(real) = value;
+}
+
+static int
+cmp_flonum(double op1, double op2)
+{
+    double value = op1 - op2;
+
+    if (!finite(value))
+       fatal_error(FLOATING_POINT_OVERFLOW);
+
+    return (value > 0.0 ? 1 : value < 0.0 ? -1 : 0);
+}
+
+
+/************************************************************************
+ * FIXNUM FIXNUM
+ ************************************************************************/
+static void
+rop_fi_fi_bi(n_real *real, long fi, int op)
+{
+    mpi *bigi = XALLOC(mpi);
+
+    mpi_init(bigi);
+    mpi_seti(bigi, RFI(real));
+    if (op == NOP_ADD)
+       mpi_addi(bigi, bigi, fi);
+    else if (op == NOP_SUB)
+       mpi_subi(bigi, bigi, fi);
+    else
+       mpi_muli(bigi, bigi, fi);
+    RBI(real) = bigi;
+    RTYPE(real) = N_BIGNUM;
+}
+
+static INLINE void
+radd_fi_fi(n_real *real, long fi)
+{
+    if (!fi_fi_add_overflow(RFI(real), fi))
+       RFI(real) += fi;
+    else
+       rop_fi_fi_bi(real, fi, NOP_ADD);
+}
+
+static INLINE void
+rsub_fi_fi(n_real *real, long fi)
+{
+    if (!fi_fi_sub_overflow(RFI(real), fi))
+       RFI(real) -= fi;
+    else
+       rop_fi_fi_bi(real, fi, NOP_SUB);
+}
+
+static INLINE void
+rmul_fi_fi(n_real *real, long fi)
+{
+    if (!fi_fi_mul_overflow(RFI(real), fi))
+       RFI(real) *= fi;
+    else
+       rop_fi_fi_bi(real, fi, NOP_MUL);
+}
+
+static INLINE void
+rdiv_fi_fi(n_real *real, long fi)
+{
+    RTYPE(real) = N_FIXRATIO;
+    RFRN(real) = RFI(real);
+    RFRD(real) = fi;
+    rfr_canonicalize(real);
+}
+
+static INLINE int
+cmp_fi_fi(long op1, long op2)
+{
+    if (op1 > op2)
+       return (1);
+    else if (op1 < op2)
+       return (-1);
+
+    return (0);
+}
+
+
+/************************************************************************
+ * FIXNUM BIGNUM
+ ************************************************************************/
+static void
+rop_fi_bi_xi(n_real *real, mpi *bi, int nop)
+{
+    mpi *bigi = XALLOC(mpi);
+
+    mpi_init(bigi);
+    mpi_seti(bigi, RFI(real));
+    if (nop == NOP_ADD)
+       mpi_add(bigi, bigi, bi);
+    else if (nop == NOP_SUB)
+       mpi_sub(bigi, bigi, bi);
+    else
+       mpi_mul(bigi, bigi, bi);
+
+    if (mpi_fiti(bigi)) {
+       RFI(real) = mpi_geti(bigi);
+       mpi_clear(bigi);
+       XFREE(bigi);
+    }
+    else {
+       RBI(real) = bigi;
+       RTYPE(real) = N_BIGNUM;
+    }
+}
+
+static INLINE void
+radd_fi_bi(n_real *real, mpi *bi)
+{
+    rop_fi_bi_xi(real, bi, NOP_ADD);
+}
+
+static INLINE void
+rsub_fi_bi(n_real *real, mpi *bi)
+{
+    rop_fi_bi_xi(real, bi, NOP_SUB);
+}
+
+static INLINE void
+rmul_fi_bi(n_real *real, mpi *bi)
+{
+    rop_fi_bi_xi(real, bi, NOP_MUL);
+}
+
+static void
+rdiv_fi_bi(n_real *real, mpi *bi)
+{
+    mpr *bigr;
+
+    if (mpi_cmpi(bi, 0) == 0)
+       fatal_error(DIVIDE_BY_ZERO);
+
+    bigr = XALLOC(mpr);
+    mpr_init(bigr);
+    mpi_seti(mpr_num(bigr), RFI(real));
+    mpi_set(mpr_den(bigr), bi);
+    RBR(real) = bigr;
+    RTYPE(real) = N_BIGRATIO;
+    rbr_canonicalize(real);
+}
+
+static INLINE int
+cmp_fi_bi(long fixnum, mpi *bignum)
+{
+    return (-mpi_cmpi(bignum, fixnum));
+}
+
+
+/************************************************************************
+ * FIXNUM FIXRATIO
+ ************************************************************************/
+static void
+rop_fi_fr_as_xr(n_real *real, long num, long den, int nop)
+{
+    int fit;
+    long value = 0, op = RFI(real);
+
+    fit = !fi_fi_mul_overflow(op, den);
+    if (fit) {
+       value = op * den;
+       if (nop == NOP_ADD)
+           fit = !fi_fi_add_overflow(value, num);
+       else
+           fit = !fi_fi_sub_overflow(value, num);
+    }
+    if (fit) {
+       if (nop == NOP_ADD)
+           RFRN(real) = value + num;
+       else
+           RFRN(real) = value - num;
+       RFRD(real) = den;
+       RTYPE(real) = N_FIXRATIO;
+       rfr_canonicalize(real);
+    }
+    else {
+       mpi iop;
+       mpr *bigr = XALLOC(mpr);
+
+       mpi_init(&iop);
+       mpi_seti(&iop, op);
+       mpi_muli(&iop, &iop, den);
+
+       mpr_init(bigr);
+       mpr_seti(bigr, num, den);
+       if (nop == NOP_ADD)
+           mpi_add(mpr_num(bigr), &iop, mpr_num(bigr));
+       else
+           mpi_sub(mpr_num(bigr), &iop, mpr_num(bigr));
+       mpi_clear(&iop);
+       RBR(real) = bigr;
+       RTYPE(real) = N_BIGRATIO;
+       rbr_canonicalize(real);
+    }
+}
+
+static void
+rop_fi_fr_md_xr(n_real *real, long num, long den, int nop)
+{
+    int fit;
+    long op = RFI(real);
+
+    if (nop == NOP_MUL)
+       fit = !fi_fi_mul_overflow(op, num);
+    else
+       fit = !fi_fi_mul_overflow(op, den);
+    if (fit) {
+       if (nop == NOP_MUL) {
+           RFRN(real) = op * num;
+           RFRD(real) = den;
+       }
+       else {
+           RFRN(real) = op * den;
+           RFRD(real) = num;
+       }
+       RTYPE(real) = N_FIXRATIO;
+       rfr_canonicalize(real);
+    }
+    else {
+       mpi iop;
+       mpr *bigr = XALLOC(mpr);
+
+       mpi_init(&iop);
+       mpi_seti(&iop, op);
+
+       mpr_init(bigr);
+       if (nop == NOP_MUL)
+           mpr_seti(bigr, num, den);
+       else
+           mpr_seti(bigr, den, num);
+       mpi_mul(mpr_num(bigr), mpr_num(bigr), &iop);
+       mpi_clear(&iop);
+       RBR(real) = bigr;
+       RTYPE(real) = N_BIGRATIO;
+       rbr_canonicalize(real);
+    }
+}
+
+static INLINE void
+radd_fi_fr(n_real *real, long num, long den)
+{
+    rop_fi_fr_as_xr(real, num, den, NOP_ADD);
+}
+
+static INLINE void
+rsub_fi_fr(n_real *real, long num, long den)
+{
+    rop_fi_fr_as_xr(real, num, den, NOP_SUB);
+}
+
+static INLINE void
+rmul_fi_fr(n_real *real, long num, long den)
+{
+    rop_fi_fr_md_xr(real, num, den, NOP_MUL);
+}
+
+static INLINE void
+rdiv_fi_fr(n_real *real, long num, long den)
+{
+    rop_fi_fr_md_xr(real, num, den, NOP_DIV);
+}
+
+static INLINE int
+cmp_fi_fr(long fi, long num, long den)
+{
+    return (cmp_flonum((double)fi, (double)num / (double)den));
+}
+
+
+/************************************************************************
+ * FIXNUM BIGRATIO
+ ************************************************************************/
+static void
+rop_fi_br_as_xr(n_real *real, mpr *ratio, int nop)
+{
+    mpi iop;
+    mpr *bigr = XALLOC(mpr);
+
+    mpi_init(&iop);
+    mpi_seti(&iop, RFI(real));
+
+    mpr_init(bigr);
+    mpr_set(bigr, ratio);
+
+    mpi_mul(&iop, &iop, mpr_den(ratio));
+    if (nop == NOP_ADD)
+       mpi_add(mpr_num(bigr), &iop, mpr_num(bigr));
+    else
+       mpi_sub(mpr_num(bigr), &iop, mpr_num(bigr));
+
+    mpi_clear(&iop);
+    RBR(real) = bigr;
+    RTYPE(real) = N_BIGRATIO;
+    rbr_canonicalize(real); 
+}
+
+static void
+rop_fi_br_md_xr(n_real *real, mpr *ratio, int nop)
+{
+    mpi iop;
+    mpr *bigr = XALLOC(mpr);
+
+    mpi_init(&iop);
+    mpi_seti(&iop, RFI(real));
+
+    mpr_init(bigr);
+    if (nop == NOP_MUL)
+       mpr_set(bigr, ratio);
+    else
+       mpr_inv(bigr, ratio);
+
+    mpi_mul(mpr_num(bigr), &iop, mpr_num(bigr));
+
+    mpi_clear(&iop);
+    RBR(real) = bigr;
+    RTYPE(real) = N_BIGRATIO;
+    rbr_canonicalize(real);
+}
+
+static INLINE void
+radd_fi_br(n_real *real, mpr *ratio)
+{
+    rop_fi_br_as_xr(real, ratio, NOP_ADD);
+}
+
+static INLINE void
+rsub_fi_br(n_real *real, mpr *ratio)
+{
+    rop_fi_br_as_xr(real, ratio, NOP_SUB);
+}
+
+static INLINE void
+rmul_fi_br(n_real *real, mpr *ratio)
+{
+    rop_fi_br_md_xr(real, ratio, NOP_MUL);
+}
+
+static INLINE void
+rdiv_fi_br(n_real *real, mpr *ratio)
+{
+    rop_fi_br_md_xr(real, ratio, NOP_DIV);
+}
+
+static INLINE int
+cmp_fi_br(long op1, mpr *op2)
+{
+    return (-mpr_cmpi(op2, op1));
+}
+
+
+/************************************************************************
+ * BIGNUM FIXNUM
+ ************************************************************************/
+static INLINE void
+radd_bi_fi(n_real *real, long fi)
+{
+    mpi_addi(RBI(real), RBI(real), fi);
+    rbi_canonicalize(real);
+}
+
+static INLINE void
+rsub_bi_fi(n_real *real, long fi)
+{
+    mpi_subi(RBI(real), RBI(real), fi);
+    rbi_canonicalize(real);
+}
+
+static INLINE void
+rmul_bi_fi(n_real *real, long fi)
+{
+    mpi_muli(RBI(real), RBI(real), fi);
+    rbi_canonicalize(real);
+}
+
+static void
+rdiv_bi_fi(n_real *real, long fi)
+{
+    mpr *bigr;
+
+    if (RFI(real) == 0)
+       fatal_error(DIVIDE_BY_ZERO);
+
+    bigr = XALLOC(mpr);
+    mpr_init(bigr);
+    mpi_set(mpr_num(bigr), RBI(real));
+    mpi_seti(mpr_den(bigr), fi);
+    RCLEAR_BI(real);
+    RBR(real) = bigr;
+    RTYPE(real) = N_BIGRATIO;
+    rbr_canonicalize(real);
+}
+
+static INLINE int
+cmp_bi_fi(mpi *bignum, long fi)
+{
+    return (mpi_cmpi(bignum, fi));
+}
+
+
+/************************************************************************
+ * BIGNUM BIGNUM
+ ************************************************************************/
+static INLINE void
+radd_bi_bi(n_real *real, mpi *bignum)
+{
+    mpi_add(RBI(real), RBI(real), bignum);
+    rbi_canonicalize(real);
+}
+
+static INLINE void
+rsub_bi_bi(n_real *real, mpi *bignum)
+{
+    mpi_sub(RBI(real), RBI(real), bignum);
+    rbi_canonicalize(real);
+}
+
+static INLINE void
+rmul_bi_bi(n_real *real, mpi *bignum)
+{
+    mpi_mul(RBI(real), RBI(real), bignum);
+    rbi_canonicalize(real);
+}
+
+static void
+rdiv_bi_bi(n_real *real, mpi *bignum)
+{
+    mpr *bigr;
+
+    if (mpi_cmpi(bignum, 0) == 0)
+       fatal_error(DIVIDE_BY_ZERO);
+
+    bigr = XALLOC(mpr);
+    mpr_init(bigr);
+    mpi_set(mpr_num(bigr), RBI(real));
+    mpi_set(mpr_den(bigr), bignum);
+    RCLEAR_BI(real);
+    RBR(real) = bigr;
+    RTYPE(real) = N_BIGRATIO;
+    rbr_canonicalize(real); 
+}
+
+static INLINE int
+cmp_bi_bi(mpi *op1, mpi *op2)
+{
+    return (mpi_cmp(op1, op2));
+}
+
+
+/************************************************************************
+ * BIGNUM FIXRATIO
+ ************************************************************************/
+static void
+rop_bi_fr_as_xr(n_real *real, long num, long den, int nop)
+{
+    mpi iop;
+    mpr *bigr = XALLOC(mpr);
+
+    mpi_init(&iop);
+    mpi_set(&iop, RBI(real));
+    mpi_muli(&iop, &iop, den);
+
+    mpr_init(bigr);
+    mpr_seti(bigr, num, den);
+
+    if (nop == NOP_ADD)
+       mpi_add(mpr_num(bigr), &iop, mpr_num(bigr));
+    else
+       mpi_sub(mpr_num(bigr), &iop, mpr_num(bigr));
+    mpi_clear(&iop);
+
+    RCLEAR_BI(real);
+    RBR(real) = bigr;
+    RTYPE(real) = N_BIGRATIO;
+    rbr_canonicalize(real);
+}
+
+static INLINE void
+rop_bi_fr_md_xr(n_real *real, long num, long den, int nop)
+{
+    mpr *bigr = XALLOC(mpr);
+
+    mpr_init(bigr);
+
+    mpr_seti(bigr, num, den);
+
+    if (nop == NOP_MUL)
+       mpi_mul(mpr_num(bigr), RBI(real), mpr_num(bigr));
+    else {
+       mpi_mul(mpr_den(bigr), RBI(real), mpr_den(bigr));
+       mpr_inv(bigr, bigr);
+    }
+
+    RCLEAR_BI(real);
+    RBR(real) = bigr;
+    RTYPE(real) = N_BIGRATIO;
+    rbr_canonicalize(real);
+}
+
+static INLINE void
+radd_bi_fr(n_real *real, long num, long den)
+{
+    rop_bi_fr_as_xr(real, num, den, NOP_ADD);
+}
+
+static INLINE void
+rsub_bi_fr(n_real *real, long num, long den)
+{
+    rop_bi_fr_as_xr(real, num, den, NOP_SUB);
+}
+
+static INLINE void
+rmul_bi_fr(n_real *real, long num, long den)
+{
+    rop_bi_fr_md_xr(real, num, den, NOP_MUL);
+}
+
+static INLINE void
+rdiv_bi_fr(n_real *real, long num, long den)
+{
+    rop_bi_fr_md_xr(real, num, den, NOP_DIV);
+}
+
+static int
+cmp_bi_fr(mpi *bignum, long num, long den)
+{
+    int cmp;
+    mpr cmp1, cmp2;
+
+    mpr_init(&cmp1);
+    mpi_set(mpr_num(&cmp1), bignum);
+    mpi_seti(mpr_den(&cmp1), 1);
+
+    mpr_init(&cmp2);
+    mpr_seti(&cmp2, num, den);
+
+    cmp = mpr_cmp(&cmp1, &cmp2);
+    mpr_clear(&cmp1);
+    mpr_clear(&cmp2);
+
+    return (cmp);
+}
+
+
+/************************************************************************
+ * BIGNUM BIGRATIO
+ ************************************************************************/
+static void
+rop_bi_br_as_xr(n_real *real, mpr *bigratio, int nop)
+{
+    mpi iop;
+    mpr *bigr = XALLOC(mpr);
+
+    mpi_init(&iop);
+    mpi_set(&iop, RBI(real));
+    mpr_init(bigr);
+    mpr_set(bigr, bigratio);
+
+    mpi_mul(&iop, &iop, mpr_den(bigratio));
+
+    if (nop == NOP_ADD)
+       mpi_add(mpr_num(bigr), &iop, mpr_num(bigr));
+    else
+       mpi_sub(mpr_num(bigr), &iop, mpr_num(bigr));
+    mpi_clear(&iop);
+
+    RCLEAR_BI(real);
+    RBR(real) = bigr;
+    RTYPE(real) = N_BIGRATIO;
+    rbr_canonicalize(real);
+}
+
+static void
+rop_bi_br_md_xr(n_real *real, mpr *bigratio, int nop)
+{
+    mpr *bigr = XALLOC(mpr);
+
+    mpr_init(bigr);
+    if (nop == NOP_MUL)
+       mpr_set(bigr, bigratio);
+    else
+       mpr_inv(bigr, bigratio);
+
+    mpi_mul(mpr_num(bigr), RBI(real), mpr_num(bigr));
+
+    RCLEAR_BI(real);
+    RBR(real) = bigr;
+    RTYPE(real) = N_BIGRATIO;
+    rbr_canonicalize(real); 
+}
+
+static INLINE void
+radd_bi_br(n_real *real, mpr *bigratio)
+{
+    rop_bi_br_as_xr(real, bigratio, NOP_ADD);
+}
+
+static INLINE void
+rsub_bi_br(n_real *real, mpr *bigratio)
+{
+    rop_bi_br_as_xr(real, bigratio, NOP_SUB);
+}
+
+static INLINE void
+rmul_bi_br(n_real *real, mpr *bigratio)
+{
+    rop_bi_br_md_xr(real, bigratio, NOP_MUL);
+}
+
+static INLINE void
+rdiv_bi_br(n_real *real, mpr *bigratio)
+{
+    rop_bi_br_md_xr(real, bigratio, NOP_DIV);
+}
+
+static int
+cmp_bi_br(mpi *bignum, mpr *bigratio)
+{
+    int cmp;
+    mpr cmp1;
+
+    mpr_init(&cmp1);
+    mpi_set(mpr_num(&cmp1), bignum);
+    mpi_seti(mpr_den(&cmp1), 1);
+
+    cmp = mpr_cmp(&cmp1, bigratio);
+    mpr_clear(&cmp1);
+
+    return (cmp);
+}
+
+
+/************************************************************************
+ * FIXRATIO FIXNUM
+ ************************************************************************/
+static void
+rop_fr_fi_as_xr(n_real *real, long op, int nop)
+{
+    int fit;
+    long value = 0, num = RFRN(real), den = RFRD(real);
+
+    fit = !fi_fi_mul_overflow(op, den);
+
+    if (fit) {
+       value = op * den;
+       if (nop == NOP_ADD)
+           fit = !fi_fi_add_overflow(value, num);
+       else
+           fit = !fi_fi_sub_overflow(value, num);
+    }
+    if (fit) {
+       if (nop == NOP_ADD)
+           RFRN(real) = num + value;
+       else
+           RFRN(real) = num - value;
+       rfr_canonicalize(real);
+    }
+    else {
+       mpi iop;
+       mpr *bigr = XALLOC(mpr);
+
+       mpr_init(bigr);
+       mpr_seti(bigr, num, den);
+       mpi_init(&iop);
+       mpi_seti(&iop, op);
+       mpi_muli(&iop, &iop, den);
+       if (nop == NOP_ADD)
+           mpi_add(mpr_num(bigr), mpr_num(bigr), &iop);
+       else
+           mpi_sub(mpr_num(bigr), mpr_num(bigr), &iop);
+       mpi_clear(&iop);
+       RBR(real) = bigr;
+       RTYPE(real) = N_BIGRATIO;
+       rbr_canonicalize(real);
+    }
+}
+
+static void
+rop_fr_fi_md_xr(n_real *real, long op, int nop)
+{
+    long num = RFRN(real), den = RFRD(real);
+
+    if (nop == NOP_MUL) {
+       if (!fi_fi_mul_overflow(op, num)) {
+           RFRN(real) = op * num;
+           rfr_canonicalize(real);
+           return;
+       }
+    }
+    else if (!fi_fi_mul_overflow(op, den)) {
+       RFRD(real) = op * den;
+       rfr_canonicalize(real);
+       return;
+    }
+
+    {
+       mpr *bigr = XALLOC(mpr);
+
+       mpr_init(bigr);
+       mpr_seti(bigr, num, den);
+       if (nop == NOP_MUL)
+           mpr_muli(bigr, bigr, op);
+       else
+           mpr_divi(bigr, bigr, op);
+       RBR(real) = bigr;
+       RTYPE(real) = N_BIGRATIO;
+       rbr_canonicalize(real);
+    }
+}
+
+static INLINE void
+radd_fr_fi(n_real *real, long op)
+{
+    rop_fr_fi_as_xr(real, op, NOP_ADD);
+}
+
+static INLINE void
+rsub_fr_fi(n_real *real, long op)
+{
+    rop_fr_fi_as_xr(real, op, NOP_SUB);
+}
+
+static INLINE void
+rmul_fr_fi(n_real *real, long op)
+{
+    rop_fr_fi_md_xr(real, op, NOP_MUL);
+}
+
+static INLINE void
+rdiv_fr_fi(n_real *real, long op)
+{
+    rop_fr_fi_md_xr(real, op, NOP_DIV);
+}
+
+static INLINE int
+cmp_fr_fi(long num, long den, long fixnum)
+{
+    return (cmp_flonum((double)num / (double)den, (double)fixnum));
+}
+
+
+/************************************************************************
+ * FIXRATIO BIGNUM
+ ************************************************************************/
+static void
+rop_fr_bi_as_xr(n_real *real, mpi *bignum, int nop)
+{
+    mpi iop;
+    mpr *bigr = XALLOC(mpr);
+
+    mpr_init(bigr);
+    mpr_seti(bigr, RFRN(real), RFRD(real));
+
+    mpi_init(&iop);
+    mpi_set(&iop, bignum);
+    mpi_muli(&iop, &iop, RFRD(real));
+
+    if (nop == NOP_ADD)
+       mpi_add(mpr_num(bigr), mpr_num(bigr), &iop);
+    else
+       mpi_sub(mpr_num(bigr), mpr_num(bigr), &iop);
+    mpi_clear(&iop);
+
+    RBR(real) = bigr;
+    RTYPE(real) = N_BIGRATIO;
+    rbr_canonicalize(real); 
+}
+
+static void
+rop_fr_bi_md_xr(n_real *real, mpi *bignum, int nop)
+{
+    mpr *bigr = XALLOC(mpr);
+
+    mpr_init(bigr);
+    mpr_seti(bigr, RFRN(real), RFRD(real));
+
+    if (nop == NOP_MUL)
+       mpi_mul(mpr_num(bigr), mpr_num(bigr), bignum);
+    else
+       mpi_mul(mpr_den(bigr), mpr_den(bigr), bignum);
+
+    RBR(real) = bigr;
+    RTYPE(real) = N_BIGRATIO;
+    rbr_canonicalize(real); 
+}
+
+static INLINE void
+radd_fr_bi(n_real *real, mpi *bignum)
+{
+    rop_fr_bi_as_xr(real, bignum, NOP_ADD);
+}
+
+static INLINE void
+rsub_fr_bi(n_real *real, mpi *bignum)
+{
+    rop_fr_bi_as_xr(real, bignum, NOP_SUB);
+}
+
+static INLINE void
+rmul_fr_bi(n_real *real, mpi *bignum)
+{
+    rop_fr_bi_md_xr(real, bignum, NOP_MUL);
+}
+
+static INLINE void
+rdiv_fr_bi(n_real *real, mpi *bignum)
+{
+    rop_fr_bi_md_xr(real, bignum, NOP_DIV);
+}
+
+static int
+cmp_fr_bi(long num, long den, mpi *bignum)
+{
+    int cmp;
+    mpr cmp1, cmp2;
+
+    mpr_init(&cmp1);
+    mpr_seti(&cmp1, num, den);
+
+    mpr_init(&cmp2);
+    mpi_set(mpr_num(&cmp2), bignum);
+    mpi_seti(mpr_den(&cmp2), 1);
+
+    cmp = mpr_cmp(&cmp1, &cmp2);
+    mpr_clear(&cmp1);
+    mpr_clear(&cmp2);
+
+    return (cmp);
+}
+
+
+/************************************************************************
+ * FIXRATIO FIXRATIO
+ ************************************************************************/
+static void
+rop_fr_fr_as_xr(n_real *real, long num2, long den2, int nop)
+{
+    int fit;
+    long num1 = RFRN(real), den1 = RFRD(real), num = 0, den = 0;
+
+    fit = !fi_fi_mul_overflow(num1, den2);
+    if (fit) {
+       num = num1 * den2;
+       fit = !fi_fi_mul_overflow(num2, den1);
+       if (fit) {
+           den = num2 * den1;
+           if (nop == NOP_ADD) {
+               if ((fit = !fi_fi_add_overflow(num, den)) != 0)
+                   num += den;
+           }
+           else if ((fit = !fi_fi_sub_overflow(num, den)) != 0)
+               num -= den;
+           if (fit) {
+               fit = !fi_fi_mul_overflow(den1, den2);
+               if (fit)
+                   den = den1 * den2;
+           }
+       }
+    }
+    if (fit) {
+       RFRN(real) = num;
+       RFRD(real) = den;
+       rfr_canonicalize(real);
+    }
+    else {
+       mpi iop;
+       mpr *bigr = XALLOC(mpr);
+
+       mpr_init(bigr);
+       mpr_seti(bigr, num1, den1);
+       mpi_muli(mpr_den(bigr), mpr_den(bigr), den2);
+       mpi_init(&iop);
+       mpi_seti(&iop, num2);
+       mpi_muli(&iop, &iop, den1);
+       mpi_muli(mpr_num(bigr), mpr_num(bigr), den2);
+       if (nop == NOP_ADD)
+           mpi_add(mpr_num(bigr), mpr_num(bigr), &iop);
+       else
+           mpi_sub(mpr_num(bigr), mpr_num(bigr), &iop);
+       mpi_clear(&iop);
+       RBR(real) = bigr;
+       RTYPE(real) = N_BIGRATIO;
+       rbr_canonicalize(real);
+    }
+}
+
+static void
+rop_fr_fr_md_xr(n_real *real, long num2, long den2, int nop)
+{
+    int fit;
+    long num1 = RFRN(real), den1 = RFRD(real), num = 0, den = 0;
+
+    if (nop == NOP_MUL) {
+       fit = !fi_fi_mul_overflow(num1, num2) && !fi_fi_mul_overflow(den1, den2);
+       if (fit) {
+           num = num1 * num2;
+           den = den1 * den2;
+       }
+    }
+    else {
+       fit = !fi_fi_mul_overflow(num1, den2) && !fi_fi_mul_overflow(den1, num2);
+       if (fit) {
+           num = num1 * den2;
+           den = den1 * num2;
+       }
+    }
+
+    if (fit) {
+       RFRN(real) = num;
+       RFRD(real) = den;
+       rfr_canonicalize(real);
+    }
+    else {
+       mpr *bigr = XALLOC(mpr);
+
+       mpr_init(bigr);
+
+       if (nop == NOP_MUL) {
+           mpr_seti(bigr, num1, den1);
+           mpi_muli(mpr_num(bigr), mpr_num(bigr), num2);
+           mpi_muli(mpr_den(bigr), mpr_den(bigr), den2);
+       }
+       else {
+           mpr_seti(bigr, num1, num2);
+           mpi_muli(mpr_num(bigr), mpr_num(bigr), den2);
+           mpi_muli(mpr_den(bigr), mpr_den(bigr), den1);
+       }
+
+       RBR(real) = bigr;
+       RTYPE(real) = N_BIGRATIO;
+       rbr_canonicalize(real);
+    }
+}
+
+static INLINE void
+radd_fr_fr(n_real *real, long num, long den)
+{
+    rop_fr_fr_as_xr(real, num, den, NOP_ADD);
+}
+
+static INLINE void
+rsub_fr_fr(n_real *real, long num, long den)
+{
+    rop_fr_fr_as_xr(real, num, den, NOP_SUB);
+}
+
+static INLINE void
+rmul_fr_fr(n_real *real, long num, long den)
+{
+    rop_fr_fr_md_xr(real, num, den, NOP_MUL);
+}
+
+static INLINE void
+rdiv_fr_fr(n_real *real, long num, long den)
+{
+    rop_fr_fr_md_xr(real, num, den, NOP_DIV);
+}
+
+static INLINE int
+cmp_fr_fr(long num1, long den1, long num2, long den2)
+{
+    return (cmp_flonum((double)num1 / (double)den1,
+                      (double)num2 / (double)den2));
+}
+
+
+/************************************************************************
+ * FIXRATIO BIGRATIO
+ ************************************************************************/
+static void
+rop_fr_br_asmd_xr(n_real *real, mpr *bigratio, int nop)
+{
+    mpr *bigr = XALLOC(mpr);
+
+    mpr_init(bigr);
+    mpr_seti(bigr, RFRN(real), RFRD(real));
+
+    switch (nop) {
+       case NOP_ADD:
+           mpr_add(bigr, bigr, bigratio);
+           break;
+       case NOP_SUB:
+           mpr_sub(bigr, bigr, bigratio);
+           break;
+       case NOP_MUL:
+           mpr_mul(bigr, bigr, bigratio);
+           break;
+       default:
+           mpr_div(bigr, bigr, bigratio);
+           break;
+    }
+
+    RBR(real) = bigr;
+    RTYPE(real) = N_BIGRATIO;
+    rbr_canonicalize(real); 
+}
+
+static INLINE void
+radd_fr_br(n_real *real, mpr *bigratio)
+{
+    rop_fr_br_asmd_xr(real, bigratio, NOP_ADD);
+}
+
+static INLINE void
+rsub_fr_br(n_real *real, mpr *bigratio)
+{
+    rop_fr_br_asmd_xr(real, bigratio, NOP_SUB);
+}
+
+static INLINE void
+rmul_fr_br(n_real *real, mpr *bigratio)
+{
+    rop_fr_br_asmd_xr(real, bigratio, NOP_MUL);
+}
+
+static INLINE void
+rdiv_fr_br(n_real *real, mpr *bigratio)
+{
+    rop_fr_br_asmd_xr(real, bigratio, NOP_DIV);
+}
+
+static int
+cmp_fr_br(long num, long den, mpr *bigratio)
+{
+    int cmp;
+    mpr cmp1;
+
+    mpr_init(&cmp1);
+    mpr_seti(&cmp1, num, den);
+
+    cmp = mpr_cmp(&cmp1, bigratio);
+    mpr_clear(&cmp1);
+
+    return (cmp);
+}
+
+
+/************************************************************************
+ * BIGRATIO FIXNUM
+ ************************************************************************/
+static void
+rop_br_fi_asmd_xr(n_real *real, long fixnum, int nop)
+{
+    mpr *bigratio = RBR(real);
+
+    switch (nop) {
+       case NOP_ADD:
+           mpr_addi(bigratio, bigratio, fixnum);
+           break;
+       case NOP_SUB:
+           mpr_subi(bigratio, bigratio, fixnum);
+           break;
+       case NOP_MUL:
+           mpr_muli(bigratio, bigratio, fixnum);
+           break;
+       default:
+           if (fixnum == 0)
+               fatal_error(DIVIDE_BY_ZERO);
+           mpr_divi(bigratio, bigratio, fixnum);
+           break;
+    }
+    rbr_canonicalize(real); 
+}
+
+static INLINE void
+radd_br_fi(n_real *real, long fixnum)
+{
+    rop_br_fi_asmd_xr(real, fixnum, NOP_ADD);
+}
+
+static INLINE void
+rsub_br_fi(n_real *real, long fixnum)
+{
+    rop_br_fi_asmd_xr(real, fixnum, NOP_SUB);
+}
+
+static INLINE void
+rmul_br_fi(n_real *real, long fixnum)
+{
+    rop_br_fi_asmd_xr(real, fixnum, NOP_MUL);
+}
+
+static INLINE void
+rdiv_br_fi(n_real *real, long fixnum)
+{
+    rop_br_fi_asmd_xr(real, fixnum, NOP_DIV);
+}
+
+static int
+cmp_br_fi(mpr *bigratio, long fixnum)
+{
+    int cmp;
+    mpr cmp2;
+
+    mpr_init(&cmp2);
+    mpr_seti(&cmp2, fixnum, 1);
+    cmp = mpr_cmp(bigratio, &cmp2);
+    mpr_clear(&cmp2);
+
+    return (cmp);
+}
+
+
+/************************************************************************
+ * BIGRATIO BIGNUM
+ ************************************************************************/
+static void
+rop_br_bi_as_xr(n_real *real, mpi *bignum, int nop)
+{
+    mpi iop;
+
+    mpi_init(&iop);
+    mpi_set(&iop, bignum);
+
+    mpi_mul(&iop, &iop, RBRD(real));
+    if (nop == NOP_ADD)
+       mpi_add(RBRN(real), RBRN(real), &iop);
+    else
+       mpi_sub(RBRN(real), RBRN(real), &iop);
+    mpi_clear(&iop);
+    rbr_canonicalize(real); 
+}
+
+static INLINE void
+radd_br_bi(n_real *real, mpi *bignum)
+{
+    rop_br_bi_as_xr(real, bignum, NOP_ADD);
+}
+
+static INLINE void
+rsub_br_bi(n_real *real, mpi *bignum)
+{
+    rop_br_bi_as_xr(real, bignum, NOP_SUB);
+}
+
+static INLINE void
+rmul_br_bi(n_real *real, mpi *bignum)
+{
+    mpi_mul(RBRN(real), RBRN(real), bignum);
+    rbr_canonicalize(real);
+}
+
+static INLINE void
+rdiv_br_bi(n_real *real, mpi *bignum)
+{
+    mpi_mul(RBRD(real), RBRD(real), bignum);
+    rbr_canonicalize(real);
+}
+
+static int
+cmp_br_bi(mpr *bigratio, mpi *bignum)
+{
+    int cmp;
+    mpr cmp1;
+
+    mpr_init(&cmp1);
+    mpi_set(mpr_num(&cmp1), bignum);
+    mpi_seti(mpr_den(&cmp1), 1);
+
+    cmp = mpr_cmp(bigratio, &cmp1);
+    mpr_clear(&cmp1);
+
+    return (cmp);
+}
+
+
+/************************************************************************
+ * BIGRATIO FIXRATIO
+ ************************************************************************/
+static void
+rop_br_fr_asmd_xr(n_real *real, long num, long den, int nop)
+{
+    mpr *bigratio = RBR(real), rop;
+
+    mpr_init(&rop);
+    mpr_seti(&rop, num, den);
+    switch (nop) {
+       case NOP_ADD:
+           mpr_add(bigratio, bigratio, &rop);
+           break;
+       case NOP_SUB:
+           mpr_sub(bigratio, bigratio, &rop);
+           break;
+       case NOP_MUL:
+           mpr_mul(bigratio, bigratio, &rop);
+           break;
+       default:
+           mpr_div(bigratio, bigratio, &rop);
+           break;
+    }
+    mpr_clear(&rop);
+    rbr_canonicalize(real); 
+}
+
+static INLINE void
+radd_br_fr(n_real *real, long num, long den)
+{
+    rop_br_fr_asmd_xr(real, num, den, NOP_ADD);
+}
+
+static INLINE void
+rsub_br_fr(n_real *real, long num, long den)
+{
+    rop_br_fr_asmd_xr(real, num, den, NOP_SUB);
+}
+
+static INLINE void
+rmul_br_fr(n_real *real, long num, long den)
+{
+    rop_br_fr_asmd_xr(real, num, den, NOP_MUL);
+}
+
+static INLINE void
+rdiv_br_fr(n_real *real, long num, long den)
+{
+    rop_br_fr_asmd_xr(real, num, den, NOP_DIV);
+}
+
+static int
+cmp_br_fr(mpr *bigratio, long num, long den)
+{
+    int cmp;
+    mpr cmp2;
+
+    mpr_init(&cmp2);
+    mpr_seti(&cmp2, num, den);
+    cmp = mpr_cmp(bigratio, &cmp2);
+    mpr_clear(&cmp2);
+
+    return (cmp);
+}
+
+
+/************************************************************************
+ * BIGRATIO BIGRATIO
+ ************************************************************************/
+static INLINE void
+radd_br_br(n_real *real, mpr *bigratio)
+{
+    mpr_add(RBR(real), RBR(real), bigratio);
+    rbr_canonicalize(real); 
+}
+
+static INLINE void
+rsub_br_br(n_real *real, mpr *bigratio)
+{
+    mpr_sub(RBR(real), RBR(real), bigratio);
+    rbr_canonicalize(real); 
+}
+
+static INLINE void
+rmul_br_br(n_real *real, mpr *bigratio)
+{
+    mpr_mul(RBR(real), RBR(real), bigratio);
+    rbr_canonicalize(real); 
+}
+
+static INLINE void
+rdiv_br_br(n_real *real, mpr *bigratio)
+{
+    mpr_div(RBR(real), RBR(real), bigratio);
+    rbr_canonicalize(real); 
+}
+
+static INLINE int
+cmp_br_br(mpr *op1, mpr *op2)
+{
+    return (mpr_cmp(op1, op2));
+}
diff --git a/xedit/lisp/modules/indent.lsp b/xedit/lisp/modules/indent.lsp
new file mode 100644 (file)
index 0000000..1ba8b72
--- /dev/null
@@ -0,0 +1,1426 @@
+;
+;; Copyright (c) 2002 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/modules/indent.lsp,v 1.6 2003/01/16 03:50:46 paulo Exp $
+;;
+
+(provide "indent")
+(require "xedit")
+(in-package "XEDIT")
+
+(defconstant indent-spaces '(#\Tab #\Space))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; The final indentation function.
+;; Parameters:
+;;     indent
+;;             Number of spaces to insert
+;;     offset
+;;             Offset to where indentation should be added
+;;     no-tabs
+;;             If set, tabs aren't inserted
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun indent-text (indent offset &optional no-tabs
+                   &aux start line length index current tabs spaces string
+                        barrier base result (point (point))
+                  )
+
+    ;; Initialize
+    (setq
+       start   (scan offset :eol :left)
+       line    (read-text start (- offset start))
+       length  (length line)
+       index   (1- length)
+       current 0
+       base    0
+    )
+
+    (and (minusp indent) (setq indent 0))
+
+    ;; Skip any spaces after offset, "paranoia check"
+    (while (member (char-after offset) indent-spaces)
+       (incf offset)
+    )
+
+    ;; Check if there are only spaces before `offset' and the line `start'
+    (while (and (>= index 0) (member (char line index) indent-spaces))
+       (decf index)
+    )
+
+    ;; `index' will be zero if there are only spaces in the `line'
+    (setq barrier (+ start (incf index)))
+
+    ;; Calculate `base' unmodifiable indentation, if any
+    (dotimes (i index)
+       (if (char= (char line i) #\Tab)
+           (incf base (- 8 (rem base 8)))
+           (incf base)
+       )
+    )
+
+    ;; If any non blank character would need to be deleted
+    (and (> base indent) (return-from indent-text nil))
+
+    ;; Calculate `current' indentation
+    (setq current base)
+    (while (< index length)
+       (if (char= (char line index) #\Tab)
+           (incf current (- 8 (rem current 8)))
+           (incf current)
+       )
+       (incf index)
+    )
+
+    ;; Maybe could also "optimize" the indentation even if it is already
+    ;; correct, removing spaces "inside" tabs.
+    (when (/= indent current)
+       (if no-tabs
+           (setq
+               length  (- indent base)
+               result  (+ barrier length)
+               string  (make-string length :initial-element #\Space)
+           )
+           (progn
+               (multiple-value-setq (tabs spaces) (floor (- indent base) 8))
+               (setq
+                   length      (+ tabs spaces)
+                   result      (+ barrier length)
+                   string      (make-string length :initial-element #\Tab)
+               )
+               (fill string #\Space :start tabs)
+           )
+       )
+
+       (replace-text barrier offset string)
+       (and (>= offset point) (>= point barrier) (goto-char result))
+    )
+)
+(compile 'indent-text)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Helper function, returns indentation of a given offset
+;; If `align' is set, stop once a non blank character is seen, that
+;; is, use `offset' only as a line identifier
+;; If `resolve' is set, it means that the offset is just a hint, it
+;; maybe anywhere in the line
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun offset-indentation (offset &key resolve align
+                          &aux
+                          char
+                          line
+                          (start (scan offset :eol :left))
+                          (indent 0))
+    (if resolve
+       (loop
+           (if (characterp (setq char (char-after start)))
+               (if (char= char #\Tab)
+                   (incf indent (- 8 (rem indent 8)))
+                   ;; Not a tab, check if is a space
+                   (if (char= char #\Space)
+                       (incf indent)
+                       ;; Not a tab neither a space
+                       (return indent)
+                   )
+               )
+               ;; EOF found
+               (return indent)
+           )
+           ;; Increment offset to check next character
+           (incf start)
+       )
+       (progn
+           (setq line (read-text start (- offset start)))
+           (dotimes (i (length line) indent)
+               (if (char= (setq char (char line i)) #\Tab)
+                   (incf indent (- 8 (rem indent 8)))
+                   (progn
+                       (or align (member char indent-spaces)
+                           (return indent)
+                       )
+                       (incf indent)
+                   )
+               )
+           )
+       )
+    )
+)
+(compile 'offset-indentation)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  A default/fallback indentation function, just copy indentation
+;; of previous line.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun default-indent (syntax syntable)
+    (let
+       (
+       (offset (scan (point) :eol :left))
+       start
+       left
+       right
+       )
+
+       syntable        ;; XXX hack to not generate warning about unused
+                       ;; variable, should be temporary (until unused
+                       ;; variables can be declared as such)
+
+       (if
+           (or
+               ;; if indentation is disabled
+               (and
+                   (hash-table-p (syntax-options syntax))
+                   (gethash :disable-indent (syntax-options syntax))
+               )
+               ;; or if not at the start of a new line
+               (> (scan offset :eol :right) offset)
+           )
+           (return-from default-indent)
+       )
+
+       (setq left offset)
+       (loop
+           (setq
+               start left
+               left (scan start :eol :left :count 2)
+               right (scan left :eol :right)
+           )
+           ;; if start of file reached
+           (and (>= left start) (return))
+           (when
+               (setq
+                   start
+                   (position-if-not
+                       #'(lambda (char) (member char indent-spaces))
+                       (read-text left (- right left))
+                   )
+               )
+
+               ;; indent the current line
+               (indent-text (offset-indentation (+ left start) :align t) offset)
+               (return)
+           )
+       )
+    )
+)
+(compile 'default-indent)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Helper function
+;;   Clear line before cursor if it is empty
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun indent-clear-empty-line (&aux left offset right line index)
+    (setq
+       offset  (scan (point) :eol :left)
+       left    (scan offset :eol :left :count 2)
+       right   (scan left :eol :right)
+    )
+
+    ;; If not at the first line in the file and line is not already empty
+    (when (and (/= offset left) (/= left right))
+       (setq
+           line        (read-text left (- right left))
+           index       (1- (length line))
+       )
+       (while (and (>= index 0) (member (char line index) indent-spaces))
+           (decf index)
+       )
+       ;; If line was only spaces
+       (and (minusp index) (replace-text left right ""))
+    )
+)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  Macro to be called whenever an indentation rule decides that
+;; the parser is done.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defmacro indent-macro-terminate (&optional result)
+    `(return-from ind-terminate-block ,result)
+)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Like indent-terminate, but "rejects" the input for the current line
+;; and terminates the loop.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defmacro indent-macro-reject (&optional result)
+   `(progn
+       (setq ind-state ind-prev-state)
+       (return-from ind-terminate-block ,result)
+    )
+)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Like indent-reject, but "rejects" anything before the current token
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defmacro indent-macro-reject-left (&optional result)
+   `(progn
+       (setq ind-state ind-matches)
+       (return-from ind-terminate-block ,result)
+    )
+)
+
+
+(defstruct indtoken
+    regex                      ;; a string, character or regex
+    token                      ;; the resulting token, nil or a keyword
+    begin                      ;; begin a new table
+    switch                     ;; switch to another table
+    ;; begin and switch fields are used like the ones for the syntax highlight
+    ;; syntoken structure.
+    label                      ;; filed at compile time
+    code                       ;; code to execute when it matches
+)
+
+(defstruct indtable
+    label                      ;; a keyword, name of the table
+    tokens                     ;; list of indtoken structures
+    tables                     ;; list of indtable structures
+    augments                   ;; augment list
+)
+
+(defstruct indaugment
+    labels                     ;; list of keywords labeling tables
+)
+
+(defstruct indinit
+    variables                  ;; list of variables and optional initialization
+    ;; Format of variables must be suitable to LET*, example of call:
+    ;; (indinit
+    ;;     var1                ;; initialized to NIL
+    ;;     (var2 (afun))       ;; initialized to the value returned by AFUN
+    ;; )
+)
+
+(defstruct indreduce
+    token                      ;; reduced token
+    rules                      ;; list of rules
+    label                      ;; unique label associated with rule, this
+                               ;; field is automatically filled in the
+                               ;; compilation process. this field exists
+                               ;; to allow several indreduce definitions
+                               ;; that result in the same token
+    check                      ;; FORM evaluated, if T apply reduce rule
+    code                       ;; PROGN to be called when a rule matches
+)
+
+;; NOTE, unlike "reduce" rules, "resolve" rules cannot be duplicated
+(defstruct indresolve
+    match                      ;; the matched token (or a list of tokens)
+    code                       ;; PROGN to apply for this token
+)
+
+(defstruct indent
+    reduces                    ;; list of indreduce structures
+    tables                     ;; list of indtable structures
+    inits                      ;; initialization list
+    resolves                   ;; list of indresolve structures
+    token-code                 ;; code to execute when a token matches
+    check-code                 ;; code to execute before applying a reduce rule
+    reduce-code                        ;; code to execute after reduce rule
+    resolve-code               ;; code to execute when matching a token
+)
+
+(defmacro defindent (variable label &rest lists)
+   `(if (boundp ',variable)
+       ,variable
+       (progn
+           (proclaim '(special ,variable))
+           (setq ,variable (compile-indent-table ,label ,@lists))
+       )
+    )
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Create an indent token.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defmacro indtoken (pattern token
+                   &key icase nospec begin switch code (nosub t))
+    (setq pattern (re-comp (eval pattern) :icase icase :nospec nospec :nosub nosub))
+    (when (consp (re-exec pattern "" :notbol t :noteol t))
+       (error "INDTOKEN: regex ~A matches empty string" pattern)
+    )
+
+    ;; result of macro, return token structure
+    (make-indtoken
+       :regex  pattern
+       :token  token
+       :begin  begin
+       :switch switch
+       :code   code
+    )
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Create an indentation table. Basically a list of indentation tokens.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun indtable (label &rest definitions)
+    ;; check for simple errors
+    (unless (keywordp label)
+       (error "INDTABLE: ~A is not a keyword" label)
+    )
+    (dolist (item definitions)
+       (unless
+           (or
+               (atom item)
+               (indtoken-p item)
+               (indtable-p item)
+               (indaugment-p item)
+           )
+           (error "INDTABLE: invalid indent table argument ~A" item)
+       )
+    )
+
+    ;; return indent table structure
+    (make-indtable
+       :label          label
+       :tokens         (remove-if-not #'indtoken-p definitions)
+       :tables         (remove-if-not #'indtable-p definitions)
+       :augments       (remove-if-not #'indaugment-p definitions)
+    )
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Add identifier to list of augment tables.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun indaugment (&rest keywords)
+    (dolist (keyword keywords)
+       (unless (keywordp keyword)
+           (error "INDAUGMENT: bad indent table label ~A" keyword)
+       )
+    )
+
+    ;; return augment list structure
+    (make-indaugment :labels keywords)
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Add variables to initialization list
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defmacro indinit (&rest variables)
+    (make-indinit :variables variables)
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Create a "reduction rule"
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defmacro indreduce (token check rules &rest code &aux nullp consp)
+    ;; check for simple errors
+    (unless (or (keywordp token) (null token))
+       (error "INDREDUCE: ~A is not a keyword" token)
+    )
+    (dolist (rule rules)
+       (or (listp rule) (error "INDREDUCE: invalid indent rule ~A" rule))
+       ;; XXX This test is not enough, maybe should add some sort of
+       ;; runtime check to avoid circularity.
+       (and (eq token (car rule)) (null (cdr rule))
+           (error "INDREDUCE: ~A reduces to ~A" token)
+       )
+       (dolist (item rule)
+           (and (or nullp consp) (not (keywordp item))
+               (error "INDREDUCE: a keyword must special pattern")
+           )
+           (if (consp item)
+               (progn
+                   (unless
+                       (or
+                           (and
+                               (eq (car item) 'not)
+                               (keywordp (cadr item))
+                               (null (cddr item))
+                           )
+                           (and
+                               (eq (car item) 'or)
+                               (null (member-if-not #'keywordp (cdr item)))
+                           )
+                       )
+                       (error "INDREDUCE: syntax error parsing ~A" item)
+                   )
+                   (setq consp t)
+               )
+               (progn
+                   (setq nullp (null item) consp nil)
+                   (unless (or (keywordp item) nullp (eq item t))
+                       (error "INDREDUCE: ~A is not a keyword" item)
+                   )
+               )
+           )
+       )
+;      (and consp
+;          (error "INDREDUCE: pattern must be followed by keyword")
+;      )
+    )
+
+    ;; result of macro, return indent reduce structure
+    (make-indreduce
+       :token  token
+       :check  check
+       :rules  (remove-if #'null rules)
+       :code   code
+    )
+)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Create a "resolve rule"
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defmacro indresolve (match &rest code)
+    ;; check for simple errors
+    (if (consp match)
+       (dolist (token match)
+           (or (keywordp token) (error "INDRESOLVE: ~A is not a keyword" token))
+       )
+       (or (keywordp match) (error "INDRESOLVE: ~A is not a keyword" match))
+    )
+
+    ;; result of macro, return indent resolve structure
+    (make-indresolve
+       :match  match
+       :code   code
+    )
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Helper function for compile-indent-table. Returns a list of all
+;; tables and tokens for a given table, including tokens and tables
+;; of children.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun list-indtable-elements (table &aux result sub-result)
+    (setq result (cons (indtable-tokens table) (indtable-tables table)))
+    (dolist (child (indtable-tables table))
+       (setq sub-result (list-indtable-elements child))
+       (rplaca result (append (car result) (car sub-result)))
+       (rplacd result (append (cdr result) (cdr sub-result)))
+    )
+    ;; Return pair of all nested tokens and tables
+    result
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; First pass adding augumented tokens to a table, done in two passes
+;; to respect inheritance order.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun compile-indent-augment-list (table table-list &aux labels augment tokens)
+
+    ;; Create a list of all augment tables.
+    (dolist (augment (indtable-augments table))
+       (setq labels (append labels (indaugment-labels augment)))
+    )
+
+    ;;  Remove duplicates and references to "itself", without warnings?
+    (setq
+       labels
+       (remove (indtable-label table) (remove-duplicates labels :from-end t))
+    )
+
+    ;; Check if the specified indent tables exists!
+    (dolist (label labels)
+       (unless
+           (setq augment (car (member label table-list :key #'indtable-label)))
+           (error "COMPILE-INDENT-AUGMENT-LIST: Cannot augment ~A in ~A"
+               label
+               (indtable-label table)
+           )
+       )
+
+       ;; Increase list of tokens.
+       (setq tokens (append tokens (indtable-tokens augment)))
+    )
+
+    ;;  Store the tokens in the augment list. They will be added
+    ;; to the indent table in the second pass.
+    (setf (indtable-augments table) tokens)
+
+    ;;  Recurse on every child table.
+    (dolist (child (indtable-tables table))
+       (compile-indent-augment-list child table-list)
+    )
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Last pass adding augmented tokens to a table.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun link-indent-augment-list (table)
+    (setf
+       (indtable-tokens table)
+       (remove-duplicates
+           (nconc (indtable-tokens table) (indtable-augments table))
+           :key        #'indtoken-regex
+           :test       #'equal
+           :from-end   t
+       )
+
+       ;;  Don't need to keep this list anymore.
+       (indtable-augments table)
+       ()
+    )
+
+    (dolist (child (indtable-tables table))
+       (link-indent-augment-list child)
+    )
+)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Compile the indent reduction rules
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun compile-indent-reduces (reduces
+                              &aux need label check rules reduce
+                                   check-code reduce-code)
+    (dolist (item reduces)
+       (setq
+           label       (indreduce-label item)
+           check       (indreduce-check item)
+           rules       (indreduce-rules item)
+           reduce      (indreduce-code  item)
+           need        (and
+                           rules
+                           (not label)
+                           (or
+                               reduce
+                               (null check)
+                               (not (constantp check))
+                           )
+                       )
+       )
+       (when need
+           (and (null label) (setq label (intern (string (gensym)) 'keyword)))
+
+           (setf (indreduce-label item) label)
+
+           (and
+               (or (null check)
+                   (not (constantp check))
+               )
+               (setq
+                   check       (list (list 'eq '*ind-label* label) check)
+                   check-code  (nconc check-code (list check))
+               )
+           )
+
+           (and reduce
+               (setq
+                   reduce      (cons (list 'eq '*ind-label* label) reduce)
+                   reduce-code (nconc reduce-code (list reduce))
+               )
+           )
+       )
+    )
+
+    ;; XXX Instead of using COND, could/should use CASE
+    ;; TODO Implement a smart CASE in the bytecode compiler, if
+    ;;     possible, should generate a hashtable, or a table
+    ;;     of indexes (for example when all elements in the cases
+    ;;     are characters) and then jump directly to the code.
+    (if check-code
+       (setq check-code (cons 'cond (nconc check-code '((t t)))))
+       (setq check-code t)
+    )
+    (and reduce-code (setq reduce-code (cons 'cond reduce-code)))
+
+    (values check-code reduce-code)
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Compile the indent resolve code
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun compile-indent-resolves (resolves &aux match resolve resolve-code)
+    (and
+       (/=
+           (length resolves)
+           (length (remove-duplicates resolves :key #'indresolve-match))
+       )
+       ;; XXX Could do a more complete job and tell what is wrong...
+       (error "COMPILE-INDENT-RESOLVES: duplicated labels")
+    )
+
+    (dolist (item resolves)
+       (when (setq resolve (indresolve-code item))
+           (setq
+               match
+               (indresolve-match item)
+
+               resolve
+               (cons
+                   (if (listp match)
+                       (list 'member '*ind-token* `',match :test `#'eq)
+                       (list 'eq '*ind-token* match)
+                   )
+                   resolve
+               )
+
+               resolve-code
+               (nconc resolve-code (list resolve))
+           )
+       )
+    )
+
+    (and resolve-code (cons 'cond resolve-code))
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Create an indentation table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun compile-indent-table (name &rest lists
+                            &aux main elements switches begins tables symbols
+                                 label code token-code check-code reduce-code
+                                 (inits (remove-if-not #'indinit-p lists))
+                                 (reduces (remove-if-not #'indreduce-p lists))
+                                 (resolves (remove-if-not #'indresolve-p lists))
+                           )
+    (setq
+       lists    (delete-if
+                   #'(lambda (object)
+                       (or
+                           (indinit-p object)
+                           (indreduce-p object)
+                           (indresolve-p object)
+                       )
+                   )
+                   lists)
+       main     (apply #'indtable name lists)
+       elements (list-indtable-elements main)
+       switches (remove-if #'null (car elements) :key #'indtoken-switch)
+       begins   (remove-if #'null (car elements) :key #'indtoken-begin)
+       tables   (cons main (cdr elements))
+    )
+
+    ;; Check for typos in the keywords, or for not defined indent tables.
+    (dolist (item (mapcar #'indtoken-switch switches))
+       (unless
+           (or (and (integerp item) (minusp item))
+               (member item tables :key #'indtable-label)
+           )
+           (error "COMPILE-INDENT-TABLE: SWITCH ~A cannot be matched" item)
+       )
+    )
+    (dolist (item (mapcar #'indtoken-begin begins))
+       (unless (member item tables :key #'indtable-label)
+           (error "COMPILE-INDENT-TABLE: BEGIN ~A cannot be matched" item)
+       )
+    )
+
+    ;; Build augment list.
+    (compile-indent-augment-list main tables)
+    (link-indent-augment-list main)
+
+    ;; Change switch and begin fields to point to the indent table
+    (dolist (item switches)
+       (if (keywordp (indtoken-switch item))
+           (setf
+               (indtoken-switch item)
+               (car (member (indtoken-switch item) tables :key #'indtable-label))
+           )
+       )
+    )
+    (dolist (item begins)
+       (setf
+           (indtoken-begin item)
+           (car (member (indtoken-begin item) tables :key #'indtable-label))
+       )
+    )
+
+    ;; Build initialization list
+    (dolist (init inits)
+       (setq symbols (nconc symbols (indinit-variables init)))
+    )
+
+    ;; Build token code
+    (dolist (item (car elements))
+       (when (setq code (indtoken-code item))
+           (setf
+               label
+               (intern (string (gensym)) 'keyword)
+
+               (indtoken-label item)
+               label
+
+               code
+               (list (list 'eq '*ind-label* label) code)
+
+               token-code
+               (nconc token-code (list code))
+           )
+       )
+    )
+
+    (multiple-value-setq
+       (check-code reduce-code)
+       (compile-indent-reduces reduces)
+    )
+
+    (make-indent
+       :tables         tables
+       :inits          symbols
+       :reduces        reduces
+       :resolves       resolves
+       :token-code     (and token-code (cons 'cond token-code))
+       :check-code     check-code
+       :reduce-code    reduce-code
+       :resolve-code   (compile-indent-resolves resolves)
+    )
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Search rule-pattern in match-pattern
+;; Returns offset of match, and it's length, if any
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun indent-search-rule (rule-pattern match-pattern
+                          &aux start rule rulep matchp test offset length)
+    (if (member-if-not #'keywordp rule-pattern)
+       ;; rule has wildcards
+       (progn
+           (setq
+               rulep   rule-pattern
+               matchp  match-pattern
+               start   match-pattern
+           )
+           (loop
+               (setq rule (car rulep))
+               (cond
+                   ;; Special pattern
+                   ((consp rule)
+                       (if (eq (car rule) 'not)
+                           (progn
+                               (setq
+                                   test        (cadr rule)
+                                   rulep       (cdr rulep)
+                                   rule        (car rulep)
+                               )
+                               (while
+                                   (and
+                                       ;; something to match
+                                       matchp
+                                       ;; NOT match is true
+                                       (not (eq (car matchp) test))
+                                       ;; next match is not true
+                                       (not (eq (car matchp) rule))
+                                   )
+                                   (setq matchp (cdr matchp))
+                               )
+                               (if (eq (car matchp) rule)
+                                   ;; rule matched
+                                   (setq
+                                       matchp  (cdr matchp)
+                                       rulep   (cdr rulep)
+                                   )
+                                   ;; failed
+                                   (setq
+                                       rulep   rule-pattern
+                                       matchp  (cdr start)
+                                       start   matchp
+                                   )
+                               )
+                           )
+                           ;; (eq (car rule) 'or)
+                           (progn
+                               (if (member (car matchp) (cdr rule) :test #'eq)
+                                   (setq rulep (cdr rulep) matchp (cdr matchp))
+                                   ;; failed
+                                   (progn
+                                       ;; end of match found!
+                                       (and (null matchp) (return))
+                                       ;; reset search
+                                       (setq
+                                           rulep       rule-pattern
+                                           matchp      (cdr start)
+                                           start       matchp
+                                       )
+                                   )
+                               )
+                           )
+                       )
+                   )
+
+                   ;; Skip until end of match-pattern or rule is found
+                   ((null rule)
+                       (setq rulep (cdr rulep))
+                       ;; If matches everything
+                       (if (null rulep)
+                           (progn (setq matchp nil) (return))
+                           ;; If next token cannot be matched
+                           (unless
+                               (setq
+                                   matchp
+                                   (member (car rulep) matchp :test #'eq)
+                               )
+                               (setq rulep rule-pattern)
+                               (return)
+                           )
+                       )
+                       (setq rulep (cdr rulep) matchp (cdr matchp))
+                   )
+
+                   ;; Matched
+                   ((eq rule t)
+                       ;; If there isn't a rule to skip
+                       (and (null matchp) (return))
+                       (setq rulep (cdr rulep) matchp (cdr matchp))
+                   )
+
+                   ;; Matched
+                   ((eq rule (car matchp))
+                       (setq rulep (cdr rulep) matchp (cdr matchp))
+                   )
+
+                   ;; No match
+                   (t
+                       ;; end of match found!
+                       (and (null matchp) (return))
+                       ;; reset search
+                       (setq
+                           rulep       rule-pattern
+                           matchp      (cdr start)
+                           start       matchp
+                       )
+                   )
+               )
+
+               ;; if everything matched
+               (or rulep (return))
+           )
+
+           ;; All rules matched
+           (unless rulep
+               ;; Calculate offset and length of match
+               (setq offset 0 length 0)
+               (until (eq match-pattern start)
+                   (setq
+                       offset          (1+ offset)
+                       match-pattern   (cdr match-pattern)
+                   )
+               )
+               (until (eq match-pattern matchp)
+                   (setq
+                       length          (1+ length)
+                       match-pattern   (cdr match-pattern)
+                   )
+               )
+           )
+       )
+       ;; no wildcards
+       (and (setq offset (search rule-pattern match-pattern :test #'eq))
+            (setq length (length rule-pattern))
+       )
+    )
+
+    (values offset length)
+)
+(compile 'indent-search-rule)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Indentation parser
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defmacro indent-macro (ind-definition ind-offset &optional ind-no-tabs)
+   `(prog*
+       (
+       ;; Current indentation table
+       (ind-table (car (indent-tables ,ind-definition)))
+
+       ;; The parser rules
+       (ind-reduces (indent-reduces ,ind-definition))
+
+       ;; Token list for the table
+       (ind-tokens (indtable-tokens ind-table))
+
+       ;; Stack of nested tables/states
+       ind-stack
+
+       ;; indentation to be used
+       (*indent* 0)
+
+       ;; offset to apply indentation
+       *offset*
+
+       ;; Number of lines read
+       (*ind-lines* 1)
+
+       ;; Matched token
+       *ind-token*
+
+       ;; list of tokens after current match, should not be changed
+       *ind-token-list*
+
+       ;; label associated with rule
+       *ind-label*
+
+       ;; offset of match
+       *ind-offset*
+
+       ;; length of match
+       *ind-length*
+
+       ;; insert position
+       (*ind-point* (point))
+
+       (ind-from (scan ,ind-offset :eol :left))
+       (ind-to ,ind-offset)
+       (ind-line (read-text ind-from (- ind-to ind-from)))
+
+       ;; start of current line
+       (*ind-start* ind-from)
+
+       ;; State information
+       ind-state
+
+       ;; For use with (indent-macro-reject)
+       ind-prev-state
+
+       ;; Matches for the current line
+       ind-matches
+
+       ;; Matched tokens not yet used
+       ind-cache
+
+       ;; Pattern being tested
+       ind-token
+
+       ;; Used when searching for a regex
+       ind-match
+
+       ;; Table to change
+       ind-change
+
+       ;; Length of ind-line
+       (ind-length (length ind-line))
+
+       ;; Don't parse after this offset
+       (ind-end ind-length)
+
+       ;; Temporary variables used during loops
+       ind-left
+       ind-right
+       ind-tleft
+       ind-tright
+
+       ;; Set  when start of file is found
+       ind-startp
+
+       ;; Flag for regex search
+       (ind-noteol (< ind-to (scan ind-from :eol :right)))
+
+       ;; Initialization variables expanded here
+       ,@(indent-inits (eval ind-definition))
+       )
+
+       ;; Initial input already read
+       (go :ind-loop)
+
+       ;; Just to avoid a warning about unused variable, as this
+       ;; variable is somewhat redundant as code should already
+       ;; know before entering indent parser, but useful inside
+       ;; indent macros.
+       *ind-point*
+
+;------------------------------------------------------------------------
+; Read a text line
+:ind-read
+       (setq
+           ind-to      ind-from
+           ind-from    (scan ind-from :eol :left :count 2)
+       )
+       ;; If start of file reached
+       (and (= ind-to ind-from) (setq ind-startp t) (go :ind-process))
+
+       (setq
+           *ind-lines*         (1+ *ind-lines*)
+           ind-to              (scan ind-from :eol :right)
+           ind-line            (read-text ind-from (- ind-to ind-from))
+           ind-length          (length ind-line)
+           ind-end             ind-length
+           ind-noteol          nil
+           ind-cache           nil
+           ind-prev-state      ind-state
+       )
+
+;------------------------------------------------------------------------
+; Loop parsing backwards
+:ind-loop
+       (setq ind-matches nil)
+       (dolist (token ind-tokens)
+           ;; Prepare to loop
+           (setq
+               ind-token       (indtoken-regex token)
+               ind-left        0
+           )
+           ;; While the pattern matches
+           (loop
+               (setq ind-right ind-left)
+               (if
+                   (consp
+                       (setq
+                           ind-match
+                           (re-exec
+                               ind-token
+                               ind-line
+                               :start  ind-left
+                               :end    ind-end
+                               :notbol (> ind-left 0)
+                               :noteol ind-noteol
+                           )
+                       )
+                   )
+
+                   ;; Remember about match
+                   (setq
+                       ind-match   (car ind-match)
+                       ind-left    (cdr ind-match)
+                       ind-matches (cons (cons token ind-match) ind-matches)
+                   )
+
+                   ;; No match
+                   (return)
+               )
+               ;; matched an empty string
+               (and (= ind-left ind-right) (incf ind-left))
+
+               ;; matched a single eol or bol
+               (and (>= ind-left ind-end) (return))
+           )
+       )
+
+       ;; Add new matches to cache
+       (when ind-matches
+           (setq
+               ind-cache
+               (stable-sort
+                   (nconc (nreverse ind-matches) ind-cache) #'< :key #'cadr
+               )
+           )
+       )
+
+       ;; If nothing in the cache
+       (or ind-cache (go :ind-process))
+
+       (setq
+           ind-left    (cadar ind-cache)
+           ind-right   (cddar ind-cache)
+           ind-matches (cdr ind-cache)
+       )
+
+       ;; If only one element in the cache
+       (or ind-matches (go :ind-parse))
+
+       (setq
+           ind-tleft   (cadar ind-matches)
+           ind-tright  (cddar ind-matches)
+       )
+
+       ;; Remove overlaps
+       (loop
+           (if (or (>= ind-tleft ind-right) (<= ind-tright ind-left))
+               ;; No overlap
+               (progn
+                   (setq
+                       ind-left    ind-tleft
+                       ind-right   ind-tright
+                       ind-matches (cdr ind-matches)
+                   )
+                   ;; If everything checked
+                   (or ind-matches (return))
+               )
+               ;; Overlap found
+               (progn
+                   (if (consp (cdr ind-matches))
+                       ;; There are yet items to be checked
+                       (progn
+                           (rplaca ind-matches (cadr ind-matches))
+                           (rplacd ind-matches (cddr ind-matches))
+                       )
+                       ;; Last item
+                       (progn
+                           (rplacd (last ind-cache 2) nil)
+                           (return)
+                       )
+                   )
+               )
+           )
+
+           ;; Prepare for next check
+           (setq
+               ind-tleft   (cadar ind-matches)
+               ind-tright  (cddar ind-matches)
+           )
+       )
+
+;------------------------------------------------------------------------
+; Process the matched tokens
+:ind-parse
+       (setq ind-cache (nreverse ind-cache))
+
+:ind-parse-loop
+       (or (setq ind-match (car ind-cache)) (go :ind-process))
+
+       (setq
+           ind-cache (cdr ind-cache)
+           ind-token (car ind-match)
+       )
+
+       (or (member ind-token ind-tokens :test #'eq)
+           (go :ind-parse-loop)
+       )
+
+       ;; If a state should be added
+       (when (setq ind-change (indtoken-token ind-token))
+           (setq
+               ind-left    (cadr ind-match)
+               ind-right   (cddr ind-match)
+
+               *ind-offset*
+               (+ ind-from ind-left)
+
+               *ind-length*
+               (- ind-right ind-left)
+
+               ind-state
+               (cons
+                   (cons ind-change (cons *ind-offset* *ind-length*))
+                   ind-state
+               )
+
+               *ind-label*
+               (indtoken-label ind-token)
+           )
+
+           ;; Expand token code
+           ,(indent-token-code (eval ind-definition))
+       )
+
+       ;; Check if needs to switch to another table
+       (when (setq ind-change (indtoken-switch ind-token))
+           ;; Need to switch to a previous table
+           (if (integerp ind-change)
+               ;; Relative switch
+               (while (and ind-stack (minusp ind-change))
+                   (setq
+                       ind-table       (pop ind-stack)
+                       ind-change      (1+ ind-change)
+                   )
+               )
+               ;; Search table in the stack
+               (until
+                   (or
+                       (null ind-stack)
+                       (eq
+                           (setq ind-table (pop ind-stack))
+                           ind-change
+                       )
+                   )
+               )
+           )
+
+           ;; If no match or stack became empty
+           (and (null ind-table)
+               (setq
+                   ind-table
+                   (car (indent-tables ,ind-definition))
+               )
+           )
+       )
+
+       ;; Check if needs to start a new table
+       ;; XXX use ind-tleft to reduce number of local variables
+       (when (setq ind-tleft (indtoken-begin ind-token))
+           (setq
+               ind-change  ind-tleft
+               ind-stack   (cons ind-table ind-stack)
+               ind-table   ind-change
+           )
+       )
+
+       ;; If current "indent pattern table" changed
+       (when ind-change
+           (setq
+               ind-tokens  (indtable-tokens ind-table)
+               ind-cache   (nreverse ind-cache)
+               ind-end     (cadr ind-match)
+               ind-noteol  (> ind-length ind-end)
+           )
+           (go :ind-loop)
+       )
+
+       (and ind-cache (go :ind-parse-loop))
+
+;------------------------------------------------------------------------
+; Everything checked, process result
+:ind-process
+
+       ;; If stack is not empty, don't apply rules
+       (and ind-stack (not ind-startp) (go :ind-read))
+
+       (block ind-terminate-block
+           (setq ind-cache nil ind-tleft 0 ind-change (mapcar #'car ind-state))
+           (dolist (entry ind-reduces)
+               (setq
+                   *ind-token* (indreduce-token entry)
+                   *ind-label* (indreduce-label entry)
+               )
+               (dolist (rule (indreduce-rules entry))
+                   (loop
+                       ;; Check if reduction can be applied
+                       (or
+                           (multiple-value-setq
+                               (ind-match ind-length)
+                               (indent-search-rule rule ind-change)
+                           )
+                           (return)
+                       )
+
+                       (setq
+                           ;; First element matched
+                           ind-matches         (nthcdr ind-match ind-state)
+
+                           ;; Offset of match
+                           *ind-offset*        (cadar ind-matches)
+
+                           *ind-token-list*    (nthcdr ind-match ind-change)
+
+                           ;; Length of match, note that *ind-length*
+                           ;; Will be transformed to zero bellow if
+                           ;; the rule is deleting entries.
+                           *ind-length*
+                           (if (> ind-length 1)
+                               (progn
+                                   (setq
+                                       ;; XXX using ind-tright, to reduce
+                                       ;; number of local variables...
+                                       ind-tright
+                                       (nth (1- ind-length) ind-matches)
+
+                                       ind-right
+                                       (+  (cadr ind-tright)
+                                           (cddr ind-tright)
+                                       )
+                                   )
+                                   (- ind-right *ind-offset*)
+                               )
+                               (cddar ind-matches)
+                           )
+                       )
+
+                       ;; XXX using ind-tleft as a counter, to reduce
+                       ;; number of used variables...
+                       (and (>= (incf ind-tleft) 1000)
+                           ;; Should never apply so many reduce rules on
+                           ;; every iteration, if needs to, something is
+                           ;; wrong in the indentation definition...
+                           (error "~D INDREDUCE iterations, ~
+                                  now checking (~A ~A)"
+                               ind-tleft *ind-token* rule
+                           )
+                       )
+
+                       ;; Check if should apply the reduction
+                       (or
+                           ;; Expand check code
+                           ,(indent-check-code (eval ind-definition))
+                           (return)
+                       )
+
+                       (if (null *ind-token*)
+                           ;; Remove match
+                           (progn
+                               (setq *ind-length* 0)
+                               (if (= ind-match 0)
+                                   ;; Matched the first entry
+                                   (setq
+                                       ind-state
+                                       (nthcdr ind-length ind-matches)
+                                   )
+                                   (progn
+                                       (setq
+                                           ind-matches
+                                           (nthcdr (1- ind-match) ind-state)
+                                       )
+                                       (rplacd
+                                           ind-matches
+                                           (nthcdr (1+ ind-length) ind-matches)
+                                       )
+                                   )
+                               )
+                           )
+
+                           ;; Substitute/simplify
+                           (progn
+                               (rplaca (car ind-matches) *ind-token*)
+                               (when (> ind-length 1)
+                                   (rplacd (cdar ind-matches) *ind-length*)
+                                   (rplacd
+                                       ind-matches
+                                       (nthcdr ind-length ind-matches)
+                                   )
+                               )
+                           )
+                       )
+                       (setq
+                           ind-cache       t
+                           ind-change      (mapcar #'car ind-state)
+                       )
+
+                       ;; Expand reduce code
+                       ,(indent-reduce-code (eval ind-definition))
+                   )
+               )
+           )
+
+           ;; ind-cache will be T if at least one change was done
+           (and ind-cache (go :ind-process))
+
+           ;; Start of file reached
+           (or ind-startp (go :ind-read))
+
+       )    ;; end of ind-terminate-block
+
+
+       (block ind-terminate-block
+           (setq *ind-token-list* (mapcar #'car ind-state))
+           (dolist (item ind-state)
+               (setq
+                   *ind-token*         (car item)
+                   *ind-offset*        (cadr item)
+                   *ind-length*        (cddr item)
+               )
+               ;; Expand resolve code
+               ,(indent-resolve-code (eval ind-definition))
+               (setq *ind-token-list* (cdr *ind-token-list*))
+           )
+       )
+
+       (and (integerp *indent*)
+            (integerp *offset*)
+           (indent-text *indent* *offset* ,ind-no-tabs)
+       )
+    )
+)
diff --git a/xedit/lisp/modules/lisp.lsp b/xedit/lisp/modules/lisp.lsp
new file mode 100644 (file)
index 0000000..b65a067
--- /dev/null
@@ -0,0 +1,174 @@
+;;
+;; Copyright (c) 2001 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/modules/lisp.lsp,v 1.9 2002/12/04 05:28:01 paulo Exp $
+;;
+(provide "lisp")
+
+(in-package "LISP")
+
+(export '(
+    second third fourth fifth sixth seventh eighth ninth tenth
+    pathname merge-pathnames
+    logtest signum
+    alphanumericp copy-seq push pop prog prog*
+    with-open-file with-output-to-string
+))
+
+(defun second (a)      (nth 1 a))
+(defun third (a)       (nth 2 a))
+(defun fourth (a)      (nth 3 a))
+(defun fifth (a)       (nth 4 a))
+(defun sixth (a)       (nth 5 a))
+(defun seventh (a)     (nth 6 a))
+(defun eighth (a)      (nth 7 a))
+(defun ninth (a)       (nth 8 a))
+(defun tenth (a)       (nth 9 a))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; pathnames
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun pathname (filename)
+    (values (parse-namestring filename)))
+
+(defun merge-pathnames (pathname &optional defaults default-version)
+    (if (null default-version)
+       (parse-namestring pathname nil defaults)
+       (parse-namestring pathname nil
+           (make-pathname :defaults defaults :version default-version))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; math
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun logtest (integer1 integer2)
+    (not (zerop (logand integer1 integer2))))
+
+(defun signum (number)
+    (if (zerop number) number (/ number (abs number))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; misc functions/macros
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun alphanumericp (char)
+    (or (alpha-char-p char) (not (null (digit-char-p char)))))
+
+(defun copy-seq (sequence)
+    (subseq sequence 0))
+
+(defmacro prog (init &rest body)
+    `(block nil (let ,init (tagbody ,@body))))
+
+(defmacro prog* (init &rest body)
+    `(block nil (let* ,init (tagbody ,@body))))
+
+(defmacro with-open-file (file &rest body)
+    `(let ((,(car file) (open ,@(cdr file))))
+       (unwind-protect
+           (progn ,@body)
+           (if ,(car file) (close ,(car file))))))
+
+(defmacro with-output-to-string (stream &rest body)
+    `(let ((,(car stream) (make-string-output-stream)))
+       (unwind-protect
+           (progn ,@body (get-output-stream-string ,(car stream)))
+           (and ,(car stream) (close ,(car stream))))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; setf
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defsetf car (list) (value)    `(progn (rplaca ,list ,value) ,value))
+(defsetf cdr (list) (value)    `(progn (rplacd ,list ,value) ,value))
+
+(defsetf caar (list) (value)   `(progn (rplaca (car ,list) ,value) ,value))
+(defsetf cadr (list) (value)   `(progn (rplaca (cdr ,list) ,value) ,value))
+(defsetf cdar (list) (value)   `(progn (rplacd (car ,list) ,value) ,value))
+(defsetf cddr (list) (value)   `(progn (rplacd (cdr ,list) ,value) ,value))
+(defsetf caaar (list) (value)  `(progn (rplaca (caar ,list) ,value) ,value))
+(defsetf caadr (list) (value)  `(progn (rplaca (cadr ,list) ,value) ,value))
+(defsetf cadar (list) (value)  `(progn (rplaca (cdar ,list) ,value) ,value))
+(defsetf caddr (list) (value)  `(progn (rplaca (cddr ,list) ,value) ,value))
+(defsetf cdaar (list) (value)  `(progn (rplacd (caar ,list) ,value) ,value))
+(defsetf cdadr (list) (value)  `(progn (rplacd (cadr ,list) ,value) ,value))
+(defsetf cddar (list) (value)  `(progn (rplacd (cdar ,list) ,value) ,value))
+(defsetf cdddr (list) (value)  `(progn (rplacd (cddr ,list) ,value) ,value))
+(defsetf caaaar (list) (value) `(progn (rplaca (caaar ,list) ,value) ,value))
+(defsetf caaadr (list) (value) `(progn (rplaca (caadr ,list) ,value) ,value))
+(defsetf caadar (list) (value) `(progn (rplaca (cadar ,list) ,value) ,value))
+(defsetf caaddr (list) (value) `(progn (rplaca (caddr ,list) ,value) ,value))
+(defsetf cadaar (list) (value) `(progn (rplaca (cdaar ,list) ,value) ,value))
+(defsetf cadadr (list) (value) `(progn (rplaca (cdadr ,list) ,value) ,value))
+(defsetf caddar (list) (value) `(progn (rplaca (cddar ,list) ,value) ,value))
+(defsetf cadddr (list) (value) `(progn (rplaca (cdddr ,list) ,value) ,value))
+(defsetf cdaaar (list) (value) `(progn (rplacd (caaar ,list) ,value) ,value))
+(defsetf cdaadr (list) (value) `(progn (rplacd (caadr ,list) ,value) ,value))
+(defsetf cdadar (list) (value) `(progn (rplacd (cadar ,list) ,value) ,value))
+(defsetf cdaddr (list) (value) `(progn (rplacd (caddr ,list) ,value) ,value))
+(defsetf cddaar (list) (value) `(progn (rplacd (cdaar ,list) ,value) ,value))
+(defsetf cddadr (list) (value) `(progn (rplacd (cdadr ,list) ,value) ,value))
+(defsetf cdddar (list) (value) `(progn (rplacd (cddar ,list) ,value) ,value))
+(defsetf cddddr (list) (value) `(progn (rplacd (cdddr ,list) ,value) ,value))
+
+(defsetf first (list) (value)  `(progn (rplaca ,list ,value) ,value))
+(defsetf second (list) (value) `(progn (rplaca (nthcdr 1 ,list) ,value) ,value))
+(defsetf third (list) (value)  `(progn (rplaca (nthcdr 2 ,list) ,value) ,value))
+(defsetf fourth (list) (value) `(progn (rplaca (nthcdr 3 ,list) ,value) ,value))
+(defsetf fifth (list) (value)  `(progn (rplaca (nthcdr 4 ,list) ,value) ,value))
+(defsetf sixth (list) (value)  `(progn (rplaca (nthcdr 5 ,list) ,value) ,value))
+(defsetf seventh (list) (value)        `(progn (rplaca (nthcdr 6 ,list) ,value) ,value))
+(defsetf eighth (list) (value) `(progn (rplaca (nthcdr 7 ,list) ,value) ,value))
+(defsetf ninth (list) (value)  `(progn (rplaca (nthcdr 8 ,list) ,value) ,value))
+(defsetf tenth (list) (value)  `(progn (rplaca (nthcdr 9 ,list) ,value) ,value))
+
+(defsetf rest (list) (value)   `(progn (rplacd ,list ,value) ,value))
+
+(defun lisp::nth-store (index list value)
+    (rplaca (nthcdr index list) value) value)
+(defsetf nth lisp::nth-store)
+
+(defsetf aref (array &rest indices) (value)
+    `(lisp::vector-store ,array ,@indices ,value))
+
+(defsetf get (symbol key &optional default) (value)
+    `(lisp::put ,symbol ,key ,value))
+
+(defsetf symbol-plist lisp::set-symbol-plist)
+
+(defsetf gethash (key hash-table &optional default) (value)
+    `(lisp::puthash ,key ,hash-table ,value))
+
+(defsetf char lisp::char-store)
+(defsetf schar lisp::char-store)
+(defsetf elt lisp::elt-store)
+(defsetf svref lisp::elt-store)
+(defsetf documentation lisp::documentation-store)
+
+(defsetf symbol-value set)
+
+(defsetf subseq (sequence start &optional end) (value)
+    `(progn (replace ,sequence ,value :start1 ,start :end1 ,end) ,value))
diff --git a/xedit/lisp/modules/progmodes/auto.lsp b/xedit/lisp/modules/progmodes/auto.lsp
new file mode 100644 (file)
index 0000000..aa4543e
--- /dev/null
@@ -0,0 +1,110 @@
+;; Copyright (c) 2007,2008 Paulo Cesar Pereira de Andrade
+;;
+;; 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 (including the next
+;; paragraph) 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.
+;;
+;; Author: Paulo Cesar Pereira de Andrade
+;;
+
+;; Mode for editing autoconf/automake m4 files
+
+(require "syntax")
+(in-package "XEDIT")
+
+(defsynprop *prop-macro*
+    "macro"
+    :font      "*courier-bold-r*-12-*"
+    :foreground        "green4")
+
+(defsynprop *prop-separator*
+  "separator"
+  :font                "*courier-bold-r*-12-*"
+  :foreground  "Red3")
+
+(defsynprop *prop-variable*
+  "variable"
+  :font                "*lucidatypewriter-medium-r*-12-*"
+  :foreground  "Gold4")
+
+(defsynprop *prop-escape*
+  "escape"
+  :font                "*lucidatypewriter-medium-r*-12-*"
+  :foreground  "Red3")
+
+(defsyntax *auto-mode* :main nil nil nil
+  ;; dont consider dnl a macro call at top level
+  (syntoken "(#.*|\\<dnl($|\\>.*))" :property *prop-comment*)
+
+  ;; shell keywords
+  (syntoken
+    (string-concat
+      "\\<("
+      "if|then|else|elif|else|fi|case|in|esac|do|done"
+      ")\\>") :property *prop-keyword*)
+
+  ;; toplevel no arguments macro
+  (syntoken "^[a-zA-Z0-9_]+$" :property *prop-macro*)
+
+  (syntable :string *prop-string* nil
+    ;; ignore escaped characters
+    (syntoken "\\\\.")
+    (syntoken "\"" :nospec t :switch -1)
+    (synaugment :variables))
+  (syntable :constant *prop-constant* nil
+    (syntoken "\\\\.")
+    (syntoken "'" :nospec t :switch -1)
+    (synaugment :variables))
+  (syntable :escape *prop-escape* nil
+    (syntoken "\\\\.")
+    (syntoken "`" :nospec t :switch -1)
+    (synaugment :variables))
+
+  (syntable :quoted-string *prop-string* nil
+    (syntoken "\\\"" :nospec t :switch -1))
+
+  (syntable :macro *prop-default* nil
+    (syntoken "," :property *prop-separator*)
+    (syntoken "[" :nospec t :property *prop-separator* :begin :quoted)
+    (syntable :quoted *prop-default* nil
+      ;; allow nesting
+      (syntoken "[" :nospec t :property *prop-separator* :begin :quoted)
+      (syntoken "]" :nospec t :property *prop-separator* :switch -1)
+      (synaugment :shared :variables))
+    (syntoken ")" :nospec t :property *prop-macro* :switch -1)
+    (synaugment :shared :variables :comments))
+
+  (syntable :shared nil nil
+    (syntoken "[a-zA-Z0-9_]+\\(" :property *prop-macro* :begin :macro)
+    ;; variable assignment
+    (syntoken "[a-zA-Z0-9_-]+=" :property *prop-keyword*)
+    (syntoken "\"" :nospec t :begin :string :contained t)
+    (syntoken "'" :nospec t :begin :constant :contained t)
+    (syntoken "`" :nospec t :begin :escape :contained t)
+    (syntoken "\\\"" :nospec t :begin :quoted-string :contained t)
+  )
+
+  (syntable :variables nil nil
+    (syntoken "\\$[a-zA-Z0-9_-]+" :property *prop-variable*)
+    (syntoken "\\$\\{[a-zA-Z0-9_-]+\\}" :property *prop-variable*)
+    (syntoken "\\$\\([a-zA-Z0-9_-]+\\)" :property *prop-variable*))
+
+  (syntable :comments nil nil
+    (syntoken "(#.*|\\<dnl($|\\>.*))" :property *prop-comment*))
+
+  (synaugment :shared :variables))
diff --git a/xedit/lisp/modules/progmodes/c.lsp b/xedit/lisp/modules/progmodes/c.lsp
new file mode 100644 (file)
index 0000000..fba6b99
--- /dev/null
@@ -0,0 +1,1140 @@
+;;
+;; Copyright (c) 2002 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/modules/progmodes/c.lsp,v 1.27 2004/01/12 17:53:20 paulo Exp $
+;;
+
+(require "syntax")
+(require "indent")
+(in-package "XEDIT")
+
+(defsynprop *prop-format*
+    "format"
+    :font      "*lucidatypewriter-medium-r*-12-*"
+    :foreground        "RoyalBlue2"
+    :underline t
+)
+
+(defsynoptions *c-DEFAULT-style*
+    ;; Positive number. Basic indentation.
+    (:indentation              .       4)
+
+    ;; Boolean. Support for GNU style indentation.
+    (:brace-indent             .       nil)
+
+    ;; Boolean. Add one indentation level to case and default?
+    (:case-indent              .       t)
+
+    ;; Boolean. Remove one indentation level for labels?
+    (:label-dedent             .       t)
+
+    ;; Boolean. Add one indentation level to continuations?
+    (:cont-indent              .       t)
+
+    ;; Boolean. Move cursor to the indent column after pressing <Enter>?
+    (:newline-indent           .       t)
+
+    ;; Boolean. Set to T if tabs shouldn't be used to fill indentation.
+    (:emulate-tabs             .       nil)
+
+    ;; Boolean. Force a newline before braces?
+    (:newline-before-brace     .       nil)
+
+    ;; Boolean. Force a newline after braces?
+    (:newline-after-brace      .       nil)
+
+    ;; Boolean. Force a newline after semicolons?
+    (:newline-after-semi       .       nil)
+
+    ;; Boolean. Only calculate indentation after pressing <Enter>?
+    ;;         This may be useful if the parser does not always
+    ;;         do what the user expects...
+    (:only-newline-indent      .       nil)
+
+    ;; Boolean. Remove extra spaces from previous line.
+    ;;         This should default to T when newline-indent is not NIL.
+    (:trim-blank-lines         .       t)
+
+    ;; Boolean. If this hash-table entry is set, no indentation is done.
+    ;;         Useful to temporarily disable indentation.
+    (:disable-indent           .       nil)
+)
+
+;; BSD like style
+(defsynoptions *c-BSD-style*
+    (:indentation              .       8)
+    (:brace-indent             .       nil)
+    (:case-indent              .       nil)
+    (:label-dedent             .       t)
+    (:cont-indent              .       t)
+    (:newline-indent           .       t)
+    (:emulate-tabs             .       nil)
+    (:newline-before-brace     .       nil)
+    (:newline-after-brace      .       t)
+    (:newline-after-semi       .       t)
+    (:trim-blank-lines         .       t)
+)
+
+;; GNU like style
+(defsynoptions *c-GNU-style*
+    (:indentation              .       2)
+    (:brace-indent             .       t)
+    (:case-indent              .       nil)
+    (:label-dedent             .       t)
+    (:cont-indent              .       t)
+    (:newline-indent           .       nil)
+    (:emulate-tabs             .       nil)
+    (:newline-before-brace     .       t)
+    (:newline-after-brace      .       t)
+    (:newline-after-semi       .       t)
+    (:trim-blank-lines         .       nil)
+)
+
+;; K&R like style
+(defsynoptions *c-K&R-style*
+    (:indentation              .       5)
+    (:brace-indent             .       nil)
+    (:case-indent              .       nil)
+    (:label-dedent             .       t)
+    (:cont-indent              .       t)
+    (:newline-indent           .       t)
+    (:emulate-tabs             .       t)
+    (:newline-before-brace     .       t)
+    (:newline-after-brace      .       t)
+    (:newline-after-semi       .       t)
+    (:trim-blank-lines         .       t)
+)
+
+(defvar *c-styles* '(
+    ("xedit"   .       *c-DEFAULT-style*)
+    ("BSD"     .       *c-BSD-style*)
+    ("GNU"     .       *c-GNU-style*)
+    ("K&R"     .       *c-K&R-style*)
+))
+
+(defvar *c-mode-options* *c-DEFAULT-style*)
+; (setq *c-mode-options* *c-gnu-style*)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; This is a very lazy "pattern matcher" for the C language.
+;; If the syntax in the code is not correct, it may get confused, and
+;; because it is "lazy" some wrong constructs will be recognized as
+;; correct when reducing patterns.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defindent *c-mode-indent* :main
+    ;; this must be the first token
+    (indtoken "^\\s*"          :start-of-line)
+    (indtoken "\\<case\\>"     :c-case)
+    (indtoken "\\<default\\>"  :c-default)
+    (indtoken "\\<do\\>"       :do)
+    (indtoken "\\<if\\>"       :c-if)
+    (indtoken "\\<else\\>"     :c-else)
+    (indtoken "\\<for\\>"      :c-for)
+    (indtoken "\\<switch\\>"   :c-switch)
+    (indtoken "\\<while\\>"    :c-while)
+    ;; Match identifiers and numbers as an expression
+    (indtoken "\\w+"           :expression)
+    (indtoken ";"              :semi           :nospec t)
+    (indtoken ","              :comma          :nospec t)
+    (indtoken ":"              :collon         :nospec t)
+    ;;  Ignore spaces before collon, this avoids dedenting ternary
+    ;; and bitfield definitions as the parser does not distinguish
+    ;; labels from those, another option would be to use the pattern
+    ;; "\\w+:", but this way should properly handle labels generated
+    ;; by macros, example: `MACRO_LABEL(value):'
+    (indtoken "\\s+:"          nil)
+
+    (indinit                   (c-braces 0))
+    (indtoken "{"
+       :obrace
+       :nospec t
+       :code   (decf c-braces)
+    )
+    (indtoken "}"
+       :cbrace
+       :nospec t
+       :begin  :braces
+       :code   (incf c-braces)
+    )
+    (indtable :braces
+       (indtoken "{"
+           :obrace
+           :nospec t
+           :switch -1
+           :code   (decf c-braces)
+       )
+       (indtoken "}"
+           :cbrace
+           :nospec t
+           :begin  :braces
+           :code   (incf c-braces)
+       )
+    )
+
+    (indinit                   (c-bra 0))
+    (indtoken ")"              :cparen         :nospec t :code (incf c-bra))
+    (indtoken "("              :oparen         :nospec t :code (decf c-bra))
+    (indtoken "]"              :cbrack         :nospec t :code (incf c-bra))
+    (indtoken "["              :obrack         :nospec t :code (decf c-bra))
+    (indtoken "\\\\$"          :continuation)
+
+    ;; C++ style comment, disallow other tokens to match inside comment
+    (indtoken "//.*$"          nil)
+
+    (indtoken "#"              :hash           :nospec t)
+
+    ;; if in the same line, reduce now, this must be done because the
+    ;; delimiters are identical
+    (indtoken "'([^\\']|\\\\.)*'"      :expression)
+    (indtoken "\"([^\\\"]|\\\\.)*\""   :expression)
+
+    (indtoken "\""             :cstring        :nospec t       :begin :string)
+
+    (indtoken "'"              :cconstant      :nospec t       :begin :constant)
+
+    (indtoken "*/"             :ccomment       :nospec t       :begin :comment)
+    ;; this must be the last token
+    (indtoken "$"              :end-of-line)
+
+    (indtable :string
+       ;; Ignore escaped characters
+       (indtoken "\\."         nil)
+       ;; Return to the toplevel when the start of the string is found
+       (indtoken "\""          :ostring        :nospec t       :switch -1)
+    )
+    (indtable :constant
+       ;; Ignore escaped characters
+       (indtoken "\\."         nil)
+       ;; Return to the toplevel when the start of the character is found
+       (indtoken "'"           :oconstant      :nospec t       :switch -1)
+    )
+    (indtable :comment
+       (indtoken "/*"          :ocomment       :nospec t       :switch -1)
+    )
+
+    ;; "Complex" statements
+    (indinit           (c-complex 0) (c-cases 0))
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Order of reduce rules here is important, process comment,
+    ;; continuations, preprocessor and set states when an eol is found.
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+    (indinit   (c-offset (point-max))
+               (c-prev-offset c-offset)
+    )
+    (indreduce :indent
+       t
+       ((:start-of-line))
+       (and (= *ind-start* *ind-offset*)
+           (setq
+               *offset* (+ *ind-offset* *ind-length*)
+           )
+       )
+       (setq
+           c-prev-offset   c-offset
+           c-offset        *ind-offset*
+       )
+    )
+
+    ;; Delete comments
+    (indreduce nil
+       t
+       ((:ocomment nil :ccomment))
+    )
+
+    ;; Join in a single token to simplify removal of possible multiline
+    ;; preprocessor directives
+    (indinit                   c-continuation)
+    (indreduce :continuation
+       t
+       ((:continuation :end-of-line))
+       (setq c-continuation t)
+    )
+
+    (indreduce :eol
+       t
+       ((:end-of-line))
+       ;; Anything after the eol offset is safe to parse now
+       (setq c-continuation nil)
+    )
+
+    ;; Delete blank lines
+    (indreduce nil
+       t
+       ((:indent :eol))
+    )
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Preprocessor
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    (indreduce nil
+       (>= *ind-offset* *ind-start*)
+       ((:indent :hash))
+       (setq *indent* 0)
+       (indent-macro-reject-left)
+    )
+    (indreduce nil
+       t
+       ((:indent :hash nil :eol))
+    )
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Expressions
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    (indreduce :expression
+       t
+       ;; Reduce to a single expression
+       ((:expression :parens)
+        (:expression :bracks)
+        (:expression :expression)
+       ;; These may be multiline
+        (:ostring (not :ostring) :cstring)
+        (:oconstant (not :oconstant) :cconstant)
+       )
+    )
+
+    (indreduce :expression
+       t
+       ((:expression :eol :indent :expression)
+        (:expression :eol :expression)
+       )
+    )
+
+    (indreduce :exp-comma
+       t
+       ((:expression :comma)
+       )
+    )
+
+    ;; A semicollon, start a statement
+    (indreduce :stat
+       t
+       ((:semi))
+    )
+
+    ;; Expression following (possibly empty) statement
+    (indreduce :stat
+       t
+       (((or :expression :exp-comma) :stat))
+    )
+
+    ;; Multiline statements
+    (indreduce :stat
+       t
+       (((or :expression :exp-comma) :eol :indent :stat)
+        ;; rule below may have removed the :indent
+        ((or :expression :exp-comma) :eol :stat)
+       )
+    )
+
+    (indinit   c-exp-indent)
+    ;; XXX This rule avoids parsing large amounts of code
+    (indreduce :stat
+       t
+       ;; Eat eol if following expression
+       ((:indent :stat :eol)
+        (:indent :stat)
+       )
+       (if
+           (or
+               (null c-exp-indent)
+               (/= (cdar c-exp-indent) (+ *ind-offset* *ind-length*))
+           )
+           ;; A new statement, i.e. not just joining a multiline one
+           (push
+               (cons
+                   (offset-indentation *ind-offset* :resolve t)
+                   (+ *ind-offset* *ind-length*)
+               )
+               c-exp-indent
+           )
+           ;; Update start of statement
+           (rplaca
+               (car c-exp-indent)
+               (offset-indentation *ind-offset* :resolve t)
+           )
+       )
+       (when (consp (cdr c-exp-indent))
+           (if (and
+                   (zerop c-complex)
+                   (zerop c-cases)
+                   (zerop c-bra)
+                   (= (caar c-exp-indent) (caadr c-exp-indent))
+               )
+               ;; Two statements with the same indentation
+               (progn
+                   (setq *indent* (caar c-exp-indent))
+                   (indent-macro-reject-left)
+               )
+               ;; Different indentation or complex state
+               (progn
+                   (rplacd c-exp-indent nil)
+                   (setq c-complex 0)
+               )
+           )
+       )
+    )
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Handle braces
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    (indreduce :stat
+       ;; If block finishes before current line, group as a statement
+       (< (+ *ind-offset* *ind-length*) *ind-start*)
+       ((:obrace (not :obrace) :cbrace))
+    )
+    (indreduce :obrace
+       ;; If not in the first line
+       (< *ind-offset* *ind-start*)
+       ;; If the opening { is the first non blank char in the line
+       ((:indent :obrace))
+       (setq *indent* (offset-indentation (+ *ind-offset* *ind-length*)))
+
+       ;; XXX This may be the starting brace of a switch
+       (setq c-case-flag nil)
+       (indent-macro-reject-left)
+    )
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Labels
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; XXX this frequently doesn't do what is expected, should redefine
+    ;; some rules, as it frequently will dedent while typing something
+    ;; like  test ? exp1 : exp2
+    ;;                   ^ dedents here because it reduces everything
+    ;;                    before ':' to a single :expression token.
+    (indreduce :label
+       t
+       ((:indent :expression :collon :eol))
+       (when (and *label-dedent* (>= *ind-offset* *ind-start*))
+           (setq
+               *indent*
+               (- (offset-indentation *ind-offset* :resolve t) *base-indent*)
+           )
+           (indent-macro-reject-left)
+       )
+    )
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Handle if
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    (indreduce :if
+       t
+       ((:c-if :parens)
+       )
+       (incf c-complex)
+    )
+
+    (indreduce :else
+       t
+       ((:c-else))
+       (incf c-complex)
+    )
+
+    ;; Join
+    (indreduce :else-if
+       t
+       ((:else :if)
+        (:else :eol :indent :if)
+       )
+       (incf c-complex)
+    )
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Handle for
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Join with the parentheses
+    (indreduce :for
+       t
+       ((:c-for :parens)
+       )
+       (incf c-complex)
+    )
+    ;; Before current line, simplify
+    (indreduce :stat
+       (< (+ *ind-offset* *ind-length*) *ind-point*)
+       ((:for :stat)
+       )
+    )
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Handle while and do
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    (indreduce :while
+       t
+       ((:c-while :parens)
+       )
+       (incf c-complex)
+    )
+    (indreduce :stat
+       t
+       ((:do :stat :while)
+        (:while :stat)
+       )
+    )
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Handle switch
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    (indinit                   c-case-flag)
+
+    (indreduce :switch
+       t
+       ((:c-switch :parens)
+       )
+    )
+    ;; Transform in a statement
+    (indreduce :stat
+       (< (+ *ind-offset* *ind-length*) *ind-start*)
+       ((:switch :stat)
+        ;; Do it now or some rule may stop parsing, and calculate
+        ;; a wrong indentation for nested switches
+        (:switch :eol :indent :stat)
+       )
+    )
+    ;; An open switch
+    (indreduce :obrace
+       (and
+           (<= c-braces 0)
+           (> *ind-start* *ind-offset*)
+       )
+       ((:indent :switch :obrace)
+       )
+       (setq
+           *indent* (offset-indentation *ind-offset* :resolve t)
+           c-case-flag nil
+       )
+       (indent-macro-reject-left)
+    )
+    (indreduce :obrace
+       (and
+           (<= c-braces 0)
+           (> *ind-start* *ind-offset*)
+       )
+       ((:indent :switch :eol :indent :obrace)
+       )
+       (setq
+           *indent* (- (offset-indentation *ind-offset* :resolve t) *base-indent*)
+           c-case-flag nil
+       )
+       (and *brace-indent* (incf *indent* *base-indent*))
+       (indent-macro-reject-left)
+    )
+    ;; Before current line
+    (indreduce :case
+       (and
+           (or
+               (not *case-indent*)
+               (prog1 c-case-flag (setq c-case-flag t))
+           )
+           (<= c-braces 0)
+           (< *ind-offset* *ind-start*)
+       )
+       ((:indent :case)
+       )
+       (setq
+           *indent* (offset-indentation *ind-offset* :resolve t)
+           c-case-flag nil
+       )
+       (indent-macro-reject-left)
+    )
+    (indreduce :case
+       t
+       ((:c-case :expression :collon)
+        (:c-default :collon)
+        ;; Assume that it is yet being edited, or adjusting indentation
+        (:c-case)
+        (:c-default)
+       )
+       (and (>= *ind-offset* *ind-start*)
+           (incf c-cases)
+       )
+    )
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Handle parentheses and brackets
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Reduce matches
+    (indreduce :parens
+       t
+       ((:oparen (not :oparen) :cparen))
+       (when
+           (and
+               (< *ind-offset* *ind-start*)
+               (> (+ *ind-offset* *ind-length*) *ind-start*)
+           )
+           (setq *indent* (1+ (offset-indentation *ind-offset* :align t)))
+           (indent-macro-reject-left)
+       )
+    )
+    (indreduce :bracks
+       t
+       ((:obrack (not :obrack) :cbrack))
+       (when
+           (and
+               (< *ind-offset* *ind-start*)
+               (> (+ *ind-offset* *ind-length*) *ind-start*)
+           )
+           (setq *indent* (1+ (offset-indentation *ind-offset* :align t)))
+           (indent-macro-reject-left)
+       )
+    )
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Assuming previous lines have correct indentation, this allows
+    ;; resolving the indentation fastly
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Line ended with an open brace
+    (indreduce :obrace
+       (< *ind-offset* *ind-start*)
+       ((:indent (or :for :while :if :else-if :else :do) :obrace)
+       )
+       (setq *indent* (offset-indentation *ind-offset* :resolve t))
+       (indent-macro-reject-left)
+    )
+    ;; Adjust indentation level if current line starts with an open brace
+    (indreduce nil
+       (< *ind-offset* *ind-start* (+ *ind-offset* *ind-length*))
+        ;; Just set initial indentation
+       ((:indent (or :for :while :if :else-if :else :do) :eol :indent :obrace)
+       )
+       (setq
+           *indent*
+           (- (offset-indentation *ind-offset* :resolve t) *base-indent*)
+       )
+       (and *brace-indent* (incf *indent* *base-indent*))
+       (indent-macro-reject-left)
+    )
+    ;; Previous rule failed, current line does not start with an open brace
+    (indreduce :flow
+       ;; first statement is in current line
+       (and
+           (<= c-braces 0)
+           (> (+ *ind-offset* *ind-length*) *ind-start* *ind-offset*)
+       )
+       ((:indent (or :for :while :if :else-if :else :do) :eol :indent)
+       )
+       (setq *indent* (offset-indentation *ind-offset* :resolve t))
+       (indent-macro-reject-left)
+    )
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Simplify, remove old (:eol :indent)
+    ;; This must be the last rule, to avoid not matching the
+    ;; rules for fast calculation of indentation above
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    (indreduce nil
+       (> *ind-offset* c-prev-offset)
+       ((:eol :indent))
+    )
+
+
+    (indinit                   (c-flow 0))
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; If
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    (indinit                   c-if-flow)
+    (indresolve :if
+       (and (< *ind-offset* *ind-start*)
+           (push c-flow c-if-flow)
+           (incf *indent* *base-indent*)
+           (incf c-flow)
+       )
+    )
+    (indresolve (:else-if :else)
+       (when c-if-flow
+           (while (< c-flow (car c-if-flow))
+               (incf *indent* *base-indent*)
+               (incf c-flow)
+           )
+           (or (eq *ind-token* :else-if) (pop c-if-flow))
+       )
+       (and (< *ind-offset* *ind-start*)
+           (incf *indent* *base-indent*)
+           (incf c-flow)
+       )
+    )
+
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; For/while/do
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    (indinit                   c-do-flow)
+    (indresolve (:for :while :do)
+       (if (eq *ind-token* :do)
+           (and (< *ind-offset* *ind-start*) (push c-flow c-do-flow))
+           (when (and c-do-flow (eq *ind-token* :while))
+               (while (< c-flow (car c-do-flow))
+                   (incf *indent* *base-indent*)
+                   (incf c-flow)
+               )
+               (pop c-do-flow)
+           )
+       )
+       (and (< *ind-offset* *ind-start*)
+           (incf *indent* *base-indent*)
+           (incf c-flow)
+       )
+    )
+
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Switch
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    (indresolve :switch
+       (setq c-case-flag nil)
+    )
+    (indresolve (:case :c-case)
+       (if (< *ind-offset* *ind-start*)
+           (or c-case-flag
+               (setq
+                   *indent*
+                   (+ (offset-indentation *ind-offset* :resolve t)
+                       *base-indent*
+                   )
+               )
+           )
+           (if c-case-flag
+               (and (= (decf c-cases) 0)
+                   (decf *indent* *base-indent*)
+               )
+               (or *case-indent*
+                   (decf *indent* *base-indent*)
+               )
+           )
+       )
+       (setq c-case-flag t)
+    )
+
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Braces/flow control
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    (indresolve :flow
+       (incf *indent* *base-indent*)
+    )
+    (indresolve :obrace
+       (and (< *ind-offset* *ind-start*)
+           (incf *indent* *base-indent*)
+       )
+    )
+    (indresolve :cbrace
+       (decf *indent* *base-indent*)
+       (and *case-indent* c-case-flag
+           (decf *indent* *base-indent*)
+           (setq c-case-flag nil)
+       )
+       (and (not *offset*) (>= *ind-offset* *ind-start*)
+           (setq *offset* *ind-offset*)
+       )
+    )
+
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Statements
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    (indresolve :stat
+       (when (< *ind-offset* *ind-start*)
+           (while (> c-flow 0)
+               (setq
+                   *indent*    (- *indent* *base-indent*)
+                   c-flow      (1- c-flow)
+               )
+           )
+       )
+       (and
+           *cont-indent*
+           (< *ind-offset* *ind-start*)
+           (> (+ *ind-offset* *ind-length*) *ind-start*)
+           (incf *indent* *base-indent*)
+       )
+    )
+
+    (indresolve :expression
+       (and
+           *cont-indent*
+           (zerop c-bra)
+           (> *indent* 0)
+           (< *ind-offset* *ind-start*)
+           (> (+ *ind-offset* *ind-length*) *ind-start*)
+           (incf *indent* *base-indent*)
+       )
+    )
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Open
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    (indresolve (:oparen :obrack)
+       (and (< *ind-offset* *ind-start*)
+           (setq *indent* (1+ (offset-indentation *ind-offset* :align t)))
+       )
+    )
+)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Find a "good" offset to start parsing backwards, so that it should
+;; always generate the same results.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun c-offset-indent (&aux char (point (point)))
+    ;; Skip spaces forward
+    (while (member (setq char (char-after point)) indent-spaces)
+       (incf point)
+    )
+    (or (characterp char) (return-from c-offset-indent point))
+
+    ;; Skip word chars
+    (when (alphanumericp char)
+       (while (and (setq char (char-after point)) (alphanumericp char))
+           (incf point)
+       )
+       (or (characterp char) (return-from c-offset-indent point))
+
+       ;; Skip spaces forward
+       (while (member (setq char (char-after point)) indent-spaces)
+           (incf point)
+       )
+       (or (characterp char) (return-from c-offset-indent point))
+    )
+
+    ;; don't include " or ' to avoid parsing strings "inverted"
+    (if (member char '(#\Newline #\" #\')) point (1+ point))
+)
+(compile 'c-offset-indent)
+
+(defun c-should-indent (options)
+    (when (hash-table-p options)
+       ;; check if previous line has extra spaces
+       (and (gethash :trim-blank-lines options)
+           (indent-clear-empty-line)
+       )
+
+       ;; indentation disabled?
+       (and (gethash :disable-indent options)
+           (return-from c-should-indent)
+       )
+
+       (let*
+           (
+           (point (point))
+           (start (scan point :eol :left))
+           (char (char-before point))
+           offset
+           match
+           text
+           )
+
+           ;; at the start of an empty file
+           (or (characterp char)
+               (return-from c-should-indent)
+           )
+
+           ;; if at bol and should indent only when starting a line
+           (and (gethash :only-newline-indent options)
+               (return-from c-should-indent (= point start))
+           )
+
+           (and
+               (char= char #\;)
+               (gethash :newline-after-semi options)
+               (return-from c-should-indent t)
+           )
+
+           ;; if one of these was typed, must check indentation
+           (and (member char '(#\{ #\} #\: #\] #\) #\#))
+               (return-from c-should-indent t)
+           )
+
+           ;; at the start of a line
+           (and (= point start)
+               (return-from c-should-indent (gethash :newline-indent options))
+           )
+
+           ;; if first character
+           (and (= point (1+ start))
+               (return-from c-should-indent t)
+           )
+
+           ;; check if is the first non-blank character in a new line
+           (when
+               (and
+                   (gethash :cont-indent options)
+                   (= point (scan point :eol :right))
+                   (alphanumericp char)
+               )
+               (setq offset (1- point))
+               (while
+                   (and
+                       (> offset start)
+                       (member (char-before offset) indent-spaces)
+                   )
+                   (decf offset)
+               )
+               ;; line has only one character with possible spaces before it
+               (and (<= offset start)
+                   (return-from c-should-indent t)
+               )
+           )
+
+           ;; check for keywords that change indentation
+           (when (alphanumericp char)
+               (setq offset (1- point))
+               (while
+                   (and
+                       (alphanumericp (char-before offset))
+                       (> offset start)
+                   )
+                   (decf offset)
+               )
+               (setq
+                   text        (read-text offset (- point offset))
+                   match       (re-exec #.(re-comp "(case|else|while)\\w?\\>")
+                                   text)
+               )
+               (and
+                   (consp match)
+                   (return-from c-should-indent (<= (- (caar match) offset) 2))
+               )
+           )
+       )
+    )
+    ;; Should not indent
+    nil
+)
+(compile 'c-should-indent)
+
+
+(defun c-indent-check (syntax syntable options
+                      &aux start point char left brace change)
+    (setq
+       point   (point)
+       char    (char-before point)
+       left    point
+       brace   (member char '(#\{ #\}))
+    )
+
+    (when
+       (and brace (gethash :newline-before-brace options))
+       (setq start (scan point :eol :left))
+       (while
+           (and
+               (> (decf left) start)
+               (member (char-before left) indent-spaces)
+           )
+           ;; skip blanks
+       )
+       (when (> left start)
+           (replace-text left left (string #\Newline))
+           (c-indent syntax syntable)
+           (setq change t)
+       )
+    )
+
+    (when
+       (or
+           (and brace (not change) (gethash :newline-after-brace options))
+           (and (char= char #\;) (gethash :newline-after-semi options))
+       )
+       (setq left (point))
+       (replace-text left left (string #\Newline))
+       (goto-char (1+ left))
+       (c-indent syntax syntable)
+    )
+)
+
+(defun c-indent (syntax syntable)
+    (let*
+       (
+       (options (syntax-options syntax))
+       *base-indent*
+       *brace-indent*
+       *case-indent*
+       *label-dedent*
+       *cont-indent*
+       )
+
+       (or (c-should-indent options) (return-from c-indent))
+
+       (setq
+           *base-indent*       (gethash :indentation options 4)
+           *brace-indent*      (gethash :brace-indent options nil)
+           *case-indent*       (gethash :case-indent options t)
+           *label-dedent*      (gethash :label-dedent options t)
+           *cont-indent*       (gethash :cont-indent options t)
+       )
+
+       (indent-macro
+           *c-mode-indent*
+           (c-offset-indent)
+           (gethash :emulate-tabs options)
+       )
+
+       (c-indent-check syntax syntable options)
+    )
+)
+(compile 'c-indent)
+
+(defsyntax *c-mode* :main nil #'c-indent *c-mode-options*
+    ;;  All recognized C keywords.
+    (syntoken
+       (string-concat
+           "\\<("
+           "asm|auto|break|case|catch|char|class|const|continue|default|"
+           "delete|do|double|else|enum|extern|float|for|friend|goto|if|"
+           "inline|int|long|new|operator|private|protected|public|register|"
+           "return|short|signed|sizeof|static|struct|switch|template|this|"
+           "throw|try|typedef|union|unsigned|virtual|void|volatile|while"
+           ")\\>")
+       :property *prop-keyword*)
+
+    ;; Numbers, this is optional, comment this rule if xedit is
+    ;; too slow to load c files.
+    (syntoken
+       (string-concat
+           "\\<("
+           ;; Integers
+           "(\\d+|0x\\x+)(u|ul|ull|l|ll|lu|llu)?|"
+           ;; Floats
+           "\\d+\\.?\\d*(e[+-]?\\d+)?[lf]?"
+           ")\\>")
+       :icase t
+       :property *prop-number*
+    )
+
+    ;; String start rule.
+    (syntoken "\"" :nospec t :begin :string :contained t)
+
+    ;; Character start rule.
+    (syntoken "'" :nospec t :begin :character :contained t)
+
+    ;; Preprocessor start rule.
+    (syntoken "^\\s*#\\s*\\w+" :begin :preprocessor :contained t)
+
+    ;; Comment start rule.
+    (syntoken "/*" :nospec t :begin :comment :contained t)
+
+    ;; C++ style comments.
+    (syntoken "//.*" :property *prop-comment*)
+
+    ;; Punctuation, this is also optional, comment this rule if xedit is
+    ;; too slow to load c files.
+    (syntoken "[][(){}/*+:;=<>,&.!%|^~?-][][(){}*+:;=<>,&.!%|^~?-]?"
+       :property *prop-punctuation*)
+
+
+    ;; Rules for comments.
+    (syntable :comment *prop-comment* #'default-indent
+       ;; Match nested comments as an error.
+       (syntoken "/*" :nospec t :property *prop-error*)
+
+       (syntoken "XXX|TODO|FIXME" :property *prop-annotation*)
+
+       ;;  Rule to finish a comment.
+       (syntoken "*/" :nospec t :switch -1)
+    )
+
+    ;; Rules for strings.
+    (syntable :string *prop-string* #'default-indent
+       ;; Ignore escaped characters, this includes \".
+       (syntoken "\\\\.")
+
+       ;; Match, most, printf arguments.
+       (syntoken "%%|%([+-]?\\d+)?(l?[deEfgiouxX]|[cdeEfgiopsuxX])"
+           :property *prop-format*)
+
+       ;; Ignore continuation in the next line.
+       (syntoken "\\\\$")
+
+       ;; Rule to finish a string.
+       (syntoken "\"" :nospec t :switch -1)
+
+       ;; Don't allow strings continuing in the next line.
+       (syntoken ".?$" :begin :error)
+    )
+
+    ;; Rules for characters.
+    (syntable :character *prop-constant* nil
+       ;; Ignore escaped characters, this includes \'.
+       (syntoken "\\\\.")
+
+       ;; Ignore continuation in the next line.
+       (syntoken "\\\\$")
+
+       ;; Rule to finish a character constant.
+       (syntoken "'" :nospec t :switch -1)
+
+       ;; Don't allow constants continuing in the next line.
+       (syntoken ".?$" :begin :error)
+    )
+
+    ;;  Rules for preprocessor.
+    (syntable :preprocessor *prop-preprocessor* #'default-indent
+       ;;  Preprocessor includes comments.
+       (syntoken "/*" :nospec t :begin :comment :contained t)
+
+       ;;  Ignore strings and constants in the same line and finishes table
+       ;; This is kind hackish, but must be done because the current parser
+       ;; will not flag eol. Maybe it could be extended to properly handle
+       ;; and have an internal flag to tell it to pass again if there
+       ;; is a regex that can match eol on an empty string.
+       ;;  A test is already done (but at compile time) to not allow patterns
+       ;; that match an empty string (but allow patterns matching
+       ;; bol, eol or both on an empty string).
+       (syntoken "\"([^\\\"]|\\\\.)*\"$" :property *prop-string* :switch -1)
+       (syntoken "'([^']|\\\\.)*'$" :property *prop-constant* :switch -1)
+
+       ;;  Ignore strings and constants in the same line
+       (syntoken "\"([^\\\"]|\\\\.)*\"" :property *prop-string*)
+       (syntoken "'([^']|\\\\.)*'" :property *prop-constant*)
+
+       ;;  Ignore lines finishing with a backslash.
+       (syntoken "\\\\$")
+
+       ;; multiline strings
+       (syntoken "\"" :nospec t :begin :string)
+
+       ;; multiline constants
+       (syntoken "'" :nospec t :begin :character)
+
+       ;;  C++ style comments
+       (syntoken "//.*$" :property *prop-comment* :switch -1)
+
+       ;; Return to previous state if end of line found.
+       (syntoken ".?$" :switch -1)
+    )
+
+    (syntable :error *prop-error* nil
+       (syntoken "^.*$" :switch -2)
+    )
+
+    ;;  You may also want to comment this rule if the parsing is
+    ;; noticeably slow.
+    (syntoken "\\c" :property *prop-control*)
+)
diff --git a/xedit/lisp/modules/progmodes/html.lsp b/xedit/lisp/modules/progmodes/html.lsp
new file mode 100644 (file)
index 0000000..562739e
--- /dev/null
@@ -0,0 +1,327 @@
+;;
+;; Copyright (c) 2002 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/modules/progmodes/html.lsp,v 1.2 2002/09/22 18:41:27 paulo Exp $
+;;
+
+(require "syntax")
+(in-package "XEDIT")
+
+#|
+  This is not a validation tool for html.
+
+  It is possible to, using macros generate all combinations of text attributes,
+  to properly handle <b>...<i>...</i>...</b> etc, as well as generating macros
+  to automatically closing tags, but for now this file was built to work as an
+  experience with the syntax highlight code.
+|#
+
+(defsynprop *prop-html-default*
+    "default"
+    :font      "-*-lucida-medium-r-*-*-14-*-*-*-*-*-*-1"
+    :foreground        "Gray10")
+
+(defsynprop *prop-html-bold*
+    "bold"
+    :font      "-*-lucida-bold-r-*-*-14-*-*-*-*-*-*-1"
+    :foreground        "Gray15")
+
+(defsynprop *prop-html-italic*
+    "italic"
+    :font      "-*-lucida-medium-i-*-*-14-*-*-*-*-*-*-1"
+    :foreground        "Gray10")
+
+(defsynprop *prop-html-pre*
+    "pre"
+    :font      "-*-courier-medium-r-*-*-14-*-*-*-*-*-*-1"
+    :foreground        "Gray10")
+
+(defsynprop *prop-html-link*
+    "link"
+    :font      "-*-lucida-medium-r-*-*-14-*-*-*-*-*-*-1"
+    :foreground        "Blue"
+    :underline "t")
+
+(defsynprop *prop-html-small*
+    "small"
+    :font      "-*-lucida-medium-r-*-*-10-*-*-*-*-*-*-1"
+    :foreground        "Gray10")
+
+(defsynprop *prop-html-big*
+    "big"
+    :font      "-*-lucida-medium-r-*-*-20-*-*-*-*-*-*-1"
+    :foreground        "Gray15")
+
+(defsynprop *prop-html-name*
+    "name"
+    :font      "-*-lucida-bold-r-*-*-14-*-*-*-*-*-*-1"
+    :foreground        "Black"
+    :background "rgb:e/f/e")
+
+(defsynprop *prop-html-h1*
+    "h1"
+    :font      "-*-lucida-bold-r-*-*-20-*-*-*-*-*-*-1"
+    :foreground        "Gray15")
+
+(defsynprop *prop-html-h2*
+    "h2"
+    :font      "-*-lucida-bold-r-*-*-17-*-*-*-*-*-*-1"
+    :foreground        "Gray15")
+
+(defsynprop *prop-html-h4*
+    "h4"
+    :font      "-*-lucida-bold-r-*-*-12-*-*-*-*-*-*-1"
+    :foreground        "Gray15")
+
+(defsynprop *prop-html-h5*
+    "h5"
+    :font      "-*-lucida-bold-r-*-*-10-*-*-*-*-*-*-1"
+    :foreground        "Gray15")
+
+(defsynprop *prop-html-li*
+    "li"
+    :font      "-*-lucida-bold-r-*-*-8-*-*-*-*-*-*-1"
+    :foreground        "rgb:0/5/0"
+    :underline t)
+
+(defsynprop *prop-html-hr*
+    "hr"
+    :font      "-*-courier-bold-r-*-*-12-*-*-*-*-*-*-1"
+    :foreground        "rgb:0/5/0"
+    :overstrike        t)
+
+(defsynprop *prop-html-title*
+    "title"
+    :font      "-*-lucida-medium-r-*-*-14-*-*-*-*-*-*-1"
+    :foreground        "Red3"
+    :underline "t")
+
+(defsynprop *prop-html-tag*
+    "tag"
+    :font      "-*-courier-medium-r-*-*-10-*-*-*-*-*-*-1"
+    :foreground        "green4")
+
+(defsynprop *prop-html-string*
+    "string"
+    :font      "-*-lucida-medium-r-*-*-10-*-*-*-*-*-*-1"
+    :foreground        "RoyalBlue2")
+
+(defsynprop *prop-html-comment*
+    "comment"
+    :font      "-*-courier-medium-o-*-*-10-*-*-*-*-*-*-1"
+    :foreground        "SlateBlue3")
+
+(defsynprop *prop-html-entity*
+    "entity"
+    :font      "-*-lucida-medium-r-*-*-12-*-*-*-*-*-*-1"
+    :foreground        "Red4")
+
+(defsynprop *prop-html-unknown*
+    "unknown"
+    :font      "-*-courier-bold-r-*-*-10-*-*-*-*-*-*-1"
+    :foreground        "yellow"
+    :background "red")
+
+(defmacro html-syntoken (name)
+    `(syntoken (string-concat "<" ,name "\\>")
+       :icase t :contained t
+       :begin (intern (string-concat ,name "$") 'keyword)))
+(defmacro html-syntable (name property)
+    `(let
+       ((label (intern (string-concat ,name "$") 'keyword))
+        (nested-label (intern (string (gensym)) 'keyword)))
+       (syntable label *prop-html-tag* nil
+           (synaugment :generic-tag)
+           (syntoken ">" :nospec t :property *prop-html-tag* :begin nested-label)
+           (syntable nested-label ,property nil
+               (syntoken (string-concat "</" ,name ">")
+                   :icase t :nospec t :property *prop-html-tag* :switch -2)
+               (syntoken (string-concat "</" ,name "\\s*$")
+                   :icase t :contained t :begin :continued-end-tag)
+               (synaugment :main)))))
+
+
+(defsyntax *html-mode* :main *prop-html-default* nil nil
+    (syntoken "<!--" :nospec t :contained t :begin :comment)
+    (syntable :comment *prop-html-comment* nil
+       (syntoken "-->" :nospec t :switch -1))
+    (syntoken "&([a-zA-Z0-9_.-]+|#\\x\\x?);?" :property *prop-html-entity*)
+    (syntoken "<li>" :nospec t :icase t :property *prop-html-li*)
+    (syntoken "<hr>" :nospec t :icase t :property *prop-html-hr*)
+
+    (syntoken "<img\\>" :icase t :contained t :begin :tag)
+    (syntoken "<(p|br)>" :icase t :property *prop-html-tag*)
+
+    ;; If in the toplevel, unbalanced!
+    ;; XXX When adding new nested tables, don't forget to update this pattern.
+    (syntoken
+       (string-concat
+           "</("
+           "b|strong|i|em|address|pre|code|tt|small|big|a|span|div|"
+           "h1|h2|h3|h4|h5|title|font|ol|ul|dl|dt|dd|menu"
+           ")\\>")
+       :icase t :property *prop-html-unknown* :begin :unbalanced)
+    (syntable :unbalanced *prop-html-unknown* nil
+       (syntoken ">" :nospec t :switch :main)
+       (synaugment :generic-tag)
+    )
+
+    #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+    ;; XXX ONLY add a rule for "html", "head" and "body" if you want to do a
+    ;; more complete check for common errors. If you add those rules, it will
+    ;; reparse the entire file at every character typed (unless there are
+    ;; errors in which case the parser resets the state).
+    ;; For visualization only that would be OK...
+    ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||#
+
+    (html-syntoken "b")
+    (html-syntable "b" *prop-html-bold*)
+    (html-syntoken "strong")
+    (html-syntable "strong" *prop-html-bold*)
+
+    (html-syntoken "i")
+    (html-syntable "i" *prop-html-italic*)
+    (html-syntoken "em")
+    (html-syntable "em" *prop-html-italic*)
+    (html-syntoken "address")
+    (html-syntable "address" *prop-html-italic*)
+
+    (html-syntoken "pre")
+    (html-syntable "pre" *prop-html-pre*)
+    (html-syntoken "code")
+    (html-syntable "code" *prop-html-pre*)
+    (html-syntoken "tt")
+    (html-syntable "tt" *prop-html-pre*)
+
+    (html-syntoken "small")
+    (html-syntable "small" *prop-html-small*)
+
+    (html-syntoken "big")
+    (html-syntable "big" *prop-html-big*)
+
+    ;; Cannot hack html-syntoken and html-syntable to handle this,
+    ;; as the option to <a may be in the next line.
+    (syntoken "<a\\>" :icase t :contained t :begin :a)
+    (syntable :a *prop-html-tag* nil
+       ;; Tag is open
+       (syntoken "\\<href\\>" :icase t :begin :a-href)
+       (syntoken "\\<name\\>" :icase t :begin :a-name)
+       (syntoken "<" :nospec t :property *prop-html-unknown* :switch -2)
+       (synaugment :generic-tag)
+       (syntoken ">" :nospec t :begin :a-generic-text)
+       (syntable :a-href *prop-html-tag* nil
+           (syntoken ">" :nospec t :begin :a-href-text)
+           (synaugment :generic-tag)
+           (syntable :a-href-text *prop-html-link* nil
+               (syntoken "</a>"
+                   :icase t :nospec t :property *prop-html-tag* :switch -3)
+               (syntoken "</a\\s*$" :icase t :begin :continued-nested-end-tag)
+               (synaugment :main)
+           )
+       )
+       (syntable :a-name *prop-html-tag* nil
+           (syntoken ">" :nospec t :begin :a-name-text)
+           (synaugment :generic-tag)
+           (syntable :a-name-text *prop-html-name* nil
+               (syntoken "</a>"
+                   :icase t :nospec t :property *prop-html-tag* :switch -3)
+               (syntoken "</a\\s*$" :icase t :begin :continued-nested-end-tag)
+               (synaugment :main)
+           )
+       )
+       (syntable :a-generic-text nil nil
+           (syntoken "</a>"
+               :icase t :nospec t :property *prop-html-tag* :switch -2)
+           (syntoken "<a/\\s$" :icase t :begin :continued-end-tag)
+           (synaugment :main)
+       )
+    )
+
+    ;; Do nothing, just check start/end tags
+    (html-syntoken "ol")
+    (html-syntable "ol" nil)
+    (html-syntoken "ul")
+    (html-syntable "ul" nil)
+    (html-syntoken "dl")
+    (html-syntable "dl" nil)
+    ;; Maybe <dt> and <dd> should be in a special table, to not require
+    ;; and ending tag.
+    ;; XXX Maybe should also add a table for <p>.
+    (html-syntoken "dt")
+    (html-syntable "dt" nil)
+    (html-syntoken "dd")
+    (html-syntable "dd" nil)
+
+    (html-syntoken "span")
+    (html-syntable "span" nil)
+    (html-syntoken "div")
+    (html-syntable "div" nil)
+    (html-syntoken "menu")
+    (html-syntable "menu" nil)
+
+    (html-syntoken "h1")
+    (html-syntable "h1" *prop-html-h1*)
+    (html-syntoken "h2")
+    (html-syntable "h2" *prop-html-h2*)
+    (html-syntoken "h3")
+    (html-syntable "h3" *prop-html-bold*)
+    (html-syntoken "h4")
+    (html-syntable "h4" *prop-html-h4*)
+    (html-syntoken "h5")
+    (html-syntable "h5" *prop-html-h5*)
+    (html-syntoken "title")
+    (html-syntable "title" *prop-html-title*)
+
+    (html-syntoken "font")
+    (html-syntable "font" *prop-control*)
+
+    (syntoken "<" :nospec t :contained t :begin :tag)
+    (syntable :generic-tag *prop-html-tag* nil
+       (syntoken "\"" :nospec t :contained t :begin :string)
+       (syntoken "<" :nospec t :property *prop-html-unknown*)
+    )
+    (syntable :tag *prop-html-tag* nil
+       (syntoken ">" :nospec t :switch -1)
+       (synaugment :generic-tag)
+    )
+       ;; Tag ended in a newline, common practice...
+    (syntable :continued-end-tag *prop-html-tag* nil
+       (syntoken ">" :nospec t :switch -3)
+       (synaugment :generic-tag)
+    )
+    (syntable :continued-nested-end-tag *prop-html-tag* nil
+       (syntoken ">" :nospec t :switch -4)
+       (synaugment :generic-tag)
+    )
+
+    (syntable :string *prop-html-string* nil
+       (syntoken "\\\\.")
+       (syntoken "\"" :nospec t :switch -1)
+    )
+)
diff --git a/xedit/lisp/modules/progmodes/imake.lsp b/xedit/lisp/modules/progmodes/imake.lsp
new file mode 100644 (file)
index 0000000..c34860d
--- /dev/null
@@ -0,0 +1,188 @@
+;;
+;; Copyright (c) 2002 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/modules/progmodes/imake.lsp,v 1.2 2002/10/06 17:11:48 paulo Exp $
+;;
+
+(require "syntax")
+(in-package "XEDIT")
+
+(defsynprop *prop-shell*
+    "shell"
+    :font      "*courier-bold-r*-12-*"
+    :foreground        "Red4"
+)
+
+(defsynprop *prop-variable*
+    "variable"
+    :font      "*courier-medium-r*-12-*"
+    :foreground        "Red3"
+)
+
+;;  The syntax-highlight definition does not try to flag errors, just show
+;; tabs in the start of lines for better visualization.
+(defsynprop *prop-tabulation*
+    "tabulation"
+    :font      "*courier-medium-r*-12-*"
+    :background        "Gray90"
+)
+
+(defsynprop *prop-xcomm*
+    "xcomm"
+    :font      "*courier-medium-o*-12-*"
+    :foreground        "SkyBlue4"
+)
+
+
+(defsyntax *imake-mode* :main nil nil nil
+    (syntoken "^\\s*XCOMM\\W?.*$"
+       :property *prop-xcomm*)
+
+    (syntoken "^\\t+"
+       :property *prop-tabulation*)
+
+    (syntoken "$("
+       :nospec t
+       :begin :shell
+       :property *prop-shell*)
+
+    (syntoken "[][(){};$<=>&@/\\,.:~!|*?'`+-]"
+       :property *prop-shell*)
+
+    ;;  Preprocessor start rule.
+    (syntoken "^\\s*#\\s*\\w+"
+       :begin :preprocessor
+       :contained t)
+
+    ;;  Comment start rule.
+    (syntoken "/*"
+       :nospec t
+       :begin :comment
+       :contained t)
+
+    ;;  String start rule.
+    (syntoken "\""
+       :begin :string
+       :nospec t
+       :contained t)
+
+    ;;  Quoted string start rule.
+    (syntoken "\\\""
+       :begin :quoted-string
+       :nospec t
+       :contained t)
+
+    (syntable :shell *prop-variable* nil
+       (syntoken ")"
+           :nospec t
+           :property *prop-shell*
+           :switch -1)
+    )
+
+    ;;  Rules for comments.
+    (syntable :comment *prop-comment* nil
+
+       ;;  Match nested comments as an error.
+       (syntoken "/*"
+           :nospec t
+           :property *prop-error*)
+
+       (syntoken "XXX|TODO|FIXME"
+           :property *prop-annotation*)
+
+       ;;  Rule to finish a comment.
+       (syntoken "*/"
+           :nospec t
+           :switch -1)
+    )
+
+    ;;  Rules for preprocessor.
+    (syntable :preprocessor *prop-preprocessor* nil
+
+       ;;  Preprocessor includes comments.
+       (syntoken "/*"
+           :nospec t
+           :begin :comment
+           :contained t)
+
+       ;;  Visualization help, show tabs in the start of lines.
+       (syntoken "^\\t+"
+           :property *prop-tabulation*)
+
+       ;;  Ignore lines finishing with a backslash.
+       (syntoken "\\\\$")
+
+       ;;  Return to previous state if end of line found.
+       (syntoken ".?$"
+           :switch -1)
+    )
+
+    ;;  Rules for strings.
+    (syntable :string *prop-string* nil
+
+       ;;  Ignore escaped characters, this includes \".
+       (syntoken "\\\\.")
+
+       ;;  Ignore continuation in the next line.
+       (syntoken "\\\\$")
+
+       ;;  Rule to finish a string.
+       (syntoken "\""
+           :nospec t
+           :switch -1)
+
+       ;;  Don't allow strings continuing in the next line.
+       (syntoken ".?$"
+           :begin :error)
+    )
+
+    ;;  Rules for quoted strings.
+    (syntable :quoted-string *prop-constant* nil
+
+       ;;  Rule to finish the quoted string.
+       (syntoken "\\\""
+           :nospec t
+           :switch -1)
+
+       ;;  Ignore escaped characters
+       (syntoken "\\\\.")
+
+       ;;  Ignore continuation in the next line.
+       (syntoken "\\\\$")
+
+       ;;  Don't allow strings continuing in the next line.
+       (syntoken ".?$"
+           :begin :error)
+    )
+
+    (syntable :error *prop-error* nil
+       (syntoken "^.*$"
+           :switch -2)
+    )
+)
diff --git a/xedit/lisp/modules/progmodes/lisp.lsp b/xedit/lisp/modules/progmodes/lisp.lsp
new file mode 100644 (file)
index 0000000..2472b72
--- /dev/null
@@ -0,0 +1,384 @@
+;;
+;; Copyright (c) 2002 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/modules/progmodes/lisp.lsp,v 1.9 2003/01/30 02:46:26 paulo Exp $
+;;
+
+(require "syntax")
+(require "indent")
+(in-package "XEDIT")
+
+(defsynprop *prop-special*
+  "special"
+  :font                "*courier-bold-r*-12-*"
+  :foreground  "NavyBlue"
+)
+
+(defsynprop *prop-quote*
+  "quote"
+  :font                "*courier-bold-r*-12-*"
+  :foreground  "Red4"
+)
+
+(defsynprop *prop-package*
+  "package"
+  :font                "*lucidatypewriter-medium-r*-12-*"
+  :foreground  "Gold4"
+)
+
+(defsynprop *prop-unreadable*
+  "unreadable"
+  :font                "*courier-medium-r*-12-*"
+  :foreground  "Gray25"
+  :underline   t
+)
+
+(defsynoptions *lisp-DEFAULT-style*
+  ;; Positive number. Basic indentation.
+  (:indentation                        .       2)
+
+  ;; Boolean. Move cursor to the indent column after pressing <Enter>?
+  (:newline-indent             .       t)
+
+  ;; Boolean. Use spaces instead of tabs to fill indentation?
+  (:emulate-tabs               .       nil)
+
+  ;; Boolean. Remove extra spaces from previous line.
+  ;;           This should default to T when newline-indent is not NIL.
+  (:trim-blank-lines           .       t)
+
+  ;; Boolean. If this hash-table entry is set, no indentation is done.
+  ;;           Useful to temporarily disable indentation.
+  (:disable-indent             .       nil)
+)
+
+(defvar *lisp-mode-options* *lisp-DEFAULT-style*)
+
+(defindent *lisp-mode-indent* :main
+  ;; this must be the first token
+  (indtoken "^\\s*"            :indent
+    :code (or *offset* (setq *offset* (+ *ind-offset* *ind-length*))))
+  ;; ignore single line comments
+  (indtoken ";.*$"             nil)
+  ;; multiline comments
+  (indtoken "|#"               :comment        :nospec t       :begin :comment)
+  ;; characters
+  (indtoken "#\\\\(\\W|\\w+(-\\w+)?)"          :character)
+  ;; numbers
+  (indtoken
+    (string-concat
+      "(\\<|[+-])\\d+("
+      ;; integers
+      "(\\>|\\.(\\s|$))|"
+      ;; ratios
+      "/\\d+\\>|"
+      ;;floats
+      "\\.?\\d*([SsFfDdLlEe][+-]?\\d+)?\\>"
+      ")")
+    :number)
+  ;; symbols, with optional package
+  (indtoken
+    (string-concat
+      ;; optional package name and ending ':'
+      "([A-Za-z_0-9%-]+:)?"
+      ;; internal symbol if after package name, or keyword
+      ":?"
+      ;; symbol name
+      "[][{}A-Za-z_0-9!$%&/<=>^~*+-]+")
+    :symbol)
+  ;; strings in the same line
+  (indtoken "\"([^\\\"]|\\\\.)*\""             :string)
+  ;; multiline strings
+  (indtoken "\""               :cstring        :nospec t       :begin :string)
+  ;; "quoted" symbols in the same line
+  (indtoken "\\|([^\\|]|\\\\.)*\\|"            :symbol)
+  ;; multiline
+  (indtoken "|"                        :csymbol        :nospec t       :begin :symbol)
+  (indtoken "#"                        :hash           :nospec t)
+
+  (indinit     (parens 0))
+  (indtoken "("                        :oparen         :nospec t :code (incf parens))
+  (indtoken ")"                        :cparen         :nospec t :code (decf parens))
+
+  (indtable :comment
+    ;; multiline comments can nest
+    (indtoken "|#"             nil             :nospec t       :begin :comment)
+    (indtoken "#|"             nil             :nospec t       :switch -1))
+
+  (indtable :string
+    ;; Ignore escaped characters
+    (indtoken "\\."            nil)
+    ;; Return to the toplevel when the start of the string is found
+    (indtoken "\""             :ostring        :nospec t       :switch -1))
+
+  (indtable :symbol
+    ;; Ignore escaped characters
+    (indtoken "\\."            nil)
+    ;; Return to the toplevel when the start of the symbol is found
+    (indtoken "|"              :osymbol        :nospec t       :switch -1))
+
+  ;; ignore comments
+  (indreduce nil
+    t
+    ((:comment)))
+
+  ;; reduce multiline strings
+  (indreduce :string
+    t
+    ((:ostring (not :ostring) :cstring)))
+
+  ;; reduce multiline symbols
+  (indreduce :symbol
+    t
+    ((:osymbol (not :osymbol) :csymbol)))
+
+  ;; reduce basic types, don't care if inside list or not
+  (indreduce :element
+    t
+    ((:number)
+      (:string)
+      (:character)
+      (:element :element)
+      (:indent :element)))
+
+  (indreduce :symbol
+    t
+    ((:symbol :symbol)
+      (:symbol :element)
+      (:indent :symbol)))
+
+  ;; the "real" indentation value, to make easier parsing code like:
+  ;;  (foo (bar (baz (blah
+  ;;        ^         ^
+  ;;        |         |
+  ;;        indent    |
+  ;;                  effective indentation to be used
+  (indinit     (indent 0))
+
+  ;; indentation values of opening parenthesis.
+  (indinit     stack)
+
+  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+  ;; if before current line and open parenthesis >= 0, use indentation
+  ;; of current line to calculate relative indentation.
+  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+  (indreduce :oparen   ;; simple list?
+    (and (>= parens 0) (< *ind-offset* *ind-start*))
+    ((:indent :oparen))
+    (setq
+      *indent* (offset-indentation (+ *ind-offset* *ind-length*) :resolve t)
+      indent   *indent*)
+    (indent-macro-reject-left))
+
+  ;; reduce list if there isn't indentation change
+  (indreduce :element
+    t
+    ((:oparen (not :oparen) :cparen)))
+
+  (indresolve :oparen
+    (setq
+      *indent*
+      (offset-indentation
+       (+ *ind-offset* *ind-length* -1 *base-indent*) :align t))
+    (push *indent* stack)
+    (incf indent *base-indent*)
+    (if (< *indent* indent) (setq *indent* indent)))
+
+  (indresolve :cparen
+    (decf indent *base-indent*)
+    (setq *indent* (pop stack))
+    (if (null stack)
+      (setq *indent* indent)
+      (setq *indent* (car stack))))
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Find a "good" offset to start parsing backwards, so that it should
+;; always generate the same results.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun lisp-offset-indent (&aux char (point (scan (point) :eol :left)))
+  ;; skip spaces
+  (while (member (setq char (char-after point)) indent-spaces)
+    (incf point))
+  (if (member char '(#\))) (1+ point) point))
+
+(defun lisp-should-indent (options &aux char point start)
+  (when (hash-table-p options)
+    ;; check if previous line has extra spaces
+    (and (gethash :trim-blank-lines options)
+      (indent-clear-empty-line))
+
+    ;; indentation disabled?
+    (and (gethash :disable-indent options)
+      (return-from lisp-should-indent))
+
+    (setq
+      point    (point)
+      char     (char-before (point))
+      start    (scan point :eol :left))
+
+    ;; at the start of a line
+    (and (= point start)
+      (return-from lisp-should-indent (gethash :newline-indent options)))
+
+    ;; if first character
+    (and (= point (1+ start)) (return-from lisp-should-indent t))
+
+    ;; if closing parenthesis and first nonblank char
+    (when (and (characterp char) (char= char #\)))
+      (decf point)
+      (while
+       (and (> point start) (member (char-before point) indent-spaces))
+       (decf point))
+      (return-from lisp-should-indent (<= point start)))
+  )
+  ;; should not indent
+  nil)
+
+(defun lisp-indent (syntax syntable)
+  (let*
+    ((options (syntax-options syntax))
+      *base-indent*)
+
+    (or (lisp-should-indent options) (return-from lisp-indent))
+
+    (setq *base-indent* (gethash :indentation options 2))
+
+    (indent-macro
+      *lisp-mode-indent*
+      (lisp-offset-indent)
+      (gethash :emulate-tabs options))))
+
+(compile 'lisp-indent)
+
+(defsyntax *lisp-mode* :main nil #'lisp-indent *lisp-mode-options*
+  ;; highlight car and parenthesis
+  (syntoken "\\(+\\s*[][{}A-Za-z_0-9!$%&/<=>?^~*:+-]*\\)*"
+    :property *prop-keyword*)
+  (syntoken "\\)+" :property *prop-keyword*)
+
+  ;; nil and t
+  (syntoken "\\<(nil|t)\\>" :icase t :property *prop-special*)
+
+  (syntoken "|" :nospec t :begin :unreadable :contained t)
+
+  ;; keywords
+  (syntoken ":[][{}A-Za-z_0-9!$%&/<=>^~+-]+" :property *prop-constant*)
+
+  ;; special symbol.
+  (syntoken "\\*[][{}A-Za-z_0-9!$%&7=?^~+-]+\\*"
+    :property *prop-special*)
+
+  ;; special identifiers
+  (syntoken "&(aux|key|optional|rest)\\>" :icase t :property *prop-constant*)
+
+  ;; numbers
+  (syntoken
+    ;; since lisp is very liberal in what can be a symbol, this pattern
+    ;; will not always work as expected, since \< and \> will not properly
+    ;; work for all characters that may be in a symbol name
+    (string-concat
+      "(\\<|[+-])\\d+("
+      ;; integers
+      "(\\>|\\.(\\s|$))|"
+      ;; ratios
+      "/\\d+\\>|"
+      ;;floats
+      "\\.?\\d*([SsFfDdLlEe][+-]?\\d+)?\\>"
+      ")")
+    :property *prop-number*)
+
+  ;; characters
+  (syntoken "#\\\\(\\W|\\w+(-\\w+)?)" :property *prop-constant*)
+
+  ;; quotes
+  (syntoken "[`'.]|,@?" :property *prop-quote*)
+
+  ;; package names
+  (syntoken "[A-Za-z_0-9%-]+::?" :property *prop-package*)
+
+  ;; read time evaluation
+  (syntoken "#\\d+#" :property *prop-preprocessor*)
+  (syntoken "#([+'cCsS-]|\\d+[aA=])?" :begin :preprocessor :contained t)
+
+  (syntoken "\\c" :property *prop-control*)
+
+  ;; symbols, do nothing, just resolve conflicting matches
+  (syntoken "[][{}A-Za-z_0-9!$%&/<=>^~*+-]+")
+
+  (syntable :simple-comment *prop-comment* nil
+    (syntoken "$" :switch -1)
+    (syntoken "XXX|FIXME|TODO" :property *prop-annotation*))
+
+  (syntable :comment *prop-comment* nil
+    ;; comments can nest
+    (syntoken "#|" :nospec t :begin :comment)
+    ;;  return to previous state
+    (syntoken "|#" :nospec t :switch -1)
+    (syntoken "XXX|FIXME|TODO" :property *prop-annotation*))
+
+  (syntable :unreadable *prop-unreadable* nil
+    ;; ignore escaped characters
+    (syntoken "\\\\.")
+    (syntoken "|" :nospec t :switch -1))
+
+  (syntable :string *prop-string* nil
+    ;; ignore escaped characters
+    (syntoken "\\\\.")
+    (syntoken "\"" :nospec t :switch -1))
+
+  (syntable :preprocessor *prop-preprocessor* nil
+    ;; a symbol
+    (syntoken "[][{}A-Za-z_0-9!$%&/<=>^~:*+-]+" :switch -1)
+
+    ;; conditional expression
+    (syntoken "(" :nospec t :begin :preprocessor-expression :contained t)
+
+    (syntable :preprocessor-expression *prop-preprocessor* nil
+      ;; recursive
+      (syntoken "(" :nospec t :begin :preprocessor-recursive :contained t)
+      (syntoken ")" :nospec t :switch -2)
+
+      (syntable :preprocessor-recursive *prop-preprocessor* nil
+       (syntoken "(" :nospec t
+         :begin :preprocessor-recursive
+         :contained t)
+       (syntoken ")" :nospec t :switch -1)
+       (synaugment :comments-and-strings))
+      (synaugment :comments-and-strings))
+    (synaugment :comments-and-strings))
+
+  (syntable :comments-and-strings nil nil
+    (syntoken "\"" :nospec t :begin :string :contained t)
+    (syntoken "#|" :nospec t :begin :comment :contained t)
+    (syntoken ";" :begin :simple-comment :contained t))
+
+  (synaugment :comments-and-strings)
+)
diff --git a/xedit/lisp/modules/progmodes/make.lsp b/xedit/lisp/modules/progmodes/make.lsp
new file mode 100644 (file)
index 0000000..d40b18f
--- /dev/null
@@ -0,0 +1,135 @@
+;;
+;; Copyright (c) 2002 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/modules/progmodes/make.lsp,v 1.2 2002/10/06 17:11:48 paulo Exp $
+;;
+
+(require "syntax")
+(in-package "XEDIT")
+
+(defsynprop *prop-shell*
+    "shell"
+    :font      "*courier-bold-r*-12-*"
+    :foreground        "Red4"
+)
+
+(defsynprop *prop-variable*
+    "variable"
+    :font      "*courier-medium-r*-12-*"
+    :foreground        "Red3"
+)
+
+;;  The syntax-highlight definition does not try to flag errors, just show
+;; tabs in the start of lines for better visualization.
+(defsynprop *prop-tabulation*
+    "tabulation"
+    :font      "*courier-medium-r*-12-*"
+    :background        "Gray90"
+)
+
+
+(defsyntax *make-mode* :main nil nil nil
+    (syntoken "^\\t+" :property *prop-tabulation*)
+
+    (syntoken "^\\.\\w+" :property *prop-keyword*)
+
+    (syntoken "$("
+       :nospec t
+       :begin :shell
+       :property *prop-shell*)
+
+    (syntoken "[][(){};$<=>&@/\\,.:~!|*?'`+-]"
+       :property *prop-shell*)
+
+    ;;  Preprocessor start rule.
+    (syntoken "#.*"
+       :property *prop-comment*)
+
+    ;;  String start rule.
+    (syntoken "\""
+       :begin :string
+       :nospec t
+       :contained t)
+
+    ;;  Quoted string start rule.
+    (syntoken "\\\""
+       :begin :quoted-string
+       :nospec t
+       :contained t)
+
+    (syntable :shell *prop-variable* nil
+       (syntoken ")"
+           :nospec t
+           :property *prop-shell*
+           :switch -1)
+    )
+
+    ;;  Rules for strings.
+    (syntable :string *prop-string* nil
+
+       ;;  Ignore escaped characters, this includes \".
+       (syntoken "\\\\.")
+
+       ;;  Ignore continuation in the next line.
+       (syntoken "\\\\$")
+
+       ;;  Rule to finish a string.
+       (syntoken "\""
+           :nospec t
+           :switch -1)
+
+       ;;  Don't allow strings continuing in the next line.
+       (syntoken ".?$"
+           :begin :error)
+    )
+
+    ;;  Rules for quoted strings.
+    (syntable :quoted-string *prop-constant* nil
+
+       ;;  Rule to finish the quoted string.
+       (syntoken "\\\""
+           :nospec t
+           :switch -1)
+
+       ;;  Ignore escaped characters
+       (syntoken "\\\\.")
+
+       ;;  Ignore continuation in the next line.
+       (syntoken "\\\\$")
+
+       ;;  Don't allow strings continuing in the next line.
+       (syntoken ".?$"
+           :begin :error)
+    )
+
+    (syntable :error *prop-error* nil
+       (syntoken "^.*$"
+           :switch -2)
+    )
+)
diff --git a/xedit/lisp/modules/progmodes/man.lsp b/xedit/lisp/modules/progmodes/man.lsp
new file mode 100644 (file)
index 0000000..45c6590
--- /dev/null
@@ -0,0 +1,160 @@
+;;
+;; Copyright (c) 2002 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/modules/progmodes/man.lsp,v 1.2 2002/10/06 17:11:48 paulo Exp $
+;;
+
+(require "syntax")
+(in-package "XEDIT")
+
+(defsynprop *prop-man-b*
+    "b"
+    :font      "*courier-bold-r*-12-*"
+    :foreground        "gray12"
+)
+
+(defsynprop *prop-man-i*
+    "i"
+    :font      "*courier-medium-o*-12-*"
+    :foreground        "black"
+)
+
+(defsynprop *prop-man-bi*
+    "bi"
+    :font      "*courier-bold-o*-12-*"
+    :foreground        "gray20"
+)
+
+(defsynprop *prop-man-th*
+    "th"
+    :font      "-*-courier-*-*-*-*-18-*-*-*-*-*-*-1"
+    :foreground        "Red3"
+)
+
+(defsynprop *prop-man-sh*
+    "sh"
+    :font      "-*-courier-*-*-*-*-14-*-*-*-*-*-*-1"
+    :foreground        "OrangeRed3"
+)
+
+(defsynprop *prop-man-ss*
+    "ss"
+    :font      "-*-courier-*-*-*-*-12-*-*-*-*-*-*-1"
+    :foreground        "Gold4"
+)
+
+(defsynprop *prop-man-escape*
+    "escape"
+    :font      "*lucidatypewriter-medium-r*-12-*"
+    :foreground        "RoyalBlue4"
+)
+
+(defsynprop *prop-man-string*
+    "string"
+    :font      "*lucidatypewriter-bold-r*-12-*"
+    :foreground        "RoyalBlue3"
+;    :underline        t
+)
+
+(defmacro man-syntoken (pattern)
+    `(syntoken (string-concat "^\\.(" ,pattern ")(\\s+|$)")
+       :icase t
+;      :contained t
+       :property *prop-preprocessor*
+       :begin (intern (string ,pattern) 'keyword)))
+
+(defmacro man-syntable (pattern property)
+    `(syntable (intern (string ,pattern) 'keyword) ,property nil
+       (syntoken "$" :switch -1)
+       (synaugment :extras)))
+
+
+(defsyntax *man-mode* :main nil nil nil
+    (syntoken "^\\.\\\\\".*"
+       :property *prop-comment*)
+
+    (man-syntoken "b|br|nm")
+    (man-syntable "b|br|nm" *prop-man-b*)
+
+    (man-syntoken "i|ir|ri|ip")
+    (man-syntable "i|ir|ri|ip" *prop-man-i*)
+
+    (man-syntoken "th|dt")
+    (man-syntable "th|dt" *prop-man-th*)
+
+    (man-syntoken "sh")
+    (man-syntable "sh" *prop-man-sh*)
+
+    (man-syntoken "ss")
+    (man-syntable "ss" *prop-man-ss*)
+
+    (man-syntoken "bi")
+    (man-syntable "bi" *prop-man-bi*)
+
+    ;; Anything not matched...
+    (syntoken "^\\.[a-z][a-z](\\s+|$)"
+       :icase t
+       :property *prop-preprocessor*)
+
+    (syntable :extras nil nil
+       (syntoken "\\<__\\l+__\\>"
+           :property *prop-constant*)
+       (syntoken "\\\\fB"
+           :property *prop-preprocessor*
+           :begin :b)
+       (syntoken "\\\\fI"
+           :property *prop-preprocessor*
+           :begin :i)
+       (syntoken "\\\\f\\u"
+           :property *prop-preprocessor*)
+
+       (syntoken "\\\\\\*?."
+           :property *prop-man-escape*)
+
+       (syntoken "\""
+           :property *prop-man-string*)
+
+       (syntable :i *prop-man-i* nil
+           (syntoken "$"
+               :switch :main)
+           (syntoken "\\\\f\\u"
+               :property *prop-preprocessor*
+               :switch -1)
+       )
+       (syntable :b *prop-man-b* nil
+           (syntoken "$"
+               :switch :main)
+           (syntoken "\\\\f\\u"
+               :property *prop-preprocessor*
+               :switch -1)
+       )
+    )
+
+    (synaugment :extras)
+)
diff --git a/xedit/lisp/modules/progmodes/patch.lsp b/xedit/lisp/modules/progmodes/patch.lsp
new file mode 100644 (file)
index 0000000..d89bc39
--- /dev/null
@@ -0,0 +1,55 @@
+;;
+;; Copyright (c) 2003 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86$
+;;
+
+(require "syntax")
+(require "indent")
+(in-package "XEDIT")
+
+(defsyntax *patch-mode* :main nil #'default-indent nil
+  ;; "normal" diff
+  (syntoken "^(\\d+d\\d+|\\d+a\\d+,\\d+)$" :property *prop-keyword*)
+  (syntoken "^<.*" :property *prop-constant*)
+  (syntoken "^>.*" :property *prop-preprocessor*)
+  
+  ;; context diff
+  (syntoken "^\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*"
+    :property *prop-string*)
+  (syntoken "^\\*\\*\\* \\d+,\\d+ \\*\\*\\*\\*" :property *prop-comment*)
+  (syntoken "^--- \\d+,\\d+ ----" :property *prop-comment*)
+
+  ;; headers
+  (syntoken "^(---|\\+\\+\\+|\\*\\*\\*).*" :property *prop-keyword*)
+
+  (syntoken "^@@ .*" :property *prop-comment*)
+  (syntoken "^-.*" :property *prop-constant*)
+  (syntoken "^\\+.*" :property *prop-preprocessor*)
+)
diff --git a/xedit/lisp/modules/progmodes/perl.lsp b/xedit/lisp/modules/progmodes/perl.lsp
new file mode 100644 (file)
index 0000000..25a62c5
--- /dev/null
@@ -0,0 +1,507 @@
+;; Copyright (c) 2007,2008 Paulo Cesar Pereira de Andrade
+;;
+;; 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 (including the next
+;; paragraph) 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.
+;;
+;; Author: Paulo Cesar Pereira de Andrade
+;;
+
+;;   Perl syntax and indentation mode
+;;   Based on the C/C++ and Lisp modes. Attempting to make simple
+;; syntax/indentation rules, that should work correctly with most
+;; perl code.
+
+;;  *cont-indent* is somewhat buggy, that if pressing C-A,Tab, will
+;; not generate the same output as when normally typing the expression.
+;;  This is because the parser doesn't search for a matching ';', '{',
+;; '[' or '(' to know where the expression starts. The C mode has the
+;; same problem. Example:
+;;     a +
+;;         b;  <-- if pressing C-A,Tab will align "b;" with "a +"
+
+;;  Maybe most of the code here, and some code in the C mode could be
+;; merged to have a single "default mode" parser for languages that
+;; basically only depend on { and } for indentation.
+
+(require "syntax")
+(require "indent")
+(in-package "XEDIT")
+
+;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+(defsynprop *prop-string-escape*
+  "string-escape"
+  :font                "*lucidatypewriter-bold-r*-12-*"
+  :foreground  "RoyalBlue2"
+  :underline   t)
+
+(defsynprop *prop-string-keyword-bold*
+  "string-variable-bold"
+  :font                "*lucidatypewriter-bold-r*-12-*"
+  :foreground  "RoyalBlue4")
+
+(defsynprop *prop-string-keyword*
+  "string-variable"
+  :font                "*lucidatypewriter-medium-r*-12-*"
+  :foreground  "RoyalBlue4")
+
+(defsynprop *prop-constant-escape*
+  "constant-escape"
+  :font                "*lucidatypewriter-medium-r*-12-*"
+  :foreground  "VioletRed3"
+  :underline   t)
+
+(defsynprop *prop-regex*
+  "regex"
+  :font                "*courier-medium-o*-12-*"
+  :foreground  "black")
+
+(defsynprop *prop-shell*
+  "shell"
+  :font                "*lucidatypewriter-medium-r*-12-*"
+  :foreground  "red3")
+
+(defsynprop *prop-shell-escape*
+  "shell-escape"
+  :font                "*lucidatypewriter-bold-r*-12-*"
+  :foreground  "red3"
+  :underline   t)
+
+(defsynprop *prop-documentation*
+  "documentation"
+  :font                "fixed"
+  :foreground  "black"
+  :background  "rgb:e/e/e"
+)
+
+
+;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+(defsynoptions *perl-DEFAULT-style*
+  ;; Positive number. Basic indentation
+  (:indentation                .       4)
+
+  ;; Boolean. Add one indentation level to continuations?
+  (:cont-indent                .       t)
+
+  ;; Boolean. Move cursor to the indent column after pressing <Enter>?
+  (:newline-indent     .       t)
+
+  ;; Boolean. Set to T if tabs shouldn't be used to fill indentation.
+  (:emulate-tabs       .       nil)
+
+  ;; Boolean. Only calculate indentation after pressing <Enter>?
+  ;;           This may be useful if the parser does not always
+  ;;           do what the user expects...
+  (:only-newline-indent        .       nil)
+
+  ;; Boolean. Remove extra spaces from previous line.
+  ;;           This should default to T when newline-indent is not NIL.
+  (:trim-blank-lines   .       t)
+
+  ;; Boolean. If this hash-table entry is set, no indentation is done.
+  ;;           Useful to temporarily disable indentation.
+  (:disable-indent     .       nil))
+
+
+
+;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+(defvar *perl-mode-options* *perl-DEFAULT-style*)
+
+;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+;; Parenthesis are usually not required, just distinguish as:
+;; expression: code without an ending ';'
+;; statement:  code ending in a ';'
+;; block:      code enclosed in '{' and '}'
+;; In Perl a simpler logic can be used, unlikely the C mode, as in
+;; perl braces are mandatory
+(defindent *perl-mode-indent* :main
+  ;; this must be the first token
+  (indtoken "^\\s*" :indent
+    :code (or *offset* (setq *offset* (+ *ind-offset* *ind-length*))))
+  ;; this may cause some other patterns to fail, due to matching single \'
+  (indtoken "(&?(\\w+)|&(\\w+)?)'\\w+" :expression)
+  ;; special variables
+  (indtoken "\\$(\\d|^\\u|[][0-9!#$*()_@<>?/|,\"'])" :expression)
+  ;; ignore comments
+  (indtoken "#.*$" nil)
+  ;; treat regex as expressions to avoid confusing parser
+  (indtoken "m?/([^/]|\\\\/)+/\\w*" :expression)
+  (indtoken "m\\{[^}]+\\}\\w*" :expression)
+  (indtoken "m<[^>]+>\\w*" :expression)
+  (indtoken "(s|tr)/[^/]+/([^/]|\\\\/)*/\\w*" :expression)
+  (indtoken "//" :expression :nospec t)
+  ;; fast resolve deferences to expressions
+  (indtoken "[$@%&*]?\\{\\$?\\S+\\}" :expression)
+
+  (indtoken "($%@*)?\\w+" :expression)
+  (indtoken ";" :semi :nospec t)
+  (indinit (braces 0))
+  (indtoken "{" :obrace :nospec t
+    :code (decf braces))
+  (indtoken "}" :cbrace :nospec t
+    :code (incf braces))
+  (indinit (parens&bracks 0))
+  (indtoken ")" :cparen :nospec t :code (incf parens&bracks))
+  (indtoken "(" :oparen        :nospec t :code (decf parens&bracks))
+  (indtoken "]" :cbrack        :nospec t :code (incf parens&bracks))
+  (indtoken "[" :obrack        :nospec t :code (decf parens&bracks))
+  ;; if in the same line, reduce now, this must be done because the
+  ;; delimiters are identical
+  (indtoken "'([^\\']|\\\\.)*'" :expression)
+  (indtoken "\"([^\\\"]|\\\\.)*\"" :expression)
+  (indtoken "\"" :cstring1 :nospec t :begin :string1)
+  (indtoken "'" :cstring2 :nospec t :begin :string2)
+  ;; This must be the last rule
+  (indtoken "\\s*$"            :eol)
+
+  (indtable :string1
+    ;; Ignore escaped characters
+    (indtoken "\\." nil)
+    ;; Return to the toplevel when the start of the string is found
+    (indtoken "\"" :ostring1 :nospec t :switch -1))
+  (indtable :string2
+    (indtoken "\\." nil)
+    (indtoken "'" :ostring2 :nospec t :switch -1))
+
+  ;; This avoids some problems with *cont-indent* adding an indentation
+  ;; level to an expression after an empty line
+  (indreduce nil
+    t
+    ((:indent :eol)))
+
+  ;; Reduce to a single expression token
+  (indreduce :expression
+    t
+    ((:indent :expression)
+      (:expression :eol)
+      (:expression :parens)
+      (:expression :bracks)
+      (:expression :expression)
+      ;; multiline strings
+      (:ostring1 (not :ostring1) :cstring1)
+      (:ostring2 (not :ostring2) :cstring2)
+      ;; parenthesis and brackets
+      (:oparen (not :oparen) :cparen)
+      (:obrack (not :obrack) :cbrack)))
+
+  ;; Statements end in a semicollon
+  (indreduce :statement
+    t
+    ((:semi)
+      (:indent :semi)
+      (:expression :statement)
+      (:statement :eol)
+      ;; Doesn't necessarily end in a semicollon
+      (:expression :block)))
+
+  (indreduce :block
+    t
+    ((:obrace (not :obrace) :cbrace)
+      (:block :eol)))
+  (indreduce :obrace
+    (< *ind-offset* *ind-start*)
+    ((:indent :obrace))
+    (setq *indent* (offset-indentation (+ *ind-offset* *ind-length*) :resolve t))
+    (indent-macro-reject-left))
+
+  ;; Try to do an smart indentation on open parenthesis and brackets
+  (indreduce :parens
+    t
+    ((:oparen (not :oparen) :cparen))
+    (when (and
+           (< *ind-offset* *ind-start*)
+           (> (+ *ind-offset* *ind-length*) *ind-start*))
+      (setq *indent* (1+ (offset-indentation *ind-offset* :align t)))
+      (indent-macro-reject-left)))
+  (indreduce :bracks
+    t
+    ((:obrack (not :obrack) :cbrack))
+    (when (and
+           (< *ind-offset* *ind-start*)
+           (> (+ *ind-offset* *ind-length*) *ind-start*))
+      (setq *indent* (1+ (offset-indentation *ind-offset* :align t)))
+      (indent-macro-reject-left)))
+
+  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+  ;; Assuming previous lines have correct indentation, try to
+  ;; fast resolve brace indentation
+  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+  ;; Line ended with an open brace
+  (indreduce :obrace
+    (< *ind-offset* *ind-start*)
+    ((:expression :obrace))
+    (setq *indent* (offset-indentation *ind-offset* :resolve t))
+    (indent-macro-reject-left))
+  ;; Line starts with an open brace
+  (indreduce nil
+    (< *ind-offset* *ind-start* (+ *ind-offset* *ind-length*))
+    ;; Just set initial indentation
+    ((:indent :obrace))
+    (setq
+      *indent* (- (offset-indentation *ind-offset* :resolve t) *base-indent*))
+    (indent-macro-reject-left))
+
+  (indresolve :statement
+    (when (< *ind-offset* *ind-start*)
+      (while (> braces 0)
+       (setq
+         *indent*      (- *indent* *base-indent*)
+         braces        (1- braces)))))
+
+  (indresolve :obrace
+    (and (< *ind-offset* *ind-start*)
+      (incf *indent* *base-indent*)))
+  (indresolve :cbrace
+    (decf *indent* *base-indent*))
+  (indresolve :expression
+    (and
+      *cont-indent*
+      (> *indent* 0)
+      (zerop parens&bracks)
+      (< *ind-offset* *ind-start*)
+      (> (+ *ind-offset* *ind-length*) *ind-start*)
+      (incf *indent* *base-indent*)))
+
+  (indresolve (:oparen :obrack)
+    (and (< *ind-offset* *ind-start*)
+      (setq *indent* (1+ (offset-indentation *ind-offset* :align t)))))
+)
+
+;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+(defun perl-offset-indent (&aux char (point (point)))
+  ;; Skip spaces forward
+  (while (member (setq char (char-after point)) indent-spaces)
+    (incf point))
+  (if (member char '(#\})) (1+ point) point))
+
+(compile 'perl-offset-indent)
+
+;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+(defun perl-should-indent (options &aux char point start offset)
+  (when (hash-table-p options)
+    ;; check if previous line has extra spaces
+    (and (gethash :trim-blank-lines options)
+      (indent-clear-empty-line))
+
+    ;; indentation disabled?
+    (and (gethash :disable-indent options)
+      (return-from perl-should-indent))
+
+    (setq
+      point    (point)
+      char     (char-before point)
+      start    (scan point :eol :left))
+
+    ;; if at bol and should indent only when starting a line
+    (and (gethash :only-newline-indent options)
+      (return-from perl-should-indent (= point start)))
+
+    ;; at the start of a line
+    (and (= point start)
+      (return-from perl-should-indent (gethash :newline-indent options)))
+
+    ;; if first character
+    (and (= point (1+ start))
+      (return-from perl-should-indent t))
+
+    ;; check if is the first non-blank character in a new line
+    (when (and
+           (gethash :cont-indent options)
+           (= point (scan point :eol :right))
+           (alphanumericp char))
+      (setq offset (1- point))
+      (while (and
+              (> offset start)
+              (member (char-before offset) indent-spaces))
+       (decf offset))
+      ;; line has only one character with possible spaces before it
+      (and (<= offset start)
+       (return-from perl-should-indent t)))
+
+    ;; if one of these was typed, should check indentation
+    (if (member char '(#\})) (return-from perl-should-indent t))
+  )
+  ;; Should not indent
+  nil)
+
+(compile 'perl-should-indent)
+
+;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+(defun perl-indent (syntax syntable)
+  (let*
+    ((options (syntax-options syntax))
+      *base-indent*
+      *cont-indent*)
+
+    (or (perl-should-indent options) (return-from perl-indent))
+    (setq
+      *base-indent* (gethash :indentation options 4)
+      *cont-indent* (gethash :cont-indent options t))
+
+    (indent-macro
+      *perl-mode-indent*
+      (perl-offset-indent)
+      (gethash :emulate-tabs options))))
+
+(compile 'perl-indent)
+
+;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+;; some example macros to easily add new patterns for strings and possibly
+;; regex or other patterns
+(defmacro perl-q-string-token (token)
+  `(syntoken (string-concat "\\<q(q|w)?\\s*\\" ,token)
+     :icase t :contained t :begin
+     (intern (string-concat "string" ,token) 'keyword)))
+(defmacro perl-q-string-table (start end)
+  `(syntable (intern (string-concat "string" ,start) 'keyword)
+     *prop-string* #'default-indent
+     (syntoken ,end :nospec t :switch -1)
+     (synaugment :inside-string)))
+
+;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+(defsyntax *perl-mode* :main nil #'perl-indent *perl-mode-options*
+  ;; keywords
+  (syntoken
+    (string-concat
+      "\\<("
+      "and|for|foreach|gt|if|else|elsif|eq|goto|le|lt|last|ne|"
+      "neg|next|not|or|return|shift|sub|unless|unshift|until|while"
+      ")\\>")
+    :property *prop-keyword*)
+
+  ;; pseudo keywords
+  (syntoken
+    (string-concat
+      "\\<("
+      "BEGIN|END|bless|blessed|defined|delete|eval|local|my|our|"
+      "package|require|undef|use"
+      ")\\>")
+    :property *prop-preprocessor*)
+  ;; this may cause some other patterns to fail, due to matching single \'
+  (syntoken "(&?(\\w+)|&(\\w+)?)'\\w+" :property *prop-preprocessor*)
+
+  ;; numbers
+  (syntoken
+    (string-concat
+      "\\<("
+      ;; Integers
+      "(\\d+|0x\\x+)|"
+      ;; Floats
+      "\\d+\\.?\\d*(e[+-]?\\d+)?"
+      ")\\>")
+    :icase t
+    :property *prop-number*)
+
+  ;; special variables
+  (syntoken "\\$(\\d|^\\u|[][0-9!#$*()_@<>?/|,\"'])" :property *prop-keyword*)
+
+  ;; also match variables
+  (syntable :inside-string nil nil
+    ;; escaped characters
+
+    ;; XXX This pattern was matching the empty string and entering an
+    ;; infinite loop in code like:
+#|
+---%<---
+"              <-- *** if an backslash is added it fails. Inverting
+a";                 *** the pattern fixed the problem, but was the wrong
+---%<---           *** solution. Note that C-G stops the interpreter, and
+                   *** special care must be taken with patterns matching
+                   *** empty strings.
+|#
+
+    (syntoken "\\\\\\d{3}|\\\\." :property *prop-string-escape*)
+    (syntoken "(\\{\\$|\\$\\{)" :property *prop-string-keyword-bold* :begin :string-varbrace)
+    (syntoken "[$@]" :property *prop-string-keyword-bold* :begin :string-variable)
+    (syntoken "\\$(\\d|^\\u|[][0-9!#$*()_@<>?/|,\"'])" :property *prop-string-keyword-bold*))
+
+  ;; variables insided strings
+  (syntable :string-variable *prop-string-keyword* nil
+    (syntoken "\\w+" :switch -1))
+  (syntable :string-varbrace *prop-string-keyword* nil
+    (syntoken          "}"
+      :nospec          t
+      :property        *prop-string-keyword-bold*
+      :switch          -1)
+    (synaugment :inside-string))
+
+  ;; comments
+  (syntoken "#.*$" :property *prop-comment*)
+
+  ;; regex
+  (syntoken "(\\<m)?/([^/]|\\\\/)+/\\w*"       :property *prop-regex*)
+  (syntoken "\\<m\\{[^}]+\\}\\w*"              :property *prop-regex*)
+  (syntoken "\\<m<[^>]+>\\w*"                  :property *prop-regex*)
+  (syntoken "\\<(s|tr)/[^/]+/([^/]|\\\\/)*/\\w*":property *prop-regex*)
+  ;; just to avoid confusing the parser on something like split //, ...
+  (syntoken "//" :nospec t                     :property *prop-regex*)
+
+  ;; strings
+  (syntoken "\"" :nospec t :contained t :begin :string)
+  (syntable :string *prop-string* #'default-indent
+    (syntoken "\"" :nospec t :switch -1)
+    (synaugment :inside-string))
+
+  ;; more strings
+  (perl-q-string-token "{")
+  (perl-q-string-table "{" "}")
+  (perl-q-string-token "[")
+  (perl-q-string-table "[" "]")
+  (perl-q-string-token "(")
+  (perl-q-string-table "(" ")")
+  (perl-q-string-token "/")
+  (perl-q-string-table "/" "/")
+
+  ;; yet more strings
+  (syntoken "'" :nospec t :contained t :begin :constant)
+  (syntable :constant *prop-constant* #'default-indent
+    (syntoken "'"      :nospec t :switch -1)
+    (syntoken "\\\\." :property *prop-string-escape*))
+
+  ;; shell commands
+  (syntoken "`" :nospec t :contained t :begin :shell)
+  (syntable :shell *prop-shell* #'default-indent
+    (syntoken "`"      :nospec t :switch -1)
+    (synaugment :inside-string))
+
+  ;; punctuation
+  (syntoken "[][$@%(){}/*+:;=<>,&!|^~\\.?-]" :property *prop-punctuation*)
+  (syntoken "\\<x\\>" :property *prop-punctuation*)
+
+  ;; primitive faked heredoc support, doesn't match the proper string, just
+  ;; expects an uppercase identifier in a single line
+  (syntoken "<<\"[A-Z][A-Z0-9_]+\"" :property *prop-string* :begin :heredoc)
+  (syntoken "<<'[A-Z][A-Z0-9_]+'" :property *prop-constant* :begin :heredoc)
+  (syntoken "<<[A-Z][A-Z0-9_]+" :property *prop-preprocessor* :begin :heredoc)
+  (syntable :heredoc *prop-documentation* #'default-indent
+    (syntoken "^[A-Z][A-Z0-9_]+$" :switch -1))
+
+  (syntoken "^=(pod|item|over|head\\d)\\>.*$" :property *prop-documentation* :begin :info)
+  (syntable :info *prop-documentation* nil
+    (syntoken "^=cut\\>.*$"    :switch -1)
+    (syntoken "^.*$"))
+
+  (syntoken "^(__END__|__DATA__)$" :property *prop-documentation*
+    :begin :documentation)
+
+  (syntoken "__\\u+__" :property *prop-preprocessor*)
+
+  (syntable :documentation *prop-documentation* nil
+    (syntoken "^.*$"))
+
+)
diff --git a/xedit/lisp/modules/progmodes/python.lsp b/xedit/lisp/modules/progmodes/python.lsp
new file mode 100644 (file)
index 0000000..ff70856
--- /dev/null
@@ -0,0 +1,306 @@
+;; Copyright (c) 2008 Paulo Cesar Pereira de Andrade
+;;
+;; 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 (including the next
+;; paragraph) 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.
+;;
+;; Author: Paulo Cesar Pereira de Andrade
+;;
+
+(require "syntax")
+(require "indent")
+(in-package "XEDIT")
+
+;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+(defsynprop *prop-indent*
+  "indent"
+  :font                "*courier-medium-r*-12-*"
+  :background  "Gray92")
+
+;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+(defsynoptions *python-DEFAULT-options*
+  ;; Positive number. Basic indentation
+  (:indentation                .       4)
+
+  ;; Boolean. Move cursor to the indent column after pressing <Enter>?
+  (:newline-indent     .       t)
+
+  ;; Boolean. Set to T if tabs shouldn't be used to fill indentation.
+  (:emulate-tabs       .       t)
+
+  ;; Boolean. Only calculate indentation after pressing <Enter>?
+  ;;           This may be useful if the parser does not always
+  ;;           do what the user expects...
+  (:only-newline-indent        .       nil)
+
+  ;; Boolean. Remove extra spaces from previous line.
+  ;;           This should default to T when newline-indent is not NIL.
+  (:trim-blank-lines   .       nil)
+
+  ;; Boolean. If this hash-table entry is set, no indentation is done.
+  ;;           Useful to temporarily disable indentation.
+  (:disable-indent     .       nil))
+
+
+;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+;;   Not doing "special" indentation of multiline ( because it is attempting
+;; to do a "smart" indentation and usually don't read more then one line
+;; back to resolve indentation.
+;;   Code for multiline { and [, usually declaring vector/hash like variables
+;; should be working properly.
+;;   Note that the indent lisp hook is only run on character additions, so
+;; it doesn't do a "smart" tabbing when pressing backspace, but it will
+;; properly align to the "closest tab stop" when typping a character.
+(defindent *python-mode-indent* :main
+  ;; this must be the first token
+  (indtoken "^\\s*" :indent
+    :code (or *offset* (setq *offset* (+ *ind-offset* *ind-length*))))
+
+  ;; ignore comments
+  (indtoken "#.*$" nil)
+
+  (indtoken ":" :collon :nospec t)
+
+  ;; don't directly match {}, [], () strings, and :
+  (indtoken "[a-zA-Z0-9+*/%^&<>=.,|!~-]+" :expression)
+
+  ;; if in the same line, reduce now, as delimiters are identical
+  (indtoken "'([^\\']|\\\\.)*'" :expression)
+  (indtoken "\"([^\\\"]|\\\\.)*\"" :expression)
+  ;; otherwise, use a table
+  (indtoken "\"" :cstring :nospec t :begin :string)
+  (indtoken "'" :cconstant :nospec t :begin :constant)
+  (indtoken "\"\"\"" :cstring3 :nospec t :begin :string3)
+  (indtoken "'''" :cconstant :nospec t :begin :constant3)
+
+  (indinit (braces 0))
+  (indtoken "}" :cbrace :nospec t :code (incf braces))
+  (indtoken "{" :obrace        :nospec t :code (decf braces))
+  (indtoken ")" :cparen :nospec t :code (incf braces))
+  (indtoken "(" :oparen        :nospec t :code (decf braces))
+  (indtoken "]" :cbrack        :nospec t :code (incf braces))
+  (indtoken "[" :obrack        :nospec t :code (decf braces))
+
+  ;; This must be the last token
+  (indtoken "$"                :eol)
+
+  (indtable :string
+    ;; Ignore escaped characters
+    (indtoken "\\." nil)
+    ;; Return to the toplevel when the start of the string is found
+    (indtoken "\"" :ostring :nospec t :switch -1))
+  (indtable :constant
+    (indtoken "\\." nil)
+    (indtoken "'" :oconstant :nospec t :switch -1))
+
+  (indtable :string3
+    (indtoken "\"\"\"" :ostring3 :nospec t :switch -1))
+  (indtable :constant3
+    (indtoken "'''" :oconstant3 :nospec t :switch -1))
+
+  ;; Reduce what isn't reduced in regex pattern match
+  (indreduce :expression
+    t
+    ((:expression :expression)
+      ;; multiline strings
+      (:ostring (not :ostring) :cstring)
+      (:oconstant (not :oconstant) :cconstant)
+      (:ostring3 (not :ostring3) :cstring3)
+      (:oconstant3 (not :oconstant3) :cconstant3)
+      ;; braces, parenthesis and brackets
+      (:obrace (not :obrace) :cbrace)
+      (:oparen (not :oparen) :cparen)
+      (:obrack (not :obrack) :cbrack)))
+
+  ;; This should be the most common exit point;
+  ;; just copy previous line indentation.
+  (indreduce :align
+    (< *ind-offset* *ind-start*)
+    ((:indent :eol)
+      (:indent :expression :eol))
+    (setq *indent* (offset-indentation *offset* :resolve t))
+
+    ;; If cursor is not in an indentation tab, assume user is trying to align
+    ;; to another block, and just use the resolve code to round it down
+    (unless (/= (mod *indent* *base-indent*) 0)
+      ;; else use "previous-line" indentation.
+      (setq *indent* (offset-indentation *ind-offset* :resolve t)))
+    (indent-macro-reject-left))
+
+  ;; This should be second most common exit point;
+  ;; add one indentation level.
+  (indreduce :align
+    (< *ind-offset* *ind-start*)
+    ((:indent :expression :collon :eol))
+    (setq *indent* (+ *base-indent* (offset-indentation *ind-offset* :resolve t)))
+    (indent-macro-reject-left))
+
+  (indresolve :align
+    (setq *indent* (- *indent* (mod *indent* *base-indent*))))
+
+  ;; Calculate special indentation for [ and {
+  (indresolve (:obrack :obrace)
+    (and
+      (< *ind-offset* *ind-start*)
+      (setq *indent* (+ *base-indent*
+                      (offset-indentation *ind-offset* :resolve t)))))
+  (indresolve (:cbrack :cbrace)
+    (setq *indent* (- (offset-indentation *ind-offset* :resolve t)
+                    (if (>= *ind-offset* *ind-start*)
+                      *base-indent* 0))))
+)
+
+
+;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+(defun python-offset-indent (&aux char (point (point)))
+  ;; Skip spaces forward
+  (while (member (setq char (char-after point)) indent-spaces)
+    (incf point))
+  point)
+
+(compile 'python-offset-indent)
+
+;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+(defun python-should-indent (options &aux point start end offset)
+  (when (hash-table-p options)
+    ;; check if previous line has extra spaces
+    (and (gethash :trim-blank-lines options)
+      (indent-clear-empty-line))
+
+    ;; indentation disabled?
+    (and (gethash :disable-indent options)
+      (return-from python-should-indent))
+
+    (setq
+      point    (point)
+      start    (scan point :eol :left)
+      end      (scan point :eol :right))
+
+    ;; if at bol and should indent only when starting a line
+    (and (gethash :only-newline-indent options)
+      (return-from python-should-indent (= point start)))
+
+    ;; at the start of a line
+    (and (= point start)
+      (return-from python-should-indent (gethash :newline-indent options)))
+
+    ;; if first character
+    (and (= point (1+ start))
+      (return-from python-should-indent t))
+
+    (setq offset start)
+    (while (and
+            (< offset end)
+            (member (char-after offset) indent-spaces))
+      (incf offset))
+
+    ;; cursor is at first character in line, with possible spaces before it
+    (return-from python-should-indent (or (= offset end) (= offset (1- point))))
+  )
+  ;; Should not indent
+  nil)
+
+(compile 'python-should-indent)
+
+;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+(defun python-indent (syntax syntable)
+  (let*
+    ((options (syntax-options syntax))
+      *base-indent*)
+
+    (or (python-should-indent options) (return-from python-indent))
+    (setq
+      *base-indent* (gethash :indentation options 4))
+
+    (indent-macro
+      *python-mode-indent*
+      (python-offset-indent)
+      (gethash :emulate-tabs options))))
+
+(compile 'python-indent)
+
+
+;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+(defvar *python-mode-options* *python-DEFAULT-options*)
+
+
+;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+(defsyntax *python-mode* :main nil #'python-indent *python-mode-options*
+  ;; keywords
+  (syntoken
+    (string-concat
+      "\\<("
+      "and|break|class|continue|def|del|enumerate|except|False|for|"
+      "elif|else|if|in|is|len|None|not|or|pass|print|raise|range|"
+      "return|self|True|try|type|while|yield"
+      ")\\>")
+    :property *prop-keyword*)
+
+  (syntoken "^\\s+" :property *prop-indent*)
+
+  ;; preprocessor like
+  (syntoken
+    (string-concat
+      "\\<("
+      "from|import"
+      ")\\>")
+    :property *prop-preprocessor*)
+
+  ;; namespaces/accessors
+  (syntoken "(\\w+\\.)+" :property *prop-preprocessor*)
+
+  ;; more preprocessor like
+  (syntoken "\\<__[a-zA-Z0-9]+__\\>" :property *prop-keyword*)
+
+  ;; numbers
+  (syntoken
+    (string-concat
+      "\\<("
+      ;; Integers
+      "(\\d+|0x\\x+)L?|"
+      ;; Floats
+      "\\d+\\.?\\d*(e[+-]?\\d+)?"
+      ")\\>")
+    :icase t
+    :property *prop-number*)
+
+  ;; comments
+  (syntoken "#.*" :property *prop-comment*)
+
+  ;; punctuation
+  (syntoken "[][(){}+*/%^&<>=.,|!~:-]+" :property *prop-punctuation*)
+
+  ;; constant or constant like
+  (syntoken "'" :nospec t :property *prop-constant* :begin :constant)
+  (syntoken "'''" :nospec t :property *prop-constant* :begin :constant3)
+
+  ;; strings
+  (syntoken "\"" :nospec t :property *prop-string* :begin :string)
+  (syntoken "\"\"\"" :nospec t :property *prop-string* :begin :string3)
+
+  (syntable :constant *prop-constant* nil
+    (syntoken "\\\\.")
+    (syntoken "'" :nospec t :switch -1))
+  (syntable :constant3 *prop-constant* nil
+    (syntoken "'''" :nospec t :switch -1))
+  (syntable :string *prop-string* nil
+    (syntoken "\\\\.")
+    (syntoken "\"" :nospec t :switch -1))
+  (syntable :string3 *prop-string* nil
+    (syntoken "\"\"\"" :nospec t :switch -1))
+)
diff --git a/xedit/lisp/modules/progmodes/rpm.lsp b/xedit/lisp/modules/progmodes/rpm.lsp
new file mode 100644 (file)
index 0000000..a00ecc0
--- /dev/null
@@ -0,0 +1,166 @@
+;;
+;; Copyright (c) 2003 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/modules/progmodes/rpm.lsp,v 1.1 2003/01/16 03:50:46 paulo Exp $
+;;
+
+(require "syntax")
+(in-package "XEDIT")
+
+;; Only for testing, unifinished, good for viewing but too slow for real use...
+#|
+(defsynprop *prop-rpm-special*
+    "rpm-special"
+    :font      "*courier-bold-r*-12-*"
+    :foreground        "NavyBlue"
+)
+
+(defsynprop *prop-rpm-escape*
+    "rpm-escape"
+    :font      "*lucidatypewriter-medium-r*-12-*"
+    :foreground        "Red3")
+
+;; main package is implicit
+(defsyntax *rpm-mode* :package nil nil nil
+    (syntable :sections nil nil
+       (syntoken "^%package"
+           :icase t
+           :switch :package
+           ;; XXX :begin :package was added just to test finishing and
+           ;; starting a new syntax-table, unfortunately if using it
+           ;; this way, frequently the entire file will be reparsed
+           ;; at every character typed.
+           ;; TODO study these cases and implement code to avoid it,
+           ;; the easiest way is limiting the number of backtracked lines,
+           ;; the screen contents sometimes could not correctly reflect
+           ;; file contents in this case...
+           :begin :package
+           :property *prop-rpm-special*)
+       (syntoken "^%(build|setup|install|pre|preun|post|postun)\\>"
+           :icase t
+           :property *prop-rpm-special*
+           :switch :package
+           :begin :shell)
+       ;; %changelog, XXX no rules to return to the toplevel
+       (syntoken "^%changelog\\>"
+           :icase t
+           :switch :package
+           :begin :changelog
+           :property *prop-rpm-special*)
+       (syntable :changelog nil nil
+           ;; ignore if escaped
+           (syntoken "%%")
+           ;; "warn" if not escaped
+           (syntoken "%" :property *prop-control*)
+           ;; emails
+           (syntoken "<[a-z0-9_-]+@[a-z0-9_-]+\\.\\w+(\\.\\w+)?>"
+               :icase t
+               :property *prop-string*)
+       )
+       ;; comments
+       (syntoken "#" :contained t :nospec t :begin :comment)
+       (syntable :comment *prop-comment* nil
+           ;; some macros are expanded even when inside comments, and may
+           ;; cause surprises, "warn" about it
+           (syntoken "%\\{?\\w+\\}?" :property *prop-rpm-special*)
+           (syntoken "$" :switch -1)
+       )
+       (synaugment :global)
+    )
+
+    ;; may appear anywhere
+    (syntable :global nil nil
+       ;; preprocessor like commands
+       (syntoken "^%(define|if|ifarch|else|endif)\\>"
+           :icase t
+           :property *prop-preprocessor*)
+       ;; variables
+       (syntoken "%\\{.*\\}" :property *prop-constant*)
+    )
+
+    ;; example: "Group: ..." or "Group(pt_BR): ..."
+    (syntoken "^\\w+(\\(\\w+\\))?:" :property *prop-keyword*)
+
+    ;; for sections with shell commands
+    (syntable :shell nil nil
+       (syntoken "\\<(if|then|elif|else|fi|for|do|done|case|esac|while|until)\\>"
+           :property *prop-keyword*)
+       (syntable :strings nil nil
+           (syntoken "\"" :nospec t :begin :string :contained t)
+           (syntable :string *prop-string* nil
+               (syntoken "\\$\\(?\\w+\\)?" :property *prop-constant*)
+               (syntoken "\\\\.")
+               (syntoken "\"" :nospec t :switch -1)
+           )
+           (syntoken "\'" :nospec t :begin :constant :contained t)
+           (syntable :constant *prop-constant* nil
+               (syntoken "\\\\.")
+               (syntoken "\'" :nospec t :switch -1)
+           )
+           (syntoken "\`" :nospec t :begin :escape :contained t)
+           (syntable :escape *prop-rpm-escape* nil
+               (syntoken "\\$\\(?\\w+\\)?" :property *prop-constant*)
+               (syntoken "\\\\.")
+               (syntoken "\`" :nospec t :switch -1)
+           )
+       )
+       (synaugment :strings :sections)
+    )
+    (synaugment :sections)
+)
+|#
+
+
+(defsyntax *rpm-mode* :package nil nil nil
+    ;; commands, macro definitions, etc
+    (syntoken "^\\s*%\\s*\\w+" :property *prop-keyword*)
+
+    ;; rpm "variables"
+    (syntoken "%\\{.*\\}" :property *prop-constant*)
+
+    ;; package info, example: "Group: ...", "Group(pt_BR): ...", etc.
+    (syntoken "^\\w+(\\(\\w+\\))?:" :property *prop-preprocessor*)
+
+    ;; comments
+    (syntoken "#" :contained t :nospec t :begin :comment)
+    (syntable :comment *prop-comment* nil
+       ;; some macros are expanded even when inside comments, and may
+       ;; cause surprises, "warn" about it
+       (syntoken "%define\\>" :property *prop-control*)
+       (syntoken "%\\{?\\w+\\}?" :property *prop-string*)
+       (syntoken "$" :switch -1)
+    )
+
+    ;; emails
+    (syntoken "<?[a-z0-9_-]+@[a-z0-9_-]+\\.\\w+(\\.\\w+)*>?"
+       :icase t
+       :property *prop-string*)
+    ;; links
+    (syntoken "\\<(http|ftp)://\\S+" :property *prop-string*)
+)
diff --git a/xedit/lisp/modules/progmodes/sgml.lsp b/xedit/lisp/modules/progmodes/sgml.lsp
new file mode 100644 (file)
index 0000000..76b537c
--- /dev/null
@@ -0,0 +1,428 @@
+;;
+;; Copyright (c) 2002 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/modules/progmodes/sgml.lsp,v 1.2 2002/10/06 17:11:48 paulo Exp $
+;;
+
+(require "syntax")
+(in-package "XEDIT")
+
+;; Default property the text is shown.
+(defsynprop *prop-sgml-default*
+    "default"
+    :font      "-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-1"
+    :foreground        "Gray10"
+)
+
+(defsynprop *prop-sgml-default-short*
+    "default-short"
+    :font      "-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-1"
+    :foreground        "Gray10"
+    :underline t
+)
+
+;; Large font.
+(defsynprop *prop-sgml-sect*
+    "sect"
+    :font      "-*-helvetica-bold-r-*-*-17-*-*-*-*-*-*-1"
+    :foreground        "Gray20"
+)
+
+;; Monospaced property.
+(defsynprop *prop-sgml-tt*
+    "tt"
+    :font      "-*-courier-medium-r-*-*-12-*-*-*-*-*-*-1"
+    :foreground        "Black"
+)
+
+;; Italic property.
+(defsynprop *prop-sgml-it*
+    "it"
+    :font      "-*-helvetica-medium-o-*-*-12-*-*-*-*-*-*-1"
+    :foreground        "Black"
+)
+
+;; Bold font property.
+(defsynprop *prop-sgml-bf*
+    "bf"
+    :font      "-*-helvetica-bold-r-*-*-12-*-*-*-*-*-*-1"
+    :foreground        "Gray10"
+)
+
+;; Looks like a link...
+(defsynprop *prop-sgml-link*
+    "link"
+    :font      "-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-1"
+    :foreground        "blue"
+    :underline t
+)
+
+;; Monospaced, also looks like a link...
+(defsynprop *prop-sgml-email*
+    "email"
+    :font      "-*-courier-medium-r-*-*-12-*-*-*-*-*-*-1"
+    :foreground        "blue"
+    :underline t
+)
+
+;; Another monospaced property,
+(defsynprop *prop-sgml-screen*
+    "screen"
+    :font      "-*-fixed-*-*-*-*-*-*-*-*-*-*-*-1"
+    :foreground        "Gray10"
+)
+
+(defsynprop *prop-sgml-maybe-entity*
+    "maybe-entity"
+    :font      "*lucidatypewriter-medium-r*-12-*"
+    :foreground        "VioletRed4"
+    :background        "LightYellow"
+)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  The macros sgml-syntoken and sgml-syntable allows creating rules for
+;; matching text inside tags in the format:
+;;     <tag> or <tag arg=value> or <tag arg1=value ... argn=value>
+;;             any-text
+;;     </tag>
+;;  The generated rules don't allow things like: < tag> or </tag >
+;;
+;;  This could also be done as a normal definition, with a starting rule like:
+;;     "<(tag1|tag2|tag3)\\>"
+;; and an ending rule like:
+;;     "</(tag1|tag2|tag3)>"
+;;  But is implemented in way that will fail on purpose for things like:
+;;     <tag1>any text</tag3></tag1>
+;;
+;; NOTE: These definitions aren't cheap in the time required to process the
+;;     file, and are just adaptations/tests with the syntax-highlight code,
+;;     probably it is better to avoid using it in other syntax definitions.
+;; NOTE2: It cannot be defined as a single macro because it is required to
+;;       generate 2 entries in the main SGML syntax highlight definition,
+;;       or, should generate the entire definition from a macro; you will
+;;       need to type the tag name twice, but shouldn't be a problem if
+;;       you are using sgml :-)
+;; XXX: Maybe the syntax-highlight code could save the starting match and
+;;     apply a regex generated at run-time to check for the ending tag,
+;;     but this probably would make the parser too slow, better to have
+;;     a specialized parser if that is required...
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defmacro sgml-syntoken (name)
+    `(syntoken (string-concat "<" ,name "\\>")
+       :icase t
+       :contained t
+       :begin (intern (string-concat ,name "$") 'keyword))
+)
+(defmacro sgml-syntable (name property)
+    `(let
+       (
+       (label (intern (string-concat ,name "$") 'keyword))
+       (nested-label (intern (string (gensym)) 'keyword))
+       )
+       (syntable label *prop-preprocessor* nil
+           ;; tag is still open, process any options
+           (synaugment :generic-tag)
+           (syntoken ">"
+               :nospec t
+               :property *prop-preprocessor*
+               :begin nested-label)
+           ;;  Generate a nested table that includes everything, and only
+           ;; returns when the closing tag is found.
+           (syntable nested-label ,property nil
+               (syntoken (string-concat "</" ,name ">")
+                   :icase t
+                   :nospec t
+                   :property *prop-preprocessor*
+                   :switch -2)
+               (synaugment :main)
+           )
+       )
+    )
+)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Generate tokens for tags that don't require and ending tag.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defmacro sgml-syntable-simple (name property)
+    `(let
+       (
+       (label (intern (string-concat ,name "$") 'keyword))
+       (nested-label (intern (string (gensym)) 'keyword))
+       )
+       (syntable label *prop-preprocessor* nil
+           ;; tag is still open, process any options
+           (synaugment :generic-tag)
+           (syntoken ">"
+               :nospec t
+               :property *prop-preprocessor*
+               :begin nested-label)
+           ;;  Generate a nested table that finishes whenever an unmatched
+           ;; start or end tag is found.
+           (syntable nested-label ,property nil
+               (syntoken "</"
+                   :icase t
+                   :nospec t
+                   :contained t
+                   :begin :simple-nested-tag)
+               ;;  These will take precedence over other rules
+               (syntoken "<"
+                   :icase t
+                   :nospec t
+                   :contained t
+                   :begin :simple-nested-tag)
+               (syntoken "<p>"
+                   :icase t
+                   :nospec t
+                   :property *prop-preprocessor*
+                   :switch :main)
+               (synaugment :main)
+           )
+       )
+    )
+)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Define some macros to generate tokens for tags in the format:
+;;     <tag/  ... /
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defmacro sgml-syntoken-short (name)
+    `(syntoken (string-concat "<" ,name "/")
+       :icase t
+       :property *prop-preprocessor*
+       :begin (intern (string-concat ,name "/") 'keyword))
+)
+(defmacro sgml-syntable-short (name property)
+    `(syntable (intern (string-concat ,name "/") 'keyword) ,property nil
+       (syntoken "/"
+           :nospec t
+           :property *prop-preprocessor*
+           :switch -1)
+       (syntoken "</?\\w+>"
+           :property *prop-control*
+           :switch :main)
+    )
+)
+
+
+;; The main SGML syntax table
+(defsyntax *sgml-mode* :main *prop-sgml-default* nil nil
+    ;; Comments
+    (syntoken "<!--"
+       :nospec t
+       :contained t
+       :begin :comment)
+    (syntable :comment *prop-comment* nil
+       ;; Only one rule, to finish the comment.
+       (syntoken "-->"
+           :nospec t
+           :switch -1)
+    )
+
+    ;; Entities
+    (syntoken "&[a-zA-Z0-9_.-]+;"
+       :property *prop-constant*)
+    ;; Probably an entity, missing ending `;'
+    (syntoken "&[a-zA-Z0-9_.-]+"
+       :property *prop-sgml-maybe-entity*)
+
+    ;; Strings
+    (syntable :string *prop-string* nil
+       ;;  Ignore escaped characters.
+       (syntoken "\\\\.")
+       ;;  Rule to finish the string.
+       (syntoken "\""
+           :nospec t
+           :switch -1)
+    )
+
+    ;; Links
+    (syntable :link *prop-preprocessor* nil
+       ;; No link string following "url="
+       (syntoken ">"
+           :nospec t
+           :property *prop-control*
+           :switch -1)
+       (syntoken "\""
+           :nospec t
+           :contained t
+           :begin :link-string)
+       (syntable :link-string *prop-sgml-link* nil
+           ;; Ignore escaped characters.
+           (syntoken "\\\\.")
+           ;; Rule to finish the link, note that returns two levels.
+           (syntoken "\""
+               :nospec t
+               :switch -2)
+       )
+    )
+
+    ;; "Special" tag
+    (syntoken "<!"
+       :nospec t
+       :contained t
+       :begin :special-tag)
+    ;;  Rules for "special" tags
+    (syntable :special-tag *prop-preprocessor* nil
+       (syntoken "["
+           :nospec t
+           :property *prop-preprocessor*
+           :begin :brackets)
+       ;; Finish the "special" tag
+       (syntoken ">"
+           :nospec t
+           :switch -1)
+       (syntable :brackets *prop-sgml-default* nil
+           (syntoken "]"
+               :nospec t
+               :property *prop-preprocessor*
+               :switch -1)
+           ;; Allow nesting.
+           (syntoken "["
+               :nospec t
+               :property *prop-preprocessor*
+               :begin :brackets)
+           ;; Entities.
+           (syntoken "%[a-zA-Z0-9_.-]+;?"
+               :property *prop-annotation*)
+           ;;  Allow everything inside the brackets
+           (synaugment :main)
+       )
+       ;; Don't use generic tag tokens, only create a rule for strings
+       (syntoken "\""
+           :nospec t
+           :begin :string
+           :contained t)
+       ;; Allow everything inside the "special" tag
+       (synaugment :main)
+    )
+
+    ;; Some "short" tags
+    (sgml-syntoken-short "tt")
+    (sgml-syntable-short "tt" *prop-sgml-tt*)
+    (sgml-syntoken-short "it")
+    (sgml-syntable-short "it" *prop-sgml-it*)
+    (sgml-syntoken-short "bf")
+    (sgml-syntable-short "bf" *prop-sgml-bf*)
+    (sgml-syntoken-short "em")
+    (sgml-syntable-short "em" *prop-sgml-bf*)
+
+    ;; Short tag
+    (syntoken "<\\w+/"
+       :property *prop-preprocessor*
+       :begin :short-tag)
+    (syntable :short-tag *prop-sgml-default-short* nil
+       (syntoken "/"
+           :nospec t
+           :property *prop-preprocessor*
+           :switch -1)
+       (syntoken "</?\\w+>"
+           :property *prop-control*
+           :switch -1)
+    )
+
+    ;;  Don't allow spaces, this may and may not be the start of a tag,
+    ;; but the syntax-highlight definition is not specialized...
+    (syntoken "<([^/a-zA-Z]|$)"
+       :property *prop-control*)
+
+    ;; Some tags that require an end tag
+    (sgml-syntoken "tt")
+    (sgml-syntable "tt" *prop-sgml-tt*)
+    (sgml-syntoken "code")
+    (sgml-syntable "code" *prop-sgml-tt*)
+    (sgml-syntoken "tag")
+    (sgml-syntable "tag" *prop-sgml-tt*)
+    (sgml-syntoken "verb")
+    (sgml-syntable "verb" *prop-sgml-tt*)
+    (sgml-syntoken "programlisting")
+    (sgml-syntable "programlisting" *prop-sgml-tt*)
+    (sgml-syntoken "it")
+    (sgml-syntable "it" *prop-sgml-it*)
+    (sgml-syntoken "bf")
+    (sgml-syntable "bf" *prop-sgml-bf*)
+    (sgml-syntoken "em")
+    (sgml-syntable "em" *prop-sgml-bf*)
+    (sgml-syntoken "mail")
+    (sgml-syntable "mail" *prop-sgml-email*)
+    (sgml-syntoken "email")
+    (sgml-syntable "email" *prop-sgml-email*)
+    (sgml-syntoken "screen")
+    (sgml-syntable "screen" *prop-sgml-screen*)
+    (sgml-syntoken "tscreen")
+    (sgml-syntable "tscreen" *prop-sgml-screen*)
+
+
+    ;;  Helper for tags that don't need an ending one.
+    ;;  NOTE: Since the parser is not specialized, if the tag is
+    ;;       folowed by one that has a special property defined here,
+    ;;       it may not be detected, i.e. put a <p> after the <sect>
+    ;;       and it will work.
+    (syntable :simple-nested-tag *prop-preprocessor* nil
+       ;; tag is still open, process any options
+       (synaugment :generic-tag)
+       (syntoken ">"
+           :nospec t
+           :property *prop-preprocessor*
+           :switch -3)
+    )
+    (sgml-syntoken "sect")
+    (sgml-syntable-simple "sect" *prop-sgml-sect*)
+    (sgml-syntoken "sect1")
+    (sgml-syntable-simple "sect1" *prop-sgml-sect*)
+    (sgml-syntoken "sect2")
+    (sgml-syntable-simple "sect2" *prop-sgml-sect*)
+
+    ;; Generic tags
+    (syntoken "<"
+       :nospec t
+       :contained t
+       :begin :tag)
+    ;; Table :generic-tag is defined to be augmented, no rule to finish it.
+    (syntable :generic-tag *prop-preprocessor* nil
+       ;; Start string
+       (syntoken "\""
+           :nospec t
+           :begin :string
+           :contained t)
+       ;; Start url link
+       (syntoken "url="
+           :nospec t
+           :begin :link)
+       ;; Cannot nest
+       (syntoken "<"
+           :nospec t
+           :property *prop-control*)
+    )
+    (syntable :tag *prop-preprocessor* nil
+       ;; Finish the tag
+       (syntoken ">"
+           :nospec t
+           :switch -1)
+       ;; Import generic definitions
+       (synaugment :generic-tag)
+    )
+)
diff --git a/xedit/lisp/modules/progmodes/sh.lsp b/xedit/lisp/modules/progmodes/sh.lsp
new file mode 100644 (file)
index 0000000..b202039
--- /dev/null
@@ -0,0 +1,113 @@
+;;
+;; Copyright (c) 2003 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/modules/progmodes/sh.lsp,v 1.1 2003/01/16 03:50:46 paulo Exp $
+;;
+
+(require "syntax")
+(require "indent")
+(in-package "XEDIT")
+
+(defsynprop *prop-escape*
+    "escape"
+    :font      "*lucidatypewriter-medium-r*-12-*"
+    :foreground        "Red3")
+
+(defsynprop *prop-variable*
+    "variable"
+    :font      "*lucidatypewriter-medium-r*-12-*"
+    :foreground        "Gold4")
+
+(defsynprop *prop-backslash*
+    "backslash"
+    :font      "*courier-bold-r*-12-*"
+    :foreground        "green4")
+
+;; XXX it would be interesting if "here-documents" could be parsed
+;; just searching for "<<\s*EOF\\>" and then for "^EOF\\>" should
+;; handle most cases, but would be a hack...
+(defsyntax *sh-mode* :main nil #'default-indent nil
+    ;; keywords and common commands/builtins
+    (syntoken "\\<(if|then|elif|else|fi|case|in|esac|for|do|done|while|until|break|continue|eval|exit|exec|test|echo|cd|shift|local|return)\\>"
+       :property *prop-keyword*)
+
+    ; comments
+    (syntoken "#.*$" :property *prop-comment*)
+
+    ;; punctuation
+    (syntoken "[][;:*?(){}<>&!|$#]+" :property *prop-punctuation*)
+
+    ;; variable declaration
+    (syntoken "\\w+=" :property *prop-preprocessor*)
+
+    ;; numbers
+    (syntoken "\\<\\d+\\>" :property *prop-number*)
+
+    ;; escaped characters at toplevel
+    (syntoken "\\\\." :property *prop-backslash*)
+
+    ;; single quote
+    (syntoken "'" :nospec t :contained t :begin :single)
+    (syntable :single *prop-constant* nil
+       ;; do nothing, escaped characters
+       (syntoken "\\\\.")
+       (syntoken "'" :nospec t :switch -1)
+    )
+
+    ;; double quote
+    (syntoken "\"" :nospec t :contained t :begin :double)
+    (syntable :double *prop-string* #'default-indent
+       ;; escaped characters
+       (syntoken "\\\\." :property *prop-backslash*)
+       (syntoken "\"" :nospec t :switch -1)
+       ;; rule to start escape
+       (syntoken "`" :nospec t :contained t :begin :escape)
+       ;; ignore single quote, required because escape is augmented
+       (syntoken "'" :nospec t)
+       (synaugment :escape :variable)
+    )
+
+    ;; escaped commands
+    (syntoken "`" :nospec t :contained t :begin :escape)
+    (syntable :escape *prop-escape* #'default-indent
+       ;; escaped characters
+       (syntoken "\\\\." :property *prop-backslash*)
+       (syntoken "`" :nospec t :switch -1)
+       ;; rule to start double quote inside escape
+       (syntoken "\"" :nospec t :contained t :begin :double)
+       ;; rule to start single quote
+       (syntoken "'" :nospec t :contained t :begin :single)
+       (synaugment :double :variable)
+    )
+
+    (syntable :variable nil nil
+       (syntoken "\\$\\w+" :property *prop-variable*)
+    )
+    (synaugment :variable)
+)
diff --git a/xedit/lisp/modules/progmodes/xconf.lsp b/xedit/lisp/modules/progmodes/xconf.lsp
new file mode 100644 (file)
index 0000000..506f44b
--- /dev/null
@@ -0,0 +1,68 @@
+;;
+;; Copyright (c) 2003 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86$
+;;
+
+(require "syntax")
+(require "indent")
+(in-package "XEDIT")
+
+(defsyntax *xconf-mode* :main nil #'default-indent nil
+    ;; section start
+    (syntoken "\\<(Section|SubSection)\\>"
+       :property *prop-keyword* :icase t :begin :section)
+    ;; just for fun, highlight the section name differently
+    (syntable :section *prop-constant* #'default-indent
+       (syntoken "\"" :nospec t :begin :name)
+       (syntable :name *prop-constant* nil
+           ;; ignore escaped characters
+           (syntoken "\\\\.")
+           (syntoken "\"" :nospec t :switch -2)
+       )
+    )
+
+    ;; section end
+    (syntoken "\\<(EndSection|EndSubSection)\\>"
+       :property *prop-keyword* :icase t)
+
+    ;; numeric options
+    (syntoken "\\<\\d+(\\.\\d+)?\\>" :property *prop-number*)
+
+    ;; comments
+    (syntoken "#.*$" :property *prop-comment*)
+
+    ;; strings
+    (syntoken "\"" :nospec t :begin :string :contained t)
+    (syntable :string *prop-string* #'default-indent
+       ;; ignore escaped characters
+       (syntoken "\\\\.")
+       (syntoken "\"" :nospec t :switch -1)
+    )
+)
diff --git a/xedit/lisp/modules/progmodes/xlog.lsp b/xedit/lisp/modules/progmodes/xlog.lsp
new file mode 100644 (file)
index 0000000..3b57201
--- /dev/null
@@ -0,0 +1,102 @@
+;;
+;; Copyright (c) 2003 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/modules/progmodes/xlog.lsp,v 1.1 2003/01/16 06:25:51 paulo Exp $
+;;
+
+(require "syntax")
+(in-package "XEDIT")
+
+(defsynprop *prop-xlog-probe*
+    "xlog-probe"
+    :font      "*courier-medium-r*-12-*"
+    :background        "rgb:c/f/c")
+
+(defsynprop *prop-xlog-config*
+    "xlog-config"
+    :font      "*courier-medium-r*-12-*"
+    :background        "rgb:c/e/f")
+
+(defsynprop *prop-xlog-default*
+    "xlog-default"
+    :font      "*courier-medium-r*-12-*"
+    :background        "rgb:e/c/f")
+
+(defsynprop *prop-xlog-warning*
+    "xlog-warning"
+    :font      "*courier-bold-r*-12-*"
+    :foreground        "Red4"
+    :background        "Yellow1"
+)
+
+(defsynprop *prop-xlog-error*
+    "xlog-error"
+    :font      "*courier-bold-r*-12-*"
+    :foreground        "Yellow2"
+    :background        "Red3"
+)
+
+(defsyntax *xlog-mode* :main nil nil nil
+    ;; highlight version
+    (syntoken "^XFree86 Version \\S+" :property *prop-annotation*)
+
+    ;; release date
+    (syntoken "^Release Date: " :property *prop-keyword* :begin :note)
+
+    ;; highlight operating system description
+    (syntoken "^Build Operating System: " :property *prop-keyword* :begin :note)
+
+    (syntable :note *prop-annotation* nil (syntoken "$" :switch -1))
+
+    ;; don't highlight info lines
+    (syntoken "^\\(II\\) " :property *prop-keyword*)
+
+    ;; default lines
+    (syntoken "^\\(==\\) " :property *prop-keyword* :begin :default)
+    (syntable :default *prop-xlog-default* nil (syntoken "$" :switch -1))
+
+    ;; probe lines
+    (syntoken "^\\(--\\) " :property *prop-keyword* :begin :probe)
+    (syntable :probe *prop-xlog-probe* nil (syntoken "$" :switch -1))
+
+    ;; config lines
+    (syntoken "^\\(\\*\\*\\) " :property *prop-keyword* :begin :config)
+    (syntable :config *prop-xlog-config* nil (syntoken "$" :switch -1))
+
+    ;; warnings
+    (syntoken "^\\(WW\\) " :property *prop-keyword* :begin :warning)
+    (syntable :warning *prop-xlog-warning* nil (syntoken "$" :switch -1))
+
+    ;; errors
+    (syntoken "^\\(EE\\) " :property *prop-keyword* :begin :error)
+    (syntable :error *prop-xlog-error* nil (syntoken "$" :switch -1))
+
+    ;; command line and "uncommon" messages
+    (syntoken "^\\(..\\) " :property *prop-control* :begin :warning)
+)
diff --git a/xedit/lisp/modules/progmodes/xrdb.lsp b/xedit/lisp/modules/progmodes/xrdb.lsp
new file mode 100644 (file)
index 0000000..a1cabac
--- /dev/null
@@ -0,0 +1,115 @@
+;;
+;; Copyright (c) 2002 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/modules/progmodes/xrdb.lsp,v 1.2 2002/10/06 17:11:48 paulo Exp $
+;;
+
+(require "syntax")
+(in-package "XEDIT")
+
+(defsynprop *prop-xrdb-comment*
+    "xrdb-comment"
+    :font      "*courier-medium-o*-12-*"
+    :foreground        "sienna"
+)
+
+(defsynprop *prop-xrdb-special*
+    "format"
+    :font      "*lucidatypewriter-medium-r*-12-*"
+    :foreground        "RoyalBlue4"
+)
+
+(defsynprop *prop-xrdb-punctuation*
+    "punctuation"
+    :font      "-*-courier-bold-r-*-*-14-*-*-*-*-*-*-1"
+    :foreground        "OrangeRed4"
+)
+
+(defsyntax *xrdb-mode* :main nil nil nil
+    (syntoken "^\\s*!.*"
+       :property *prop-xrdb-comment*)
+    (syntoken "^\\s*#.*"
+       :property *prop-preprocessor*)
+    (syntoken "\\*|\\.|\\?"
+       :property *prop-xrdb-punctuation*
+       :begin :resource)
+    (syntoken "."
+       :nospec t
+       :begin :resource)
+
+    ;; Extra comments
+    (syntoken "/*" :nospec t :begin :comment :contained t)
+    (syntable :comment *prop-comment* nil
+       (syntoken "/*" :nospec t :property *prop-error*)
+       ;;  Rule to finish a comment.
+       (syntoken "*/" :nospec t :switch -1)
+    )
+
+    (syntable :resource nil nil
+       (syntoken "\\*|\\.|\\?" :property *prop-xrdb-punctuation*)
+       (syntoken ":\\s*" :property *prop-xrdb-punctuation* :begin :value)
+    )
+
+    (syntable :value *prop-string* nil
+       (syntoken "\\\\$" :property *prop-constant*)
+
+
+       ;; If the pattern ends at a newline, must switch to the previous state.
+       ;; Not sure yet how to better handle this. The parser does not detect
+       ;; eol because it is a match to the empty string. A possible hack
+       ;; would be to check if the pattern string ends in a "$", but probably
+       ;; better in this case to have a syntoken option, to tell the parser
+       ;; an eol may exist.
+       (syntoken
+           (string-concat
+               "("
+               "\\d+|"                         ;; numbers
+               "(#\\x+|rgb:\\x+/\\x+/\\x+)|"   ;; color spec
+               "#\\w+"                         ;; translation table
+               ")$")
+           :property *prop-xrdb-special* :switch -2)
+       (syntoken "(\\\\n?|\")$"
+           :property *prop-constant* :switch -2)
+
+       ;; XXX Cut&paste of the above, only without the match to eol
+       (syntoken
+           (string-concat
+               "("
+               "\\d+|"
+               "(#\\x+|rgb:\\x+/\\x+/\\x+)|"
+               "#\\w+"
+               ")")
+           :property *prop-xrdb-special*)
+       (syntoken "(\\\\n?|\")"
+           :property *prop-constant*)
+
+       (syntoken "/*" :nospec t :begin :comment :contained t)
+       (syntoken ".?$" :switch -2)
+    )
+)
diff --git a/xedit/lisp/modules/psql.c b/xedit/lisp/modules/psql.c
new file mode 100644 (file)
index 0000000..76d8d16
--- /dev/null
@@ -0,0 +1,983 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/modules/psql.c,v 1.12tsi Exp $ */
+
+#include <stdlib.h>
+#include <libpq-fe.h>
+#undef USE_SSL         /* cannot get it to compile... */
+#include <postgres.h>
+#include <utils/geo_decls.h>
+#include "lisp/internal.h"
+#include "lisp/private.h"
+
+/*
+ * Prototypes
+ */
+int psqlLoadModule(void);
+
+LispObj *Lisp_PQbackendPID(LispBuiltin*);
+LispObj *Lisp_PQclear(LispBuiltin*);
+LispObj *Lisp_PQconsumeInput(LispBuiltin*);
+LispObj *Lisp_PQdb(LispBuiltin*);
+LispObj *Lisp_PQerrorMessage(LispBuiltin*);
+LispObj *Lisp_PQexec(LispBuiltin*);
+LispObj *Lisp_PQfinish(LispBuiltin*);
+LispObj *Lisp_PQfname(LispBuiltin*);
+LispObj *Lisp_PQfnumber(LispBuiltin*);
+LispObj *Lisp_PQfsize(LispBuiltin*);
+LispObj *Lisp_PQftype(LispBuiltin*);
+LispObj *Lisp_PQgetlength(LispBuiltin*);
+LispObj *Lisp_PQgetvalue(LispBuiltin*);
+LispObj *Lisp_PQhost(LispBuiltin*);
+LispObj *Lisp_PQnfields(LispBuiltin*);
+LispObj *Lisp_PQnotifies(LispBuiltin*);
+LispObj *Lisp_PQntuples(LispBuiltin*);
+LispObj *Lisp_PQoptions(LispBuiltin*);
+LispObj *Lisp_PQpass(LispBuiltin*);
+LispObj *Lisp_PQport(LispBuiltin*);
+LispObj *Lisp_PQresultStatus(LispBuiltin*);
+LispObj *Lisp_PQsetdb(LispBuiltin*);
+LispObj *Lisp_PQsetdbLogin(LispBuiltin*);
+LispObj *Lisp_PQsocket(LispBuiltin*);
+LispObj *Lisp_PQstatus(LispBuiltin*);
+LispObj *Lisp_PQtty(LispBuiltin*);
+LispObj *Lisp_PQuser(LispBuiltin*);
+
+/*
+ * Initialization
+ */
+static LispBuiltin lispbuiltins[] = {
+    {LispFunction, Lisp_PQbackendPID, "pq-backend-pid connection"},
+    {LispFunction, Lisp_PQclear, "pq-clear result"},
+    {LispFunction, Lisp_PQconsumeInput, "pq-consume-input connection"},
+    {LispFunction, Lisp_PQdb, "pq-db connection"},
+    {LispFunction, Lisp_PQerrorMessage, "pq-error-message connection"},
+    {LispFunction, Lisp_PQexec, "pq-exec connection query"},
+    {LispFunction, Lisp_PQfinish, "pq-finish connection"},
+    {LispFunction, Lisp_PQfname, "pq-fname result field-number"},
+    {LispFunction, Lisp_PQfnumber, "pq-fnumber result field-name"},
+    {LispFunction, Lisp_PQfsize, "pq-fsize result field-number"},
+    {LispFunction, Lisp_PQftype, "pq-ftype result field-number"},
+    {LispFunction, Lisp_PQgetlength, "pq-getlength result tupple field-number"},
+    {LispFunction, Lisp_PQgetvalue, "pq-getvalue result tupple field-number &optional type"},
+    {LispFunction, Lisp_PQhost, "pq-host connection"},
+    {LispFunction, Lisp_PQnfields, "pq-nfields result"},
+    {LispFunction, Lisp_PQnotifies, "pq-notifies connection"},
+    {LispFunction, Lisp_PQntuples, "pq-ntuples result"},
+    {LispFunction, Lisp_PQoptions, "pq-options connection"},
+    {LispFunction, Lisp_PQpass, "pq-pass connection"},
+    {LispFunction, Lisp_PQport, "pq-port connection"},
+    {LispFunction, Lisp_PQresultStatus, "pq-result-status result"},
+    {LispFunction, Lisp_PQsetdb, "pq-setdb host port options tty dbname"},
+    {LispFunction, Lisp_PQsetdbLogin, "pq-setdb-login host port options tty dbname login password"},
+    {LispFunction, Lisp_PQsocket, "pq-socket connection"},
+    {LispFunction, Lisp_PQstatus, "pq-status connection"},
+    {LispFunction, Lisp_PQtty, "pq-tty connection"},
+    {LispFunction, Lisp_PQuser, "pq-user connection"},
+};
+
+LispModuleData psqlLispModuleData = {
+    LISP_MODULE_VERSION,
+    psqlLoadModule
+};
+
+static int PGconn_t, PGresult_t;
+
+/*
+ * Implementation
+ */
+int
+psqlLoadModule(void)
+{
+    int i;
+    char *fname = "PSQL-LOAD-MODULE";
+
+    PGconn_t = LispRegisterOpaqueType("PGconn*");
+    PGresult_t = LispRegisterOpaqueType("PGresult*");
+
+    GCDisable();
+    /* NOTE: Implemented just enough to make programming examples
+     * (and my needs) work.
+     * Completing this is an exercise to the reader, or may be implemented
+     * when/if required.
+     */
+    LispExecute("(DEFSTRUCT PG-NOTIFY RELNAME BE-PID)\n"
+               "(DEFSTRUCT PG-POINT X Y)\n"
+               "(DEFSTRUCT PG-BOX HIGH LOW)\n"
+               "(DEFSTRUCT PG-POLYGON SIZE NUM-POINTS BOUNDBOX POINTS)\n");
+
+    /* enum ConnStatusType */
+    (void)LispSetVariable(ATOM2("PG-CONNECTION-OK"),
+                         REAL(CONNECTION_OK), fname, 0);
+    (void)LispSetVariable(ATOM2("PG-CONNECTION-BAD"),
+                         REAL(CONNECTION_BAD), fname, 0);
+    (void)LispSetVariable(ATOM2("PG-CONNECTION-STARTED"),
+                         REAL(CONNECTION_STARTED), fname, 0);
+    (void)LispSetVariable(ATOM2("PG-CONNECTION-MADE"),
+                         REAL(CONNECTION_MADE), fname, 0);
+    (void)LispSetVariable(ATOM2("PG-CONNECTION-AWAITING-RESPONSE"),
+                         REAL(CONNECTION_AWAITING_RESPONSE), fname, 0);
+    (void)LispSetVariable(ATOM2("PG-CONNECTION-AUTH-OK"),
+                         REAL(CONNECTION_AUTH_OK), fname, 0);
+    (void)LispSetVariable(ATOM2("PG-CONNECTION-SETENV"),
+                         REAL(CONNECTION_SETENV), fname, 0);
+
+
+    /* enum ExecStatusType */
+    (void)LispSetVariable(ATOM2("PGRES-EMPTY-QUERY"),
+                         REAL(PGRES_EMPTY_QUERY), fname, 0);
+    (void)LispSetVariable(ATOM2("PGRES-COMMAND-OK"),
+                         REAL(PGRES_COMMAND_OK), fname, 0);
+    (void)LispSetVariable(ATOM2("PGRES-TUPLES-OK"),
+                         REAL(PGRES_TUPLES_OK), fname, 0);
+    (void)LispSetVariable(ATOM2("PGRES-COPY-OUT"),
+                         REAL(PGRES_COPY_OUT), fname, 0);
+    (void)LispSetVariable(ATOM2("PGRES-COPY-IN"),
+                         REAL(PGRES_COPY_IN), fname, 0);
+    (void)LispSetVariable(ATOM2("PGRES-BAD-RESPONSE"),
+                         REAL(PGRES_BAD_RESPONSE), fname, 0);
+    (void)LispSetVariable(ATOM2("PGRES-NONFATAL-ERROR"),
+                         REAL(PGRES_NONFATAL_ERROR), fname, 0);
+    (void)LispSetVariable(ATOM2("PGRES-FATAL-ERROR"),
+                         REAL(PGRES_FATAL_ERROR), fname, 0);
+    GCEnable();
+
+    for (i = 0; i < sizeof(lispbuiltins) / sizeof(lispbuiltins[0]); i++)
+       LispAddBuiltinFunction(&lispbuiltins[i]);
+
+    return (1);
+}
+
+LispObj *
+Lisp_PQbackendPID(LispBuiltin *builtin)
+/*
+ pq-backend-pid connection
+ */
+{
+    int pid;
+    PGconn *conn;
+
+    LispObj *connection;
+
+    connection = ARGUMENT(0);
+
+    if (!CHECKO(connection, PGconn_t))
+       LispDestroy("%s: cannot convert %s to PGconn*",
+                   STRFUN(builtin), STROBJ(connection));
+    conn = (PGconn*)(connection->data.opaque.data);
+
+    pid = PQbackendPID(conn);
+
+    return (INTEGER(pid));
+}
+
+LispObj *
+Lisp_PQclear(LispBuiltin *builtin)
+/*
+ pq-clear result
+ */
+{
+    PGresult *res;
+
+    LispObj *result;
+
+    result = ARGUMENT(0);
+
+    if (!CHECKO(result, PGresult_t))
+       LispDestroy("%s: cannot convert %s to PGresult*",
+                   STRFUN(builtin), STROBJ(result));
+    res = (PGresult*)(result->data.opaque.data);
+
+    PQclear(res);
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_PQconsumeInput(LispBuiltin *builtin)
+/*
+ pq-consume-input connection
+ */
+{
+    int result;
+    PGconn *conn;
+
+    LispObj *connection;
+
+    connection = ARGUMENT(0);
+
+    if (!CHECKO(connection, PGconn_t))
+       LispDestroy("%s: cannot convert %s to PGconn*",
+                   STRFUN(builtin), STROBJ(connection));
+    conn = (PGconn*)(connection->data.opaque.data);
+
+    result = PQconsumeInput(conn);
+
+    return (INTEGER(result));
+}
+
+LispObj *
+Lisp_PQdb(LispBuiltin *builtin)
+/*
+ pq-db connection
+ */
+{
+    char *string;
+    PGconn *conn;
+
+    LispObj *connection;
+
+    connection = ARGUMENT(0);
+
+    if (!CHECKO(connection, PGconn_t))
+       LispDestroy("%s: cannot convert %s to PGconn*",
+                   STRFUN(builtin), STROBJ(connection));
+    conn = (PGconn*)(connection->data.opaque.data);
+
+    string = PQdb(conn);
+
+    return (string ? STRING(string) : NIL);
+}
+
+LispObj *
+Lisp_PQerrorMessage(LispBuiltin *builtin)
+{
+    char *string;
+    PGconn *conn;
+
+    LispObj *connection;
+
+    connection = ARGUMENT(0);
+
+    if (!CHECKO(connection, PGconn_t))
+       LispDestroy("%s: cannot convert %s to PGconn*",
+                   STRFUN(builtin), STROBJ(connection));
+    conn = (PGconn*)(connection->data.opaque.data);
+
+    string = PQerrorMessage(conn);
+
+    return (string ? STRING(string) : NIL);
+}
+
+LispObj *
+Lisp_PQexec(LispBuiltin *builtin)
+/*
+ pq-exec connection query
+ */
+{
+    PGconn *conn;
+    PGresult *res;
+
+    LispObj *connection, *query;
+
+    query = ARGUMENT(1);
+    connection = ARGUMENT(0);
+
+    if (!CHECKO(connection, PGconn_t))
+       LispDestroy("%s: cannot convert %s to PGconn*",
+                   STRFUN(builtin), STROBJ(connection));
+    conn = (PGconn*)(connection->data.opaque.data);
+
+    CHECK_STRING(query);
+    res = PQexec(conn, THESTR(query));
+
+    return (res ? OPAQUE(res, PGresult_t) : NIL);
+}
+
+LispObj *
+Lisp_PQfinish(LispBuiltin *builtin)
+/*
+ pq-finish connection
+ */
+{
+    PGconn *conn;
+
+    LispObj *connection;
+
+    connection = ARGUMENT(0);
+
+    if (!CHECKO(connection, PGconn_t))
+       LispDestroy("%s: cannot convert %s to PGconn*",
+                   STRFUN(builtin), STROBJ(connection));
+    conn = (PGconn*)(connection->data.opaque.data);
+
+    PQfinish(conn);
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_PQfname(LispBuiltin *builtin)
+/*
+ pq-fname result field-number
+ */
+{
+    char *string;
+    int field;
+    PGresult *res;
+
+    LispObj *result, *field_number;
+
+    field_number = ARGUMENT(1);
+    result = ARGUMENT(0);
+
+    if (!CHECKO(result, PGresult_t))
+       LispDestroy("%s: cannot convert %s to PGresult*",
+                   STRFUN(builtin), STROBJ(result));
+    res = (PGresult*)(result->data.opaque.data);
+
+    CHECK_INDEX(field_number);
+    field = FIXNUM_VALUE(field_number);
+
+    string = PQfname(res, field);
+
+    return (string ? STRING(string) : NIL);
+}
+
+LispObj *
+Lisp_PQfnumber(LispBuiltin *builtin)
+/*
+ pq-fnumber result field-name
+ */
+{
+    int number;
+    int field;
+    PGresult *res;
+
+    LispObj *result, *field_name;
+
+    field_name = ARGUMENT(1);
+    result = ARGUMENT(0);
+
+    if (!CHECKO(result, PGresult_t))
+       LispDestroy("%s: cannot convert %s to PGresult*",
+                   STRFUN(builtin), STROBJ(result));
+    res = (PGresult*)(result->data.opaque.data);
+
+    CHECK_STRING(field_name);
+    number = PQfnumber(res, THESTR(field_name));
+
+    return (INTEGER(number));
+}
+
+LispObj *
+Lisp_PQfsize(LispBuiltin *builtin)
+/*
+ pq-fsize result field-number
+ */
+{
+    int size, field;
+    PGresult *res;
+
+    LispObj *result, *field_number;
+
+    field_number = ARGUMENT(1);
+    result = ARGUMENT(0);
+
+    if (!CHECKO(result, PGresult_t))
+       LispDestroy("%s: cannot convert %s to PGresult*",
+                   STRFUN(builtin), STROBJ(result));
+    res = (PGresult*)(result->data.opaque.data);
+
+    CHECK_INDEX(field_number);
+    field = FIXNUM_VALUE(field_number);
+
+    size = PQfsize(res, field);
+
+    return (INTEGER(size));
+}
+
+LispObj *
+Lisp_PQftype(LispBuiltin *builtin)
+{
+    Oid oid;
+    int field;
+    PGresult *res;
+
+    LispObj *result, *field_number;
+
+    field_number = ARGUMENT(1);
+    result = ARGUMENT(0);
+
+    if (!CHECKO(result, PGresult_t))
+       LispDestroy("%s: cannot convert %s to PGresult*",
+                   STRFUN(builtin), STROBJ(result));
+    res = (PGresult*)(result->data.opaque.data);
+
+    CHECK_INDEX(field_number);
+    field = FIXNUM_VALUE(field_number);
+
+    oid = PQftype(res, field);
+
+    return (INTEGER(oid));
+}
+
+LispObj *
+Lisp_PQgetlength(LispBuiltin *builtin)
+/*
+ pq-getlength result tupple field-number
+ */
+{
+    PGresult *res;
+    int tuple, field, length;
+
+    LispObj *result, *otupple, *field_number;
+
+    field_number = ARGUMENT(2);
+    otupple = ARGUMENT(1);
+    result = ARGUMENT(0);
+
+    if (!CHECKO(result, PGresult_t))
+       LispDestroy("%s: cannot convert %s to PGresult*",
+                   STRFUN(builtin), STROBJ(result));
+    res = (PGresult*)(result->data.opaque.data);
+
+    CHECK_INDEX(otupple);
+    tuple = FIXNUM_VALUE(otupple);
+
+    CHECK_INDEX(field_number);
+    field = FIXNUM_VALUE(field_number);
+
+    length = PQgetlength(res, tuple, field);
+
+    return (INTEGER(length));
+}
+
+LispObj *
+Lisp_PQgetvalue(LispBuiltin *builtin)
+/*
+ pq-getvalue result tuple field &optional type-specifier
+ */
+{
+    char *string;
+    double real = 0.0;
+    PGresult *res;
+    int tuple, field, isint = 0, isreal = 0, integer;
+
+    LispObj *result, *otupple, *field_number, *type;
+
+    type = ARGUMENT(3);
+    field_number = ARGUMENT(2);
+    otupple = ARGUMENT(1);
+    result = ARGUMENT(0);
+
+    if (!CHECKO(result, PGresult_t))
+       LispDestroy("%s: cannot convert %s to PGresult*",
+                   STRFUN(builtin), STROBJ(result));
+    res = (PGresult*)(result->data.opaque.data);
+
+    CHECK_INDEX(otupple);
+    tuple = FIXNUM_VALUE(otupple);
+
+    CHECK_INDEX(field_number);
+    field = FIXNUM_VALUE(field_number);
+
+    string = PQgetvalue(res, tuple, field);
+
+    if (type != UNSPEC) {
+       char *typestring;
+
+       CHECK_SYMBOL(type);
+       typestring = ATOMID(type);
+
+       if (strcmp(typestring, "INT16") == 0) {
+           integer = *(short*)string;
+           isint = 1;
+           goto simple_type;
+       }
+       else if (strcmp(typestring, "INT32") == 0) {
+           integer = *(int*)string;
+           isint = 1;
+           goto simple_type;
+       }
+       else if (strcmp(typestring, "FLOAT") == 0) {
+           real = *(float*)string;
+           isreal = 1;
+           goto simple_type;
+       }
+       else if (strcmp(typestring, "REAL") == 0) {
+           real = *(double*)string;
+           isreal = 1;
+           goto simple_type;
+       }
+       else if (strcmp(typestring, "PG-POLYGON") == 0)
+           goto polygon_type;
+       else if (strcmp(typestring, "STRING") != 0)
+           LispDestroy("%s: unknown type %s",
+                       STRFUN(builtin), typestring);
+    }
+
+simple_type:
+    return (isint ? INTEGER(integer) : isreal ? DFLOAT(real) :
+           (string ? STRING(string) : NIL));
+
+polygon_type:
+  {
+    LispObj *poly, *box, *p = NIL, *cdr, *obj;
+    POLYGON *polygon;
+    int i, size;
+
+    size = PQgetlength(res, tuple, field);
+    polygon = (POLYGON*)(string - sizeof(int));
+
+    GCDisable();
+    /* get polygon->boundbox */
+    cdr = EVAL(CONS(ATOM("MAKE-PG-POINT"),
+                   CONS(KEYWORD("X"),
+                        CONS(REAL(polygon->boundbox.high.x),
+                             CONS(KEYWORD("Y"),
+                                  CONS(REAL(polygon->boundbox.high.y), NIL))))));
+    obj = EVAL(CONS(ATOM("MAKE-PG-POINT"),
+                   CONS(KEYWORD("X"),
+                        CONS(REAL(polygon->boundbox.low.x),
+                             CONS(KEYWORD("Y"),
+                                  CONS(REAL(polygon->boundbox.low.y), NIL))))));
+    box = EVAL(CONS(ATOM("MAKE-PG-BOX"),
+                   CONS(KEYWORD("HIGH"),
+                        CONS(cdr,
+                             CONS(KEYWORD("LOW"),
+                                  CONS(obj, NIL))))));
+    /* get polygon->p values */
+    for (i = 0; i < polygon->npts; i++) {
+       obj = EVAL(CONS(ATOM("MAKE-PG-POINT"),
+                       CONS(KEYWORD("X"),
+                            CONS(REAL(polygon->p[i].x),
+                             CONS(KEYWORD("Y"),
+                                  CONS(REAL(polygon->p[i].y), NIL))))));
+       if (i == 0)
+           p = cdr = CONS(obj, NIL);
+       else {
+           RPLACD(cdr, CONS(obj, NIL));
+           cdr = CDR(cdr);
+       }
+    }
+
+    /* make result */
+    poly = EVAL(CONS(ATOM("MAKE-PG-POLYGON"),
+                    CONS(KEYWORD("SIZE"),
+                         CONS(REAL(size),
+                              CONS(KEYWORD("NUM-POINTS"),
+                                   CONS(REAL(polygon->npts),
+                                        CONS(KEYWORD("BOUNDBOX"),
+                                             CONS(box,
+                                                  CONS(KEYWORD("POINTS"),
+                                                       CONS(QUOTE(p), NIL))))))))));
+    GCEnable();
+
+    return (poly);
+  }
+}
+
+LispObj *
+Lisp_PQhost(LispBuiltin *builtin)
+/*
+ pq-host connection
+ */
+{
+    char *string;
+    PGconn *conn;
+
+    LispObj *connection;
+
+    connection = ARGUMENT(0);
+
+    if (!CHECKO(connection, PGconn_t))
+       LispDestroy("%s: cannot convert %s to PGconn*",
+                   STRFUN(builtin), STROBJ(connection));
+    conn = (PGconn*)(connection->data.opaque.data);
+
+    string = PQhost(conn);
+
+    return (string ? STRING(string) : NIL);
+}
+
+LispObj *
+Lisp_PQnfields(LispBuiltin *builtin)
+/*
+ pq-nfields result
+ */
+{
+    int nfields;
+    PGresult *res;
+
+    LispObj *result;
+
+    result = ARGUMENT(0);
+
+    if (!CHECKO(result, PGresult_t))
+       LispDestroy("%s: cannot convert %s to PGresult*",
+                   STRFUN(builtin), STROBJ(result));
+    res = (PGresult*)(result->data.opaque.data);
+
+    nfields = PQnfields(res);
+
+    return (INTEGER(nfields));
+}
+
+LispObj *
+Lisp_PQnotifies(LispBuiltin *builtin)
+/*
+ pq-notifies connection
+ */
+{
+    LispObj *result, *code, *cod = COD;
+    PGconn *conn;
+    PGnotify *notifies;
+
+    LispObj *connection;
+
+    connection = ARGUMENT(0);
+
+    if (!CHECKO(connection, PGconn_t))
+       LispDestroy("%s: cannot convert %s to PGconn*",
+                   STRFUN(builtin), STROBJ(connection));
+    conn = (PGconn*)(connection->data.opaque.data);
+
+    if ((notifies = PQnotifies(conn)) == NULL)
+       return (NIL);
+
+    GCDisable();
+    code = CONS(ATOM("MAKE-PG-NOTIFY"),
+                 CONS(KEYWORD("RELNAME"),
+                      CONS(STRING(notifies->relname),
+                           CONS(KEYWORD("BE-PID"),
+                                CONS(REAL(notifies->be_pid), NIL)))));
+    COD = CONS(code, COD);
+    GCEnable();
+    result = EVAL(code);
+    COD = cod;
+
+    free(notifies);
+
+    return (result);
+}
+
+LispObj *
+Lisp_PQntuples(LispBuiltin *builtin)
+/*
+ pq-ntuples result
+ */
+{
+    int ntuples;
+    PGresult *res;
+
+    LispObj *result;
+
+    result = ARGUMENT(0);
+
+    if (!CHECKO(result, PGresult_t))
+       LispDestroy("%s: cannot convert %s to PGresult*",
+                   STRFUN(builtin), STROBJ(result));
+    res = (PGresult*)(result->data.opaque.data);
+
+    ntuples = PQntuples(res);
+
+    return (INTEGER(ntuples));
+}
+
+LispObj *
+Lisp_PQoptions(LispBuiltin *builtin)
+/*
+ pq-options connection
+ */
+{
+    char *string;
+    PGconn *conn;
+
+    LispObj *connection;
+
+    connection = ARGUMENT(0);
+
+    if (!CHECKO(connection, PGconn_t))
+       LispDestroy("%s: cannot convert %s to PGconn*",
+                   STRFUN(builtin), STROBJ(connection));
+    conn = (PGconn*)(connection->data.opaque.data);
+
+    string = PQoptions(conn);
+
+    return (string ? STRING(string) : NIL);
+}
+
+LispObj *
+Lisp_PQpass(LispBuiltin *builtin)
+/*
+ pq-pass connection
+ */
+{
+    char *string;
+    PGconn *conn;
+
+    LispObj *connection;
+
+    connection = ARGUMENT(0);
+
+    if (!CHECKO(connection, PGconn_t))
+       LispDestroy("%s: cannot convert %s to PGconn*",
+                   STRFUN(builtin), STROBJ(connection));
+    conn = (PGconn*)(connection->data.opaque.data);
+
+    string = PQpass(conn);
+
+    return (string ? STRING(string) : NIL);
+}
+
+LispObj *
+Lisp_PQport(LispBuiltin *builtin)
+/*
+ pq-port connection
+ */
+{
+    char *string;
+    PGconn *conn;
+
+    LispObj *connection;
+
+    connection = ARGUMENT(0);
+
+    if (!CHECKO(connection, PGconn_t))
+       LispDestroy("%s: cannot convert %s to PGconn*",
+                   STRFUN(builtin), STROBJ(connection));
+    conn = (PGconn*)(connection->data.opaque.data);
+
+    string = PQport(conn);
+
+    return (string ? STRING(string) : NIL);
+}
+
+LispObj *
+Lisp_PQresultStatus(LispBuiltin *builtin)
+/*
+ pq-result-status result
+ */
+{
+    int status;
+    PGresult *res;
+
+    LispObj *result;
+
+    result = ARGUMENT(0);
+
+    if (!CHECKO(result, PGresult_t))
+       LispDestroy("%s: cannot convert %s to PGresult*",
+                   STRFUN(builtin), STROBJ(result));
+    res = (PGresult*)(result->data.opaque.data);
+
+    status = PQresultStatus(res);
+
+    return (INTEGER(status));
+}
+
+LispObj *
+LispPQsetdb(LispBuiltin *builtin, int loginp)
+/*
+ pq-setdb host port options tty dbname
+ pq-setdb-login host port options tty dbname login password
+ */
+{
+    PGconn *conn;
+    char *host, *port, *options, *tty, *dbname, *login, *password;
+
+    LispObj *ohost, *oport, *ooptions, *otty, *odbname, *ologin, *opassword;
+
+    if (loginp) {
+       opassword = ARGUMENT(6);
+       ologin = ARGUMENT(5);
+    }
+    else
+       opassword = ologin = NIL;
+    odbname = ARGUMENT(4);
+    otty = ARGUMENT(3);
+    ooptions = ARGUMENT(2);
+    oport = ARGUMENT(1);
+    ohost = ARGUMENT(0);
+
+    if (ohost != NIL) {
+       CHECK_STRING(ohost);
+       host = THESTR(ohost);
+    }
+    else
+       host = NULL;
+
+    if (oport != NIL) {
+       CHECK_STRING(oport);
+       port = THESTR(oport);
+    }
+    else
+       port = NULL;
+
+    if (ooptions != NIL) {
+       CHECK_STRING(ooptions);
+       options = THESTR(ooptions);
+    }
+    else
+       options = NULL;
+
+    if (otty != NIL) {
+       CHECK_STRING(otty);
+       tty = THESTR(otty);
+    }
+    else
+       tty = NULL;
+
+    if (odbname != NIL) {
+       CHECK_STRING(odbname);
+       dbname = THESTR(odbname);
+    }
+    else
+       dbname = NULL;
+
+    if (ologin != NIL) {
+       CHECK_STRING(ologin);
+       login = THESTR(ologin);
+    }
+    else
+       login = NULL;
+
+    if (opassword != NIL) {
+       CHECK_STRING(opassword);
+       password = THESTR(opassword);
+    }
+    else
+       password = NULL;
+
+    conn = PQsetdbLogin(host, port, options, tty, dbname, login, password);
+
+    return (conn ? OPAQUE(conn, PGconn_t) : NIL);
+}
+
+LispObj *
+Lisp_PQsetdb(LispBuiltin *builtin)
+/*
+ pq-setdb host port options tty dbname
+ */
+{
+    return (LispPQsetdb(builtin, 0));
+}
+
+LispObj *
+Lisp_PQsetdbLogin(LispBuiltin *builtin)
+/*
+ pq-setdb-login host port options tty dbname login password
+ */
+{
+    return (LispPQsetdb(builtin, 1));
+}
+
+LispObj *
+Lisp_PQsocket(LispBuiltin *builtin)
+/*
+ pq-socket connection
+ */
+{
+    int sock;
+    PGconn *conn;
+
+    LispObj *connection;
+
+    connection = ARGUMENT(0);
+
+    if (!CHECKO(connection, PGconn_t))
+       LispDestroy("%s: cannot convert %s to PGconn*",
+                   STRFUN(builtin), STROBJ(connection));
+    conn = (PGconn*)(connection->data.opaque.data);
+
+    sock = PQsocket(conn);
+
+    return (INTEGER(sock));
+}
+
+LispObj *
+Lisp_PQstatus(LispBuiltin *builtin)
+/*
+ pq-status connection
+ */
+{
+    int status;
+    PGconn *conn;
+
+    LispObj *connection;
+
+    connection = ARGUMENT(0);
+
+    if (!CHECKO(connection, PGconn_t))
+       LispDestroy("%s: cannot convert %s to PGconn*",
+                   STRFUN(builtin), STROBJ(connection));
+    conn = (PGconn*)(connection->data.opaque.data);
+
+    status = PQstatus(conn);
+
+    return (INTEGER(status));
+}
+
+LispObj *
+Lisp_PQtty(LispBuiltin *builtin)
+/*
+ pq-tty connection
+ */
+{
+    char *string;
+    PGconn *conn;
+
+    LispObj *connection;
+
+    connection = ARGUMENT(0);
+
+    if (!CHECKO(connection, PGconn_t))
+       LispDestroy("%s: cannot convert %s to PGconn*",
+                   STRFUN(builtin), STROBJ(connection));
+    conn = (PGconn*)(connection->data.opaque.data);
+
+    string = PQtty(conn);
+
+    return (string ? STRING(string) : NIL);
+}
+
+LispObj *
+Lisp_PQuser(LispBuiltin *builtin)
+/*
+ pq-user connection
+ */
+{
+    char *string;
+    PGconn *conn;
+
+    LispObj *connection;
+
+    connection = ARGUMENT(0);
+
+    if (!CHECKO(connection, PGconn_t))
+       LispDestroy("%s: cannot convert %s to PGconn*",
+                   STRFUN(builtin), STROBJ(connection));
+    conn = (PGconn*)(connection->data.opaque.data);
+
+    string = PQuser(conn);
+
+    return (string ? STRING(string) : NIL);
+}
diff --git a/xedit/lisp/modules/syntax.lsp b/xedit/lisp/modules/syntax.lsp
new file mode 100644 (file)
index 0000000..7ae434c
--- /dev/null
@@ -0,0 +1,1452 @@
+;;
+;; Copyright (c) 2002 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/modules/syntax.lsp,v 1.11 2003/01/16 03:50:46 paulo Exp $
+;;
+
+(provide "syntax")
+(require "xedit")
+(in-package "XEDIT")
+
+(defvar *syntax-symbols* '(
+    syntax-highlight defsyntax defsynprop synprop-p syntax-p
+    syntable syntoken synaugment
+    *prop-default* *prop-keyword* *prop-number* *prop-string*
+    *prop-constant* *prop-comment* *prop-preprocessor*
+    *prop-punctuation* *prop-error* *prop-annotation*
+))
+(export *syntax-symbols*)
+(in-package "USER")
+(dolist (symbol xedit::*syntax-symbols*)
+    (import symbol)
+)
+(in-package "XEDIT")
+(makunbound '*syntax-symbols*)
+
+#|
+TODO:
+o Add a command to match without increment the offset in the input, this
+  may be useful for example in a case like:
+       some-table
+           match "<"
+               switch -1
+       match "<"       <- the table already eated this, so it won't be matched.
+  This must be carefully checked at compile time, such instruction should
+  be in a token that returns or starts a new one, and even then, may need
+  runtime check to make sure it won't enter an infinite loop.
+o Allow combining properties, this is supported in Xaw, and could allow some
+  very interesting effects for complex documents.
+o Maybe have an separated function/loop for tables that don't have tokens
+  that start/switch to another table, and/or have the contained attribute set.
+  This could allow running considerably faster.
+o Do a better handling of interactive edition for tokens that start and end
+  with the same pattern, as an example strings, if the user types '"', it
+  will parse up to the end of the file, "inverting" all strings.
+o Allow generic code to be run once a match is found, such code could handle
+  some defined variables and take decisions based on the parser state. This
+  should be detected at compile time, to maybe run a different parser for
+  such syntax tables, due to the extra time building the environment to
+  call the code. This would be useful to "really" parse documents with
+  complex syntax, for example, a man page source file.
+o Add command to change current default property without initializing a new
+  state.
+o Fix problems matching EOL. Since EOL is an empty string match, if there
+  is a rule to match only EOL, but some other rule matches up to the end
+  of the input, the match to EOL will not be recognized. Currently the only
+  way to handle this is to have a nested table that always returns once a
+  match is found, so that it will restart the match loop code even if the
+  input is at EOL.
+  One possible solution would be to add the ending newline to the input,
+  and then instead of matching "$", should match "\\n".
+o XXX Usage of the variable newline-property must be reviewed in function
+  syntax-highlight, if the text property has a background attribute,
+  visual effect will look "strange", will paint a square with the
+  background attribute at the end of every line in the matched text.
+|#
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Some annotations to later write documentation for the module...
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+#|
+    The current interface logic should be easy to understand for people
+that have written lex scanners before. It has some extended semantics,
+that could be translated to stacked BEGIN() statements in lex, but
+currently does not have rules for matches in the format RE/TRAILING, as
+well as code attached to rules (the biggest difference) and/or things
+like REJECT and unput(). Also, at least currently, it is *really* quite
+slower than lex.
+
+       MATCHING RULES
+       --------------
+    When two tokens are matched at the same input offset, the longest
+token is used, if the length is the same, the first definition is
+used. For example:
+       token1  =>      int
+       token2  =>      [A-Za-z]+
+       input   =>      integer
+    Token1 matches "int" and token2 matches "integer", but since token2 is
+longer, it is used. But in the case:
+       token1  =>      int
+       token2  =>      [A-Za-z]+
+       input   =>      int
+    Both, token1 and token2 match "int", since token1 is defined first, it
+is used.
+|#
+
+
+;;  Initialize some default properties that may be shared in syntax
+;; highlight definitions. Use of these default properties is encouraged,
+;; so that "tokens" will be shown identically when editing program
+;; sources in different programming languages.
+(defsynprop *prop-default*
+    "default"
+    :font      "*courier-medium-r*-12-*"
+    :foreground        "black")
+
+(defsynprop *prop-keyword*
+    "keyword"
+    :font      "*courier-bold-r*-12-*"
+    :foreground        "gray12")
+
+(defsynprop *prop-number*
+    "number"
+    :font      "*courier-bold-r*-12-*"
+    :foreground        "OrangeRed3")
+
+(defsynprop *prop-string*
+    "string"
+    :font      "*lucidatypewriter-medium-r*-12-*"
+    :foreground        "RoyalBlue2")
+
+(defsynprop *prop-constant*
+    "constant"
+    :font      "*lucidatypewriter-medium-r*-12-*"
+    :foreground        "VioletRed3")
+
+(defsynprop *prop-comment*
+    "comment"
+    :font      "*courier-medium-o*-12-*"
+    :foreground        "SlateBlue3")
+
+(defsynprop *prop-preprocessor*
+    "preprocessor"
+    :font      "*courier-medium-r*-12-*"
+    :foreground        "green4")
+
+(defsynprop *prop-punctuation*
+    "punctuation"
+    :font      "*courier-bold-r*-12-*"
+    :foreground        "gray12")
+
+;; Control characters, not always errors...
+(defsynprop *prop-control*
+    "control"
+    :font      "*courier-bold-r*-12-*"
+    :foreground        "yellow2"
+    :background        "red3")
+
+(defsynprop *prop-error*
+    "error"
+    :font      "*new century schoolbook-bold*-24-*"
+    :foreground        "yellow"
+    :background        "red")
+
+(defsynprop *prop-annotation*
+    "annotation"
+    :font      "*courier-medium-r*-12-*"
+    :foreground        "black"
+    :background        "PaleGreen")
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  The "main" definition of the syntax highlight coding interface.
+;;  Creates a "special" variable with the given name, associating to
+;; it an already compiled syntax table.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defmacro defsyntax (variable label property indent options &rest lists)
+    `(if (boundp ',variable)
+       ,variable
+       (progn
+           (proclaim '(special ,variable))
+           (setq ,variable
+               (compile-syntax-table
+                   (string ',variable) ,options
+                   (syntable ,label ,property ,indent ,@lists)
+               )
+           )
+       )
+    )
+)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  Just a wrapper to create a hash-table and bound it to a symbol.
+;;  Example of call:
+;;     (defsynoptions *my-syntax-options*
+;;         (:indent            .       8)
+;;         (:indent-option-1   .       1)
+;;         (:indent-option-2   .       2)
+;;     )
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defmacro defsynoptions (variable &rest options)
+    `(if (boundp ',variable)
+       ,variable
+       (progn
+           (proclaim '(special ,variable))
+           (setq ,variable (make-hash-table :initial-contents ',options))
+       )
+    )
+)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; These definitions should be "private".
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defstruct syntoken
+    regex              ;; A compiled regexp.
+    property           ;; NIL for default, or a synprop structure.
+    contained          ;; Only used when switch/begin is not NIL. Values:
+                       ;;      NIL       -> just switch to or begin new
+                       ;;                   syntax table.
+                       ;;      (not NIL) -> apply syntoken property
+                       ;;                   (or default one) to matched
+                       ;;                   text *after* switching to or
+                       ;;                   beginning a new syntax table.
+    switch             ;; Values for switch are:
+                       ;;      NIL       -> do nothing
+                       ;;      A keyword -> switch to the syntax table
+                       ;;                   identified by the keyword.
+                       ;;      A negative integer -> Pop the stack
+                       ;;                            -<swich-value> times.
+                       ;;                            A common value is -1,
+                       ;;                           to switch to the previous
+                       ;;                           state, but some times
+                       ;;                           it is desired to return
+                       ;;                           two or more times in
+                       ;;                           in the stack.
+                       ;;  NOTE: This is actually a jump, the stack is
+                       ;; popped until the named syntax table is found,
+                       ;; if the stack becomes empty, a new state is
+                       ;; implicitly created.
+    begin              ;;  NIL or a keyword (like switch), but instead of
+                       ;; popping the stack, it pushes the current syntax
+                       ;; table to the stack and sets a new current one.
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Just a wrapper to make-syntoken.
+;;     TODO: Add support for structure constructors.
+;;     XXX: Note that the NOSUB only works with the xedit regex, it
+;; will still return the match offsets, but will ignore subexpressions,
+;; that is, parenthesis are used only for grouping.
+;;     TODO: Create a new version of the re-exec call that returns
+;; offsets in the format (<from> . <to>) and not
+;; ((<from0> . <to0>) ... (<fromN> . <toN>)). Only the global result
+;; is expected/used, so there is no reason to allocate more than one
+;; cons cell per call.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun syntoken (pattern
+                &key icase nospec property contained switch begin (nosub t)
+                &aux
+                (regex
+                   (re-comp pattern :icase icase :nospec nospec :nosub nosub)
+                )
+                check)
+
+    ;;  Don't allow a regex that matches the null string enter the
+    ;; syntax table list.
+    (if (consp (setq check (re-exec regex "" :noteol t :notbol t)))
+#+xedit        (error "SYNTOKEN: regex matches empty string ~S" regex)
+#-xedit        ()
+    )
+
+    (make-syntoken
+       :regex          regex
+       :property       property
+       :contained      contained
+       :switch         switch
+       :begin          begin
+    )
+)
+
+
+;;  This structure is defined only to do some type checking, it just
+;; holds a list of keywords.
+(defstruct synaugment
+    labels             ;; List of keywords labeling syntax tables.
+)
+
+(defstruct syntable
+    label              ;; A keyword naming this syntax table.
+    property           ;; NIL or a default synprop structure.
+    indent             ;; Indentation function for the syntax table.
+    tokens             ;; A list of syntoken structures.
+    tables             ;; A list of syntable structures.
+    augments           ;;  A list of synaugment structures, used only
+                       ;; at "compile time", so that a table can be
+                       ;; used before it's definition.
+    bol                        ;;  One of the tokens match the empty string at
+                       ;; the start of a line (loop optimization hint).
+                       ;; Field filled at "link" time.
+    eol                        ;;  Same comments as bol, but in this case, for
+                       ;; the empty string at the end of a line.
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  Just call make-syntable, but sorts the elements by type, allowing
+;; a cleaner code when defining the syntax highlight rules.
+;; XXX Same comments as for syntoken about the use of a constructor for
+;; structures. TODO: when/if clos is implemented in the interpreter.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun syntable (label default-property indent &rest definitions)
+
+    ;; Check for possible errors in the arguments.
+    (unless (keywordp label)
+       (error "SYNTABLE: ~A is not a keyword" label)
+    )
+    (unless
+       (or
+           (null default-property)
+           (synprop-p default-property)
+       )
+       (error "SYNTABLE: ~A is an invalid text property"
+           default-property
+       )
+    )
+
+    ;; Don't allow unknown data in the definition list.
+    ;; XXX typecase should be added to the interpreter, and since
+    ;;     the code is traversing the entire list, it could build
+    ;;     now the arguments to make-syntable.
+    (dolist (item definitions)
+       (unless
+           (or
+
+               ;;  Allow NIL in the definition list, so that one
+               ;; can put conditionals in the syntax definition,
+               ;; and if the conditional is false, fill the slot
+               ;; with a NIL value.
+               (atom item)
+               (syntoken-p item)
+               (syntable-p item)
+               (synaugment-p item)
+           )
+           (error "SYNTABLE: invalid syntax table argument ~A" item)
+       )
+    )
+
+    ;; Build the syntax table.
+    (make-syntable
+       :label          label
+       :property       default-property
+       :indent         indent
+       :tokens         (remove-if-not #'syntoken-p definitions)
+       :tables         (remove-if-not #'syntable-p definitions)
+       :augments       (remove-if-not #'synaugment-p definitions)
+    )
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  Just to do a "preliminary" error checking, every element must be a
+;; a keyword, and also check for reserved names.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun synaugment (&rest keywords)
+    (dolist (keyword keywords)
+       (unless (keywordp keyword)
+           (error "SYNAUGMENT: bad syntax table label ~A" keyword)
+       )
+    )
+    (make-synaugment :labels keywords)
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Recursive compile utility function.
+;; Returns a cons in the format:
+;;     car     =>      List of all syntoken structures
+;;                     (including child tables).
+;;     cdr     =>      List of all child syntable structures.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun list-syntable-elements (table &aux result sub-result)
+    (setq
+       result
+       (cons
+           (syntable-tokens table)
+           (syntable-tables table))
+    )
+
+    ;; For every child syntax table.
+    (dolist (child (syntable-tables table))
+
+       ;; Recursively call list-syntable-elements.
+       (setq sub-result (list-syntable-elements child))
+
+       (rplaca result (append (car result) (car sub-result)))
+       (rplacd result (append (cdr result) (cdr sub-result)))
+    )
+
+    ;; Return the pair of nested tokens and tables.
+    result
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  Append tokens of the augment list to the tokens of the specified
+;; syntax table.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun compile-syntax-augment-list (table table-list
+                                   &aux labels augment tokens)
+
+    ;; Create a list of all augment tables.
+    (dolist (augment (syntable-augments table))
+       (setq labels (append labels (synaugment-labels augment)))
+    )
+
+    ;;  Remove duplicates and references to "itself",
+    ;; without warnings?
+    (setq
+       labels
+       (remove
+           (syntable-label table)
+           (remove-duplicates labels :from-end t)
+       )
+    )
+
+    ;; Check if the specified syntax tables exists!
+    (dolist (label labels)
+       (unless
+           (setq
+               augment
+               (car (member label table-list :key #'syntable-label))
+           )
+           (error "COMPILE-SYNTAX-AUGMENT-LIST: Cannot augment ~A in ~A"
+               label
+               (syntable-label table)
+           )
+       )
+
+       ;; Increase list of tokens.
+       (setq tokens (append tokens (syntable-tokens augment)))
+    )
+
+    ;;  Store the tokens in the augment list. They will be added
+    ;; to the syntax table in the second pass.
+    (setf (syntable-augments table) tokens)
+
+    ;;  Recurse on every child table.
+    (dolist (child (syntable-tables table))
+       (compile-syntax-augment-list child table-list)
+    )
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  Just add the augmented tokens to the token list, recursing on
+;; every child syntax table.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun link-syntax-augment-table (table)
+    (setf
+       (syntable-tokens table)
+       ;;  When augmenting a table, duplicated tokens or different tokens
+       ;; that use the same regex pattern should be common.
+       (remove-duplicates
+           (nconc (syntable-tokens table) (syntable-augments table))
+           :key        #'syntoken-regex
+           :test       #'equal
+           :from-end   t
+       )
+
+       ;;  Don't need to keep this list anymore.
+       (syntable-augments table)
+       ()
+    )
+
+    ;;  Check if one of the tokens match the empty string at the
+    ;; start or end of a text line. XXX The fields bol and eol
+    ;; are expected to be initialized to NIL.
+    (dolist (token (syntable-tokens table))
+       (when (consp (re-exec (syntoken-regex token) "" :noteol t))
+           (setf (syntable-bol table) t)
+           (return)
+       )
+    )
+    (dolist (token (syntable-tokens table))
+       (when (consp (re-exec (syntoken-regex token) "" :notbol t))
+           (setf (syntable-eol table) t)
+           (return)
+       )
+    )
+
+    (dolist (child (syntable-tables table))
+       (link-syntax-augment-table child)
+    )
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; "Compile" the main structure of the syntax highlight code.
+;; Variables "switches" and "begins" are used only for error checking.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun compile-syntax-table (name options main-table &aux syntax elements
+                            switches begins tables properties)
+    (unless (stringp name)
+       (error "COMPILE-SYNTAX-TABLE: ~A is not a string" name)
+    )
+
+    (setq
+       elements
+       (list-syntable-elements main-table)
+
+       switches
+       (remove-if
+           #'null
+           (car elements)
+           :key #'syntoken-switch
+       )
+
+       begins
+       (remove-if-not
+           #'keywordp
+           (car elements)
+           :key #'syntoken-begin
+       )
+
+       ;;  The "main-table" isn't in the list, because
+       ;; list-syntable-elements includes only the child tables;
+       ;; this is done to avoid the need of removing duplicates here.
+       tables
+       (cons main-table (cdr elements))
+    )
+
+    ;; Check for typos in the keywords, or for not defined syntax tables.
+    (dolist (item (mapcar #'syntoken-switch switches))
+       (unless
+           (or
+               (and
+                   (integerp item)
+                   (minusp item)
+               )
+               (member item tables :key #'syntable-label)
+           )
+           (error "COMPILE-SYNTAX-TABLE: SWITCH ~A cannot be matched"
+               item
+           )
+       )
+    )
+    (dolist (item (mapcar #'syntoken-begin begins))
+       (unless (member item tables :key #'syntable-label)
+           (error "COMPILE-SYNTAX-TABLE: BEGIN ~A cannot be matched"
+               item
+           )
+       )
+    )
+
+    ;; Create a list of all properties used by the syntax.
+    (setq
+       properties
+       (delete-duplicates
+
+           ;; Remove explicitly set to "default" properties.
+           (remove nil
+
+               (append
+
+                   ;; List all properties in the syntoken list.
+                   (mapcar
+                       #'syntoken-property
+                       (car elements)
+                   )
+
+                   ;; List all properties in the syntable list.
+                   (mapcar
+                       #'syntable-property
+                       tables
+                   )
+               )
+           )
+           :test #'string=
+           :key  #'synprop-name
+       )
+    )
+
+    ;;  Provide a default property if none specified.
+    (unless
+       (member
+           "default"
+           properties
+           :test #'string=
+           :key #'synprop-name
+       )
+       (setq properties (append (list *prop-default*) properties))
+    )
+
+
+    ;;  Now that a list of all nested syntax tables is known, compile the
+    ;; augment list. Note that even the main-table can be augmented to
+    ;; include tokens of one of it's children.
+
+    ;;  Adding the tokens of the augment tables must be done in
+    ;; two passes, or it may cause surprises due to "inherited"
+    ;; tokens, as the augment table was processed first, and
+    ;; increased it's token list.
+    (compile-syntax-augment-list main-table tables)
+
+    ;;  Now just append the augmented tokens to the table's token list.
+    (link-syntax-augment-table main-table)
+
+    ;;  Change all syntoken switch and begin fields to point to the
+    ;; syntable.
+    (dolist (item switches)
+       (if (keywordp (syntoken-switch item))
+           ;;  A switch may be relative, check if a keyword
+           ;; was specified.
+           (setf
+               (syntoken-switch item)
+               (car
+                   (member
+                       (syntoken-switch item)
+                       tables
+                       :key #'syntable-label
+                   )
+               )
+           )
+       )
+    )
+    (dolist (item begins)
+       (setf
+           (syntoken-begin item)
+           (car
+               (member
+                   (syntoken-begin item)
+                   tables
+                   :key #'syntable-label
+               )
+           )
+       )
+    )
+
+    ;;  Don't need to add a entity for default properties
+    (dolist (item (car elements))
+       (and
+           (syntoken-property item)
+           (string= (synprop-name (syntoken-property item)) "default")
+           (setf (syntoken-property item) ())
+       )
+    )
+    (dolist (item tables)
+       (and
+           (syntable-property item)
+           (string= (synprop-name (syntable-property item)) "default")
+           (setf (syntable-property item) ())
+       )
+    )
+
+    (setq syntax
+       (make-syntax
+           :name       name
+           :options    options
+           :labels     tables
+           :quark
+               (compile-syntax-property-list
+                   name
+                   properties
+               )
+           :token-count
+               (length (car elements))
+       )
+    )
+
+    ;; Ready to run!
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  Loop applying the specifed syntax table to the text.
+;;  XXX This function needs a review. Should compile the regex patterns
+;; with newline sensitive match (and scan the entire file), and keep a
+;; cache of matched tokens (that may be at a very longer offset), and,
+;; when the match is removed from the cache, readd the token to the
+;; token-list; if the token does not match, it will not be in the cache,
+;; but should be removed from the token-list. If properly implemented, it
+;; should be somewhat like 4 times faster, but I would not be surprised
+;; if it becames even faster.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun syntax-highlight (*syntax*
+                        &optional
+                        (*from* (point-min))
+                        (*to* (point-max))
+                        interactive
+                        &aux
+#+debug                         (*line-number* 0)
+                        stream
+                        indent-table
+                       )
+
+    ;;  Make sure the property list is in use.
+    ;;  The interactive flag is only set after loading the file.
+    (or interactive
+       (property-list (syntax-quark *syntax*))
+    )
+
+#+debug
+    (setq *from* 0 *to* 0)
+
+#-debug
+    (and (>= *from* *to*) (return-from syntax-highlight (values *from* nil)))
+
+    ;;  Remove any existing properties from the text.
+    (clear-entities *from* (1+ *to*))
+
+    (setq stream
+#-debug        (make-string-input-stream (read-text *from* (- *to* *from*)))
+#+debug        *standard-input*
+    )
+
+    (prog*
+       (
+       ;;  Used to check if end of file found but syntax stack did
+       ;; not finish.
+       (point-max (point-max))
+
+       ;;  Used in interactive mode, to return the syntax table
+       ;; where the cursor is located.
+       (point (point))
+
+       ;;  The current stack of states.
+       stack
+
+       ;;  The current syntable.
+       (syntax-table (car (syntax-labels *syntax*)))
+
+       ;;  The current syntable's default property.
+       (default-property (syntable-property syntax-table))
+
+       ;;  Add this property to newlines as a hint to the interactive
+       ;; callback, so that it knows from where to restart parsing.
+       newline-property
+
+       ;;  The tokens in the current syntax table that may match,
+       ;; i.e. the items in this list are not in nomatch.
+       token-list
+
+       ;;  A pointer to the syntable token list, if token-list is
+       ;; eq to this value, cannot change it inplace.
+       current-token-list
+
+       ;;  Help to avoid allocating too many new object cells, and
+       ;; optmizes a bit time in [n]?set-difference.
+       ;;  This optimizes only the processing of one line of text
+       ;; as nomatch must be rebuilt when reading a new line of text.
+       token-list-stack
+
+       ;;  Matches for the current list of tokens.
+       matches
+
+       ;;  Line of text.
+       line
+
+       ;;  Length of the text line.
+       length
+
+       ;;  A inverse cache, don't call re-exec when the regex is
+       ;; already known to not match.
+       nomatch
+
+       ;;  Use cache as a list of matches to avoid repetitive
+       ;; unnecessary calls to re-exec.
+       ;;  cache is a list in which every element has the format:
+       ;;      (token . (start . end))
+       ;;  Line of text.
+       cache
+
+       ;;  Used just to avoid a function call at every re-exec call.
+       notbol
+
+       match
+
+       start
+       left
+       right
+       result
+       property
+
+       ;;  Beginig a new syntax table?
+       begin
+
+       ;;  Switching to another syntax table?
+       switch
+
+       ;;  Property flag when changing the current syntax table.
+       contained
+
+       ;;  Flag to know if syntax table has changed.
+       change
+
+       ;;  Variables used when removing invalid elements from the
+       ;; the cache.
+       item
+       from
+       to
+       )
+
+;-----------------------------------------------------------------------
+:read
+#+debug-verbose
+       (format t "** Entering :READ stack length is ~D~%" (length stack))
+#+debug        (format t "~%[~D]> " (incf *line-number*))
+
+       ;;  If input has finished, return.
+       (unless (setq line (read-line stream nil nil))
+           (when
+               (and
+                   ;; If a nested syntax table wasn't finished
+                   (consp stack)
+                   (<
+                       (setq *to* (scan *from* :eol :right))
+                       point-max
+                   )
+               )
+               (setq line (read-text *from* (- *to* *from*)))
+               (clear-entities *from* (1+ *to*))
+               (go :again)
+           )
+#-debug            (close stream)
+           (return)
+       )
+
+;------------------------------------------------------------------------
+:again
+       (setq
+           start               0
+           length              (length line)
+           token-list          (syntable-tokens syntax-table)
+           current-token-list  token-list
+           token-list-stack    ()
+           nomatch             ()
+           cache               ()
+       )
+
+
+       ;;  If empty line, and current table does not have matches for
+       ;; the empty string at start or end of a text line.
+       (when
+           (and
+               (= length 0)
+               (not (syntable-eol syntax-table))
+               (not (syntable-bol syntax-table)))
+#+debug-verbose
+           (format t "Empty line and table has no match to bol or eol~%")
+
+           (and newline-property
+               (add-entity *from* 1 (synprop-quark newline-property)))
+           (go :update)
+       )
+
+;------------------------------------------------------------------------
+:loop
+#+debug-verbose
+       (format t "** Entering :LOOP at offset ~D in table ~A, cache has ~D items~%"
+           start
+           (syntable-label syntax-table)
+           (length cache))
+
+       (setq notbol (> start 0))
+
+       ;;  For every token that may match.
+       (dolist
+           (token
+               (setq
+                   token-list
+                   (if (eq token-list current-token-list)
+                       (set-difference token-list nomatch :test #'eq)
+                       (nset-difference token-list nomatch :test #'eq)
+                   )
+               )
+           )
+
+           ;;  Try to fetch match from cache.
+           (if (setq match (member token cache :test #'eq :key #'car))
+               ;;  Match is in the cache.
+
+               (progn
+                   ;;  Match must be moved to the beginning of the
+                   ;; matches list, as a match from another syntax
+                   ;; table may be also in the cache, but before
+                   ;; the match for the current token.
+#+debug-verbose            (format t "cached: {~A:~S} ~A~%"
+                       (cdar match)
+                       (subseq line (cadar match) (cddar match))
+                       (syntoken-regex token))
+
+                   ;;  Remove the match from the cache.
+                   (if (eq match cache)
+
+                       ;;  This could be changed to only set "matches"
+                       ;; if it is not the first element of cache,
+                       ;; but is unsafe, because other tokens may
+                       ;; be added to "matches", and will end up
+                       ;; before when joining "matches" and "cache".
+                       (progn
+                           (setq cache (cdr cache))
+                           (rplacd match matches)
+                           (setq matches match))
+
+                       (progn
+                           (if (= (length match) 1)
+                               (progn
+                                   (rplacd (last cache 2) nil)
+                                   (rplacd match matches)
+                                   (setq matches match))
+                               (progn
+                                   (setq matches (cons (car match) matches))
+                                   (rplaca match (cadr match))
+                                   (rplacd match (cddr match)))
+                           )
+                       )
+                   )
+
+                   ;;  Exit loop if the all the remaining
+                   ;; input was matched.
+                   (when
+                       (and
+                           (= start (cadar match))
+                           (= length (cddar match))
+                       )
+#+debug-verbose        (format t "Rest of line match~%")
+                       (return)
+                   )
+               )
+
+               ;;  Not in the cache, call re-exec.
+               (if
+                   (consp
+                       (setq
+                           match
+                           (re-exec
+                               (syntoken-regex token)
+                               line
+                               :start  start
+                               :notbol notbol)))
+
+                   ;;  Match found.
+                   (progn
+#+debug-verbose                (format t "Adding to cache: {~A:~S} ~A~%"
+                           (car match)
+                           (subseq line (caar match) (cdar match))
+                           (syntoken-regex token))
+
+                       ;; Only the first pair is used.
+                       (setq match (car match))
+
+                       (cond
+                           (
+                               (or
+                                   (null matches)
+                                   ;;  No overlap and after most
+                                   ;; recent match.
+                                   (>= (car match) (cddar matches))
+                                   ;; No overlap and before most
+                                   ;; recent match.
+                                   (<= (cdr match) (cadar matches))
+                               )
+                               (setq
+                                   matches
+                                   (cons (cons token match) matches)
+                               )
+                           )
+                           (
+                               (or
+                                   ;;  Overlap, but start before most
+                                   ;; recent match.
+                                   (< (car match) (cadar matches))
+                                   (and
+                                       ;;  Same offset as most recent
+                                       ;; match, but is longer.
+                                       (= (car match) (cadar matches))
+                                       (> (cdr match) (cddar matches))
+                                   )
+                               )
+                               (rplaca (car matches) token)
+                               (rplacd (car matches) match)
+#+debug-verbose                (format t "Replaced most recent match~%")
+                           )
+                           (t
+#+debug-verbose                (format t "Ignored~%")
+                               ;; XXX The interpreter does not yet implement
+                               ;; implicit tagbody in dolist, just comment
+                               ;; the go call in that case. (Will just do
+                               ;; an unecessary test...)
+                               (go :ignored)
+                           )
+                       )
+
+                       ;;  Exit loop if the all the remaining
+                       ;; input was matched.
+                       (when
+                           (and
+                               (= start (car match))
+                               (= length (cdr match)))
+#+debug-verbose            (format t "Rest of line match~%")
+                           (return))
+                   )
+
+                   ;;  Match not found.
+                   (progn
+#+debug-verbose        (format t "Adding to nomatch: ~A~%"
+                           (syntoken-regex token))
+                       (setq nomatch (cons token nomatch)))
+               )
+           )
+:ignored
+       )
+
+       ;;  Add matches to the beginning of the cache list.
+       (setq
+           ;;  Put matches with smaller offset first.
+           cache
+           (stable-sort (nconc (nreverse matches) cache) #'< :key #'cadr)
+
+           ;;  Make sure that when the match loop is reentered, this
+           ;; variable is NIL.
+           matches
+           ()
+       )
+
+       ;;  While the first entry in the cache is not from the current table.
+       (until (or (null cache) (member (caar cache) token-list :test #'eq))
+
+#+debug-verbose
+           (format t "Not in the current table, removing {~A:~S} ~A~%"
+               (cdar cache)
+               (subseq line (cadar cache) (cddar cache))
+               (syntoken-regex (caar cache)))
+
+           (setq cache (cdr cache))
+       )
+
+
+       ;;  If nothing was matched in the entire/remaining line.
+       (unless cache
+           (when default-property
+               (if
+                   (or
+                       (null result)
+                       (> start (cadar result))
+                       (not (eq (cddar result) default-property)))
+                   (setq
+                       result
+                       (cons
+                           (cons start (cons length default-property))
+                           result
+                       )
+                   )
+                   (rplaca (cdar result) length)
+               )
+           )
+
+#+debug-verbose
+           (format t "No match until end of line~%")
+
+           ;;  Result already known, and there is no syntax table
+           ;; change, bypass :PARSE.
+           (and interactive
+               (null indent-table)
+               (<= 0 (- point *from*) length)
+               (setq indent-table syntax-table))
+           (go :process)
+       )
+
+#+debug-verbose
+       (format t "Removing first candidate from cache {~A:~S} ~A~%"
+           (cdar cache)
+           (subseq line (cadar cache) (cddar cache))
+           (syntoken-regex (caar cache))
+       )
+
+       ;;  Prepare to choose best match.
+       (setq
+           match       (car cache)
+           left        (cadr match)
+           right       (cddr match)
+           cache       (cdr cache)
+       )
+
+       ;;  First element can be safely removed now.
+       ;;  If there is only one, skip loop below.
+       (or cache (go :parse))
+
+       ;;  Remove elements of cache that must be discarded.
+       (setq
+           item   (car cache)
+           from   (cadr item)
+           to     (cddr item)
+       )
+
+       (loop
+           (if
+               (or
+
+                   ;;  If everything removed from the cache.
+                   (null item)
+
+                   ;;  Or next item is at a longer offset than the
+                   ;; end of current match.
+                   (>= from right)
+               )
+               (return)
+           )
+
+           (and
+               ;;  If another match at the same offset.
+               (= left from)
+
+               ;;  And if this match is longer than the current one.
+               (> to right)
+
+               (member (car item) token-list :test #'eq)
+
+               (setq
+                   match   item
+                   right   to
+               )
+           )
+
+#+debug-verbose
+           (format t "Removing from cache {~A:~S} ~A~%"
+               (cdar cache)
+               (subseq line from to)
+               (syntoken-regex (caar cache)))
+
+           (setq
+               cache       (cdr cache)
+               item        (car cache)
+               from        (cadr item)
+               to          (cddr item)
+           )
+       )
+
+
+;-----------------------------------------------------------------------
+:parse
+#+debug-verbose
+       (format t "** Entering :PARSE~%")
+
+       (setq
+
+           ;;  Change match value to the syntoken.
+           match       (car match)
+
+           begin       (syntoken-begin match)
+           switch      (syntoken-switch match)
+           contained   (syntoken-contained match)
+           change      (or begin switch)
+       )
+
+       ;;  Check for unmatched leading text.
+       (when (and default-property (> left start))
+#+debug-verbose (format t "No match in {(~D . ~D):~S}~%"
+               start
+               left
+               (subseq line start left)
+           )
+           (if
+               (or
+                   (null result)
+                   (> start (cadar result))
+                   (not (eq (cddar result) default-property)))
+               (setq
+                   result
+                   (cons
+                       (cons start (cons left default-property))
+                       result
+                   )
+               )
+               (rplaca (cdar result) left)
+           )
+       )
+
+       ;;  If the syntax table is not changed,
+       ;; or if the new table requires that the
+       ;; current default property be used.
+       (unless (and change contained)
+
+           (and
+               (> right left)
+               (setq
+                   property
+                   (or
+                       ;;  If token specifies the property.
+                       (syntoken-property match)
+                       default-property
+                   )
+               )
+
+               ;;  Add matched text.
+               (if
+                   (or
+                       (null result)
+                       (> left (cadar result))
+                       (not (eq (cddar result) property))
+                   )
+                   (setq
+                       result
+                       (cons
+                           (cons left (cons right property))
+                           result
+                       )
+                   )
+                   (rplaca (cdar result) right)
+               )
+           )
+
+#+debug-verbose
+           (format t "(0)Match found for {(~D . ~D):~S}~%"
+               left
+               right
+               (subseq line left right)
+           )
+       )
+
+
+       ;;  Update start offset in the input now!
+       (and interactive
+           (null indent-table)
+           (<= start (- point *from*) right)
+           (setq indent-table syntax-table))
+       (setq start right)
+
+
+       ;;  When changing the current syntax table.
+       (when change
+           (when switch
+               (if (numberp switch)
+
+                   ;;  If returning to a previous state.
+                   ;;  Don't generate an error if the stack
+                   ;; becomes empty?
+                   (while
+                       (< switch 0)
+
+                       (setq
+                           syntax-table        (pop stack)
+                           token-list          (pop token-list-stack)
+                           switch              (1+ switch)
+                       )
+                   )
+
+                   ;;  Else, not to a previous state, but
+                   ;; returning to a named syntax table,
+                   ;; search for it in the stack.
+                   (while
+                       (and
+
+                           (setq
+                               token-list      (pop token-list-stack)
+                               syntax-table    (pop stack)
+                           )
+
+                           (not (eq switch syntax-table))
+                       )
+                       ;;  Empty loop.
+                   )
+               )
+
+               ;;  If no match found while popping
+               ;; the stack.
+               (unless syntax-table
+
+                   ;;  Return to the topmost syntax table.
+                   (setq
+                       syntax-table
+                       (car (syntax-labels *syntax*))
+                   )
+               )
+
+#+debug-verbose        (format t "switching to ~A offset: ~D~%"
+                   (syntable-label syntax-table)
+                   start
+               )
+
+               (if (null token-list)
+                   (setq token-list (syntable-tokens syntax-table))
+               )
+           )
+
+           (when begin
+               ;;  Save state for a possible
+               ;; :SWITCH later.
+               (setq
+                   stack            (cons syntax-table stack)
+                   token-list-stack (cons token-list token-list-stack)
+                   token-list       (syntable-tokens begin)
+                   syntax-table     begin
+               )
+#+debug-verbose        (format t "begining ~A offset: ~D~%"
+                   (syntable-label syntax-table)
+                   start
+               )
+           )
+
+           ;;  Change current syntax table.
+           (setq
+               default-property    (syntable-property syntax-table)
+               current-token-list  (syntable-tokens syntax-table)
+           )
+
+           ;;  Set newline property, to help interactive callback
+           ;;  Only need to have a defined value, for now don't care
+           ;; about wich value is being used, neither if there is
+           ;; a value to be set.
+           (if (null stack)
+               (setq newline-property nil)
+               (or newline-property
+                   (setq newline-property default-property)
+                   (setq newline-property (syntoken-property match))
+               )
+           )
+
+           ;; If processing of text was deferred.
+           (when contained
+
+               (and
+                   (> right left)
+                   (setq
+                       property
+                       (or
+                           (syntoken-property match)
+                           default-property
+                       )
+                   )
+                   ;;  Add matched text with the updated property.
+                   (if
+                       (or
+                           (null result)
+                           (> left (cadar result))
+                           (not (eq (cddar result) property))
+                       )
+                       (setq
+                           result
+                           (cons
+                               (cons left (cons right property))
+                               result
+                           )
+                       )
+                       (rplaca (cdar result) right)
+                   )
+               )
+
+#+debug-verbose (format t "(1)Match found for {(~D . ~D):~S}~%"
+                   left
+                   right
+                   (subseq line left right)
+               )
+           )
+
+           (go :loop)
+       )
+
+
+;-----------------------------------------------------------------------
+       ;;  Wait for the end of the line to process, so that
+       ;; it is possible to join sequential matches with the
+       ;; same text property.
+       (and (or cache (< start length)) (go :loop))
+:process
+
+#+debug-verbose
+       (format t "** Entering :PROCESS~%")
+
+       (if result
+           (progn
+               ;;  If the last property was at the end of the line,
+               ;; there are nested syntax tables, and there is a
+               ;; default property, include the newline in the property,
+               ;; as a hint to the interactive callback.
+               (and
+                   newline-property
+                   (if
+                       (and
+                           (eq (cddar result) newline-property)
+                           (= length (cadar result))
+                       )
+                       (rplaca (cdar result) (1+ length))
+                       (setq
+                           result
+                           (cons
+                               (cons length (cons (1+ length) newline-property))
+                               result
+                           )
+                       )
+                   )
+               )
+
+               ;;  Result was created in reversed order.
+               (nreverse result)
+               (dolist (item result)
+                   (setq
+                       left            (car item)
+                       right           (cadr item)
+                       property        (cddr item))
+
+                   ;; Use the information.
+                   (add-entity
+                       (+ *from* left)
+                       (- right left)
+                       (synprop-quark property))
+               )
+           )
+
+           (and newline-property
+               (add-entity
+                   (+ *from* length)
+                   1
+                   (synprop-quark newline-property))
+           )
+       )
+
+;------------------------------------------------------------------------
+:update
+       ;; Prepare for new matches.
+       (setq
+           result      nil
+
+           ;;  Update offset to read text.
+           ;;  Add 1 for the skipped newline.
+           *from*      (+ *from* length 1)
+       )
+
+       (go :read)
+    )
+
+#+debug (terpri)
+    (values *to* indent-table)
+)
+
+(compile 'syntax-highlight)
diff --git a/xedit/lisp/modules/x11.c b/xedit/lisp/modules/x11.c
new file mode 100644 (file)
index 0000000..e3d8886
--- /dev/null
@@ -0,0 +1,666 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/modules/x11.c,v 1.11tsi Exp $ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "lisp/internal.h"
+#include "lisp/private.h"
+#include <X11/Xlib.h>
+
+/*
+ * Prototypes
+ */
+int x11LoadModule(void);
+
+LispObj *Lisp_XOpenDisplay(LispBuiltin *builtin);
+LispObj *Lisp_XCloseDisplay(LispBuiltin *builtin);
+LispObj *Lisp_XDefaultRootWindow(LispBuiltin *builtin);
+LispObj *Lisp_XDefaultScreen(LispBuiltin *builtin);
+LispObj *Lisp_XDefaultScreenOfDisplay(LispBuiltin *builtin);
+LispObj *Lisp_XBlackPixel(LispBuiltin *builtin);
+LispObj *Lisp_XBlackPixelOfScreen(LispBuiltin *builtin);
+LispObj *Lisp_XWidthOfScreen(LispBuiltin *builtin);
+LispObj *Lisp_XHeightOfScreen(LispBuiltin *builtin);
+LispObj *Lisp_XWhitePixel(LispBuiltin *builtin);
+LispObj *Lisp_XWhitePixelOfScreen(LispBuiltin *builtin);
+LispObj *Lisp_XDefaultGC(LispBuiltin *builtin);
+LispObj *Lisp_XDefaultGCOfScreen(LispBuiltin *builtin);
+LispObj *Lisp_XCreateSimpleWindow(LispBuiltin *builtin);
+LispObj *Lisp_XMapWindow(LispBuiltin *builtin);
+LispObj *Lisp_XDestroyWindow(LispBuiltin *builtin);
+LispObj *Lisp_XFlush(LispBuiltin *builtin);
+LispObj *Lisp_XRaiseWindow(LispBuiltin *builtin);
+LispObj *Lisp_XBell(LispBuiltin *builtin);
+
+LispObj *Lisp_XDrawLine(LispBuiltin *builtin);
+
+/*
+ * Initialization
+ */
+static LispBuiltin lispbuiltins[] = {
+    {LispFunction, Lisp_XOpenDisplay, "x-open-display &optional display-name"},
+    {LispFunction, Lisp_XCloseDisplay, "x-close-display display"},
+    {LispFunction, Lisp_XDefaultRootWindow, "x-default-root-window display"},
+    {LispFunction, Lisp_XDefaultScreen, "x-default-screen display"},
+    {LispFunction, Lisp_XDefaultScreenOfDisplay, "x-default-screen-of-display display"},
+    {LispFunction, Lisp_XBlackPixel, "x-black-pixel display &optional screen"},
+    {LispFunction, Lisp_XBlackPixelOfScreen, "x-black-pixel-of-screen screen"},
+    {LispFunction, Lisp_XWhitePixel, "x-white-pixel display &optional screen"},
+    {LispFunction, Lisp_XWhitePixelOfScreen, "x-white-pixel-of-screen screen"},
+    {LispFunction, Lisp_XDefaultGC, "x-default-gc display &optional screen"},
+    {LispFunction, Lisp_XDefaultGCOfScreen, "x-default-gc-of-screen screen"},
+    {LispFunction, Lisp_XCreateSimpleWindow, "x-create-simple-window display parent x y width height &optional border-width border background"},
+    {LispFunction, Lisp_XMapWindow, "x-map-window display window"},
+    {LispFunction, Lisp_XDestroyWindow, "X-DESTROY-WINDOW"},
+    {LispFunction, Lisp_XFlush, "x-flush display"},
+    {LispFunction, Lisp_XDrawLine, "x-draw-line display drawable gc x1 y1 x2 y2"},
+    {LispFunction, Lisp_XBell, "x-bell display &optional percent"},
+    {LispFunction, Lisp_XRaiseWindow, "x-raise-window display window"},
+    {LispFunction, Lisp_XWidthOfScreen, "x-width-of-screen screen"},
+    {LispFunction, Lisp_XHeightOfScreen, "x-height-of-screen screen"},
+};
+
+LispModuleData x11LispModuleData = {
+    LISP_MODULE_VERSION,
+    x11LoadModule
+};
+
+static int x11Display_t, x11Screen_t, x11Window_t, x11GC_t;
+
+/*
+ * Implementation
+ */
+int
+x11LoadModule(void)
+{
+    int i;
+
+    x11Display_t = LispRegisterOpaqueType("Display*");
+    x11Screen_t = LispRegisterOpaqueType("Screen*");
+    x11Window_t = LispRegisterOpaqueType("Window");
+    x11GC_t = LispRegisterOpaqueType("GC");
+
+    for (i = 0; i < sizeof(lispbuiltins) / sizeof(lispbuiltins[0]); i++)
+       LispAddBuiltinFunction(&lispbuiltins[i]);
+
+    return (1);
+}
+
+LispObj *
+Lisp_XOpenDisplay(LispBuiltin *builtin)
+/*
+x-open-display &optional display-name
+ */
+{
+    LispObj *display_name;
+    char *dname;
+
+    display_name = ARGUMENT(0);
+
+    if (display_name == UNSPEC)
+       dname = NULL;
+    else {
+       CHECK_STRING(display_name);
+       dname = THESTR(display_name);
+    }
+
+    return (OPAQUE(XOpenDisplay(dname), x11Display_t));
+}
+
+LispObj *
+Lisp_XCloseDisplay(LispBuiltin *builtin)
+/*
+ x-close-display display
+ */
+{
+    LispObj *display;
+
+    display = ARGUMENT(0);
+
+    if (!CHECKO(display, x11Display_t))
+       LispDestroy("%s: cannot convert %s to Display*",
+                   STRFUN(builtin), STROBJ(display));
+
+    XCloseDisplay((Display*)(display->data.opaque.data));
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_XDefaultRootWindow(LispBuiltin *builtin)
+/*
+ x-default-root-window display
+ */
+{
+    LispObj *display;
+
+    display = ARGUMENT(0);
+
+    if (!CHECKO(display, x11Display_t))
+       LispDestroy("%s: cannot convert %s to Display*",
+                   STRFUN(builtin), STROBJ(display));
+
+    return (OPAQUE(DefaultRootWindow((Display*)(display->data.opaque.data)),
+                  x11Window_t));
+}
+
+LispObj *
+Lisp_XDefaultScreen(LispBuiltin *builtin)
+/*
+ x-default-screen display
+ */
+{
+    LispObj *display;
+
+    display = ARGUMENT(0);
+
+    if (!CHECKO(display, x11Display_t))
+       LispDestroy("%s: cannot convert %s to Display*",
+                   STRFUN(builtin), STROBJ(display));
+
+    return (INTEGER(DefaultScreen((Display*)(display->data.opaque.data))));
+}
+
+LispObj *
+Lisp_XDefaultScreenOfDisplay(LispBuiltin *builtin)
+/*
+ x-default-screen-of-display display
+ */
+{
+    LispObj *display;
+
+    display = ARGUMENT(0);
+
+    if (!CHECKO(display, x11Display_t))
+       LispDestroy("%s: cannot convert %s to Display*",
+                   STRFUN(builtin), STROBJ(display));
+
+    return (OPAQUE(DefaultScreenOfDisplay((Display*)(display->data.opaque.data)),
+                  x11Screen_t));
+}
+
+LispObj *
+Lisp_XBlackPixel(LispBuiltin *builtin)
+/*
+ x-black-pixel display &optional screen
+ */
+{
+    Display *display;
+    int screen;
+
+    LispObj *odisplay, *oscreen;
+
+    oscreen = ARGUMENT(1);
+    odisplay = ARGUMENT(0);
+
+    if (!CHECKO(odisplay, x11Display_t))
+       LispDestroy("%s: cannot convert %s to Display*",
+                   STRFUN(builtin), STROBJ(odisplay));
+    display = (Display*)(odisplay->data.opaque.data);
+
+    if (oscreen == UNSPEC)
+       screen = DefaultScreen(display);
+    else {
+       CHECK_INDEX(oscreen);
+       screen = FIXNUM_VALUE(oscreen);
+    }
+
+    if (screen >= ScreenCount(display))
+       LispDestroy("%s: screen index %d too large, %d screens available",
+                   STRFUN(builtin), screen, ScreenCount(display));
+
+    return (INTEGER(BlackPixel(display, screen)));
+}
+
+LispObj *
+Lisp_XBlackPixelOfScreen(LispBuiltin *builtin)
+/*
+ x-black-pixel-of-screen screen
+ */
+{
+    LispObj *screen;
+
+    screen = ARGUMENT(0);
+
+    if (!CHECKO(screen, x11Screen_t))
+       LispDestroy("%s: cannot convert %s to Screen*",
+                   STRFUN(builtin), STROBJ(screen));
+
+    return (INTEGER(XBlackPixelOfScreen((Screen*)(screen->data.opaque.data))));
+}
+
+LispObj *
+Lisp_XWhitePixel(LispBuiltin *builtin)
+/*
+ x-white-pixel display &optional screen
+ */
+{
+    Display *display;
+    int screen;
+
+    LispObj *odisplay, *oscreen;
+
+    oscreen = ARGUMENT(1);
+    odisplay = ARGUMENT(0);
+
+    if (!CHECKO(odisplay, x11Display_t))
+       LispDestroy("%s: cannot convert %s to Display*",
+                   STRFUN(builtin), STROBJ(odisplay));
+    display = (Display*)(odisplay->data.opaque.data);
+
+    if (oscreen == UNSPEC)
+       screen = DefaultScreen(display);
+    else {
+       CHECK_FIXNUM(oscreen);
+       screen = FIXNUM_VALUE(oscreen);
+    }
+
+    if (screen >= ScreenCount(display))
+       LispDestroy("%s: screen index %d too large, %d screens available",
+                   STRFUN(builtin), screen, ScreenCount(display));
+
+    return (INTEGER(WhitePixel(display, screen)));
+}
+
+LispObj *
+Lisp_XWhitePixelOfScreen(LispBuiltin *builtin)
+/*
+ x-white-pixel-of-screen screen
+ */
+{
+    LispObj *screen;
+
+    screen = ARGUMENT(0);
+
+    if (!CHECKO(screen, x11Screen_t))
+       LispDestroy("%s: cannot convert %s to Screen*",
+                   STRFUN(builtin), STROBJ(screen));
+
+    return (INTEGER(WhitePixelOfScreen((Screen*)(screen->data.opaque.data))));
+}
+
+LispObj *
+Lisp_XDefaultGC(LispBuiltin *builtin)
+/*
+ x-default-gc display &optional screen
+ */
+{
+    Display *display;
+    int screen;
+
+    LispObj *odisplay, *oscreen;
+
+    oscreen = ARGUMENT(1);
+    odisplay = ARGUMENT(0);
+
+    if (!CHECKO(odisplay, x11Display_t))
+       LispDestroy("%s: cannot convert %s to Display*",
+                   STRFUN(builtin), STROBJ(odisplay));
+    display = (Display*)(odisplay->data.opaque.data);
+
+    if (oscreen == UNSPEC)
+       screen = DefaultScreen(display);
+    else {
+       CHECK_FIXNUM(oscreen);
+       screen = FIXNUM_VALUE(oscreen);
+    }
+
+    if (screen >= ScreenCount(display))
+       LispDestroy("%s: screen index %d too large, %d screens available",
+                   STRFUN(builtin), screen, ScreenCount(display));
+
+    return (OPAQUE(DefaultGC(display, screen), x11GC_t));
+}
+
+LispObj *
+Lisp_XDefaultGCOfScreen(LispBuiltin *builtin)
+/*
+ x-default-gc-of-screen screen
+ */
+{
+    LispObj *screen;
+
+    screen = ARGUMENT(0);
+
+    if (!CHECKO(screen, x11Screen_t))
+       LispDestroy("%s: cannot convert %s to Screen*",
+                   STRFUN(builtin), STROBJ(screen));
+
+    return (OPAQUE(DefaultGCOfScreen((Screen*)(screen->data.opaque.data)),
+                  x11GC_t));
+}
+
+LispObj *
+Lisp_XCreateSimpleWindow(LispBuiltin *builtin)
+/*
+ x-create-simple-window display parent x y width height &optional border-width border background
+ */
+{
+    Display *display;
+    Window parent;
+    int x, y;
+    unsigned int width, height, border_width;
+    unsigned long border, background;
+
+    LispObj *odisplay, *oparent, *ox, *oy, *owidth, *oheight,
+           *oborder_width, *oborder, *obackground;
+
+    obackground = ARGUMENT(8);
+    oborder = ARGUMENT(7);
+    oborder_width = ARGUMENT(6);
+    oheight = ARGUMENT(5);
+    owidth = ARGUMENT(4);
+    oy = ARGUMENT(3);
+    ox = ARGUMENT(2);
+    oparent = ARGUMENT(1);
+    odisplay = ARGUMENT(0);
+
+    if (!CHECKO(odisplay, x11Display_t))
+       LispDestroy("%s: cannot convert %s to Display*",
+                   STRFUN(builtin), STROBJ(odisplay));
+    display = (Display*)(odisplay->data.opaque.data);
+
+    if (!CHECKO(oparent, x11Window_t))
+       LispDestroy("%s: cannot convert %s to Window",
+                   STRFUN(builtin), STROBJ(oparent));
+    parent = (Window)(oparent->data.opaque.data);
+
+    CHECK_FIXNUM(ox);
+    x = FIXNUM_VALUE(ox);
+
+    CHECK_FIXNUM(oy);
+    y = FIXNUM_VALUE(oy);
+
+    CHECK_INDEX(owidth);
+    width = FIXNUM_VALUE(owidth);
+
+    CHECK_INDEX(oheight);
+    height = FIXNUM_VALUE(oheight);
+
+    /* check &OPTIONAL parameters */
+    if (oborder_width == UNSPEC)
+       border_width = 1;
+    else {
+       CHECK_INDEX(oborder_width);
+       border_width = FIXNUM_VALUE(oborder_width);
+    }
+
+    if (oborder == UNSPEC)
+       border = BlackPixel(display, DefaultScreen(display));
+    else {
+       CHECK_LONGINT(oborder);
+       border = LONGINT_VALUE(oborder);
+    }
+
+    if (obackground == UNSPEC)
+       background = WhitePixel(display, DefaultScreen(display));
+    else {
+       CHECK_LONGINT(obackground);
+       background = LONGINT_VALUE(obackground);
+    }
+
+    return (OPAQUE(
+           XCreateSimpleWindow(display, parent, x, y, width, height,
+                               border_width, border, background),
+           x11Window_t));
+}
+
+LispObj *
+Lisp_XMapWindow(LispBuiltin *builtin)
+/*
+ x-map-window display window
+ */
+{
+    Display *display;
+    Window window;
+
+    LispObj *odisplay, *owindow;
+
+    owindow = ARGUMENT(1);
+    odisplay = ARGUMENT(0);
+
+    if (!CHECKO(odisplay, x11Display_t))
+       LispDestroy("%s: cannot convert %s to Display*",
+                   STRFUN(builtin), STROBJ(odisplay));
+    display = (Display*)(odisplay->data.opaque.data);
+
+    if (!CHECKO(owindow, x11Window_t))
+       LispDestroy("%s: cannot convert %s to Window",
+                   STRFUN(builtin), STROBJ(owindow));
+    window = (Window)(owindow->data.opaque.data);
+
+    XMapWindow(display, window);
+
+    return (owindow);
+}
+
+LispObj *
+Lisp_XDestroyWindow(LispBuiltin *builtin)
+/*
+ x-destroy-window display window
+ */
+{
+    Display *display;
+    Window window;
+
+    LispObj *odisplay, *owindow;
+
+    owindow = ARGUMENT(1);
+    odisplay = ARGUMENT(0);
+
+    if (!CHECKO(odisplay, x11Display_t))
+       LispDestroy("%s: cannot convert %s to Display*",
+                   STRFUN(builtin), STROBJ(odisplay));
+    display = (Display*)(odisplay->data.opaque.data);
+
+    if (!CHECKO(owindow, x11Window_t))
+       LispDestroy("%s: cannot convert %s to Window",
+                   STRFUN(builtin), STROBJ(owindow));
+    window = (Window)(owindow->data.opaque.data);
+
+    XDestroyWindow(display, window);
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_XFlush(LispBuiltin *builtin)
+/*
+ x-flush display
+ */
+{
+    Display *display;
+
+    LispObj *odisplay;
+
+    odisplay = ARGUMENT(0);
+
+    if (!CHECKO(odisplay, x11Display_t))
+       LispDestroy("%s: cannot convert %s to Display*",
+                   STRFUN(builtin), STROBJ(odisplay));
+    display = (Display*)(odisplay->data.opaque.data);
+
+    XFlush(display);
+
+    return (odisplay);
+}
+
+LispObj *
+Lisp_XDrawLine(LispBuiltin *builtin)
+/*
+ x-draw-line display drawable gc x1 y1 x2 y2
+ */
+{
+    Display *display;
+    Drawable drawable;
+    GC gc;
+    int x1, y1, x2, y2;
+
+    LispObj *odisplay, *odrawable, *ogc, *ox1, *oy1, *ox2, *oy2;
+
+    oy2 = ARGUMENT(6);
+    ox2 = ARGUMENT(5);
+    oy1 = ARGUMENT(4);
+    ox1 = ARGUMENT(3);
+    ogc = ARGUMENT(2);
+    odrawable = ARGUMENT(1);
+    odisplay = ARGUMENT(0);
+
+    if (!CHECKO(odisplay, x11Display_t))
+       LispDestroy("%s: cannot convert %s to Display*",
+                   STRFUN(builtin), STROBJ(odisplay));
+    display = (Display*)(odisplay->data.opaque.data);
+
+    /* XXX correct check when drawing to pixmaps implemented */
+    if (!CHECKO(odrawable, x11Window_t))
+       LispDestroy("%s: cannot convert %s to Drawable",
+                   STRFUN(builtin), STROBJ(odrawable));
+    drawable = (Drawable)(odrawable->data.opaque.data);
+
+    if (!CHECKO(ogc, x11GC_t))
+       LispDestroy("%s: cannot convert %s to Display*",
+                   STRFUN(builtin), STROBJ(ogc));
+    gc = (GC)(ogc->data.opaque.data);
+
+    CHECK_FIXNUM(ox1);
+    x1 = FIXNUM_VALUE(ox1);
+
+    CHECK_FIXNUM(oy1);
+    y1 = FIXNUM_VALUE(oy1);
+
+    CHECK_FIXNUM(ox2);
+    x2 = FIXNUM_VALUE(ox2);
+
+    CHECK_FIXNUM(oy2);
+    y2 = FIXNUM_VALUE(oy2);
+
+    XDrawLine(display, drawable, gc, x1, y1, x2, y2);
+
+    return (odrawable);
+}
+
+LispObj *
+Lisp_XBell(LispBuiltin *builtin)
+/*
+ x-bell &optional percent
+ */
+{
+    Display *display;
+    int percent;
+
+    LispObj *odisplay, *opercent;
+
+    opercent = ARGUMENT(1);
+    odisplay = ARGUMENT(0);
+
+    if (!CHECKO(odisplay, x11Display_t))
+       LispDestroy("%s: cannot convert %s to Display*",
+                   STRFUN(builtin), STROBJ(odisplay));
+    display = (Display*)(odisplay->data.opaque.data);
+
+    if (opercent == UNSPEC)
+       percent = 0;
+    else {
+       CHECK_FIXNUM(opercent);
+       percent = FIXNUM_VALUE(opercent);
+    }
+
+    if (percent < -100 || percent > 100)
+       LispDestroy("%s: percent value %d out of range -100 to 100",
+                   STRFUN(builtin), percent);
+
+    XBell(display, percent);
+
+    return (odisplay);
+}
+
+LispObj *
+Lisp_XRaiseWindow(LispBuiltin *builtin)
+/*
+ x-raise-window display window
+ */
+{
+    Display *display;
+    Window window;
+
+    LispObj *odisplay, *owindow;
+
+    owindow = ARGUMENT(1);
+    odisplay = ARGUMENT(0);
+
+    if (!CHECKO(odisplay, x11Display_t))
+       LispDestroy("%s: cannot convert %s to Display*",
+                   STRFUN(builtin), STROBJ(odisplay));
+    display = (Display*)(odisplay->data.opaque.data);
+
+    if (!CHECKO(owindow, x11Window_t))
+       LispDestroy("%s: cannot convert %s to Window",
+                   STRFUN(builtin), STROBJ(owindow));
+    window = (Window)(owindow->data.opaque.data);
+
+    XRaiseWindow(display, window);
+
+    return (owindow);
+}
+
+LispObj *
+Lisp_XWidthOfScreen(LispBuiltin *builtin)
+/*
+ x-width-of-screen screen
+ */
+{
+    LispObj *screen;
+
+    screen = ARGUMENT(0);
+
+    if (!CHECKO(screen, x11Screen_t))
+       LispDestroy("%s: cannot convert %s to Screen*",
+                   STRFUN(builtin), STROBJ(screen));
+
+    return (FIXNUM(WidthOfScreen((Screen*)(screen->data.opaque.data))));
+}
+
+LispObj *
+Lisp_XHeightOfScreen(LispBuiltin *builtin)
+/*
+ x-height-of-screen screen
+ */
+{
+    LispObj *screen;
+
+    screen = ARGUMENT(0);
+
+    if (!CHECKO(screen, x11Screen_t))
+       LispDestroy("%s: cannot convert %s to Screen*",
+                   STRFUN(builtin), STROBJ(screen));
+
+    return (FIXNUM(HeightOfScreen((Screen*)(screen->data.opaque.data))));
+}
diff --git a/xedit/lisp/modules/xaw.c b/xedit/lisp/modules/xaw.c
new file mode 100644 (file)
index 0000000..70f8424
--- /dev/null
@@ -0,0 +1,664 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/modules/xaw.c,v 1.15tsi Exp $ */
+
+#include <stdlib.h>
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Xaw/AsciiSink.h>
+#include <X11/Xaw/AsciiSrc.h>
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Box.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Dialog.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Grip.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/List.h>
+#include <X11/Xaw/MenuButton.h>
+#include <X11/Xaw/MultiSink.h>
+#include <X11/Xaw/MultiSrc.h>
+#include <X11/Xaw/Paned.h>
+#include <X11/Xaw/Panner.h>
+#include <X11/Xaw/Porthole.h>
+#include <X11/Xaw/Repeater.h>
+#include <X11/Xaw/Scrollbar.h>
+#include <X11/Xaw/Simple.h>
+#include <X11/Xaw/SimpleMenu.h>
+#include <X11/Xaw/SmeBSB.h>
+#include <X11/Xaw/Sme.h>
+#include <X11/Xaw/SmeLine.h>
+#include <X11/Xaw/StripChart.h>
+#include <X11/Xaw/Text.h>
+#include <X11/Xaw/TextSink.h>
+#include <X11/Xaw/TextSrc.h>
+#include <X11/Xaw/Tip.h>
+#include <X11/Xaw/Toggle.h>
+#include <X11/Xaw/Tree.h>
+#include <X11/Xaw/Viewport.h>
+#include <X11/Vendor.h>
+#include "lisp/internal.h"
+#include "lisp/private.h"
+
+/*
+ * Types
+ */
+typedef struct {
+    LispObj *object;
+    void *data;
+} WidgetData;
+
+/*
+ * Prototypes
+ */
+int xawLoadModule(void);
+void LispXawCleanupCallback(Widget, XtPointer, XtPointer);
+
+/* until a better/smarter interface be written... */
+LispObj *Lisp_XawCoerceToListReturnStruct(LispBuiltin*);
+LispObj *Lisp_XawScrollbarCoerceToReal(LispBuiltin*);
+
+LispObj *Lisp_XawFormDoLayout(LispBuiltin*);
+LispObj *Lisp_XawListChange(LispBuiltin*);
+LispObj *Lisp_XawListHighlight(LispBuiltin*);
+LispObj *Lisp_XawListUnhighlight(LispBuiltin*);
+LispObj *Lisp_XawTextGetSource(LispBuiltin*);
+LispObj *Lisp_XawTextLastPosition(LispBuiltin*);
+LispObj *Lisp_XawTextReplace(LispBuiltin*);
+LispObj *Lisp_XawTextSearch(LispBuiltin*);
+LispObj *Lisp_XawTextGetInsertionPoint(LispBuiltin*);
+LispObj *Lisp_XawTextSetInsertionPoint(LispBuiltin*);
+LispObj *Lisp_XawScrollbarSetThumb(LispBuiltin*);
+
+/*
+ * Initialization
+ */
+
+static LispBuiltin lispbuiltins[] = {
+    {LispFunction, Lisp_XawCoerceToListReturnStruct, "xaw-coerce-to-list-return-struct opaque"},
+    {LispFunction, Lisp_XawScrollbarCoerceToReal, "xaw-scrollbar-coerce-to-real opaque"},
+
+    {LispFunction, Lisp_XawScrollbarSetThumb, "xaw-scrollbar-set-thumb widget top &optional shown"},
+    {LispFunction, Lisp_XawFormDoLayout, "xaw-form-do-layout widget force"},
+    {LispFunction, Lisp_XawListChange, "xaw-list-change widget list &optional longest resize"},
+    {LispFunction, Lisp_XawListHighlight, "xaw-list-highlight widget index"},
+    {LispFunction, Lisp_XawListUnhighlight, "xaw-list-unhighlight widget"},
+    {LispFunction, Lisp_XawTextGetSource, "xaw-text-get-source widget"},
+    {LispFunction, Lisp_XawTextLastPosition, "xaw-text-last-position widget"},
+    {LispFunction, Lisp_XawTextReplace, "xaw-text-replace widget left right text"},
+    {LispFunction, Lisp_XawTextSearch, "xaw-text-search widget direction text"},
+    {LispFunction, Lisp_XawTextGetInsertionPoint, "xaw-text-get-insertion-point widget"},
+    {LispFunction, Lisp_XawTextSetInsertionPoint, "xaw-text-set-insertion-point widget position"},
+};
+
+LispModuleData xawLispModuleData = {
+    LISP_MODULE_VERSION,
+    xawLoadModule
+};
+
+static int xawWidget_t, xawWidgetClass_t, xawListReturnStruct_t, xawFloatp_t;
+static WidgetData **list_data;
+static int num_list_data;
+
+/*
+ * Implementation
+ */
+int
+xawLoadModule(void)
+{
+    int i;
+    char *fname = "XAW-LOAD-MODULE";
+
+    xawWidget_t = LispRegisterOpaqueType("Widget");
+    xawWidgetClass_t = LispRegisterOpaqueType("WidgetClass");
+    xawListReturnStruct_t = LispRegisterOpaqueType("XawListReturnStruct");
+    xawFloatp_t = LispRegisterOpaqueType("float*");
+
+    LispExecute("(DEFSTRUCT XAW-LIST-RETURN-STRUCT STRING INDEX)\n");
+
+    GCDisable();
+    (void)LispSetVariable(ATOM2("ASCII-SINK-OBJECT-CLASS"),
+                         OPAQUE(asciiSinkObjectClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("ASCII-SRC-OBJECT-CLASS"),
+                         OPAQUE(asciiSinkObjectClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("ASCII-TEXT-WIDGET-CLASS"),
+                         OPAQUE(asciiTextWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("BOX-WIDGET-CLASS"),
+                         OPAQUE(boxWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("COMMAND-WIDGET-CLASS"),
+                         OPAQUE(commandWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("DIALOG-WIDGET-CLASS"),
+                         OPAQUE(dialogWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("FORM-WIDGET-CLASS"),
+                         OPAQUE(formWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("GRIP-WIDGET-CLASS"),
+                         OPAQUE(gripWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("LABEL-WIDGET-CLASS"),
+                         OPAQUE(labelWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("LIST-WIDGET-CLASS"),
+                         OPAQUE(listWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("MENU-BUTTON-WIDGET-CLASS"),
+                         OPAQUE(menuButtonWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("MULTI-SINK-OBJEC-TCLASS"),
+                         OPAQUE(multiSinkObjectClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("MULTI-SRC-OBJECT-CLASS"),
+                         OPAQUE(multiSrcObjectClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("PANED-WIDGET-CLASS"),
+                         OPAQUE(panedWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("PANNER-WIDGET-CLASS"),
+                         OPAQUE(pannerWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("PORTHOLE-WIDGET-CLASS"),
+                         OPAQUE(portholeWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("REPEATER-WIDGET-CLASS"),
+                         OPAQUE(repeaterWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("SCROLLBAR-WIDGET-CLASS"),
+                         OPAQUE(scrollbarWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("SIMPLE-MENU-WIDGET-CLASS"),
+                         OPAQUE(simpleMenuWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("SIMPLE-WIDGET-CLASS"),
+                         OPAQUE(simpleWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("SME-BSB-OBJECT-CLASS"),
+                         OPAQUE(smeBSBObjectClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("SME-LINE-OBJECT-CLASS"),
+                         OPAQUE(smeLineObjectClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("SME-OBJECT-CLASS"),
+                         OPAQUE(smeObjectClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("STRIP-CHART-WIDGET-CLASS"),
+                         OPAQUE(stripChartWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("TEXT-WIDGET-CLASS"),
+                         OPAQUE(textWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("TEXT-SINKOBJECT-CLASS"),
+                         OPAQUE(textSinkObjectClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("TEXT-SRC-OBJECT-CLASS"),
+                         OPAQUE(textSrcObjectClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("TIP-WIDGET-CLASS"),
+                         OPAQUE(tipWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("TOGGLE-WIDGET-CLASS"),
+                         OPAQUE(toggleWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("TREE-WIDGET-CLASS"),
+                         OPAQUE(treeWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("VIEWPORT-WIDGET-CLASS"),
+                         OPAQUE(viewportWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("VENDOR-SHELL-WIDGET-CLASS"),
+                         OPAQUE(vendorShellWidgetClass, xawWidgetClass_t),
+                         fname, 0);
+
+    /* return codes of XawTextReplace */
+    (void)LispSetVariable(ATOM2("XAW-REPLACE-ERROR"),
+                         INTEGER(XawReplaceError), fname, 0);
+    (void)LispSetVariable(ATOM2("XAW-EDIT-DONE"),
+                         INTEGER(XawEditDone), fname, 0);
+    (void)LispSetVariable(ATOM2("XAW-EDIT-ERROR"),
+                         INTEGER(XawEditError), fname, 0);
+    (void)LispSetVariable(ATOM2("XAW-POSITION-ERROR"),
+                         INTEGER(XawPositionError), fname, 0);
+
+    /* return code of XawTextSearch */
+    (void)LispSetVariable(ATOM2("XAW-TEXT-SEARCH-ERROR"),
+                         INTEGER(XawTextSearchError), fname, 0);
+
+    /* enum XawTextScanDirection */
+    (void)LispSetVariable(ATOM2("XAWSD-LEFT"),
+                         INTEGER(XawsdLeft), fname, 0);
+    (void)LispSetVariable(ATOM2("XAWSD-RIGHT"),
+                         INTEGER(XawsdRight), fname, 0);
+    GCEnable();
+
+    for (i = 0; i < sizeof(lispbuiltins) / sizeof(lispbuiltins[0]); i++)
+       LispAddBuiltinFunction(&lispbuiltins[i]);
+
+    return (1);
+}
+
+void
+LispXawCleanupCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+    WidgetData *data = (WidgetData*)user_data;
+
+    UPROTECT(CAR(data->object), data->object);
+    XtFree((XtPointer)data->data);
+    XtFree((XtPointer)data);
+}
+
+LispObj *
+Lisp_XawCoerceToListReturnStruct(LispBuiltin *builtin)
+/*
+ xaw-coerce-to-list-return-struct opaque
+ */
+{
+    LispObj *result, *code, *ocod = COD;
+    XawListReturnStruct *retlist;
+
+    LispObj *opaque;
+
+    opaque = ARGUMENT(0);
+
+    if (!CHECKO(opaque, xawListReturnStruct_t))
+       LispDestroy("%s: cannot convert %s to XawListReturnStruct",
+                   STRFUN(builtin), STROBJ(opaque));
+
+    retlist = (XawListReturnStruct*)(opaque->data.opaque.data);
+
+    GCDisable();
+    code = CONS(ATOM("MAKE-XAW-LIST-RETURN-STRUCT"),
+               CONS(KEYWORD("STRING"),
+                      CONS(STRING(retlist->string),
+                           CONS(KEYWORD("INDEX"),
+                                CONS(INTEGER(retlist->list_index), NIL)))));
+    COD = CONS(code, COD);
+    GCEnable();
+
+    result = EVAL(code);
+    COD = ocod;
+
+    return (result);
+}
+
+LispObj *
+Lisp_XawScrollbarCoerceToReal(LispBuiltin *builtin)
+/*
+ xaw-scrollbar-coerce-to-real opaque
+ */
+{
+    float *floatp;
+    double real;
+
+    LispObj *opaque;
+
+    opaque = ARGUMENT(0);
+
+    if (!CHECKO(opaque, xawFloatp_t))
+       LispDestroy("%s: cannot convert %s to float*",
+                   STRFUN(builtin), STROBJ(opaque));
+
+    floatp = (float*)(opaque->data.opaque.data);
+    real = *floatp;
+
+    return (DFLOAT(real));
+}
+
+LispObj *
+Lisp_XawFormDoLayout(LispBuiltin *builtin)
+/*
+ xaw-form-do-layout widget force
+ */
+{
+    int force;
+
+    LispObj *owidget, *oforce;
+
+    oforce = ARGUMENT(1);
+    owidget = ARGUMENT(0);
+
+    if (!CHECKO(owidget, xawWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(owidget));
+
+    force = oforce != NIL;
+    XawFormDoLayout((Widget)(owidget->data.opaque.data), force);
+
+    return (oforce);
+}
+
+LispObj *
+Lisp_XawTextGetSource(LispBuiltin *builtin)
+/*
+ xaw-text-get-source widget
+ */
+{
+    LispObj *owidget;
+
+    owidget = ARGUMENT(0);
+
+    if (!CHECKO(owidget, xawWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(owidget));
+
+    return (OPAQUE(XawTextGetSource((Widget)(owidget->data.opaque.data)),
+                  xawWidget_t));
+}
+
+LispObj *
+Lisp_XawTextLastPosition(LispBuiltin *builtin)
+/*
+ xaw-text-last-position widget
+ */
+{
+    LispObj *owidget;
+
+    owidget = ARGUMENT(0);
+
+    if (!CHECKO(owidget, xawWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(owidget));
+
+    return (FIXNUM(XawTextLastPosition((Widget)(owidget->data.opaque.data))));
+}
+
+LispObj *
+Lisp_XawTextGetInsertionPoint(LispBuiltin *builtin)
+/*
+ xaw-text-get-insertion-point widget
+ */
+{
+    LispObj *owidget;
+
+    owidget = ARGUMENT(0);
+
+    if (!CHECKO(owidget, xawWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(owidget));
+
+    return (FIXNUM(XawTextGetInsertionPoint((Widget)(owidget->data.opaque.data))));
+}
+
+LispObj *
+Lisp_XawTextSetInsertionPoint(LispBuiltin *builtin)
+/*
+ xaw-text-set-insertion-point widget position
+ */
+{
+    Widget widget;
+    XawTextPosition position;
+
+    LispObj *owidget, *oposition;
+
+    oposition = ARGUMENT(1);
+    owidget = ARGUMENT(0);
+
+    if (!CHECKO(owidget, xawWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(owidget));
+    widget = (Widget)(owidget->data.opaque.data);
+
+    CHECK_INDEX(oposition);
+    position = (XawTextPosition)FIXNUM_VALUE(oposition);
+
+    XawTextSetInsertionPoint(widget, position);
+
+    return (oposition);
+}
+
+LispObj *
+Lisp_XawTextReplace(LispBuiltin *builtin)
+/*
+ xaw-text-replace widget left right text
+ */
+{
+    Widget widget;
+    XawTextPosition left, right;
+    XawTextBlock block;
+
+    LispObj *owidget, *oleft, *oright, *otext;
+
+    otext = ARGUMENT(3);
+    oright = ARGUMENT(2);
+    oleft = ARGUMENT(1);
+    owidget = ARGUMENT(0);
+
+    if (!CHECKO(owidget, xawWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(owidget));
+    widget = (Widget)(owidget->data.opaque.data);
+
+    CHECK_INDEX(oleft);
+    left = (XawTextPosition)FIXNUM_VALUE(oleft);
+
+    CHECK_INDEX(oright);
+    right = (XawTextPosition)FIXNUM_VALUE(oright);
+
+    CHECK_STRING(otext);
+    block.firstPos = 0;
+    block.ptr = THESTR(otext);
+    block.length = strlen(block.ptr);
+    block.format = FMT8BIT;
+
+    return (FIXNUM(XawTextReplace(widget, left, right, &block)));
+}
+
+LispObj *
+Lisp_XawTextSearch(LispBuiltin *builtin)
+/*
+ xaw-text-search widget direction text
+ */
+{
+    Widget widget;
+    XawTextScanDirection direction;
+    XawTextBlock block;
+
+    LispObj *owidget, *odirection, *otext;
+
+    otext = ARGUMENT(2);
+    odirection = ARGUMENT(1);
+    owidget = ARGUMENT(0);
+
+    if (!CHECKO(owidget, xawWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(owidget));
+    widget = (Widget)(owidget->data.opaque.data);
+
+    CHECK_INDEX(odirection);
+    direction = (XawTextPosition)FIXNUM_VALUE(odirection);
+    if (direction != XawsdLeft && direction != XawsdRight)
+       LispDestroy("%s: %d does not fit in XawTextScanDirection",
+                   STRFUN(builtin), direction);
+
+    CHECK_STRING(otext);
+    block.firstPos = 0;
+    block.ptr = THESTR(otext);
+    block.length = strlen(block.ptr);
+    block.format = FMT8BIT;
+
+    return (FIXNUM(XawTextSearch(widget, direction, &block)));
+}
+
+LispObj *
+Lisp_XawListChange(LispBuiltin *builtin)
+/*
+ xaw-list-change widget list &optional longest resize
+ */
+{
+    Widget widget;
+    String *list;
+    int i, nitems;
+    int longest;
+    Boolean resize;
+    LispObj *object;
+    WidgetData *data;
+
+    LispObj *owidget, *olist, *olongest, *oresize;
+
+    oresize = ARGUMENT(3);
+    olongest = ARGUMENT(2);
+    olist = ARGUMENT(1);
+    owidget = ARGUMENT(0);
+
+    if (!CHECKO(owidget, xawWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(owidget));
+    widget = (Widget)(owidget->data.opaque.data);
+
+    CHECK_LIST(olist);
+    for (nitems = 0, object = olist; CONSP(object);
+        ++nitems, object = CDR(object))
+       CHECK_STRING(CAR(object));
+
+    if (olongest != UNSPEC) {
+       CHECK_INDEX(olongest);
+       longest = FIXNUM_VALUE(olongest);
+    }
+    else
+       XtVaGetValues(widget, XtNlongest, &longest, NULL, 0);
+    resize = oresize != UNSPEC && oresize != NIL;
+
+    /* No errors in arguments, build string list */
+    list = (String*)XtMalloc(sizeof(String) * nitems);
+    for (i = 0, object = olist; CONSP(object); i++, object = CDR(object))
+       list[i] = THESTR(CAR(object));
+
+    /* Check if xaw-list-change was already called
+      * for this widget and free previous data */
+    for (i = 0; i < num_list_data; i++)
+       if ((Widget)CAR(list_data[i]->object)->data.opaque.data == widget) {
+           XtRemoveCallback(widget, XtNdestroyCallback,
+                            LispXawCleanupCallback, list_data[i]);
+           LispXawCleanupCallback(widget, list_data[i], NULL);
+           break;
+       }
+
+    if (i >= num_list_data) {
+       ++num_list_data;
+       list_data = (WidgetData**)XtRealloc((XtPointer)list_data,
+                                           sizeof(WidgetData*) * num_list_data);
+    }
+
+    data = (WidgetData*)XtMalloc(sizeof(WidgetData));
+    data->data = list;
+    list_data[i] = data;
+    data->object = CONS(owidget, olist);
+    PROTECT(owidget, data->object);
+    XtAddCallback(widget, XtNdestroyCallback, LispXawCleanupCallback, data);
+
+    XawListChange(widget, list, nitems, longest, resize);
+
+    return (olist);
+}
+
+LispObj *
+Lisp_XawListHighlight(LispBuiltin *builtin)
+/*
+ xaw-list-highlight widget index
+ */
+{
+    Widget widget;
+    int position;
+
+    LispObj *owidget, *oindex;
+
+    oindex = ARGUMENT(1);
+    owidget = ARGUMENT(0);
+
+    if (!CHECKO(owidget, xawWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(owidget));
+    widget = (Widget)(owidget->data.opaque.data);
+
+    CHECK_INDEX(oindex);
+    position = FIXNUM_VALUE(oindex);
+
+    XawListHighlight(widget, position);
+
+    return (oindex);
+}
+
+LispObj *
+Lisp_XawListUnhighlight(LispBuiltin *builtin)
+/*
+ xaw-list-unhighlight widget
+ */
+{
+    LispObj *owidget;
+
+    owidget = ARGUMENT(0);
+
+    if (!CHECKO(owidget, xawWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(owidget));
+
+    XawListUnhighlight((Widget)(owidget->data.opaque.data));
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_XawScrollbarSetThumb(LispBuiltin *builtin)
+/*
+ xaw-scrollbar-set-thumb widget top &optional shown
+ */
+{
+    Widget widget;
+    double top, shown;
+
+    LispObj *owidget, *otop, *oshown;
+
+    oshown = ARGUMENT(2);
+    otop = ARGUMENT(1);
+    owidget = ARGUMENT(0);
+
+    if (!CHECKO(owidget, xawWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(owidget));
+    widget = (Widget)(owidget->data.opaque.data);
+
+    CHECK_DFLOAT(otop);
+    top = DFLOAT_VALUE(otop);
+
+    if (oshown == UNSPEC)
+       shown = 1.0;
+    else {
+       CHECK_DFLOAT(oshown);
+       shown = DFLOAT_VALUE(oshown);
+    }
+
+    XawScrollbarSetThumb(widget, top, shown);
+
+    return (oshown == UNSPEC ? DFLOAT(shown) : oshown);
+}
diff --git a/xedit/lisp/modules/xedit.lsp b/xedit/lisp/modules/xedit.lsp
new file mode 100644 (file)
index 0000000..9b916d5
--- /dev/null
@@ -0,0 +1,569 @@
+;;
+;; Copyright (c) 2002 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XdotOrg: xc/programs/xedit/lisp/modules/xedit.lsp,v 1.2 2004/04/23 19:54:45 eich Exp $
+;; $XFree86: xc/programs/xedit/lisp/modules/xedit.lsp,v 1.9 2003/01/16 03:50:46 paulo Exp $
+;;
+
+(provide "xedit")
+
+#+debug        (make-package "XEDIT" :use '("LISP" "EXT"))
+(in-package "XEDIT")
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  TODO The user should be able to define *auto-modes* prior to the
+;; initialization here in a configuration file, since defvar only binds
+;; the variable if it is unbound or doesn't have a value defined.
+;;  *auto-modes* is a list of conses where every car is compiled
+;; to a regexp to match the name of the file being loaded. The caddr is
+;; either a string, a pathname, or a syntax-p.
+;;  When loading a file, if the regexp in the car matches, it will check
+;; the caddr value, and if it is a:
+;;     string:         executes (load "progmodes/<the-string>.lsp")
+;;     pathname:       executes (load <the-pathhame>)
+;;     syntax-p:       does nothing, already loaded
+;;
+;;  If it fails to load the file, or the returned value is not a
+;; syntax-p, the entry is removed.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defvar *auto-modes* '(
+    ("\\.(c|cc|C|cxx|cpp|h|hpp|bm|xbm|xpm|y|h\\.in)$"
+       "C/C++"         "c"     . *c-mode*)
+    ("\\.(l|li?sp|scm)$"
+       "Lisp/Scheme"   "lisp"  . *lisp-mode*)
+    ("\\.sh$"
+       "Unix shell"    "sh"    . *sh-mode*)
+    ("\\.(diff|patch)"
+       "Patch file"    "patch" . *patch-mode*)
+    ("/[Mm]akefile.*|\\.mk$"
+       "Makefile"      "make"  . *make-mode*)
+    ("\\.(ac|in|m4)$"
+       "Autotools"     "auto"  . *auto-mode*)
+    ("\\.spec$"
+       "RPM spec"      "rpm"   . *rpm-mode*)
+    ("\\.(pl|pm|ph)$"
+       "Perl"          "perl"  . *perl-mode*)
+    ("\\.(py)$"
+       "Python"        "python". *python-mode*)
+    ("\\.(sgml?|dtd)$"
+       "SGML"          "sgml"  . *sgml-mode*)
+    ("\\.html?$"
+       "HTML"          "html"  . *html-mode*)
+    ("\\.(man|\\d)$"
+       "Man page"      "man"   . *man-mode*)
+    ("app-defaults/\\w+|\\u[A-Za-z0-9_-]+\\.ad"
+       "X resource"    "xrdb"  . *xrdb-mode*)
+    ("\\<(XF86Config|xorg.conf)[^/]*"
+       "XF86Config"    "xconf" . *xconf-mode*)
+    ("\\<(XFree86|Xorg)\\.\\d+\\.log(\\..*|$)"
+       "XFree86 log"   "xlog"  . *xlog-mode*)
+    ("Imakefile|(\\.(cf|rules|tmpl|def)$)"
+       "X imake"       "imake" . *imake-mode*)
+))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Compile the regexps in the *auto-modes* list.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(dolist (mode *auto-modes*)
+    (rplaca mode (re-comp (car mode) :nosub t))
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Find the progmode associated with the given filename.
+;; Returns nil if nothing matches.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun auto-mode (filename &optional symbol &aux syntax)
+    (if (and symbol (symbolp symbol))
+       (if (boundp symbol)
+           (return-from auto-mode (symbol-value symbol))
+           (setq syntax (cddr (find symbol *auto-modes* :key #'cdddr)))
+       )
+       ;; symbol optional argument is not a symbol
+       (do*
+           (
+           (mode   *auto-modes*    (cdr mode))
+           (regex  (caar mode)     (caar mode))
+           )
+           ((endp mode))
+
+           ;; only wants to know if the regex match.
+           (when (listp (re-exec regex filename :count 0))
+               (setq syntax (cddar mode) symbol (cdr syntax))
+               (return)
+           )
+       )
+    )
+
+    ;; if file was already loaded
+    (if (and symbol (boundp symbol))
+       (return-from auto-mode (symbol-value symbol))
+    )
+
+    (when (consp syntax)
+       ;; point to the syntax file specification
+       (setq syntax (car syntax))
+
+       ;; try to load the syntax definition file
+       (if (stringp syntax)
+           (load
+               (string-concat
+                   (namestring *default-pathname-defaults*)
+                   "progmodes/"
+                   syntax
+                   ".lsp"
+               )
+           )
+           (load syntax)
+       )
+
+       (and symbol (boundp symbol) (symbol-value symbol))
+    )
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Data types.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  The main syntax structure, normally, only one should exist per
+;; syntax highlight module.
+;;  The structure is defined here so it is not required to load all
+;; the extra data associated with syntax-highlight at initialization
+;; time, and will never be loaded if no syntax-highlight mode is
+;; defined to the files being edited.
+(defstruct syntax
+    name               ;;  A unique string to identify the syntax mode.
+                       ;; Should be the name of the language/file type.
+    options            ;;  A hash table of options specified for the
+                       ;; language.
+
+    ;; Field(s) defined at "compile time"
+    labels             ;;  Not exactly a list of labels, but all syntax
+                       ;; tables for the module.
+    quark              ;;  A XrmQuark associated with the XawTextPropertyList
+                       ;; used by this syntax mode.
+    token-count                ;;  Number of distinct syntoken structures in
+                       ;; the syntax table.
+)
+
+;;  Xlfd description, used when combining properties.
+;;  Field names are self descriptive.
+;;     XXX Fields should be initialized as strings, but fields
+;;         that have an integer value should be allowed to
+;;         be initialized as such.
+;;  Combining properties in supported in Xaw, but not yet in the
+;; syntax highlight code interface. Combining properties allow easier
+;; implementation for markup languages, for example:
+;;     <b>bold<i>italic</i></b>
+;;     would render "bold" using a bold version of the default font,
+;;     and "italic" using a bold and italic version of the default font
+(defstruct xlfd
+    foundry
+    family
+    weight
+    slant
+    setwidth
+    addstyle
+    pixel-size
+    point-size
+    res-x
+    res-y
+    spacing
+    avgwidth
+    registry
+    encoding
+)
+
+
+;;   At some time this structure should also hold information for at least:
+;;     o fontset
+;;     o foreground pixmap
+;;     o background pixmap
+;;   XXX This is also a TODO in Xaw.
+(defstruct synprop
+    quark      ;;   XrmQuark identifier of the XawTextProperty
+               ;; structure. This field is filled when "compiling"
+               ;; the syntax-table.
+
+    name       ;;   String name of property, must be unique per
+               ;; property list.
+    font       ;; Optional font string name of property.
+    foreground ;; Optional string representation of foreground color.
+    background ;; Optional string representation of background color.
+    xlfd       ;;   Optional xlfd structure, when combining properties.
+               ;; Currently combining properties logic not implemented,
+               ;; but fonts may be specified using the xlfd definition.
+
+    ;; Boolean properties.
+    underline  ;; Draw a line below the text.
+    overstrike ;; Draw a line over the text.
+
+    ;; XXX Are these working in Xaw?
+    subscript  ;; Align text to the bottom of the line.
+    superscript        ;; Align text to the top of the line.
+    ;;  Note: subscript and superscript only have effect when the text
+    ;; line has different height fonts displayed.
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  Utility macro, to create a "special" variable holding
+;; a synprop structure.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defmacro defsynprop (variable name
+                     &key font foreground background xlfd underline
+                          overstrike subscript superscript)
+    `(progn
+       (proclaim '(special ,variable))
+       (setq ,variable
+           (make-synprop
+               :name           ,name
+               :font           ,font
+               :foreground     ,foreground
+               :background     ,background
+               :xlfd           ,xlfd
+               :underline      ,underline
+               :overstrike     ,overstrike
+               :subscript      ,subscript
+               :superscript    ,superscript
+           )
+       )
+    )
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  Convert a synprop structure  to a string in the format
+;; expected by Xaw.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun synprop-to-string (synprop &aux values booleans xlfd)
+    (if (setq xlfd (synprop-xlfd synprop))
+       (dolist
+           (element
+              `(
+               ("foundry"          ,(xlfd-foundry xlfd))
+               ("family"           ,(xlfd-family xlfd))
+               ("weight"           ,(xlfd-weight xlfd))
+               ("slant"            ,(xlfd-slant xlfd))
+               ("setwidth"         ,(xlfd-setwidth xlfd))
+               ("addstyle"         ,(xlfd-addstyle xlfd))
+               ("pixelsize"        ,(xlfd-pixel-size xlfd))
+               ("pointsize"        ,(xlfd-point-size xlfd))
+               ("resx"             ,(xlfd-res-x xlfd))
+               ("resy"             ,(xlfd-res-y xlfd))
+               ("spacing"          ,(xlfd-spacing xlfd))
+               ("avgwidth"         ,(xlfd-avgwidth xlfd))
+               ("registry"         ,(xlfd-registry xlfd))
+               ("encoding"         ,(xlfd-encoding xlfd))
+               )
+           )
+           (if (cadr element)
+               (setq values (append values element))
+           )
+       )
+    )
+    (dolist
+       (element
+          `(
+           ("font"             ,(synprop-font synprop))
+           ("foreground"       ,(synprop-foreground synprop))
+           ("background"       ,(synprop-background synprop))
+           )
+       )
+       (if (cadr element)
+           (setq values (append values element))
+       )
+    )
+
+    ;;  Boolean attributes. These can be specified in the format
+    ;; <name>=<anything>, but do a nicer output as the format
+    ;; <name> is accepted.
+    (dolist
+       (element
+           `(
+           ("underline"        ,(synprop-underline synprop))
+           ("overstrike"       ,(synprop-overstrike synprop))
+           ("subscript"        ,(synprop-subscript synprop))
+           ("superscript"      ,(synprop-superscript synprop))
+           )
+       )
+       (if (cadr element)
+           (setq booleans (append booleans element))
+       )
+    )
+
+    ;;  Play with format conditionals, list iteration, and goto, to
+    ;; make resulting string.
+    (format
+       nil
+       "~A~:[~;?~]~:[~3*~;~A=~A~{&~A=~A~}~]~:[~;&~]~:[~2*~;~A~{&~A~*~}~]"
+
+       (synprop-name synprop)                          ;; ~A
+       (or values booleans)                            ;; ~:[~;?~]
+       values                                          ;; ~:[
+           (car values) (cadr values) (cddr values)    ;; ~A=~A~{&~A=~A~}
+       (and values booleans)                           ;; ~:[~;&~]
+       booleans                                        ;; ~:[
+           (car booleans) (cddr booleans)              ;; ~A~{&~A~*~}
+    )
+)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;  Use xedit protocol to create a XawTextPropertyList with the
+;; given arguments.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun compile-syntax-property-list (name properties
+                                    &aux string-properties quark)
+
+    ;; Create a string representation of the properties.
+    (dolist (property properties)
+       (setq
+           string-properties
+           (append
+               string-properties
+               (list (synprop-to-string property))
+           )
+       )
+    )
+
+    (setq
+       string-properties
+       (case (length string-properties)
+           (0  "")
+           (1  (car string-properties))
+           (t  (format nil "~A~{,~A~}"
+                   (car string-properties)
+                   (cdr string-properties)
+               )
+           )
+       )
+    )
+
+#+debug
+    (format *output* "~Cconvert-property-list ~S ~S~%"
+       *escape*
+       name
+       string-properties
+    )
+    (setq quark #-debug (convert-property-list name string-properties)
+               #+debug 0)
+
+    ;; Store the quark for properties not yet "initialized".
+    ;; XXX This is just a call to Xrm{Perm,}StringToQuark, and should
+    ;;     be made available if there were a wrapper/interface to
+    ;;     that Xlib function.
+    (dolist (property properties)
+       (unless (integerp (synprop-quark property))
+#+debug
+           (format *output* "~Cxrm-string-to-quark ~S~%"
+               *escape*
+               (synprop-name property)
+           )
+           (setf
+               (synprop-quark property)
+#-debug                (xrm-string-to-quark (synprop-name property))
+#+debug                0
+           )
+       )
+    )
+
+    quark
+)
+
+
+
+
+#+debug
+(progn
+    (defconstant *escape* #\$)
+
+    (defconstant *output* *standard-output*)
+
+    ;; Recognized identifiers for wrap mode.
+    (defconstant *wrap-modes* '(:never :line :word))
+
+    ;; Recognized identifiers for justification.
+    (defconstant *justifications* '(:left :right :center :full))
+
+    ;; XawTextScanType
+    (defconstant *scan-type*
+       '(:positions :white-space :eol :paragraph :all :alpha-numeric))
+
+    ;; XawTextScanDirection
+    (defconstant *scan-direction* '(:left :right))
+
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    ;; Debugging version of xedit functions.
+    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+    (defun clear-entities (left right)
+       (format *output* "~Cclear-entities ~D ~D~%"
+           *escape* left right))
+
+    (defun add-entity (offset length identifier)
+       (format *output* "~Cadd-entity ~D ~D ~D~%"
+           *escape* offset length identifier))
+
+    (defun background (&optional (value nil specified))
+       (if specified
+           (format *output* "~Cset-background ~S~%" *escape* value)
+           (format *output* "~Cget-background~%" *escape*)))
+
+    (defun foreground (&optional (value nil specified))
+       (if specified
+           (format *output* "~Cset-foreground ~S~%" *escape* value)
+           (format *output* "~Cget-foreground~%" *escape*)))
+
+    (defun font (&optional (value nil specified))
+       (if specified
+           (format *output* "~Cset-font ~S~%" *escape* value)
+           (format *output* "~Cget-font~%" *escape*)))
+
+    (defun point (&optional (value nil specified))
+       (if specified
+           (format *output* "~Cset-point ~D~%" *escape* value)
+           (format *output* "~Cget-point~%" *escape*)))
+
+    (defun point-min ()
+       (format *output* "~Cpoint-min~%" *escape*))
+
+    (defun point-max ()
+       (format *output* "~Cpoint-max~%" *escape*))
+
+    (defun property-list (&optional (quark nil specified))
+       (format *output* "~property-list ~D~%" *escape* quark))
+
+    (defun insert (string)
+       (format *output* "~Cinsert ~S~%" *escape* string))
+
+    (defun read-text (offset length)
+       (format *output* "~Cread-text ~D ~D~%"
+           *escape* offset length))
+
+    (defun replace-text (left right string)
+       (format *output* "~Creplace-text ~D ~D ~S~%"
+           *escape* left right string))
+
+    (defun scan (offset type direction &key (count 1) include)
+       (unless (setq type (position type *scan-type*))
+           (error "SCAN: type must be one of ~A, not ~A"
+               *scan-type* type))
+       (unless (setq direction (position direction *scan-direction*))
+           (error "SCAN: direction must be one of ~A, not ~A"
+               *scan-direction* direction))
+       (format *output* "~Cscan ~D ~D ~D ~D ~D~%"
+           *escape* offset type direction count (if include 1 0)))
+
+    (defun search-forward (string &optional case-sensitive)
+       (format *output* "~Csearch-forward ~S ~D~%"
+           *escape* string (if case-sensitive 1 0)))
+
+    (defun search-backward (string &optional case-sensitive)
+       (format *output* "~Csearch-backward ~S ~D~%"
+           *escape* string (if case-sensitive 1 0)))
+
+    (defun wrap-mode (&optional (value nil specified))
+       (if specified
+           (progn
+               (unless (member value *wrap-modes*)
+                   (error "WRAP-MODE: argument must be one of ~A, not ~A"
+                       *wrap-modes* value))
+               (format *output* "~Cset-wrap-mode ~S~%"
+                   *escape* (string value)))
+           (format *output* "~Cget-wrap-mode~%" *escape*)))
+
+    (defun auto-fill (&optional (value nil specified))
+       (if specified
+           (format *output* "~Cset-auto-fill ~S~%"
+               *escape* (if value "true" "false"))
+           (format *output* "~Cget-auto-fill~%" *escape*)))
+
+    (defun justification (&optional (value nil specified))
+       (if specified
+           (progn
+               (unless (member value *justifications*)
+                   (error "JUSTIFICATION: argument must be one of ~A, not ~A"
+                       *justifications* value))
+               (format *output* "~Cset-justification ~S~%"
+                   *escape* (string value)))
+           (format *output* "~Cget-justification~%" *escape*)))
+
+    (defun left-column (&optional (value nil specified))
+       (if specified
+           (format *output* "~Cset-left-column ~D~%" *escape* value)
+           (format *output* "~Cget-left-column~%" *escape*)))
+
+    (defun right-column (&optional (value nil specified))
+       (if specified
+           (format *output* "~Cset-right-column ~D~%" *escape* value)
+           (format *output* "~Cget-right-column~%" *escape*)))
+
+    (defun vertical-scrollbar (&optional (value nil specified))
+       (if specified
+           (format *output* "~Cset-vert-scrollbar ~S~%"
+               *escape* (if value "always" "never"))
+           (format *output* "~Cget-vert-scrollbar~%" *escape*)))
+
+    (defun horizontal-scrollbar (&optional (value nil specified))
+       (if specified
+           (format *output* "~Cset-horiz-scrollbar ~S~%"
+               *escape* (if value "always" "never"))
+           (format *output* "~Cget-horiz-scrollbar~%" *escape*)))
+
+    #|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+    (defun create-buffer (name)
+       (format *output* "~Ccreate-buffer ~S~%" *escape* name))
+
+    (defun remove-buffer (name)
+       (format *output* "~Cremove-buffer ~S~%" *escape* name))
+
+    (defun buffer-name (&optional (value nil specified))
+       (if specified
+           (format *output* "~Cset-buffer-name ~S~%" *escape* value)
+           (format *output* "~Cget-buffer-name~%" *escape*)))
+
+    (defun buffer-filename (&optional (value nil specified))
+       (if specified
+           (format *output* "~Cset-buffer-filename ~S~%"
+               *escape* (namestring value))
+           (format *output* "~Cget-buffer-filename~%" *escape*)))
+
+    (defun current-buffer (&optional (value nil specified))
+       (if specified
+           (format *output* "~Cset-current-buffer ~S~%" *escape* value)
+           (format *output* "~Cget-current-buffer~%" *escape*)))
+
+    (defun other-buffer (&optional (value nil specified))
+       (if specified
+           (format *output* "~Cset-other-buffer ~S~%" *escape* value)
+           (format *output* "~Cget-other-buffer~%" *escape*)))
+    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||#
+)
diff --git a/xedit/lisp/modules/xt.c b/xedit/lisp/modules/xt.c
new file mode 100644 (file)
index 0000000..5ea51b2
--- /dev/null
@@ -0,0 +1,1799 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/modules/xt.c,v 1.20tsi Exp $ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Shell.h>
+#include "lisp/internal.h"
+#include "lisp/private.h"
+
+/*
+ * Types
+ */
+typedef struct {
+    XrmQuark qname;
+    XrmQuark qtype;
+    Cardinal size;
+} ResourceInfo;
+
+typedef struct {
+    WidgetClass widget_class;
+    ResourceInfo **resources;
+    Cardinal num_resources;
+    Cardinal num_cons_resources;
+} ResourceList;
+
+typedef struct {
+    Arg *args;
+    Cardinal num_args;
+} Resources;
+
+typedef struct {
+    LispObj *data;
+    /* data is => (list* widget callback argument) */
+} CallbackArgs;
+
+/*
+ * Prototypes
+ */
+int xtLoadModule(void);
+void LispXtCleanupCallback(Widget, XtPointer, XtPointer);
+
+void LispXtCallback(Widget, XtPointer, XtPointer);
+void LispXtInputCallback(XtPointer, int*, XtInputId*);
+
+/* a hack... */
+LispObj *Lisp_XtCoerceToWidgetList(LispBuiltin*);
+
+LispObj *Lisp_XtAddCallback(LispBuiltin*);
+LispObj *Lisp_XtAppInitialize(LispBuiltin*);
+LispObj *Lisp_XtAppMainLoop(LispBuiltin*);
+LispObj *Lisp_XtAppAddInput(LispBuiltin*);
+LispObj *Lisp_XtAppPending(LispBuiltin*);
+LispObj *Lisp_XtAppProcessEvent(LispBuiltin*);
+LispObj *Lisp_XtCreateWidget(LispBuiltin*);
+LispObj *Lisp_XtCreateManagedWidget(LispBuiltin*);
+LispObj *Lisp_XtCreatePopupShell(LispBuiltin*);
+LispObj *Lisp_XtDestroyWidget(LispBuiltin*);
+LispObj *Lisp_XtGetKeyboardFocusWidget(LispBuiltin*);
+LispObj *Lisp_XtGetValues(LispBuiltin*);
+LispObj *Lisp_XtManageChild(LispBuiltin*);
+LispObj *Lisp_XtUnmanageChild(LispBuiltin*);
+LispObj *Lisp_XtSetMappedWhenManaged(LispBuiltin*);
+LispObj *Lisp_XtMapWidget(LispBuiltin*);
+LispObj *Lisp_XtName(LispBuiltin*);
+LispObj *Lisp_XtParent(LispBuiltin*);
+LispObj *Lisp_XtUnmapWidget(LispBuiltin*);
+LispObj *Lisp_XtPopup(LispBuiltin*);
+LispObj *Lisp_XtPopdown(LispBuiltin*);
+LispObj *Lisp_XtIsRealized(LispBuiltin*);
+LispObj *Lisp_XtRealizeWidget(LispBuiltin*);
+LispObj *Lisp_XtUnrealizeWidget(LispBuiltin*);
+LispObj *Lisp_XtRemoveInput(LispBuiltin*);
+LispObj *Lisp_XtSetSensitive(LispBuiltin*);
+LispObj *Lisp_XtSetValues(LispBuiltin*);
+LispObj *Lisp_XtWidgetToApplicationContext(LispBuiltin*);
+LispObj *Lisp_XtDisplay(LispBuiltin*);
+LispObj *Lisp_XtDisplayOfObject(LispBuiltin*);
+LispObj *Lisp_XtScreen(LispBuiltin*);
+LispObj *Lisp_XtScreenOfObject(LispBuiltin*);
+LispObj *Lisp_XtSetKeyboardFocus(LispBuiltin*);
+LispObj *Lisp_XtWindow(LispBuiltin*);
+LispObj *Lisp_XtWindowOfObject(LispBuiltin*);
+LispObj *Lisp_XtAddGrab(LispBuiltin*);
+LispObj *Lisp_XtRemoveGrab(LispBuiltin*);
+LispObj *Lisp_XtAppGetExitFlag(LispBuiltin*);
+LispObj *Lisp_XtAppSetExitFlag(LispBuiltin*);
+
+LispObj *LispXtCreateWidget(LispBuiltin*, int);
+
+static Resources *LispConvertResources(LispObj*, Widget,
+                                      ResourceList*, ResourceList*);
+static void LispFreeResources(Resources*);
+
+static int bcmp_action_resource(_Xconst void*, _Xconst void*);
+static ResourceInfo *GetResourceInfo(char*, ResourceList*, ResourceList*);
+static ResourceList *GetResourceList(WidgetClass);
+static int bcmp_action_resource_list(_Xconst void*, _Xconst void*);
+static ResourceList *FindResourceList(WidgetClass);
+static int qcmp_action_resource_list(_Xconst void*, _Xconst void*);
+static ResourceList *CreateResourceList(WidgetClass);
+static int qcmp_action_resource(_Xconst void*, _Xconst void*);
+static void BindResourceList(ResourceList*);
+
+static void PopdownAction(Widget, XEvent*, String*, Cardinal*);
+static void QuitAction(Widget, XEvent*, String*, Cardinal*);
+
+/*
+ * Initialization
+ */
+static LispBuiltin lispbuiltins[] = {
+    {LispFunction, Lisp_XtCoerceToWidgetList, "xt-coerce-to-widget-list number opaque"},
+
+    {LispFunction, Lisp_XtAddGrab, "xt-add-grab widget exclusive spring-loaded"},
+    {LispFunction, Lisp_XtAddCallback, "xt-add-callback widget callback-name callback &optional client-data"},
+    {LispFunction, Lisp_XtAppAddInput, "xt-app-add-input app-context fileno condition function &optional client-data"},
+    {LispFunction, Lisp_XtAppInitialize, "xt-app-initialize app-context-return application-class &optional options fallback-resources"},
+    {LispFunction, Lisp_XtAppPending, "xt-app-pending app-context"},
+    {LispFunction, Lisp_XtAppMainLoop, "xt-app-main-loop app-context"},
+    {LispFunction, Lisp_XtAppProcessEvent, "xt-app-process-event app-context &optional mask"},
+    {LispFunction, Lisp_XtAppGetExitFlag, "xt-app-get-exit-flag app-context"},
+    {LispFunction, Lisp_XtAppSetExitFlag, "xt-app-set-exit-flag app-context"},
+    {LispFunction, Lisp_XtCreateManagedWidget, "xt-create-managed-widget name widget-class parent &optional arguments"},
+    {LispFunction, Lisp_XtCreateWidget, "xt-create-widget name widget-class parent &optional arguments"},
+    {LispFunction, Lisp_XtCreatePopupShell, "xt-create-popup-shell name widget-class parent &optional arguments"},
+    {LispFunction, Lisp_XtDestroyWidget, "xt-destroy-widget widget"},
+    {LispFunction, Lisp_XtGetKeyboardFocusWidget, "xt-get-keyboard-focus-widget widget"},
+    {LispFunction, Lisp_XtGetValues, "xt-get-values widget arguments"},
+    {LispFunction, Lisp_XtManageChild, "xt-manage-child widget"},
+    {LispFunction, Lisp_XtName, "xt-name widget"},
+    {LispFunction, Lisp_XtUnmanageChild, "xt-unmanage-child widget"},
+    {LispFunction, Lisp_XtMapWidget, "xt-map-widget widget"},
+    {LispFunction, Lisp_XtUnmapWidget, "xt-unmap-widget widget"},
+    {LispFunction, Lisp_XtSetMappedWhenManaged, "xt-set-mapped-when-managed widget map-when-managed"},
+    {LispFunction, Lisp_XtParent, "xt-parent widget"},
+    {LispFunction, Lisp_XtPopup, "xt-popup widget grab-kind"},
+    {LispFunction, Lisp_XtPopdown, "xt-popdown widget"},
+    {LispFunction, Lisp_XtIsRealized, "xt-is-realized widget"},
+    {LispFunction, Lisp_XtRealizeWidget, "xt-realize-widget widget"},
+    {LispFunction, Lisp_XtUnrealizeWidget, "xt-unrealize-widget widget"},
+    {LispFunction, Lisp_XtRemoveInput, "xt-remove-input input"},
+    {LispFunction, Lisp_XtRemoveGrab, "xt-remove-grab widget"},
+    {LispFunction, Lisp_XtSetKeyboardFocus, "xt-set-keyboard-focus widget descendant"},
+    {LispFunction, Lisp_XtSetSensitive, "xt-set-sensitive widget sensitive"},
+    {LispFunction, Lisp_XtSetValues, "xt-set-values widget arguments"},
+    {LispFunction, Lisp_XtWidgetToApplicationContext, "xt-widget-to-application-context widget"},
+    {LispFunction, Lisp_XtDisplay, "xt-display widget"},
+    {LispFunction, Lisp_XtDisplayOfObject, "xt-display-of-object object"},
+    {LispFunction, Lisp_XtScreen, "xt-screen widget"},
+    {LispFunction, Lisp_XtScreenOfObject, "xt-screen-of-object object"},
+    {LispFunction, Lisp_XtWindow, "xt-window widget"},
+    {LispFunction, Lisp_XtWindowOfObject, "xt-window-of-object object"},
+};
+
+LispModuleData xtLispModuleData = {
+    LISP_MODULE_VERSION,
+    xtLoadModule,
+};
+
+static ResourceList **resource_list;
+static Cardinal num_resource_list;
+
+static Atom delete_window;
+static int xtAppContext_t, xtWidget_t, xtWidgetClass_t, xtWidgetList_t,
+          xtInputId_t, xtDisplay_t, xtScreen_t, xtWindow_t;
+
+static XtActionsRec actions[] = {
+    {"xt-popdown",     PopdownAction},
+    {"xt-quit",                QuitAction},
+};
+
+static XrmQuark qCardinal, qInt, qString, qWidget, qFloat;
+
+static CallbackArgs **input_list;
+static Cardinal num_input_list, size_input_list;
+
+/*
+ * Implementation
+ */
+int
+xtLoadModule(void)
+{
+    int i;
+    char *fname = "XT-LOAD-MODULE";
+
+    xtAppContext_t = LispRegisterOpaqueType("XtAppContext");
+    xtWidget_t = LispRegisterOpaqueType("Widget");
+    xtWidgetClass_t = LispRegisterOpaqueType("WidgetClass");
+    xtWidgetList_t = LispRegisterOpaqueType("WidgetList");
+    xtInputId_t = LispRegisterOpaqueType("XtInputId");
+    xtDisplay_t = LispRegisterOpaqueType("Display*");
+    xtScreen_t = LispRegisterOpaqueType("Screen*");
+    xtWindow_t = LispRegisterOpaqueType("Window");
+
+    LispExecute("(DEFSTRUCT XT-WIDGET-LIST NUM-CHILDREN CHILDREN)\n");
+
+    GCDisable();
+    (void)LispSetVariable(ATOM2("CORE-WIDGET-CLASS"),
+                         OPAQUE(coreWidgetClass, xtWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("COMPOSITE-WIDGET-CLASS"),
+                         OPAQUE(compositeWidgetClass, xtWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("CONSTRAINT-WIDGET-CLASS"),
+                         OPAQUE(constraintWidgetClass, xtWidgetClass_t),
+                         fname, 0);
+    (void)LispSetVariable(ATOM2("TRANSIENT-SHELL-WIDGET-CLASS"),
+                         OPAQUE(transientShellWidgetClass, xtWidgetClass_t),
+                         fname, 0);
+
+    /* parameters for XtPopup */
+    (void)LispSetVariable(ATOM2("XT-GRAB-EXCLUSIVE"),
+                         INTEGER(XtGrabExclusive), fname, 0);
+    (void)LispSetVariable(ATOM2("XT-GRAB-NONE"),
+                         INTEGER(XtGrabNone), fname, 0);
+    (void)LispSetVariable(ATOM2("XT-GRAB-NONE-EXCLUSIVE"),
+                         INTEGER(XtGrabNonexclusive), fname, 0);
+
+    /* parameters for XtAppProcessEvent */
+    (void)LispSetVariable(ATOM2("XT-IM-XEVENT"),
+                         INTEGER(XtIMXEvent), fname, 0);
+    (void)LispSetVariable(ATOM2("XT-IM-TIMER"),
+                         INTEGER(XtIMTimer), fname, 0);
+    (void)LispSetVariable(ATOM2("XT-IM-ALTERNATE-INPUT"),
+                         INTEGER(XtIMAlternateInput), fname, 0);
+    (void)LispSetVariable(ATOM2("XT-IM-SIGNAL"),
+                         INTEGER(XtIMSignal), fname, 0);
+    (void)LispSetVariable(ATOM2("XT-IM-ALL"),
+                         INTEGER(XtIMAll), fname, 0);
+
+    /* parameters for XtAppAddInput */
+    (void)LispSetVariable(ATOM2("XT-INPUT-READ-MASK"),
+                         INTEGER(XtInputReadMask), fname, 0);
+    (void)LispSetVariable(ATOM2("XT-INPUT-WRITE-MASK"),
+                         INTEGER(XtInputWriteMask), fname, 0);
+    (void)LispSetVariable(ATOM2("XT-INPUT-EXCEPT-MASK"),
+                         INTEGER(XtInputExceptMask), fname, 0);
+    GCEnable();
+
+    qCardinal = XrmPermStringToQuark(XtRCardinal);
+    qInt = XrmPermStringToQuark(XtRInt);
+    qString = XrmPermStringToQuark(XtRString);
+    qWidget = XrmPermStringToQuark(XtRWidget);
+    qFloat = XrmPermStringToQuark(XtRFloat);
+
+    for (i = 0; i < sizeof(lispbuiltins) / sizeof(lispbuiltins[0]); i++)
+       LispAddBuiltinFunction(&lispbuiltins[i]);
+
+    return (1);
+}
+
+void
+LispXtCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+    CallbackArgs *args = (CallbackArgs*)user_data;
+    LispObj *code, *ocod = COD;
+
+    GCDisable();
+               /* callback name */        /* reall caller */
+    code = CONS(CDR(CDR(args->data)), CONS(OPAQUE(w, xtWidget_t),
+               CONS(CAR(CDR(args->data)), CONS(OPAQUE(call_data, 0), NIL))));
+                    /* user arguments */
+    COD = CONS(code, COD);
+    GCEnable();
+
+    (void)EVAL(code);
+    COD = ocod;
+}
+
+
+void
+LispXtCleanupCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+    CallbackArgs *args = (CallbackArgs*)user_data;
+
+    UPROTECT(CAR(args->data), args->data);
+    XtFree((XtPointer)args);
+}
+
+void
+LispXtInputCallback(XtPointer closure, int *source, XtInputId *id)
+{
+    CallbackArgs *args = (CallbackArgs*)closure;
+    LispObj *code, *ocod = COD;
+
+    GCDisable();
+               /* callback name */       /* user arguments */
+    code = CONS(CDR(CDR(args->data)), CONS(CAR(CDR(args->data)),
+               CONS(INTEGER(*source), CONS(CAR(args->data), NIL))));
+                    /* input source */    /* input id */
+    COD = CONS(code, COD);
+    GCEnable();
+
+    (void)EVAL(code);
+    COD = ocod;
+}
+
+LispObj *
+Lisp_XtCoerceToWidgetList(LispBuiltin *builtin)
+/*
+ xt-coerce-to-widget-list number opaque
+ */
+{
+    int i;
+    WidgetList children;
+    Cardinal num_children;
+    LispObj *cons, *widget_list, *result;
+
+    LispObj *onumber, *opaque;
+
+    opaque = ARGUMENT(1);
+    onumber = ARGUMENT(0);
+
+    CHECK_INDEX(onumber);
+    num_children = FIXNUM_VALUE(onumber);
+
+    if (!CHECKO(opaque, xtWidgetList_t))
+       LispDestroy("%s: cannot convert %s to WidgetList",
+                   STRFUN(builtin), STROBJ(opaque));
+    children = (WidgetList)(opaque->data.opaque.data);
+
+    GCDisable();
+    widget_list = cons = NIL;
+    for (i = 0; i < num_children; i++) {
+       result = CONS(OPAQUE(children[i], xtWidget_t), NIL);
+       if (widget_list == NIL)
+           widget_list = cons = result;
+       else {
+           RPLACD(cons, result);
+           cons = CDR(cons);
+       }
+    }
+
+    result = APPLY(ATOM("MAKE-XT-WIDGET-LIST"),
+                  CONS(KEYWORD("NUM-CHILDREN"),
+                       CONS(INTEGER(num_children),
+                            CONS(KEYWORD("CHILDREN"),
+                                 CONS(widget_list, NIL)))));
+    GCEnable();
+
+    return (result);
+}
+
+LispObj *
+Lisp_XtAddCallback(LispBuiltin *builtin)
+/*
+ xt-add-callback widget callback-name callback &optional client-data
+ */
+{
+    CallbackArgs *arguments;
+    LispObj *data;
+
+    LispObj *widget, *callback_name, *callback, *client_data;
+
+    client_data = ARGUMENT(3);
+    callback = ARGUMENT(2);
+    callback_name = ARGUMENT(1);
+    widget = ARGUMENT(0);
+
+    if (!CHECKO(widget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(widget));
+
+    CHECK_STRING(callback_name);
+    if (!SYMBOLP(callback) && callback->type != LispLambda_t)
+       LispDestroy("%s: %s cannot be used as a callback",
+                   STRFUN(builtin), STROBJ(callback));
+
+    if (client_data == UNSPEC)
+       client_data = NIL;
+
+    data = CONS(widget, CONS(client_data, callback));
+    PROTECT(widget, data);
+
+    arguments = XtNew(CallbackArgs);
+    arguments->data = data;
+
+    XtAddCallback((Widget)(widget->data.opaque.data), THESTR(callback_name),
+                 LispXtCallback, (XtPointer)arguments);
+    XtAddCallback((Widget)(widget->data.opaque.data), XtNdestroyCallback,
+                 LispXtCleanupCallback, (XtPointer)arguments);
+
+    return (client_data);
+}
+
+LispObj *
+Lisp_XtAppAddInput(LispBuiltin *builtin)
+/*
+  xt-app-add-input app-context fileno condition function &optional client-data
+ */
+{
+    LispObj *data, *input;
+    XtAppContext appcon;
+    int source, condition;
+    CallbackArgs *arguments;
+    XtInputId id;
+
+    LispObj *app_context, *fileno, *ocondition, *function, *client_data;
+
+    client_data = ARGUMENT(4);
+    function = ARGUMENT(3);
+    ocondition = ARGUMENT(2);
+    fileno = ARGUMENT(1);
+    app_context = ARGUMENT(0);
+
+    if (!CHECKO(app_context, xtAppContext_t))
+       LispDestroy("%s: cannot convert %s to XtAppContext",
+                   STRFUN(builtin), STROBJ(app_context));
+    appcon = (XtAppContext)(app_context->data.opaque.data);
+
+    CHECK_LONGINT(fileno);
+    source = LONGINT_VALUE(fileno);
+
+    CHECK_FIXNUM(ocondition);
+    condition = FIXNUM_VALUE(ocondition);
+
+    if (!SYMBOLP(function) && function->type != LispLambda_t)
+       LispDestroy("%s: %s cannot be used as a callback",
+                   STRFUN(builtin), STROBJ(function));
+
+    /* client data optional */
+    if (client_data == UNSPEC)
+       client_data = NIL;
+
+    data = CONS(NIL, CONS(client_data, function));
+
+    arguments = XtNew(CallbackArgs);
+    arguments->data = data;
+
+    id = XtAppAddInput(appcon, source, (XtPointer)condition,
+                      LispXtInputCallback, (XtPointer)arguments);
+    GCDisable();
+    input = OPAQUE(id, xtInputId_t);
+    GCEnable();
+    RPLACA(data, input);
+    PROTECT(input, data);
+
+    if (num_input_list + 1 >= size_input_list) {
+       ++size_input_list;
+       input_list = (CallbackArgs**)
+           XtRealloc((XtPointer)input_list,
+                     sizeof(CallbackArgs*) * size_input_list);
+    }
+    input_list[num_input_list++] = arguments;
+
+    return (input);
+}
+
+LispObj *
+Lisp_XtRemoveInput(LispBuiltin *builtin)
+/*
+ xt-remove-input input
+ */
+{
+    int i;
+    XtInputId id;
+    CallbackArgs *args;
+
+    LispObj *input;
+
+    input = ARGUMENT(0);
+
+    if (!CHECKO(input, xtInputId_t))
+       LispDestroy("%s: cannot convert %s to XtInputId",
+                   STRFUN(builtin), STROBJ(input));
+
+    id = (XtInputId)(input->data.opaque.data);
+    for (i = 0; i < num_input_list; i++) {
+       args = input_list[i];
+       if (id == (XtInputId)(CAR(args->data)->data.opaque.data)) {
+           UPROTECT(CAR(args->data), args->data);
+           XtFree((XtPointer)args);
+
+           if (i + 1 < num_input_list)
+               memmove(input_list + i, input_list + i + 1,
+                       sizeof(CallbackArgs*) * (num_input_list - i - 1));
+           --num_input_list;
+
+           XtRemoveInput(id);
+
+           return (T);
+       }
+    }
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_XtAppInitialize(LispBuiltin *builtin)
+/*
+ xt-app-initialize app-context-return application-class &optional options fallback-resources
+ */
+{
+    XtAppContext appcon;
+    Widget shell;
+    int zero = 0;
+    Resources *resources = NULL;
+    String *fallback = NULL;
+
+    LispObj *app_context_return, *application_class,
+           *options, *fallback_resources;
+
+    fallback_resources = ARGUMENT(3);
+    options = ARGUMENT(2);
+    application_class = ARGUMENT(1);
+    app_context_return = ARGUMENT(0);
+
+    CHECK_SYMBOL(app_context_return);
+    CHECK_STRING(application_class);
+    CHECK_LIST(options);
+
+    /* check fallback resources, if given */
+    if (fallback_resources != UNSPEC) {
+       LispObj *string;
+       int count;
+
+       CHECK_CONS(fallback_resources);
+       for (string = fallback_resources, count = 0; CONSP(string);
+            string = CDR(string), count++)
+           CHECK_STRING(CAR(string));
+
+       /* fallback resources was correctly specified */
+       fallback = LispMalloc(sizeof(String) * (count + 1));
+       for (string = fallback_resources, count = 0; CONSP(string);
+            string = CDR(string), count++)
+           fallback[count] = THESTR(CAR(string));
+       fallback[count] = NULL;
+    }
+
+    shell = XtAppInitialize(&appcon, THESTR(application_class), NULL,
+                           0, &zero, NULL, fallback, NULL, 0);
+    if (fallback)
+       LispFree(fallback);
+    (void)LispSetVariable(app_context_return,
+                         OPAQUE(appcon, xtAppContext_t),
+                         STRFUN(builtin), 0);
+
+    XtAppAddActions(appcon, actions, XtNumber(actions));
+
+    if (options != UNSPEC) {
+       resources = LispConvertResources(options, shell,
+                                        GetResourceList(XtClass(shell)),
+                                        NULL);
+       if (resources) {
+           XtSetValues(shell, resources->args, resources->num_args);
+           LispFreeResources(resources);
+       }
+    }
+
+    return (OPAQUE(shell, xtWidget_t));
+}
+
+LispObj *
+Lisp_XtAppMainLoop(LispBuiltin *builtin)
+/*
+ xt-app-main-loop app-context
+ */
+{
+    LispObj *app_context;
+
+    app_context = ARGUMENT(0);
+
+    if (!CHECKO(app_context, xtAppContext_t))
+       LispDestroy("%s: cannot convert %s to XtAppContext",
+                   STRFUN(builtin), STROBJ(app_context));
+
+    XtAppMainLoop((XtAppContext)(app_context->data.opaque.data));
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_XtAppPending(LispBuiltin *builtin)
+/*
+ xt-app-pending app-context
+ */
+{
+    LispObj *app_context;
+
+    app_context = ARGUMENT(0);
+
+    if (!CHECKO(app_context, xtAppContext_t))
+       LispDestroy("%s: cannot convert %s to XtAppContext",
+                   STRFUN(builtin), STROBJ(app_context));
+
+    return (INTEGER(
+           XtAppPending((XtAppContext)(app_context->data.opaque.data))));
+}
+
+LispObj *
+Lisp_XtAppProcessEvent(LispBuiltin *builtin)
+/*
+ xt-app-process-event app-context &optional mask
+ */
+{
+    XtInputMask mask;
+    XtAppContext appcon;
+
+    LispObj *app_context, *omask;
+
+    omask = ARGUMENT(1);
+    app_context = ARGUMENT(0);
+
+    if (!CHECKO(app_context, xtAppContext_t))
+       LispDestroy("%s: cannot convert %s to XtAppContext",
+                   STRFUN(builtin), STROBJ(app_context));
+
+    appcon = (XtAppContext)(app_context->data.opaque.data);
+    if (omask == UNSPEC)
+       mask = XtIMAll;
+    else {
+       CHECK_FIXNUM(omask);
+       mask = FIXNUM_VALUE(omask);
+    }
+
+    if (mask != (mask & XtIMAll))
+       LispDestroy("%s: %ld does not fit in XtInputMask %ld",
+                   STRFUN(builtin), (long)mask, (long)XtIMAll);
+
+    if (mask)
+       XtAppProcessEvent(appcon, mask);
+
+    return (omask == NIL ? FIXNUM(mask) : omask);
+}
+
+LispObj *
+Lisp_XtRealizeWidget(LispBuiltin *builtin)
+/*
+ xt-realize-widget widget
+ */
+{
+    Widget widget;
+
+    LispObj *owidget;
+
+    owidget = ARGUMENT(0);
+
+    if (!CHECKO(owidget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(owidget));
+    widget = (Widget)(owidget->data.opaque.data);
+    XtRealizeWidget(widget);
+
+    if (XtIsSubclass(widget, shellWidgetClass)) {
+       if (!delete_window)
+           delete_window = XInternAtom(XtDisplay(widget),
+                                       "WM_DELETE_WINDOW", False);
+       (void)XSetWMProtocols(XtDisplay(widget), XtWindow(widget),
+                             &delete_window, 1);
+    }
+
+    return (owidget);
+}
+
+LispObj *
+Lisp_XtUnrealizeWidget(LispBuiltin *builtin)
+/*
+ xt-unrealize-widget widget
+ */
+{
+    LispObj *widget;
+
+    widget = ARGUMENT(0);
+
+    if (!CHECKO(widget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(widget));
+
+    XtUnrealizeWidget((Widget)(widget->data.opaque.data));
+
+    return (widget);
+}
+
+LispObj *
+Lisp_XtIsRealized(LispBuiltin *builtin)
+/*
+ xt-is-realized widget
+ */
+{
+    LispObj *widget;
+
+    widget = ARGUMENT(0);
+
+    if (!CHECKO(widget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(widget));
+
+    return (XtIsRealized((Widget)(widget->data.opaque.data)) ? T : NIL);
+}
+
+LispObj *
+Lisp_XtDestroyWidget(LispBuiltin *builtin)
+/*
+ xt-destroy-widget widget
+ */
+{
+    LispObj *widget;
+
+    widget = ARGUMENT(0);
+
+    if (!CHECKO(widget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(widget));
+
+    XtDestroyWidget((Widget)(widget->data.opaque.data));
+
+    return (NIL);
+}
+
+#define UNMANAGED      0
+#define MANAGED                1
+#define SHELL          2
+LispObj *
+Lisp_XtCreateWidget(LispBuiltin *builtin)
+/*
+ xt-create-widget name widget-class parent &optional arguments
+ */
+{
+    return (LispXtCreateWidget(builtin, UNMANAGED));
+}
+
+LispObj *
+Lisp_XtCreateManagedWidget(LispBuiltin *builtin)
+/*
+ xt-create-managed-widget name widget-class parent &optional arguments
+ */
+{
+    return (LispXtCreateWidget(builtin, MANAGED));
+}
+
+LispObj *
+Lisp_XtCreatePopupShell(LispBuiltin *builtin)
+/*
+ xt-create-popup-shell name widget-class parent &optional arguments
+ */
+{
+    return (LispXtCreateWidget(builtin, SHELL));
+}
+
+LispObj *
+LispXtCreateWidget(LispBuiltin *builtin, int options)
+/*
+ xt-create-widget name widget-class parent &optional arguments
+ xt-create-managed-widget name widget-class parent &optional arguments
+ xt-create-popup-shell name widget-class parent &optional arguments
+ */
+{
+    char *name;
+    WidgetClass widget_class;
+    Widget widget, parent;
+    Resources *resources = NULL;
+
+    LispObj *oname, *owidget_class, *oparent, *arguments;
+
+    arguments = ARGUMENT(3);
+    oparent = ARGUMENT(2);
+    owidget_class = ARGUMENT(1);
+    oname = ARGUMENT(0);
+
+    CHECK_STRING(oname);
+    name = THESTR(oname);
+
+    if (!CHECKO(owidget_class, xtWidgetClass_t))
+       LispDestroy("%s: cannot convert %s to WidgetClass",
+                   STRFUN(builtin), STROBJ(owidget_class));
+    widget_class = (WidgetClass)(owidget_class->data.opaque.data);
+
+    if (!CHECKO(oparent, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(oparent));
+    parent = (Widget)(oparent->data.opaque.data);
+
+    if (arguments == UNSPEC)
+       arguments = NIL;
+    CHECK_LIST(arguments);
+
+    if (options == SHELL)
+       widget = XtCreatePopupShell(name, widget_class, parent, NULL, 0);
+    else
+       widget = XtCreateWidget(name, widget_class, parent, NULL, 0);
+
+    if (arguments == NIL)
+       resources = NULL;
+    else {
+       resources = LispConvertResources(arguments, widget,
+                                        GetResourceList(widget_class),
+                                        GetResourceList(XtClass(parent)));
+       XtSetValues(widget, resources->args, resources->num_args);
+    }
+    if (options == MANAGED)
+       XtManageChild(widget);
+    if (resources)
+       LispFreeResources(resources);
+
+    return (OPAQUE(widget, xtWidget_t));
+}
+
+LispObj *
+Lisp_XtGetKeyboardFocusWidget(LispBuiltin *builtin)
+/*
+ xt-get-keyboard-focus-widget widget
+ */
+{
+    LispObj *widget;
+
+    widget = ARGUMENT(0);
+
+    if (!CHECKO(widget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(widget));
+    return (OPAQUE(XtGetKeyboardFocusWidget((Widget)(widget->data.opaque.data)),
+                  xtWidget_t));
+}
+
+LispObj *
+Lisp_XtGetValues(LispBuiltin *builtin)
+/*
+ xt-get-values widget arguments
+ */
+{
+    Arg args[1];
+    Widget widget;
+    ResourceList *rlist, *plist;
+    ResourceInfo *resource;
+    LispObj *list, *object = NIL, *result, *cons = NIL;
+    char c1;
+    short c2;
+    int c4;
+#ifdef LONG64
+    long c8;
+#endif
+
+    LispObj *owidget, *arguments;
+
+    arguments = ARGUMENT(1);
+    owidget = ARGUMENT(0);
+
+    if (arguments == NIL)
+       return (NIL);
+
+    if (!CHECKO(owidget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(owidget));
+    widget = (Widget)(owidget->data.opaque.data);
+    CHECK_CONS(arguments);
+
+    rlist = GetResourceList(XtClass(widget));
+    plist =  XtParent(widget) ?
+            GetResourceList(XtClass(XtParent(widget))) : NULL;
+
+    GCDisable();
+    result = NIL;
+    for (list = arguments; CONSP(list); list = CDR(list)) {
+       CHECK_STRING(CAR(list));
+       if ((resource = GetResourceInfo(THESTR(CAR(list)), rlist, plist))
+            == NULL) {
+           int i;
+           Widget child;
+
+           for (i = 0; i < rlist->num_resources; i++) {
+               if (rlist->resources[i]->qtype == qWidget) {
+                   XtSetArg(args[0],
+                            XrmQuarkToString(rlist->resources[i]->qname),
+                            &child);
+                   XtGetValues(widget, args, 1);
+                   if (child && XtParent(child) == widget) {
+                       resource =
+                           GetResourceInfo(THESTR(CAR(list)),
+                                           GetResourceList(XtClass(child)),
+                                           NULL);
+                       if (resource)
+                           break;
+                   }
+               }
+           }
+           if (resource == NULL) {
+               LispMessage("%s: resource %s not available",
+                           STRFUN(builtin), THESTR(CAR(list)));
+               continue;
+           }
+       }
+       switch (resource->size) {
+           case 1:
+               XtSetArg(args[0], THESTR(CAR(list)), &c1);
+               break;
+           case 2:
+               XtSetArg(args[0], THESTR(CAR(list)), &c2);
+               break;
+           case 4:
+               XtSetArg(args[0], THESTR(CAR(list)), &c4);
+               break;
+#ifdef LONG64
+           case 1:
+               XtSetArg(args[0], THESTR(CAR(list)), &c8);
+               break;
+#endif
+       }
+       XtGetValues(widget, args, 1);
+
+       /* special resources */
+       if (resource->qtype == qString) {
+#ifdef LONG64
+           object = CONS(CAR(list), STRING((char*)c8));
+#else
+           object = CONS(CAR(list), STRING((char*)c4));
+#endif
+       }
+       else if (resource->qtype == qCardinal || resource->qtype == qInt) {
+#ifdef LONG64
+           if (sizeof(int) == 8)
+               object = CONS(CAR(list), INTEGER(c8));
+           else
+#endif
+           object = CONS(CAR(list), INTEGER(c4));
+       }
+       else {
+           switch (resource->size) {
+               case 1:
+                   object = CONS(CAR(list), OPAQUE(c1, 0));
+                   break;
+               case 2:
+                   object = CONS(CAR(list), OPAQUE(c2, 0));
+                   break;
+               case 4:
+                   object = CONS(CAR(list), OPAQUE(c4, 0));
+                   break;
+#ifdef LONG64
+               case 8:
+                   object = CONS(CAR(list), OPAQUE(c8, 0));
+                   break;
+#endif
+           }
+       }
+
+       if (result == NIL)
+           result = cons = CONS(object, NIL);
+       else {
+           RPLACD(cons, CONS(object, NIL));
+           cons = CDR(cons);
+       }
+    }
+    GCEnable();
+
+    return (result);
+}
+
+LispObj *
+Lisp_XtManageChild(LispBuiltin *builtin)
+/*
+ xt-manage-child widget
+ */
+{
+    LispObj *widget;
+
+    widget = ARGUMENT(0);
+
+    if (!CHECKO(widget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(widget));
+    XtManageChild((Widget)(widget->data.opaque.data));
+
+    return (widget);
+}
+
+LispObj *
+Lisp_XtUnmanageChild(LispBuiltin *builtin)
+/*
+ xt-unmanage-child widget
+ */
+{
+    LispObj *widget;
+
+    widget = ARGUMENT(0);
+
+    if (!CHECKO(widget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(widget));
+    XtUnmanageChild((Widget)(widget->data.opaque.data));
+
+    return (widget);
+}
+
+LispObj *
+Lisp_XtMapWidget(LispBuiltin *builtin)
+/*
+ xt-map-widget widget
+ */
+{
+    LispObj *widget;
+
+    widget = ARGUMENT(0);
+
+    if (!CHECKO(widget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(widget));
+    XtMapWidget((Widget)(widget->data.opaque.data));
+
+    return (widget);
+}
+
+LispObj *
+Lisp_XtUnmapWidget(LispBuiltin *builtin)
+/*
+ xt-unmap-widget widget
+ */
+{
+    LispObj *widget;
+
+    widget = ARGUMENT(0);
+
+    if (!CHECKO(widget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(widget));
+    XtUnmapWidget((Widget)(widget->data.opaque.data));
+
+    return (widget);
+}
+
+LispObj *
+Lisp_XtSetMappedWhenManaged(LispBuiltin *builtin)
+/*
+ xt-set-mapped-when-managed widget map-when-managed
+ */
+{
+    LispObj *widget, *map_when_managed;
+
+    map_when_managed = ARGUMENT(1);
+    widget = ARGUMENT(0);
+
+    if (!CHECKO(widget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(widget));
+
+    XtSetMappedWhenManaged((Widget)(widget->data.opaque.data),
+                          map_when_managed != NIL);
+
+    return (map_when_managed);
+}
+
+LispObj *
+Lisp_XtPopup(LispBuiltin *builtin)
+/*
+ xt-popup widget grab-kind
+ */
+{
+    XtGrabKind kind;
+
+    LispObj *widget, *grab_kind;
+
+    grab_kind = ARGUMENT(1);
+    widget = ARGUMENT(0);
+
+    if (!CHECKO(widget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(widget));
+    CHECK_INDEX(grab_kind);
+    kind = (XtGrabKind)FIXNUM_VALUE(grab_kind);
+    if (kind != XtGrabExclusive && kind != XtGrabNone &&
+       kind != XtGrabNonexclusive)
+       LispDestroy("%s: %d does not fit in XtGrabKind",
+                   STRFUN(builtin), kind);
+    XtPopup((Widget)(widget->data.opaque.data), kind);
+
+    return (grab_kind);
+}
+
+LispObj *
+Lisp_XtPopdown(LispBuiltin *builtin)
+/*
+ xt-popdown widget
+ */
+{
+    LispObj *widget;
+
+    widget = ARGUMENT(0);
+
+    if (!CHECKO(widget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(widget));
+    XtPopdown((Widget)(widget->data.opaque.data));
+
+    return (widget);
+}
+
+LispObj *
+Lisp_XtSetKeyboardFocus(LispBuiltin *builtin)
+/*
+ xt-set-keyboard-focus widget descendant
+ */
+{
+    LispObj *widget, *descendant;
+
+    descendant = ARGUMENT(1);
+    widget = ARGUMENT(0);
+
+    if (!CHECKO(widget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(widget));
+    if (!CHECKO(descendant, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(descendant));
+    XtSetKeyboardFocus((Widget)(widget->data.opaque.data),
+                      (Widget)(descendant->data.opaque.data));
+
+    return (widget);
+}
+
+LispObj *
+Lisp_XtSetSensitive(LispBuiltin *builtin)
+/*
+ xt-set-sensitive widget sensitive
+ */
+{
+    LispObj *widget, *sensitive;
+
+    sensitive = ARGUMENT(1);
+    widget = ARGUMENT(0);
+
+    if (!CHECKO(widget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(widget));
+    XtSetSensitive((Widget)(widget->data.opaque.data), sensitive != NIL);
+
+    return (sensitive);
+}
+
+LispObj *
+Lisp_XtSetValues(LispBuiltin *builtin)
+/*
+ xt-set-values widget arguments
+ */
+{
+    Widget widget;
+    Resources *resources;
+
+    LispObj *owidget, *arguments;
+
+    arguments = ARGUMENT(1);
+    owidget = ARGUMENT(0);
+
+    if (arguments == NIL)
+       return (owidget);
+
+    if (!CHECKO(owidget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(owidget));
+    widget = (Widget)(owidget->data.opaque.data);
+    CHECK_CONS(arguments);
+    resources = LispConvertResources(arguments, widget,
+                                    GetResourceList(XtClass(widget)),
+                                    XtParent(widget) ?
+                                       GetResourceList(XtClass(XtParent(widget))) :
+                                       NULL);
+    XtSetValues(widget, resources->args, resources->num_args);
+    LispFreeResources(resources);
+
+    return (owidget);
+}
+
+LispObj *
+Lisp_XtWidgetToApplicationContext(LispBuiltin *builtin)
+/*
+ xt-widget-to-application-context widget
+ */
+{
+    Widget widget;
+    XtAppContext appcon;
+
+    LispObj *owidget;
+
+    owidget = ARGUMENT(0);
+
+    if (!CHECKO(owidget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(owidget));
+    widget = (Widget)(owidget->data.opaque.data);
+    appcon = XtWidgetToApplicationContext(widget);
+
+    return (OPAQUE(appcon, xtAppContext_t));
+}
+
+LispObj *
+Lisp_XtDisplay(LispBuiltin *builtin)
+/*
+ xt-display widget
+ */
+{
+    Widget widget;
+    Display *display;
+
+    LispObj *owidget;
+
+    owidget = ARGUMENT(0);
+
+    if (!CHECKO(owidget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(owidget));
+    widget = (Widget)(owidget->data.opaque.data);
+    display = XtDisplay(widget);
+
+    return (OPAQUE(display, xtDisplay_t));
+}
+
+LispObj *
+Lisp_XtDisplayOfObject(LispBuiltin *builtin)
+/*
+ xt-display-of-object object
+ */
+{
+    Widget widget;
+    Display *display;
+
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    if (!CHECKO(object, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(object));
+    widget = (Widget)(object->data.opaque.data);
+    display = XtDisplayOfObject(widget);
+
+    return (OPAQUE(display, xtDisplay_t));
+}
+
+LispObj *
+Lisp_XtScreen(LispBuiltin *builtin)
+/*
+ xt-screen widget
+ */
+{
+    Widget widget;
+    Screen *screen;
+
+    LispObj *owidget;
+
+    owidget = ARGUMENT(0);
+
+    if (!CHECKO(owidget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(owidget));
+    widget = (Widget)(owidget->data.opaque.data);
+    screen = XtScreen(widget);
+
+    return (OPAQUE(screen, xtScreen_t));
+}
+
+LispObj *
+Lisp_XtScreenOfObject(LispBuiltin *builtin)
+/*
+ xt-screen-of-object object
+ */
+{
+    Widget widget;
+    Screen *screen;
+
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    if (!CHECKO(object, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(object));
+    widget = (Widget)(object->data.opaque.data);
+    screen = XtScreenOfObject(widget);
+
+    return (OPAQUE(screen, xtScreen_t));
+}
+
+LispObj *
+Lisp_XtWindow(LispBuiltin *builtin)
+/*
+ xt-window widget
+ */
+{
+    Widget widget;
+    Window window;
+
+    LispObj *owidget;
+
+    owidget = ARGUMENT(0);
+
+    if (!CHECKO(owidget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(owidget));
+    widget = (Widget)(owidget->data.opaque.data);
+    window = XtWindow(widget);
+
+    return (OPAQUE(window, xtWindow_t));
+}
+
+LispObj *
+Lisp_XtWindowOfObject(LispBuiltin *builtin)
+/*
+ xt-window-of-object widget
+ */
+{
+    Widget widget;
+    Window window;
+
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    if (!CHECKO(object, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(object));
+    widget = (Widget)(object->data.opaque.data);
+    window = XtWindowOfObject(widget);
+
+    return (OPAQUE(window, xtWindow_t));
+}
+
+LispObj *
+Lisp_XtAddGrab(LispBuiltin *builtin)
+/*
+ xt-add-grab widget exclusive spring-loaded
+ */
+{
+    Widget widget;
+    Bool exclusive, spring_loaded;
+
+    LispObj *owidget, *oexclusive, *ospring_loaded;
+
+    ospring_loaded = ARGUMENT(2);
+    oexclusive = ARGUMENT(1);
+    owidget = ARGUMENT(0);
+
+    if (!CHECKO(owidget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(owidget));
+    widget = (Widget)(owidget->data.opaque.data);
+    exclusive = oexclusive != NIL;
+    spring_loaded = ospring_loaded != NIL;
+
+    XtAddGrab(widget, exclusive, spring_loaded);
+
+    return (T);
+}
+
+LispObj *
+Lisp_XtRemoveGrab(LispBuiltin *builtin)
+/*
+ xt-remove-grab widget
+ */
+{
+    LispObj *widget;
+
+    widget = ARGUMENT(0);
+
+    if (!CHECKO(widget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(widget));
+
+    XtRemoveGrab((Widget)(widget->data.opaque.data));
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_XtName(LispBuiltin *builtin)
+/*
+ xt-name widget
+ */
+{
+    LispObj *widget;
+
+    widget = ARGUMENT(0);
+
+    if (!CHECKO(widget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(widget));
+
+    return (STRING(XtName((Widget)(widget->data.opaque.data))));
+}
+
+LispObj *
+Lisp_XtParent(LispBuiltin *builtin)
+/*
+ xt-parent widget
+ */
+{
+    LispObj *widget;
+
+    widget = ARGUMENT(0);
+
+    if (!CHECKO(widget, xtWidget_t))
+       LispDestroy("%s: cannot convert %s to Widget",
+                   STRFUN(builtin), STROBJ(widget));
+
+    return (OPAQUE(XtParent((Widget)widget->data.opaque.data), xtWidget_t));
+}
+
+LispObj *
+Lisp_XtAppGetExitFlag(LispBuiltin *builtin)
+/*
+ xt-app-get-exit-flag app-context
+ */
+{
+    LispObj *app_context;
+
+    app_context = ARGUMENT(0);
+
+    if (!CHECKO(app_context, xtAppContext_t))
+       LispDestroy("%s: cannot convert %s to XtAppContext",
+                   STRFUN(builtin), STROBJ(app_context));
+
+    return (XtAppGetExitFlag((XtAppContext)(app_context->data.opaque.data)) ?
+           T : NIL);
+}
+
+LispObj *
+Lisp_XtAppSetExitFlag(LispBuiltin *builtin)
+/*
+ xt-app-get-exit-flag app-context
+ */
+{
+    LispObj *app_context;
+
+    app_context = ARGUMENT(0);
+
+    if (!CHECKO(app_context, xtAppContext_t))
+       LispDestroy("%s: cannot convert %s to XtAppContext",
+                   STRFUN(builtin), STROBJ(app_context));
+
+    XtAppSetExitFlag((XtAppContext)(app_context->data.opaque.data));
+
+    return (T);
+}
+
+static Resources *
+LispConvertResources(LispObj *list, Widget widget,
+                    ResourceList *rlist, ResourceList *plist)
+{
+    char c1;
+    short c2;
+    int c4;   
+#ifdef LONG64
+    long c8;
+#endif
+    XrmValue from, to;
+    LispObj *arg, *val;
+    ResourceInfo *resource;
+    char *fname = "XT-CONVERT-RESOURCES";
+    Resources *resources = (Resources*)XtCalloc(1, sizeof(Resources));
+
+    for (; CONSP(list); list = CDR(list)) {
+       if (!CONSP(CAR(list))) {
+           XtFree((XtPointer)resources);
+           LispDestroy("%s: %s is not a cons", fname, STROBJ(CAR(list)));
+       }
+       arg = CAR(CAR(list));
+       val = CDR(CAR(list));
+
+       if (!STRINGP(arg)) {
+           XtFree((XtPointer)resources);
+           LispDestroy("%s: %s is not a string", fname, STROBJ(arg));
+       }
+
+       if ((resource = GetResourceInfo(THESTR(arg), rlist, plist)) == NULL) {
+           int i;
+           Arg args[1];
+           Widget child;
+
+           for (i = 0; i < rlist->num_resources; i++) {
+               if (rlist->resources[i]->qtype == qWidget) {
+                   XtSetArg(args[0],
+                            XrmQuarkToString(rlist->resources[i]->qname),
+                            &child);
+                   XtGetValues(widget, args, 1);
+                   if (child && XtParent(child) == widget) {
+                       resource =
+                           GetResourceInfo(THESTR(arg),
+                                           GetResourceList(XtClass(child)),
+                                           NULL);
+                       if (resource)
+                           break;
+                   }
+               }
+           }
+           if (resource == NULL) {
+               LispMessage("%s: resource %s not available",
+                           fname, THESTR(arg));
+               continue;
+           }
+       }
+
+       if (LONGINTP(val) || DFLOATP(val) || OPAQUEP(val)) {
+           resources->args = (Arg*)
+               XtRealloc((XtPointer)resources->args,
+                         sizeof(Arg) * (resources->num_args + 1));
+           if (!OPAQUEP(val)) {
+               float fvalue;
+
+               if (DFLOATP(val))
+                   fvalue = DFLOAT_VALUE(val);
+               else
+                   fvalue = LONGINT_VALUE(val);
+               if (resource->qtype == qFloat) {
+                   XtSetArg(resources->args[resources->num_args],
+                            XrmQuarkToString(resource->qname), fvalue);
+               }
+               else
+                   XtSetArg(resources->args[resources->num_args],
+                            XrmQuarkToString(resource->qname),
+                            (int)fvalue);
+           }
+           else
+               XtSetArg(resources->args[resources->num_args],
+                        XrmQuarkToString(resource->qname), val->data.opaque.data);
+           ++resources->num_args;
+           continue;
+       }
+       else if (val == NIL) {
+           /* XXX assume it is a pointer or a boolean */
+#ifdef DEBUG
+           LispWarning("%s: assuming %s is a pointer or boolean",
+                       fname, XrmQuarkToString(resource->qname));
+#endif
+           resources->args = (Arg*)
+               XtRealloc((XtPointer)resources->args,
+                         sizeof(Arg) * (resources->num_args + 1));
+           XtSetArg(resources->args[resources->num_args],
+                    XrmQuarkToString(resource->qname), NULL);
+           ++resources->num_args;
+           continue;
+       }
+       else if (val == T) {
+           /* XXX assume it is a boolean */
+#ifdef DEBUG
+           LispWarning("%s: assuming %s is a boolean",
+                       fname, XrmQuarkToString(resource->qname));
+#endif
+           resources->args = (Arg*)
+               XtRealloc((XtPointer)resources->args,
+                         sizeof(Arg) * (resources->num_args + 1));
+           XtSetArg(resources->args[resources->num_args],
+                    XrmQuarkToString(resource->qname), True);
+           ++resources->num_args;
+           continue;
+       }
+       else if (!STRINGP(val)) {
+           XtFree((XtPointer)resources);
+           LispDestroy("%s: resource value must be string, number or opaque, not %s",
+                       fname, STROBJ(val));
+       }
+
+       from.size = val == NIL ? 1 : strlen(THESTR(val)) + 1;
+       from.addr = val == NIL ? "" : THESTR(val);
+       switch (to.size = resource->size) {
+           case 1:
+               to.addr = (XtPointer)&c1;
+               break;
+           case 2:
+               to.addr = (XtPointer)&c2;
+               break;
+           case 4:
+               to.addr = (XtPointer)&c4;
+               break;
+#ifdef LONG64
+           case 8:
+               to.addr = (XtPointer)&c8;
+               break;
+#endif
+           default:
+               LispWarning("%s: bad resource size %d for %s",
+                           fname, to.size, THESTR(arg));
+               continue;
+       }
+
+       if (qString == resource->qtype)
+#ifdef LONG64
+           c8 = (long)from.addr;
+#else
+           c4 = (long)from.addr;
+#endif
+       else if (!XtConvertAndStore(widget, XtRString, &from,
+                                   XrmQuarkToString(resource->qtype), &to))
+           /* The type converter already have printed an error message */
+           continue;
+
+       resources->args = (Arg*)
+           XtRealloc((XtPointer)resources->args,
+                     sizeof(Arg) * (resources->num_args + 1));
+       switch (to.size) {
+           case 1:
+               XtSetArg(resources->args[resources->num_args],
+                        XrmQuarkToString(resource->qname), c1);
+               break;
+           case 2:
+               XtSetArg(resources->args[resources->num_args],
+                        XrmQuarkToString(resource->qname), c2);
+               break;
+           case 4:
+               XtSetArg(resources->args[resources->num_args],
+                        XrmQuarkToString(resource->qname), c4);
+               break;
+#ifdef LONG64
+           case 8:
+               XtSetArg(resources->args[resources->num_args],
+                        XrmQuarkToString(resource->qname), c8);
+               break;
+#endif
+       }
+       ++resources->num_args;
+    }
+
+    return (resources);
+}
+
+static void
+LispFreeResources(Resources *resources)
+{
+    if (resources) {
+       XtFree((XtPointer)resources->args);
+       XtFree((XtPointer)resources);
+    }
+}
+
+static int
+bcmp_action_resource(_Xconst void *string, _Xconst void *resource)
+{
+    return (strcmp((String)string,
+                  XrmQuarkToString((*(ResourceInfo**)resource)->qname)));
+}   
+
+static ResourceInfo *
+GetResourceInfo(char *name, ResourceList *rlist, ResourceList *plist)
+{
+    ResourceInfo **resource = NULL;
+
+    if (rlist->resources)
+       resource = (ResourceInfo**)
+           bsearch(name, rlist->resources, rlist->num_resources,
+                   sizeof(ResourceInfo*), bcmp_action_resource);
+
+    if (resource == NULL && plist) {
+       resource = (ResourceInfo**)
+         bsearch(name, &plist->resources[plist->num_resources],
+                 plist->num_cons_resources, sizeof(ResourceInfo*),
+                 bcmp_action_resource);
+    }
+
+    return (resource ? *resource : NULL);
+}
+
+static ResourceList *
+GetResourceList(WidgetClass wc)
+{
+    ResourceList *list;
+
+    if ((list = FindResourceList(wc)) == NULL)
+       list = CreateResourceList(wc);
+
+    return (list);
+}
+
+static int
+bcmp_action_resource_list(_Xconst void *wc, _Xconst void *list)
+{
+    return ((char*)wc - (char*)((*(ResourceList**)list)->widget_class));
+}
+
+static ResourceList *
+FindResourceList(WidgetClass wc)
+{  
+    ResourceList **list;
+
+    if (!resource_list)
+       return (NULL);
+
+    list = (ResourceList**)
+       bsearch(wc, resource_list, num_resource_list,
+               sizeof(ResourceList*),  bcmp_action_resource_list);
+
+    return (list ? *list : NULL);
+}
+
+static int
+qcmp_action_resource_list(_Xconst void *left, _Xconst void *right)
+{
+    return ((char*)((*(ResourceList**)left)->widget_class) -
+           (char*)((*(ResourceList**)right)->widget_class));
+}
+
+static ResourceList *
+CreateResourceList(WidgetClass wc)
+{
+    ResourceList *list;
+
+    list = (ResourceList*)XtMalloc(sizeof(ResourceList));
+    list->widget_class = wc;
+    list->num_resources = list->num_cons_resources = 0;
+    list->resources = NULL;
+
+    resource_list = (ResourceList**)
+       XtRealloc((XtPointer)resource_list, sizeof(ResourceList*) *
+                 (num_resource_list + 1));
+    resource_list[num_resource_list++] = list;
+    qsort(resource_list, num_resource_list, sizeof(ResourceList*),
+         qcmp_action_resource_list);
+    BindResourceList(list);
+
+    return (list);
+}
+
+static int
+qcmp_action_resource(_Xconst void *left, _Xconst void *right)
+{
+    return (strcmp(XrmQuarkToString((*(ResourceInfo**)left)->qname),
+                  XrmQuarkToString((*(ResourceInfo**)right)->qname)));
+}
+
+static void
+BindResourceList(ResourceList *list)
+{
+    XtResourceList xt_list, cons_list;
+    Cardinal i, num_xt, num_cons;
+
+    XtGetResourceList(list->widget_class, &xt_list, &num_xt);
+    XtGetConstraintResourceList(list->widget_class, &cons_list, &num_cons);
+    list->num_resources = num_xt;
+    list->num_cons_resources = num_cons;
+
+    list->resources = (ResourceInfo**)
+       XtMalloc(sizeof(ResourceInfo*) * (num_xt + num_cons));
+
+    for (i = 0; i < num_xt; i++) {
+       list->resources[i] = (ResourceInfo*)XtMalloc(sizeof(ResourceInfo));
+       list->resources[i]->qname =
+           XrmPermStringToQuark(xt_list[i].resource_name);
+       list->resources[i]->qtype =
+           XrmPermStringToQuark(xt_list[i].resource_type);
+       list->resources[i]->size = xt_list[i].resource_size;
+    }
+
+    for (; i < num_xt + num_cons; i++) {
+       list->resources[i] = (ResourceInfo*)XtMalloc(sizeof(ResourceInfo));
+       list->resources[i]->qname =
+           XrmPermStringToQuark(cons_list[i - num_xt].resource_name);
+       list->resources[i]->qtype =
+           XrmPermStringToQuark(cons_list[i - num_xt].resource_type);
+       list->resources[i]->size = cons_list[i - num_xt].resource_size;
+    }
+
+    XtFree((XtPointer)xt_list);
+    if (cons_list)
+       XtFree((XtPointer)cons_list);
+
+    qsort(list->resources, list->num_resources, sizeof(ResourceInfo*),
+         qcmp_action_resource);
+    if (num_cons)
+       qsort(&list->resources[num_xt], list->num_cons_resources,
+             sizeof(ResourceInfo*), qcmp_action_resource);
+}
+
+/*ARGSUSED*/
+static void
+PopdownAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    XtPopdown(w);
+}
+
+/*ARGSUSED*/
+static void
+QuitAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    XtAppSetExitFlag(XtWidgetToApplicationContext(w));
+}
diff --git a/xedit/lisp/mp/mp.c b/xedit/lisp/mp/mp.c
new file mode 100644 (file)
index 0000000..2afb343
--- /dev/null
@@ -0,0 +1,822 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/mp/mp.c,v 1.2 2002/11/08 08:01:00 paulo Exp $ */
+
+#include "mp.h"
+
+/*
+ * TODO:
+ *     o Optimize squaring
+ *     o Write better division code and move from mpi.c to here
+ *     o Make multiplication code don't required memory to be zeroed
+ *             + The first step is easy, just multiply the low word,
+ *             then the high word, that may overlap with the result
+ *             of the first multiply (in case of carry), and then
+ *             just make sure carry is properly propagated in the
+ *             subsequent multiplications.
+ *             + Some code needs also to be rewritten because some
+ *             intermediate addition code in mp_mul, mp_karatsuba_mul,
+ *             and mp_toom_mul is assuming the memory is zeroed.
+ */
+
+/*
+ * Prototypes
+ */
+       /* out of memory handler */
+static void mp_outmem(void);
+
+       /* memory allocation fallback functions */
+static void *_mp_malloc(size_t);
+static void *_mp_calloc(size_t, size_t);
+static void *_mp_realloc(void*, size_t);
+static void _mp_free(void*);
+
+/*
+ * Initialization
+ */
+static mp_malloc_fun __mp_malloc = _mp_malloc;
+static mp_calloc_fun __mp_calloc = _mp_calloc;
+static mp_realloc_fun __mp_realloc = _mp_realloc;
+static mp_free_fun __mp_free = _mp_free;
+
+/*
+ * Implementation
+ */
+static void
+mp_outmem(void)
+{
+    fprintf(stderr, "out of memory in MP library.\n");
+    exit(1);
+}
+
+static void *
+_mp_malloc(size_t size)
+{
+    return (malloc(size));
+}
+
+void *
+mp_malloc(size_t size)
+{
+    void *pointer = (*__mp_malloc)(size);
+
+    if (pointer == NULL)
+       mp_outmem();
+
+    return (pointer);
+}
+
+mp_malloc_fun
+mp_set_malloc(mp_malloc_fun fun)
+{
+    mp_malloc_fun old = __mp_malloc;
+
+    __mp_malloc = fun;
+
+    return (old);
+}
+
+static void *
+_mp_calloc(size_t nmemb, size_t size)
+{
+    return (calloc(nmemb, size));
+}
+
+void *
+mp_calloc(size_t nmemb, size_t size)
+{
+    void *pointer = (*__mp_calloc)(nmemb, size);
+
+    if (pointer == NULL)
+       mp_outmem();
+
+    return (pointer);
+}
+
+mp_calloc_fun
+mp_set_calloc(mp_calloc_fun fun)
+{
+    mp_calloc_fun old = __mp_calloc;
+
+    __mp_calloc = fun;
+
+    return (old);
+}
+
+static void *
+_mp_realloc(void *old, size_t size)
+{
+    return (realloc(old, size));
+}
+
+void *
+mp_realloc(void *old, size_t size)
+{
+    void *pointer = (*__mp_realloc)(old, size);
+
+    if (pointer == NULL)
+       mp_outmem();
+
+    return (pointer);
+}
+
+mp_realloc_fun
+mp_set_realloc(mp_realloc_fun fun)
+{
+    mp_realloc_fun old = __mp_realloc;
+
+    __mp_realloc = fun;
+
+    return (old);
+}
+
+static void
+_mp_free(void *pointer)
+{
+    free(pointer);
+}
+
+void
+mp_free(void *pointer)
+{
+    (*__mp_free)(pointer);
+}
+
+mp_free_fun
+mp_set_free(mp_free_fun fun)
+{
+    mp_free_fun old = __mp_free;
+
+    __mp_free = fun;
+
+    return (old);
+}
+
+long
+mp_add(BNS *rop, BNS *op1, BNS *op2, BNI len1, BNI len2)
+{
+    BNI value;                 /* intermediate result */
+    BNS carry;                 /* carry flag */
+    long size;                 /* result size */
+
+    if (len1 < len2)
+       MP_SWAP(op1, op2, len1, len2);
+
+    /* unroll start of loop */
+    value = op1[0] + op2[0];
+    rop[0] = value;
+    carry = value >> BNSBITS;
+
+    /* add op1 and op2 */
+    for (size = 1; size < len2; size++) {
+       value = op1[size] + op2[size] + carry;
+       rop[size] = value;
+       carry = value >> BNSBITS;
+    }
+    if (rop != op1) {
+       for (; size < len1; size++) {
+           value = op1[size] + carry;
+           rop[size] = value;
+           carry = value >> BNSBITS;
+       }
+    }
+    else {
+       /* if rop == op1, than just adjust carry */
+       for (; carry && size < len1; size++) {
+           value = op1[size] + carry;
+           rop[size] = value;
+           carry = value >> BNSBITS;
+       }
+       size = len1;
+    }
+    if (carry)
+       rop[size++] = carry;
+
+    return (size);
+}
+
+long
+mp_sub(BNS *rop, BNS *op1, BNS *op2, BNI len1, BNI len2)
+{
+    long svalue;               /* intermediate result */
+    BNS carry;                 /* carry flag */
+    long size;                 /* result size */
+
+    /* special case */
+    if (op1 == op2) {
+       rop[0] = 0;
+
+       return (1);
+    }
+
+    /* unroll start of loop */
+    svalue = op1[0] - op2[0];
+    rop[0] = svalue;
+    carry = svalue < 0;
+
+    /* subtracts op2 from op1 */
+    for (size = 1; size < len2; size++) {
+       svalue = (long)(op1[size]) - op2[size] - carry;
+       rop[size] = svalue;
+       carry = svalue < 0;
+    }
+    if (rop != op1) {
+       for (; size < len1; size++) {
+           svalue = op1[size] - carry;
+           rop[size] = svalue;
+           carry = svalue < 0;
+       }
+    }
+    else {
+       /* if rop == op1, than just adjust carry */
+       for (; carry && size < len1; size++) {
+           svalue = op1[size] - carry;
+           rop[size] = svalue;
+           carry = svalue < 0;
+       }
+       size = len1;
+    }
+
+    /* calculate result size */
+    while (size > 1 && rop[size - 1] == 0)
+       --size;
+
+    return (size);
+}
+
+long
+mp_lshift(BNS *rop, BNS *op, BNI len, long shift)
+{
+    long i, size;
+    BNI words, bits;           /* how many word and bit shifts */
+
+    words = shift / BNSBITS;
+    bits = shift % BNSBITS;
+    size = len + words;
+
+    if (bits) {
+       BNS hi, lo;
+       BNI carry;
+       int adj;
+
+       for (i = 1, carry = CARRY >> 1; carry; i++, carry >>= 1)
+           if (op[len - 1] & carry)
+               break;
+       adj = (bits + (BNSBITS - i)) / BNSBITS;
+       size += adj;
+
+       lo = hi = op[0];
+       rop[words] = lo << bits;
+       for (i = 1; i < len; i++) {
+           hi = op[i];
+           rop[words + i] = hi << bits | (lo >> (BNSBITS - bits));
+           lo = hi;
+       }
+       if (adj)
+           rop[size - 1] = hi >> (BNSBITS - bits);
+    }
+    else
+       memmove(rop + size - len, op, sizeof(BNS) * len);
+
+    if (words)
+       memset(rop, '\0', sizeof(BNS) * words);
+
+    return (size);
+}
+
+long
+mp_rshift(BNS *rop, BNS *op, BNI len, long shift)
+{
+    int adj = 0;
+    long i, size;
+    BNI words, bits;           /* how many word and bit shifts */
+
+    words = shift / BNSBITS;
+    bits = shift % BNSBITS;
+    size = len - words;
+
+    if (bits) {
+       BNS hi, lo;
+       BNI carry;
+
+       for (i = 0, carry = CARRY >> 1; carry; i++, carry >>= 1)
+           if (op[len - 1] & carry)
+               break;
+       adj = (bits + i) / BNSBITS;
+       if (size - adj == 0) {
+           rop[0] = 0;
+
+           return (1);
+       }
+
+       hi = lo = op[words + size - 1];
+       rop[size - 1] = hi >> bits;
+       for (i = size - 2; i >= 0; i--) {
+           lo = op[words + i];
+           rop[i] = (lo >> bits) | (hi << (BNSBITS - bits));
+           hi = lo;
+       }
+       if (adj)
+           rop[0] |= lo << (BNSBITS - bits);
+    }
+    else
+       memmove(rop, op + len - size, size * sizeof(BNS));
+
+    return (size - adj);
+}
+
+       /* rop must be a pointer to len1 + len2 elements
+        * rop cannot be either op1 or op2
+        * rop must be all zeros */
+long
+mp_base_mul(BNS *rop, BNS *op1, BNS *op2, BNI len1, BNI len2)
+{
+    long i, j;                 /* counters */
+    BNI value;                 /* intermediate result */
+    BNS carry;                 /* carry value */
+    long size = len1 + len2;
+
+    /* simple optimization: first pass does not need to deference rop[i+j] */
+    if (op1[0]) {
+       value = (BNI)(op1[0]) * op2[0];
+       rop[0] = value;
+       carry = (BNS)(value >> BNSBITS);
+       for (j = 1; j < len2; j++) {
+           value = (BNI)(op1[0]) * op2[j] + carry;
+           rop[j] = value;
+           carry = (BNS)(value >> BNSBITS);
+       }
+       rop[j] = carry;
+    }
+
+    /* do the multiplication */
+    for (i = 1; i < len1; i++) {
+       if (op1[i]) {
+           /* unrool loop initialization */
+           value = (BNI)(op1[i]) * op2[0] + rop[i];
+           rop[i] = value;
+           carry = (BNS)(value >> BNSBITS);
+           /* multiply */
+           for (j = 1; j < len2; j++) {
+               value = (BNI)(op1[i]) * op2[j] + rop[i + j] + carry;
+               rop[i + j] = value;
+               carry = (BNS)(value >> BNSBITS);
+           }
+           rop[i + j] = carry;
+       }
+    }
+
+    if (size > 1 && rop[size - 1] == 0)
+       --size;
+
+    return (size);
+}
+
+       /* Karatsuba method
+        * t + ((a0 + a1) (b0 + b1) - t - u) x + ux²
+        * where t = a0b0 and u = a1b1
+        *
+        * Karatsuba method reduces the number of multiplications. Example:
+        *      Square a 40 length number
+        *      instead of a plain 40*40 = 1600 multiplies/adds, it does:
+        *      20*20+20*20+20*20 = 1200
+        *      but since it is recursive, every 20*20=400 is reduced to
+        *      10*10+10*10+10*10=300
+        *      and so on.
+        * The multiplication by x and x² is a just a shift, as it is a
+        * power of two, and is implemented below by just writting at the
+        * correct offset */
+long
+mp_karatsuba_mul(BNS *rop, BNS *op1, BNS *op2, BNI len1, BNI len2)
+{
+    BNI x;                             /* shift count */
+    BNI la0, la1, lb0, lb1;            /* length of a0, a1, b0, and b1 */
+    BNS *t;                            /* temporary memory for t product */
+    BNS *u;                            /* temporary memory for u product */
+    BNS *r;                            /* pointer to rop */
+    long xlen, tlen, ulen;
+
+    /* calculate value of x, that is 2^(BNSBITS*x) */
+    if (len1 >= len2)
+       x = (len1 + 1) >> 1;
+    else
+       x = (len2 + 1) >> 1;
+
+    /* calculate length of operands */
+    la0 = x;
+    la1 = len1 - x;
+    lb0 = x;
+    lb1 = len2 - x;
+
+    /* allocate buffer for t and (a0 + a1) */
+    tlen = la0 + lb0;
+    t = mp_malloc(sizeof(BNS) * tlen);
+
+    /* allocate buffer for u and (b0 + b1) */
+    if (la1 + lb1 < lb0 + lb1 + 1)
+       ulen = lb0 + lb1 + 1;
+    else
+       ulen = la1 + lb1;
+    u = mp_malloc(sizeof(BNS) * ulen);
+
+    /* calculate a0 + a1, store result in t */
+    tlen = mp_add(t, op1, op1 + x, la0, la1);
+
+    /* calculate b0 + b1, store result in u */
+    ulen = mp_add(u, op2, op2 + x, lb0, lb1);
+
+    /* store (a0 + a1) * (b0 + b1) in rop */
+
+    r = rop + x;               /* multiplied by 2^(BNSBITS*x) */
+    xlen = mp_mul(r, t, u, tlen, ulen);
+
+    /* must zero t and u memory, this is required for mp_mul */
+
+    /* calculate t = a0 * b0 */
+    tlen = la0 + lb0;
+    memset(t, '\0', sizeof(BNS) * tlen);
+    tlen = mp_mul(t, op1, op2, la0, lb0);
+
+    /* calculate u = a1 * b1 */
+    ulen = la1 + lb1;
+    memset(u, '\0', sizeof(BNS) * ulen);
+    ulen = mp_mul(u, op1 + x, op2 + x, la1, lb1);
+
+    /* subtract t from partial result */
+    xlen = mp_sub(r, r, t, xlen, tlen);
+
+    /* subtract u form partial result */
+    xlen = mp_sub(r, r, u, xlen, ulen);
+
+    /* add ux^2 to partial result */
+
+    r = rop + (x << 1);                /* multiplied by x^2 = 2^(BNSBITS*x*2) */
+    xlen = len1 + len2;
+    xlen = mp_add(r, r, u, xlen, ulen);
+
+    /* now add t to final result */
+    xlen = mp_add(rop, rop, t, xlen, tlen);
+
+    mp_free(t);
+    mp_free(u);
+
+    if (xlen > 1 && rop[xlen - 1] == 0)
+       --xlen;
+
+    return (xlen);
+}
+
+       /* Toom method  (partially based on GMP documentation)
+        * Evaluation at k = [ 0 1/2 1 2 oo ]
+        * U(x) = (U2k + U1)k + U0
+        * V(x) = (V2k + V1)k + V0
+        * W(x) = U(x)V(x)
+        *
+        * Sample:
+        *      123 * 456
+        *
+        *      EVALUATION:
+        * U(0) = (1*0+2)*0+3   => 3
+        * U(1) = 1+(2+3*2)*2   => 17
+        * U(2) = 1+2+3         => 6
+        * U(3) = (1*2+2)*2+3   => 11
+        * U(4) = 1+(2+3*0)*0   => 1
+        *
+        * V(0) = (4*0+5)*0+6   => 6
+        * V(1) = 4+(5+6*2)*2   => 38
+        * V(2) = 4+5+6         => 15
+        * V(3) = (4*2+5)*2+6   => 32
+        * V(4) = 4+(5+6*0)*0   => 4
+        *
+        *      U = [ 3   17  6  11 1 ]
+        *      V = [ 6   38 15  32 4 ]
+        *      W = [ 18 646 90 352 4 ]
+        *
+        * After that, we have:
+        *      a = 18                                  (w0 already known)
+        *      b = 16w0 + 8w1 + 4w2 + 2w3 +   w4
+        *      c =   w0 +  w1 +  w2 +  w3 +   w4
+        *      d =   w0 + 2w1 + 4w2 + 8w3 + 16w4
+        *      e = 4                                   (w4 already known)
+        *
+        *      INTERPOLATION:
+        *      b = b -16a - e          (354)
+        *      c = c - a - e           (68)
+        *      d = d - a - 16e         (270)
+        *
+        *      w = (b + d) - 8c = (10w1+8w2+10w3) - (8w1+8w2+8w3) = 2w1+2w3
+        *      w = 2c - w              (56)
+        *      b = b/2 = 4w1+w+w3
+        *      b = b-c = 4w1+w+w3 - w1+w2+w3 = 3w1+w2
+        *      c = w/2                 (w2 = 28)
+        *      b = b-c = 3w1+c - c = 3w1
+        *      b = b/3                 (w1 = 27)
+        *      d = d/2
+        *      d = d-b-w = b+w+4w3 - b-w = 4w3
+        *      d = d/4                 (w3 = 13)
+        *
+        *      RESULT:
+        *      w4*10^4 + w3*10³ + w2*10² + w1*10 + w0
+        *      40000   + 13000   + 2800   + 270    + 18
+        *      10 is the base where the calculation was done
+        *
+        *      This sample uses small numbers, so it does not show the
+        * advantage of the method. But for example (in base 10), when squaring
+        *      123456789012345678901234567890
+        *      The normal method would do 30*30=900 multiplications
+        *      Karatsuba method would do 15*15*3=675 multiplications
+        *      Toom method would do 10*10*5=500 multiplications
+        * Toom method has a larger overhead if compared with Karatsuba method,
+        * due to evaluation and interpolation, so it should be used for larger
+        * numbers, so that the computation time of evaluation/interpolation
+        * would be smaller than the time spent using other methods.
+        *
+        *      Note that Karatsuba method can be seen as a special case of
+        * Toom method, i.e:
+        *      U1U0 * V1V0
+        *      with k = [ 0 1 oo ]
+        *      U = [ U0 U1+U0 U1 ]
+        *      V = [ V0 V1+V0 V1 ]
+        *      W = [ U0*V0 (U1+U0)*(V1+V0) (U1+V1) ]
+        *
+        *      w0 = U0*V0
+        *      w = (U1+U0)*(V1+V0)
+        *      w2 = (U1*V1)
+        *
+        *      w1 = w - w0 - w2
+        * w2x² + w1x + w0
+        *
+        *      See Knuth's Seminumerical Algorithms for a sample implemention
+        * using 4 stacks and k = [ 0 1 2 3 ... ], based on the size of the
+        * input.
+        */
+long
+mp_toom_mul(BNS *rop, BNS *op1, BNS *op2, BNI len1, BNI len2)
+{
+    long size, xsize, i;
+    BNI value;                         /* used in division */
+    BNS carry;
+    BNI x;                             /* shift count */
+    BNI l1, l2;
+    BNI al, bl, cl, dl, el, Ul[3], Vl[3];
+    BNS *a, *b, *c, *d, *e, *U[3], *V[3];
+
+    /* x is the base i.e. 2^(BNSBITS*x) */
+    x = (len1 + len2 + 4) / 6;
+    l1 = len1 - (x << 1);      /* length of remaining piece of op1 */
+    l2 = len2 - (x << 1);      /* length of remaining piece of op2 */
+
+    /* allocate memory for storing U and V */
+    U[0] = mp_malloc(sizeof(BNS) * (x + 2));
+    V[0] = mp_malloc(sizeof(BNS) * (x + 2));
+    U[1] = mp_malloc(sizeof(BNS) * (x + 1));
+    V[1] = mp_malloc(sizeof(BNS) * (x + 1));
+    U[2] = mp_malloc(sizeof(BNS) * (x + 2));
+    V[2] = mp_malloc(sizeof(BNS) * (x + 2));
+
+       /* EVALUATE U AND V */
+
+    /* Numbers are in the format U2x²+U1x+U0 and V2x²+V1x+V0 */
+
+       /* U[0] = U2+U1*2+U0*4 */
+
+    /* store U1*2 in U[1], this value is used twice */
+    Ul[1] = mp_lshift(U[1], op1 + x, x, 1);
+
+    /* store U0*4 in U[0] */
+    Ul[0] = mp_lshift(U[0], op1, x, 2);
+    /* add U1*2 to U[0] */
+    Ul[0] = mp_add(U[0], U[0], U[1], Ul[0], Ul[1]);
+    /* add U2 to U[0] */
+    Ul[0] = mp_add(U[0], U[0], op1 + x + x, Ul[0], l1);
+
+       /* U[2] = U2*4+U1*2+U0 */
+
+    /* store U2*4 in U[2] */
+    Ul[2] = mp_lshift(U[2], op1 + x + x, l1, 2);
+    /* add U1*2 to U[2] */
+    Ul[2] = mp_add(U[2], U[2], U[1], Ul[2], Ul[1]);
+    /* add U0 to U[2] */
+    Ul[2] = mp_add(U[2], U[2], op1, Ul[2], x);
+
+       /* U[1] = U2+U1+U0 */
+
+    Ul[1] = mp_add(U[1], op1, op1 + x, x, x);
+    Ul[1] = mp_add(U[1], U[1], op1 + x + x, Ul[1], l1);
+
+
+       /* Evaluate V[x], same code as U[x] */
+    Vl[1] = mp_lshift(V[1], op2 + x, x, 1);
+    Vl[0] = mp_lshift(V[0], op2, x, 2);
+    Vl[0] = mp_add(V[0], V[0], V[1], Vl[0], Vl[1]);
+    Vl[0] = mp_add(V[0], V[0], op2 + x + x, Vl[0], l2);
+    Vl[2] = mp_lshift(V[2], op2 + x + x, l2, 2);
+    Vl[2] = mp_add(V[2], V[2], V[1], Vl[2], Vl[1]);
+    Vl[2] = mp_add(V[2], V[2], op2, Vl[2], x);
+    Vl[1] = mp_add(V[1], op2, op2 + x, x, x);
+    Vl[1] = mp_add(V[1], V[1], op2 + x + x, Vl[1], l2);
+
+
+       /* MULTIPLY U[] AND V[] */
+
+       /* calculate (U2+U1*2+U0*4) * (V2+V1*2+V0*4) */
+    b = mp_calloc(1, sizeof(BNS) * (Ul[0] * Vl[0]));
+    bl = mp_mul(b, U[0], V[0], Ul[0], Vl[0]);
+    mp_free(U[0]);
+    mp_free(V[0]);
+
+       /* calculate (U2+U1+U0) * (V2+V1+V0) */
+    c = mp_calloc(1, sizeof(BNS) * (Ul[1] * Vl[1]));
+    cl = mp_mul(c, U[1], V[1], Ul[1], Vl[1]);
+    mp_free(U[1]);
+    mp_free(V[1]);
+
+       /* calculate (U2*4+U1*2+U0) * (V2*4+V1*2+V0) */
+    d = mp_calloc(1, sizeof(BNS) * (Ul[2] * Vl[2]));
+    dl = mp_mul(d, U[2], V[2], Ul[2], Vl[2]);
+    mp_free(U[2]);
+    mp_free(V[2]);
+
+       /* calculate U0 * V0 */
+    a = mp_calloc(1, sizeof(BNS) * (x + x));
+    al = mp_mul(a, op1, op2, x, x);
+
+       /* calculate U2 * V2 */
+    e = mp_calloc(1, sizeof(BNS) * (l1 + l2));
+    el = mp_mul(e, op1 + x + x, op2 + x + x, l1, l2);
+
+
+       /* INTERPOLATE COEFFICIENTS */
+
+    /* b = b - 16a - e */
+    size = mp_lshift(rop, a, al, 4);
+    bl = mp_sub(b, b, rop, bl, size);
+    bl = mp_sub(b, b, e, bl, el);
+
+    /* c = c - a - e*/
+    cl = mp_sub(c, c, a, cl, al);
+    cl = mp_sub(c, c, e, cl, el);
+
+    /* d = d - a - 16e */
+    dl = mp_sub(d, d, a, dl, al);
+    size = mp_lshift(rop, e, el, 4);
+    dl = mp_sub(d, d, rop, dl, size);
+
+    /* w = (b + d) - 8c */
+    size = mp_add(rop, b, d, bl, dl);
+    xsize = mp_lshift(rop + size, c, cl, 3);   /* rop has enough storage */
+    size = mp_sub(rop, rop, rop + size, size, xsize);
+
+    /* w = 2c - w*/
+    xsize = mp_lshift(rop + size, c, cl, 1);
+    size = mp_sub(rop, rop + size, rop, xsize, size);
+
+    /* b = b/2 */
+    bl = mp_rshift(b, b, bl, 1);
+
+    /* b = b - c */
+    bl = mp_sub(b, b, c, bl, cl);
+
+    /* c = w / 2 */
+    cl = mp_rshift(c, rop, size, 1);
+
+    /* b = b - c */
+    bl = mp_sub(b, b, c, bl, cl);
+
+    /* b = b/3 */
+       /* maybe the most expensive calculation */
+    i = bl - 1;
+    value = b[i];
+    b[i] = value / 3;
+    for (--i; i >= 0; i--) {
+       carry = value % 3;
+       value = ((BNI)carry << BNSBITS) + b[i];
+       b[i] = (BNS)(value / 3);
+    }
+
+    /* d = d/2 */
+    dl = mp_rshift(d, d, dl, 1);
+
+    /* d = d - b - w */
+    dl = mp_sub(d, d, b, dl, bl);
+    dl = mp_sub(d, d, rop, dl, size);
+
+    /* d = d/4 */
+    dl = mp_rshift(d, d, dl, 2);
+
+
+       /* STORE RESULT IN ROP */
+    /* first clear memory used as temporary variable w and 8c */
+    memset(rop, '\0', sizeof(BNS) * (len1 + len2));
+
+    i = x * 4;
+    xsize = (len1 + len2) - i;
+    size = mp_add(rop + i, rop + i, e, xsize, el) + i;
+    i = x * 3;
+    xsize = size - i;
+    size = mp_add(rop + i, rop + i, d, xsize, dl) + i;
+    i = x * 2;
+    xsize = size - i;
+    size = mp_add(rop + i, rop + i, c, xsize, cl) + i;
+    i = x;
+    xsize = size - i;
+    size = mp_add(rop + i, rop + i, b, xsize, bl) + i;
+    size = mp_add(rop, rop, a, size, al);
+
+    mp_free(e);
+    mp_free(d);
+    mp_free(c);
+    mp_free(b);
+    mp_free(a);
+
+    if (size > 1 && rop[size - 1] == 0)
+       --size;
+
+    return (size);
+}
+
+long
+mp_mul(BNS *rop, BNS *op1, BNS *op2, BNI len1, BNI len2)
+{
+    if (len1 < len2)
+       MP_SWAP(op1, op2, len1, len2);
+
+    if (len1 < KARATSUBA || len2 < KARATSUBA)
+       return (mp_base_mul(rop, op1, op2, len1, len2));
+    else if (len1 < TOOM && len2 < TOOM && len2 > ((len1 + 1) >> 1))
+       return (mp_karatsuba_mul(rop, op1, op2, len1, len2));
+    else if (len1 >= TOOM && len2 >= TOOM && (len2 + 2) / 3 == (len1 + 2) / 3)
+       return (mp_toom_mul(rop, op1, op2, len1, len2));
+    else {
+       long xsize, psize, isize;
+       BNS *ptr;
+
+       /* adjust index pointer and estimated size of result */
+       isize = 0;
+       xsize = len1 + len2;
+       mp_mul(rop, op1, op2, len2, len2);
+       /* adjust pointers */
+       len1 -= len2;
+       op1 += len2;
+
+       /* allocate buffer for intermediate multiplications */
+       if (len1 > len2)
+           ptr = mp_calloc(1, sizeof(BNS) * (len2 + len2));
+       else
+           ptr = mp_calloc(1, sizeof(BNS) * (len1 + len2));
+
+       /* loop multiplying len2 size operands at a time */
+       while (len1 >= len2) {
+           isize += len2;
+           psize = mp_mul(ptr, op1, op2, len2, len2);
+           mp_add(rop + isize, rop + isize, ptr, xsize - isize, psize);
+           len1 -= len2;
+           op1 += len2;
+
+           /* multiplication routines require zeroed memory */
+           memset(ptr, '\0', sizeof(BNS) * (MIN(len1, len2) + len2));
+       }
+
+       /* len1 was not a multiple of len2 */
+       if (len1) {
+           isize += len2;
+           psize = mp_mul(ptr, op2, op1, len2, len1);
+           mp_add(rop + isize, rop + isize, ptr, xsize, psize);
+       }
+
+       /* adjust result size */
+       if (rop[xsize - 1] == 0)
+           --xsize;
+
+       mp_free(ptr);
+
+       return (xsize);
+    }
+}
diff --git a/xedit/lisp/mp/mp.h b/xedit/lisp/mp/mp.h
new file mode 100644 (file)
index 0000000..8bcb127
--- /dev/null
@@ -0,0 +1,435 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/mp/mp.h,v 1.5tsi Exp $ */
+
+#include <stdio.h>
+#include <math.h>
+#ifdef sun
+#include <ieeefp.h>
+#endif
+#include <float.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <ctype.h>
+#include <string.h>
+
+#ifndef __mp_h_
+#define __mp_h_
+
+#ifdef __GNUC__
+#define INLINE __inline__
+#else
+#define INLINE /**/
+#endif
+
+/* this normally is better for multiplication and also
+ * simplify addition loops putting the larger value first */
+#define MP_SWAP(op1, op2, len1, len2) {        \
+    BNS *top = op1;                    \
+    BNI tlen = len1;                   \
+                                       \
+    op1 = op2;                         \
+    len1 = len2;                       \
+    op2 = top;                         \
+    len2 = tlen;                       \
+}
+
+/*
+ * At least this length to use Karatsuba multiplication method
+ */
+#define KARATSUBA              32
+
+/*
+ * At least this length to use Toom multiplication method
+ */
+#define TOOM                   128
+
+#if ULONG_MAX > 4294967295UL
+  /* sizeof(long) == 8 and sizeof(int) == 4 */
+# define BNI           unsigned long
+# define BNS           unsigned int
+# define MINSLONG      0x8000000000000000UL
+# define CARRY         0x100000000
+# define LMASK         0xffffffff00000000UL
+# define SMASK         0x00000000ffffffffUL
+# define BNIBITS       64
+# define BNSBITS       32
+# ifndef LONG64
+#  define LONG64
+# endif
+#else
+  /* sizeof(long) == 4 and sizeof(short) == 2 */
+# define BNI           unsigned long
+# define BNS           unsigned short
+# define MINSLONG      0x80000000UL
+# define CARRY         0x10000
+# define LMASK         0xffff0000UL
+# define SMASK         0x0000ffffUL
+# define BNIBITS       32
+# define BNSBITS       16
+#endif
+
+#ifdef MAX
+#undef MAX
+#endif
+#define MAX(a, b)      ((a) > (b) ? (a) : (b))
+
+#ifdef MIN
+#undef MIN
+#endif
+#define MIN(a, b)      ((a) < (b) ? (a) : (b))
+
+/*
+ * Types
+ */
+typedef struct _mpi {
+    unsigned int size : 31;
+    unsigned int sign : 1;
+    BNI alloc;
+    BNS *digs;         /* LSF format */
+} mpi;
+
+typedef struct _mpr {
+    mpi num;
+    mpi den;
+} mpr;
+
+typedef void *(*mp_malloc_fun)(size_t);
+typedef void *(*mp_calloc_fun)(size_t, size_t);
+typedef void *(*mp_realloc_fun)(void*, size_t);
+typedef void (*mp_free_fun)(void*);
+
+/*
+ * Prototypes
+ */
+/* GENERIC FUNCTIONS */
+       /* memory allocation wrappers */
+void *mp_malloc(size_t size);
+void *mp_calloc(size_t nmemb, size_t size);
+void *mp_realloc(void *pointer, size_t size);
+void mp_free(void *pointer);
+mp_malloc_fun mp_set_malloc(mp_malloc_fun);
+mp_calloc_fun mp_set_calloc(mp_calloc_fun);
+mp_realloc_fun mp_set_realloc(mp_realloc_fun);
+mp_free_fun mp_set_free(mp_free_fun);
+
+       /* adds op1 and op2, stores result in rop
+        * rop must pointer to at least len1 + len2 + 1 elements
+        * rop can be either op1 or op2 */
+long mp_add(BNS *rop, BNS *op1, BNS *op2, BNI len1, BNI len2);
+
+       /* subtracts op2 from op1, stores result in rop
+        * rop must pointer to at least len1 + len2 elements
+        * op1 must be >= op2
+        * rop can be either op1 or op2 */
+long mp_sub(BNS *rop, BNS *op1, BNS *op2, BNI len1, BNI len2);
+
+       /* shift op to the left shift bits
+        * rop must have enough storage for result
+        * rop can be op */
+long mp_lshift(BNS *rop, BNS *op, BNI len, long shift);
+
+       /* shift op to the right shift bits
+        * shift must be positive
+        * rop can be op */
+long mp_rshift(BNS *rop, BNS *op, BNI len, long shift);
+
+       /* use simple generic multiplication method
+        * rop cannot be the same as op1 or op2
+        * rop must be zeroed
+        * op1 can be op2 */
+long mp_base_mul(BNS *rop, BNS *op1, BNS *op2, BNI len1, BNI len2);
+
+       /* use Karatsuba method
+        * MIN(len1, len2) must be larger than (MAX(len1, len2) + 1) >> 1
+        * MAX(len1, len2) should be at least 2
+        * rop cannot be the same as op1 or op2
+        * rop must be zeroed
+        * op1 can be op2 */
+long mp_karatsuba_mul(BNS *rop, BNS *op1, BNS *op2, BNI len1, BNI len2);
+
+       /* use Toom method
+        * len1 / 3 should be equal to len2 / 3
+        * len1 / 3 should be at least 1
+        * rop cannot be the same as op1 or op2
+        * rop must be zeroed
+        * op1 can be op2 */
+long mp_toom_mul(BNS *rop, BNS *op1, BNS *op2, BNI len1, BNI len2);
+
+       /* chooses the available multiplication methods based on it's input
+        * rop must be a pointer to len1 + len2 elements
+        * rop cannot be the same as op1 or op2
+        * rop must be zeroed
+        * op1 can be op2 */
+long mp_mul(BNS *rop, BNS *op1, BNS *op2, BNI len1, BNI len2);
+
+/* INTEGER FUNCTIONS */
+       /* initialize op and set it to 0 */
+void mpi_init(mpi *op);
+
+       /* clear memory associated to op */
+void mpi_clear(mpi *op);
+
+       /* set rop to the value of op */
+void mpi_set(mpi *rop, mpi *op);
+
+       /* set rop to the value of si */
+void mpi_seti(mpi *rop, long si);
+
+       /* set rop to the floor(fabs(d)) */
+void mpi_setd(mpi *rop, double d);
+
+       /* initialize rop to number representation in str in the given base.
+        * leading zeros are skipped.
+        * if sign present, it is processed.
+        * base must be in the range 2 to 36. */
+void mpi_setstr(mpi *rop, char *str, int base);
+
+       /* adds two mp integers */
+void mpi_add(mpi *rop, mpi *op1, mpi *op2);
+
+       /* adds op1 and op2 */
+void mpi_addi(mpi *rop, mpi *op1, long op2);
+
+       /* subtracts two mp integers */
+void mpi_sub(mpi *rop, mpi *op1, mpi *op2);
+
+       /* subtracts op2 from op1 */
+void mpi_subi(mpi *rop, mpi *op1, long op2);
+
+       /* multiply two mp integers */
+void mpi_mul(mpi *rop, mpi *op1, mpi *op2);
+
+       /* multiply op1 by op2 */
+void mpi_muli(mpi *rop, mpi *op1, long op2);
+
+       /* divides num by den and sets rop to result */
+void mpi_div(mpi *rop, mpi *num, mpi *den);
+
+       /* divides num by den and sets rop to the remainder */
+void mpi_rem(mpi *rop, mpi *num, mpi *den);
+
+       /* divides num by den, sets quotient to qrop and remainder to rrop
+        * qrop is truncated towards zero.
+        * qrop and rrop are optional
+        * qrop and rrop cannot be the same variable */
+void mpi_divqr(mpi *qrop, mpi *rrop, mpi *num, mpi *den);
+
+       /* divides num by then and stores result in rop */
+void mpi_divi(mpi *rop, mpi *num, long den);
+
+       /* divides num by den and returns remainder */
+long mpi_remi(mpi *num, long den);
+
+       /* divides num by den
+        * stores quotient in qrop and returns remainder */
+long mpi_divqri(mpi *qrop, mpi *num, long den);
+
+       /* sets rop to num modulo den */
+void mpi_mod(mpi *rop, mpi *num, mpi *den);
+
+       /* returns num modulo den */
+long mpi_modi(mpi *num, long den);
+
+       /* sets rop to the greatest common divisor of num and den
+        * result is always positive */
+void mpi_gcd(mpi *rop, mpi *num, mpi *den);
+
+       /* sets rop to the least common multiple of num and den
+        * result is always positive */
+void mpi_lcm(mpi *rop, mpi *num, mpi *den);
+
+       /* sets rop to op raised to exp */
+void mpi_pow(mpi *rop, mpi *op, unsigned long exp);
+
+       /* sets rop to the integer part of the nth root of op.
+        * returns 1 if result is exact, 0 otherwise */
+int mpi_root(mpi *rop, mpi *op, unsigned long nth);
+
+       /* sets rop to the integer part of the square root of op.
+        * returns 1 if result is exact, 0 otherwise */
+int mpi_sqrt(mpi *rop, mpi *op);
+
+       /* bit shift, left if shift positive, right if negative
+        * a fast way to multiply and divide by powers of two */
+void mpi_ash(mpi *rop, mpi *op, long shift);
+
+       /* sets rop to op1 logand op2 */
+void mpi_and(mpi *rop, mpi *op1, mpi *op2);
+
+       /* sets rop to op1 logior op2 */
+void mpi_ior(mpi *rop, mpi *op1, mpi *op2);
+
+       /* sets rop to op1 logxor op2 */
+void mpi_xor(mpi *rop, mpi *op1, mpi *op2);
+
+       /* sets rop to one's complement of op */
+void mpi_com(mpi *rop, mpi *op);
+
+       /* sets rop to -op */
+void mpi_neg(mpi *rop, mpi *op);
+
+       /* sets rop to the absolute value of op */
+void mpi_abs(mpi *rop, mpi *op);
+
+       /* compares op1 and op2
+        * returns >0 if op1 > op2, 0 if op1 = op2, and  <0 if op1 < op2 */
+int mpi_cmp(mpi *op1, mpi *op2);
+
+       /* mpi_cmp with a long integer operand */
+int mpi_cmpi(mpi *op1, long op2);
+
+       /* compares absolute value of op1 and op2
+        * returns >0 if abs(op1) > abs(op2), 0 if abs(op1) = abs(op2),
+        * and  <0 if abs(op1) < abs(op2) */
+int mpi_cmpabs(mpi *op1, mpi *op2);
+
+       /* mpi_cmpabs with a long integer operand */
+int mpi_cmpabsi(mpi *op1, long op2);
+
+       /* returns 1 if op1 > 0, 0 if op1 = 0, and  -1 if op1 < 0 */
+int mpi_sgn(mpi *op);
+
+       /* fastly swaps contents of op1 and op2 */
+void mpi_swap(mpi *op1, mpi *op2);
+
+       /* returns 1 if op fits in a signed long int, 0 otherwise */
+int mpi_fiti(mpi *op);
+
+       /* converts mp integer to long int
+        * to know if the value will fit, call mpi_fiti */
+long mpi_geti(mpi *op);
+
+       /* convert mp integer to double */
+double mpi_getd(mpi *op);
+
+       /* returns exact number of characters to represent mp integer
+        * in given base, excluding sign and ending null character.
+        * base must be in the range 2 to 36 */
+unsigned long mpi_getsize(mpi *op, int base);
+
+       /* returns pointer to string with representation of mp integer
+        * if str is not NULL, it must have enough space to store integer
+        * representation, if NULL a newly allocated string is returned.
+        * base must be in the range 2 to 36 */
+char *mpi_getstr(char *str, mpi *op, int base);
+
+/* RATIO FUNCTIONS */
+#define mpr_num(op)    (&((op)->num))
+#define mpr_den(op)    (&((op)->den))
+
+       /* initialize op and set it to 0/1 */
+void mpr_init(mpr *op);
+
+       /* clear memory associated to op */
+void mpr_clear(mpr *op);
+
+       /* set rop to the value of op */
+void mpr_set(mpr *rop, mpr *op);
+
+       /* set rop to num/den */
+void mpr_seti(mpr *rop, long num, long den);
+
+       /* set rop to the value of d */
+void mpr_setd(mpr *rop, double d);
+
+       /* initialize rop to number representation in str in the given base.
+        * leading zeros are skipped.
+        * if sign present, it is processed.
+        * base must be in the range 2 to 36. */
+void mpr_setstr(mpr *rop, char *str, int base);
+
+       /* remove common factors of op */
+void mpr_canonicalize(mpr *op);
+
+       /* adds two mp rationals */
+void mpr_add(mpr *rop, mpr *op1, mpr *op2);
+
+       /* adds op1 and op2 */
+void mpr_addi(mpr *rop, mpr *op1, long op2);
+
+       /* subtracts two mp rationals */
+void mpr_sub(mpr *rop, mpr *op1, mpr *op2);
+
+       /* subtracts op2 from op1 */
+void mpr_subi(mpr *rop, mpr *op1, long op2);
+
+       /* multiply two mp rationals */
+void mpr_mul(mpr *rop, mpr *op1, mpr *op2);
+
+       /* multiply op1 by op2 */
+void mpr_muli(mpr *rop, mpr *op1, long op2);
+
+       /* divide two mp rationals */
+void mpr_div(mpr *rop, mpr *op1, mpr *op2);
+
+       /* divides op1 by op2 */
+void mpr_divi(mpr *rop, mpr *op1, long op2);
+
+       /* sets rop to 1/op */
+void mpr_inv(mpr *rop, mpr *op);
+
+       /* sets rop to -op */
+void mpr_neg(mpr *rop, mpr *op);
+
+       /* sets rop to the absolute value of op */
+void mpr_abs(mpr *rop, mpr *op);
+
+       /* compares op1 and op2
+        * returns >0 if op1 > op2, 0 if op1 = op2, and  <0 if op1 < op2 */
+int mpr_cmp(mpr *op1, mpr *op2);
+
+       /* mpr_cmp with a long integer operand */
+int mpr_cmpi(mpr *op1, long op2);
+
+       /* compares absolute value of op1 and op2
+        * returns >0 if abs(op1) > abs(op2), 0 if abs(op1) = abs(op2),
+        * and  <0 if abs(op1) < abs(op2) */
+int mpr_cmpabs(mpr *op1, mpr *op2);
+
+       /* mpr_cmpabs with a long integer operand */
+int mpr_cmpabsi(mpr *op1, long op2);
+
+       /* fastly swaps contents of op1 and op2 */
+void mpr_swap(mpr *op1, mpr *op2);
+
+       /* returns 1 if op fits in a signed long int, 0 otherwise */
+int mpr_fiti(mpr *op);
+
+       /* convert mp rational to double */
+double mpr_getd(mpr *op);
+
+       /* returns pointer to string with representation of mp rational
+        * if str is not NULL, it must have enough space to store rational
+        * representation, if NULL a newly allocated string is returned.
+        * base must be in the range 2 to 36 */
+char *mpr_getstr(char *str, mpr *op, int base);
+
+#endif /* __mp_h_ */
diff --git a/xedit/lisp/mp/mpi.c b/xedit/lisp/mp/mpi.c
new file mode 100644 (file)
index 0000000..fabe366
--- /dev/null
@@ -0,0 +1,1660 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/mp/mpi.c,v 1.12 2002/11/20 07:44:43 paulo Exp $ */
+
+#include "mp.h"
+
+#ifdef __UNIXOS2__
+# define finite(x) isfinite(x)
+#endif
+
+/*
+ * Prototypes
+ */
+       /* do the hard work of mpi_add and mpi_sub */
+static void mpi_addsub(mpi *rop, mpi *op1, mpi *op2, int sub);
+
+       /* logical functions implementation */
+static INLINE BNS mpi_logic(BNS op1, BNS op2, BNS op);
+static void mpi_log(mpi *rop, mpi *op1, mpi *op2,  BNS op);
+
+       /* internal mpi_seti, whithout memory allocation */
+static void _mpi_seti(mpi *rop, long si);
+
+/*
+ * Initialization
+ */
+static BNS onedig[1] = { 1 };
+static mpi mpone = { 1, 1, 0, (BNS*)&onedig };
+
+/*
+ * Implementation
+ */
+void
+mpi_init(mpi *op)
+{
+    op->sign = 0;
+    op->size = op->alloc = 1;
+    op->digs = mp_malloc(sizeof(BNS));
+    op->digs[0] = 0;
+}
+
+void
+mpi_clear(mpi *op)
+{
+    op->sign = 0;
+    op->size = op->alloc = 0;
+    mp_free(op->digs);
+}
+
+void
+mpi_set(mpi *rop, mpi *op)
+{
+    if (rop != op) {
+       if (rop->alloc < op->size) {
+           rop->digs = mp_realloc(rop->digs, sizeof(BNS) * op->size);
+           rop->alloc = op->size;
+       }
+       rop->size = op->size;
+       memcpy(rop->digs, op->digs, sizeof(BNS) * op->size);
+       rop->sign = op->sign;
+    }
+}
+
+void
+mpi_seti(mpi *rop, long si)
+{
+    unsigned long ui;
+    int sign = si < 0;
+    int size;
+
+    if (si == MINSLONG) {
+       ui = MINSLONG;
+       size = 2;
+    }
+    else {
+       if (sign)
+           ui = -si;
+       else
+           ui = si;
+       if (ui < CARRY)
+           size = 1;
+       else
+           size = 2;
+    }
+
+    if (rop->alloc < size) {
+       rop->digs = mp_realloc(rop->digs, sizeof(BNS) * size);
+       rop->alloc = size;
+    }
+    rop->size = size;
+
+    /* store data in small mp integer */
+    rop->digs[0] = (BNS)ui;
+    if (size > 1)
+       rop->digs[1] = (BNS)(ui >> BNSBITS);
+    rop->size = size;
+
+    /* adjust result sign */
+    rop->sign = sign;
+}
+
+static void
+_mpi_seti(mpi *rop, long si)
+{
+    unsigned long ui;
+    int sign = si < 0;
+    int size;
+
+    if (si == MINSLONG) {
+       ui = MINSLONG;
+       size = 2;
+    }
+    else {
+       if (sign)
+           ui = -si;
+       else
+           ui = si;
+       if (ui < CARRY)
+           size = 1;
+       else
+           size = 2;
+    }
+
+    rop->digs[0] = (BNS)ui;
+    if (size > 1)
+       rop->digs[1] = (BNS)(ui >> BNSBITS);
+    rop->size = size;
+
+    rop->sign = sign;
+}
+
+void
+mpi_setd(mpi *rop, double d)
+{
+    long i;
+    double mantissa;
+    int shift, exponent;
+    BNI size;
+
+    if (isnan(d))
+       d = 0.0;
+    else if (!finite(d))
+       d = copysign(1.0, d) * DBL_MAX;
+
+    /* check if number is larger than 1 */
+    if (fabs(d) < 1.0) {
+       rop->digs[0] = 0;
+       rop->size = 1;
+       rop->sign = d < 0.0;
+
+       return;
+    }
+
+    mantissa = frexp(d, &exponent);
+    if (mantissa < 0)
+       mantissa = -mantissa;
+
+    size = (exponent + (BNSBITS - 1)) / BNSBITS;
+    shift = BNSBITS - (exponent & (BNSBITS - 1));
+
+    /* adjust amount of memory */
+    if (rop->alloc < size) {
+       rop->digs = mp_realloc(rop->digs, sizeof(BNS) * size);
+       rop->alloc = size;
+    }
+    rop->size = size;
+
+    /* adjust the exponent */
+    if (shift < BNSBITS)
+       mantissa = ldexp(mantissa, -shift);
+
+    /* convert double */
+    for (i = size - 1; i >= 0 && mantissa != 0.0; i--) {
+       mantissa = ldexp(mantissa, BNSBITS);
+       rop->digs[i] = (BNS)mantissa;
+       mantissa -= rop->digs[i];
+    }
+    for (; i >= 0; i--)
+       rop->digs[i] = 0;
+
+    /* normalize */
+    if (size > 1 && rop->digs[size - 1] == 0)
+       --rop->size;
+
+    rop->sign = d < 0.0;
+}
+
+/* how many BNS in the given base, log(base) / log(CARRY) */
+#ifdef LONG64
+static double str_bases[37] = {
+    0.0000000000000000, 0.0000000000000000, 0.0312500000000000,
+    0.0495300781475362, 0.0625000000000000, 0.0725602529652301,
+    0.0807800781475362, 0.0877298413143002, 0.0937500000000000,
+    0.0990601562950723, 0.1038102529652301, 0.1081072380824156,
+    0.1120300781475362, 0.1156387411919092, 0.1189798413143002,
+    0.1220903311127662, 0.1250000000000000, 0.1277332137890731,
+    0.1303101562950723, 0.1327477347951120, 0.1350602529652300,
+    0.1372599194618363, 0.1393572380824156, 0.1413613111267817,
+    0.1432800781475362, 0.1451205059304602, 0.1468887411919092,
+    0.1485902344426084, 0.1502298413143002, 0.1518119060977367,
+    0.1533403311127662, 0.1548186346995899, 0.1562500000000000,
+    0.1576373162299517, 0.1589832137890731, 0.1602900942795302,
+    0.1615601562950723,
+};
+#else
+static double str_bases[37] = {
+    0.0000000000000000, 0.0000000000000000, 0.0625000000000000,
+    0.0990601562950723, 0.1250000000000000, 0.1451205059304602,
+    0.1615601562950723, 0.1754596826286003, 0.1875000000000000,
+    0.1981203125901446, 0.2076205059304602, 0.2162144761648311,
+    0.2240601562950723, 0.2312774823838183, 0.2379596826286003,
+    0.2441806622255325, 0.2500000000000000, 0.2554664275781462,
+    0.2606203125901445, 0.2654954695902241, 0.2701205059304602,
+    0.2745198389236725, 0.2787144761648311, 0.2827226222535633,
+    0.2865601562950723, 0.2902410118609203, 0.2937774823838183,
+    0.2971804688852168, 0.3004596826286003, 0.3036238121954733,
+    0.3066806622255324, 0.3096372693991797, 0.3125000000000000,
+    0.3152746324599034, 0.3179664275781462, 0.3205801885590604,
+    0.3231203125901446,
+};
+#endif
+
+void
+mpi_setstr(mpi *rop, char *str, int base)
+{
+    long i;                    /* counter */
+    int sign;                  /* result sign */
+    BNI carry;                 /* carry value */
+    BNI value;                 /* temporary value */
+    BNI size;                  /* size of result */
+    char *ptr;                 /* end of valid input */
+
+    /* initialization */
+    sign = 0;
+    carry = 0;
+
+    /* skip leading spaces */
+    while (isspace(*str))
+       ++str;
+
+    /* check if sign supplied */
+    if (*str == '-') {
+       sign = 1;
+       ++str;
+    }
+    else if (*str == '+')
+       ++str;
+
+    /* skip leading zeros */
+    while (*str == '0')
+       ++str;
+
+    ptr = str;
+    while (*ptr) {
+       if (*ptr >= '0' && *ptr <= '9') {
+           if (*ptr - '0' >= base)
+               break;
+       }
+       else if (*ptr >= 'A' && *ptr <= 'Z') {
+           if (*ptr - 'A' + 10 >= base)
+               break;
+       }
+       else if (*ptr >= 'a' && *ptr <= 'z') {
+           if (*ptr - 'a' + 10 >= base)
+               break;
+       }
+       else
+           break;
+       ++ptr;
+    }
+
+    /* resulting size */
+    size = (ptr - str) * str_bases[base] + 1;
+
+    /* make sure rop has enough storage */
+    if (rop->alloc < size) {
+       rop->digs = mp_realloc(rop->digs, size * sizeof(BNS));
+       rop->alloc = size;
+    }
+    rop->size = size;
+
+    /* initialize rop to zero */
+    memset(rop->digs, '\0', size * sizeof(BNS));
+
+    /* set result sign */
+    rop->sign = sign;
+
+    /* convert string */
+    for (; str < ptr; str++) {
+       value = *str;
+       if (islower(value))
+           value = toupper(value);
+       value = value > '9' ? value - 'A' + 10 : value - '0';
+       value += rop->digs[0] * base;
+       carry = value >> BNSBITS;
+       rop->digs[0] = (BNS)value;
+       for (i = 1; i < size; i++) {
+           value = (BNI)rop->digs[i] * base + carry;
+           carry = value >> BNSBITS;
+           rop->digs[i] = (BNS)value;
+       }
+    }
+
+    /* normalize */
+    if (rop->size > 1 && rop->digs[rop->size - 1] == 0)
+       --rop->size;
+}
+
+void
+mpi_add(mpi *rop, mpi *op1, mpi *op2)
+{
+    mpi_addsub(rop, op1, op2, 0);
+}
+
+void
+mpi_addi(mpi *rop, mpi *op1, long op2)
+{
+    BNS digs[2];
+    mpi op;
+
+    op.digs = (BNS*)digs;
+    _mpi_seti(&op, op2);
+
+    mpi_addsub(rop, op1, &op, 0);
+}
+
+void
+mpi_sub(mpi *rop, mpi *op1, mpi *op2)
+{
+    mpi_addsub(rop, op1, op2, 1);
+}
+
+void
+mpi_subi(mpi *rop, mpi *op1, long op2)
+{
+    BNS digs[2];
+    mpi op;
+
+    op.digs = (BNS*)digs;
+    _mpi_seti(&op, op2);
+
+    mpi_addsub(rop, op1, &op, 1);
+}
+
+static void
+mpi_addsub(mpi *rop, mpi *op1, mpi *op2, int sub)
+{
+    long xlen;                         /* maximum result size */
+
+    if (sub ^ (op1->sign == op2->sign)) {
+       /* plus one for possible carry */
+       xlen = MAX(op1->size, op2->size) + 1;
+       if (rop->alloc < xlen) {
+           rop->digs = mp_realloc(rop->digs, sizeof(BNS) * xlen);
+           rop->alloc = xlen;
+       }
+       rop->size = mp_add(rop->digs, op1->digs, op2->digs,
+                          op1->size, op2->size);
+       rop->sign = op1->sign;
+    }
+    else {
+       long cmp;                       /* check for larger operator */
+
+       cmp = mpi_cmpabs(op1, op2);
+       if (cmp == 0) {
+           rop->digs[0] = 0;
+           rop->size = 1;
+           rop->sign = 0;
+       }
+       else {
+           xlen = MAX(op1->size, op2->size);
+           if (rop->alloc < xlen) {
+               rop->digs = mp_realloc(rop->digs, sizeof(BNS) * xlen);
+               rop->alloc = xlen;
+           }
+           if (cmp > 0) {
+               rop->size = mp_sub(rop->digs, op1->digs, op2->digs,
+                                  op1->size, op2->size);
+               rop->sign = op1->sign;
+           }
+           else {
+               rop->size = mp_sub(rop->digs, op2->digs, op1->digs,
+                                  op2->size, op1->size);
+               rop->sign = sub ^ op2->sign;
+           }
+       }
+    }
+}
+
+void
+mpi_mul(mpi *rop, mpi *op1, mpi *op2)
+{
+    int sign;                          /* sign flag */
+    BNS *digs;                         /* result data */
+    long xsize;                                /* result size */
+
+    /* get result sign */
+    sign = op1->sign ^ op2->sign;
+
+    /* check for special cases */
+    if (op1->size == 1) {
+       if (*op1->digs == 0) {
+           /* multiply by 0 */
+           mpi_seti(rop, 0);
+           return;
+       }
+       else if (*op1->digs == 1) {
+           /* multiply by +-1 */
+           if (rop->alloc < op2->size) {
+               rop->digs = mp_realloc(rop->digs, sizeof(BNS) * op2->size);
+               rop->alloc = op2->size;
+           }
+           rop->size = op2->size;
+           memmove(rop->digs, op2->digs, sizeof(BNS) * op2->size);
+           rop->sign = op2->size > 1 || *op2->digs ? sign : 0;
+
+           return;
+       }
+    }
+    else if (op2->size == 1) {
+       if (*op2->digs == 0) {
+           /* multiply by 0 */
+           mpi_seti(rop, 0);
+           return;
+       }
+       else if (*op2->digs == 1) {
+           /* multiply by +-1 */
+           if (rop->alloc < op1->size) {
+               rop->digs = mp_realloc(rop->digs, sizeof(BNS) * op1->size);
+               rop->alloc = op1->size;
+           }
+           rop->size = op1->size;
+           memmove(rop->digs, op1->digs, sizeof(BNS) * op1->size);
+           rop->sign = op1->size > 1 || *op1->digs ? sign : 0;
+
+           return;
+       }
+    }
+
+    /* allocate result data and set it to zero */
+    xsize = op1->size + op2->size;
+    if (rop->digs == op1->digs || rop->digs == op2->digs)
+       /* rop is also an operand */
+       digs = mp_calloc(1, sizeof(BNS) * xsize);
+    else {
+       if (rop->alloc < xsize) {
+           rop->digs = mp_realloc(rop->digs, sizeof(BNS) * xsize);
+           rop->alloc = xsize;
+       }
+       digs = rop->digs;
+       memset(digs, '\0', sizeof(BNS) * xsize);
+    }
+
+    /* multiply operands */
+    xsize = mp_mul(digs, op1->digs, op2->digs, op1->size, op2->size);
+
+    /* store result in rop */
+    if (digs != rop->digs) {
+       /* if rop was an operand, free old data */
+       mp_free(rop->digs);
+       rop->digs = digs;
+    }
+    rop->size = xsize;
+
+    /* set result sign */
+    rop->sign = sign;
+}
+
+void
+mpi_muli(mpi *rop, mpi *op1, long op2)
+{
+    BNS digs[2];
+    mpi op;
+
+    op.digs = (BNS*)digs;
+    _mpi_seti(&op, op2);
+
+    mpi_mul(rop, op1, &op);
+}
+
+void
+mpi_div(mpi *rop, mpi *num, mpi *den)
+{
+    mpi_divqr(rop, NULL, num, den);
+}
+
+void
+mpi_rem(mpi *rop, mpi *num, mpi *den)
+{
+    mpi_divqr(NULL, rop, num, den);
+}
+
+/*
+ * Could/should be changed to not allocate qdigs if qrop is NULL
+ * Performance wouldn't suffer too much with a test on every loop iteration.
+ */
+void
+mpi_divqr(mpi *qrop, mpi *rrop, mpi *num, mpi *den)
+{
+    long i, j;                 /* counters */
+    int qsign;                 /* sign of quotient */
+    int rsign;                 /* sign of remainder */
+    BNI qsize;                 /* size of quotient */
+    BNI rsize;                 /* size of remainder */
+    BNS qest;                  /* estimative of quotient value */
+    BNS *qdigs, *rdigs;                /* work copy or result */
+    BNS *ndigs, *ddigs;                /* work copy or divisor and dividend */
+    BNI value;                 /* temporary result */
+    long svalue;               /* signed temporary result (2's complement) */
+    BNS carry, scarry, denorm; /* carry and normalization */
+    BNI dpos, npos;            /* offsets in data */
+
+    /* get signs */
+    rsign = num->sign;
+    qsign = rsign ^ den->sign;
+
+    /* check for special case */
+    if (num->size < den->size) {
+       /* quotient is zero and remainder is numerator */
+       if (rrop && rrop->digs != num->digs) {
+           if (rrop->alloc < num->size) {
+               rrop->digs = mp_realloc(rrop->digs, sizeof(BNS) * num->size);
+               rrop->alloc = num->size;
+           }
+           rrop->size = num->size;
+           memcpy(rrop->digs, num->digs, sizeof(BNS) * num->size);
+           rrop->sign = rsign;
+       }
+       if (qrop)
+           mpi_seti(qrop, 0);
+
+       return;
+    }
+
+    /* estimate result sizes */
+    rsize = den->size;
+    qsize = num->size - den->size + 1;
+
+    /* offsets */
+    npos = num->size - 1;
+    dpos = den->size - 1;
+
+    /* allocate space for quotient and remainder */
+    if (qrop == NULL || qrop->digs == num->digs || qrop->digs == den->digs)
+       qdigs = mp_calloc(1, sizeof(BNS) * qsize);
+    else {
+       if (qrop->alloc < qsize) {
+           qrop->digs = mp_realloc(qrop->digs, sizeof(BNS) * qsize);
+           qrop->alloc = qsize;
+       }
+       memset(qrop->digs, '\0', sizeof(BNS) * qsize);
+       qdigs = qrop->digs;
+    }
+    if (rrop) {
+       if (rrop->digs == num->digs || rrop->digs == den->digs)
+           rdigs = mp_calloc(1, sizeof(BNS) * rsize);
+       else {
+           if (rrop->alloc < rsize) {
+               rrop->digs = mp_realloc(rrop->digs, sizeof(BNS) * rsize);
+               rrop->alloc = rsize;
+           }
+           memset(rrop->digs, '\0', sizeof(BNS) * rsize);
+           rdigs = rrop->digs;
+       }
+    }
+    else
+       rdigs = NULL;   /* fix gcc warning */
+
+    /* special case, only one word in divisor */
+    if (dpos == 0) {
+       for (carry = 0, i = npos; i >= 0; i--) {
+           value = ((BNI)carry << BNSBITS) + num->digs[i];
+           qdigs[i] = (BNS)(value / den->digs[0]);
+           carry = (BNS)(value % den->digs[0]);
+       }
+       if (rrop)
+           rdigs[0] = carry;
+
+       goto mpi_divqr_done;
+    }
+
+    /* make work copy of numerator */
+    ndigs = mp_malloc(sizeof(BNS) * (num->size + 1));
+    /* allocate one extra word an update offset */
+    memcpy(ndigs, num->digs, sizeof(BNS) * num->size);
+    ndigs[num->size] = 0;
+    ++npos;
+
+    /* normalize */
+    denorm = (BNS)((BNI)CARRY / ((BNI)(den->digs[dpos]) + 1));
+
+    if (denorm > 1) {
+       /* i <= num->size because ndigs has an extra word */
+       for (carry = 0, i = 0; i <= num->size; i++) {
+           value = ndigs[i] * (BNI)denorm + carry;
+           ndigs[i] = (BNS)value;
+           carry = (BNS)(value >> BNSBITS);
+       }
+       /* make work copy of denominator */
+       ddigs = mp_malloc(sizeof(BNS) * den->size);
+       memcpy(ddigs, den->digs, sizeof(BNS) * den->size);
+       for (carry = 0, i = 0; i < den->size; i++) {
+           value = ddigs[i] * (BNI)denorm + carry;
+           ddigs[i] = (BNS)value;
+           carry = (BNS)(value >> BNSBITS);
+       }
+    }
+    else
+       /* only allocate copy of denominator if going to change it */
+       ddigs = den->digs;
+
+    /* divide mp integers */
+    for (j = qsize - 1; j >= 0; j--, npos--) {
+       /* estimate quotient */
+       if (ndigs[npos] == ddigs[dpos])
+           qest = (BNS)SMASK;
+       else
+           qest = (BNS)((((BNI)(ndigs[npos]) << 16) + ndigs[npos - 1]) /
+                        ddigs[dpos]);
+
+       while ((value = ((BNI)(ndigs[npos]) << 16) + ndigs[npos - 1] -
+               qest * (BNI)(ddigs[dpos])) < CARRY &&
+               ddigs[dpos - 1] * (BNI)qest >
+               (value << BNSBITS) + ndigs[npos - 2])
+              --qest;
+
+       /* multiply and subtract */
+       carry = scarry = 0;
+       for (i = 0; i < den->size; i++) {
+           value = qest * (BNI)ddigs[i] + carry;
+           carry = (BNS)(value >> BNSBITS);
+           svalue = (long)ndigs[npos - dpos + i - 1] - (long)(value & SMASK) -
+                    (long)scarry;
+           ndigs[npos - dpos + i - 1] = (BNS)svalue;
+           scarry = svalue < 0;
+       }
+
+       svalue = (long)ndigs[npos] - (long)(carry & SMASK) - (long)scarry;
+       ndigs[npos] = (BNS)svalue;
+
+       if (svalue & LMASK) {
+           /* quotient too big */
+           --qest;
+           carry = 0;
+           for (i = 0; i < den->size; i++) {
+               value = ndigs[npos - dpos + i - 1] + (BNI)carry + (BNI)ddigs[i];
+               ndigs[npos - dpos + i - 1] = (BNS)value;
+               carry = (BNS)(value >> BNSBITS);
+           }
+           ndigs[npos] += carry;
+       }
+
+       qdigs[j] = qest;
+    }
+
+    /* calculate remainder */
+    if (rrop) {
+       for (carry = 0, j = dpos; j >= 0; j--) {
+           value = ((BNI)carry << BNSBITS) + ndigs[j];
+           rdigs[j] = (BNS)(value / denorm);
+           carry = (BNS)(value % denorm);
+       }
+    }
+
+    mp_free(ndigs);
+    if (ddigs != den->digs)
+       mp_free(ddigs);
+
+mpi_divqr_done:
+    if (rrop) {
+       if (rrop->digs != rdigs)
+           mp_free(rrop->digs);
+       /* normalize remainder */
+       for (i = rsize - 1; i >= 0; i--)
+           if (rdigs[i] != 0)
+               break;
+       if (i != rsize - 1) {
+           if (i < 0) {
+               rsign = 0;
+               rsize = 1;
+           }
+           else
+               rsize = i + 1;
+       }
+       rrop->digs = rdigs;
+       rrop->sign = rsign;
+       rrop->size = rsize;
+    }
+
+    /* normalize quotient */
+    if (qrop) {
+       if (qrop->digs != qdigs)
+           mp_free(qrop->digs);
+       for (i = qsize - 1; i >= 0; i--)
+           if (qdigs[i] != 0)
+               break;
+       if (i != qsize - 1) {
+           if (i < 0) {
+               qsign = 0;
+               qsize = 1;
+           }
+           else
+               qsize = i + 1;
+       }
+       qrop->digs = qdigs;
+       qrop->sign = qsign;
+       qrop->size = qsize;
+    }
+    else
+       mp_free(qdigs);
+}
+
+long
+mpi_divqri(mpi *qrop, mpi *num, long den)
+{
+    BNS ddigs[2];
+    mpi dop, rrop;
+    long remainder;
+
+    dop.digs = (BNS*)ddigs;
+    _mpi_seti(&dop, den);
+
+    memset(&rrop, '\0', sizeof(mpi));
+    mpi_init(&rrop);
+    mpi_divqr(qrop, &rrop, num, &dop);
+    remainder = rrop.digs[0];
+    if (rrop.size > 1)
+       remainder |= (BNI)(rrop.digs[1]) << BNSBITS;
+    if (rrop.sign)
+       remainder = -remainder;
+    mpi_clear(&rrop);
+
+    return (remainder);
+}
+
+void
+mpi_divi(mpi *rop, mpi *num, long den)
+{
+    BNS ddigs[2];
+    mpi dop;
+
+    dop.digs = (BNS*)ddigs;
+    _mpi_seti(&dop, den);
+
+    mpi_divqr(rop, NULL, num, &dop);
+}
+
+long
+mpi_remi(mpi *num, long den)
+{
+    return (mpi_divqri(NULL, num, den));
+}
+
+void
+mpi_mod(mpi *rop, mpi *num, mpi *den)
+{
+    mpi_rem(rop, num, den);
+    if (num->sign ^ den->sign)
+       mpi_add(rop, rop, den);
+}
+
+long
+mpi_modi(mpi *num, long den)
+{
+    long remainder;
+
+    remainder = mpi_remi(num, den);
+    if (num->sign ^ (den < 0))
+       remainder += den;
+
+    return (remainder);
+}
+
+void
+mpi_gcd(mpi *rop, mpi *num, mpi *den)
+{
+    long cmp;
+    mpi rem;
+
+    /* check if result already given */
+    cmp = mpi_cmpabs(num, den);
+
+    /* check if num is equal to den or if num is zero */
+    if (cmp == 0 || (num->size == 1 && num->digs[0] == 0)) {
+       mpi_set(rop, den);
+       rop->sign = 0;
+       return;
+    }
+    /* check if den is not zero */
+    if (den->size == 1 && den->digs[0] == 0) {
+       mpi_set(rop, num);
+       rop->sign = 0;
+       return;
+    }
+
+    /* don't call mpi_init, relies on realloc(0, size) == malloc(size) */
+    memset(&rem, '\0', sizeof(mpi));
+
+    /* if num larger than den */
+    if (cmp > 0) {
+       mpi_rem(&rem, num, den);
+       if (rem.size == 1 && rem.digs[0] == 0) {
+           /* exact division */
+           mpi_set(rop, den);
+           rop->sign = 0;
+           mpi_clear(&rem);
+           return;
+       }
+       mpi_set(rop, den);
+    }
+    else {
+       mpi_rem(&rem, den, num);
+       if (rem.size == 1 && rem.digs[0] == 0) {
+           /* exact division */
+           mpi_set(rop, num);
+           rop->sign = 0;
+           mpi_clear(&rem);
+           return;
+       }
+       mpi_set(rop, num);
+    }
+
+    /* loop using positive values */
+    rop->sign = rem.sign = 0;
+
+    /* cannot optimize this inverting rem/rop assignment earlier
+     * because rop mais be an operand */
+    mpi_swap(rop, &rem);
+
+    /* Euclides algorithm */
+    for (;;) {
+       mpi_rem(&rem, &rem, rop);
+       if (rem.size == 1 && rem.digs[0] == 0)
+           break;
+       mpi_swap(rop, &rem);
+    }
+    mpi_clear(&rem);
+}
+
+void
+mpi_lcm(mpi *rop, mpi *num, mpi *den)
+{
+    mpi gcd;
+
+    /* check for zero operand */
+    if ((num->size == 1 && num->digs[0] == 0) ||
+       (den->size == 1 && den->digs[0] == 0)) {
+       rop->digs[0] = 0;
+       rop->sign = 0;
+       return;
+    }
+
+    /* don't call mpi_init, relies on realloc(0, size) == malloc(size) */
+    memset(&gcd, '\0', sizeof(mpi));
+
+    mpi_gcd(&gcd, num, den);
+    mpi_div(&gcd, den, &gcd);
+    mpi_mul(rop, &gcd, num);
+    rop->sign = 0;
+
+    mpi_clear(&gcd);
+}
+
+void
+mpi_pow(mpi *rop, mpi *op, unsigned long exp)
+{
+    mpi zop, top;
+
+    if (exp == 2) {
+       mpi_mul(rop, op, op);
+       return;
+    }
+    /* check for op**0 */
+    else if (exp == 0) {
+       rop->digs[0] = 1;
+       rop->size = 1;
+       rop->sign = 0;
+       return;
+    }
+    else if (exp == 1) {
+       mpi_set(rop, op);
+       return;
+    }
+    else if (op->size == 1) {
+       if (op->digs[0] == 0) {
+           mpi_seti(rop, 0);
+           return;
+       }
+       else if (op->digs[0] == 1) {
+           mpi_seti(rop, op->sign && (exp & 1) ? -1 : 1);
+           return;
+       }
+    }
+
+    memset(&zop, '\0', sizeof(mpi));
+    memset(&top, '\0', sizeof(mpi));
+    mpi_set(&zop, op);
+    mpi_set(&top, op);
+    for (--exp; exp; exp >>= 1) {
+       if (exp & 1)
+           mpi_mul(&zop, &top, &zop);
+       mpi_mul(&top, &top, &top);
+    }
+
+    mpi_clear(&top);
+    rop->sign = zop.sign;
+    mp_free(rop->digs);
+    rop->digs = zop.digs;
+    rop->size = zop.size;
+}
+
+/* Find integer root of given number using the iteration
+ *     x{n+1} = ((K-1) * x{n} + N / x{n}^(K-1)) / K
+ */
+int
+mpi_root(mpi *rop, mpi *op, unsigned long nth)
+{
+    long bits, cmp;
+    int exact;
+    int sign;
+    mpi *r, t, temp, quot, old, rem;
+
+    sign = op->sign;
+
+    /* divide by zero op**1/0 */
+    if (nth == 0) {
+       int one = 1, zero = 0;
+       one = one / zero;
+    }
+    /* result is complex */
+    if (sign && !(nth & 1)) {
+       int one = 1, zero = 0;
+       one = one / zero;
+    }
+
+    /* special case op**1/1 = op */
+    if (nth == 1) {
+       mpi_set(rop, op);
+       return (1);
+    }
+
+    bits = mpi_getsize(op, 2) - 2;
+
+    if (bits < 0 || bits / nth == 0) {
+       /* integral root is surely less than 2 */
+       exact = op->size == 1 && (op->digs[0] == 1 || op->digs[0] == 0);
+       mpi_seti(rop, sign ? -1 : op->digs[0] == 0 ? 0 : 1);
+
+       return (exact == 1);
+    }
+
+    /* initialize */
+    if (rop != op)
+       r = rop;
+    else {
+       r = &t;
+       memset(r, '\0', sizeof(mpi));
+    }
+    memset(&temp, '\0', sizeof(mpi));
+    memset(&quot, '\0', sizeof(mpi));
+    memset(&old, '\0', sizeof(mpi));
+    memset(&rem, '\0', sizeof(mpi));
+
+    if (sign)
+       r->sign = 0;
+
+    /* root aproximation */
+    mpi_ash(r, op, -(bits - (bits / nth)));
+
+    for (;;) {
+       mpi_pow(&temp, r, nth - 1);
+       mpi_divqr(&quot, &rem, op, &temp);
+       cmp = mpi_cmpabs(r, &quot);
+       if (cmp == 0) {
+           exact = mpi_cmpi(&rem, 0) == 0;
+           break;
+       }
+       else if (cmp < 0) {
+           if (mpi_cmpabs(r, &old) == 0) {
+               exact = 0;
+               break;
+           }
+           mpi_set(&old, r);
+       }
+       mpi_muli(&temp, r, nth - 1);
+       mpi_add(&quot, &quot, &temp);
+       mpi_divi(r, &quot, nth);
+    }
+
+    mpi_clear(&temp);
+    mpi_clear(&quot);
+    mpi_clear(&old);
+    mpi_clear(&rem);
+    if (r != rop) {
+       mpi_set(rop, r);
+       mpi_clear(r);
+    }
+    rop->sign = sign;
+
+    return (exact);
+}
+
+/*
+ * Find square root using the iteration:
+ *     x{n+1} = (x{n}+N/x{n})/2
+ */
+int
+mpi_sqrt(mpi *rop, mpi *op)
+{
+    long bits, cmp;
+    int exact;
+    mpi *r, t, quot, rem, old;
+
+    /* result is complex */
+    if (op->sign) {
+       int one = 1, zero = 0;
+       one = one / zero;
+    }
+
+    bits = mpi_getsize(op, 2) - 2;
+
+    if (bits < 2) {
+       /* integral root is surely less than 2 */
+       exact = op->size == 1 && (op->digs[0] == 1 || op->digs[0] == 0);
+       mpi_seti(rop, op->digs[0] == 0 ? 0 : 1);
+
+       return (exact == 1);
+    }
+
+    /* initialize */
+    if (rop != op)
+       r = rop;
+    else {
+       r = &t;
+       memset(r, '\0', sizeof(mpi));
+    }
+    memset(&quot, '\0', sizeof(mpi));
+    memset(&rem, '\0', sizeof(mpi));
+    memset(&old, '\0', sizeof(mpi));
+
+    /* root aproximation */
+    mpi_ash(r, op, -(bits - (bits / 2)));
+
+    for (;;) {
+       if (mpi_cmpabs(r, &old) == 0) {
+           exact = 0;
+           break;
+       }
+       mpi_divqr(&quot, &rem, op, r);
+       cmp = mpi_cmpabs(&quot, r);
+       if (cmp == 0) {
+           exact = mpi_cmpi(&rem, 0) == 0;
+           break;
+       }
+       else if (cmp > 0 && rem.size == 1 && rem.digs[0] == 0)
+           mpi_subi(&quot, &quot, 1);
+       mpi_set(&old, r);
+       mpi_add(r, r, &quot);
+       mpi_ash(r, r, -1);
+    }
+    mpi_clear(&quot);
+    mpi_clear(&rem);
+    mpi_clear(&old);
+    if (r != rop) {
+       mpi_set(rop, r);
+       mpi_clear(r);
+    }
+
+    return (exact);
+}
+
+void
+mpi_ash(mpi *rop, mpi *op, long shift)
+{
+    long i;                    /* counter */
+    long xsize;                        /* maximum result size */
+    BNS *digs;
+
+    /* check for 0 shift, multiply/divide by 1 */
+    if (shift == 0) {
+       if (rop != op) {
+           if (rop->alloc < op->size) {
+               rop->digs = mp_realloc(rop->digs, sizeof(BNS) * op->size);
+               rop->alloc = op->size;
+           }
+           rop->size = op->size;
+           memcpy(rop->digs, op->digs, sizeof(BNS) * op->size);
+       }
+
+       return;
+    }
+    else if (op->size == 1 && op->digs[0] == 0) {
+       rop->sign = 0;
+       rop->size = 1;
+       rop->digs[0] = 0;
+
+       return;
+    }
+
+    /* check shift and initialize */
+    if (shift > 0)
+       xsize = op->size + (shift / BNSBITS) + 1;
+    else {
+       xsize = op->size - ((-shift) / BNSBITS);
+       if (xsize <= 0) {
+           rop->size = 1;
+           rop->sign = op->sign;
+           rop->digs[0] = op->sign ? 1 : 0;
+
+           return;
+       }
+    }
+
+    /* allocate/adjust memory for result */
+    if (rop == op)
+       digs = mp_malloc(sizeof(BNS) * xsize);
+    else {
+       if (rop->alloc < xsize) {
+           rop->digs = mp_realloc(rop->digs, sizeof(BNS) * xsize);
+           rop->alloc = xsize;
+       }
+       digs = rop->digs;
+    }
+
+    /* left shift, multiply by power of two */
+    if (shift > 0)
+       rop->size = mp_lshift(digs, op->digs, op->size, shift);
+    /* right shift, divide by power of two */
+    else {
+       long carry = 0;
+
+       if (op->sign) {
+           BNI words, bits;
+
+           words = -shift / BNSBITS;
+           bits = -shift % BNSBITS;
+           for (i = 0; i < words; i++)
+               carry |= op->digs[xsize + i];
+           if (!carry) {
+               for (i = 0; i < bits; i++)
+                   if (op->digs[op->size - xsize] & (1 << i)) {
+                       carry = 1;
+                       break;
+                   }
+           }
+       }
+       rop->size = mp_rshift(digs, op->digs, op->size, -shift);
+
+       if (carry)
+           /* emulates two's complement subtracting 1 from the result */
+           rop->size = mp_add(digs, digs, mpone.digs, rop->size, 1);
+    }
+
+    if (rop->digs != digs) {
+       mp_free(rop->digs);
+       rop->alloc = rop->size;
+       rop->digs = digs;
+    }
+    rop->sign = op->sign;
+}
+
+static INLINE BNS
+mpi_logic(BNS op1, BNS op2, BNS op)
+{
+    switch (op) {
+       case '&':
+           return (op1 & op2);
+       case '|':
+           return (op1 | op2);
+       case '^':
+           return (op1 ^ op2);
+    }
+
+    return (SMASK);
+}
+
+static void
+mpi_log(mpi *rop, mpi *op1, mpi *op2, BNS op)
+{
+    long i;                    /* counter */
+    long c, c1, c2;            /* carry */
+    BNS *digs, *digs1, *digs2; /* pointers to mp data */
+    BNI size, size1, size2;
+    BNS sign, sign1, sign2;
+    BNS n, n1, n2;             /* logical operands */
+    BNI sum;
+
+    /* initialize */
+    size1 = op1->size;
+    size2 = op2->size;
+
+    sign1 = op1->sign ? SMASK : 0;
+    sign2 = op2->sign ? SMASK : 0;
+
+    sign = mpi_logic(sign1, sign2, op);
+
+    size = MAX(size1, size2);
+    if (sign)
+       ++size;
+    if (rop->alloc < size) {
+       rop->digs = mp_realloc(rop->digs, sizeof(BNS) * size);
+       rop->alloc = size;
+    }
+
+    digs = rop->digs;
+    digs1 = op1->digs;
+    digs2 = op2->digs;
+
+    c = c1 = c2 = 1;
+
+    /* apply logical operation */
+    for (i = 0; i < size; i++) {
+       if (i >= size1)
+           n1 = sign1;
+       else if (sign1) {
+           sum = (BNI)(BNS)(~digs1[i]) + c1;
+           c1 = (long)(sum >> BNSBITS);
+           n1 = (BNS)sum;
+       }
+       else
+           n1 = digs1[i];
+
+       if (i >= size2)
+           n2 = sign2;
+       else if (sign2) {
+           sum = (BNI)(BNS)(~digs2[i]) + c2;
+           c2 = (long)(sum >> BNSBITS);
+           n2 = (BNS)sum;
+       }
+       else
+           n2 = digs2[i];
+
+       n = mpi_logic(n1, n2, op);
+       if (sign) {
+           sum = (BNI)(BNS)(~n) + c;
+           c = (long)(sum >> BNSBITS);
+           digs[i] = (BNS)sum;
+       }
+       else
+           digs[i] = n;
+    }
+
+    /* normalize */
+    for (i = size - 1; i >= 0; i--)
+       if (digs[i] != 0)
+           break;
+    if (i != size - 1) {
+       if (i < 0) {
+           sign = 0;
+           size = 1;
+       }
+       else
+           size = i + 1;
+    }
+
+    rop->sign = sign != 0;
+    rop->size = size;
+}
+
+void
+mpi_and(mpi *rop, mpi *op1, mpi *op2)
+{
+    mpi_log(rop, op1, op2, '&');
+}
+
+void
+mpi_ior(mpi *rop, mpi *op1, mpi *op2)
+{
+    mpi_log(rop, op1, op2, '|');
+}
+
+void
+mpi_xor(mpi *rop, mpi *op1, mpi *op2)
+{
+    mpi_log(rop, op1, op2, '^');
+}
+
+void
+mpi_com(mpi *rop, mpi *op)
+{
+    static BNS digs[1] = { 1 };
+    static mpi one = { 0, 1, 1, (BNS*)&digs };
+
+    mpi_log(rop, rop, &one, '^');
+}
+
+void
+mpi_neg(mpi *rop, mpi *op)
+{
+    int sign = op->sign ^ 1;
+
+    if (rop->digs != op->digs) {
+       if (rop->alloc < op->size) {
+           rop->digs = mp_realloc(rop->digs, sizeof(BNS) * rop->size);
+           rop->alloc = op->size;
+       }
+       rop->size = op->size;
+       memcpy(rop->digs, op->digs, sizeof(BNS) * rop->size);
+    }
+
+    rop->sign = sign;
+}
+
+void
+mpi_abs(mpi *rop, mpi *op)
+{
+    if (rop->digs != op->digs) {
+       if (rop->alloc < op->size) {
+           rop->digs = mp_realloc(rop->digs, sizeof(BNS) * rop->size);
+           rop->alloc = op->size;
+       }
+       rop->size = op->size;
+       memcpy(rop->digs, op->digs, sizeof(BNS) * rop->size);
+    }
+
+    rop->sign = 0;
+}
+
+int
+mpi_cmp(mpi *op1, mpi *op2)
+{
+    if (op1->sign ^ op2->sign)
+       return (op1->sign ? -1 : 1);
+
+    if (op1->size == op2->size) {
+       long i, cmp = 0;
+
+       for (i = op1->size - 1; i >= 0; i--)
+           if ((cmp = (long)op1->digs[i] - (long)op2->digs[i]) != 0)
+               break;
+
+       return (cmp == 0 ? 0 : (cmp < 0) ^ op1->sign ? -1 : 1);
+    }
+
+    return ((op1->size < op2->size) ^ op1->sign ? -1 : 1);
+}
+
+int
+mpi_cmpi(mpi *op1, long op2)
+{
+    long cmp;
+
+    if (op1->size > 2)
+       return (op1->sign ? -1 : 1);
+
+    cmp = op1->digs[0];
+    if (op1->size == 2) {
+       cmp |= (long)op1->digs[1] << BNSBITS;
+       if (cmp == MINSLONG)
+           return (op2 == cmp && op1->sign ? 0 : op1->sign ? -1 : 1);
+    }
+    if (op1->sign)
+       cmp = -cmp;
+
+    return (cmp - op2);
+}
+
+int
+mpi_cmpabs(mpi *op1, mpi *op2)
+{
+    if (op1->size == op2->size) {
+       long i, cmp = 0;
+
+       for (i = op1->size - 1; i >= 0; i--)
+           if ((cmp = (long)op1->digs[i] - (long)op2->digs[i]) != 0)
+               break;
+
+       return (cmp);
+    }
+
+    return ((op1->size < op2->size) ? -1 : 1);
+}
+
+int
+mpi_cmpabsi(mpi *op1, long op2)
+{
+    unsigned long cmp;
+
+    if (op1->size > 2)
+       return (1);
+
+    cmp = op1->digs[0];
+    if (op1->size == 2)
+       cmp |= (unsigned long)op1->digs[1] << BNSBITS;
+
+    return (cmp > op2 ? 1 : cmp == op2 ? 0 : -1);
+}
+
+int
+mpi_sgn(mpi *op)
+{
+    return (op->sign ? -1 : op->size > 1 || op->digs[0] ? 1 : 0);
+}
+
+void
+mpi_swap(mpi *op1, mpi *op2)
+{
+    if (op1 != op2) {
+       mpi swap;
+
+       memcpy(&swap, op1, sizeof(mpi));
+       memcpy(op1, op2, sizeof(mpi));
+       memcpy(op2, &swap, sizeof(mpi));
+    }
+}
+
+int
+mpi_fiti(mpi *op)
+{
+    if (op->size == 1)
+       return (1);
+    else if (op->size == 2) {
+       unsigned long value = ((BNI)(op->digs[1]) << BNSBITS) | op->digs[0];
+
+       if (value & MINSLONG)
+           return (op->sign && value == MINSLONG) ? 1 : 0;
+
+       return (1);
+    }
+
+    return (0);
+}
+
+long
+mpi_geti(mpi *op)
+{
+    long value;
+
+    value = op->digs[0];
+    if (op->size > 1)
+       value |= (BNI)(op->digs[1]) << BNSBITS;
+
+    return (op->sign && value != MINSLONG ? -value : value);
+}
+
+double
+mpi_getd(mpi *op)
+{
+    long i, len;
+    double d = 0.0;
+    int exponent;
+
+#define FLOATDIGS      sizeof(double) / sizeof(BNS)
+
+    switch (op->size) {
+       case 2:
+           d = (BNI)(op->digs[1]) << BNSBITS;
+       case 1:
+           d += op->digs[0];
+           return (op->sign ? -d : d);
+       default:
+           break;
+    }
+
+    for (i = 0, len = op->size; len > 0 && i < FLOATDIGS; i++)
+       d = ldexp(d, BNSBITS) + op->digs[--len];
+    d = frexp(d, &exponent);
+    if (len > 0)
+       exponent += len * BNSBITS;
+
+    if (d == 0.0)
+       return (d);
+
+    d = ldexp(d, exponent);
+
+    return (op->sign ? -d : d);
+}
+
+/* how many digits in a given base, floor(log(CARRY) / log(base)) */
+#ifdef LONG64
+static char dig_bases[37] = {
+     0,  0, 32, 20, 16, 13, 12, 11, 10, 10,  9,  9,  8,  8,  8,  8,
+     8,  7,  7,  7,  7,  7,  7,  7,  6,  6,  6,  6,  6,  6,  6,  6,
+     6,  6,  6,  6,  6,
+};
+#else
+static char dig_bases[37] = {
+     0,  0, 16, 10,  8,  6,  6,  5,  5,  5,  4,  4,  4,  4,  4,  4,
+     4,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
+     3,  3,  3,  3,  3,
+};
+#endif
+
+/* how many digits per bit in a given base, log(2) / log(base) */
+static double bit_bases[37] = {
+    0.0000000000000000, 0.0000000000000000, 1.0000000000000000,
+    0.6309297535714575, 0.5000000000000000, 0.4306765580733931,
+    0.3868528072345416, 0.3562071871080222, 0.3333333333333334,
+    0.3154648767857287, 0.3010299956639811, 0.2890648263178878,
+    0.2789429456511298, 0.2702381544273197, 0.2626495350371936,
+    0.2559580248098155, 0.2500000000000000, 0.2446505421182260,
+    0.2398124665681315, 0.2354089133666382, 0.2313782131597592,
+    0.2276702486969530, 0.2242438242175754, 0.2210647294575037,
+    0.2181042919855316, 0.2153382790366965, 0.2127460535533632,
+    0.2103099178571525, 0.2080145976765095, 0.2058468324604344,
+    0.2037950470905062, 0.2018490865820999, 0.2000000000000000,
+    0.1982398631705605, 0.1965616322328226, 0.1949590218937863,
+    0.1934264036172708,
+};
+
+/* normalization base for string conversion, pow(base, dig_bases[base]) & ~CARRY */
+#ifdef LONG64
+static BNS big_bases[37] = {
+    0x00000001, 0x00000001, 0x00000000, 0xCFD41B91, 0x00000000, 0x48C27395,
+    0x81BF1000, 0x75DB9C97, 0x40000000, 0xCFD41B91, 0x3B9ACA00, 0x8C8B6D2B,
+    0x19A10000, 0x309F1021, 0x57F6C100, 0x98C29B81, 0x00000000, 0x18754571,
+    0x247DBC80, 0x3547667B, 0x4C4B4000, 0x6B5A6E1D, 0x94ACE180, 0xCAF18367,
+    0x0B640000, 0x0E8D4A51, 0x1269AE40, 0x17179149, 0x1CB91000, 0x23744899,
+    0x2B73A840, 0x34E63B41, 0x40000000, 0x4CFA3CC1, 0x5C13D840, 0x6D91B519,
+    0x81BF1000,
+};
+#else
+static BNS big_bases[37] = {
+    0x0001, 0x0001, 0x0000, 0xE6A9, 0x0000, 0x3D09, 0xB640, 0x41A7, 0x8000,
+    0xE6A9, 0x2710, 0x3931, 0x5100, 0x6F91, 0x9610, 0xC5C1, 0x0000, 0x1331,
+    0x16C8, 0x1ACB, 0x1F40, 0x242D, 0x2998, 0x2F87, 0x3600, 0x3D09, 0x44A8,
+    0x4CE3, 0x55C0, 0x5F45, 0x6978, 0x745F, 0x8000, 0x8C61, 0x9988, 0xA77B,
+    0xb640,
+};
+#endif
+
+unsigned long
+mpi_getsize(mpi *op, int base)
+{
+    unsigned long value, bits;
+
+    value = op->digs[op->size - 1];
+
+    /* count leading bits */
+    if (value) {
+       unsigned long count, carry;
+
+       for (count = 0, carry = CARRY >> 1; carry; count++, carry >>= 1)
+           if (value & carry)
+               break;
+
+       bits = BNSBITS - count;
+    }
+    else
+       bits = 0;
+
+    return ((bits + (op->size - 1) * BNSBITS) * bit_bases[base] + 1);
+}
+
+char *
+mpi_getstr(char *str, mpi *op, int base)
+{
+    long i;                    /* counter */
+    BNS *digs, *xdigs;         /* copy of op data */
+    BNI size;                  /* size of op */
+    BNI digits;                        /* digits per word in given base */
+    BNI bigbase;               /* big base of given base */
+    BNI strsize;               /* size of resulting string */
+    char *cp;                  /* pointer in str for conversion */
+
+    /* initialize */
+    size = op->size;
+    strsize = mpi_getsize(op, base) + op->sign + 1;
+
+    if (str == NULL)
+       str = mp_malloc(strsize);
+
+    /* check for zero */
+    if (size == 1 && op->digs[0] == 0) {
+       str[0] = '0';
+       str[1] = '\0';
+
+       return (str);
+    }
+
+    digits = dig_bases[base];
+    bigbase = big_bases[base];
+
+    cp = str + strsize;
+    *--cp = '\0';
+
+    /* make copy of op data and adjust digs */
+    xdigs = mp_malloc(size * sizeof(BNS));
+    memcpy(xdigs, op->digs, size * sizeof(unsigned short));
+    digs = xdigs + size - 1;
+
+    /* convert to string */
+    for (;;) {
+       long count = -1;
+       BNI value;
+       BNS quotient, remainder = 0;
+
+       /* if power of two base */
+       if ((base & (base - 1)) == 0) {
+           for (i = 0; i < size; i++) {
+               quotient = remainder;
+               remainder = digs[-i];
+               digs[-i] = quotient;
+               if (count < 0 && quotient)
+                   count = i;
+           }
+       }
+       else {
+           for (i = 0; i < size; i++) {
+               value = digs[-i] + ((BNI)remainder << BNSBITS);
+               quotient = (BNS)(value / bigbase);
+               remainder = (BNS)(value % bigbase);
+               digs[-i] = quotient;
+               if (count < 0 && quotient)
+                   count = i;
+           }
+       }
+       quotient = remainder;
+       for (i = 0; i < digits; i++) {
+           if (quotient == 0 && count < 0)
+               break;
+           remainder = quotient % base;
+           quotient /= base;
+           *--cp = remainder < 10 ? remainder + '0' : remainder - 10 + 'A';
+       }
+       if (count < 0)
+           break;
+       digs -= count;
+       size -= count;
+    }
+
+    /* adjust sign */
+    if (op->sign)
+       *--cp = '-';
+
+    /* remove any extra characters */
+    if (cp > str)
+       strcpy(str, cp);
+
+    mp_free(xdigs);
+
+    return (str);
+}
diff --git a/xedit/lisp/mp/mpr.c b/xedit/lisp/mp/mpr.c
new file mode 100644 (file)
index 0000000..3310a07
--- /dev/null
@@ -0,0 +1,436 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86$ */
+
+#include "mp.h"
+
+/*
+ * TODO:
+ *  Implement a fast gcd and divexact for integers, so that this code
+ * could be changed to do intermediary calculations faster using smaller
+ * numbers.
+ */
+
+/*
+ * Prototypes
+ */
+       /* do the hard work of mpr_add and mpr_sub */
+static void mpr_addsub(mpr *rop, mpr *op1, mpr *op2, int sub);
+
+       /* do the hard work of mpr_cmp and mpr_cmpabs */
+static int mpr_docmp(mpr *op1, mpr *op2, int sign);
+
+/*
+ * Implementation
+ */
+void
+mpr_init(mpr *op)
+{
+    op->num.digs = mp_malloc(sizeof(BNS));
+    op->num.sign = 0;
+    op->num.size = op->num.alloc = 1;
+    op->num.digs[0] = 0;
+
+    op->den.digs = mp_malloc(sizeof(BNS));
+    op->den.sign = 0;
+    op->den.size = op->den.alloc = 1;
+    op->den.digs[0] = 1;
+}
+
+void
+mpr_clear(mpr *op)
+{
+    op->num.sign = 0;
+    op->num.size = op->num.alloc = 0;
+    mp_free(op->num.digs);
+
+    op->den.sign = 0;
+    op->den.size = op->den.alloc = 0;
+    mp_free(op->den.digs);
+}
+
+void
+mpr_set(mpr *rop, mpr *op)
+{
+    if (rop != op) {
+       mpi_set(mpr_num(rop), mpr_num(op));
+       mpi_set(mpr_den(rop), mpr_den(op));
+    }
+}
+
+void
+mpr_seti(mpr *rop, long num, long den)
+{
+    mpi_seti(mpr_num(rop), num);
+    mpi_seti(mpr_den(rop), den);
+}
+
+void
+mpr_setd(mpr *rop, double d)
+{
+    double val, num;
+    int e, sign;
+
+    /* initialize */
+    if (d < 0) {
+       sign = 1;
+       val = -d;
+    }
+    else {
+       sign = 0;
+       val = d;
+    }
+
+    val = frexp(val, &e);
+    while (modf(val, &num) != 0.0 && val <= DBL_MAX / 2.0) {
+       --e;
+       val *= 2.0;
+    }
+    if (e >= 0) {
+       mpi_setd(mpr_num(rop), d);
+       mpi_seti(mpr_den(rop), 1);
+    }
+    else {
+       mpi_setd(mpr_num(rop), sign ? -num : num);
+       mpi_setd(mpr_den(rop), ldexp(1.0, -e));
+    }
+}
+
+void
+mpr_setstr(mpr *rop, char *str, int base)
+{
+    char *slash = strchr(str, '/');
+
+    mpi_setstr(mpr_num(rop), str, base);
+    if (slash != NULL)
+       mpi_setstr(mpr_den(rop), slash + 1, base);
+    else
+       mpi_seti(mpr_den(rop), 1);
+}
+
+void
+mpr_canonicalize(mpr *op)
+{
+    mpi gcd;
+
+    memset(&gcd, '\0', sizeof(mpi));
+
+    mpi_gcd(&gcd, mpr_num(op), mpr_den(op));
+    if (mpi_cmpabsi(&gcd, 1)) {
+       mpi_div(mpr_num(op), mpr_num(op), &gcd);
+       mpi_div(mpr_den(op), mpr_den(op), &gcd);
+    }
+
+    if (op->den.sign) {
+       op->num.sign = !op->num.sign;
+       op->den.sign = 0;
+    }
+
+    mpi_clear(&gcd);
+}
+
+void
+mpr_add(mpr *rop, mpr *op1, mpr *op2)
+{
+    mpr_addsub(rop, op1, op2, 0);
+}
+
+void
+mpr_addi(mpr *rop, mpr *op1, long op2)
+{
+    mpi prod;
+
+    memset(&prod, '\0', sizeof(mpi));
+
+    mpi_muli(&prod, mpr_den(op1), op2);
+    mpi_add(mpr_num(rop), mpr_num(op1), &prod);
+    mpi_clear(&prod);
+}
+
+void
+mpr_sub(mpr *rop, mpr *op1, mpr *op2)
+{
+    mpr_addsub(rop, op1, op2, 1);
+}
+
+void
+mpr_subi(mpr *rop, mpr *op1, long op2)
+{
+    mpi prod;
+
+    memset(&prod, '\0', sizeof(mpi));
+
+    mpi_muli(&prod, mpr_den(op1), op2);
+    mpi_sub(mpr_num(rop), mpr_num(op1), &prod);
+    mpi_clear(&prod);
+}
+
+static void
+mpr_addsub(mpr *rop, mpr *op1, mpr *op2, int sub)
+{
+    mpi prod1, prod2;
+
+    memset(&prod1, '\0', sizeof(mpi));
+    memset(&prod2, '\0', sizeof(mpi));
+
+    mpi_mul(&prod1, mpr_num(op1), mpr_den(op2));
+    mpi_mul(&prod2, mpr_num(op2), mpr_den(op1));
+
+    if (sub)
+       mpi_sub(mpr_num(rop), &prod1, &prod2);
+    else
+       mpi_add(mpr_num(rop), &prod1, &prod2);
+
+    mpi_clear(&prod1);
+    mpi_clear(&prod2);
+
+    mpi_mul(mpr_den(rop), mpr_den(op1), mpr_den(op2));
+}
+
+void
+mpr_mul(mpr *rop, mpr *op1, mpr *op2)
+{
+    /* check if temporary storage is required */
+    if (op1 == op2 && rop == op1) {
+       mpi prod;
+
+       memset(&prod, '\0', sizeof(mpi));
+
+       mpi_mul(&prod, mpr_num(op1), mpr_num(op2));
+       mpi_mul(mpr_den(rop), mpr_den(op1), mpr_den(op2));
+       mpi_set(mpr_num(rop), &prod);
+
+       mpi_clear(&prod);
+    }
+    else {
+       mpi_mul(mpr_num(rop), mpr_num(op1), mpr_num(op2));
+       mpi_mul(mpr_den(rop), mpr_den(op1), mpr_den(op2));
+    }
+}
+
+void
+mpr_muli(mpr *rop, mpr *op1, long op2)
+{
+    mpi_muli(mpr_num(rop), mpr_num(op1), op2);
+}
+
+void
+mpr_div(mpr *rop, mpr *op1, mpr *op2)
+{
+    /* check if temporary storage is required */
+    if (op1 == op2 && rop == op1) {
+       mpi prod;
+
+       memset(&prod, '\0', sizeof(mpi));
+
+       mpi_mul(&prod, mpr_num(op1), mpr_den(op2));
+       mpi_mul(mpr_den(rop), mpr_num(op2), mpr_den(op1));
+       mpi_set(mpr_num(rop), &prod);
+
+       mpi_clear(&prod);
+    }
+    else {
+       mpi_mul(mpr_num(rop), mpr_num(op1), mpr_den(op2));
+       mpi_mul(mpr_den(rop), mpr_num(op2), mpr_den(op1));
+    }
+}
+
+void
+mpr_divi(mpr *rop, mpr *op1, long op2)
+{
+    mpi_muli(mpr_den(rop), mpr_den(op1), op2);
+}
+
+void
+mpr_inv(mpr *rop, mpr *op)
+{
+    if (rop == op)
+       mpi_swap(mpr_num(op), mpr_den(op));
+    else {
+       mpi_set(mpr_num(rop), mpr_den(op));
+       mpi_set(mpr_den(rop), mpr_num(op));
+    }
+}
+
+void
+mpr_neg(mpr *rop, mpr *op)
+{
+    mpi_neg(mpr_num(rop), mpr_num(op));
+    mpi_set(mpr_den(rop), mpr_den(op));
+}
+
+void
+mpr_abs(mpr *rop, mpr *op)
+{
+    if (mpr_num(op)->sign)
+       mpi_neg(mpr_num(rop), mpr_num(op));
+    else
+       mpi_set(mpr_num(rop), mpr_num(op));
+
+    /* op may not be canonicalized */
+    if (mpr_den(op)->sign)
+       mpi_neg(mpr_den(rop), mpr_den(op));
+    else
+       mpi_set(mpr_den(rop), mpr_den(op));
+}
+
+int
+mpr_cmp(mpr *op1, mpr *op2)
+{
+    return (mpr_docmp(op1, op2, 1));
+}
+
+int
+mpr_cmpi(mpr *op1, long op2)
+{
+    int cmp;
+    mpr rat;
+
+    mpr_init(&rat);
+    mpi_seti(mpr_num(&rat), op2);
+    cmp = mpr_docmp(op1, &rat, 1);
+    mpr_clear(&rat);
+
+    return (cmp);
+}
+
+int
+mpr_cmpabs(mpr *op1, mpr *op2)
+{
+    return (mpr_docmp(op1, op2, 0));
+}
+
+int
+mpr_cmpabsi(mpr *op1, long op2)
+{
+    int cmp;
+    mpr rat;
+
+    mpr_init(&rat);
+    mpi_seti(mpr_num(&rat), op2);
+    cmp = mpr_docmp(op1, &rat, 0);
+    mpr_clear(&rat);
+
+    return (cmp);
+}
+
+static int
+mpr_docmp(mpr *op1, mpr *op2, int sign)
+{
+    int cmp, neg;
+    mpi prod1, prod2;
+
+    neg = 0;
+    if (sign) {
+       /* if op1 is negative */
+       if (mpr_num(op1)->sign ^ mpr_den(op1)->sign) {
+           /* if op2 is positive */
+           if (!(mpr_num(op2)->sign ^ mpr_den(op2)->sign))
+               return (-1);
+           else
+               neg = 1;
+       }
+       /* if op2 is negative */
+       else if (mpr_num(op2)->sign ^ mpr_den(op2)->sign)
+           return (1);
+       /* else same sign */
+    }
+
+    /* if denominators are equal, compare numerators */
+    if (mpi_cmpabs(mpr_den(op1), mpr_den(op2)) == 0) {
+       cmp = mpi_cmpabs(mpr_num(op1), mpr_num(op2));
+       if (cmp == 0)
+           return (0);
+       if (sign && neg)
+           return (cmp < 0 ? 1 : -1);
+       return (cmp);
+    }
+
+    memset(&prod1, '\0', sizeof(mpi));
+    memset(&prod2, '\0', sizeof(mpi));
+
+    /* "divide" op1 by op2
+     * if result is smaller than 1, op1 is smaller than op2 */
+    mpi_mul(&prod1, mpr_num(op1), mpr_den(op2));
+    mpi_mul(&prod2, mpr_num(op2), mpr_den(op1));
+
+    cmp = mpi_cmpabs(&prod1, &prod2);
+
+    mpi_clear(&prod1);
+    mpi_clear(&prod2);
+
+    if (sign && neg)
+       return (cmp < 0 ? 1 : -1);
+    return (cmp);
+}
+
+void
+mpr_swap(mpr *op1, mpr *op2)
+{
+    if (op1 != op2) {
+       mpr swap;
+
+       memcpy(&swap, op1, sizeof(mpr));
+       memcpy(op1, op2, sizeof(mpr));
+       memcpy(op2, &swap, sizeof(mpr));
+    }
+}
+
+int
+mpr_fiti(mpr *op)
+{
+    return (mpi_fiti(mpr_num(op)) && mpi_fiti(mpr_den(op)));
+}
+
+double
+mpr_getd(mpr *op)
+{
+    return (mpi_getd(mpr_num(op)) / mpi_getd(mpr_den(op)));
+}
+
+char *
+mpr_getstr(char *str, mpr *op, int base)
+{
+    int len;
+
+    if (str == NULL) {
+       len = mpi_getsize(mpr_num(op), base) + mpr_num(op)->sign + 1 +
+             mpi_getsize(mpr_den(op), base) + mpr_den(op)->sign + 1;
+
+       str = mp_malloc(len);
+    }
+
+    (void)mpi_getstr(str, mpr_num(op), base);
+    len = strlen(str);
+    str[len] = '/';
+    (void)mpi_getstr(str + len + 1, mpr_den(op), base);
+
+    return (str);
+}
diff --git a/xedit/lisp/package.c b/xedit/lisp/package.c
new file mode 100644 (file)
index 0000000..8b941ec
--- /dev/null
@@ -0,0 +1,849 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/package.c,v 1.20tsi Exp $ */
+
+#include "lisp/package.h"
+#include "lisp/private.h"
+
+/*
+ * Prototypes
+ */
+static int LispDoSymbol(LispObj*, LispAtom*, int, int);
+static LispObj *LispReallyDoSymbols(LispBuiltin*, int, int);
+static LispObj *LispDoSymbols(LispBuiltin*, int, int);
+static LispObj *LispFindSymbol(LispBuiltin*, int);
+static LispObj *LispFindPackageOrDie(LispBuiltin*, LispObj*);
+static void LispDoExport(LispBuiltin*, LispObj*, LispObj*, int);
+static void LispDoImport(LispBuiltin*, LispObj*);
+
+/*
+ * Initialization
+ */
+extern LispProperty *NOPROPERTY;
+static LispObj *Kinternal, *Kexternal, *Kinherited;
+
+/*
+ * Implementation
+ */
+void
+LispPackageInit(void)
+{
+    Kinternal  = KEYWORD("INTERNAL");
+    Kexternal  = KEYWORD("EXTERNAL");
+    Kinherited = KEYWORD("INHERITED");
+}
+
+LispObj *
+LispFindPackageFromString(char *string)
+{
+    LispObj *list, *package, *nick;
+
+    for (list = PACK; CONSP(list); list = CDR(list)) {
+       package = CAR(list);
+       if (strcmp(THESTR(package->data.package.name), string) == 0)
+           return (package);
+       for (nick = package->data.package.nicknames;
+            CONSP(nick); nick = CDR(nick))
+           if (strcmp(THESTR(CAR(nick)), string) == 0)
+               return (package);
+    }
+
+    return (NIL);
+}
+
+LispObj *
+LispFindPackage(LispObj *name)
+{
+    char *string = NULL;
+
+    if (PACKAGEP(name))
+       return (name);
+
+    if (SYMBOLP(name))
+       string = ATOMID(name)->value;
+    else if (STRINGP(name))
+       string = THESTR(name);
+    else
+       LispDestroy("FIND-PACKAGE: %s is not a string or symbol", STROBJ(name));
+
+    return (LispFindPackageFromString(string));
+}
+
+int
+LispCheckAtomString(char *string)
+{
+    char *ptr;
+
+    if (*string == '\0')
+       return (0);
+
+    for (ptr = string; *ptr; ptr++) {
+       if (islower(*ptr) || strchr("\"\\;#()`'|:", *ptr) ||
+           ((ptr == string || ptr[1] == '\0') && strchr(".,@", *ptr)))
+           return (0);
+    }
+
+    return (1);
+}
+
+/*   This function is used to avoid some namespace polution caused by the
+ * way builtin functions are created, all function name arguments enter
+ * the current package, but most of them do not have a property */
+static int
+LispDoSymbol(LispObj *package, LispAtom *atom, int if_extern, int all_packages)
+{
+    int dosymbol;
+
+    /* condition 1: atom package is current package */
+    dosymbol = !all_packages || atom->package == package;
+    if (dosymbol) {
+       /* condition 2: intern and extern symbols or symbol is extern */
+       dosymbol = !if_extern || atom->ext;
+       if (dosymbol) {
+           /* condition 3: atom has properties or is in
+            * the current package */
+           dosymbol = atom->property != NOPROPERTY ||
+                      package == lisp__data.keyword ||
+                      package == PACKAGE;
+       }
+    }
+
+    return (dosymbol);
+}
+
+static LispObj *
+LispFindPackageOrDie(LispBuiltin *builtin, LispObj *name)
+{
+    LispObj *package;
+
+    package = LispFindPackage(name);
+
+    if (package == NIL)
+       LispDestroy("%s: package %s is not available",
+                   STRFUN(builtin), STROBJ(name));
+
+    return (package);
+}
+
+/* package must be of type LispPackage_t, symbol type is checked
+   bypass lisp.c:LispExportSymbol() */
+static void
+LispDoExport(LispBuiltin *builtin,
+            LispObj *package, LispObj *symbol, int export)
+{
+    CHECK_SYMBOL(symbol);
+    if (!export) {
+       if (package == lisp__data.keyword ||
+           symbol->data.atom->package == lisp__data.keyword)
+           LispDestroy("%s: symbol %s cannot be unexported",
+                       STRFUN(builtin), STROBJ(symbol));
+    }
+
+    if (package == PACKAGE)
+       symbol->data.atom->ext = export ? 1 : 0;
+    else {
+       Atom_id string;
+       LispAtom *atom;
+       LispPackage *pack;
+
+       string = ATOMID(symbol);
+       pack = package->data.package.package;
+       atom = (LispAtom *)hash_check(pack->atoms,
+                                     string->value, string->length);
+
+       if (atom) {
+           atom->ext = export ? 1 : 0;
+           return;
+       }
+
+       LispDestroy("%s: the symbol %s is not available in package %s",
+                   STRFUN(builtin), STROBJ(symbol),
+                   THESTR(package->data.package.name));
+    }
+}
+
+static void
+LispDoImport(LispBuiltin *builtin, LispObj *symbol)
+{
+    CHECK_SYMBOL(symbol);
+    LispImportSymbol(symbol);
+}
+
+static LispObj *
+LispReallyDoSymbols(LispBuiltin *builtin, int only_externs, int all_symbols)
+{
+    int head = lisp__data.env.length;
+    LispPackage *pack = NULL;
+    LispAtom *atom;
+    LispObj *variable, *package = NULL, *list, *code, *result_form;
+
+    LispObj *init, *body;
+
+    body = ARGUMENT(1);
+    init = ARGUMENT(0);
+
+    /* Prepare for loop */
+    CHECK_CONS(init);
+    variable = CAR(init);
+    CHECK_SYMBOL(variable);
+
+    if (!all_symbols) {
+       /* if all_symbols, a package name is not specified in the init form */
+
+       init = CDR(init);
+       if (!CONSP(init))
+           LispDestroy("%s: missing package name", STRFUN(builtin));
+
+       /* Evaluate package specification */
+       package = EVAL(CAR(init));
+       if (!PACKAGEP(package))
+           package = LispFindPackageOrDie(builtin, package);
+
+       pack = package->data.package.package;
+    }
+
+    result_form = NIL;
+
+    init = CDR(init);
+    if (CONSP(init))
+       result_form = init;
+
+    /* Initialize iteration variable */
+    CHECK_CONSTANT(variable);
+    LispAddVar(variable, NIL);
+    ++lisp__data.env.head;
+
+    for (list = PACK; CONSP(list); list = CDR(list)) {
+       if (all_symbols) {
+           package = CAR(list);
+           pack = package->data.package.package;
+       }
+
+       /* Traverse the symbol list, executing body */
+       for (atom = (LispAtom *)hash_iter_first(pack->atoms);
+            atom;
+            atom = (LispAtom *)hash_iter_next(pack->atoms)) {
+               /* Save pointer to next atom. If variable is removed,
+                * predicatable result is only guaranteed if the bound
+                * variable is removed. */
+
+           if (LispDoSymbol(package, atom, only_externs, all_symbols)) {
+               LispSetVar(variable, atom->object);
+               for (code = body; CONSP(code); code = CDR(code))
+                   EVAL(CAR(code));
+           }
+       }
+
+       if (!all_symbols)
+           break;
+    }
+
+    /* Variable is still bound */
+    for (code = result_form; CONSP(code); code = CDR(code))
+       EVAL(CAR(code));
+
+    lisp__data.env.head = lisp__data.env.length = head;
+
+    return (NIL);
+}
+
+static LispObj *
+LispDoSymbols(LispBuiltin *builtin, int only_externs, int all_symbols)
+{
+    int did_jump, *pdid_jump = &did_jump;
+    LispObj *result, **presult = &result;
+    LispBlock *block;
+
+    *presult = NIL;
+    *pdid_jump = 1;
+    block = LispBeginBlock(NIL, LispBlockTag);
+    if (setjmp(block->jmp) == 0) {
+       *presult = LispReallyDoSymbols(builtin, only_externs, all_symbols);
+       *pdid_jump = 0;
+    }
+    LispEndBlock(block);
+    if (*pdid_jump)
+       *presult = lisp__data.block.block_ret;
+
+    return (*presult);
+}
+
+LispObj *
+LispFindSymbol(LispBuiltin *builtin, int intern)
+{
+    char *ptr;
+    LispAtom *atom;
+    LispObj *symbol;
+    LispPackage *pack;
+
+    LispObj *string, *package;
+
+    package = ARGUMENT(1);
+    string = ARGUMENT(0);
+
+    CHECK_STRING(string);
+    if (package != UNSPEC)
+       package = LispFindPackageOrDie(builtin, package);
+    else
+       package = PACKAGE;
+
+    /* If got here, package is a LispPackage_t */
+    pack = package->data.package.package;
+
+    /* Search symbol in specified package */
+    ptr = THESTR(string);
+
+    RETURN_COUNT = 1;
+
+    symbol = NULL;
+    /* Fix for current behaviour where NIL and T aren't symbols... */
+    if (STRLEN(string) == 3 && memcmp(ptr, "NIL", 3) == 0)
+       symbol = NIL;
+    else if (STRLEN(string) == 1 && ptr[0] == 'T')
+       symbol = T;
+    if (symbol) {
+       RETURN(0) = NIL;
+       return (symbol);
+    }
+
+    atom = (LispAtom *)hash_check(pack->atoms, ptr, strlen(ptr));
+    if (atom)
+       symbol = atom->object;
+
+    if (symbol == NULL || symbol->data.atom->package == NULL) {
+       RETURN(0) = NIL;
+       if (intern) {
+           /* symbol does not exist in the specified package, create a new
+            * internal symbol */
+
+           if (package == PACKAGE)
+               symbol = ATOM(ptr);
+           else {
+               LispPackage *savepack;
+               LispObj *savepackage;
+
+               /* Save package environment */
+               savepackage = PACKAGE;
+               savepack = lisp__data.pack;
+
+               /* Change package environment */
+               PACKAGE = package;
+               lisp__data.pack = package->data.package.package;
+
+               symbol = ATOM(ptr);
+
+               /* Restore package environment */
+               PACKAGE = savepackage;
+               lisp__data.pack = savepack;
+           }
+
+           symbol->data.atom->unreadable = !LispCheckAtomString(ptr);
+           /* If symbol being create in the keyword package, make it external */
+           if (package == lisp__data.keyword)
+               symbol->data.atom->ext = symbol->data.atom->constant = 1;
+       }
+       else
+           symbol = NIL;
+    }
+    else {
+       if (symbol->data.atom->package == package)
+           RETURN(0) = symbol->data.atom->ext ? Kexternal : Kinternal;
+       else
+           RETURN(0) = Kinherited;
+    }
+
+    return (symbol);
+}
+
+
+LispObj *
+Lisp_DoAllSymbols(LispBuiltin *builtin)
+/*
+ do-all-symbols init &rest body
+ */
+{
+    return (LispDoSymbols(builtin, 0, 1));
+}
+
+LispObj *
+Lisp_DoExternalSymbols(LispBuiltin *builtin)
+/*
+ do-external-symbols init &rest body
+ */
+{
+    return (LispDoSymbols(builtin, 1, 0));
+}
+
+LispObj *
+Lisp_DoSymbols(LispBuiltin *builtin)
+/*
+ do-symbols init &rest body
+ */
+{
+    return (LispDoSymbols(builtin, 0, 0));
+}
+
+LispObj *
+Lisp_FindAllSymbols(LispBuiltin *builtin)
+/*
+ find-all-symbols string-or-symbol
+ */
+{
+    GC_ENTER();
+    char *string = NULL;
+    LispAtom *atom;
+    LispPackage *pack;
+    LispObj *list, *package, *result;
+    int length = 0;
+
+    LispObj *string_or_symbol;
+
+    string_or_symbol = ARGUMENT(0);
+
+    if (STRINGP(string_or_symbol)) {
+       string = THESTR(string_or_symbol);
+       length = STRLEN(string_or_symbol);
+    }
+    else if (SYMBOLP(string_or_symbol)) {
+       string = ATOMID(string_or_symbol)->value;
+       length = ATOMID(string_or_symbol)->length;
+    }
+    else
+       LispDestroy("%s: %s is not a string or symbol",
+                   STRFUN(builtin), STROBJ(string_or_symbol));
+
+    result = NIL;
+
+    /* Traverse all packages, searching for symbols matching specified string */
+    for (list = PACK; CONSP(list); list = CDR(list)) {
+       package = CAR(list);
+       pack = package->data.package.package;
+
+       atom = (LispAtom *)hash_check(pack->atoms, string, length);
+       if (atom && LispDoSymbol(package, atom, 0, 1)) {
+           /* Return only one pointer to a matching symbol */
+
+           if (result == NIL) {
+               result = CONS(atom->object, NIL);
+               GC_PROTECT(result);
+           }
+           else {
+               /* Put symbols defined first in the
+                * beginning of the result list */
+               RPLACD(result, CONS(CAR(result), CDR(result)));
+               RPLACA(result, atom->object);
+           }
+       }
+    }
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+Lisp_FindSymbol(LispBuiltin *builtin)
+/*
+ find-symbol string &optional package
+ */
+{
+    return (LispFindSymbol(builtin, 0));
+}
+
+LispObj *
+Lisp_FindPackage(LispBuiltin *builtin)
+/*
+ find-package name
+ */
+{
+    LispObj *name;
+
+    name = ARGUMENT(0);
+
+    return (LispFindPackage(name));
+}
+
+LispObj *
+Lisp_Export(LispBuiltin *builtin)
+/*
+ export symbols &optional package
+ */
+{
+    LispObj *list;
+
+    LispObj *symbols, *package;
+
+    package = ARGUMENT(1);
+    symbols = ARGUMENT(0);
+
+    /* If specified, make sure package is available */
+    if (package != UNSPEC)
+       package = LispFindPackageOrDie(builtin, package);
+    else
+       package = PACKAGE;
+
+    /* Export symbols */
+    if (CONSP(symbols)) {
+       for (list = symbols; CONSP(list); list = CDR(list))
+           LispDoExport(builtin, package, CAR(list), 1);
+    }
+    else
+       LispDoExport(builtin, package, symbols, 1);
+
+    return (T);
+}
+
+LispObj *
+Lisp_Import(LispBuiltin *builtin)
+/*
+ import symbols &optional package
+ */
+{
+    int restore_package;
+    LispPackage *savepack = NULL;
+    LispObj *list, *savepackage = NULL;
+
+    LispObj *symbols, *package;
+
+    package = ARGUMENT(1);
+    symbols = ARGUMENT(0);
+
+    /* If specified, make sure package is available */
+    if (package != UNSPEC)
+       package = LispFindPackageOrDie(builtin, package);
+    else
+       package = PACKAGE;
+
+    restore_package = package != PACKAGE;
+    if (restore_package) {
+       /* Save package environment */
+       savepackage = PACKAGE;
+       savepack = lisp__data.pack;
+
+       /* Change package environment */
+       PACKAGE = package;
+       lisp__data.pack = package->data.package.package;
+    }
+
+    /* Export symbols */
+    if (CONSP(symbols)) {
+       for (list = symbols; CONSP(list); list = CDR(list))
+           LispDoImport(builtin, CAR(list));
+    }
+    else
+       LispDoImport(builtin, symbols);
+
+    if (restore_package) {
+       /* Restore package environment */
+       PACKAGE = savepackage;
+       lisp__data.pack = savepack;
+    }
+
+    return (T);
+}
+
+LispObj *
+Lisp_InPackage(LispBuiltin *builtin)
+/*
+ in-package name
+ */
+{
+    LispObj *package;
+
+    LispObj *name;
+
+    name = ARGUMENT(0);
+
+    package = LispFindPackageOrDie(builtin, name);
+
+    /* Update pointer to package symbol table */
+    lisp__data.pack = package->data.package.package;
+    PACKAGE = package;
+
+    return (package);
+}
+
+LispObj *
+Lisp_Intern(LispBuiltin *builtin)
+/*
+ intern string &optional package
+ */
+{
+    return (LispFindSymbol(builtin, 1));
+}
+
+LispObj *
+Lisp_ListAllPackages(LispBuiltin *builtin)
+/*
+ list-all-packages
+ */
+{
+    /*   Maybe this should be read-only or a copy of the package list.
+     *   But, if properly implemented, it should be possible to (rplaca)
+     * this variable from lisp code with no problems. Don't do it at home. */
+
+    return (PACK);
+}
+
+LispObj *
+Lisp_MakePackage(LispBuiltin *builtin)
+/*
+ make-package package-name &key nicknames use
+ */
+{
+    GC_ENTER();
+    LispObj *list, *package, *nicks, *cons, *savepackage;
+
+    LispObj *package_name, *nicknames, *use;
+
+    use = ARGUMENT(2);
+    nicknames = ARGUMENT(1);
+    package_name = ARGUMENT(0);
+
+    /* Check if package already exists */
+    package = LispFindPackage(package_name);
+    if (package != NIL)
+       /* FIXME: this should be a correctable error */
+       LispDestroy("%s: package %s already defined",
+                   STRFUN(builtin), STROBJ(package_name));
+
+    /* Error checks done, package_name is either a symbol or string */
+    if (!XSTRINGP(package_name))
+       package_name = STRING(ATOMID(package_name)->value);
+
+    GC_PROTECT(package_name);
+
+    /* Check nicknames */
+    nicks = cons = NIL;
+    for (list = nicknames; CONSP(list); list = CDR(list)) {
+       package = LispFindPackage(CAR(list));
+       if (package != NIL)
+           /* FIXME: this should be a correctable error */
+           LispDestroy("%s: nickname %s matches package %s",
+                       STRFUN(builtin), STROBJ(CAR(list)),
+                       THESTR(package->data.package.name));
+       /* Store all nicknames as strings */
+       package = CAR(list);
+       if (!XSTRINGP(package))
+           package = STRING(ATOMID(package)->value);
+       if (nicks == NIL) {
+           nicks = cons = CONS(package, NIL);
+           GC_PROTECT(nicks);
+       }
+       else {
+           RPLACD(cons, CONS(package, NIL));
+           cons = CDR(cons);
+       }
+    }
+
+    /* Check use list */
+    for (list = use; CONSP(list); list = CDR(list))
+       (void)LispFindPackageOrDie(builtin, CAR(list));
+
+    /* No errors, create new package */
+    package = LispNewPackage(package_name, nicks);
+
+    /* Update list of packages */
+    PACK = CONS(package, PACK);
+
+    /* No need for gc protection anymore */
+    GC_LEAVE();
+
+    /* Import symbols from use list */
+    savepackage = PACKAGE;
+
+    /* Update pointer to package symbol table */
+    lisp__data.pack = package->data.package.package;
+    PACKAGE = package;
+
+    if (use != UNSPEC) {
+       for (list = use; CONSP(list); list = CDR(list))
+           LispUsePackage(LispFindPackage(CAR(list)));
+    }
+    else
+       LispUsePackage(lisp__data.lisp);
+
+    /* Restore pointer to package symbol table */
+    lisp__data.pack = savepackage->data.package.package;
+    PACKAGE = savepackage;
+
+    return (package);
+}
+
+LispObj *
+Lisp_Packagep(LispBuiltin *builtin)
+/*
+ packagep object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (PACKAGEP(object) ? T : NIL);
+}
+
+LispObj *
+Lisp_PackageName(LispBuiltin *builtin)
+/*
+ package-name package
+ */
+{
+    LispObj *package;
+
+    package = ARGUMENT(0);
+
+    package = LispFindPackageOrDie(builtin, package);
+
+    return (package->data.package.name);
+}
+
+LispObj *
+Lisp_PackageNicknames(LispBuiltin *builtin)
+/*
+ package-nicknames package
+ */
+{
+    LispObj *package;
+
+    package = ARGUMENT(0);
+
+    package = LispFindPackageOrDie(builtin, package);
+
+    return (package->data.package.nicknames);
+}
+
+LispObj *
+Lisp_PackageUseList(LispBuiltin *builtin)
+/*
+ package-use-list package
+ */
+{
+    /*  If the variable returned by this function is expected to be changeable,
+     * need to change the layout of the LispPackage structure. */
+
+    LispPackage *pack;
+    LispObj *package, *use, *cons;
+
+    package = ARGUMENT(0);
+
+    package = LispFindPackageOrDie(builtin, package);
+
+    use = cons = NIL;
+    pack = package->data.package.package;
+
+    if (pack->use.length) {
+       GC_ENTER();
+       int i = pack->use.length - 1;
+
+       use = cons = CONS(pack->use.pairs[i], NIL);
+       GC_PROTECT(use);
+       for (--i; i >= 0; i--) {
+           RPLACD(cons, CONS(pack->use.pairs[i], NIL));
+           cons = CDR(cons);
+       }
+       GC_LEAVE();
+    }
+
+    return (use);
+}
+
+LispObj *
+Lisp_PackageUsedByList(LispBuiltin *builtin)
+/*
+ package-used-by-list package
+ */
+{
+    GC_ENTER();
+    int i;
+    LispPackage *pack;
+    LispObj *package, *other, *used, *cons, *list;
+
+    package = ARGUMENT(0);
+
+    package = LispFindPackageOrDie(builtin, package);
+
+    used = cons = NIL;
+
+    for (list = PACK; CONSP(list); list = CDR(list)) {
+       other = CAR(list);
+       if (package == other)
+           /* Surely package uses itself */
+           continue;
+
+       pack = other->data.package.package;
+
+       for (i = 0; i < pack->use.length; i++) {
+           if (pack->use.pairs[i] == package) {
+               if (used == NIL) {
+                   used = cons = CONS(other, NIL);
+                   GC_PROTECT(used);
+               }
+               else {
+                   RPLACD(cons, CONS(other, NIL));
+                   cons = CDR(cons);
+               }
+           }
+       }
+    }
+
+    GC_LEAVE();
+
+    return (used);
+}
+
+LispObj *
+Lisp_Unexport(LispBuiltin *builtin)
+/*
+ unexport symbols &optional package
+ */
+{
+    LispObj *list;
+
+    LispObj *symbols, *package;
+
+    package = ARGUMENT(1);
+    symbols = ARGUMENT(0);
+
+    /* If specified, make sure package is available */
+    if (package != UNSPEC)
+       package = LispFindPackageOrDie(builtin, package);
+    else
+       package = PACKAGE;
+
+    /* Export symbols */
+    if (CONSP(symbols)) {
+       for (list = symbols; CONSP(list); list = CDR(list))
+           LispDoExport(builtin, package, CAR(list), 0);
+    }
+    else
+       LispDoExport(builtin, package, symbols, 0);
+
+    return (T);
+}
diff --git a/xedit/lisp/package.h b/xedit/lisp/package.h
new file mode 100644 (file)
index 0000000..f6940c8
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/package.h,v 1.7tsi Exp $ */
+
+#ifndef Lisp_package_h
+#define Lisp_package_h
+
+#include "lisp/internal.h"
+
+void LispPackageInit(void);
+LispObj *LispFindPackage(LispObj*);
+LispObj *LispFindPackageFromString(char*);
+/* returns 1 if string can safely be read back */
+int LispCheckAtomString(char*);
+
+LispObj *Lisp_DoAllSymbols(LispBuiltin*);
+LispObj *Lisp_DoExternalSymbols(LispBuiltin*);
+LispObj *Lisp_DoSymbols(LispBuiltin*);
+LispObj *Lisp_FindAllSymbols(LispBuiltin*);
+LispObj *Lisp_FindPackage(LispBuiltin*);
+LispObj *Lisp_FindSymbol(LispBuiltin*);
+LispObj *Lisp_Export(LispBuiltin*);
+LispObj *Lisp_Import(LispBuiltin*);
+LispObj *Lisp_InPackage(LispBuiltin*);
+LispObj *Lisp_Intern(LispBuiltin*);
+LispObj *Lisp_ListAllPackages(LispBuiltin*);
+LispObj *Lisp_MakePackage(LispBuiltin*);
+LispObj *Lisp_Packagep(LispBuiltin*);
+LispObj *Lisp_PackageName(LispBuiltin*);
+LispObj *Lisp_PackageNicknames(LispBuiltin*);
+LispObj *Lisp_PackageUseList(LispBuiltin*);
+LispObj *Lisp_PackageUsedByList(LispBuiltin*);
+LispObj *Lisp_Unexport(LispBuiltin*);
+
+#endif /* Lisp_package_h */
diff --git a/xedit/lisp/pathname.c b/xedit/lisp/pathname.c
new file mode 100644 (file)
index 0000000..5d991fe
--- /dev/null
@@ -0,0 +1,1096 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/pathname.c,v 1.17tsi Exp $ */
+
+#include <stdio.h>     /* including dirent.h first may cause problems */
+#include <sys/types.h>
+#include <dirent.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include "lisp/pathname.h"
+#include "lisp/private.h"
+
+#define NOREAD_SKIP    0
+#define NOREAD_ERROR   1
+
+/*
+ * Initialization
+ */
+LispObj *Oparse_namestring, *Kerror, *Kabsolute, *Krelative, *Kskip;
+
+/*
+ * Implementation
+ */
+void
+LispPathnameInit(void)
+{
+    Kerror             = KEYWORD("ERROR");
+    Oparse_namestring  = STATIC_ATOM("PARSE-NAMESTRING");
+    Kabsolute          = KEYWORD("ABSOLUTE");
+    Krelative          = KEYWORD("RELATIVE");
+}
+
+static int
+glob_match(char *cmp1, char *cmp2)
+/*
+ * Note: this code was written from scratch, and may generate incorrect
+ * results for very complex glob masks.
+ */
+{
+    for (;;) {
+       while (*cmp1 && *cmp1 == *cmp2) {
+           ++cmp1;
+           ++cmp2;
+       }
+       if (*cmp2) {
+           if (*cmp1 == '*') {
+               while (*cmp1 == '*')
+                   ++cmp1;
+               if (*cmp1) {
+                   int count = 0, settmp = 1;
+                   char *tmp = cmp2, *sav2;
+
+                   while (*cmp1 && *cmp1 == '?') {
+                       ++cmp1;
+                       ++count;
+                   }
+
+                   /* need to recurse here to make sure
+                    * all cases are tested.
+                    */
+                   while (*cmp2 && *cmp2 != *cmp1)
+                       ++cmp2;
+                   if (!*cmp1 && cmp2 - tmp < count)
+                       return (0);
+                   sav2 = cmp2;
+
+                   /* if recursive calls fails, make sure all '?'
+                    * following '*' are processed */
+                   while (*sav2 && sav2 - tmp < count)
+                       ++sav2;
+
+                   for (; *cmp2;) {
+                       if (settmp) /* repeated letters: *?o? => boot, root */
+                           tmp = cmp2;
+                       else
+                           settmp = 1;
+                       while (*cmp2 && *cmp2 != *cmp1)
+                           ++cmp2;
+                       if (cmp2 - tmp < count) {
+                           if (*cmp2)
+                               ++cmp2;
+                           settmp = 0;
+                           continue;
+                       }
+                       if (*cmp2) {
+                           if (glob_match(cmp1, cmp2))
+                               return (1);
+                           ++cmp2;
+                       }
+                   }
+                   cmp2 = sav2;
+               }
+               else {
+                   while (*cmp2)
+                       ++cmp2;
+                   break;
+               }
+           }
+           else if (*cmp1 == '?') {
+               while (*cmp1 == '?' && *cmp2) {
+                   ++cmp1;
+                   ++cmp2;
+               }
+               continue;
+           }
+           else
+               break;
+       }
+       else {
+           while (*cmp1 == '*')
+               ++cmp1;
+           break;
+       }
+    }
+
+    return (*cmp1 == '\0' && *cmp2 == '\0');
+}
+
+/*
+ * Since directory is a function to be extended by the implementation,
+ * current extensions are:
+ *     all             => list files and directories
+ *                        it is an error to call
+ *                        (directory "<pathname-spec>/" :all t)
+ *                        if non nil, it is like the shell command
+ *                        echo <pathname-spec>, but normally, not in the
+ *                        same order, as the code does not sort the result.
+ *             !=nil   => list files and directories
+ * (default)   nil     => list only files, or only directories if
+ *                        <pathname-spec> ends with PATH_SEP char.
+ *     if-cannot-read  => if opendir fails on a directory
+ *             :error  => generate an error
+ * (default)   :skip   => skip search in this directory
+ */
+LispObj *
+Lisp_Directory(LispBuiltin *builtin)
+/*
+ directory pathname &key all if-cannot-read
+ */
+{
+    GC_ENTER();
+    DIR *dir;
+    struct stat st;
+    struct dirent *ent;
+    int length, listdirs, i, ndirs, nmatches;
+    char name[PATH_MAX + 1], path[PATH_MAX + 2], directory[PATH_MAX + 2];
+    char *sep, *base, *ptr, **dirs, **matches,
+         dot[] = {'.', PATH_SEP, '\0'},
+         dotdot[] = {'.', '.', PATH_SEP, '\0'};
+    int cannot_read;
+
+    LispObj *pathname, *all, *if_cannot_read, *result, *cons, *object;
+
+    if_cannot_read = ARGUMENT(2);
+    all = ARGUMENT(1);
+    pathname = ARGUMENT(0);
+    result = NIL;
+
+    cons = NIL;
+
+    if (if_cannot_read != UNSPEC) {
+       if (!KEYWORDP(if_cannot_read) ||
+           (if_cannot_read != Kskip &&
+            if_cannot_read != Kerror))
+           LispDestroy("%s: bad :IF-CANNOT-READ %s",
+                       STRFUN(builtin), STROBJ(if_cannot_read));
+       if (if_cannot_read != Kskip)
+           cannot_read = NOREAD_SKIP;
+       else
+           cannot_read = NOREAD_ERROR;
+    }
+    else
+       cannot_read = NOREAD_SKIP;
+
+    if (PATHNAMEP(pathname))
+       pathname = CAR(pathname->data.pathname);
+    else if (STREAMP(pathname) && pathname->data.stream.type == LispStreamFile)
+       pathname = CAR(pathname->data.stream.pathname->data.pathname);
+    else if (!STRINGP(pathname))
+       LispDestroy("%s: %s is not a pathname",
+                   STRFUN(builtin), STROBJ(pathname));
+
+    strncpy(name, THESTR(pathname), sizeof(name) - 1);
+    name[sizeof(name) - 1] = '\0';
+    length = strlen(name);
+    if (length < STRLEN(pathname))
+       LispDestroy("%s: pathname too long %s",
+                   STRFUN(builtin), name);
+
+    if (length == 0) {
+       if (getcwd(path, sizeof(path) - 2) == NULL)
+           LispDestroy("%s: getcwd(): %s", STRFUN(builtin), strerror(errno));
+       length = strlen(path);
+       if (!length || path[length - 1] != PATH_SEP) {
+           path[length++] = PATH_SEP;
+           path[length] = '\0';
+       }
+       result = APPLY1(Oparse_namestring, LSTRING(path, length));
+       GC_LEAVE();
+
+       return (result);
+    }
+
+    if (name[length - 1] == PATH_SEP) {
+       listdirs = 1;
+       if (length > 1) {
+           --length;
+           name[length] = '\0';
+       }
+    }
+    else
+       listdirs = 0;
+
+    if (name[0] != PATH_SEP) {
+       if (getcwd(path, sizeof(path) - 2) == NULL)
+           LispDestroy("%s: getcwd(): %s", STRFUN(builtin), strerror(errno));
+       length = strlen(path);
+       if (!length || path[length - 1] != PATH_SEP) {
+           path[length++] = PATH_SEP;
+           path[length] = '\0';
+       }
+    }
+    else
+       path[0] = '\0';
+
+    result = NIL;
+
+    /* list intermediate directories */
+    matches = NULL;
+    nmatches = 0;
+    dirs = LispMalloc(sizeof(char*));
+    ndirs = 1;
+    if (snprintf(directory, sizeof(directory), "%s%s%c",
+                path, name, PATH_SEP) > PATH_MAX)
+       LispDestroy("%s: pathname too long %s", STRFUN(builtin), directory);
+
+    /* Remove ../ */
+    sep = directory;
+    for (sep = strstr(sep, dotdot); sep; sep = strstr(sep, dotdot)) {
+       if (sep <= directory + 1)
+           strcpy(directory, sep + 2);
+       else if (sep[-1] == PATH_SEP) {
+           for (base = sep - 2; base > directory; base--)
+               if (*base == PATH_SEP)
+                   break;
+           strcpy(base, sep + 2);
+           sep = base;
+       }
+       else
+           ++sep;
+    }
+
+    /* Remove "./" */
+    sep = directory;
+    for (sep = strstr(sep, dot); sep; sep = strstr(sep, dot)) {
+       if (sep == directory || sep[-1] == PATH_SEP)
+           strcpy(sep, sep + 2);
+       else
+           ++sep;
+    }
+
+    /* This will happen when there are too many '../'  in the path */
+    if (directory[1] == '\0') {
+       directory[1] = PATH_SEP;
+       directory[2] = '\0';
+    }
+
+    base = directory;
+    sep = strchr(base + 1, PATH_SEP);
+    dirs[0] = LispMalloc(2);
+    dirs[0][0] = PATH_SEP;
+    dirs[0][1] = '\0';
+
+    for (base = directory + 1, sep = strchr(base, PATH_SEP); ;
+        base = sep + 1, sep = strchr(base, PATH_SEP)) {
+       *sep = '\0';
+       if (sep[1] == '\0')
+           sep = NULL;
+       length = strlen(base);
+       if (length == 0) {
+           if (sep)
+               *sep = PATH_SEP;
+           else
+               break;
+           continue;
+       }
+
+       for (i = 0; i < ndirs; i++) {
+           length = strlen(dirs[i]);
+           if (length > 1)
+               dirs[i][length - 1] = '\0';             /* remove trailing / */
+           if ((dir = opendir(dirs[i])) != NULL) {
+               (void)readdir(dir);     /* "." */
+               (void)readdir(dir);     /* ".." */
+               if (length > 1)
+                   dirs[i][length - 1] = PATH_SEP;     /* add trailing / again */
+
+               snprintf(path, sizeof(path), "%s", dirs[i]);
+               length = strlen(path);
+               ptr = path + length;
+
+               while ((ent = readdir(dir)) != NULL) {
+                   int isdir;
+                   unsigned d_namlen = strlen(ent->d_name);
+
+                   if (length + d_namlen + 2 < sizeof(path))
+                       strcpy(ptr, ent->d_name);
+                   else {
+                       closedir(dir);
+                       LispDestroy("%s: pathname too long %s",
+                                   STRFUN(builtin), dirs[i]);
+                   }
+
+                   if (stat(path, &st) != 0)
+                       isdir = 0;
+                   else
+                       isdir = S_ISDIR(st.st_mode);
+
+                   if (all != UNSPEC || ((isdir && (listdirs || sep)) ||
+                                         (!listdirs && !sep && !isdir))) {
+                       if (glob_match(base, ent->d_name)) {
+                           if (isdir) {
+                               length = strlen(ptr);
+                               ptr[length++] = PATH_SEP;
+                               ptr[length] = '\0';
+                           }
+                           /* XXX won't closedir on memory allocation failure! */
+                           matches = LispRealloc(matches, sizeof(char*) *
+                                                 nmatches + 1);
+                           matches[nmatches++] = LispStrdup(ptr);
+                       }
+                   }
+               }
+               closedir(dir);
+
+               if (nmatches == 0) {
+                   if (sep || !listdirs || *base) {
+                       LispFree(dirs[i]);
+                       if (i + 1 < ndirs)
+                           memmove(dirs + i, dirs + i + 1,
+                                   sizeof(char*) * (ndirs - (i + 1)));
+                       --ndirs;
+                       --i;                /* XXX playing with for loop */
+                   }
+               }
+               else {
+                   int j;
+
+                   length = strlen(dirs[i]);
+                   if (nmatches > 1) {
+                       dirs = LispRealloc(dirs, sizeof(char*) *
+                                          (ndirs + nmatches));
+                       if (i + 1 < ndirs)
+                           memmove(dirs + i + nmatches, dirs + i + 1,
+                                   sizeof(char*) * (ndirs - (i + 1)));
+                   }
+                   for (j = 1; j < nmatches; j++) {
+                       dirs[i + j] = LispMalloc(length +
+                                                strlen(matches[j]) + 1);
+                       sprintf(dirs[i + j], "%s%s", dirs[i], matches[j]);
+                   }
+                   dirs[i] = LispRealloc(dirs[i],
+                                         length + strlen(matches[0]) + 1);
+                   strcpy(dirs[i] + length, matches[0]);
+                   i += nmatches - 1;  /* XXX playing with for loop */
+                   ndirs += nmatches - 1;
+
+                   for (j = 0; j < nmatches; j++)
+                       LispFree(matches[j]);
+                   LispFree(matches);
+                   matches = NULL;
+                   nmatches = 0;
+               }
+           }
+           else {
+               if (cannot_read == NOREAD_ERROR)
+                   LispDestroy("%s: opendir(%s): %s",
+                               STRFUN(builtin), dirs[i], strerror(errno));
+               else {
+                   LispFree(dirs[i]);
+                   if (i + 1 < ndirs)
+                       memmove(dirs + i, dirs + i + 1,
+                               sizeof(char*) * (ndirs - (i + 1)));
+                   --ndirs;
+                   --i;            /* XXX playing with for loop */
+               }
+           }
+       }
+       if (sep)
+           *sep = PATH_SEP;
+       else
+           break;
+    }
+
+    for (i = 0; i < ndirs; i++) {
+       object = APPLY1(Oparse_namestring, STRING2(dirs[i]));
+       if (result == NIL) {
+           result = cons = CONS(object, NIL);
+           GC_PROTECT(result);
+       }
+       else {
+           RPLACD(cons, CONS(object, NIL));
+           cons = CDR(cons);
+       }
+    }
+    LispFree(dirs);
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+Lisp_ParseNamestring(LispBuiltin *builtin)
+/*
+ parse-namestring object &optional host defaults &key start end junk-allowed
+ */
+{
+    GC_ENTER();
+    LispObj *result;
+
+    LispObj *object, *host, *defaults, *ostart, *oend, *junk_allowed;
+
+    junk_allowed = ARGUMENT(5);
+    oend = ARGUMENT(4);
+    ostart = ARGUMENT(3);
+    defaults = ARGUMENT(2);
+    host = ARGUMENT(1);
+    object = ARGUMENT(0);
+
+    if (host == UNSPEC)
+       host = NIL;
+    if (defaults == UNSPEC)
+       defaults = NIL;
+
+    RETURN_COUNT = 1;
+    if (STREAMP(object)) {
+       if (object->data.stream.type == LispStreamFile)
+           object = object->data.stream.pathname;
+       /* else just check for JUNK-ALLOWED... */
+    }
+    if (PATHNAMEP(object)) {
+       RETURN(0) = FIXNUM(0);
+       return (object);
+    }
+
+    if (host != NIL) {
+       CHECK_STRING(host);
+    }
+    if (defaults != NIL) {
+       if (!PATHNAMEP(defaults)) {
+           defaults = APPLY1(Oparse_namestring, defaults);
+           GC_PROTECT(defaults);
+       }
+    }
+
+    result = NIL;
+    if (STRINGP(object)) {
+       LispObj *cons, *cdr;
+       char *name = THESTR(object), *ptr, *str, data[PATH_MAX + 1],
+             string[PATH_MAX + 1], *namestr, *typestr, *send;
+       long start, end, length, alength, namelen, typelen;
+
+       LispCheckSequenceStartEnd(builtin, object, ostart, oend,
+                                 &start, &end, &length);
+       alength = end - start;
+
+       if (alength > sizeof(data) - 1)
+           LispDestroy("%s: string %s too large",
+                       STRFUN(builtin), STROBJ(object));
+       memcpy(data, name + start, alength);
+#ifndef KEEP_EXTRA_PATH_SEP
+       ptr = data;
+       send = ptr + alength;
+       while (ptr < send) {
+           if (*ptr++ == PATH_SEP) {
+               for (str = ptr; str < send && *str == PATH_SEP; str++)
+                   ;
+               if (str - ptr) {
+                   memmove(ptr, str, alength - (str - data));
+                   alength -= str - ptr;
+                   send -= str - ptr;
+               }
+           }
+       }
+#endif
+       data[alength] = '\0';
+       memcpy(string, data, alength + 1);
+
+       if (PATHNAMEP(defaults))
+           defaults = defaults->data.pathname;
+
+       /* string name */
+       result = cons = CONS(NIL, NIL);
+       GC_PROTECT(result);
+
+       /* host */
+       if (defaults != NIL)
+           defaults = CDR(defaults);
+       cdr = defaults == NIL ? NIL : CAR(defaults);
+       RPLACD(cons, CONS(cdr, NIL));
+       cons = CDR(cons);
+
+       /* device */
+       if (defaults != NIL)
+           defaults = CDR(defaults);
+       cdr = defaults == NIL ? NIL : CAR(defaults);
+       RPLACD(cons, CONS(cdr, NIL));
+       cons = CDR(cons);
+
+       /* directory */
+       if (defaults != NIL)
+           defaults = CDR(defaults);
+       if (*data == PATH_SEP)
+           cdr = CONS(Kabsolute, NIL);
+       else
+           cdr = CONS(Krelative, NIL);
+       RPLACD(cons, CONS(cdr, NIL));
+       cons = CDR(cons);
+       /* directory components */
+       ptr = data;
+       send = data + alength;
+       if (*ptr == PATH_SEP)
+           ++ptr;
+       for (str = ptr; str < send; str++) {
+           if (*str == PATH_SEP)
+               break;
+       }
+       while (str < send) {
+           *str++ = '\0';
+           if (str - ptr > NAME_MAX)
+               LispDestroy("%s: directory name too long %s",
+                           STRFUN(builtin), ptr);
+           RPLACD(cdr, CONS(LSTRING(ptr, str - ptr - 1), NIL));
+           cdr = CDR(cdr);
+           for (ptr = str; str < send; str++) {
+               if (*str == PATH_SEP)
+                   break;
+           }
+       }
+       if (str - ptr > NAME_MAX)
+           LispDestroy("%s: file name too long %s", STRFUN(builtin), ptr);
+       if (CAAR(cons) == Krelative &&
+           defaults != NIL && CAAR(defaults) == Kabsolute) {
+           /* defaults specify directory and pathname doesn't */
+           char *tstring;
+           long dlength, tlength;
+           LispObj *dir = CDAR(defaults);
+
+           for (dlength = 1; CONSP(dir); dir = CDR(dir))
+               dlength += STRLEN(CAR(dir)) + 1;
+           if (alength + dlength < PATH_MAX) {
+               memmove(data + dlength, data, alength + 1);
+               memmove(string + dlength, string, alength + 1);
+               alength += dlength;
+               ptr += dlength;
+               send += dlength;
+               CAAR(cons) = Kabsolute;
+               for (dir = CDAR(defaults), cdr = CAR(cons);
+                    CONSP(dir);
+                    dir = CDR(dir)) {
+                   RPLACD(cdr, CONS(CAR(dir), CDR(cdr)));
+                   cdr = CDR(cdr);
+               }
+               dir = CDAR(defaults);
+               data[0] = string[0] = PATH_SEP;
+               for (dlength = 1; CONSP(dir); dir = CDR(dir)) {
+                   tstring = THESTR(CAR(dir));
+                   tlength = STRLEN(CAR(dir));
+                   memcpy(data + dlength, tstring, tlength);
+                   memcpy(string + dlength, tstring, tlength);
+                   dlength += tlength;
+                   data[dlength] = string[dlength] = PATH_SEP;
+                   ++dlength;
+               }
+           }
+       }
+
+       /* name */
+       if (defaults != NIL)
+           defaults = CDR(defaults);
+       cdr = defaults == NIL ? NIL : CAR(defaults);
+       for (typelen = 0, str = ptr; str < send; str++) {
+           if (*str == PATH_TYPESEP) {
+               typelen = 1;
+               break;
+           }
+       }
+       if (*ptr)
+           cdr = LSTRING(ptr, str - ptr);
+       if (STRINGP(cdr)) {
+           namestr = THESTR(cdr);
+           namelen = STRLEN(cdr);
+       }
+       else {
+           namestr = "";
+           namelen = 0;
+       }
+       RPLACD(cons, CONS(cdr, NIL));
+       cons = CDR(cons);
+
+       /* type */
+       if (defaults != NIL)
+           defaults = CDR(defaults);
+       cdr = defaults == NIL ? NIL : CAR(defaults);
+       ptr = str + typelen;
+       if (*ptr)
+           cdr = LSTRING(ptr, send - ptr);
+       if (STRINGP(cdr)) {
+           typestr = THESTR(cdr);
+           typelen = STRLEN(cdr);
+       }
+       else {
+           typestr = "";
+           typelen = 0;
+       }
+       RPLACD(cons, CONS(cdr, NIL));
+       cons = CDR(cons);
+
+       /* version */
+       if (defaults != NIL)
+           defaults = CDR(defaults);
+       cdr = defaults == NIL ? NIL : CAR(defaults);
+       RPLACD(cons, CONS(cdr, NIL));
+
+       /* string representation, must be done here to use defaults */
+       for (ptr = string + alength; ptr >= string; ptr--) {
+           if (*ptr == PATH_SEP)
+               break;
+       }
+       if (ptr >= string)
+           ++ptr;
+       else
+           ptr = string;
+       *ptr = '\0';
+
+       length = ptr - string;
+
+       alength = namelen;
+       if (alength) {
+           if (length + alength + 2 > sizeof(string))
+               alength = sizeof(string) - length - 2;
+           memcpy(string + length, namestr, alength);
+           length += alength;
+       }
+
+       alength = typelen;
+       if (alength) {
+           if (length + 2 < sizeof(string))
+               string[length++] = PATH_TYPESEP;
+           if (length + alength + 2 > sizeof(string))
+               alength = sizeof(string) - length - 2;
+           memcpy(string + length, typestr, alength);
+           length += alength;
+       }
+       string[length] = '\0';
+
+       RPLACA(result,  LSTRING(string, length));
+       RETURN(0) = FIXNUM(end);
+
+       result = PATHNAME(result);
+    }
+    else if (junk_allowed == UNSPEC || junk_allowed == NIL)
+       LispDestroy("%s: bad argument %s", STRFUN(builtin), STROBJ(object));
+    else
+       RETURN(0) = NIL;
+
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+Lisp_MakePathname(LispBuiltin *builtin)
+/*
+ make-pathname &key host device directory name type version defaults
+ */
+{
+    GC_ENTER();
+    int length, alength;
+    char *string, pathname[PATH_MAX + 1];
+    LispObj *result, *cdr, *cons;
+
+    LispObj *host, *device, *directory, *name, *type, *version, *defaults;
+
+    defaults = ARGUMENT(6);
+    version = ARGUMENT(5);
+    type = ARGUMENT(4);
+    name = ARGUMENT(3);
+    directory = ARGUMENT(2);
+    device = ARGUMENT(1);
+    host = ARGUMENT(0);
+
+    if (host != UNSPEC) {
+       CHECK_STRING(host);
+    }
+    if (device != UNSPEC) {
+       CHECK_STRING(device);
+    }
+
+    if (directory != UNSPEC) {
+       LispObj *dir;
+
+       CHECK_CONS(directory);
+       dir = CAR(directory);
+       CHECK_KEYWORD(dir);
+       if (dir != Kabsolute && dir != Krelative)
+           LispDestroy("%s: directory type %s unknown",
+                       STRFUN(builtin), STROBJ(dir));
+    }
+
+    if (name != UNSPEC) {
+       CHECK_STRING(name);
+    }
+    if (type != UNSPEC) {
+       CHECK_STRING(type);
+    }
+
+    if (version != UNSPEC && version != NIL) {
+       switch (OBJECT_TYPE(version)) {
+           case LispFixnum_t:
+               if (FIXNUM_VALUE(version) >= 0)
+                   goto version_ok;
+           case LispInteger_t:
+               if (INT_VALUE(version) >= 0)
+                   goto version_ok;
+               break;
+           case LispDFloat_t:
+               if (DFLOAT_VALUE(version) >= 0.0)
+                   goto version_ok;
+               break;
+           default:
+               break;
+       }
+       LispDestroy("%s: %s is not a positive real number",
+                   STRFUN(builtin), STROBJ(version));
+    }
+version_ok:
+
+    if (defaults != UNSPEC && !PATHNAMEP(defaults) &&
+       (host == UNSPEC || device == UNSPEC || directory == UNSPEC ||
+        name == UNSPEC || type == UNSPEC || version == UNSPEC)) {
+       defaults = APPLY1(Oparse_namestring, defaults);
+       GC_PROTECT(defaults);
+    }
+
+    if (defaults != UNSPEC) {
+       defaults = defaults->data.pathname;
+       defaults = CDR(defaults);       /* host */
+       if (host == UNSPEC)
+           host = CAR(defaults);
+       defaults = CDR(defaults);       /* device */
+       if (device == UNSPEC)
+           device = CAR(defaults);
+       defaults = CDR(defaults);       /* directory */
+       if (directory == UNSPEC)
+           directory = CAR(defaults);
+       defaults = CDR(defaults);       /* name */
+       if (name == UNSPEC)
+           name = CAR(defaults);
+       defaults = CDR(defaults);       /* type */
+       if (type == UNSPEC)
+           type = CAR(defaults);
+       defaults = CDR(defaults);       /* version */
+       if (version == UNSPEC)
+           version = CAR(defaults);
+    }
+
+    /* string representation */
+    length = 0;
+    if (CONSP(directory)) {
+       if (CAR(directory) == Kabsolute)
+           pathname[length++] = PATH_SEP;
+
+       for (cdr = CDR(directory); CONSP(cdr); cdr = CDR(cdr)) {
+           CHECK_STRING(CAR(cdr));
+           string = THESTR(CAR(cdr));
+           alength = STRLEN(CAR(cdr));
+           if (alength > NAME_MAX)
+               LispDestroy("%s: directory name too long %s",
+                           STRFUN(builtin), string);
+           if (length + alength + 2 > sizeof(pathname))
+               alength = sizeof(pathname) - length - 2;
+           memcpy(pathname + length, string, alength);
+           length += alength;
+           pathname[length++] = PATH_SEP;
+       }
+    }
+    if (STRINGP(name)) {
+       int xlength = 0;
+
+       if (STRINGP(type))
+           xlength = STRLEN(type) + 1;
+
+       string = THESTR(name);
+       alength = STRLEN(name);
+       if (alength + xlength > NAME_MAX)
+           LispDestroy("%s: file name too long %s",
+                       STRFUN(builtin), string);
+       if (length + alength + 2 > sizeof(pathname))
+           alength = sizeof(pathname) - length - 2;
+       memcpy(pathname + length, string, alength);
+       length += alength;
+    }
+    if (STRINGP(type)) {
+       if (length + 2 < sizeof(pathname))
+           pathname[length++] = PATH_TYPESEP;
+       string = THESTR(type);
+       alength = STRLEN(type);
+       if (length + alength + 2 > sizeof(pathname))
+           alength = sizeof(pathname) - length - 2;
+       memcpy(pathname + length, string, alength);
+       length += alength;
+    }
+    pathname[length] = '\0';
+    result = cons = CONS(LSTRING(pathname, length), NIL);
+    GC_PROTECT(result);
+
+    /* host */
+    RPLACD(cons, CONS(host == UNSPEC ? NIL : host, NIL));
+    cons = CDR(cons);
+
+    /* device */
+    RPLACD(cons, CONS(device == UNSPEC ? NIL : device, NIL));
+    cons = CDR(cons);
+
+    /* directory */
+    if (directory == UNSPEC)
+       cdr = CONS(Krelative, NIL);
+    else
+       cdr = directory;
+    RPLACD(cons, CONS(cdr, NIL));
+    cons = CDR(cons);
+
+    /* name */
+    RPLACD(cons, CONS(name == UNSPEC ? NIL : name, NIL));
+    cons = CDR(cons);
+
+    /* type */
+    RPLACD(cons, CONS(type == UNSPEC ? NIL : type, NIL));
+    cons = CDR(cons);
+
+    /* version */
+    RPLACD(cons, CONS(version == UNSPEC ? NIL : version, NIL));
+
+    GC_LEAVE();
+
+    return (PATHNAME(result));
+}
+
+LispObj *
+Lisp_PathnameHost(LispBuiltin *builtin)
+/*
+ pathname-host pathname
+ */
+{
+    return (LispPathnameField(PATH_HOST, 0));
+}
+
+LispObj *
+Lisp_PathnameDevice(LispBuiltin *builtin)
+/*
+ pathname-device pathname
+ */
+{
+    return (LispPathnameField(PATH_DEVICE, 0));
+}
+
+LispObj *
+Lisp_PathnameDirectory(LispBuiltin *builtin)
+/*
+ pathname-device pathname
+ */
+{
+    return (LispPathnameField(PATH_DIRECTORY, 0));
+}
+
+LispObj *
+Lisp_PathnameName(LispBuiltin *builtin)
+/*
+ pathname-name pathname
+ */
+{
+    return (LispPathnameField(PATH_NAME, 0));
+}
+
+LispObj *
+Lisp_PathnameType(LispBuiltin *builtin)
+/*
+ pathname-type pathname
+ */
+{
+    return (LispPathnameField(PATH_TYPE, 0));
+}
+
+LispObj *
+Lisp_PathnameVersion(LispBuiltin *builtin)
+/*
+ pathname-version pathname
+ */
+{
+    return (LispPathnameField(PATH_VERSION, 0));
+}
+
+LispObj *
+Lisp_FileNamestring(LispBuiltin *builtin)
+/*
+ file-namestring pathname
+ */
+{
+    return (LispPathnameField(PATH_NAME, 1));
+}
+
+LispObj *
+Lisp_DirectoryNamestring(LispBuiltin *builtin)
+/*
+ directory-namestring pathname
+ */
+{
+    return (LispPathnameField(PATH_DIRECTORY, 1));
+}
+
+LispObj *
+Lisp_EnoughNamestring(LispBuiltin *builtin)
+/*
+ enough-pathname pathname &optional defaults
+ */
+{
+    LispObj *pathname, *defaults;
+
+    defaults = ARGUMENT(1);
+    pathname = ARGUMENT(0);
+
+    if (defaults != UNSPEC && defaults != NIL) {
+       char *ppathname, *pdefaults, *pp, *pd;
+
+       if (!STRINGP(pathname)) {
+           if (PATHNAMEP(pathname))
+               pathname  = CAR(pathname->data.pathname);
+           else if (STREAMP(pathname) &&
+                    pathname->data.stream.type == LispStreamFile)
+               pathname  = CAR(pathname->data.stream.pathname->data.pathname);
+           else
+               LispDestroy("%s: bad PATHNAME %s",
+                           STRFUN(builtin), STROBJ(pathname));
+       }
+
+       if (!STRINGP(defaults)) {
+           if (PATHNAMEP(defaults))
+               defaults  = CAR(defaults->data.pathname);
+           else if (STREAMP(defaults) &&
+                    defaults->data.stream.type == LispStreamFile)
+               defaults  = CAR(defaults->data.stream.pathname->data.pathname);
+           else
+               LispDestroy("%s: bad DEFAULTS %s",
+                           STRFUN(builtin), STROBJ(defaults));
+       }
+
+       ppathname = pp = THESTR(pathname);
+       pdefaults = pd = THESTR(defaults);
+       while (*ppathname && *pdefaults && *ppathname == *pdefaults) {
+           ppathname++;
+           pdefaults++;
+       }
+       if (*pdefaults == '\0' && pdefaults > pd)
+           --pdefaults;
+       if (*ppathname && *pdefaults && *pdefaults != PATH_SEP) {
+           --ppathname;
+           while (*ppathname != PATH_SEP && ppathname > pp)
+               --ppathname;
+           if (*ppathname == PATH_SEP)
+               ++ppathname;
+       }
+
+       return (STRING(ppathname));
+    }
+    else {
+       if (STRINGP(pathname))
+           return (pathname);
+       else if (PATHNAMEP(pathname))
+           return (CAR(pathname->data.pathname));
+       else if (STREAMP(pathname)) {
+           if (pathname->data.stream.type == LispStreamFile)
+               return (CAR(pathname->data.stream.pathname->data.pathname));
+       }
+    }
+    LispDestroy("%s: bad PATHNAME %s", STRFUN(builtin), STROBJ(pathname));
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_Namestring(LispBuiltin *builtin)
+/*
+ namestring pathname
+ */
+{
+    return (LispPathnameField(PATH_STRING, 1));
+}
+
+LispObj *
+Lisp_HostNamestring(LispBuiltin *builtin)
+/*
+ host-namestring pathname
+ */
+{
+    return (LispPathnameField(PATH_HOST, 1));
+}
+
+LispObj *
+Lisp_Pathnamep(LispBuiltin *builtin)
+/*
+ pathnamep object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (PATHNAMEP(object) ? T : NIL);
+}
+
+/* XXX only checks if host is a string and only checks the HOME enviroment
+ * variable */
+LispObj *
+Lisp_UserHomedirPathname(LispBuiltin *builtin)
+/*
+ user-homedir-pathname &optional host
+ */
+{
+    GC_ENTER();
+    int length;
+    char *home = getenv("HOME"), data[PATH_MAX + 1];
+    LispObj *result;
+
+    LispObj *host;
+
+    host = ARGUMENT(0);
+
+    if (host != UNSPEC && !STRINGP(host))
+       LispDestroy("%s: bad hostname %s", STRFUN(builtin), STROBJ(host));
+
+    length = 0;
+    if (home) {
+       length = strlen(home);
+       strncpy(data, home, length);
+       if (length && home[length - 1] != PATH_SEP)
+           data[length++] = PATH_SEP;
+    }
+    data[length] = '\0';
+
+    result = LSTRING(data, length);
+    GC_PROTECT(result);
+    result = APPLY1(Oparse_namestring, result);
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+Lisp_Truename(LispBuiltin *builtin)
+{
+    return (LispProbeFile(builtin, 0));
+}
+
+LispObj *
+Lisp_ProbeFile(LispBuiltin *builtin)
+{
+    return (LispProbeFile(builtin, 1));
+}
diff --git a/xedit/lisp/pathname.h b/xedit/lisp/pathname.h
new file mode 100644 (file)
index 0000000..5b075f5
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/pathname.h,v 1.4tsi Exp $ */
+
+#ifndef Lisp_pathname_h
+#define Lisp_pathname_h
+
+#include "lisp/internal.h"
+
+#define        PATH_SEP        '/'
+#define        PATH_TYPESEP    '.'
+
+#ifndef PATH_MAX
+#define PATH_MAX       4096
+#endif
+
+#ifndef NAME_MAX
+#define NAME_MAX       256
+#endif
+
+
+#define PATH_STRING    0
+#define PATH_HOST      1
+#define PATH_DEVICE    2
+#define PATH_DIRECTORY 3
+#define PATH_NAME      4
+#define PATH_TYPE      5
+#define PATH_VERSION   6
+
+void LispPathnameInit(void);
+
+LispObj *Lisp_Directory(LispBuiltin*);
+LispObj *Lisp_Namestring(LispBuiltin*);
+LispObj *Lisp_FileNamestring(LispBuiltin*);
+LispObj *Lisp_DirectoryNamestring(LispBuiltin*);
+LispObj *Lisp_EnoughNamestring(LispBuiltin*);
+LispObj *Lisp_HostNamestring(LispBuiltin*);
+LispObj *Lisp_MakePathname(LispBuiltin*);
+LispObj *Lisp_Pathnamep(LispBuiltin*);
+LispObj *Lisp_ParseNamestring(LispBuiltin*);
+LispObj *Lisp_PathnameHost(LispBuiltin*);
+LispObj *Lisp_PathnameDevice(LispBuiltin*);
+LispObj *Lisp_PathnameDirectory(LispBuiltin*);
+LispObj *Lisp_PathnameName(LispBuiltin*);
+LispObj *Lisp_PathnameType(LispBuiltin*);
+LispObj *Lisp_PathnameVersion(LispBuiltin*);
+LispObj *Lisp_Truename(LispBuiltin*);
+LispObj *Lisp_ProbeFile(LispBuiltin*);
+LispObj *Lisp_UserHomedirPathname(LispBuiltin*);
+
+#endif /* Lisp_pathname_h */
diff --git a/xedit/lisp/private.h b/xedit/lisp/private.h
new file mode 100644 (file)
index 0000000..ef44ab2
--- /dev/null
@@ -0,0 +1,537 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XdotOrg: xc/programs/xedit/lisp/private.h,v 1.2 2004/04/23 19:54:44 eich Exp $ */
+/* $XFree86: xc/programs/xedit/lisp/private.h,v 1.41 2003/05/27 22:27:04 tsi Exp $ */
+
+#ifndef Lisp_private_h
+#define Lisp_private_h
+
+#include <X11/Xos.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#if defined(X_POSIX_C_SOURCE)
+#define _POSIX_C_SOURCE X_POSIX_C_SOURCE
+#include <setjmp.h>
+#undef _POSIX_C_SOURCE
+#else
+#include <setjmp.h>
+#endif
+#include <unistd.h>
+#include <sys/time.h>
+#include "lisp/internal.h"
+
+#include "lisp/core.h"
+#ifdef DEBUGGER
+#include "lisp/debugger.h"
+#endif
+#include "lisp/helper.h"
+#include "lisp/string.h"
+#include "lisp/struct.h"
+
+/*
+ * Defines
+ */
+#define        STRTBLSZ                23
+#define MULTIPLE_VALUES_LIMIT  127
+#define MAX_STACK_DEPTH                16384
+
+#define FEATURES                                                       \
+    (lisp__data.features->data.atom->a_object ?                                \
+       (LispObj *)lisp__data.features->data.atom->property->value :    \
+       NIL)
+#define PACK   lisp__data.packlist
+#define PACKAGE        lisp__data.package->data.atom->property->value
+#define MOD    lisp__data.modlist
+#define COD    lisp__data.codlist
+#define RUN    lisp__data.runlist
+#define RES    lisp__data.reslist
+#define DBG    lisp__data.dbglist
+#define BRK    lisp__data.brklist
+#define PRO    lisp__data.prolist
+
+#define SINPUT lisp__data.input
+#define SOUTPUT        lisp__data.output
+#define STANDARD_INPUT                                         \
+    lisp__data.standard_input->data.atom->property->value
+#define STANDARD_OUTPUT                                                \
+    lisp__data.standard_output->data.atom->property->value
+#define STANDARDSTREAM(file, desc, flags)                      \
+       LispNewStandardStream(file, desc, flags)
+
+/*
+ * Types
+ */
+typedef struct _LispStream LispStream;
+typedef struct _LispBlock LispBlock;
+typedef struct _LispOpaque LispOpaque;
+typedef struct _LispModule LispModule;
+typedef struct _LispProperty LispProperty;
+typedef struct _LispObjList LispObjList;
+typedef struct _LispStringHash LispStringHash;
+typedef struct _LispCharInfo LispCharInfo;
+
+
+/* Normal function/macro arguments */
+typedef struct _LispNormalArgs {
+    int num_symbols;
+    LispObj **symbols;         /* symbol names */
+} LispNormalArgs;
+
+/* &optional function/macro arguments */
+typedef struct _LispOptionalArgs {
+    int num_symbols;
+    LispObj **symbols;         /* symbol names */
+    LispObj **defaults;                /* default values, when unspecifed */
+    LispObj **sforms;          /* T if variable specified, NIL otherwise */
+} LispOptionalArgs;
+
+/* &key function/macro arguments */
+typedef struct _LispKeyArgs {
+    int num_symbols;
+    LispObj **symbols;         /* symbol names */
+    LispObj **defaults;                /* default values */
+    LispObj **sforms;          /* T if variable specified, NIL otherwise */
+    LispObj **keys;            /* key names, for special keywords */
+} LispKeyArgs;
+
+/* &aux function/macro arguments */
+typedef struct _LispAuxArgs {
+    int num_symbols;
+    LispObj **symbols;         /* symbol names */
+    LispObj **initials;                /* initial values */
+} LispAuxArgs;
+
+/* characters in the field description have the format:
+ *     '.'     normals has a list of normal arguments
+ *     'o'     optionals has a list of &optional arguments
+ *     'k'     keys has a list of &key arguments
+ *     'r'     rest is a valid pointer to a &rest symbol
+ *     'a'     auxs has a list of &aux arguments
+ */
+typedef struct _LispArgList {
+    LispNormalArgs normals;
+    LispOptionalArgs optionals;
+    LispKeyArgs keys;
+    LispObj *rest;
+    LispAuxArgs auxs;
+    int num_arguments;
+    char *description;
+} LispArgList;
+
+typedef enum _LispDocType_t {
+    LispDocVariable,
+    LispDocFunction,
+    LispDocStructure,
+    LispDocType,
+    LispDocSetf
+} LispDocType_t;
+
+struct _LispProperty {
+    /* may be used by multiple packages */
+    unsigned int refcount;
+
+    /* package where the property was created */
+    LispPackage *package;
+
+    /* value of variable attached to symbol */
+    LispObj *value;
+
+    union {
+       /* function attached to symbol */
+       LispObj *function;
+       /* builtin function attached to symbol*/
+       LispBuiltin *builtin;
+    } fun;
+    /* function/macro argument list description */
+    LispArgList *alist;
+
+    /* symbol properties list */
+    LispObj *properties;
+
+    /* setf method */
+    LispObj *setf;
+    /* setf argument list description */
+    LispArgList *salist;
+
+    /* structure information */
+    struct {
+       LispObj *definition;
+#define STRUCT_NAME            -3
+#define STRUCT_CHECK           -2
+#define STRUCT_CONSTRUCTOR     -1
+       int function;           /* if >= 0, it is a structure field index */
+    } structure;
+};
+
+struct _LispAtom {
+    hash_key *key;
+    struct _LispAtom *next;
+
+    /* hint: dynamically binded variable */
+    unsigned int dyn : 1;
+
+    /* Property has useful data in value field */
+    unsigned int a_object : 1;
+    /* Property has useful data in fun.function field */
+    unsigned int a_function : 1;
+    /* Property has useful data in fun.builtin field */
+    unsigned int a_builtin : 1;
+    /* Property has useful data in fun.function field */
+    unsigned int a_compiled : 1;
+    /* Property has useful data in properties field */
+    unsigned int a_property : 1;
+    /* Property has useful data in setf field */
+    unsigned int a_defsetf : 1;
+    /* Property has useful data in defstruct field */
+    unsigned int a_defstruct : 1;
+
+    /* Symbol is extern */
+    unsigned int ext : 1;
+
+    /* Symbol must be quoted with '|' to be allow reading back */
+    unsigned int unreadable : 1;
+
+    /* Symbol value may need special handling when changed */
+    unsigned int watch : 1;
+
+    /* Symbol value is constant, cannot be changed */
+    unsigned int constant : 1;
+
+    LispObj *object;           /* backpointer to object ATOM */
+    int offset;                        /* in the environment list */
+    LispObj *package;          /* package home of symbol */
+    LispObj *function;         /* symbol function */
+    LispObj *name;             /* symbol string */
+    LispProperty *property;
+
+    LispObj *documentation[5];
+};
+
+struct _LispObjList {
+    LispObj **pairs;           /* name0 ... nameN */
+    int length;                        /* number of objects */
+    int space;                 /* space allocated in field pairs */
+};
+
+struct _LispPackage {
+    LispObjList glb;           /* global symbols in package */
+    LispObjList use;           /* inherited packages */
+    hash_table *atoms;         /* atoms in this package */
+};
+
+struct _LispOpaque {
+    hash_key *desc;
+    LispOpaque *next;
+    int type;
+};
+
+typedef enum _LispBlockType {
+    LispBlockNone,     /* no block */
+    LispBlockTag,      /* may become "invisible" */
+    LispBlockCatch,    /* can be used to jump across function calls */
+    LispBlockClosure,  /* hides blocks of type LispBlockTag bellow it */
+    LispBlockProtect,  /* used by unwind-protect */
+    LispBlockBody      /* used by tagbody and go */
+} LispBlockType;
+
+struct _LispBlock {
+    LispBlockType type;
+    LispObj *tag;
+    jmp_buf jmp;
+    int stack;
+    int protect;
+    int block_level;
+#ifdef DEBUGGER
+    int debug_level;
+    int debug_step;
+#endif
+};
+
+struct _LispModule {
+    LispModule *next;
+    void *handle;
+    LispModuleData *data;
+};
+
+typedef struct _LispUngetInfo {
+    char buffer[16];
+    int offset;
+} LispUngetInfo;
+
+struct _LispMac {
+    /* stack for builtin function arguments */
+    struct {
+       LispObj **values;
+       int base;               /* base of arguments to function */
+       int length;
+       int space;
+    } stack;
+
+    /* environment */
+    struct {
+       LispObj **values;
+       Atom_id *names;
+       int lex;                /* until where variables are visible */
+       int head;               /* top of environment */
+       int length;             /* number of used pairs */
+       int space;              /* number of objects in pairs */
+    } env;
+
+    struct {
+       LispObj **values;
+       int count;
+    } returns;
+
+    struct {
+       LispObj **objects;
+       int length;
+       int space;
+    } protect;
+
+    LispObj *package;          /* package object */
+    LispPackage *pack;         /* pointer to lisp__data.package->data.package.package */
+
+    /* fast access to the KEYWORD package */
+    LispObj *keyword;
+    LispPackage *key;
+
+    /* the LISP package */
+    LispObj *lisp;
+
+    /* only used if the package was changed, but an error generated
+     * before returning to the toplevel */
+    LispObj *savepackage;
+    LispPackage *savepack;
+
+    struct {
+       int block_level;
+       int block_size;
+       LispObj *block_ret;
+       LispBlock **block;
+    } block;
+
+    sigjmp_buf jmp;
+
+    struct {
+       unsigned int expandbits : 3;    /* code doesn't look like reusing cells
+                                        * so try to have a larger number of
+                                        * free cells */
+       unsigned int immutablebits : 1; /* need to reset immutable bits */
+       unsigned int timebits : 1;      /* update gctime counter */
+       unsigned int count;
+       long gctime;
+       int average;                    /* of cells freed after gc calls */
+    } gc;
+
+    hash_table *strings;
+    hash_table *opqs;
+    int opaque;
+
+    LispObj *standard_input, *input, *input_list;
+    LispObj *standard_output, *output, *output_list;
+    LispObj *error_stream;
+    LispUngetInfo **unget;
+    int iunget, nunget;
+    int eof;
+
+    int interactive;
+    int errexit;
+
+    struct {
+       int index;
+       int level;
+       int space;
+       void **mem;
+    } mem;             /* memory from Lisp*Alloc, to be release in error */
+    LispModule *module;
+    LispObj *modules;
+    char *prompt;
+
+    LispObj *features;
+
+    LispObj *modlist;          /* module list */
+    LispObj *packlist;         /* list of packages */
+    LispObj *codlist;          /* current code */
+    LispObj *runlist[3];       /* +, ++, and +++ */
+    LispObj *reslist[3];       /* *, **, and *** */
+#ifdef DEBUGGER
+    LispObj *dbglist;          /* debug information */
+    LispObj *brklist;          /* breakpoints information */
+#endif
+    LispObj *prolist;          /* protect objects list */
+
+#ifdef SIGNALRETURNSINT
+    int (*sigint)(int);
+    int (*sigfpe)(int);
+#else
+    void (*sigint)(int);
+    void (*sigfpe)(int);
+#endif
+
+    int destroyed;             /* reached LispDestroy, used by unwind-protect */
+    int running;               /* there is somewhere to siglongjmp */
+
+    int ignore_errors;         /* inside a ignore-errors block */
+    LispObj *error_condition;  /* actually, a string */
+
+    int debugging;             /* debugger enabled? */
+#ifdef DEBUGGER
+    int debug_level;           /* almost always the same as lisp__data.level */
+    int debug_step;            /* control for stoping and printing output */
+    int debug_break;           /* next breakpoint number */
+    LispDebugState debug;
+#endif
+};
+
+struct _LispCharInfo {
+    char **names;
+};
+
+
+/*
+ * Prototypes
+ */
+void LispUseArgList(LispArgList*);
+void LispFreeArgList(LispArgList*);
+LispArgList *LispCheckArguments(LispFunType, LispObj*, char*, int);
+LispObj *LispListProtectedArguments(LispArgList*);
+
+LispObj *LispGetDoc(LispObj*);
+LispObj *LispGetVar(LispObj*);
+#ifdef DEBUGGER
+void *LispGetVarAddr(LispObj*);        /* used by debugger */
+#endif
+LispObj *LispAddVar(LispObj*, LispObj*);
+LispObj *LispSetVar(LispObj*, LispObj*);
+void LispUnsetVar(LispObj*);
+
+       /* only used at initialization time */
+LispObj *LispNewStandardStream(LispFile*, LispObj*, int);
+
+       /* create a new package */
+LispObj *LispNewPackage(LispObj*, LispObj*);
+       /* add package to use-list of current, and imports all extern symbols */
+void LispUsePackage(LispObj*);
+       /* make symbol extern in the current package */
+void LispExportSymbol(LispObj*);
+       /* imports symbol to current package */
+void LispImportSymbol(LispObj*);
+
+       /* always returns the same string */
+hash_key *LispGetAtomKey(char*, int);
+char *LispGetAtomString(char*, int);
+
+/* destructive fast reverse, note that don't receive a LispMac* argument */
+LispObj *LispReverse(LispObj *list);
+
+char *LispIntToOpaqueType(int);
+
+/* (print) */
+void LispPrint(LispObj*, LispObj*, int);
+
+LispBlock *LispBeginBlock(LispObj*, LispBlockType);
+#define BLOCKJUMP(block)                               \
+    lisp__data.stack.length = (block)->stack;          \
+    lisp__data.protect.length = (block)->protect;      \
+    longjmp((block)->jmp, 1)
+void LispEndBlock(LispBlock*);
+       /* if unwind-protect active, jump to cleanup code, else do nothing */
+void LispBlockUnwind(LispBlock*);
+
+void LispUpdateResults(LispObj*, LispObj*);
+void LispTopLevel(void);
+
+LispAtom *LispDoGetAtom(char *str, int);
+       /* get value from atom's property list */
+LispObj *LispGetAtomProperty(LispAtom*, LispObj*);
+       /* put value in atom's property list */
+LispObj *LispPutAtomProperty(LispAtom*, LispObj*, LispObj*);
+       /* remove value from atom's property list */
+LispObj *LispRemAtomProperty(LispAtom*, LispObj*);
+       /* replace atom's property list */
+LispObj *LispReplaceAtomPropertyList(LispAtom*, LispObj*);
+
+       /* returns function associated with symbol */
+LispObj *LispSymbolFunction(LispObj*);
+       /* returns symbol string name */
+LispObj *LispSymbolName(LispObj*);
+
+       /* define byte compiled function, or replace definition */
+void LispSetAtomCompiledProperty(LispAtom*, LispObj*);
+       /* remove byte compiled function property */
+void LispRemAtomCompiledProperty(LispAtom*);
+       /* define function, or replace function definition */
+void LispSetAtomFunctionProperty(LispAtom*, LispObj*, LispArgList*);
+       /* remove function property */
+void LispRemAtomFunctionProperty(LispAtom*);
+       /* define builtin, or replace builtin definition */
+void LispSetAtomBuiltinProperty(LispAtom*, LispBuiltin*, LispArgList*);
+       /* remove builtin property */
+void LispRemAtomBuiltinProperty(LispAtom*);
+       /* define setf macro, or replace current definition */
+void LispSetAtomSetfProperty(LispAtom*, LispObj*, LispArgList*);
+       /* remove setf macro */
+void LispRemAtomSetfProperty(LispAtom*);
+       /* create or change structure property */
+void LispSetAtomStructProperty(LispAtom*, LispObj*, int);
+       /* remove structure property */
+void LispRemAtomStructProperty(LispAtom*);
+
+void LispProclaimSpecial(LispObj*, LispObj*, LispObj*);
+void LispDefconstant(LispObj*, LispObj*, LispObj*);
+
+void LispAddDocumentation(LispObj*, LispObj*, LispDocType_t);
+void LispRemDocumentation(LispObj*, LispDocType_t);
+LispObj *LispGetDocumentation(LispObj*, LispDocType_t);
+
+/* increases storage for functions returning multiple values */
+void LispMoreReturns(void);
+
+/* increases storage for temporarily protected data */
+void LispMoreProtects(void);
+
+/* Initialization */
+extern int LispArgList_t;
+extern LispCharInfo LispChars[256];
+
+/* This function will return if the interpreter cannot be stopped */
+extern void LispSignal(int);
+
+void LispDisableInterrupts(void);
+void LispEnableInterrupts(void);
+#define DISABLE_INTERRUPTS()   LispDisableInterrupts()
+#define ENABLE_INTERRUPTS()    LispEnableInterrupts()
+
+/* Value returned by LispBegin, used everywhere in the code.
+ * Only one interpreter instance allowed. */
+extern LispMac lisp__data;
+
+#endif /* Lisp_private_h */
diff --git a/xedit/lisp/re/README b/xedit/lisp/re/README
new file mode 100644 (file)
index 0000000..aafad89
--- /dev/null
@@ -0,0 +1,121 @@
+$XFree86: xc/programs/xedit/lisp/re/README,v 1.3 2002/09/23 01:25:41 paulo Exp $
+
+LAST UPDATED:  $Date$
+
+  This is a small regex library for fast matching tokens in text. It was built
+to be used by xedit and it's syntax highlight code. It is not compliant with
+IEEE Std 1003.2, but is expected to be used where very fast matching is
+required, and exotic patterns will not be used.
+
+  To understand what kind of patterns this library is expected to be used with,
+see the file <XRoot>xc/programs/xedit/lisp/modules/progmodes/c.lsp and some
+samples in the file tests.txt, with comments for patterns that will not work,
+or may give incorrect results.
+
+  The library is not built upon the standard regex library by Henry Spencer,
+but is completely written from scratch, but it's syntax is heavily based on
+that library, and the only reason for it to exist is that unfortunately
+the standard version does not fit the requirements needed by xedit.
+Anyways, I would like to thanks Henry for his regex library, it is a really
+very useful tool.
+
+  Small description of understood tokens:
+
+               M A T C H I N G
+------------------------------------------------------------------------
+.              Any character (won't match newline if compiled with RE_NEWLINE)
+\w             Any word letter (shortcut to [a-zA-Z0-9_]
+\W             Not a word letter (shortcut to [^a-zA-Z0-9_]
+\d             Decimal number
+\D             Not a decimal number
+\s             A space
+\S             Not a space
+\l             A lower case letter
+\u             An upper case letter
+\c             A control character, currently the range 1-32 (minus tab)
+\C             Not a control character
+\o             Octal number
+\O             Not an octal number
+\x             Hexadecimal number
+\X             Not an hexadecimal number
+\<             Beginning of a word (matches an empty string)
+\>             End of a word (matches an empty string)
+^              Beginning of a line (matches an empty string)
+$              End of a line (matches an empty string)
+[...]          Matches one of the characters inside the brackets
+               ranges are specified separating two characters with "-".
+               If the first character is "^", matches only if the
+               character is not in this range. To add a "]" make it
+               the first character, and to add a "-" make it the last.
+\1 to \9       Backreference, matches the text that was matched by a group,
+               that is, text that was matched by the pattern inside
+               "(" and ")".
+
+
+               O P E R A T O R S
+------------------------------------------------------------------------
+()             Any pattern inside works as a backreference, and is also
+               used to group patterns.
+|              Alternation, allows choosing different possibilities, like
+               character ranges, but allows patterns of different lengths.
+
+
+               R E P E T I T I O N
+------------------------------------------------------------------------
+<re>*          <re> may occur any number of times, including zero
+<re>+          <re> must occur at least once
+<re>?          <re> is optional
+<re>{<e>}      <re> must occur exactly <e> times
+<re>{<n>,}     <re> must occur at least <n> times
+<re>{,<m>}     <re> must not occur more than <m> times
+<re>{<n>,<m>}  <re> must occur at least <n> times, but no more than <m>
+
+
+  Note that "." is a special character, and when used with a repetition
+operator it changes completely its meaning. For example, ".*" matches
+anything up to the end of the input string (unless the pattern was compiled
+with RE_NEWLINE, in that case it will match anything, but a newline).
+
+
+  Limitations:
+
+o Only minimal matches supported. The engine has only one level "backtracking",
+  so, it also only does minimal matches to allow backreferences working
+  properly, and to avoid failing to match depending on the input.
+
+o Only one level "grouping", for example, with the pattern:
+       (a(b)c)
+   If "abc" is anywhere in the input, it will be in "\1", but there will
+  not exist a "\2" for "b".
+
+o Some "special repetitions" were not implemented, these are:
+       .{<e>}
+       .{<n>,}
+       .{,<m>}
+       .{<n>,<m>}
+
+o Some patterns will never match, for example:
+       \w*\d
+    Since "\w*" already includes all possible matches of "\d", "\d" will
+  only be tested when "\w*" failed. There are no plans to make such
+  patterns work.
+
+
+  Some of these limitations may be worked on future versions of the library,
+but this is not what the library is expected to do, and, adding support for
+correct handling of these would probably make the library slower, what is
+not the reason of it to exist in the first time.
+
+  If you need "true" regex than this library is not for you, but if all
+you need is support for very quickly finding simple patterns, than this
+library can be a very powerful tool, on some patterns it can run more
+than 200 times faster than "true" regex implementations! And this is
+the reason it was written.
+
+
+
+  Send comments and code to me (paulo@XFree86.Org) or to the XFree86
+mailing/patch lists.
+
+--
+Paulo
diff --git a/xedit/lisp/re/re.c b/xedit/lisp/re/re.c
new file mode 100644 (file)
index 0000000..fca7e28
--- /dev/null
@@ -0,0 +1,2649 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/re/re.c,v 1.8 2002/11/17 07:51:30 paulo Exp $ */
+
+#include <stdio.h>
+#include "rep.h"
+#define DEBUG
+/*
+ * Types
+ */
+
+/*  Information used when generating the final form of the compiled re.
+ */
+struct _re_inf {
+    rec_alt *alt;
+    unsigned char *cod;
+    long len;
+    long spc;
+
+    /* Start offset of special repetition instruction */
+    long sr[MAX_DEPTH];
+
+    /* Jump offset of special repetition instruction */
+    long sj[MAX_DEPTH];
+
+    /* Just a flag, to know if this nesting is for a special repetition */
+    char sp[MAX_DEPTH];
+
+    int bas;                   /* Alternatives/repetitions depth */
+    int par;                   /* Open parenthesis counter */
+    int ref;                   /* Backreference counter */
+
+    rec_pat *apat;             /*  Alternatives duplicate patterns
+                                * if a special repetition is found,
+                                * this is done to somewhat simplify
+                                * the bytecode engine and still allow
+                                * some complex (and time consuming)
+                                * patterns. */
+
+    int flags;
+    int ecode;
+};
+
+/*  This structure is not associated with re_cod as it's data only matters
+ * to the current match search.
+ */
+struct _re_eng {
+    unsigned char *bas;                /* Base string pointer */
+    unsigned char *str;                /* String to search for pattern */
+    unsigned char *end;                /* Where to stop searching */
+    unsigned char *cod;                /* Pointer in the re_cod structure */
+    long off;                  /* Number of used entries in so/eo etc */
+
+    /* Match offset/nesting information */
+    long so[MAX_DEPTH];                /* (s)tart of (m)atch */
+    long eo[MAX_DEPTH];                /* (e)nd of (m)atch */
+    long sv[MAX_DEPTH];                /* (s)a(v)e match end offset */
+    long re[MAX_DEPTH];                /* (re)petition count */
+    long ss[MAX_DEPTH];                /* (s)ave (s)tart of match */
+    unsigned char *rcod[MAX_DEPTH];    /* restart position in regex code */
+    unsigned char *rstr[MAX_DEPTH];    /* restart position in string */
+
+    /* Group/backreference information */
+    long goff;
+    long gso[9];
+    long geo[9];
+};
+
+/*
+ * Prototypes
+ */
+static void reinit(void);
+static int rec_check(re_inf*, int);
+static int rec_code(re_inf*, ReCode);
+static int rec_byte(re_inf*, int);
+static int rec_byte_byte(re_inf*, int, int);
+static int rec_code_byte(re_inf*, ReCode, int);
+static int rec_length(re_inf*, int);
+static int rec_code_byte_byte(re_inf*, ReCode, int, int);
+static int rec_build_alt(re_inf*, rec_alt*);
+static int rec_build_pat(re_inf*, rec_pat*);
+static int rec_build_rng(re_inf*, rec_rng*);
+static int rec_build_grp(re_inf*, rec_grp*);
+static int rec_build_stl(re_inf*, rec_stl*);
+static int rec_build_rep(re_inf*, rec_rep*);
+static int rec_inc_spc(re_inf*);
+static int rec_dec_spc(re_inf*);
+static int rec_add_spc(re_inf*, int);
+static int rec_off_spc(re_inf*);
+static int rec_alt_spc(re_inf*, int);
+static int rec_rep_spc(re_inf*, int);
+#ifdef DEBUG
+static void redump(re_cod*);
+#endif
+
+/*
+ * Initialization
+ */
+unsigned char re__alnum[256];
+unsigned char re__odigit[256];
+unsigned char re__ddigit[256];
+unsigned char re__xdigit[256];
+unsigned char re__control[256];
+
+/*
+ * Implementation
+ */
+int
+recomp(re_cod *preg, const char *pattern, int flags)
+{
+    int i, ecode;
+    re_inf inf;
+
+    reinit();
+
+    preg->cod = NULL;
+    inf.alt = irec_comp(pattern,
+                       flags & RE_PEND ? preg->re_endp :
+                               pattern + strlen(pattern),
+                       flags, &ecode);
+    if (ecode != 0)
+       return (ecode);
+
+    inf.cod = NULL;
+    inf.len = inf.spc = 0;
+    inf.bas = 0;
+    inf.par = 0;
+    inf.ref = 0;
+    inf.apat = NULL;
+    inf.flags = flags;
+    inf.ecode = 0;
+    for (i = 0; i < MAX_DEPTH; i++)
+       inf.sp[i] = 0;
+
+    /* First byte is runtime modifier flags */
+    if (rec_byte(&inf, flags & (RE_NEWLINE | RE_NOSUB)) == 0 &&
+       rec_byte(&inf, 0xff) == 0 &&
+       rec_build_alt(&inf, inf.alt) == 0 &&
+       rec_rep_spc(&inf, 0) == 0 &&
+       rec_code(&inf, Re_Done) == 0) {
+       /*  Number of possible references, loops will not leave this
+        * value correct, but it is cheap to read it from the second
+        * byte, instead of adding several extra checks in the bytecode. */
+       if (inf.ref)
+           inf.cod[1] = inf.ref - 1;
+       preg->cod = inf.cod;
+       /*  Public structure member */
+       preg->re_nsub = inf.ref;
+    }
+
+    irec_free_alt(inf.alt);
+    if (inf.ecode)
+       free(inf.cod);
+#ifdef DEBUG
+    else if (flags & RE_DUMP)
+       redump(preg);
+#endif
+
+    return (inf.ecode);
+}
+
+int
+reexec(const re_cod *preg, const char *string,
+       int nmatch, re_mat pmat[], int flags)
+{
+    unsigned char *ptr, *str, newline, nosub;
+    int len, si, ci, bas, i, j, k, l, m;
+    re_eng eng;
+
+    if (preg == NULL || preg->cod == NULL || nmatch < 0 ||
+       ((flags & RE_STARTEND) &&
+        (pmat == NULL || pmat[0].rm_eo < pmat[0].rm_so)))
+       return (RE_INVARG);
+
+    eng.str = (unsigned char*)string;
+    if (flags & RE_STARTEND) {
+       eng.end = eng.str + pmat[0].rm_eo;
+       eng.str += pmat[0].rm_so;
+    }
+    else
+       eng.end = eng.str + strlen(string);
+    eng.bas = eng.str;
+    nosub = preg->cod[0] & RE_NOSUB;
+    newline = preg->cod[0] & RE_NEWLINE;
+    eng.cod = preg->cod + 2;
+
+    if (!nosub && preg->cod[1] != 0xff) {
+       for (i = 0; i <= preg->cod[1]; i++) {
+           eng.gso[i] = 0;
+           eng.geo[i] = -1;
+       }
+    }
+
+    /* Setup to search for start of match from the first character */
+    eng.so[0] = 0;
+    eng.eo[0] = eng.sv[0] = -1;
+    eng.rcod[0] = eng.cod;
+    eng.rstr[0] = eng.str + 1;
+    eng.off = 0;
+    eng.goff = -1;
+    for (ci = si = 1;;) {
+reset:
+       switch (*eng.cod) {
+           /****************************************************
+            * One byte codes                                   *
+            ****************************************************/
+           case Re_Any:
+               if (eng.str == eng.end || (newline && eng.str[0] == '\n'))
+                   goto fail;
+               goto match;
+           case Re_AnyEatAnyTimes:
+               if (newline) {
+                   for (ptr = eng.str; ptr < eng.end; ptr++) {
+                       if (*ptr == '\n')
+                           break;
+                   }
+                   si = ptr - eng.str;
+               }
+               else
+                   si = eng.end - eng.str;
+               goto match;
+           case Re_AnyEatMaybe:
+               si = eng.end > eng.str;
+               if (newline && si && eng.str[0] == '\n')
+                   si = 0;
+               goto match;
+           case Re_AnyEatAtLeast:
+               if (newline) {
+                   for (ptr = eng.str; ptr < eng.end; ptr++) {
+                       if (*ptr == '\n')
+                           break;
+                   }
+                   si = ptr - eng.str;
+               }
+               else
+                   si = eng.end - eng.str;
+               if (si == 0) {
+                   si = 1;
+                   goto fail;
+               }
+               goto match;
+           case Re_Odigit:
+               if (eng.str >= eng.end)
+                   goto fail;
+               if (re__odigit[eng.str[0]])
+                   goto match;
+               goto fail;
+           case Re_OdigitNot:
+               if (eng.str >= eng.end || re__odigit[eng.str[0]])
+                   goto fail;
+               goto match;
+           case Re_Digit:
+               if (eng.str >= eng.end)
+                   goto fail;
+               if (re__ddigit[eng.str[0]])
+                   goto match;
+               goto fail;
+           case Re_DigitNot:
+               if (eng.str >= eng.end || re__ddigit[eng.str[0]])
+                   goto fail;
+               goto match;
+           case Re_Xdigit:
+               if (eng.str >= eng.end)
+                   goto fail;
+               if (re__xdigit[eng.str[0]])
+                   goto match;
+               goto fail;
+           case Re_XdigitNot:
+               if (eng.str >= eng.end || re__xdigit[eng.str[0]])
+                   goto fail;
+               goto match;
+           case Re_Space:
+               if (eng.str >= eng.end)
+                   goto fail;
+               if (eng.str[0] == ' ' || eng.str[0] == '\t')
+                   goto match;
+               goto fail;
+           case Re_SpaceNot:
+               if (eng.str >= eng.end)
+                   goto fail;
+               if (eng.str[0] != ' ' && eng.str[0] != '\t')
+                   goto match;
+               goto fail;
+           case Re_Tab:
+               if (eng.str >= eng.end)
+                   goto fail;
+               if (eng.str[0] == '\t')
+                   goto match;
+               goto fail;
+           case Re_Newline:
+               if (eng.str >= eng.end)
+                   goto fail;
+               if (eng.str[0] == '\n')
+                   goto match;
+               goto fail;
+           case Re_Lower:
+               if (eng.str >= eng.end)
+                   goto fail;
+               if (eng.str[0] >= 'a' && eng.str[0] <= 'z')
+                   goto match;
+               goto fail;
+           case Re_Upper:
+               if (eng.str >= eng.end)
+                   goto fail;
+               if (eng.str[0] >= 'A' && eng.str[0] <= 'Z')
+                   goto match;
+               goto fail;
+           case Re_Alnum:
+               if (eng.str >= eng.end)
+                   goto fail;
+               if (re__alnum[eng.str[0]])
+                   goto match;
+               goto fail;
+           case Re_AlnumNot:
+               if (eng.str >= eng.end)
+                   goto fail;
+               if (re__alnum[eng.str[0]])
+                   goto fail;
+               goto match;
+           case Re_Control:
+               if (eng.str >= eng.end)
+                   goto fail;
+               if (re__control[eng.str[0]])
+                   goto match;
+               goto fail;
+           case Re_ControlNot:
+               if (eng.str >= eng.end || re__control[eng.str[0]])
+                   goto fail;
+               goto match;
+
+           /****************************************************
+            * One byte codes, match special emtpy strings      *
+            ****************************************************/
+           case Re_Bol:
+               if (eng.str == eng.bas) {
+                   if ((flags & RE_NOTBOL)) {
+                       /* String does not start at the beginning of a line */
+                       if (newline)
+                           goto fail;
+                       goto wont;
+                   }
+                   si = 0;
+                   goto match;
+               }
+               if (newline && eng.str[-1] == '\n') {
+                   si = 0;
+                   goto match;
+               }
+               goto fail;
+           case Re_Eol:
+               if (eng.str == eng.end) {
+                   if (flags & RE_NOTEOL)
+                       /* String does not finish at the end of a line */
+                       goto wont;
+                   si = 0;
+                   goto match;
+               }
+               if (newline && eng.str[0] == '\n') {
+                   si = 0;
+                   goto match;
+               }
+               goto fail;
+           case Re_Bow:
+               if (eng.str >= eng.end ||
+                   (eng.str > eng.bas &&
+                    (re__alnum[eng.str[-1]])))
+                   goto fail;
+               if (re__alnum[eng.str[0]]) {
+                   si = 0;
+                   goto match;
+               }
+               goto fail;
+           case Re_Eow:
+               if (eng.str == eng.bas ||
+                   (eng.str < eng.end &&
+                    re__alnum[eng.str[0]]))
+                   goto fail;
+               if (re__alnum[eng.str[-1]]) {
+                   si = 0;
+                   goto match;
+               }
+               goto fail;
+
+           /****************************************************
+            * One byte code, one byte argument                 *
+            ****************************************************/
+           case Re_Literal:
+               if (eng.str >= eng.end)
+                   goto fail;
+               if (eng.str[0] == eng.cod[1]) {
+                   ci = 2;
+                   goto match;
+               }
+               goto fail;
+           case Re_LiteralNot:
+               if (eng.str >= eng.end)
+                   goto fail;
+               if (eng.str[0] != eng.cod[1]) {
+                   ci = 2;
+                   goto match;
+               }
+               goto fail;
+           case Re_SearchLiteral:
+               for (str = eng.str; str < eng.end; str++) {
+                   if (*str == eng.cod[1]) {
+                       ci = 2;
+                       eng.str = str;
+                       goto match;
+                   }
+               }
+               /* This bytecode only happens in the toplevel */
+               eng.so[0] = str - eng.bas;
+               eng.str = str;
+               goto fail;
+
+           /****************************************************
+            * One byte code, two bytes argument                *
+            ****************************************************/
+           case Re_CaseLiteral:
+               if (eng.str >= eng.end)
+                   goto fail;
+               if (eng.str[0] == eng.cod[1] || eng.str[0] == eng.cod[2]) {
+                   ci = 3;
+                   goto match;
+               }
+               goto fail;
+           case Re_CaseLiteralNot:
+               if (eng.str >= eng.end)
+                   goto fail;
+               if (eng.str[0] != eng.cod[1] && eng.str[0] != eng.cod[2]) {
+                   ci = 3;
+                   goto match;
+               }
+               goto fail;
+           case Re_SearchCaseLiteral:
+               for (str = eng.str; str < eng.end; str++) {
+                   if (*str == eng.cod[1] || *str == eng.cod[2]) {
+                       ci = 3;
+                       eng.str = str;
+                       goto match;
+                   }
+               }
+               eng.so[0] = str - eng.bas;
+               eng.str = str;
+               goto fail;
+
+           /****************************************************
+            * One byte codes, two arguments, n bytes           *
+            ****************************************************/
+           case Re_String:
+               len = eng.cod[1];
+               if (len & 0x80) {
+                   i = 3;
+                   len = (len & 0x7f) + (eng.cod[2] << 7);
+               }
+               else
+                   i = 2;
+               if (eng.end - eng.str < len)
+                   goto fail;
+               ptr = eng.cod + i;
+               str = eng.str;
+               for (k = len; k > 0; k--) {
+                   if (*ptr++ != *str++)
+                       goto fail;
+               }
+               ci = i + len;
+               si = len;
+               goto match;
+           case Re_SearchString:
+               len = eng.cod[1];
+               if (len & 0x80) {
+                   i = 3;
+                   len = (len & 0x7f) + (eng.cod[2] << 7);
+               }
+               else
+                   i = 2;
+               for (str = eng.str; eng.end - str >= len; str = eng.str++) {
+                   for (ptr = eng.cod + i, str = eng.str, k = len; k > 0; k--)
+                       if (*ptr++ != *str++)
+                           break;
+                   if (k == 0) {
+                       /* Substring found */
+                       ci = i + len;
+                       si = str - eng.str;
+                       goto match;
+                   }
+               }
+               eng.so[0] = eng.end - eng.bas;
+               eng.str = eng.end;
+               goto fail;
+
+           case Re_CaseString:
+               len = eng.cod[1];
+               if (len & 0x80) {
+                   i = 3;
+                   len = (len & 0x7f) + (eng.cod[2] << 7);
+               }
+               else
+                   i = 2;
+
+               len >>= 1;
+               /*  Check if there are at least len/2 bytes left, string
+                * is represented as two bytes, lower and upper case */
+               if (eng.end - eng.str < len)
+                   goto fail;
+               ptr = eng.cod + i;
+               str = eng.str;
+               for (k = len; k > 0; str++, ptr += 2, k--) {
+                   if (*str != ptr[0] && *str != ptr[1])
+                       goto fail;
+               }
+               ci = i + (len << 1);
+               si = len;
+               goto match;
+           case Re_SearchCaseString:
+               len = eng.cod[1];
+               if (len & 0x80) {
+                   i = 3;
+                   len = (len & 0x7f) + (eng.cod[2] << 7);
+               }
+               else
+                   i = 2;
+               len >>= 1;
+               for (str = eng.str; eng.end - str >= len; str = eng.str++) {
+                   for (ptr = eng.cod + i, str = eng.str, k = len;
+                        k > 0; k--, ptr += 2, str++)
+                       if (ptr[0] != str[0] && ptr[1] != str[0])
+                           break;
+                   if (k == 0) {
+                       /* Substring found */
+                       ci = i + (len << 1);
+                       si = str - eng.str;
+                       goto match;
+                   }
+               }
+               eng.so[0] = eng.end - eng.bas;
+               eng.str = eng.end;
+               goto fail;
+
+           case Re_StringList:
+               /* Number of strings */
+               k = eng.cod[1];
+
+               /* Where to jump after match */
+               bas = eng.cod[2] | (eng.cod[3] << 8);
+
+               str = eng.str;
+               ptr = eng.cod + k + 4;
+               l = eng.end - eng.str;
+               for (j = 0; j < k; j++) {
+                   len = eng.cod[j + 4];
+                   if (len <= l) {
+                       for (i = 0; i < len; i++)
+                           if (ptr[i] != str[i])
+                               goto next_stl;
+                       goto stl_match;
+                   }
+next_stl:
+                   ptr += len;
+               }
+               goto fail;
+stl_match:
+               ci = bas;
+               si = len;
+               goto match;
+
+           case Re_CaseStringList:
+               /* Number of strings */
+               k = eng.cod[1];
+
+               /* Where to jump after match */
+               bas = eng.cod[2] | (eng.cod[3] << 8);
+
+               str = eng.str;
+               ptr = eng.cod + k + 4;
+               l = eng.end - eng.str;
+               for (j = 0; j < k; j++) {
+                   len = eng.cod[j + 4];
+                   if ((len >> 1) <= l) {
+                       for (i = m = 0; i < len; m++, i += 2)
+                           if (ptr[i] != str[m] && ptr[i + 1] != str[m])
+                               goto next_cstl;
+                       goto cstl_match;
+                   }
+next_cstl:
+                   ptr += len;
+               }
+               goto fail;
+cstl_match:
+               ci = bas;
+               si = len >> 1;
+               goto match;
+
+
+           case Re_LargeStringList:
+               /* Where to jump after match */
+               bas = eng.cod[1] | (eng.cod[2] << 8);
+
+               str = eng.str;
+
+               /* First entry in index map */
+               ptr = eng.cod + 3;
+               i = (int)str[0] << 1;
+               j = ptr[i] | (ptr[i + 1] << 8);
+               if (j == 0xffff)
+                   /* No entry with this byte */
+                   goto fail;
+
+               /* Bytes left in input */
+               l = eng.end - eng.str;
+
+               /* First entry matching initial byte */
+               ptr += 512 + j;
+
+               for (len = ptr[0];
+                    str[0] == ptr[1];
+                    ptr += len + 1, len = ptr[0]) {
+                   if (len <= l) {
+                       for (i = 1; i < len; i++) {
+                           if (ptr[i + 1] != str[i])
+                               goto next_lstl;
+                       }
+                       ci = bas;
+                       si = len;
+                       goto match;
+                   }
+next_lstl:;
+               }
+               goto fail;
+
+           case Re_LargeCaseStringList:
+               /* Where to jump after match */
+               bas = eng.cod[1] | (eng.cod[2] << 8);
+
+               str = eng.str;
+
+               /* First entry in index map */
+               ptr = eng.cod + 3;
+               i = (int)str[0] << 1;
+               j = ptr[i] | (ptr[i + 1] << 8);
+               if (j == 0xffff)
+                   /* No entry with this byte */
+                   goto fail;
+
+               /* Bytes left in input */
+               l = eng.end - eng.str;
+
+               /* First entry matching initial byte */
+               ptr += 512 + j;
+
+               for (len = ptr[0];
+                    str[0] == ptr[1] || str[0] == ptr[2];
+                    ptr += len + 1, len = ptr[0]) {
+                   if ((k = (len >> 1)) <= l) {
+                       for (i = 2, j = 1; i < len; i += 2, j++) {
+                           if (ptr[i + 1] != str[j] && ptr[i + 2] != str[j])
+                               goto next_lcstl;
+                       }
+                       ci = bas;
+                       si = k;
+                       goto match;
+                   }
+next_lcstl:;
+               }
+               goto fail;
+
+
+           /****************************************************
+            * Character range matching                         *
+            ****************************************************/
+           case Re_Range:
+               if (eng.str < eng.end && eng.cod[eng.str[0] + 1]) {
+                   ci = 257;
+                   goto match;
+               }
+               goto fail;
+           case Re_RangeNot:
+               if (eng.str >= eng.end || eng.cod[eng.str[0] + 1])
+                   goto fail;
+               ci = 257;
+               goto match;
+
+           /****************************************************
+            * Group handling                                   *
+            ****************************************************/
+           case Re_Open:
+               if (++eng.goff >= 9)
+                   return (RE_ASSERT);
+               eng.gso[eng.goff] = eng.str - eng.bas;
+               ++eng.cod;
+               continue;
+           case Re_Close:
+               eng.geo[eng.goff] = eng.str - eng.bas;
+               ++eng.cod;
+               continue;
+           case Re_Update:
+               bas = eng.cod[1];
+               eng.geo[eng.goff] = eng.str - eng.bas;
+               eng.cod += 2;           /* + Update + bas */
+               continue;
+
+           /****************************************************
+            * Backreference                                    *
+            ****************************************************/
+           case Re_Backref:
+               i = eng.cod[1];
+               j = eng.gso[i];
+               k = eng.geo[i];
+               len = k - j;
+               if (k < j || eng.end - eng.str < len)
+                   goto fail;
+               ptr = eng.bas + j;
+               str = eng.str;
+               for (l = len; l > 0; l--) {
+                   if (*ptr++ != *str++)
+                       goto fail;
+               }
+               ci = 2;
+               si = len;
+               goto match;
+
+           /****************************************************
+            * Alternatives handling                            *
+            ****************************************************/
+           case Re_Alt:
+               bas = eng.off;
+               if (++eng.off >= MAX_DEPTH)
+                   return (RE_ASSERT);
+
+               /* Get offset of next alternative */
+               i = eng.cod[1] | (eng.cod[2] << 8);
+
+               /* Setup for next alternative if the current fails */
+               eng.rcod[eng.off] = eng.cod + i + 1;    /* + Alt */
+
+               /* If fail, test the next alternative in the same string */
+               eng.rstr[eng.off] = eng.str;
+
+               /* Setup match offsets */
+               if (eng.so[bas] <= eng.eo[bas])
+                   eng.so[eng.off] = eng.eo[bas];
+               else
+                   eng.so[eng.off] = eng.so[bas];
+               eng.sv[eng.off] = eng.eo[eng.off] = eng.so[eng.off] - 1;
+
+               /* Save start of possible previous matches */
+               eng.ss[eng.off] = eng.so[bas];
+
+               /* Skip code */
+               eng.cod += 3;
+
+               /* Go try the first alternative */
+               continue;
+
+           case Re_AltNext:
+               bas = eng.off - 1;
+               /* Check if matched and if it is a better match */
+               if (eng.eo[eng.off] >= eng.so[eng.off] &&
+                   eng.sv[eng.off] - eng.so[eng.off] <
+                   eng.eo[eng.off] - eng.so[eng.off])
+                   eng.sv[eng.off] = eng.eo[eng.off];
+
+               /* Get offset of next alternative */
+               i = eng.cod[1] | (eng.cod[2] << 8);
+
+               /* Setup for next alternative if the current fails */
+               eng.rcod[eng.off] = eng.cod + i + 1;    /* + AltNext */
+
+               /* Setup match offset */
+               eng.eo[eng.off] = eng.so[eng.off] - 1;
+
+               /* Reset string for next alternative */
+               eng.str = eng.rstr[eng.off];
+
+               /* Skip code */
+               eng.cod += 3;
+
+               /* Go try the next alternative */
+               continue;
+
+           case Re_AltDone:
+               bas = eng.off - 1;
+               /* Check if matched and if it is a better match */
+               if (eng.sv[eng.off] - eng.so[eng.off] <
+                   eng.eo[eng.off] - eng.so[eng.off])
+                   eng.sv[eng.off] = eng.eo[eng.off];
+
+               /* If there is a match */
+               if (eng.sv[eng.off] >= eng.so[eng.off]) {
+                   eng.so[bas] = eng.ss[eng.off];
+                   eng.eo[bas] = eng.sv[eng.off];
+                   eng.str = eng.bas + eng.eo[bas];
+
+                   /* Pop stack and skip code */
+                   --eng.off;
+                   ++eng.cod;
+
+                   /* Go try next regular expression pattern */
+                   continue;
+               }
+
+               /* Failed, reset string and pop stack */
+               eng.str = eng.rstr[eng.off];
+               --eng.off;
+               goto fail;
+
+
+           /****************************************************
+            * Repetition                                       *
+            ****************************************************/
+
+               /*  Note that the repetition counter is not
+                * updated for <re>*, <re>+ and <re>?
+                * it is easy to updated, but since it is not
+                * really useful, code to do it was removed
+                * to save a few cpu cicles. */
+
+#define REPETITION_SETUP()                                     \
+       if (++eng.off >= MAX_DEPTH)                             \
+           return (RE_ASSERT);                                 \
+                                                               \
+       /* Return here for recovery if match fail */            \
+       eng.rcod[eng.off] = eng.cod;                            \
+                                                               \
+       /* Setup match offsets */                               \
+       if (eng.so[bas] <= eng.eo[bas])                         \
+           eng.so[eng.off] = eng.eo[bas];                      \
+       else                                                    \
+           eng.so[eng.off] = eng.so[bas];                      \
+       eng.ss[eng.off] = eng.so[bas];                          \
+       eng.sv[eng.off] = eng.eo[eng.off] = eng.so[eng.off] - 1;\
+                                                               \
+       /* Skip repetition instruction */                       \
+       eng.cod += 4;
+
+
+           case Re_AnyTimes:
+               bas = eng.cod[1];
+               if (eng.off == bas) {
+                   /* First iteration */
+                   REPETITION_SETUP();
+               }
+               else {
+                   if (eng.eo[eng.off] >= eng.so[eng.off] &&
+                       eng.eo[eng.off] > eng.sv[eng.off]) {
+                       /* Update offset of match */
+                       eng.sv[eng.off] = eng.eo[eng.off];
+
+                       /* Skip repetition instruction */
+                       eng.cod += 4;
+                   }
+                   else {
+                       /* Match failed but it is ok */
+                       len = eng.cod[2] | (eng.cod[3] << 8);
+                       eng.so[bas] = eng.ss[eng.off];
+                       if (eng.sv[eng.off] >= eng.so[eng.off])
+                           /* Something matched earlier, update */
+                           eng.eo[bas] = eng.sv[eng.off];
+                       else if (eng.eo[bas] < eng.so[bas])
+                           /* Empty match */
+                           eng.eo[bas] = eng.so[bas];
+
+                       /* Try next pattern at correct offset */
+                       eng.str = eng.bas + eng.eo[bas];
+
+                       /* Pop stack and skip code */
+                       --eng.off;
+                       eng.cod += len;
+                   }
+               }
+               continue;
+
+           case Re_Maybe:
+               bas = eng.cod[1];
+               if (eng.off == bas) {
+                   /* First iteration */
+                   REPETITION_SETUP();
+               }
+               else {
+                   /* Matched or first iteration is done */
+                   len = eng.cod[2] | (eng.cod[3] << 8);
+                   eng.so[bas] = eng.ss[eng.off];
+                   if (eng.eo[eng.off] > eng.so[eng.off]) {
+                       /* Something matched earlier, update */
+                       eng.eo[bas] = eng.eo[eng.off];
+                       eng.str = eng.bas + eng.eo[bas];
+                       /* Don't need to update counter */
+                   }
+                   else {
+                       /* Empty match */
+                       if (eng.eo[bas] < eng.so[bas])
+                           eng.eo[bas] = eng.so[bas];
+
+                       /* Try next pattern at correct offset */
+                       eng.str = eng.bas + eng.eo[bas];
+                   }
+
+                   /* Pop stack */
+                   --eng.off;
+
+                   /* Skip code */
+                   eng.cod += len;
+               }
+               continue;
+
+           case Re_AtLeast:
+               bas = eng.cod[1];
+               if (eng.off == bas) {
+                   /* First iteration */
+                   REPETITION_SETUP();
+               }
+               else {
+                   if (eng.eo[eng.off] >= eng.so[eng.off] &&
+                       eng.eo[eng.off] > eng.sv[eng.off]) {
+                       /* Update offset of match */
+                       eng.sv[eng.off] = eng.eo[eng.off];
+
+                       /* Skip repetition instruction */
+                       eng.cod += 4;
+                   }
+                   else {
+                       /* Last try failed */
+                       len = eng.cod[2] | (eng.cod[3] << 8);
+                       if (eng.sv[eng.off] >= eng.so[eng.off]) {
+                           /* Something matched earlier, update */
+                           eng.so[bas] = eng.ss[eng.off];
+                           eng.eo[bas] = eng.sv[eng.off];
+                           eng.str = eng.bas + eng.eo[bas];
+                       }
+                       else {
+                           /*  Do it here, so that the fail label does
+                            * not need to do too expensive work for
+                            * simple patterns. */
+                           eng.so[bas] = eng.str - eng.bas;
+
+                           /* Zero matches, pop stack and restart */
+                           --eng.off;
+                           goto fail;
+                       }
+
+                       /* Pop stack and skip code */
+                       --eng.off;
+                       eng.cod += len;
+                   }
+               }
+               continue;
+
+
+           /****************************************************
+            * Repetition with arguments                        *
+            ****************************************************/
+           case Re_Exact:
+#define COMPLEX_REPETITION_SETUP_0()                           \
+       i = eng.cod[1];                                         \
+       bas = eng.cod[2];
+
+#define COMPLEX_REPETITION_SETUP()                             \
+       /* First iteration */                                   \
+       if (++eng.off >= MAX_DEPTH)                             \
+           return (RE_ASSERT);                                 \
+                                                               \
+       /*  Remeber number or repetitions */                    \
+       eng.re[eng.off] = 0;                                    \
+                                                               \
+       /* Return here for recovery if match fail */            \
+       eng.rcod[eng.off] = eng.cod;                            \
+                                                               \
+       /* Setup match offsets */                               \
+       if (eng.so[bas] <= eng.eo[bas])                         \
+           eng.so[eng.off] = eng.eo[bas];                      \
+       else                                                    \
+           eng.so[eng.off] = eng.so[bas];                      \
+       eng.sv[eng.off] = eng.eo[eng.off] = eng.so[eng.off] - 1;\
+       eng.ss[eng.off] = eng.so[bas];                          \
+                                                               \
+       /* Skip repetition instruction */                       \
+       eng.cod += 5;
+
+               COMPLEX_REPETITION_SETUP_0();
+               if (eng.off == bas) {
+                   /* First iteration */
+                   COMPLEX_REPETITION_SETUP();
+               }
+               else {
+                   if (eng.eo[eng.off] >= eng.so[eng.off] &&
+                       eng.eo[eng.off] > eng.sv[eng.off]) {
+                       /* Update offset of match */
+                       eng.sv[eng.off] = eng.eo[eng.off];
+
+                       /* Update repetition counter */
+                       if (++eng.re[eng.off] == i) {
+                           /* Matched the required times */
+                           eng.so[bas] = eng.ss[eng.off];
+                           eng.eo[bas] = eng.sv[eng.off];
+                           eng.str = eng.bas + eng.eo[bas];
+
+                           /* Update code */
+                           k = eng.cod[3] | (eng.cod[4] << 8);
+                           eng.cod += k;
+
+                           /* Pop stack and go for next pattern */
+                           --eng.off;
+                           continue;
+                       }
+
+                       /* Skip repetition instruction */
+                       eng.cod += 5;
+                   }
+                   else {
+                       /*  Do it here, so that the fail label does
+                        * not need to do too expensive work for
+                        * simple patterns. */
+                       eng.so[bas] = eng.str - eng.bas;
+
+                       /* Pop stack and restart */
+                       --eng.off;
+                       goto fail;
+                   }
+               }
+               continue;
+
+           case Re_Min:
+               COMPLEX_REPETITION_SETUP_0();
+               if (eng.off == bas) {
+                   /* First iteration */
+                   COMPLEX_REPETITION_SETUP();
+               }
+               else {
+                   if (eng.eo[eng.off] >= eng.so[eng.off] &&
+                       eng.eo[eng.off] > eng.sv[eng.off]) {
+                       /* Update offset of match */
+                       eng.sv[eng.off] = eng.eo[eng.off];
+
+                       /* Update repetition counter */
+                       ++eng.re[eng.off];
+
+                       /* Skip repetition instruction and try again */
+                       eng.cod += 5;
+                   }
+                   else {
+                       /* Match failed! */
+                       if (eng.re[eng.off] < i) {
+                           /*  Do it here, so that the fail label does
+                            * not need to do too expensive work for
+                            * simple patterns. */
+                           eng.so[bas] = eng.str - eng.bas;
+
+                           /* Didn't match required number of times */
+                           --eng.off;
+                           goto fail;
+                       }
+                       else {
+                           /* Matched minimum number of times */
+                           eng.eo[bas] = eng.sv[eng.off];
+                           eng.str = eng.bas + eng.eo[bas];
+                           k = eng.cod[3] | (eng.cod[4] << 8);
+
+                           /* Update code and pop stack */
+                           eng.cod += k;
+                           --eng.off;
+                       }
+                   }
+               }
+               continue;
+
+           case Re_Max:
+               COMPLEX_REPETITION_SETUP_0();
+               if (eng.off == bas) {
+                   /* First iteration */
+                   COMPLEX_REPETITION_SETUP();
+               }
+               else {
+                   if (eng.eo[eng.off] >= eng.so[eng.off] &&
+                       eng.eo[eng.off] > eng.sv[eng.off]) {
+                       /* Update offset of match */
+                       eng.sv[eng.off] = eng.eo[eng.off];
+
+                       /* Update repetition counter */
+                       if (++eng.re[eng.off] == i) {
+                           /* Matched the maximum times */
+                           eng.so[bas] = eng.ss[eng.off];
+                           eng.eo[bas] = eng.sv[eng.off];
+                           eng.str = eng.bas + eng.eo[bas];
+
+                           k = eng.cod[3] | (eng.cod[4] << 8);
+
+                           /* Update code and pop stack */
+                           eng.cod += k;
+                           --eng.off;
+                           continue;
+                       }
+
+                       /* Skip repetition instruction and try again */
+                       eng.cod += 5;
+                   }
+                   else {
+                       /* No matches, but zero matches are ok */
+                       k = eng.cod[3] | (eng.cod[4] << 8);
+                       if (eng.sv[eng.off] >= eng.so[eng.off]) {
+                           /* Something matched earlier, update */
+                           eng.so[bas] = eng.ss[eng.off];
+                           eng.eo[bas] = eng.sv[eng.off];
+                           eng.str = eng.bas + eng.eo[bas];
+                       }
+                       else {
+                           /* Empty match */
+                           if (eng.eo[bas] < eng.so[bas])
+                               eng.eo[bas] = eng.so[bas];
+
+                           /* Try next pattern at correct offset */
+                           eng.str = eng.bas + eng.eo[bas];
+                       }
+
+                       /* Pop stack and update code */
+                       --eng.off;
+                       eng.cod += k;
+                   }
+               }
+               continue;
+
+           case Re_MinMax:
+               bas = eng.cod[3];
+               if (eng.off == bas) {
+                   /* First iteration */
+                   COMPLEX_REPETITION_SETUP();
+               }
+               else {
+                   if (eng.eo[eng.off] >= eng.so[eng.off] &&
+                       eng.eo[eng.off] > eng.sv[eng.off]) {
+                       /* Update offset of match */
+                       eng.sv[eng.off] = eng.eo[eng.off];
+
+                       /* Update repetition counter */
+                       if (++eng.re[eng.off] == eng.cod[2]) {
+                           /* Matched the maximum times */
+                           eng.so[bas] = eng.ss[eng.off];
+                           eng.eo[bas] = eng.sv[eng.off];
+                           eng.str = eng.bas + eng.eo[bas];
+                           k = eng.cod[4] | (eng.cod[5] << 8);
+
+                           /* Update code and pop stack */
+                           eng.cod += k;
+                           --eng.off;
+                           continue;
+                       }
+
+                       /* Skip repetition instruction and try again */
+                       eng.cod += 6;
+                   }
+                   else {
+                       /* Match failed! */
+                       if (eng.re[eng.off] < eng.cod[1]) {
+                           /*  Do it here, so that the fail label does
+                            * not need to do too expensive work for
+                            * simple patterns. */
+                           eng.so[bas] = eng.str - eng.bas;
+
+                           /* Didn't match required number of times */
+                           --eng.off;
+                           goto fail;
+                       }
+                       else {
+                           /* Matched minimum number of times */
+                           eng.so[bas] = eng.ss[eng.off];
+                           eng.eo[bas] = eng.sv[eng.off];
+                           eng.str = eng.bas + eng.eo[bas];
+                           k = eng.cod[4] | (eng.cod[5] << 8);
+
+                           /* Update code and pop stack */
+                           eng.cod += k;
+                           --eng.off;
+                       }
+                   }
+               }
+               continue;
+
+
+           /****************************************************
+            * Special repetition handling                      *
+            ****************************************************/
+           case Re_AnyAnyTimes:
+               /* code(1) + bas(1) + gbas(1) + jump(2) */
+               bas = eng.cod[1];
+               if (eng.off == bas) {
+                   /* First iteration */
+                   if (++eng.off >= MAX_DEPTH)
+                       return (RE_ASSERT);
+
+                   /* Return here for recovery if match fail */
+                   eng.rcod[eng.off] = eng.cod;
+
+                   /* If fail, test the next pattern at the same point */
+                   eng.rstr[eng.off] = eng.str;
+
+                   /* Setup match offsets */
+                   eng.so[eng.off] = eng.str - eng.bas;
+                   eng.eo[eng.off] = eng.so[eng.off] - 1;
+
+                   if (newline)
+                       /*  Use the repetition counter to store start of
+                        * skipped string, to later check if skipping a
+                        * newline. */
+                       eng.re[eng.off] = eng.so[eng.off];
+
+                   /* Save start of possible previous matches */
+                   eng.ss[eng.off] = eng.so[bas];
+
+                   /* Skip repetition instruction */
+                   eng.cod += 5;
+               }
+               else {
+                   /* -1 as an unsigned char */
+                   if (eng.cod[2] != 0xff)
+                       eng.goff = eng.cod[2];
+                   else
+                       eng.goff = -1;
+
+                   if (newline) {
+                       ptr = eng.bas + eng.re[eng.off];
+                       str = eng.bas + eng.so[eng.off];
+                       for (; ptr < str; ptr++)
+                           if (*ptr == '\n') {
+                               eng.cod = eng.rcod[0];
+                               eng.so[0] = ptr - eng.bas + 1;
+                               eng.eo[0] = eng.so[0] - 1;
+                               eng.rstr[0] = eng.str = ptr + 1;
+                               eng.off = 0;
+                               goto reset;
+                           }
+                       /* If looping, don't do too many noops */
+                       eng.re[eng.off] = ptr - eng.bas;
+                   }
+
+                   if (eng.eo[eng.off] >= eng.so[eng.off]) {
+                       /* Note that this is only true if all possibly
+                        * nested special repetitions also matched. */
+
+                       if (eng.goff >= 0) {
+                           if (eng.cod[5] == Re_Update)
+                               eng.gso[eng.goff] = eng.eo[bas] +
+                                                   (eng.so[bas] > eng.eo[bas]);
+                           else if (eng.geo[eng.goff] < eng.so[eng.off])
+                               eng.geo[eng.goff] = eng.so[eng.off];
+                       }
+
+                       /* Jump relative offset */
+                       len = eng.cod[3] | (eng.cod[4] << 8);
+
+                       /* Restore offset from where started trying */
+                       eng.so[bas] = eng.ss[eng.off];
+                       eng.eo[bas] = eng.eo[eng.off];
+
+                       /* Pop stack and skip code */
+                       --eng.off;
+                       eng.cod += len;
+                   }
+                   else {
+                       /* Only give up if the entire string was scanned */
+                       if (eng.str < eng.end) {
+                           /* Update restart point for next pattern */
+                           eng.str = ++eng.rstr[eng.off];
+
+                           /* Reset start of nested match */
+                           eng.so[eng.off] = eng.str - eng.bas;
+
+                           /* Skip repetition instruction */
+                           eng.cod += 5;
+                       }
+                       else {
+                           /* Entire string scanned and failed */
+
+                           /* Jump relative offset */
+                           len = eng.cod[3] | (eng.cod[4] << 8);
+
+                           /* Restore offset from where started trying */
+                           eng.so[bas] = eng.ss[eng.off];
+                           eng.eo[bas] = eng.ss[eng.off] - 1;
+
+                           /* Pop stack and skip code */
+                           --eng.off;
+                           eng.cod += len;
+                       }
+                   }
+               }
+               continue;
+
+           /*  This is significantly different than matching <re>.*<re>
+            * because it may need to restart several times since it is
+            * possible to find too many false positives, for example:
+            *  a.*b    => once one "a" is found, scan all
+            *             the remaining string searching for a "b"
+            *  a.?b    => the string may have too many "a"s, but the
+            *             first occurrences of "a" may not be followed
+            *             by any-character and a "b" or a single "b".
+            */
+           case Re_AnyMaybe:
+               bas = eng.cod[1];
+               if (eng.off == bas) {
+                   /* First iteration */
+                   if (++eng.off >= MAX_DEPTH)
+                       return (RE_ASSERT);
+
+                   /* Return here for recovery if match fail */
+                   eng.rcod[eng.off] = eng.cod;
+
+                   /* First try without eating a byte */
+                   eng.rstr[eng.off] = eng.str;
+
+                   /* Remember this is the first try if match fail */
+                   eng.re[eng.off] = 0;
+
+                   /* Setup match offsets */
+                   eng.so[eng.off] = eng.str - eng.bas;
+                   eng.eo[eng.off] = eng.so[eng.off] - 1;
+
+                   /* Save start of possible previous matches */
+                   eng.ss[eng.off] = eng.so[bas];
+
+                   /* Skip repetition instruction */
+                   eng.cod += 5;
+               }
+               else {
+                   /* -1 as an unsigned char */
+                   if (eng.cod[2] != 0xff)
+                       eng.goff = eng.cod[2];
+                   else
+                       eng.goff = -1;
+
+                   if (eng.eo[eng.off] >= eng.so[eng.off]) {
+                       /* Something matched */
+
+                       if (eng.goff >= 0) {
+                           if (eng.cod[5] == Re_Update)
+                               eng.gso[eng.goff] = eng.eo[bas] +
+                                                   (eng.so[bas] > eng.eo[bas]);
+                           else if (eng.geo[eng.goff] < eng.so[eng.off])
+                               eng.geo[eng.goff] = eng.so[eng.off];
+                       }
+
+                       /* Jump relative offset */
+                       len = eng.cod[3] | (eng.cod[4] << 8);
+
+                       /* Update offset of match */
+                       eng.eo[bas] = eng.eo[eng.off];
+
+                       /* Pop stack and skip code */
+                       --eng.off;
+                       eng.cod += len;
+                   }
+                   else if (eng.re[eng.off] == 0 &&
+                            (!newline || eng.rstr[eng.off][1] != '\n')) {
+                       /* Try this time skiping a byte */
+                       ++eng.re[eng.off];
+
+                       /* Reset string, skip code and go try one time more */
+                       eng.str = ++eng.rstr[eng.off];
+                       eng.cod += 5;
+                   }
+                   else {
+                       /* Failed to match */
+
+                       /* Update offsets */
+                       eng.eo[bas] = eng.ss[eng.off];
+                       eng.so[bas] = eng.eo[bas] + 1;
+
+                       eng.str = eng.rstr[eng.off] + (eng.re[eng.off] == 0);
+
+                       /* Pop stack and return to toplevel code */
+                       --eng.off;
+                       if (eng.str >= eng.end)
+                           goto wont;
+                       eng.cod = eng.rcod[bas];
+                   }
+               }
+               continue;
+
+           /* .+ almost identical to .* but requires eating at least one byte */
+           case Re_AnyAtLeast:
+               bas = eng.cod[1];
+               if (eng.off == bas) {
+                   /* First iteration */
+                   if (++eng.off >= MAX_DEPTH)
+                       return (RE_ASSERT);
+
+                   /* Return here for recovery if match fail */
+                   eng.rcod[eng.off] = eng.cod;
+
+                   /* Skip one byte for the restart string */
+                   if (newline && eng.str[0] == '\n') {
+                       /* Cannot skip newline */
+                       eng.cod = eng.rcod[0];
+                       eng.rstr[0] = ++eng.str;
+                       eng.so[0] = eng.str - eng.bas;
+                       eng.eo[0] = eng.so[0] - 1;
+                       eng.off = 0;
+                       goto reset;
+                   }
+                   eng.rstr[eng.off] = ++eng.str;
+
+                   /* Setup match offsets */
+                   eng.so[eng.off] = eng.str - eng.bas;
+                   eng.eo[eng.off] = eng.so[eng.off] - 1;
+
+                   if (newline)
+                       /*  Use the repetition counter to store start of
+                        * skipped string, to later check if skipping a
+                        * newline. */
+                       eng.re[eng.off] = eng.so[eng.off];
+
+                   /* Save start of possible previous matches */
+                   eng.ss[eng.off] = eng.so[bas];
+
+                   /* Skip repetition instruction */
+                   eng.cod += 5;
+               }
+               else {
+                   /* -1 as an unsigned char */
+                   if (eng.cod[2] != 0xff)
+                       eng.goff = eng.cod[2];
+                   else
+                       eng.goff = -1;
+
+                   if (newline) {
+                       ptr = eng.bas + eng.re[eng.off];
+                       str = eng.bas + eng.so[eng.off];
+                       for (; ptr < str; ptr++)
+                           if (*ptr == '\n') {
+                               eng.cod = eng.rcod[0];
+                               eng.so[0] = ptr - eng.bas + 1;
+                               eng.eo[0] = eng.so[0] - 1;
+                               eng.rstr[0] = eng.str = ptr + 1;
+                               eng.off = 0;
+                               goto reset;
+                           }
+                       /* If looping, don't do too many noops */
+                       eng.re[eng.off] = ptr - eng.bas;
+                   }
+
+                   if (eng.eo[eng.off] >= eng.so[eng.off]) {
+                       /* Note that this is only true if all possibly
+                        * nested special repetitions also matched. */
+
+                       if (eng.goff >= 0) {
+                           if (eng.cod[5] == Re_Update)
+                               eng.gso[eng.goff] = eng.eo[bas] +
+                                                   (eng.so[bas] > eng.eo[bas]);
+                           else if (eng.geo[eng.goff] < eng.so[eng.off])
+                               eng.geo[eng.goff] = eng.so[eng.off];
+                       }
+
+                       /* Jump relative offset */
+                       len = eng.cod[3] | (eng.cod[4] << 8);
+
+                       /* Restore offset from where started trying */
+                       eng.so[bas] = eng.ss[eng.off];
+                       eng.eo[bas] = eng.eo[eng.off];
+
+                       /* Pop stack and skip code */
+                       --eng.off;
+                       eng.cod += len;
+                   }
+                   else {
+                       /* Only give up if the entire string was scanned */
+                       if (eng.str < eng.end) {
+                           /* Update restart point for next pattern */
+                           eng.str = ++eng.rstr[eng.off];
+
+                           /* Reset start of nested match */
+                           eng.so[eng.off] = eng.str - eng.bas;
+
+                           /* Skip repetition instruction */
+                           eng.cod += 5;
+                       }
+                       else {
+                           /* Entire string scanned and failed */
+
+                           /* Jump relative offset */
+                           len = eng.cod[3] | (eng.cod[4] << 8);
+
+                           /* Restore offset from where started trying */
+                           eng.so[bas] = eng.ss[eng.off];
+                           eng.eo[bas] = eng.ss[eng.off] - 1;
+
+                           /* Pop stack and skip code */
+                           --eng.off;
+                           eng.cod += len;
+                       }
+                   }
+               }
+               continue;
+
+
+           /****************************************************
+            * Repetition matched!                              *
+            ****************************************************/
+           case Re_RepJump:
+               /* eng.cod[1] is toplevel offset of repetition */
+               if (eng.off > eng.cod[1])
+                   /* If still needs to try matches */
+                   eng.cod -= eng.cod[2];
+               else
+                   eng.cod += 3;       /* + RepJump + bas + len-size */
+               continue;
+
+           case Re_RepLongJump:
+               /* eng.cod[1] is toplevel offset of repetition */
+               if (eng.off > eng.cod[1])
+                   /* If still needs to try matches */
+                   eng.cod -= eng.cod[2] | (eng.cod[3] << 8);
+               else
+                   eng.cod += 4;       /* + RepLongJump + bas + len-size */
+               continue;
+
+           /****************************************************
+            * Finished                                         *
+            ****************************************************/
+           case Re_DoneIf:
+               if (eng.eo[eng.off] >= eng.so[eng.off]) {
+                   eng.so[0] = eng.ss[eng.off];
+                   eng.eo[0] = eng.eo[eng.off];
+                   goto done;
+               }
+               ++eng.cod;
+               continue;
+           case Re_MaybeDone:
+               if (eng.eo[eng.off] >= eng.so[eng.off]) {
+                   eng.so[0] = eng.ss[eng.off];
+                   eng.eo[0] = eng.eo[eng.off];
+                   goto done;
+               }
+               ++eng.cod;
+               continue;
+           case Re_Done:
+               goto done;
+
+           default:
+               /* Fatal internal error */
+               return (RE_ASSERT);
+       }
+
+
+wont:
+       /* Surely won't match */
+       if (eng.off == 0) {
+           eng.eo[0] = eng.so[0] - 1;
+           break;
+       }
+
+
+fail:
+       if (eng.off == 0) {
+           /* If the entire string scanned */
+           if (++eng.str > eng.end) {
+               eng.eo[0] = eng.so[0] - 1;
+               break;
+           }
+           eng.goff = -1;
+           /* Update start of possible match after restart */
+           if (eng.eo[0] >= eng.so[0]) {
+               /* If first fail */
+               eng.str = eng.rstr[0];
+               ++eng.rstr[0];
+               eng.so[0] = eng.str - eng.bas;
+               eng.eo[0] = eng.so[eng.off] - 1;
+           }
+           else
+               /* Just trying at next byte */
+               ++eng.so[0];
+       }
+       else
+           /* Remember this match failed */
+           eng.eo[eng.off] = eng.so[eng.off] - 1;
+
+       /* Restart code */
+       eng.cod = eng.rcod[eng.off];
+       continue;
+
+
+match:
+       /* If first match */
+       if (eng.eo[eng.off] < eng.so[eng.off]) {
+           if (eng.off == 0)
+               eng.rstr[0] = eng.str + 1;
+           eng.so[eng.off] = eng.eo[eng.off] = eng.str - eng.bas;
+       }
+       eng.eo[eng.off] += si;
+       eng.cod += ci;
+       eng.str += si;
+       ci = si = 1;
+       continue;
+
+done:
+       break;
+    }
+
+    if (nmatch) {
+       if (flags & RE_STARTEND)
+           len = pmat[0].rm_so;
+       else
+           len = 0;
+       if (!nosub) {
+           if (preg->cod[1] != 0xff)
+               eng.goff = preg->cod[1];
+           pmat[0].rm_so = eng.so[0];
+           pmat[0].rm_eo = eng.eo[0];
+           for (i = 1; i < nmatch; i++) {
+               if (i - 1 <= eng.goff) {
+                   pmat[i].rm_so = eng.gso[i - 1];
+                   pmat[i].rm_eo = eng.geo[i - 1];
+               }
+               else {
+                   pmat[i].rm_so = 0;
+                   pmat[i].rm_eo = -1;
+               }
+           }
+           if (len) {
+               /* Update offsets, since the match was done in a substring */
+               j = eng.goff + 2 > nmatch ? nmatch : eng.goff + 2;
+               for (i = 0; i < j; i++) {
+                   pmat[i].rm_so += len;
+                   pmat[i].rm_eo += len;
+               }
+           }
+       }
+       else {
+           /*  Already know these values, allow compiling the regex with
+            * RE_NOSUB to use parenthesis only for grouping, but avoiding
+            * the runtime overhead of keeping track of the subexpression
+            * offsets. */
+           pmat[0].rm_so = eng.so[0] + len;
+           pmat[0].rm_eo = eng.eo[0] + len;
+       }
+    }
+
+    return (eng.so[0] <= eng.eo[0] ? 0 : RE_NOMATCH);
+}
+
+int
+reerror(int ecode, const re_cod *preg, char *ebuffer, int ebuffer_size)
+{
+    static char *errors[] = {
+       "No error",
+       "Failed to match",                      /* NOMATCH */
+
+       /* Errors not generated */
+       "Invalid regular expression",           /* BADPAT */
+       "Invalid collating element",            /* ECOLLATE */
+       "Invalid character class",              /* ECTYPE */
+
+       "`\' applied to unescapable character", /* EESCAPE */
+       "Invalid backreference number",         /* ESUBREG */
+       "Brackets `[ ]' not balanced",          /* EBRACK */
+       "Parentheses `( )' not balanced",       /* EPAREN */
+       "Braces `{ }' not balanced",            /* EBRACE */
+       "Invalid repetition count(s) in `{ }'", /* BADBR */
+       "Invalid character range in `[ ]'",     /* ERANGE */
+       "Out of memory",                        /* ESPACE */
+       "`?', `*', or `+' operand invalid",     /* BADRPT */
+       "Empty (sub)expression",                /* EMPTY */
+       "Assertion error - you found a bug",    /* ASSERT */
+       "Invalid argument"                      /* INVARG */
+    };
+    char *str;
+
+    if (ecode >= 0 && ecode < sizeof(errors) / sizeof(errors[0]))
+       str = errors[ecode];
+    else
+       str = "Unknown error";
+
+    return (snprintf(ebuffer, ebuffer_size, "%s", str));
+}
+
+void
+refree(re_cod *cod)
+{
+    free(cod->cod);
+    cod->cod = NULL;
+}
+
+static void
+reinit(void)
+{
+    int i;
+    static int first = 1;
+
+    if (!first)
+       return;
+    first = 0;
+
+    re__alnum['_'] = 1;
+
+    for (i = '0'; i <= '7'; i++)
+       re__alnum[i] = re__odigit[i] = re__ddigit[i] = re__xdigit[i] = 1;
+
+    for (; i <= '9'; i++)
+       re__alnum[i] = re__ddigit[i] = re__xdigit[i] = 1;
+
+    for (i = 'a'; i <= 'f'; i++)
+       re__alnum[i] = re__xdigit[i] = 1;
+    for (; i <= 'z'; i++)
+       re__alnum[i] = 1;
+
+    for (i = 'A'; i <= 'F'; i++)
+       re__alnum[i] = re__xdigit[i] = 1;
+    for (; i <= 'Z'; i++)
+       re__alnum[i] = 1;
+
+    for (i = 1; i < 32; i++)
+       re__control[i] = 1;
+    re__control[127] = 1;
+    /* Don't show tabs as control characters */
+    re__control['\t'] = 0;
+}
+
+static int
+rec_check(re_inf *inf, int count)
+{
+    if (inf->len + count >= inf->spc) {
+       int spc;
+       unsigned char *cod;
+
+       if ((spc = (count % 64)) != 0)
+           spc = 64 - spc;
+       spc += count + inf->spc;
+       if ((cod = realloc(inf->cod, spc)) == NULL)
+           return (inf->ecode = RE_ESPACE);
+       inf->cod = cod;
+       inf->spc = spc;
+    }
+
+    return (inf->ecode);
+}
+
+static int
+rec_code(re_inf *inf, ReCode code)
+{
+    if (rec_check(inf, 1) == 0)
+       inf->cod[inf->len++] = code;
+
+    return (inf->ecode);
+}
+
+static int
+rec_byte(re_inf *inf, int value)
+{
+    if (rec_check(inf, 1) == 0)
+       inf->cod[inf->len++] = value;
+
+    return (inf->ecode);
+}
+
+static int
+rec_code_byte(re_inf *inf, ReCode code, int value)
+{
+    if (rec_check(inf, 2) == 0) {
+       inf->cod[inf->len++] = code;
+       inf->cod[inf->len++] = value;
+    }
+
+    return (inf->ecode);
+}
+
+static int
+rec_length(re_inf *inf, int length)
+{
+    int lo, hi, two;
+
+    if (length >= 16384)
+       return (inf->ecode = RE_ESPACE);
+
+    lo = length & 0xff;
+    hi = length & 0xff00;
+    two = ((length > 0x7f) != 0) + 1;
+    if (two == 2) {
+       hi <<= 1;
+       hi |= (lo & 0x80) != 0;
+       lo |= 0x80;
+    }
+
+    if (rec_check(inf, two) == 0) {
+       inf->cod[inf->len++] = lo;
+       if (two == 2)
+           inf->cod[inf->len++] = hi >> 8;
+    }
+
+    return (inf->ecode);
+}
+
+static int
+rec_byte_byte(re_inf *inf, int value0, int value1)
+{
+    if (rec_check(inf, 2) == 0) {
+       inf->cod[inf->len++] = value0;
+       inf->cod[inf->len++] = value1;
+    }
+
+    return (inf->ecode);
+}
+
+static int
+rec_code_byte_byte(re_inf *inf, ReCode code, int value0, int value1)
+{
+    if (rec_check(inf, 3) == 0) {
+       inf->cod[inf->len++] = code;
+       inf->cod[inf->len++] = value0;
+       inf->cod[inf->len++] = value1;
+    }
+
+    return (inf->ecode);
+}
+
+static int
+rec_build_alt(re_inf *inf, rec_alt *alt)
+{
+    int offset, value, bas = inf->bas + 1;
+
+    if (alt) {
+       if (alt->next) {
+           if (rec_inc_spc(inf))
+               return (inf->ecode);
+
+           /* A real a list of alternatives */
+           rec_code(inf, Re_Alt);
+
+           offset = inf->len;          /* Remember current offset */
+           rec_byte_byte(inf, 0, 0);   /* Reserve two bytes for retry address */
+           while (alt && inf->ecode == 0) {
+               if (rec_build_pat(inf, alt->pat))
+                   break;
+               alt = alt->next;
+               if (alt && inf->ecode == 0) {
+                   /* Handle (hyper)complex repetitions */
+                   if (inf->bas != bas) {
+                       /* Duplicate patterns up to end of expression */
+                       rec_build_pat(inf, inf->apat);
+                       /* Restore engine state for next alternative(s) */
+                       rec_alt_spc(inf, bas - 1);
+                   }
+
+                   /* If the jump would be so long */
+                   if ((value = inf->len - offset) >= 16384) {
+                       inf->ecode = RE_ESPACE;
+                       break;
+                   }
+                   inf->cod[offset] = value & 0xff;
+                   inf->cod[offset + 1] = (value & 0xff00) >> 8;
+
+                   rec_code(inf, Re_AltNext);
+                   offset = inf->len;
+                   rec_byte_byte(inf, 0, 0);
+               }
+           }
+           if (inf->ecode == 0) {
+               /* Handle (hyper)complex repetitions */
+               if (inf->bas != bas) {
+                   /* Duplicate patterns up to end of expression */
+                   rec_build_pat(inf, inf->apat);
+                   /* Restore engine state for next alternative(s) */
+                   rec_alt_spc(inf, bas - 1);
+               }
+
+               /* If the jump would be so long */
+               if ((value = inf->len - offset) >= 16384)
+                   return (inf->ecode = RE_ESPACE);
+               inf->cod[offset] = value & 0xff;
+               inf->cod[offset + 1] = (value & 0xff00) >> 8;
+               /* Last jump is here */
+               rec_code(inf, Re_AltDone);
+           }
+           rec_dec_spc(inf);
+       }
+       else
+           /* Single alternative */
+           rec_build_pat(inf, alt->pat);
+    }
+
+    return (inf->ecode);
+}
+
+static int
+rec_build_pat(re_inf *inf, rec_pat *pat)
+{
+    rec_pat *apat;
+    int length, offset = 0, distance, jump = 0, bas = 0;
+
+    while (pat && inf->ecode == 0) {
+       if (pat->rep) {
+           bas = inf->bas;
+           if (pat->type == Rep_Group && !inf->par && rec_code(inf, Re_Open))
+               return (inf->ecode);
+           if (rec_inc_spc(inf))
+               return (inf->ecode);
+           offset = inf->len;
+           if (rec_build_rep(inf, pat->rep))
+               break;
+           /* Reserve space to jump after repetition done */
+           jump = inf->len;
+           rec_byte_byte(inf, 0, 0);
+       }
+       switch (pat->type) {
+           case Rep_AnyAnyTimes:
+           case Rep_AnyMaybe:
+           case Rep_AnyAtLeast:
+               if (rec_add_spc(inf, pat->type == Rep_AnyMaybe))
+                   return (inf->ecode);
+               if (rec_code(inf, (ReCode)pat->type) == 0 &&
+                   rec_byte(inf, inf->bas - 1) == 0 &&
+                   rec_byte(inf, inf->ref - 1) == 0)
+                   rec_off_spc(inf);
+               break;
+           case Rep_Literal:
+           case Rep_LiteralNot:
+           case Rep_SearchLiteral:
+               rec_code_byte(inf, (ReCode)pat->type, pat->data.chr);
+               break;
+           case Rep_CaseLiteral:
+           case Rep_CaseLiteralNot:
+           case Rep_SearchCaseLiteral:
+               rec_code_byte_byte(inf, (ReCode)pat->type,
+                                  pat->data.cse.lower, pat->data.cse.upper);
+               break;
+           case Rep_Range:
+           case Rep_RangeNot:
+               if (rec_code(inf, (ReCode)pat->type) == 0)
+                   rec_build_rng(inf, pat->data.rng);
+               break;
+           case Rep_String:
+           case Rep_SearchString:
+           case Rep_CaseString:
+           case Rep_SearchCaseString:
+               rec_code(inf, (ReCode)pat->type);
+               length = strlen((char*)pat->data.str);
+               if (rec_length(inf, length) == 0 && rec_check(inf, length) == 0) {
+                   memcpy(inf->cod + inf->len, pat->data.str, length);
+                   inf->len += length;
+               }
+               break;
+           case Rep_Any:
+           case Rep_AnyEatAnyTimes:
+           case Rep_AnyEatMaybe:
+           case Rep_AnyEatAtLeast:
+           case Rep_Odigit:
+           case Rep_OdigitNot:
+           case Rep_Digit:
+           case Rep_DigitNot:
+           case Rep_Xdigit:
+           case Rep_XdigitNot:
+           case Rep_Space:
+           case Rep_SpaceNot:
+           case Rep_Tab:
+           case Rep_Newline:
+           case Rep_Lower:
+           case Rep_Upper:
+           case Rep_Alnum:
+           case Rep_AlnumNot:
+           case Rep_Control:
+           case Rep_ControlNot:
+           case Rep_Bol:
+           case Rep_Eol:
+           case Rep_Bow:
+           case Rep_Eow:
+               rec_code(inf, (ReCode)pat->type);
+               break;
+           case Rep_Backref:
+               rec_code_byte(inf, Re_Backref, pat->data.chr);
+               break;
+           case Rep_Group:
+               if (pat->rep == NULL && !inf->par && rec_code(inf, Re_Open))
+                   break;
+               apat = inf->apat;
+               inf->apat = pat->next;
+               rec_build_grp(inf, pat->data.grp);
+               inf->apat = apat;
+               break;
+           case Rep_StringList:
+               rec_build_stl(inf, pat->data.stl);
+               break;
+       }
+       if (pat->rep) {
+#if 0
+           if (rec_dec_spc(inf))
+               return (inf->ecode);
+#else
+           if (rec_rep_spc(inf, bas))
+               return (inf->ecode);
+#endif
+           distance = inf->len - offset;
+           if (distance > 255) {
+               if (rec_code(inf, Re_RepLongJump) ||
+                   rec_byte(inf, inf->bas) ||
+                   rec_byte(inf, distance & 0xff) ||
+                   rec_byte(inf, (distance & 0xff00) >> 8))
+               break;
+           }
+           else if (rec_code(inf, Re_RepJump) ||
+                    rec_byte(inf, inf->bas) ||
+                    rec_byte(inf, distance))
+               break;
+           distance = inf->len - offset;
+           inf->cod[jump] = distance & 0xff;
+           inf->cod[jump + 1] = (distance & 0xff00) >> 8;
+       }
+       pat = pat->next;
+    }
+
+    return (inf->ecode);
+}
+
+static int
+rec_build_rng(re_inf *inf, rec_rng *rng)
+{
+    if (rec_check(inf, sizeof(rng->range)) == 0) {
+       memcpy(inf->cod + inf->len, rng->range, sizeof(rng->range));
+       inf->len += sizeof(rng->range);
+    }
+
+    return (inf->ecode);
+}
+
+static int
+rec_build_grp(re_inf *inf, rec_grp *grp)
+{
+    int par = inf->par;
+
+    if (!(inf->flags & RE_NOSUB)) {
+       ++inf->par;
+       if (par == 0)
+           ++inf->ref;
+       if (rec_build_alt(inf, grp->alt) == 0) {
+           if (par == 0) {
+               if (grp->comp)
+                   rec_code_byte(inf, Re_Update, inf->ref - 1);
+               else
+                   rec_code(inf, Re_Close);
+           }
+       }
+       --inf->par;
+    }
+    else
+       rec_build_alt(inf, grp->alt);
+
+    return (inf->ecode);
+}
+
+static int
+rec_build_stl(re_inf *inf, rec_stl *stl)
+{
+    int i, len, rlen;
+    ReCode code;
+
+    /* Calculate jump distance information */
+    rlen = stl->tlen + stl->nstrs + 4;
+    /* + code + nstrs + place-offset + data-length */
+
+    if (stl->nstrs >= LARGE_STL_COUNT) {
+       rlen += 511;            /* Don't write number of strings */
+       code = stl->type == Rep_StringList ?
+               Re_LargeStringList : Re_LargeCaseStringList;
+    }
+    else
+       code = (ReCode)stl->type;
+
+    if (rlen >= 16386)
+       return (inf->ecode = RE_ESPACE);
+    if (rec_check(inf, rlen) ||
+       rec_code(inf, code))
+       return (inf->ecode);
+
+    /* Space is allocated, just write the data */
+    if (stl->nstrs < LARGE_STL_COUNT)
+       inf->cod[inf->len++] = stl->nstrs;
+
+    inf->cod[inf->len++] = rlen & 0xff;
+    inf->cod[inf->len++] = (rlen & 0xff00) >> 8;
+
+    if (stl->nstrs < LARGE_STL_COUNT) {
+       for (i = 0; i < stl->nstrs; i++)
+           inf->cod[inf->len++] = stl->lens[i];
+       for (i = 0; i < stl->nstrs; i++) {
+           len = stl->lens[i];
+           if (len > 2) {
+               memcpy(inf->cod + inf->len, stl->strs[i], len);
+               inf->len += len;
+           }
+           else {
+               if (len == 1)
+                   inf->cod[inf->len++] = (long)stl->strs[i];
+               else {
+                   inf->cod[inf->len++] = (long)stl->strs[i] & 0xff;
+                   inf->cod[inf->len++] = ((long)stl->strs[i] & 0xff00) >> 8;
+               }
+           }
+       }
+    }
+    else {
+       /* The string length goes before the string itself */
+       int j, chl, chu;
+
+       /* Fill everything with an invalid jump address */
+       memset(inf->cod + inf->len, 0xff, 512);
+       for (i = len = 0, j = -1; i < stl->nstrs; i++) {
+           chl = stl->lens[i] > 2 ? stl->strs[i][0] : (long)stl->strs[i] & 0xff;
+           if (chl != j) {
+               inf->cod[inf->len + (chl << 1)] = len & 0xff;
+               inf->cod[inf->len + (chl << 1) + 1] = (len & 0xff00) >> 8;
+               if (code == Re_LargeCaseStringList) {
+                   chu = stl->lens[i] > 2 ?
+                       stl->strs[i][1] : ((long)(stl->strs[i]) & 0xff00) >> 8;
+                   inf->cod[inf->len + (chu << 1)] = len & 0xff;
+                   inf->cod[inf->len + (chu << 1) + 1] = (len & 0xff00) >> 8;
+               }
+               j = chl;
+           }
+           len += stl->lens[i] + 1;
+       }
+       inf->len += 512;
+
+       for (i = 0; i < stl->nstrs; i++) {
+           len = stl->lens[i];
+           inf->cod[inf->len++] = len;
+           if (len > 2) {
+               memcpy(inf->cod + inf->len, stl->strs[i], len);
+               inf->len += len;
+           }
+           else {
+               if (len == 1)
+                   inf->cod[inf->len++] = (long)stl->strs[i];
+               else {
+                   inf->cod[inf->len++] = (long)stl->strs[i] & 0xff;
+                   inf->cod[inf->len++] = ((long)stl->strs[i] & 0xff00) >> 8;
+               }
+           }
+       }
+    }
+
+    return (inf->ecode);
+}
+
+static int
+rec_build_rep(re_inf *inf, rec_rep *rep)
+{
+    if (rep) {
+       switch (rep->type) {
+           case Rer_AnyTimes:
+           case Rer_AtLeast:
+           case Rer_Maybe:
+               rec_code(inf, (ReCode)rep->type);
+               break;
+           case Rer_Exact:
+               if (rec_code(inf, Re_Exact) == 0)
+                   rec_byte(inf, rep->mine);
+               break;
+           case Rer_Min:
+               if (rec_code(inf, Re_Min) == 0)
+                   rec_byte(inf, rep->mine);
+               break;
+           case Rer_Max:
+               if (rec_code(inf, Re_Max) == 0)
+                   rec_byte(inf, rep->maxc);
+               break;
+           case Rer_MinMax:
+               if (rec_code(inf, Re_MinMax) == 0 &&
+                   rec_byte(inf, rep->mine) == 0)
+                   rec_byte(inf, rep->maxc);
+               break;
+       }
+       /* It is incremented in rec_build_pat */
+       rec_byte(inf, inf->bas - 1);
+    }
+
+    return (inf->ecode);
+}
+
+static int
+rec_inc_spc(re_inf *inf)
+{
+    if (++inf->bas >= MAX_DEPTH)
+       return (inf->ecode = RE_ESPACE);
+
+    return (inf->ecode);
+}
+
+static int
+rec_dec_spc(re_inf *inf)
+{
+    if (--inf->bas < 0)
+       return (inf->ecode = RE_ASSERT);
+
+    return (inf->ecode);
+}
+
+static int
+rec_add_spc(re_inf *inf, int maybe)
+{
+    if (++inf->bas >= MAX_DEPTH)
+       return (inf->ecode = RE_ESPACE);
+    inf->sp[inf->bas] = maybe + 1;
+
+    return (inf->ecode);
+}
+
+/* Could be joined with rec_rep_spc, code almost identical */
+static int
+rec_alt_spc(re_inf *inf, int top)
+{
+    int distance, i, bas = inf->bas;
+
+    while ((inf->bas > top) && inf->sp[inf->bas]) {
+       /* Jump to this repetition for cleanup */
+       distance = inf->len - inf->sr[inf->bas];
+
+       /* This will generate a jump to a jump decision opcode */
+       inf->sj[inf->bas] = inf->len;
+
+       if (distance > 255) {
+           if (rec_code(inf, Re_RepLongJump) ||
+               rec_byte(inf, inf->bas - 1) ||
+               rec_byte(inf, distance & 0xff) ||
+               rec_byte(inf, (distance & 0xff00) >> 8))
+           break;
+       }
+       else if (rec_code(inf, Re_RepJump) ||
+                rec_byte(inf, inf->bas - 1) ||
+                rec_byte(inf, distance))
+           break;
+
+       /* Top of stack value before repetition, or end condition value */
+       --inf->bas;
+    }
+
+    i = inf->bas + 1;
+
+    if (inf->ecode == 0 && i <= bas && inf->sp[i]) {
+       /*  Only the repetition at the bottom jump to code after testing
+        * all possibilities */
+       distance = inf->len - inf->sr[i];
+       inf->cod[inf->sr[i] + 3] = distance & 0xff;
+       inf->cod[inf->sr[i] + 4] = (distance & 0xff00) >> 8;
+
+       /* The bottom jump is here */
+       if (rec_code(inf, inf->sp[i] == 1 ? Re_DoneIf : Re_MaybeDone))
+          return (inf->ecode);
+
+       /*  Generate jumps to the previous special repetition */
+       for (++i; i <= bas; i++) {
+           if (inf->sp[i]) {
+               distance = inf->sj[i] - inf->sr[i];
+               inf->cod[inf->sr[i] + 3] = distance & 0xff;
+               inf->cod[inf->sr[i] + 4] = (distance & 0xff00) >> 8;
+           }
+       }
+    }
+
+    return (inf->ecode);
+}
+
+static int
+rec_rep_spc(re_inf *inf, int top)
+{
+    int distance, i, bas = inf->bas;
+
+    while (inf->bas > top) {
+       if (inf->sp[inf->bas]) {
+           /* Jump to this repetition for cleanup */
+           distance = inf->len - inf->sr[inf->bas];
+
+           /* This will generate a jump to a jump decision opcode */
+           inf->sj[inf->bas] = inf->len;
+
+           if (distance > 255) {
+               if (rec_code(inf, Re_RepLongJump) ||
+                   rec_byte(inf, inf->bas - 1) ||
+                   rec_byte(inf, distance & 0xff) ||
+                   rec_byte(inf, (distance & 0xff00) >> 8))
+               break;
+           }
+           else if (rec_code(inf, Re_RepJump) ||
+                    rec_byte(inf, inf->bas - 1) ||
+                    rec_byte(inf, distance))
+               break;
+       }
+
+       /* Top of stack value before repetition, or end condition value */
+       --inf->bas;
+    }
+
+    /* Find first special repetition offset. XXX This should be a noop */
+    for (i = 0; i < bas; i++)
+       if (inf->sp[i])
+           break;
+
+    if (inf->ecode == 0 && i <= bas && inf->sp[i]) {
+       /*  Only the repetition at the bottom jump to code after testing
+        * all possibilities */
+       distance = inf->len - inf->sr[i];
+       inf->cod[inf->sr[i] + 3] = distance & 0xff;
+       inf->cod[inf->sr[i] + 4] = (distance & 0xff00) >> 8;
+
+       /*  Generate jumps to the previous special repetition */
+       for (++i; i <= bas; i++) {
+           if (inf->sp[i]) {
+               distance = inf->sj[i] - inf->sr[i];
+               inf->cod[inf->sr[i] + 3] = distance & 0xff;
+               inf->cod[inf->sr[i] + 4] = (distance & 0xff00) >> 8;
+           }
+       }
+    }
+
+    return (inf->ecode);
+}
+
+static int
+rec_off_spc(re_inf *inf)
+{
+    /* The jump address before the three bytes instruction */
+    inf->sr[inf->bas] = inf->len - 3;
+    /*  Don't know yet where to go after done with the special
+     * repetition, just reserve two bytes for the jump address. */
+    return (rec_byte_byte(inf, 0, 0));
+}
+
+#ifdef DEBUG
+static void
+redump(re_cod *code)
+{
+    int i, j, k;
+    unsigned char *cod = code->cod, *stl;
+
+    if (cod[0] & RE_NOSUB)
+       printf("Nosub\n");
+    if (cod[0] & RE_NEWLINE)
+       printf("Newline\n");
+    ++cod;
+    if (cod[0] != 0xff)
+       printf("%d backrefs\n", cod[0] + 1);
+    ++cod;
+    for (;;) {
+       switch (*cod++) {
+           case Re_Open:
+               printf("Open");
+               break;
+           case Re_Close:
+               printf("Close");
+               break;
+           case Re_Update:
+               printf("Update (%d)", (int)*cod++);
+               break;
+           case Re_Alt:
+               printf("Alt");
+               i = cod[0] | cod[1];
+               cod += 2;
+               printf(" %d", i);
+               break;
+           case Re_AltNext:
+               printf("Alt-next");
+               i = cod[0] | cod[1];
+               cod += 2;
+               printf(" %d", i);
+               break;
+           case Re_AltDone:
+               printf("Alt-done");
+               break;
+           case Re_AnyTimes:
+               printf("-> Anytimes %d", (int)*cod++);
+               i = cod[0] | (cod[1] << 8);
+               cod += 2;
+               printf(" /%d", i);
+               break;
+           case Re_AnyEatAnyTimes:
+               printf("Any-eat-anytimes");
+               break;
+           case Re_AnyAnyTimes:
+               printf("-> Any-anytimes %d", (int)*cod++);
+               printf(" (%d)", (int)*cod++);
+               i = cod[0] | (cod[1] << 8);
+               cod += 2;
+               printf(" /%d", i);
+               break;
+           case Re_AnyEatMaybe:
+               printf("Any-eat-maybe");
+               break;
+           case Re_AnyMaybe:
+               printf("-> Any-maybe %d", (int)*cod++);
+               printf(" (%d)", (int)*cod++);
+               i = cod[0] | (cod[1] << 8);
+               cod += 2;
+               printf(" /%d", i);
+               break;
+           case Re_AnyAtLeast:
+               printf("-> Any-atleast %d", (int)*cod++);
+               printf(" (%d)", (int)*cod++);
+               i = cod[0] | (cod[1] << 8);
+               cod += 2;
+               printf(" /%d", i);
+               break;
+           case Re_AnyEatAtLeast:
+               printf("Any-eat-atleast");
+               break;
+           case Re_Maybe:
+               printf("-> Maybe %d", (int)*cod++);
+               i = cod[0] | (cod[1] << 8);
+               cod += 2;
+               printf(" /%d", i);
+               break;
+           case Re_AtLeast:
+               printf("-> Atleast %d", (int)*cod++);
+               i = cod[0] | (cod[1] << 8);
+               cod += 2;
+               printf(" /%d", i);
+               break;
+           case Re_Exact:
+               printf("-> Exact ");
+               i = *cod++;
+               printf("%d", i);
+               printf(" %d", (int)*cod++);
+               i = cod[0] | (cod[1] << 8);
+               cod += 2;
+               printf(" /%d", i);
+               break;
+           case Re_Min:
+               printf("-> Min ");
+               i = *cod++;
+               printf("%d", i);
+               printf(" %d", (int)*cod++);
+               i = cod[0] | (cod[1] << 8);
+               cod += 2;
+               printf(" /%d", i);
+               break;
+           case Re_Max:
+               printf("-> Max ");
+               i = *cod++;
+               printf("%d", i);
+               printf(" %d", (int)*cod++);
+               i = cod[0] | (cod[1] << 8);
+               cod += 2;
+               printf(" /%d", i);
+               break;
+           case Re_MinMax:
+               printf("-> Min-max ");
+               i = *cod++;
+               printf("%d ", i);
+               i = *cod++;
+               printf("%d", i);
+               printf(" %d", (int)*cod++);
+               i = cod[0] | (cod[1] << 8);
+               cod += 2;
+               printf(" /%d", i);
+               break;
+           case Re_RepJump:
+               printf("<- Rep-jump %d ", (int)*cod++);
+               i = *cod++;
+               printf("%d", i);
+               break;
+           case Re_RepLongJump:
+               printf("<- Rep-long-jump %d ", (int)*cod++);
+               i = cod[0] | (cod[1] << 8);
+               printf("%d", i);
+               break;
+           case Re_Any:
+               printf("Any");
+               break;
+           case Re_Odigit:
+               printf("Odigit");
+               break;
+           case Re_OdigitNot:
+               printf("Odigit-not");
+               break;
+           case Re_Digit:
+               printf("Digit");
+               break;
+           case Re_DigitNot:
+               printf("Digit-not");
+               break;
+           case Re_Xdigit:
+               printf("Xdigit");
+               break;
+           case Re_XdigitNot:
+               printf("Xdigit-not");
+               break;
+           case Re_Space:
+               printf("Space");
+               break;
+           case Re_SpaceNot:
+               printf("Space-not");
+               break;
+           case Re_Tab:
+               printf("Tab");
+               break;
+           case Re_Newline:
+               printf("Newline");
+               break;
+           case Re_Lower:
+               printf("Lower");
+               break;
+           case Re_Upper:
+               printf("Upper");
+               break;
+           case Re_Alnum:
+               printf("Alnum");
+               break;
+           case Re_AlnumNot:
+               printf("Alnum-not");
+               break;
+           case Re_Control:
+               printf("Control");
+               break;
+           case Re_ControlNot:
+               printf("Control-not");
+               break;
+           case Re_Bol:
+               printf("Bol");
+               break;
+           case Re_Eol:
+               printf("Eol");
+               break;
+           case Re_Bow:
+               printf("Bow");
+               break;
+           case Re_Eow:
+               printf("Eow");
+               break;
+           case Re_Range:
+               printf("Range ");
+               goto range;
+           case Re_RangeNot:
+               printf("Range-not ");
+range:
+               for (i = 0; i < 256; i += 32) {
+                   for (j = k = 0; j < 32; j++)
+                       k |= (*cod++ & 1) << (31 - j);
+                   printf("%x ", k);
+               }
+               break;
+           case Re_Literal:
+               printf("Literal %c", *cod++);
+               break;
+           case Re_LiteralNot:
+               printf("Literal-not %c", *cod++);
+               break;
+           case Re_SearchLiteral:
+               printf("Search-literal %c", *cod++);
+               break;
+           case Re_CaseLiteral:
+               printf("Case-literal %c", *cod++);
+               putchar(*cod++);
+               break;
+           case Re_CaseLiteralNot:
+               printf("Case-literal-not %c", *cod++);
+               putchar(*cod++);
+               break;
+           case Re_SearchCaseLiteral:
+               printf("Search-case-literal %c", *cod++);
+               putchar(*cod++);
+               break;
+           case Re_String:
+               printf("String ");
+               goto string;
+           case Re_SearchString:
+               printf("Search-string ");
+               goto string;
+           case Re_CaseString:
+               printf("Case-string ");
+               goto string;
+           case Re_SearchCaseString:
+               printf("Search-case-string ");
+string:
+               i = *cod++;
+               if (i & 0x80)
+                   i = (i & 0x7f) | (*cod++ << 7);
+               for (j = 0; j < i; j++)
+                   putchar(*cod++);
+               break;
+           case Re_StringList:
+               printf("String-list");
+               goto string_list;
+           case Re_CaseStringList:
+               printf("Case-string-list");
+string_list:
+               j = *cod++;
+               cod += 2;
+               stl = cod + j;
+               for (i = 0; i < j; i++) {
+                   k = *cod++;
+                   putchar(i ? ',' : ' ');
+                   fwrite(stl, k, 1, stdout);
+                   stl += k;
+               }
+               cod = stl;
+               break;
+           case Re_LargeStringList:
+               printf("Large-string-list");
+large_string_list:
+               i = cod[0] | (cod[1] << 8);
+               stl = cod + i - 1;
+               for (i = 0, cod += 514; cod < stl; i++) {
+                   k = *cod++;
+                   putchar(i ? ',' : ' ');
+                   fwrite(cod, k, 1, stdout);
+                   cod += k;
+               }
+               cod = stl;
+               break;
+           case Re_LargeCaseStringList:
+               printf("Large-case-string-list");
+               goto large_string_list;
+           case Re_Backref:
+               printf("Backref %d", (int)*cod++);
+               break;
+           case Re_DoneIf:
+               printf("Done-if");
+               break;
+           case Re_MaybeDone:
+               printf("Maybe-done");
+               break;
+           case Re_Done:
+               printf("Done\n");
+               return;
+       }
+       putchar('\n');
+    }
+}
+#endif
diff --git a/xedit/lisp/re/re.h b/xedit/lisp/re/re.h
new file mode 100644 (file)
index 0000000..209db51
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/re/re.h,v 1.1 2002/09/08 02:29:50 paulo Exp $ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+#ifndef _re_h
+#define _re_h
+
+/*
+ * Defines
+ */
+
+       /* Compile flags options */
+#define REG_BASIC              0000    /* Not used */
+#define REG_EXTENDED           0001    /* Not used, only extended supported */
+
+#define RE_ICASE               0002
+#define RE_NOSUB               0004
+#define RE_NEWLINE             0010
+#define RE_NOSPEC              0020
+#define RE_PEND                        0040
+#define RE_DUMP                        0200
+
+
+
+       /* Execute flag options */
+#define RE_NOTBOL              1
+#define RE_NOTEOL              2
+#define RE_STARTEND            4
+#define RE_TRACE               00400   /* Not used/supported */
+#define RE_LARGE               01000   /* Not used/supported */
+#define RE_BACKR               02000   /* Not used/supported */
+
+       /* Value returned by reexec when match fails */
+#define RE_NOMATCH             1
+       /* Compile error values */
+#define RE_BADPAT              2
+#define RE_ECOLLATE            3
+#define RE_ECTYPE              4
+#define RE_EESCAPE             5
+#define RE_ESUBREG             6
+#define RE_EBRACK              7
+#define RE_EPAREN              8
+#define RE_EBRACE              9
+#define RE_EBADBR              10
+#define RE_ERANGE              11
+#define RE_ESPACE              12
+#define RE_BADRPT              13
+#define RE_EMPTY               14
+#define RE_ASSERT              15
+#define RE_INVARG              16
+#define RE_ATOI                        255     /* Not used/supported */
+#define RE_ITOA                        0400    /* Not used/supported */
+
+
+/*
+ * Types
+ */
+
+/* (re)gular expression (mat)ch result */
+typedef struct _re_mat {
+    long rm_so;
+    long rm_eo;
+} re_mat;
+
+/* (re)gular expression (cod)e */
+typedef struct _re_cod {
+    unsigned char *cod;
+    int re_nsub;               /* Public member */
+    const char *re_endp;       /* Support for RE_PEND */
+} re_cod;
+
+
+/*
+ * Prototypes
+ */
+       /* compile the given pattern string
+        * returns 0 on success, error code otherwise */
+int recomp(re_cod *preg, const char *pattern, int flags);
+
+       /* execute the compiled pattern on the string.
+        * returns 0 if matched, RE_NOMATCH if failed, error code otherwise */
+int reexec(const re_cod *preg, const char *string,
+          int nmat, re_mat pmat[], int flags);
+
+       /* formats an error message for the given code in ebuffer */
+int reerror(int ecode, const re_cod *preg, char *ebuffer, int ebuffer_size);
+
+       /* frees the given parameter */
+void refree(re_cod *preg);
+
+
+#endif /* _re_h */
diff --git a/xedit/lisp/re/rec.c b/xedit/lisp/re/rec.c
new file mode 100644 (file)
index 0000000..d5f27ce
--- /dev/null
@@ -0,0 +1,1015 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/re/rec.c,v 1.3 2002/11/15 07:01:33 paulo Exp $ */
+
+#include "rep.h"
+
+/*
+ * Types
+ */
+
+/*  Information used while compiling the intermediate format of the re. */
+typedef struct _irec_info {
+    unsigned char *ptr;                /* Pointer in the given regex pattern */
+    unsigned char *end;                /* End of regex pattern */
+    int flags;                 /* Compile flags */
+    rec_alt *alt;              /* Toplevel first/single alternative */
+
+    rec_alt *palt;             /* Current alternative being compiled */
+    rec_grp *pgrp;             /* Current group, if any */
+    rec_pat *ppat;             /* Current pattern, if any */
+
+    /*  Number of open parenthesis, for error checking */
+    int nparens;
+
+    int ngrps;                 /* Number of groups, for backreference */
+
+    int ecode;
+} irec_info;
+
+
+/*
+ * Prototypes
+ */
+
+       /* (i)ntermediate (r)egular (e)xpression (c)ompile
+        *  Generates an intermediate stage compiled regex from
+        * the specified pattern argument. Basically builds an
+        * intermediate data structure to analyse and do syntax
+        * error checking.
+        */
+static void irec_simple_pattern(irec_info*, rec_pat_t);
+static void irec_literal_pattern(irec_info*, int);
+static void irec_case_literal_pattern(irec_info*, int);
+static void irec_open_group(irec_info*);
+static void irec_close_group(irec_info*);
+static void irec_range(irec_info*);
+static void irec_range_single(irec_info*, int);
+static void irec_range_complex(irec_info*, int, int);
+static void irec_escape(irec_info*);
+static void irec_simple_repetition(irec_info*, rec_rep_t);
+static void irec_complex_repetition(irec_info*);
+static void irec_add_repetition(irec_info*, rec_rep*);
+static void irec_free(irec_info*);
+static void irec_free_grp(rec_grp*);
+static void irec_free_pats(rec_pat*);
+
+
+/*
+ * Implementation
+ */
+rec_alt *
+irec_comp(const char *pattern, const char *endp, int flags, int *ecode)
+{
+    unsigned char *ptr;
+    rec_alt *alt;
+    irec_info inf;
+
+    if (pattern == NULL || endp < pattern) {
+       *ecode = RE_INVARG;
+       return (NULL);
+    }
+
+    if (endp == pattern) {
+       *ecode = RE_EMPTY;
+       return (NULL);
+    }
+
+    alt = calloc(1, sizeof(rec_alt));
+    if (alt == NULL) {
+       *ecode = RE_ESPACE;
+       return (NULL);
+    }
+
+    inf.ptr = (unsigned char*)pattern;
+    inf.end = (unsigned char*)endp;
+    inf.flags = flags;
+    inf.alt = inf.palt = alt;
+    inf.pgrp = NULL;
+    inf.ppat = NULL;
+    inf.nparens = inf.ngrps = 0;
+    inf.ecode = 0;
+
+    if (flags & RE_NOSPEC) {
+       /* Just searching for a character or substring */
+       for (; inf.ecode == 0 && inf.ptr < inf.end; inf.ptr++) {
+           if (!(flags & RE_ICASE) ||
+               (!isupper(*inf.ptr) && !islower(*inf.ptr)))
+               irec_literal_pattern(&inf, *inf.ptr);
+           else
+               irec_case_literal_pattern(&inf, *inf.ptr);
+       }
+    }
+    /* inf.ptr = inf.end is nul if flags & RE_NOSPEC */
+    for (; inf.ecode == 0 && inf.ptr < inf.end;) {
+       switch (*inf.ptr++) {
+           case '*':
+               irec_simple_repetition(&inf, Rer_AnyTimes);
+               break;
+           case '+':
+               irec_simple_repetition(&inf, Rer_AtLeast);
+               break;
+           case '?':
+               irec_simple_repetition(&inf, Rer_Maybe);
+               break;
+           case '.':
+               irec_simple_pattern(&inf, Rep_Any);
+               break;
+           case '^':
+               if (flags & RE_NEWLINE)
+                   /* It is up to the user decide if this can match */
+                   irec_simple_pattern(&inf, Rep_Bol);
+               else {
+                   for (ptr = inf.ptr - 1;
+                        ptr > (unsigned char*)pattern && *ptr == '('; ptr--)
+                       ;
+                   /* If at the start of a pattern */
+                   if (ptr == (unsigned char*)pattern || *ptr == '|')
+                       irec_simple_pattern(&inf, Rep_Bol);
+                   else
+                       /* In the middle of a pattern, treat as literal */
+                       irec_literal_pattern(&inf, '^');
+               }
+               break;
+           case '$':
+               if (flags & RE_NEWLINE)
+                   irec_simple_pattern(&inf, Rep_Eol);
+               else {
+                   /* Look ahead to check if is the last char of a group */
+                   for (ptr = inf.ptr; ptr < inf.end && *ptr == ')'; ptr++)
+                       ;
+                   if (*ptr == '\0' || *ptr == '|')
+                       /* Last character of pattern, an EOL match */
+                       irec_simple_pattern(&inf, Rep_Eol);
+                   else
+                       /* Normal character */
+                       irec_literal_pattern(&inf, '$');
+               }
+               break;
+           case '(':
+               irec_open_group(&inf);
+               break;
+           case ')':
+               /* Look ahead to check if need to close the group now */
+               ptr = inf.ptr;
+               if (*ptr != '*' && *ptr != '+' && *ptr != '?' && *ptr != '{')
+                   /* If a repetition does not follow */
+                   irec_close_group(&inf);
+               else if (inf.pgrp == NULL)
+                   /* A repetition follows, but current group is implicit */
+                   inf.ecode = RE_EPAREN;
+               else
+                   /* Can do this as next character is known */
+                   inf.ppat = NULL;
+               break;
+           case '[':
+               irec_range(&inf);
+               break;
+           case ']':
+               irec_literal_pattern(&inf, ']');
+               break;
+           case '{':
+               irec_complex_repetition(&inf);
+               break;
+           case '}':
+               irec_literal_pattern(&inf, '}');
+               break;
+           case '|':
+                   /* If first character in the pattern */
+               if (inf.ptr - 1 == (unsigned char*)pattern ||
+                   /* If last character in the pattern */
+                   inf.ptr >= inf.end ||
+                   /* If empty pattern */
+                   inf.ptr[0] == '|' ||
+                   inf.ptr[0] == ')')
+                   inf.ecode = RE_EMPTY;
+               else {
+                   rec_alt *alt = calloc(1, sizeof(rec_alt));
+
+                   if (alt) {
+                       alt->prev = inf.palt;
+                       inf.palt->next = alt;
+                       inf.palt = alt;
+                       inf.ppat = NULL;
+                   }
+                   else
+                       inf.ecode = RE_ESPACE;
+               }
+               break;
+           case '\\':
+               irec_escape(&inf);
+               break;
+           default:
+               if (!(flags & RE_ICASE) ||
+                   (!isupper(inf.ptr[-1]) && !islower(inf.ptr[-1])))
+                   irec_literal_pattern(&inf, inf.ptr[-1]);
+               else
+                   irec_case_literal_pattern(&inf, inf.ptr[-1]);
+               break;
+       }
+    }
+
+    /* Check if not all groups closed */
+    if (inf.ecode == 0 && inf.nparens)
+       inf.ecode = RE_EPAREN;
+
+    if (inf.ecode == 0)
+       inf.ecode = orec_comp(inf.alt, flags);
+
+    /* If an error generated */
+    if (inf.ecode) {
+       irec_free(&inf);
+       alt = NULL;
+    }
+
+    *ecode = inf.ecode;
+
+    return (alt);
+}
+
+void
+irec_free_alt(rec_alt *alt)
+{
+    rec_alt *next;
+
+    while (alt) {
+       next = alt->next;
+       irec_free_pats(alt->pat);
+       free(alt);
+       alt = next;
+    }
+}
+
+
+
+static void
+irec_simple_pattern(irec_info *inf, rec_pat_t type)
+{
+    rec_pat *pat;
+
+    /* Always add a new pattern to list */
+    if ((pat = calloc(1, sizeof(rec_pat))) == NULL) {
+       inf->ecode = RE_ESPACE;
+       return;
+    }
+
+    pat->type = type;
+    if ((pat->prev = inf->ppat) != NULL)
+       inf->ppat->next = pat;
+    else
+       inf->palt->pat = pat;
+    inf->ppat = pat;
+}
+
+static void
+irec_literal_pattern(irec_info *inf, int value)
+{
+    int length;
+    rec_pat *pat;
+    unsigned char chr, *str;
+
+       /* If there is a current pattern */
+    if (inf->ppat && inf->ppat->rep == NULL) {
+       switch (inf->ppat->type) {
+           case Rep_Literal:
+               /* Start literal string */
+               chr = inf->ppat->data.chr;
+               if ((str = malloc(16)) == NULL) {
+                   inf->ecode = RE_ESPACE;
+                   return;
+               }
+               inf->ppat->type = Rep_String;
+               inf->ppat->data.str = str;
+               str[0] = chr;
+               str[1] = value;
+               str[2] = '\0';
+               return;
+
+           case Rep_String:
+               /* Augments literal string */
+               length = strlen((char*)inf->ppat->data.str);
+               if ((length % 16) >= 14) {
+                   if ((str = realloc(inf->ppat->data.str,
+                                      length + 18)) == NULL) {
+                       inf->ecode = RE_ESPACE;
+                       return;
+                   }
+                   inf->ppat->data.str = str;
+               }
+               inf->ppat->data.str[length] = value;
+               inf->ppat->data.str[length + 1] = '\0';
+               return;
+
+           default:
+               /* Anything else is added as a new pattern list element */
+               break;
+       }
+    }
+
+    if ((pat = calloc(1, sizeof(rec_pat))) == NULL) {
+       inf->ecode = RE_ESPACE;
+       return;
+    }
+
+    pat->type = Rep_Literal;
+    pat->data.chr = value;
+    if ((pat->prev = inf->ppat) != NULL)
+       inf->ppat->next = pat;
+    else
+       inf->palt->pat = pat;
+    inf->ppat = pat;
+}
+
+static void
+irec_case_literal_pattern(irec_info *inf, int value)
+{
+    int length;
+    rec_pat *pat;
+    unsigned char plower, pupper, lower, upper, *str;
+
+    lower = tolower(value);
+    upper = toupper(value);
+
+       /* If there is a current pattern */
+    if (inf->ppat && inf->ppat->rep == NULL) {
+       switch (inf->ppat->type) {
+           case Rep_CaseLiteral:
+               /* Start case literal string */
+               plower = inf->ppat->data.cse.lower;
+               pupper = inf->ppat->data.cse.upper;
+               if ((str = malloc(32)) == NULL) {
+                   inf->ecode = RE_ESPACE;
+                   return;
+               }
+               inf->ppat->type = Rep_CaseString;
+               inf->ppat->data.str = str;
+               str[0] = plower;
+               str[1] = pupper;
+               str[2] = lower;
+               str[3] = upper;
+               str[4] = '\0';
+               return;
+
+           case Rep_CaseString:
+               /* Augments case literal string */
+               length = strlen((char*)inf->ppat->data.str);
+               if (((length) % 32) >= 28) {
+                   if ((str = realloc(inf->ppat->data.str,
+                                      length + 36)) == NULL) {
+                       inf->ecode = RE_ESPACE;
+                       return;
+                   }
+                   inf->ppat->data.str = str;
+               }
+               inf->ppat->data.str[length] = lower;
+               inf->ppat->data.str[length + 1] = upper;
+               inf->ppat->data.str[length + 2] = '\0';
+               return;
+
+           default:
+               /* Anything else is added as a new pattern list element */
+               break;
+       }
+    }
+
+    if ((pat = calloc(1, sizeof(rec_pat))) == NULL) {
+       inf->ecode = RE_ESPACE;
+       return;
+    }
+
+    pat->type = Rep_CaseLiteral;
+    pat->data.cse.lower = lower;
+    pat->data.cse.upper = upper;
+    pat->prev = inf->ppat;
+    if ((pat->prev = inf->ppat) != NULL)
+       inf->ppat->next = pat;
+    else
+       inf->palt->pat = pat;
+    inf->ppat = pat;
+}
+
+static void
+irec_open_group(irec_info *inf)
+{
+    rec_pat *pat;
+    rec_alt *alt;
+    rec_grp *grp;
+
+    if ((grp = calloc(1, sizeof(rec_grp))) == NULL) {
+       inf->ecode = RE_ESPACE;
+       return;
+    }
+
+    if ((pat = calloc(1, sizeof(rec_pat))) == NULL) {
+       free(grp);
+       inf->ecode = RE_ESPACE;
+       return;
+    }
+
+    if ((alt = calloc(1, sizeof(rec_alt))) == NULL) {
+       free(grp);
+       free(pat);
+       inf->ecode = RE_ESPACE;
+       return;
+    }
+
+    pat->type = Rep_Group;
+    pat->data.grp = grp;
+    grp->parent = pat;
+    grp->palt = inf->palt;
+    grp->pgrp = inf->pgrp;
+    grp->alt = alt;
+    grp->comp = 0;
+    if ((pat->prev = inf->ppat) != NULL)
+       inf->ppat->next = pat;
+    else
+       inf->palt->pat = pat;
+    inf->palt = alt;
+    inf->ppat = NULL;
+
+    /* Only toplevel parenthesis supported */
+    if (++inf->nparens == 1)
+       ++inf->ngrps;
+
+    inf->pgrp = grp;
+}
+
+static void
+irec_close_group(irec_info *inf)
+{
+    if (inf->pgrp == NULL) {
+       inf->ecode = RE_EPAREN;
+       return;
+    }
+
+    inf->palt = inf->pgrp->palt;
+    inf->ppat = inf->pgrp->parent;
+    inf->pgrp = inf->pgrp->pgrp;
+
+    --inf->nparens;
+}
+
+static void
+irec_range(irec_info *inf)
+{
+    int count;
+    rec_pat *pat;
+    rec_rng *rng;
+    int not = inf->ptr[0] == '^';
+
+    if (not)
+       ++inf->ptr;
+
+    pat = calloc(1, sizeof(rec_pat));
+    if (pat == NULL) {
+       inf->ecode = RE_ESPACE;
+       return;
+    }
+
+    rng = calloc(1, sizeof(rec_rng));
+    if (pat == NULL) {
+       free(pat);
+       inf->ecode = RE_ESPACE;
+       return;
+    }
+
+    pat->data.rng = rng;
+    pat->type = not ? Rep_RangeNot : Rep_Range;
+    if ((pat->prev = inf->ppat) != NULL)
+       inf->ppat->next = pat;
+    else
+       inf->palt->pat = pat;
+    inf->ppat = pat;
+
+    /* First pass, add everything seen */
+    for (count = 0; inf->ecode == 0; count++) {
+       /* If bracket not closed */
+       if (inf->ptr == inf->end) {
+           inf->ecode = RE_EBRACK;
+           return;
+       }
+       /* If not the first character */
+       else if (inf->ptr[0] == ']' && count)
+           break;
+       else {
+           /* If not a range of characters */
+           if (inf->ptr[1] != '-' || inf->ptr[2] == ']') {
+               irec_range_single(inf, inf->ptr[0]);
+               ++inf->ptr;
+           }
+           else {
+               if ((inf->flags & RE_NEWLINE) &&
+                   inf->ptr[0] < '\n' && inf->ptr[2] > '\n') {
+                   /*  Unless it is forced to be a delimiter, don't allow
+                    * a newline in a character range */
+                   if (inf->ptr[0] == '\n' - 1)
+                       irec_range_single(inf, inf->ptr[0]);
+                   else
+                       irec_range_complex(inf, inf->ptr[0], '\n' - 1);
+                   if (inf->ptr[2] == '\n' + 1)
+                       irec_range_single(inf, inf->ptr[2]);
+                   else
+                       irec_range_complex(inf, '\n' + 1, inf->ptr[2]);
+               }
+               else
+                   irec_range_complex(inf, inf->ptr[0], inf->ptr[2]);
+               inf->ptr += 3;
+           }
+       }
+    }
+
+    /* Skip ] */
+    ++inf->ptr;
+}
+
+static void
+irec_range_single(irec_info *inf, int value)
+{
+    if (value >= 0 && value <= 255)
+       inf->ppat->data.rng->range[value] = 1;
+
+    if (inf->flags & RE_ICASE) {
+       if (islower(value)) {
+           value = toupper(value);
+           if (value >= 0 && value <= 255)
+               inf->ppat->data.rng->range[value] = 1;
+       }
+       else if (isupper(value)) {
+           value = tolower(value);
+           if (value >= 0 && value <= 255)
+               inf->ppat->data.rng->range[value] = 1;
+       }
+    }
+}
+
+static void
+irec_range_complex(irec_info *inf, int chrf, int chrt)
+{
+    if (chrf > chrt) {
+       inf->ecode = RE_ERANGE;
+       return;
+    }
+
+    for (; chrf <= chrt; chrf++)
+       irec_range_single(inf, chrf);
+}
+
+static void
+irec_escape(irec_info *inf)
+{
+    rec_pat *pat;
+    unsigned char chr = inf->ptr[0];
+
+    if (chr == 0) {
+       inf->ecode = RE_EESCAPE;
+       return;
+    }
+    ++inf->ptr;
+    switch (chr) {
+       case 'o':
+           irec_simple_pattern(inf, Rep_Odigit);
+           break;
+       case 'O':
+           irec_simple_pattern(inf, Rep_OdigitNot);
+           break;
+       case 'd':
+           irec_simple_pattern(inf, Rep_Digit);
+           break;
+       case 'D':
+           irec_simple_pattern(inf, Rep_DigitNot);
+           break;
+       case 'x':
+           irec_simple_pattern(inf, Rep_Xdigit);
+           break;
+       case 'X':
+           irec_simple_pattern(inf, Rep_XdigitNot);
+           break;
+       case 's':
+           irec_simple_pattern(inf, Rep_Space);
+           break;
+       case 'S':
+           irec_simple_pattern(inf, Rep_SpaceNot);
+           break;
+       case 't':
+           irec_simple_pattern(inf, Rep_Tab);
+           break;
+       case 'n':
+           irec_simple_pattern(inf, Rep_Newline);
+           break;
+       case 'l':
+           irec_simple_pattern(inf, Rep_Lower);
+           break;
+       case 'u':
+           irec_simple_pattern(inf, Rep_Upper);
+           break;
+       case 'w':
+           irec_simple_pattern(inf, Rep_Alnum);
+           break;
+       case 'W':
+           irec_simple_pattern(inf, Rep_AlnumNot);
+           break;
+       case 'c':
+           irec_simple_pattern(inf, Rep_Control);
+           break;
+       case 'C':
+           irec_simple_pattern(inf, Rep_ControlNot);
+           break;
+       case '<':
+           irec_simple_pattern(inf, Rep_Bow);
+           break;
+       case '>':
+           irec_simple_pattern(inf, Rep_Eow);
+           break;
+       case '1':       case '2':       case '3':
+       case '4':       case '5':       case '6':
+       case '7':       case '8':       case '9':
+           if ((inf->flags & RE_NOSUB) || (chr -= '1') >= inf->ngrps) {
+               inf->ecode = RE_ESUBREG;
+               return;
+           }
+           if ((pat = calloc(1, sizeof(rec_pat))) == NULL) {
+               inf->ecode = RE_ESPACE;
+               return;
+           }
+           pat->type = Rep_Backref;
+           pat->data.chr = chr;
+           pat->prev = inf->ppat;
+           if (inf->ppat)
+               inf->ppat->next = pat;
+           else
+               inf->palt->pat = pat;
+           inf->ppat = pat;
+           break;
+
+       /* True literals */
+       case '0':
+           irec_literal_pattern(inf, '\0');
+           break;
+       case 'a':
+           irec_literal_pattern(inf, '\a');
+           break;
+       case 'b':
+           irec_literal_pattern(inf, '\b');
+           break;
+       case 'f':
+           irec_literal_pattern(inf, '\f');
+           break;
+       case 'r':
+           irec_literal_pattern(inf, '\r');
+           break;
+       case 'v':
+           irec_literal_pattern(inf, '\v');
+           break;
+
+       default:
+           /* Don't check if case insensitive regular expression */
+           irec_literal_pattern(inf, chr);
+           break;
+    }
+}
+
+static void
+irec_simple_repetition(irec_info *inf, rec_rep_t type)
+{
+    rec_rep *rep;
+
+       /* If nowhere to add repetition */
+    if ((inf->pgrp == NULL && inf->ppat == NULL) ||
+       /* If repetition already added to last/current pattern */
+       (inf->pgrp == NULL && inf->ppat->rep != NULL) ||
+       /* If repetition already added to last/current group */
+       (inf->ppat == NULL && inf->pgrp->parent->rep != NULL)) {
+       inf->ecode = RE_BADRPT;
+       return;
+    }
+
+    if ((rep = calloc(1, sizeof(rec_rep))) == NULL) {
+       inf->ecode = RE_ESPACE;
+       return;
+    }
+
+    rep->type = type;
+    irec_add_repetition(inf, rep);
+}
+
+static void
+irec_complex_repetition(irec_info *inf)
+{
+    int exact;
+    rec_rep *rep;
+    long mine, maxc;
+    unsigned char *end;
+
+       /* If nowhere to add repetition */
+    if ((inf->pgrp == NULL && inf->ppat == NULL) ||
+       /* If repetition already added to last/current pattern */
+       (inf->pgrp == NULL && inf->ppat->rep != NULL) ||
+       /* If repetition already added to last/current group */
+       (inf->ppat == NULL && inf->pgrp->parent->rep != NULL)) {
+       inf->ecode = RE_EBADBR;
+       return;
+    }
+
+    exact = 0;
+    mine = maxc = -1;
+    if (inf->ptr[0] == ',')
+       /* Specify max number of ocurrences only */
+       goto domax;
+    else if (!isdigit(inf->ptr[0]))
+       goto badbr;
+
+    mine = strtol((char*)inf->ptr, (char**)&end, 10);
+    inf->ptr = end;
+    if (inf->ptr[0] == '}') {
+       exact = 1;
+       ++inf->ptr;
+       goto redone;
+    }
+    else if (inf->ptr[0] != ',')
+       goto badbr;
+
+domax:
+       /* Add one to skip comma */
+    ++inf->ptr;
+    if (inf->ptr[0] == '}') {
+       ++inf->ptr;
+       goto redone;
+    }
+    else if (!isdigit(inf->ptr[0]))
+       goto badbr;
+    maxc = strtol((char*)inf->ptr, (char**)&end, 10);
+    inf->ptr = end;
+    if (inf->ptr[0] != '}')
+       goto badbr;
+    ++inf->ptr;
+
+redone:
+    if (mine == maxc) {
+       maxc = -1;
+       exact = 1;
+    }
+
+    /* Check range and if min-max parameters are valid */
+    if (mine >= 255 || maxc >= 255 ||
+       (mine >= 0 && maxc >= 0 && mine > maxc))
+       goto badbr;
+
+    /* Check for noop */
+    if (exact && mine == 1)
+       return;
+
+    if ((rep = calloc(1, sizeof(rec_rep))) == NULL) {
+       inf->ecode = RE_ESPACE;
+       return;
+    }
+
+       /* Convert {0,1} to ? */
+    if (mine == 0 && maxc == 1)
+       rep->type = Rer_Maybe;
+    else if (exact) {
+       rep->type = Rer_Exact;
+       rep->mine = mine;
+    }
+       /* Convert {0,} to * */
+    else if (mine == 0 && maxc == -1)
+       rep->type = Rer_AnyTimes;
+       /* Convert {1,} to + */
+    else if (mine == 1 && maxc == -1)
+       rep->type = Rer_AtLeast;
+    else if (maxc == -1) {
+       rep->type = Rer_Min;
+       rep->mine = mine;
+    }
+    else if (mine < 1) {
+       rep->type = Rer_Max;
+       rep->maxc = maxc;
+    }
+    else {
+       rep->type = Rer_MinMax;
+       rep->mine = mine;
+       rep->maxc = maxc;
+    }
+
+    irec_add_repetition(inf, rep);
+
+    return;
+
+badbr:
+    inf->ecode = RE_EBADBR;
+}
+
+/*  The rep argument is allocated and has no reference yet,
+ * if something fails it must be freed before returning.
+ */
+static void
+irec_add_repetition(irec_info *inf, rec_rep *rep)
+{
+    int length;
+    rec_pat *pat;
+    rec_grp *grp;
+    rec_rep_t rept;
+    unsigned char value, upper;
+
+    rept = rep->type;
+
+    if (inf->ppat == NULL) {
+       rec_pat *any;
+       rec_grp *grp = inf->pgrp;
+
+       if (rept == Rer_AnyTimes || rept == Rer_Maybe || rept == Re_AtLeast) {
+           /* Convert (.)* to (.*), ((.))* not handled and may not match */
+           any = NULL;
+
+           if (grp->alt && grp->alt->pat) {
+               for (any = grp->alt->pat; any->next; any = any->next)
+                   ;
+               switch (any->type) {
+                   case Rep_Any:
+                       break;
+                   case Rep_AnyAnyTimes:
+                   case Rep_AnyMaybe:
+                   case Rep_AnyAtLeast:
+                       free(rep);
+                       inf->ecode = RE_BADRPT;
+                       return;
+                   default:
+                       any = NULL;
+                       break;
+               }
+           }
+           if (any) {
+               free(rep);
+               rep = NULL;
+               any->type = (rept == Rer_AnyTimes) ? Rep_AnyAnyTimes :
+                           (rept == Rer_AtLeast) ? Rep_AnyAtLeast :
+                           Rep_AnyMaybe;
+               while (grp) {
+                   ++grp->comp;
+                   grp = grp->pgrp;
+               }
+           }
+       }
+       inf->pgrp->parent->rep = rep;
+       irec_close_group(inf);
+       return;
+    }
+
+    switch (inf->ppat->type) {
+       case Rep_Bol:
+       case Rep_Eol:
+       case Rep_Bow:
+       case Rep_Eow:
+       case Rep_AnyAnyTimes:
+       case Rep_AnyMaybe:
+       case Rep_AnyAtLeast:
+           /* Markers that cannot repeat */
+           free(rep);
+           inf->ecode = RE_BADRPT;
+           return;
+
+       case Rep_Any:
+           grp = inf->pgrp;
+           free(rep);
+           if (rept == Rer_AnyTimes ||
+               rept == Rer_Maybe ||
+               rept == Rer_AtLeast) {
+               inf->ppat->type = (rept == Rer_AnyTimes) ?
+                                  Rep_AnyAnyTimes :
+                                 (rept == Rer_Maybe) ?
+                                  Rep_AnyMaybe :
+                                  Rep_AnyAtLeast;
+               while (grp) {
+                   ++grp->comp;
+                   grp = grp->pgrp;
+               }
+           }
+           else
+               /* XXX Not (yet) implemented */
+               inf->ecode = RE_BADRPT;
+           rep = NULL;
+           break;
+
+       case Rep_String:
+           if ((pat = calloc(1, sizeof(rec_pat))) == NULL) {
+               free(rep);
+               inf->ecode = RE_ESPACE;
+               return;
+           }
+
+           length = strlen((char*)inf->ppat->data.str);
+           pat->type = Rep_Literal;
+           pat->prev = inf->ppat;
+           pat->data.chr = inf->ppat->data.str[length - 1];
+           if (length == 2) {
+               /* Must convert to two Rep_Literals */
+               value = inf->ppat->data.str[0];
+               free(inf->ppat->data.str);
+               inf->ppat->data.chr = value;
+               inf->ppat->type = Rep_Literal;
+           }
+           else
+               /* Must remove last character from string */
+               inf->ppat->data.str[length - 1] = '\0';
+           inf->ppat->next = pat;
+           inf->ppat = pat;
+           break;
+
+       case Rep_CaseString:
+           if ((pat = calloc(1, sizeof(rec_pat))) == NULL) {
+               free(rep);
+               inf->ecode = RE_ESPACE;
+               return;
+           }
+
+           length = strlen((char*)inf->ppat->data.str);
+           pat->type = Rep_CaseLiteral;
+           pat->prev = inf->ppat;
+           pat->data.cse.lower = inf->ppat->data.str[length - 2];
+           pat->data.cse.upper = inf->ppat->data.str[length - 1];
+           if (length == 4) {
+               /* Must convert to two Rep_CaseLiterals */
+               value = inf->ppat->data.str[0];
+               upper = inf->ppat->data.str[1];
+               free(inf->ppat->data.str);
+               inf->ppat->data.cse.lower = value;
+               inf->ppat->data.cse.upper = upper;
+               inf->ppat->next = pat;
+               inf->ppat->type = Rep_CaseLiteral;
+           }
+           else
+               /* Must remove last character pair from string */
+               inf->ppat->data.str[length - 2] = '\0';
+           inf->ppat->next = pat;
+           inf->ppat = pat;
+           break;
+
+       default:
+           /* Anything else does not need special handling */
+           break;
+    }
+
+    inf->ppat->rep = rep;
+}
+
+static void
+irec_free(irec_info *inf)
+{
+    irec_free_alt(inf->alt);
+}
+
+static void
+irec_free_grp(rec_grp *grp)
+{
+    if (grp->alt)
+       irec_free_alt(grp->alt);
+    free(grp);
+}
+
+static void
+irec_free_pats(rec_pat *pat)
+{
+    rec_pat *next;
+    rec_pat_t rect;
+
+    while (pat) {
+       next = pat->next;
+       if (pat->rep)
+           free(pat->rep);
+       rect = pat->type;
+       if (rect == Rep_Range || rect == Rep_RangeNot)
+           free(pat->data.rng);
+       else if (rect == Rep_Group)
+           irec_free_grp(pat->data.grp);
+       else if (rect == Rep_StringList)
+           orec_free_stl(pat->data.stl);
+       free(pat);
+       pat = next;
+    }
+}
diff --git a/xedit/lisp/re/reo.c b/xedit/lisp/re/reo.c
new file mode 100644 (file)
index 0000000..af47b50
--- /dev/null
@@ -0,0 +1,685 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/re/reo.c,v 1.8 2002/09/29 02:55:01 paulo Exp $ */
+
+#include "rep.h"
+
+/*
+ *  This file is a placeholder to add code to analyse and optimize the
+ * intermediate data structure generated in rep.c.
+ *  Character ranges are optimized while being generated.
+ */
+
+/*
+ * Types
+ */
+typedef struct _orec_inf {
+    rec_alt *alt;                      /* Main alternatives list */
+    rec_grp *grp;                      /* Current group pointer */
+    int flags;
+    int ecode;
+} orec_inf;
+
+/*
+ * Prototypes
+ */
+static int orec_alt(orec_inf*, rec_alt*);
+static int orec_pat(orec_inf*, rec_pat*);
+static int orec_grp(orec_inf*, rec_grp*);
+static int orec_pat_bad_rpt(orec_inf*, rec_pat*);
+static int orec_pat_bad_forward_rpt(orec_inf*, rec_pat*);
+static int orec_pat_rng(orec_inf*, rec_pat*);
+static int orec_pat_cse(orec_inf*, rec_pat*);
+static int orec_pat_cse_can(orec_inf*, rec_pat*);
+static int orec_str_list(orec_inf*, rec_alt*, int, int);
+
+/*
+ * Initialization
+ */
+extern unsigned char re__alnum[256];
+extern unsigned char re__odigit[256];
+extern unsigned char re__ddigit[256];
+extern unsigned char re__xdigit[256];
+extern unsigned char re__control[256];
+
+/*
+ * Implementation
+ */
+int
+orec_comp(rec_alt *alt, int flags)
+{
+    orec_inf inf;
+
+    inf.alt = alt;
+    inf.grp = NULL;
+    inf.flags = flags;
+    inf.ecode = 0;
+
+    orec_alt(&inf, alt);
+
+    return (inf.ecode);
+}
+
+void
+orec_free_stl(rec_stl *stl)
+{
+    int i;
+
+    for (i = 0; i < stl->nstrs; i++) {
+       if (stl->lens[i] > 2)
+           free(stl->strs[i]);
+    }
+
+    free(stl->lens);
+    free(stl->strs);
+    free(stl);
+}
+
+
+static int
+orec_alt(orec_inf *inf, rec_alt *alt)
+{
+    if (alt) {
+       rec_alt *ptr = alt;
+       int ret, count = 0, str = 1, cstr = 1, lits = 0, clits = 0;
+
+       /* Check if can build a string list */
+       if (ptr->next) {
+           /* If more than one alternative */
+           while (ptr && (str || cstr)) {
+               if (ptr->pat == NULL || ptr->pat->rep != NULL) {
+                   cstr = str = 0;
+                   break;
+               }
+               if ((inf->flags & RE_ICASE)) {
+                   if (!(ret = orec_pat_cse_can(inf, ptr->pat))) {
+                       cstr = str = 0;
+                       break;
+                   }
+                   if (ret == 1)
+                       ++lits;
+                   else if (ret == 2)
+                       ++clits;
+               }
+               else if (ptr->pat->next == NULL) {
+                   if (ptr->pat->type != Rep_String) {
+                       if (ptr->pat->type != Rep_Literal) {
+                           str = 0;
+                           if (ptr->pat->type != Rep_CaseString) {
+                               if (ptr->pat->type != Rep_CaseLiteral)
+                                   cstr = 0;
+                               else
+                                   ++clits;
+                           }
+                           else if (strlen((char*)ptr->pat->data.str) >= 255)
+                               str = cstr = 0;
+                       }
+                       else
+                           ++lits;
+                   }
+                   else if (strlen((char*)ptr->pat->data.str) >= 255)
+                       str = cstr = 0;
+               }
+               else {
+                   str = cstr = 0;
+                   break;
+               }
+               if (++count >= 255)
+                   str = cstr = 0;
+               ptr = ptr->next;
+           }
+
+           if (str || cstr) {
+               if (inf->flags & RE_ICASE) {
+                   for (ptr = alt; ptr; ptr = ptr->next) {
+                       if (orec_pat_cse(inf, ptr->pat))
+                           return (inf->ecode);
+                   }
+                   str = 0;
+               }
+               return (orec_str_list(inf, alt, str, count));
+           }
+       }
+       else if (alt == inf->alt && alt->pat && alt->pat->rep == NULL) {
+           /* If the toplevel single alternative */
+           switch (alt->pat->type) {
+               /*  One of these will always be true for RE_NOSPEC,
+                * but can also be optimized for simple patterns */
+               case Rep_Literal:
+                   alt->pat->type = Rep_SearchLiteral;
+                   break;
+               case Rep_CaseLiteral:
+                   alt->pat->type = Rep_SearchCaseLiteral;
+                   break;
+               case Rep_String:
+                   alt->pat->type = Rep_SearchString;
+                   break;
+               case Rep_CaseString:
+                   alt->pat->type = Rep_SearchCaseString;
+                   break;
+               default:
+                   break;
+           }
+       }
+
+       while (alt) {
+           orec_pat(inf, alt->pat);
+           alt = alt->next;
+       }
+    }
+
+    return (inf->ecode);
+}
+
+static int
+orec_pat(orec_inf *inf, rec_pat *pat)
+{
+    rec_pat *next;
+
+    while (pat) {
+       switch (pat->type) {
+           case Rep_AnyAnyTimes:
+               if (pat->next == NULL) {
+                   rec_grp *grp = inf->grp;
+
+                   next = NULL;
+                   while (grp) {
+                       next = grp->parent->next;
+                       /* Cannot check if is .*$ as the input
+                        * may be a substring */
+                       if (next)
+                           break;
+                       grp = grp->pgrp;
+                   }
+                   if (next == NULL) {
+                       /*    <re>.*    */
+                       pat->type = Rep_AnyEatAnyTimes;
+                       grp = inf->grp;
+                       while (grp) {
+                           --grp->comp;
+                           next = grp->parent->next;
+                           if (next)
+                               break;
+                           grp = grp->pgrp;
+                       }
+                   }
+                   else if (orec_pat_bad_rpt(inf, next))
+                       return (inf->ecode);
+               }
+               else if (orec_pat_bad_rpt(inf, pat->next))
+                   return (inf->ecode);
+               break;
+           case Rep_AnyMaybe:
+               if (pat->next == NULL) {
+                   rec_grp *grp = inf->grp;
+
+                   next = NULL;
+                   while (grp) {
+                       next = grp->parent->next;
+                       if (next)
+                           break;
+                       grp = grp->pgrp;
+                   }
+                   if (next == NULL) {
+                       /*    <re>.?    */
+                       pat->type = Rep_AnyEatMaybe;
+                       grp = inf->grp;
+                       while (grp) {
+                           --grp->comp;
+                           next = grp->parent->next;
+                           if (next)
+                               break;
+                           grp = grp->pgrp;
+                       }
+                   }
+                   else if (orec_pat_bad_rpt(inf, next))
+                       return (inf->ecode);
+               }
+               else if (orec_pat_bad_rpt(inf, pat->next))
+                   return (inf->ecode);
+               break;
+           case Rep_AnyAtLeast:
+               if (pat->next == NULL) {
+                   rec_grp *grp = inf->grp;
+
+                   next = NULL;
+                   while (grp) {
+                       next = grp->parent->next;
+                       if (next)
+                           break;
+                       grp = grp->pgrp;
+                   }
+                   if (next == NULL) {
+                       /*    <re>.+    */
+                       pat->type = Rep_AnyEatAtLeast;
+                       grp = inf->grp;
+                       while (grp) {
+                           --grp->comp;
+                           next = grp->parent->next;
+                           if (next)
+                               break;
+                           grp = grp->pgrp;
+                       }
+                   }
+                   else if (orec_pat_bad_rpt(inf, next))
+                       return (inf->ecode);
+               }
+               else if (orec_pat_bad_rpt(inf, pat->next))
+                   return (inf->ecode);
+               break;
+           case Rep_Range:
+           case Rep_RangeNot:
+               orec_pat_rng(inf, pat);
+               break;
+           case Rep_Group:
+               orec_grp(inf, pat->data.grp);
+               break;
+           default:
+               break;
+       }
+       pat = pat->next;
+    }
+
+    return (inf->ecode);
+}
+
+static int
+orec_pat_bad_rpt(orec_inf *inf, rec_pat *pat)
+{
+    switch (pat->type) {
+       /* Not really an error, but aren't supported by the library.
+        * Includes:  .*.*, .+<re>?  .*<re>*, (.*)(<re>*), etc.
+        */
+
+       /* Not a repetition, but mathes anything... */
+       case Rep_Any:
+
+       /* Zero length matches */
+       case Rep_Eol:
+           if (!(inf->flags & RE_NEWLINE))
+               break;
+       case Rep_Bol:
+       case Rep_Bow:
+       case Rep_Eow:
+
+       /* Repetitions */
+       case Rep_AnyAnyTimes:
+       case Rep_AnyMaybe:
+       case Rep_AnyAtLeast:
+           inf->ecode = RE_BADRPT;
+           break;
+
+       /* Check if the first group element is a complex pattern */
+       case Rep_Group:
+           if (pat->rep == NULL) {
+               if (pat->data.grp->alt) {
+                   for (pat = pat->data.grp->alt->pat; pat; pat = pat->next) {
+                       if (orec_pat_bad_rpt(inf, pat))
+                           break;
+                   }
+               }
+               break;
+           }
+           /*FALLTHROUGH*/
+       default:
+           if (pat->rep)
+               inf->ecode = RE_BADRPT;
+           break;
+    }
+
+    if (!inf->ecode && pat && pat->next)
+       orec_pat_bad_forward_rpt(inf, pat->next);
+
+    return (inf->ecode);
+}
+
+static int
+orec_pat_bad_forward_rpt(orec_inf *inf, rec_pat *pat)
+{
+    if (pat->rep) {
+       switch (pat->rep->type) {
+           case Rer_MinMax:
+               if (pat->rep->mine > 0)
+                   break;
+           case Rer_AnyTimes:
+           case Rer_Maybe:
+           case Rer_Max:
+               inf->ecode = RE_BADRPT;
+           default:
+               break;
+       }
+    }
+    else if (pat->type == Rep_Group &&
+            pat->data.grp->alt &&
+            pat->data.grp->alt->pat)
+       orec_pat_bad_forward_rpt(inf, pat->data.grp->alt->pat);
+
+    return (inf->ecode);
+}
+
+static int
+orec_grp(orec_inf *inf, rec_grp *grp)
+{
+    rec_grp *prev = inf->grp;
+
+    inf->grp = grp;
+    orec_alt(inf, grp->alt);
+    /* Could also just say: inf->grp = grp->gparent */
+    inf->grp = prev;
+
+    return (inf->ecode);
+}
+
+static int
+orec_pat_rng(orec_inf *inf, rec_pat *pat)
+{
+    int i, j[2], count;
+    rec_pat_t type = pat->type;
+    unsigned char *range = pat->data.rng->range;
+
+    for (i = count = j[0] = j[1] = 0; i < 256; i++) {
+       if (range[i]) {
+           if (count == 2) {
+               ++count;
+               break;
+           }
+           j[count++] = i;
+       }
+    }
+
+    if (count == 1 ||
+       (count == 2 &&
+        ((islower(j[0]) && toupper(j[0]) == j[1]) ||
+         (isupper(j[0]) && tolower(j[0]) == j[1])))) {
+       free(pat->data.rng);
+       if (count == 1) {
+           pat->data.chr = j[0];
+           pat->type = type == Rep_Range ? Rep_Literal : Rep_LiteralNot;
+       }
+       else {
+           pat->data.cse.upper = j[0];
+           pat->data.cse.lower = j[1];
+           pat->type = type == Rep_Range ? Rep_CaseLiteral : Rep_CaseLiteralNot;
+       }
+    }
+    else {
+       if (memcmp(re__alnum, range, 256) == 0)
+           type = type == Rep_Range ? Rep_Alnum : Rep_AlnumNot;
+       else if (memcmp(re__odigit, range, 256) == 0)
+           type = type == Rep_Range ? Rep_Odigit : Rep_OdigitNot;
+       else if (memcmp(re__ddigit, range, 256) == 0)
+           type = type == Rep_Range ? Rep_Digit : Rep_DigitNot;
+       else if (memcmp(re__xdigit, range, 256) == 0)
+           type = type == Rep_Range ? Rep_Xdigit : Rep_XdigitNot;
+       else if (memcmp(re__control, range, 256) == 0)
+           type = type == Rep_Range ? Rep_Control : Rep_ControlNot;
+
+       if (type != pat->type) {
+           free(pat->data.rng);
+           pat->type = type;
+       }
+    }
+
+    return (inf->ecode);
+}
+
+/*  Join patterns if required, will only fail on memory allocation failure:
+ */
+static int
+orec_pat_cse(orec_inf *inf, rec_pat *pat)
+{
+    rec_pat_t type;
+    int i, len, length;
+    rec_pat *ptr, *next;
+    unsigned char *str, *tofree;
+
+    if (pat->next == NULL && pat->type == Rep_CaseString)
+       return (inf->ecode);
+
+    type = Rep_CaseString;
+
+    /* First calculate how many bytes will be required */
+    for (ptr = pat, length = 1; ptr; ptr = ptr->next) {
+       switch (ptr->type) {
+           case Rep_Literal:
+               length += 2;
+               break;
+           case Rep_String:
+               length += strlen((char*)ptr->data.str) << 1;
+               break;
+           case Rep_CaseLiteral:
+               length += 2;
+               break;
+           case Rep_CaseString:
+               length += strlen((char*)ptr->data.str);
+               break;
+           default:
+               break;
+       }
+    }
+
+    if ((str = malloc(length)) == NULL)
+       return (inf->ecode = RE_ESPACE);
+
+    for (ptr = pat, length = 0; ptr; ptr = next) {
+       tofree = NULL;
+       next = ptr->next;
+       switch (ptr->type) {
+           case Rep_Literal:
+               str[length++] = ptr->data.chr;
+               str[length++] = ptr->data.chr;
+               break;
+           case Rep_String:
+               tofree = ptr->data.str;
+               len = strlen((char*)tofree);
+               for (i = 0; i < len; i++) {
+                   str[length++] = tofree[i];
+                   str[length++] = tofree[i];
+               }
+               break;
+           case Rep_CaseLiteral:
+               str[length++] = ptr->data.cse.lower;
+               str[length++] = ptr->data.cse.upper;
+               break;
+           case Rep_CaseString:
+               tofree = ptr->data.str;
+               len = strlen((char*)tofree);
+               memcpy(str + length, tofree, len);
+               length += len;
+               break;
+           default:
+               break;
+       }
+       if (tofree)
+           free(tofree);
+       if (ptr != pat)
+           free(ptr);
+    }
+    str[length] = '\0';
+
+    pat->type = type;
+    pat->data.str = str;
+    pat->next = NULL;
+
+    return (inf->ecode);
+}
+
+/*  Return 0 if the patterns in the list cannot be merged, 1 if will
+ * be a simple string, 2 if a case string.
+ *  This is useful when building an alternative list that is composed
+ * only of strings, but the regex is case insensitive, in wich case
+ * the first pass may have splited some patterns, but if it is a member
+ * of an alternatives list, the cost of using a string list is smaller */
+static int
+orec_pat_cse_can(orec_inf *inf, rec_pat *pat)
+{
+    int ret;
+
+    if (pat == NULL)
+       return (0);
+
+    for (ret = 1; pat; pat = pat->next) {
+       if (pat->rep)
+           return (0);
+       switch (pat->type) {
+           case Rep_Literal:
+           case Rep_String:
+               break;
+           case Rep_CaseLiteral:
+           case Rep_CaseString:
+               ret = 2;
+               break;
+           default:
+               return (0);
+       }
+    }
+
+    return (ret);
+}
+
+
+/*  XXX If everything is a (case) byte, the pattern should be
+ * [abcde] instead of a|b|c|d|e (or [aAbBcCdDeE] instead of aA|bB|cC|dD|eE)
+ * as a string list works fine, but as a character range
+ * should be faster, and maybe could be converted here. But not
+ * very important, if performance is required, it should have already
+ * been done in the pattern.
+ */
+static int
+orec_str_list(orec_inf *inf, rec_alt *alt, int str, int count)
+{
+    rec_stl *stl;
+    rec_pat *pat;
+    rec_alt *ptr, *next;
+    int i, j, tlen, len, is;
+
+    if ((stl = calloc(1, sizeof(rec_stl))) == NULL)
+       return (inf->ecode = RE_ESPACE);
+
+    if ((stl->lens = malloc(sizeof(unsigned char) * count)) == NULL) {
+       free(stl);
+       return (inf->ecode = RE_ESPACE);
+    }
+
+    if ((stl->strs = malloc(sizeof(char*) * count)) == NULL) {
+       free(stl->lens);
+       free(stl);
+       return (inf->ecode = RE_ESPACE);
+    }
+
+    if ((pat = calloc(1, sizeof(rec_pat))) == NULL) {
+       free(stl->strs);
+       free(stl->lens);
+       free(stl);
+       return (inf->ecode = RE_ESPACE);
+    }
+
+    pat->data.stl = stl;
+    pat->type = Rep_StringList;
+    stl->type = str ? Resl_StringList : Resl_CaseStringList;
+    for (i = tlen = 0, ptr = alt; i < count; i++) {
+       next = ptr->next;
+       switch (ptr->pat->type) {
+           case Rep_Literal:
+               is = len = 1;
+               break;
+           case Rep_CaseLiteral:
+               is = len = 2;
+               break;
+           default:
+               is = 0;
+               len = strlen((char*)ptr->pat->data.str);
+               break;
+       }
+       tlen += len;
+       stl->lens[i] = len;
+       if (!is) {
+           if (len > 2)
+               stl->strs[i] = ptr->pat->data.str;
+           else {
+               if (len == 1)
+                   stl->strs[i] = (void*)(long)(ptr->pat->data.str[0]);
+               else
+                   stl->strs[i] = (void*)(long)
+                                  (ptr->pat->data.str[0] |
+                                   ((int)ptr->pat->data.str[1] << 8));
+               free(ptr->pat->data.str);
+           }
+       }
+       else {
+           if (is == 1)
+               stl->strs[i] = (void*)(long)ptr->pat->data.chr;
+           else
+               stl->strs[i] = (void*)(long)
+                              (ptr->pat->data.cse.lower |
+                               (ptr->pat->data.cse.upper << 8));
+       }
+       free(ptr->pat);
+       if (i)
+           free(ptr);
+       ptr = next;
+    }
+    stl->tlen = tlen;
+    stl->nstrs = count;
+
+    alt->pat = pat;
+    alt->next = NULL;
+
+    {
+       int li, lj;
+       unsigned char ci, cj, *str;
+
+       /*  Don't need a stable sort, there shouldn't be duplicated strings,
+        * but don't check for it either. Only need to make sure that all
+        * strings that start with the same byte are together */
+       for (i = 0; i < count; i++) {
+           li = stl->lens[i];
+           ci = li > 2 ? stl->strs[i][0] : (long)stl->strs[i] & 0xff;
+           for (j = i + 1; j < count; j++) {
+               lj = stl->lens[j];
+               cj = lj > 2 ? stl->strs[j][0] : (long)stl->strs[j] & 0xff;
+               if ((count >= LARGE_STL_COUNT && cj < ci) ||
+                   (cj == ci && lj > li)) {
+                   /* If both strings start with the same byte,
+                    * put the longer first */
+                   str = stl->strs[j];
+                   stl->strs[j] = stl->strs[i];
+                   stl->strs[i] = str;
+                   stl->lens[j] = li;
+                   stl->lens[i] = lj;
+                   li ^= lj; lj ^= li; li ^= lj;
+                   ci ^= cj; cj ^= ci; ci ^= cj;
+               }
+           }
+       }
+    }
+
+    return (inf->ecode);
+}
diff --git a/xedit/lisp/re/rep.h b/xedit/lisp/re/rep.h
new file mode 100644 (file)
index 0000000..afd13ed
--- /dev/null
@@ -0,0 +1,369 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/re/rep.h,v 1.2 2002/11/15 07:01:33 paulo Exp $ */
+
+#include "re.h"
+
+#ifndef _rep_h
+#define _rep_h
+
+/*
+ * Local defines
+ */
+
+#ifdef MIN
+#undef MIN
+#endif
+#define MIN(a, b)      ((a) < (b) ? (a) : (b))
+
+#ifdef MAX
+#undef MAX
+#endif
+#define MAX(a, b)      ((a) > (b) ? (a) : (b))
+
+/*  This value can not be larger than 255, a depth value is the nesting of
+ * repetition operations and alternatives. The number of nested parenthesis
+ * does not matter, but a repetition on the pattern inside the parenthesis
+ * does. Note also that you cannot have more than 9 parenthesis pairs in
+ * an expression.
+ *  Depth is always at least 1. So for MAX_DEPTH 8, it is only allowed
+ * 7 complex repetitions. A complex repetition is a dot followed by an
+ * repetition operator. It is called a complex repetition because dot
+ * matches anything but the empty string, so the engine needs to test
+ * all possible combinations until the end of the string is found.
+ *  Repetitions like .* use one depth until the end of the string is found,
+ * for example a.*b.*c.*d has depth 4, while a*b*c*d has depth 2.
+ */
+#define MAX_DEPTH      8
+
+/*  Minimum number of strings to generate a "large" string list, that is,
+ * sort the strings and allocate 512 extra bytes to map the first string
+ * with a given initial byte. */
+#define LARGE_STL_COUNT        16
+
+/*
+ * Local types
+ */
+/* Intermediate compilation types declaration */
+       /* (r)egular (e)xpression (c)ompile (c)a(se) */
+typedef struct _rec_cse rec_cse;
+
+       /* (r)egular (e)xpression (c)ompile (r)a(ng)e */
+typedef struct _rec_rng rec_rng;
+
+       /* (r)egular (e)xpression (c)ompile (pat)tern */
+typedef struct _rec_pat rec_pat;
+
+       /* (r)egular (e)xpression (c)ompile (rep)etition */
+typedef struct _rec_rep rec_rep;
+
+       /* (r)egular (e)xpression (c)ompile (gr)ou(p) */
+typedef struct _rec_grp rec_grp;
+
+       /* (r)egular (e)xpression (c)ompile (alt)ernatives */
+typedef struct _rec_alt rec_alt;
+
+
+/* Optimization types */
+       /* (r)egular (e)xpression (c)ompile (st)ring (l)ist */
+typedef struct _rec_stl rec_stl;
+
+/* Final compilation and execution types */
+       /* (re)gular expression (inf)ormation */
+typedef struct _re_inf re_inf;
+
+       /* (re)gular expression (eng)ine */
+typedef struct _re_eng re_eng;
+
+
+/* Codes used by the engine */
+typedef enum {
+    /* Grouping */
+    Re_Open,                   /* ( */
+    Re_Close,                  /* ) */
+    Re_Update,                 /* Like Re_Close, but is inside a loop */
+
+    /* Alternatives */
+    Re_Alt,                    /* Start alternative list, + next offset */
+    Re_AltNext,                        /* Next alternative, + next offset */
+    Re_AltDone,                        /* Finish alternative list */
+
+    /* Repetition */
+    Re_AnyTimes,               /* * */
+    Re_Maybe,                  /* ? */
+    Re_AtLeast,                        /* +, at least one */
+
+    /* Repetition like */
+    Re_AnyAnyTimes,            /* .*<re> */
+    Re_AnyMaybe,               /* .?<re> */
+    Re_AnyAtLeast,             /* .+<re> */
+
+    Re_AnyEatAnyTimes,         /* Expression ends with .* */
+    Re_AnyEatMaybe,            /* Expression ends with .? */
+    Re_AnyEatAtLeast,          /* Expression ends with .+ */
+
+    /* Repetition with arguments */
+    Re_Exact,                  /* {e} */
+    Re_Min,                    /* {n,} */
+    Re_Max,                    /* {,m} */
+    Re_MinMax,                 /* {n,m} */
+
+    /* Repetition helper instruction */
+    Re_RepJump,                        /* Special code, go back to repetition */
+    Re_RepLongJump,            /* Jump needs two bytes */
+       /*  After the repetition data, all repetitions have an offset
+        * to the code after the repetition */
+
+    /* Matching */
+    Re_Any,                    /* . */
+    Re_Odigit,                 /* \o */
+    Re_OdigitNot,              /* \O */
+    Re_Digit,                  /* \d */
+    Re_DigitNot,               /* \D */
+    Re_Xdigit,                 /* \x */
+    Re_XdigitNot,              /* \x */
+    Re_Space,                  /* \s */
+    Re_SpaceNot,               /* \S */
+    Re_Tab,                    /* \t */
+    Re_Newline,                        /* \n */
+    Re_Lower,                  /* \l */
+    Re_Upper,                  /* \u */
+    Re_Alnum,                  /* \w */
+    Re_AlnumNot,               /* \W */
+    Re_Control,                        /* \c */
+    Re_ControlNot,             /* \C */
+    Re_Bol,                    /* ^ */
+    Re_Eol,                    /* $ */
+    Re_Bow,                    /* \< */
+    Re_Eow,                    /* \> */
+
+    /* Range matching information */
+    Re_Range,                  /* + 256 bytes */
+    Re_RangeNot,               /* + 256 bytes */
+
+    /* Matching with arguments */
+    Re_Literal,                        /* + character */
+    Re_CaseLiteral,            /* + lower + upper */
+    Re_LiteralNot,             /* + character */
+    Re_CaseLiteralNot,         /* + lower + upper */
+    Re_String,                 /* + length + string */
+    Re_CaseString,             /* + length + string in format lower-upper */
+
+    /* These are useful to start matching, or when RE_NOSPEC is used. */
+    Re_SearchLiteral,
+    Re_SearchCaseLiteral,
+    Re_SearchString,
+    Re_SearchCaseString,
+
+    Re_StringList,             /* + total-length + lengths + strings */
+    Re_CaseStringList,         /* + total-length + lengths + strings */
+
+    Re_LargeStringList,                /* + total-length + lengths + map + strings */
+    Re_LargeCaseStringList,    /* + total-length + lengths + map + strings */
+
+    /* Backreference */
+    Re_Backref,                        /* + reference number */
+
+    /* The last codes */
+    Re_DoneIf,                 /* Done if at end of input */
+    Re_MaybeDone,              /* Done */
+    Re_Done                    /* If this code found, finished execution */
+} ReCode;
+
+
+/* (r)egular (e)xpresssion (pat)rern (t)ype */
+typedef enum _rec_pat_t {
+    Rep_Literal                        = Re_Literal,
+    Rep_CaseLiteral            = Re_CaseLiteral,
+    Rep_LiteralNot             = Re_LiteralNot,
+    Rep_CaseLiteralNot         = Re_CaseLiteralNot,
+    Rep_Range                  = Re_Range,
+    Rep_RangeNot               = Re_RangeNot,
+    Rep_String                 = Re_String,
+    Rep_CaseString             = Re_CaseString,
+    Rep_SearchLiteral          = Re_SearchLiteral,
+    Rep_SearchCaseLiteral      = Re_SearchCaseLiteral,
+    Rep_SearchString           = Re_SearchString,
+    Rep_SearchCaseString       = Re_SearchCaseString,
+    Rep_Any                    = Re_Any,
+    Rep_AnyAnyTimes            = Re_AnyAnyTimes,
+    Rep_AnyEatAnyTimes         = Re_AnyEatAnyTimes,
+    Rep_AnyMaybe               = Re_AnyMaybe,
+    Rep_AnyEatMaybe            = Re_AnyEatMaybe,
+    Rep_AnyAtLeast             = Re_AnyAtLeast,
+    Rep_AnyEatAtLeast          = Re_AnyEatAtLeast,
+    Rep_Odigit                 = Re_Odigit,
+    Rep_OdigitNot              = Re_OdigitNot,
+    Rep_Digit                  = Re_Digit,
+    Rep_DigitNot               = Re_DigitNot,
+    Rep_Xdigit                 = Re_Xdigit,
+    Rep_XdigitNot              = Re_XdigitNot,
+    Rep_Space                  = Re_Space,
+    Rep_SpaceNot               = Re_SpaceNot,
+    Rep_Tab                    = Re_Tab,
+    Rep_Newline                        = Re_Newline,
+    Rep_Lower                  = Re_Lower,
+    Rep_Upper                  = Re_Upper,
+    Rep_Alnum                  = Re_Alnum,
+    Rep_AlnumNot               = Re_AlnumNot,
+    Rep_Control                        = Re_Control,
+    Rep_ControlNot             = Re_ControlNot,
+    Rep_Bol                    = Re_Bol,
+    Rep_Eol                    = Re_Eol,
+    Rep_Bow                    = Re_Bow,
+    Rep_Eow                    = Re_Eow,
+    Rep_Backref                        = Re_Backref,
+    Rep_StringList             = Re_StringList,
+    Rep_Group                  = Re_Open
+} rec_pat_t;
+
+
+/* (r)egular (e)xpression (rep)etition (t)ype */
+typedef enum _rec_rep_t {
+    Rer_AnyTimes               = Re_AnyTimes,
+    Rer_AtLeast                        = Re_AtLeast,
+    Rer_Maybe                  = Re_Maybe,
+    Rer_Exact                  = Re_Exact,
+    Rer_Min                    = Re_Min,
+    Rer_Max                    = Re_Max,
+    Rer_MinMax                 = Re_MinMax
+} rec_rep_t;
+
+
+/*  Decide at re compilation time what is lowercase and what is uppercase */
+struct _rec_cse {
+    unsigned char lower;
+    unsigned char upper;
+};
+
+
+/*  A rec_rng is used only during compilation, just a character map */
+struct _rec_rng {
+    unsigned char range[256];
+};
+
+
+/*  A rec_pat is used only during compilation, and can be viewed as
+ * a regular expression element like a match to any character, a match
+ * to the beginning or end of the line, etc.
+ *  It is implemented as a linked list, and does not have nesting.
+ *  The data field can contain:
+ *     chr:    the value of a single character to match.
+ *     cse:    the upper and lower case value of a character to match.
+ *     rng:    a character map to match or not match.
+ *     str:    a simple string or a string where every two bytes
+ *             represents the character to match, in lower/upper
+ *             case sequence.
+ *  The rep field is not used for strings, strings are broken in the
+ * last character in this case. That is, strings are just a concatenation
+ * of several character matches.
+ */
+struct _rec_pat {
+    rec_pat_t type;
+    rec_pat *next, *prev;      /* Linked list information */
+    union {
+       unsigned char chr;
+       rec_cse cse;
+       rec_rng *rng;
+       rec_grp *grp;
+       unsigned char *str;
+       rec_stl *stl;
+    } data;
+    rec_rep *rep;              /* Pattern repetition information */
+};
+
+
+/*  A rec_rep is used only during compilation, and can be viewed as:
+ *
+ *     ? or * or + or {<e>} or {<m>,} or {,<M>} or {<m>,<M>}
+ *
+ * where <e> is "exact", <m> is "minimum" and <M> is "maximum".
+ *  In the compiled step it can also be just a NULL pointer, that
+ * is actually equivalent to {1}.
+ */
+struct _rec_rep {
+    rec_rep_t type;
+    short mine;                        /* minimum or exact number of matches */
+    short maxc;                        /* maximum number of matches */
+};
+
+
+/*  A rec_alt is used only during compilation, and can be viewed as:
+ *
+ *     <re>|<re>
+ *
+ * where <re> is any regular expression. The expressions are nested
+ * using the grp field of the rec_pat structure.
+ */
+struct _rec_alt {
+    rec_alt *next, *prev;      /* Linked list information */
+    rec_pat *pat;
+};
+
+
+/*  A rec_grp is a place holder for expressions enclosed in parenthesis
+ * and is linked to the compilation data by an rec_pat structure. */
+struct _rec_grp {
+    rec_pat *parent;           /* Reference to parent pattern */
+    rec_alt *alt;              /* The pattern information */
+    rec_alt *palt;             /* Parent alternative */
+    rec_grp *pgrp;             /* Nested groups */
+    int comp;                  /* (comp)lex repetition pattern inside group */
+};
+
+
+/* Optimization compilation types definition */
+       /* (r)egular (e)xpression (c)ompile (st)ring (l)ist (t)ype */
+typedef enum {
+    Resl_StringList            = Re_StringList,
+    Resl_CaseStringList                = Re_CaseStringList
+} rec_stl_t;
+
+struct _rec_stl {
+    rec_stl_t type;
+    int nstrs;                 /* Number of strings in list */
+    int tlen;                  /* Total length of all strings */
+    unsigned char *lens;       /* Vector of string lengths */
+    unsigned char **strs;      /* The strings */
+};
+
+
+/*
+ * Prototypes
+ */
+       /* rep.c */
+rec_alt *irec_comp(const char*, const char*, int, int*);
+void irec_free_alt(rec_alt*);
+
+       /* reo.c */
+int orec_comp(rec_alt*, int);
+void orec_free_stl(rec_stl*);
+
+#endif /* _rep_h */
diff --git a/xedit/lisp/re/tests.c b/xedit/lisp/re/tests.c
new file mode 100644 (file)
index 0000000..21b1e10
--- /dev/null
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86$ */
+
+/*
+ * Compile with:       cc -o tests tests.c -L. -lre
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include "re.h"
+
+int
+main(int argc, char *argv[])
+{
+    re_cod cod;
+    re_mat mat[10];
+    int line, ecode, i, len, group, failed;
+    long eo, so;
+    char buf[8192];
+    char str[8192];
+    FILE *fp = fopen("tests.txt", "r");
+
+    if (fp == NULL) {
+       fprintf(stderr, "failed to open tests.txt\n");
+       exit(1);
+    }
+
+    ecode = line = group = failed = 0;
+    cod.cod = NULL;
+    while (fgets(buf, sizeof(buf), fp)) {
+       ++line;
+       if (buf[0] == '#' || buf[0] == '\n')
+           continue;
+       else if (buf[0] == '/') {
+           char *ptr = strrchr(buf, '/');
+
+           if (ptr == buf) {
+               fprintf(stderr, "syntax error at line %d\n", line);
+               break;
+           }
+           else {
+               int flags = 0;
+
+               refree(&cod);
+               for (*ptr++ = '\0'; *ptr; ptr++) {
+                   if (*ptr == 'i')
+                       flags |= RE_ICASE;
+                   else if (*ptr == 'n')
+                       flags |= RE_NEWLINE;
+               }
+               ecode = recomp(&cod, buf + 1, flags);
+               failed = ecode;
+           }
+       }
+       else if (buf[0] == '>') {
+           if (cod.cod == NULL) {
+               fprintf(stderr, "no previous pattern at line %d\n", line);
+               break;
+           }
+           len = strlen(buf) - 1;
+           buf[len] = '\0';
+           strcpy(str, buf + 1);
+           for (i = 0, --len; i < len - 1; i++) {
+               if (str[i] == '\\') {
+                   memmove(str + i, str + i + 1, len);
+                   --len;
+                   switch (str[i]) {
+                       case 'a':
+                           str[i] = '\a';
+                           break;
+                       case 'b':
+                           str[i] = '\b';
+                           break;
+                       case 'f':
+                           str[i] = '\f';
+                           break;
+                       case 'n':
+                           str[i] = '\n';
+                           break;
+                       case 'r':
+                           str[i] = '\r';
+                           break;
+                       case 't':
+                           str[i] = '\t';
+                           break;
+                       case 'v':
+                           str[i] = '\v';
+                           break;
+                       default:
+                           break;
+                   }
+               }
+           }
+           group = 0;
+           ecode = reexec(&cod, str, 10, &mat[0], 0);
+           if (ecode && ecode != RE_NOMATCH) {
+               reerror(failed, &cod, buf, sizeof(buf));
+               fprintf(stderr, "%s, at line %d\n", buf, line);
+               break;
+           }
+       }
+       else if (buf[0] == ':') {
+           if (failed) {
+               len = strlen(buf) - 1;
+               buf[len] = '\0';
+               if (failed == RE_EESCAPE && strcmp(buf, ":EESCAPE") == 0)
+                   continue;
+               if (failed == RE_ESUBREG && strcmp(buf, ":ESUBREG") == 0)
+                   continue;
+               if (failed == RE_EBRACK && strcmp(buf, ":EBRACK") == 0)
+                   continue;
+               if (failed == RE_EPAREN && strcmp(buf, ":EPAREN") == 0)
+                   continue;
+               if (failed == RE_EBRACE && strcmp(buf, ":EBRACE") == 0)
+                   continue;
+               if (failed == RE_EBADBR && strcmp(buf, ":EBADBR") == 0)
+                   continue;
+               if (failed == RE_ERANGE && strcmp(buf, ":ERANGE") == 0)
+                   continue;
+               if (failed == RE_ESPACE && strcmp(buf, ":ESPACE") == 0)
+                   continue;
+               if (failed == RE_BADRPT && strcmp(buf, ":BADRPT") == 0)
+                   continue;
+               if (failed == RE_EMPTY && strcmp(buf, ":EMPTY") == 0)
+                   continue;
+               reerror(failed, &cod, buf, sizeof(buf));
+               fprintf(stderr, "Error value %d doesn't match: %s, at line %d\n",
+                       failed, buf, line);
+               break;
+           }
+           else if (!ecode) {
+               fprintf(stderr, "found match when shoudn't, at line %d\n", line);
+               break;
+           }
+       }
+       else {
+           if (failed) {
+               reerror(failed, &cod, buf, sizeof(buf));
+               fprintf(stderr, "%s, at line %d\n", buf, line);
+               break;
+           }
+           if (sscanf(buf, "%ld,%ld:", &so, &eo) != 2) {
+               fprintf(stderr, "expecting match offsets at line %d\n", line);
+               break;
+           }
+           else if (ecode) {
+               fprintf(stderr, "didn't match, at line %d\n", line);
+               break;
+           }
+           else if (group >= 10) {
+               fprintf(stderr, "syntax error at line %d (too many groups)\n",
+                       line);
+               break;
+           }
+           else if (so != mat[group].rm_so || eo != mat[group].rm_eo) {
+               fprintf(stderr, "match failed at line %d, got %ld,%ld: ",
+                       line, mat[group].rm_so, mat[group].rm_eo);
+               if (mat[group].rm_so < mat[group].rm_eo)
+                   fwrite(str + mat[group].rm_so,
+                          mat[group].rm_eo - mat[group].rm_so, 1, stderr);
+               fputc('\n', stderr);
+               break;
+           }
+           ++group;
+       }
+    }
+
+    fclose(fp);
+
+    return (ecode);
+}
diff --git a/xedit/lisp/re/tests.txt b/xedit/lisp/re/tests.txt
new file mode 100644 (file)
index 0000000..35fd90b
--- /dev/null
@@ -0,0 +1,470 @@
+#
+#  Copyright (c) 2002 by The XFree86 Project, Inc.
+#
+#  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.
+#
+#  Author: Paulo César Pereira de Andrade
+#
+#
+# $XFree86: xc/programs/xedit/lisp/re/tests.txt,v 1.1 2002/09/08 02:29:50 paulo Exp $
+
+# Some tests for the library:
+#      lines starting with # are comments
+#      lines starting with / are a regular expression pattern
+#              The pattern must end with / and may be followed by:
+#                      i -> ignore case
+#                      n -> create newline sensitive regex
+#      lines starting with > are a string input to the last pattern
+#              To test newline sensitive matching, add \n to the string.
+#      lines starting with a number are the expected result
+#              If more than one line, every subsequent line is the
+#              value of an "subresult".
+#      :NOMATCH means that the string input should not match
+
+# Simple string
+/abc/
+>abc
+0,3: abc
+>aaaaaaaaaaaaaaabc
+14,17: abc
+>xxxxxxxxxxxxxxaaaaaaaaaaaaaaaaabcxx
+30,33: abc
+
+# String list
+/abc|bcd|cde/
+>abc
+0,3: abc
+>aabc
+1,4: abc
+>xxxbcdef
+3,6: bcd
+>abdzzzcdabcde
+8,11: abc
+>xxxxabdecdabdcde
+13,16: cde
+
+# Complex string
+/a?bc|ab?c|abc?/
+>abc
+0,3: abc
+>xxxb
+:NOMATCH
+>xxxbc
+3,5: bc
+>sssssab
+5,7: ab
+
+# Another complex string
+/a*bc|ab*c|abc*/
+>aaaaaaabc
+0,9: aaaaaaabc
+>xaaaaaaabc
+1,10: aaaaaaabc
+>xyzaaaaaaabc
+3,12: aaaaaaabc
+>abbc
+0,4: abbc
+>xxabbbbbc
+2,9: abbbbbc
+>abcccccccccc
+0,12: abcccccccccc
+>abccccccccccd
+0,12: abcccccccccc
+>xxxxxxxaaaaaaaaaabbbbbbbbbbbccccccccccc
+16,29: abbbbbbbbbbbc
+>xxxbbbbbbbbbc
+11,13: bc
+
+# Another complex string
+/a+bc|ab+c|abc+/
+>xxxbc
+:NOMATCH
+>xaaabc
+1,6: aaabc
+>zzzzaaaaabbc
+8,12: abbc
+>zzzzaaaabbbbbbcccc
+7,15: abbbbbbc
+
+# Simple pattern
+/a.c/
+>abc
+0,3: abc
+>aaac
+1,4: aac
+>xac
+:NOMATCH
+>xaac
+1,4: aac
+>xxabc
+2,5: abc
+>xxxaxc
+3,6: axc
+
+# Another simple pattern
+/a*c/
+>c
+0,1: c
+>xxxxxxxxc
+8,9: c
+>xxxxxxxcc
+7,8: c
+>ac
+0,2: ac
+>aaaac
+0,5: aaaac
+>xac
+1,3: ac
+>xxxaac
+3,6: aac
+>xxac
+2,4: ac
+>xxxxac
+4,6: ac
+
+# Another simple pattern
+/a+c/
+>xxaac
+2,5: aac
+>xxxaaaac
+3,8: aaaac
+>xaaaabac
+6,8: ac
+>xxxc
+:NOMATCH
+>xxxxaaaaccc
+4,9: aaaac
+
+# Another simple pattern
+/a{4}b/
+>xabxxaabxxxaaabxxxxaaaab
+19,24: aaaab
+>aaabaaaab
+4,9: aaaab
+
+# Another simple pattern
+/a{4,}b/
+>xxxaaaab
+3,8: aaaab
+>zaaabzzzaaaaaaaaaaaaaaaab
+8,25: aaaaaaaaaaaaaaaab
+
+# Another simple pattern
+/a{,4}b/
+>b
+0,1: b
+>xxxxxxxxb
+8,9: b
+>xaaaaaaaaab
+6,11: aaaab
+>xxxab
+3,5: ab
+>aaaaaxaaab
+6,10: aaab
+
+# Another simple pattern
+/a{2,4}b/
+>xab
+:NOMATCH
+>xaab
+1,4: aab
+>xaaab
+1,5: aaab
+>xxaaaab
+2,7: aaaab
+>xxxaaaaab
+4,9: aaaab
+
+# Some simple grouping tests
+/foo(bar|baz)fee/
+>feebarbazfoobarfee
+9,18: foobarfee
+12,15: bar
+>foofooobazfeefoobazfee
+13,22: foobazfee
+/f(oo|ee)ba[rz]/
+>barfoebaz
+:NOMATCH
+>bazfoobar
+3,9: foobar
+4,6: oo
+>barfeebaz
+3,9: feebaz
+4,6: ee
+/\<(int|char)\>/
+>aint character int foo
+15,18: int
+15,18: int
+
+# Some complex repetitions
+/foo.*bar/
+>barfoblaboofoobarfoobarfoobar
+11,17: foobar
+/foo.+bar/
+>foobar
+:NOMATCH
+>fobbarfooxbarfooybar
+6,13: fooxbar
+/foo.?bar/
+>xfoobar
+1,7: foobar
+>xxfooxxbar
+:NOMATCH
+>yyyfootbar
+3,10: footbar
+
+# Some nested complex repetitions
+/a.*b.*c/
+>abc
+0,3: abc
+>xxxxxxxxxabbbbbbbccaaaaabbbc
+9,18: abbbbbbbc
+/a.+b.*c/
+>xxxabc 
+:NOMATCH
+>xxaxbbc
+2,7: axbbc
+/a.+b.?c/
+>xaabc
+1,5: aabc
+>xxaabbc
+2,7: aabbc
+
+# Very complex repetitions
+/(foo.*|bar)fee/
+# XXX NOTE
+# This pattern does not return the correct offset for the group.
+# Support for this may and may not be added.
+
+>barfoofee
+3,9: foofee
+>foobarfee
+0,9: foobarfee
+>xxfobarfee
+4,10: barfee
+>barfooooooobarfee
+3,17: fooooooobarfee
+>xxfobarfeefoobar
+4,10: barfee
+/(foo.+|bar)fee/
+>barfoofee
+:NOMATCH
+>barfooxfee
+3,10: fooxfee
+/(foo.?|bar)fee/
+>foobar
+:NOMATCH
+>bafoofee
+2,8:foofee
+>bafooofeebarfee
+2,9: fooofee
+>bafoofeebarfee
+2,8: foofee
+
+# Simple backreference
+/(a|b|c)\1/
+>aa
+0,2: aa
+0,1: a
+/(a|b|c)(a|b|c)\1\2/
+>acac
+0,4: acac
+0,1: a
+1,2: c
+>xxxxacac
+4,8: acac
+4,5: a
+5,6: c
+>xxacabacbcacbbacbcaaccabcaca
+24,28: caca
+24,25: c
+25,26: a
+>xyabcccc
+4,8: cccc
+4,5: c
+5,6: c
+
+# Complex backreference
+/(a*b)\1/
+>xxxaaaaabaaaaab
+3,15: aaaaabaaaaab
+3,9: aaaaab
+/(ab+c)\1/
+>xaaabbbcabbbc
+3,13: abbbcabbbc
+3,8: abbbc
+/(ab?c)\1/
+>abcac
+:NOMATCH
+>abcacabcabc
+5,11: abcabc
+5,8: abc
+>abcacac
+3,7: acac
+3,5: acac
+
+# Very complex backreference
+/a(.*)b\1/
+>xxxab
+3,5: ab
+4,4: 
+>xxxxazzzbzzz
+4,12: azzzbzzz
+5,8: zzz
+
+# Case testing
+/abc/i
+>AbC
+0,3: AbC
+/[0-9][a-z]+/i
+>xxx0aaZxYT9
+3,10: 0aaZxYT
+/a.b/i
+>aaaaaaaaaaaxB
+10,13: axB
+/a.*z/i
+>xxxAaaaaZ
+3,9: AaaaaZ
+>xxaaaZaaa
+2,6: aaaZ
+/\<(lambda|defun|defmacro)\>/i
+>    (lambda
+5,11: lambda
+5,11: lambda
+/\<(nil|t)\>/i
+>it Nil
+3,6: Nil
+3,6: Nil
+/\<(begin|end)\>/i
+>beginning the ending EnD
+21,24: EnD
+21,24: EnD
+
+# Some newline tests
+/a.*/n
+>a\naaa
+0,1:a
+>xyza\naa
+3,4: a
+/a.+/n
+>a\naaa
+2,5: aaa
+>xyza\naa
+5,7: aa
+/a.?/n
+>a\naaa
+0,1: a
+>xyza\naa
+3,4: a
+
+# Newline tests envolving complex patterns
+/a.*b.*c/n
+>xxaa\nzyacb\nabc
+11,14: abc
+>xxxab\nabc\nc
+6,9: abc
+/a.+b.*c/n
+>ab\nbc\nabbc
+6,10: abbc
+/a.?b.*c/n
+>ab\ncabbc\ncc
+4,8: abbc
+/^foo$/n
+>bar\nfoobar\nfoo
+11,14: foo
+
+# Not so complex test involving a newline...
+/^\s*#\s*(define|include)\s+.+/n
+>#define\n#include x
+8,18: #include x
+9,16: include
+
+# Check if large strings are working
+/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
+>zzzxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxzzz
+3,259: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~/
+>String here: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~/
+13,333: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~
+
+
+# Some complex repetitions not supported
+# Listed here only to make sure the library is not crashing on these
+#  Repetitions that match an empty match, or an empty string cannot follow
+# a complex repetition. A complex repetition is:
+#      .* or .+ or .?
+#      .{...} is not supported.
+/(.*)(\d*)/
+:BADRPT
+/(.*).(\d*)/
+:BADRPT
+/(.*)\<(\d*)/
+:BADRPT
+/(.*)\s(\d*)/
+:BADRPT
+/(.*)\D(\d*)/
+:BADRPT
+
+# This is a more clear pattern and partially works
+/(.*)\D(\d+)/
+>abcW12
+0,6: abcW12
+0,3: abc
+4,6: 12
+>abcW12abcW12
+0,6: abcW12
+0,3: abc
+4,6: 12
+# This wasn't working in the previous version, but now with only minimal
+# matches supported, it works.
+>abcW12abcW12a
+0,6: abcW12
+0,3: abc
+4,6: 12
+
+# Note the minimal match
+/.*\d/
+>a1a1a1aaaaaaa
+0,2: a1
+# Check match offsets
+/(.*)\d/
+>a1a1a1aaaaaaa
+0,2: a1
+0,1: a
+/.*(\d)/
+>a1a1a1aaaaaaa
+0,2: a1
+1,2: 1
+
+/.*(\d+)/
+:BADRPT
+
+# Regression fix, was matching empty string
+/\\\d{3}|\\./
+>\\
+:NOMATCH
+
+/\\.|\\\d{3}/
+>\\
+:NOMATCH
diff --git a/xedit/lisp/read.c b/xedit/lisp/read.c
new file mode 100644 (file)
index 0000000..9c70b64
--- /dev/null
@@ -0,0 +1,2056 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/read.c,v 1.36tsi Exp $ */
+
+#include <errno.h>
+#include "lisp/read.h"
+#include "lisp/package.h"
+#include "lisp/write.h"
+#include <fcntl.h>
+#include <stdarg.h>
+
+/* This should be visible only in read.c, but if an error is generated,
+ * the current code in write.c will print it as #<ERROR> */
+#define LABEL_BIT_COUNT                8
+#define LABEL_BIT_MASK         0xff
+#define MAX_LABEL_VALUE                ((1L << (sizeof(long) * 8 - 9)) - 1)
+#define READLABEL(label)                                               \
+    (LispObj*)(((label) << LABEL_BIT_COUNT) | READLABEL_MASK)
+#define READLABELP(object)                                             \
+    (((unsigned long)(object) & LABEL_BIT_MASK) == READLABEL_MASK)
+#define READLABEL_VALUE(object)                                                \
+    ((long)(object) >> LABEL_BIT_COUNT)
+
+#define READ_ENTER()                                                   \
+    LispObj *read__stream = SINPUT;                                    \
+    int read__line = LispGetLine(read__stream)
+#define READ_ERROR0(format)                                            \
+    LispReadError(read__stream, read__line, format)
+#define READ_ERROR1(format, arg1)                                      \
+    LispReadError(read__stream, read__line, format, arg1)
+#define READ_ERROR2(format, arg1, arg2)                                        \
+    LispReadError(read__stream, read__line, format, arg1, arg2)
+
+#define READ_ERROR_EOF()       READ_ERROR0("unexpected end of input")
+#define READ_ERROR_FIXNUM()    READ_ERROR0("number is not a fixnum")
+#define READ_ERROR_INVARG()    READ_ERROR0("invalid argument")
+
+#ifdef __UNIXOS2__
+# define finite(x) isfinite(x)
+#endif
+
+/*
+ * Types
+ */
+typedef struct _object_info {
+    long label;                /* the read label of this object */
+    LispObj *object;   /* the resulting object */
+    long num_circles;  /* references to object before it was completely read */
+} object_info;
+
+typedef struct _read_info {
+    int level;         /* level of open parentheses */
+
+    int nodot;         /* flag set when reading a "special" list */
+
+    int discard;       /* flag used when reading an unavailable feature */
+
+    long circle_count; /* if non zero, must resolve some labels */
+
+    /* information for #<number>= and #<number># */
+    object_info *objects;
+    long num_objects;
+
+    /* could use only the objects field as all circular data is known,
+     * but check every object so that circular/shared references generated
+     * by evaluations would not cause an infinite loop at read time */
+    LispObj **circles;
+    long num_circles;
+} read_info;
+
+/*
+ * Protypes
+ */
+static LispObj *LispReadChar(LispBuiltin*, int);
+
+static int LispGetLine(LispObj*);
+#ifdef __GNUC__
+#define PRINTF_FORMAT  __attribute__ ((format (printf, 3, 4)))
+#else
+#define PRINTF_FORMAT  /**/
+#endif
+static void LispReadError(LispObj*, int, char*, ...);
+#undef PRINTF_FORMAT
+static void LispReadFixCircle(LispObj*, read_info*);
+static LispObj *LispReadLabelCircle(LispObj*, read_info*);
+static int LispReadCheckCircle(LispObj*, read_info*);
+static LispObj *LispDoRead(read_info*);
+static int LispSkipWhiteSpace(void);
+static LispObj *LispReadList(read_info*);
+static LispObj *LispReadQuote(read_info*);
+static LispObj *LispReadBackquote(read_info*);
+static LispObj *LispReadCommaquote(read_info*);
+static LispObj *LispReadObject(int, read_info*);
+static LispObj *LispParseAtom(char*, char*, int, int, LispObj*, int);
+static LispObj *LispParseNumber(char*, int, LispObj*, int);
+static int StringInRadix(char*, int, int);
+static int AtomSeparator(int, int, int);
+static LispObj *LispReadVector(read_info*);
+static LispObj *LispReadMacro(read_info*);
+static LispObj *LispReadFunction(read_info*);
+static LispObj *LispReadRational(int, read_info*);
+static LispObj *LispReadCharacter(read_info*);
+static void LispSkipComment(void);
+static LispObj *LispReadEval(read_info*);
+static LispObj *LispReadComplex(read_info*);
+static LispObj *LispReadPathname(read_info*);
+static LispObj *LispReadStruct(read_info*);
+static LispObj *LispReadMacroArg(read_info*);
+static LispObj *LispReadArray(long, read_info*);
+static LispObj *LispReadFeature(int, read_info*);
+static LispObj *LispEvalFeature(LispObj*);
+
+/*
+ * Initialization
+ */
+static char *Char_Nul[] = {"Null", "Nul", NULL};
+static char *Char_Soh[] = {"Soh", NULL};
+static char *Char_Stx[] = {"Stx", NULL};
+static char *Char_Etx[] = {"Etx", NULL};
+static char *Char_Eot[] = {"Eot", NULL};
+static char *Char_Enq[] = {"Enq", NULL};
+static char *Char_Ack[] = {"Ack", NULL};
+static char *Char_Bel[] = {"Bell", "Bel", NULL};
+static char *Char_Bs[]  = {"Backspace", "Bs", NULL};
+static char *Char_Tab[] = {"Tab", NULL};
+static char *Char_Nl[]  = {"Newline", "Nl", "Lf", "Linefeed", NULL};
+static char *Char_Vt[]  = {"Vt", NULL};
+static char *Char_Np[]  = {"Page", "Np", NULL};
+static char *Char_Cr[]  = {"Return", "Cr", NULL};
+static char *Char_Ff[]  = {"So", "Ff", NULL};
+static char *Char_Si[]  = {"Si", NULL};
+static char *Char_Dle[] = {"Dle", NULL};
+static char *Char_Dc1[] = {"Dc1", NULL};
+static char *Char_Dc2[] = {"Dc2", NULL};
+static char *Char_Dc3[] = {"Dc3", NULL};
+static char *Char_Dc4[] = {"Dc4", NULL};
+static char *Char_Nak[] = {"Nak", NULL};
+static char *Char_Syn[] = {"Syn", NULL};
+static char *Char_Etb[] = {"Etb", NULL};
+static char *Char_Can[] = {"Can", NULL};
+static char *Char_Em[]  = {"Em", NULL};
+static char *Char_Sub[] = {"Sub", NULL};
+static char *Char_Esc[] = {"Escape", "Esc", NULL};
+static char *Char_Fs[]  = {"Fs", NULL};
+static char *Char_Gs[]  = {"Gs", NULL};
+static char *Char_Rs[]  = {"Rs", NULL};
+static char *Char_Us[]  = {"Us", NULL};
+static char *Char_Sp[]  = {"Space", "Sp", NULL};
+static char *Char_Del[] = {"Rubout", "Del", "Delete", NULL};
+
+LispCharInfo LispChars[256] = {
+    {Char_Nul},
+    {Char_Soh},
+    {Char_Stx},
+    {Char_Etx},
+    {Char_Eot},
+    {Char_Enq},
+    {Char_Ack},
+    {Char_Bel},
+    {Char_Bs},
+    {Char_Tab},
+    {Char_Nl},
+    {Char_Vt},
+    {Char_Np},
+    {Char_Cr},
+    {Char_Ff},
+    {Char_Si},
+    {Char_Dle},
+    {Char_Dc1},
+    {Char_Dc2},
+    {Char_Dc3},
+    {Char_Dc4},
+    {Char_Nak},
+    {Char_Syn},
+    {Char_Etb},
+    {Char_Can},
+    {Char_Em},
+    {Char_Sub},
+    {Char_Esc},
+    {Char_Fs},
+    {Char_Gs},
+    {Char_Rs},
+    {Char_Us},
+    {Char_Sp},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {Char_Del},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
+    {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}
+    
+};
+
+Atom_id Sand, Sor, Snot;
+
+
+/*
+ * Implementation
+ */
+LispObj *
+Lisp_Read(LispBuiltin *builtin)
+/*
+ read &optional input-stream eof-error-p eof-value recursive-p
+ */
+{
+    LispObj *result;
+
+    LispObj *input_stream, *eof_error_p, *eof_value;
+
+    eof_value = ARGUMENT(2);
+    eof_error_p = ARGUMENT(1);
+    input_stream = ARGUMENT(0);
+
+    if (input_stream == UNSPEC)
+       input_stream = NIL;
+    else if (input_stream != NIL) {
+       CHECK_STREAM(input_stream);
+       else if (!input_stream->data.stream.readable)
+           LispDestroy("%s: stream %s is not readable",
+                       STRFUN(builtin), STROBJ(input_stream));
+       LispPushInput(input_stream);
+    }
+    else if (CONSP(lisp__data.input_list)) {
+       input_stream = STANDARD_INPUT;
+       LispPushInput(input_stream);
+    }
+
+    if (eof_value == UNSPEC)
+       eof_value = NIL;
+
+    result = LispRead();
+    if (input_stream != NIL)
+       LispPopInput(input_stream);
+
+    if (result == NULL) {
+       if (eof_error_p != NIL)
+           LispDestroy("%s: EOF reading stream %s",
+                       STRFUN(builtin), STROBJ(input_stream));
+       else
+           result = eof_value;
+    }
+
+    return (result);
+}
+
+static LispObj *
+LispReadChar(LispBuiltin *builtin, int nohang)
+{
+    int character;
+
+    LispObj *input_stream, *eof_error_p, *eof_value;
+
+    eof_value = ARGUMENT(2);
+    eof_error_p = ARGUMENT(1);
+    input_stream = ARGUMENT(0);
+
+    if (input_stream == UNSPEC)
+       input_stream = NIL;
+    else if (input_stream != NIL) {
+       CHECK_STREAM(input_stream);
+    }
+    else
+       input_stream = lisp__data.input;
+
+    if (eof_value == UNSPEC)
+       eof_value = NIL;
+
+    character = EOF;
+
+    if (input_stream->data.stream.readable) {
+       LispFile *file = NULL;
+
+       switch (input_stream->data.stream.type) {
+           case LispStreamStandard:
+           case LispStreamFile:
+               file = FSTREAMP(input_stream);
+               break;
+           case LispStreamPipe:
+               file = IPSTREAMP(input_stream);
+               break;
+           case LispStreamString:
+               character = LispSgetc(SSTREAMP(input_stream));
+               break;
+           default:
+               break;
+       }
+       if (file != NULL) {
+           if (file->available || file->offset < file->length)
+               character = LispFgetc(file);
+           else {
+               if (nohang && !file->nonblock) {
+                   if (fcntl(file->descriptor, F_SETFL, O_NONBLOCK) < 0)
+                       LispDestroy("%s: fcntl(%d): %s",
+                                   STRFUN(builtin), file->descriptor,
+                                   strerror(errno));
+                   file->nonblock = 1;
+               }
+               else if (!nohang && file->nonblock) {
+                   if (fcntl(file->descriptor, F_SETFL, 0) < 0)
+                       LispDestroy("%s: fcntl(%d): %s",
+                                   STRFUN(builtin), file->descriptor,
+                                   strerror(errno));
+                   file->nonblock = 0;
+               }
+               if (nohang) {
+                   unsigned char ch;
+
+                   if (read(file->descriptor, &ch, 1) == 1)
+                       character = ch;
+                   else if (errno == EAGAIN)
+                       return (NIL);   /* XXX no character available */
+                   else
+                       character = EOF;
+               }
+               else
+                   character = LispFgetc(file);
+           }
+       }
+    }
+    else
+       LispDestroy("%s: stream %s is unreadable",
+                   STRFUN(builtin), STROBJ(input_stream));
+
+    if (character == EOF) {
+       if (eof_error_p != NIL)
+           LispDestroy("%s: EOF reading stream %s",
+                       STRFUN(builtin), STROBJ(input_stream));
+
+       return (eof_value);
+    }
+
+    return (SCHAR(character));
+}
+
+LispObj *
+Lisp_ReadChar(LispBuiltin *builtin)
+/*
+ read-char &optional input-stream eof-error-p eof-value recursive-p
+ */
+{
+    return (LispReadChar(builtin, 0));
+}
+
+LispObj *
+Lisp_ReadCharNoHang(LispBuiltin *builtin)
+/*
+ read-char-no-hang &optional input-stream eof-error-p eof-value recursive-p
+ */
+{
+    return (LispReadChar(builtin, 1));
+}
+
+LispObj *
+Lisp_ReadLine(LispBuiltin *builtin)
+/*
+ read-line &optional input-stream eof-error-p eof-value recursive-p
+ */
+{
+    char *string;
+    int ch, length;
+    LispObj *result, *status = NIL;
+
+    LispObj *input_stream, *eof_error_p, *eof_value;
+
+    eof_value = ARGUMENT(2);
+    eof_error_p = ARGUMENT(1);
+    input_stream = ARGUMENT(0);
+
+    if (input_stream == UNSPEC)
+       input_stream = NIL;
+    else if (input_stream == NIL)
+       input_stream = STANDARD_INPUT;
+    else {
+       CHECK_STREAM(input_stream);
+    }
+
+    if (eof_value == UNSPEC)
+       eof_value = NIL;
+
+    result = NIL;
+    string = NULL;
+    length = 0;
+
+    if (!input_stream->data.stream.readable)
+       LispDestroy("%s: stream %s is unreadable",
+                   STRFUN(builtin), STROBJ(input_stream));
+    if (input_stream->data.stream.type == LispStreamString) {
+       char *start, *end, *ptr;
+
+       if (SSTREAMP(input_stream)->input >=
+           SSTREAMP(input_stream)->length) {
+           if (eof_error_p != NIL)
+               LispDestroy("%s: EOS found reading %s",
+                           STRFUN(builtin), STROBJ(input_stream));
+
+           status = T;
+           result = eof_value;
+           goto read_line_done;
+       }
+
+       start = SSTREAMP(input_stream)->string +
+               SSTREAMP(input_stream)->input;
+       end = SSTREAMP(input_stream)->string +
+             SSTREAMP(input_stream)->length;
+       /* Search for a newline */
+       for (ptr = start; *ptr != '\n' && ptr < end; ptr++)
+           ;
+       if (ptr == end)
+           status = T;
+       else if (!SSTREAMP(input_stream)->binary)
+           ++SSTREAMP(input_stream)->line;
+       length = ptr - start;
+       string = LispMalloc(length + 1);
+       memcpy(string, start, length);
+       string[length] = '\0';
+       result = LSTRING2(string, length);
+       /* macro LSTRING2 does not make a copy of it's arguments, and
+        * calls LispMused on it. */
+       SSTREAMP(input_stream)->input += length + (status == NIL);
+    }
+    else /*if (input_stream->data.stream.type == LispStreamFile ||
+            input_stream->data.stream.type == LispStreamStandard ||
+            input_stream->data.stream.type == LispStreamPipe)*/ {
+       LispFile *file;
+
+       if (input_stream->data.stream.type == LispStreamPipe)
+           file = IPSTREAMP(input_stream);
+       else
+           file = FSTREAMP(input_stream);
+
+       if (file->nonblock) {
+           if (fcntl(file->descriptor, F_SETFL, 0) < 0)
+               LispDestroy("%s: fcntl: %s",
+                           STRFUN(builtin), strerror(errno));
+           file->nonblock = 0;
+       }
+
+       while (1) {
+           ch = LispFgetc(file);
+           if (ch == EOF) {
+               if (length)
+                   break;
+               if (eof_error_p != NIL)
+                   LispDestroy("%s: EOF found reading %s",
+                               STRFUN(builtin), STROBJ(input_stream));
+               if (string)
+                   LispFree(string);
+
+               status = T;
+               result = eof_value;
+               goto read_line_done;
+           }
+           else if (ch == '\n')
+               break;
+           else if ((length % 64) == 0)
+               string = LispRealloc(string, length + 64);
+           string[length++] = ch;
+       }
+       if (string) {
+           if ((length % 64) == 0)
+               string = LispRealloc(string, length + 1);
+           string[length] = '\0';
+           result = LSTRING2(string, length);
+       }
+       else
+           result = STRING("");
+    }
+
+read_line_done:
+    RETURN(0) = status;
+    RETURN_COUNT = 1;
+
+    return (result);
+}
+
+LispObj *
+LispRead(void)
+{
+    READ_ENTER();
+    read_info info;
+    LispObj *result, *code = COD;
+
+    info.level = info.nodot = info.discard = 0;
+    info.circle_count = 0;
+    info.objects = NULL;
+    info.num_objects = 0;
+
+    result = LispDoRead(&info);
+
+    /* fix circular/shared lists, note that this is done when returning to
+     * the toplevel, so, if some circular/shared reference was evaluated,
+     * it should have generated an expected error */
+    if (info.num_objects) {
+       if (info.circle_count) {
+           info.circles = NULL;
+           info.num_circles = 0;
+           LispReadFixCircle(result, &info);
+           if (info.num_circles)
+               LispFree(info.circles);
+       }
+       LispFree(info.objects);
+    }
+
+    if (result == EOLIST)
+       READ_ERROR0("object cannot start with #\\)");
+    else if (result == DOT)
+       READ_ERROR0("dot allowed only on lists");
+
+    if (result != NULL && POINTERP(result)) {
+       if (code == NIL)
+           COD = result;
+       else
+           COD = CONS(COD, result);
+    }
+
+    return (result);
+}
+
+static int
+LispGetLine(LispObj *stream)
+{
+    int line = -1;
+
+    if (STREAMP(stream)) {
+       switch (stream->data.stream.type) {
+           case LispStreamStandard:
+           case LispStreamFile:
+               if (!FSTREAMP(stream)->binary)
+                   line = FSTREAMP(stream)->line;
+               break;
+           case LispStreamPipe:
+               if (!IPSTREAMP(stream)->binary)
+                   line = IPSTREAMP(stream)->line;
+               break;
+           case LispStreamString:
+               if (!SSTREAMP(stream)->binary)
+                   line = SSTREAMP(stream)->line;
+               break;
+           default:
+               break;
+       }
+    }
+    else if (stream == NIL && !Stdin->binary)
+       line = Stdin->line;
+
+    return (line);
+}
+
+static void
+LispReadError(LispObj *stream, int line, char *fmt, ...)
+{
+    char string[128], *buffer_string;
+    LispObj *buffer = LSTRINGSTREAM("", STREAM_READ | STREAM_WRITE, 0);
+    int length;
+    va_list ap;
+
+    va_start(ap, fmt);
+    vsnprintf(string, sizeof(string), fmt, ap);
+    va_end(ap);
+
+    LispFwrite(Stderr, "*** Reading ", 12);
+    LispWriteObject(buffer, stream);
+    buffer_string = LispGetSstring(SSTREAMP(buffer), &length);
+    LispFwrite(Stderr, buffer_string, length);
+    LispFwrite(Stderr, " at line ", 9);
+    if (line < 0)
+       LispFwrite(Stderr, "?\n", 2);
+    else {
+       char str[32];
+
+       sprintf(str, "%d\n", line);
+       LispFputs(Stderr, str);
+    }
+
+    LispDestroy("READ: %s", string);
+}
+
+static void
+LispReadFixCircle(LispObj *object, read_info *info)
+{
+    LispObj *cons;
+
+fix_again:
+    switch (OBJECT_TYPE(object)) {
+       case LispCons_t:
+           for (cons = object;
+                CONSP(object);
+                cons = object, object = CDR(object)) {
+               if (READLABELP(CAR(object)))
+                   CAR(object) = LispReadLabelCircle(CAR(object), info);
+               else if (LispReadCheckCircle(object, info))
+                   return;
+               else
+                   LispReadFixCircle(CAR(object), info);
+           }
+           if (READLABELP(object))
+               CDR(cons) = LispReadLabelCircle(object, info);
+           else
+               goto fix_again;
+           break;
+       case LispArray_t:
+           if (READLABELP(object->data.array.list))
+               object->data.array.list =
+                   LispReadLabelCircle(object->data.array.list, info);
+           else if (!LispReadCheckCircle(object, info)) {
+               object = object->data.array.list;
+               goto fix_again;
+           }
+           break;
+       case LispStruct_t:
+           if (READLABELP(object->data.struc.fields))
+               object->data.struc.fields =
+                   LispReadLabelCircle(object->data.struc.fields, info);
+           else if (!LispReadCheckCircle(object, info)) {
+               object = object->data.struc.fields;
+               goto fix_again;
+           }
+           break;
+       case LispQuote_t:
+       case LispBackquote_t:
+       case LispFunctionQuote_t:
+           if (READLABELP(object->data.quote))
+               object->data.quote =
+                   LispReadLabelCircle(object->data.quote, info);
+           else {
+               object = object->data.quote;
+               goto fix_again;
+           }
+           break;
+       case LispComma_t:
+           if (READLABELP(object->data.comma.eval))
+               object->data.comma.eval =
+                   LispReadLabelCircle(object->data.comma.eval, info);
+           else {
+               object = object->data.comma.eval;
+               goto fix_again;
+           }
+           break;
+       case LispLambda_t:
+           if (READLABELP(object->data.lambda.code))
+               object->data.lambda.code =
+                   LispReadLabelCircle(object->data.lambda.code, info);
+           else if (!LispReadCheckCircle(object, info)) {
+               object = object->data.lambda.code;
+               goto fix_again;
+           }
+           break;
+       default:
+           break;
+    }
+}
+
+static LispObj *
+LispReadLabelCircle(LispObj *label, read_info *info)
+{
+    long i, value = READLABEL_VALUE(label);
+
+    for (i = 0; i < info->num_objects; i++)
+       if (info->objects[i].label == value)
+           return (info->objects[i].object);
+
+    LispDestroy("READ: internal error");
+    /*NOTREACHED*/
+    return (label);
+}
+
+static int
+LispReadCheckCircle(LispObj *object, read_info *info)
+{
+    long i;
+
+    for (i = 0; i < info->num_circles; i++)
+       if (info->circles[i] == object)
+           return (1);
+
+    if ((info->num_circles % 16) == 0)
+       info->circles = LispRealloc(info->circles, sizeof(LispObj*) *
+                                   (info->num_circles + 16));
+    info->circles[info->num_circles++] = object;
+
+    return (0);
+}
+
+static LispObj *
+LispDoRead(read_info *info)
+{
+    LispObj *object;
+    int ch = LispSkipWhiteSpace();
+
+    switch (ch) {
+       case '(':
+           object = LispReadList(info);
+           break;
+       case ')':
+           for (ch = LispGet(); ch != EOF && ch != '\n'; ch = LispGet()) {
+               if (!isspace(ch)) {
+                   LispUnget(ch);
+                   break;
+               }
+           }
+           return (EOLIST);
+       case EOF:
+           return (NULL);
+       case '\'':
+           object = LispReadQuote(info);
+           break;
+       case '`':
+           object = LispReadBackquote(info);
+           break;
+       case ',':
+           object = LispReadCommaquote(info);
+           break;
+       case '#':
+           object = LispReadMacro(info);
+           break;
+       default:
+           LispUnget(ch);
+           object = LispReadObject(0, info);
+           break;
+    }
+
+    return (object);
+}
+
+static LispObj *
+LispReadMacro(read_info *info)
+{
+    READ_ENTER();
+    LispObj *result = NULL;
+    int ch = LispGet();
+
+    switch (ch) {
+       case '(':
+           result = LispReadVector(info);
+           break;
+       case '\'':
+          result = LispReadFunction(info);
+          break;
+       case 'b':
+       case 'B':
+           result = LispReadRational(2, info);
+           break;
+       case 'o':
+       case 'O':
+           result = LispReadRational(8, info);
+           break;
+       case 'x':
+       case 'X':
+           result = LispReadRational(16, info);
+           break;
+       case '\\':
+           result = LispReadCharacter(info);
+           break;
+       case '|':
+           LispSkipComment();
+           result = LispDoRead(info);
+           break;
+       case '.':       /* eval when compiling */
+       case ',':       /* eval when loading */
+           result = LispReadEval(info);
+           break;
+       case 'c':
+       case 'C':
+           result = LispReadComplex(info);
+           break;
+       case 'p':
+       case 'P':
+           result = LispReadPathname(info);
+           break;
+       case 's':
+       case 'S':
+           result = LispReadStruct(info);
+           break;
+       case '+':
+           result = LispReadFeature(1, info);
+           break;
+       case '-':
+           result = LispReadFeature(0, info);
+           break;
+       case ':':
+           /* Uninterned symbol */
+           result = LispReadObject(1, info);
+           break;
+       default:
+           if (isdigit(ch)) {
+               LispUnget(ch);
+               result = LispReadMacroArg(info);
+           }
+           else if (!info->discard)
+               READ_ERROR1("undefined dispatch macro character #%c", ch);
+           break;
+    }
+
+    return (result);
+}
+
+static LispObj *
+LispReadMacroArg(read_info *info)
+{
+    READ_ENTER();
+    LispObj *result = NIL;
+    long i, integer;
+    int ch;
+
+    /* skip leading zeros */
+    while (ch = LispGet(), ch != EOF && isdigit(ch) && ch == '0')
+       ;
+
+    if (ch == EOF)
+       READ_ERROR_EOF();
+
+    /* if ch is not a number the argument was zero */
+    if (isdigit(ch)) {
+       char stk[32], *str;
+       int len = 1;
+
+       stk[0] = ch;
+       for (;;) {
+           ch = LispGet();
+           if (!isdigit(ch))
+               break;
+           if (len + 1 >= sizeof(stk))
+               READ_ERROR_FIXNUM();
+           stk[len++] = ch;
+       }
+       stk[len] = '\0';
+       errno = 0;
+       integer = strtol(stk, &str, 10);
+       /* number is positive because sign is not processed here */
+       if (*str || errno == ERANGE || integer > MOST_POSITIVE_FIXNUM)
+           READ_ERROR_FIXNUM();
+    }
+    else
+       integer = 0;
+
+    switch (ch) {
+       case 'a':
+       case 'A':
+           if (integer == 1) {
+               /* LispReadArray and LispReadList expect
+                * the '(' being already read  */
+               if ((ch = LispSkipWhiteSpace()) != '(') {
+                   if (info->discard)
+                       return (ch == EOF ? NULL : NIL);
+                   READ_ERROR0("bad array specification");
+               }
+               result = LispReadVector(info);
+           }
+           else
+               result = LispReadArray(integer, info);
+           break;
+       case 'r':
+       case 'R':
+           result = LispReadRational(integer, info);
+           break;
+       case '=':
+           if (integer > MAX_LABEL_VALUE)
+               READ_ERROR_FIXNUM();
+           if (!info->discard) {
+               long num_objects = info->num_objects;
+
+               /* check for duplicated label */
+               for (i = 0; i < info->num_objects; i++) {
+                   if (info->objects[i].label == integer)
+                       READ_ERROR1("label #%ld# defined more than once",
+                                   integer);
+               }
+               info->objects = LispRealloc(info->objects,
+                                           sizeof(object_info) *
+                                           (num_objects + 1));
+               /* if this label is referenced it is a shared/circular object */
+               info->objects[num_objects].label = integer;
+               info->objects[num_objects].object = NULL;
+               info->objects[num_objects].num_circles = 0;
+               ++info->num_objects;
+               result = LispDoRead(info);
+               if (READLABELP(result) && READLABEL_VALUE(result) == integer)
+                   READ_ERROR2("incorrect syntax #%ld= #%ld#",
+                               integer, integer);
+               /* any reference to it now is not shared/circular */
+               info->objects[num_objects].object = result;
+           }
+           else
+               result = LispDoRead(info);
+           break;
+       case '#':
+           if (integer > MAX_LABEL_VALUE)
+               READ_ERROR_FIXNUM();
+           if (!info->discard) {
+               /* search object */
+               for (i = 0; i < info->num_objects; i++) {
+                   if (info->objects[i].label == integer) {
+                       result = info->objects[i].object;
+                       if (result == NULL) {
+                           ++info->objects[i].num_circles;
+                           ++info->circle_count;
+                           result = READLABEL(integer);
+                       }
+                       break;
+                   }
+               }
+               if (i == info->num_objects)
+                   READ_ERROR1("undefined label #%ld#", integer);
+           }
+           break;
+       default:
+           if (!info->discard)
+               READ_ERROR1("undefined dispatch macro character #%c", ch);
+           break;
+    }
+
+    return (result);
+}
+
+static int
+LispSkipWhiteSpace(void)
+{
+    int ch;
+
+    for (;;) {
+       while (ch = LispGet(), isspace(ch) && ch != EOF)
+           ;
+       if (ch == ';') {
+           while (ch = LispGet(), ch != '\n' && ch != EOF)
+               ;
+           if (ch == EOF)
+               return (EOF);
+       }
+       else
+           break;
+    }
+
+    return (ch);
+}
+
+/* any data in the format '(' FORM ')' is read here */
+static LispObj *
+LispReadList(read_info *info)
+{
+    READ_ENTER();
+    GC_ENTER();
+    LispObj *result, *cons, *object;
+    int dot = 0;
+
+    ++info->level;
+    /* check for () */
+    object = LispDoRead(info);
+    if (object == EOLIST) {
+       --info->level;
+
+       return (NIL);
+    }
+
+    if (object == DOT)
+       READ_ERROR0("illegal start of dotted list");
+
+    result = cons = CONS(object, NIL);
+
+    /* make sure GC will not release data being read */
+    GC_PROTECT(result);
+
+    while ((object = LispDoRead(info)) != EOLIST) {
+       if (object == NULL)
+           READ_ERROR_EOF();
+       if (object == DOT) {
+           if (info->nodot == info->level)
+               READ_ERROR0("dotted list not allowed");
+           /* this is a dotted list */
+           if (dot)
+               READ_ERROR0("more than one . in list");
+           dot = 1;
+       }
+       else {
+           if (dot) {
+               /* only one object after a dot */
+               if (++dot > 2)
+                   READ_ERROR0("more than one object after . in list");
+               RPLACD(cons, object);
+           }
+           else {
+               RPLACD(cons, CONS(object, NIL));
+               cons = CDR(cons);
+           }
+       }
+    }
+
+    /* this will happen if last list element was a dot */
+    if (dot == 1)
+       READ_ERROR0("illegal end of dotted list");
+
+    --info->level;
+    GC_LEAVE();
+
+    return (result);
+}
+
+static LispObj *
+LispReadQuote(read_info *info)
+{
+    READ_ENTER();
+    LispObj *quote = LispDoRead(info), *result;
+
+    if (INVALIDP(quote))
+       READ_ERROR_INVARG();
+
+    result = QUOTE(quote);
+
+    return (result);
+}
+
+static LispObj *
+LispReadBackquote(read_info *info)
+{
+    READ_ENTER();
+    LispObj *backquote = LispDoRead(info), *result;
+
+    if (INVALIDP(backquote))
+       READ_ERROR_INVARG();
+
+    result = BACKQUOTE(backquote);
+
+    return (result);
+}
+
+static LispObj *
+LispReadCommaquote(read_info *info)
+{
+    READ_ENTER();
+    LispObj *comma, *result;
+    int atlist = LispGet();
+
+    if (atlist == EOF)
+       READ_ERROR_EOF();
+    else if (atlist != '@' && atlist != '.')
+       LispUnget(atlist);
+
+    comma = LispDoRead(info);
+    if (comma == DOT) {
+       atlist = '@';
+       comma = LispDoRead(info);
+    }
+    if (INVALIDP(comma))
+       READ_ERROR_INVARG();
+
+    result = COMMA(comma, atlist == '@' || atlist == '.');
+
+    return (result);
+}
+
+/*
+ * Read anything that is not readily identifiable by it's first character
+ * and also put the code for reading atoms, numbers and strings together.
+ */
+static LispObj *
+LispReadObject(int unintern, read_info *info)
+{
+    READ_ENTER();
+    LispObj *object;
+    char stk[128], *string, *package, *symbol;
+    int ch, length, backslash, size, quote, unreadable, collon;
+
+    package = symbol = string = stk;
+    size = sizeof(stk);
+    backslash = quote = unreadable = collon = 0;
+    length = 0;
+
+    ch = LispGet();
+    if (unintern && (ch == ':' || ch == '"'))
+       READ_ERROR0("syntax error after #:");
+    else if (ch == '"' || ch == '|')
+       quote = ch;
+    else if (ch == '\\') {
+       unreadable = backslash = 1;
+       string[length++] = ch;
+    }
+    else if (ch == ':') {
+       collon = 1;
+       string[length++] = ch;
+       symbol = string + 1;
+       ch = LispGet();
+       if (ch == '|') {
+           quote = ch;
+           unreadable = 1;
+       }
+       else if (ch != EOF)
+           LispUnget(ch);
+    }
+    else if (ch) {
+       if (islower(ch))
+           ch = toupper(ch);
+       string[length++] = ch;
+    }
+    else
+       unreadable = 1;
+
+    /* read remaining data */
+    for (; ch;) {
+       ch = LispGet();
+
+       if (ch == EOF) {
+           if (quote) {
+               /* if quote, file ended with an open quoted object */
+               if (string != stk)
+                   LispFree(string);
+               return (NULL);
+           }
+           break;
+       }
+       else if (ch == '\0')
+           break;
+
+       if (ch == '\\') {
+           backslash = !backslash;
+           if (quote == '"') {
+               /* only remove backslashs from strings */
+               if (backslash)
+                   continue;
+           }
+           else
+               unreadable = 1;
+       }
+       else if (backslash)
+           backslash = 0;
+       else if (ch == quote)
+           break;
+       else if (!quote && !backslash) {
+           if (islower(ch))
+               ch = toupper(ch);
+           else if (isspace(ch))
+               break;
+           else if (AtomSeparator(ch, 0, 0)) {
+               LispUnget(ch);
+               break;
+           }
+           else if (ch == ':') {
+               if (collon == 0 ||
+                   (collon == (1 - unintern) && symbol == string + length)) {
+                   ++collon;
+                   symbol = string + length + 1;
+               }
+               else
+                   READ_ERROR0("too many collons");
+           }
+       }
+
+       if (length + 2 >= size) {
+           if (string == stk) {
+               size = 1024;
+               string = LispMalloc(size);
+               strcpy(string, stk);
+           }
+           else {
+               size += 1024;
+               string = LispRealloc(string, size);
+           }
+           symbol = string + (symbol - package);
+           package = string;
+       }
+       string[length++] = ch;
+    }
+
+    if (info->discard) {
+       if (string != stk)
+           LispFree(string);
+
+       return (ch == EOF ? NULL : NIL);
+    }
+
+    string[length] = '\0';
+
+    if (unintern) {
+       if (length == 0)
+           READ_ERROR0("syntax error after #:");
+       object = UNINTERNED_ATOM(string);
+    }
+
+    else if (quote == '"')
+       object = LSTRING(string, length);
+
+    else if (collon) {
+       /* Package specified in object name */
+       symbol[-1] = '\0';
+       if (collon > 1)
+           symbol[-2] = '\0';
+       object = LispParseAtom(package, symbol,
+                              collon == 2, unreadable,
+                              read__stream, read__line);
+    }
+
+    else if (quote == '|' || (unreadable && !collon)) {
+       /* Set unreadable field, this atom needs quoting to be read back */
+       object = ATOM(string);
+       object->data.atom->unreadable = 1;
+    }
+
+    /* Check some common symbols */
+    else if (length == 1 && string[0] == 'T')
+       /* The T */
+       object = T;
+
+    else if (length == 1 && string[0] == '.')
+       /* The dot */
+       object = DOT;
+
+    else if (length == 3 &&
+            string[0] == 'N' && string[1] == 'I' && string[2] == 'L')
+       /* The NIL */
+       object = NIL;
+
+    else if (isdigit(string[0]) || string[0] == '.' ||
+            ((string[0] == '-' || string[0] == '+') && string[1]))
+       /* Looks like a number */
+       object = LispParseNumber(string, 10, read__stream, read__line);
+
+    else
+       /* A normal atom */
+       object = ATOM(string);
+
+    if (string != stk)
+       LispFree(string);
+
+    return (object);
+}
+
+static LispObj *
+LispParseAtom(char *package, char *symbol, int intern, int unreadable,
+             LispObj *read__stream, int read__line)
+{
+    LispObj *object = NULL, *thepackage = NULL;
+    LispPackage *pack = NULL;
+
+    if (!unreadable) {
+       /* Until NIL and T be treated as normal symbols */
+       if (symbol[0] == 'N' && symbol[1] == 'I' &&
+           symbol[2] == 'L' && symbol[3] == '\0')
+           return (NIL);
+       if (symbol[0] == 'T' && symbol[1] == '\0')
+           return (T);
+       unreadable = !LispCheckAtomString(symbol);
+    }
+
+    /* If package is empty, it is a keyword */
+    if (package[0] == '\0') {
+       thepackage = lisp__data.keyword;
+       pack = lisp__data.key;
+    }
+
+    else {
+       /* Else, search it in the package list */
+       thepackage = LispFindPackageFromString(package);
+
+       if (thepackage == NIL)
+           READ_ERROR1("the package %s is not available", package);
+
+       pack = thepackage->data.package.package;
+    }
+
+    if (pack == lisp__data.pack && intern) {
+       /* Redundant package specification, since requesting a
+        * intern symbol, create it if does not exist */
+
+       object = ATOM(symbol);
+       if (unreadable)
+           object->data.atom->unreadable = 1;
+    }
+
+    else if (intern || pack == lisp__data.key) {
+       /* Symbol is created, or just fetched from the specified package */
+
+       LispPackage *savepack;
+       LispObj *savepackage = PACKAGE;
+
+       /* Remember curent package */
+       savepack = lisp__data.pack;
+
+       /* Temporarily set another package */
+       lisp__data.pack = pack;
+       PACKAGE = thepackage;
+
+       /* Get the object pointer */
+       if (pack == lisp__data.key)
+           object = KEYWORD(LispDoGetAtom(symbol, 0)->key->value);
+       else
+           object = ATOM(symbol);
+       if (unreadable)
+           object->data.atom->unreadable = 1;
+
+       /* Restore current package */
+       lisp__data.pack = savepack;
+       PACKAGE = savepackage;
+    }
+
+    else {
+       /* Symbol must exist (and be extern) in the specified package */
+
+       LispAtom *atom;
+
+       atom = (LispAtom *)hash_check(pack->atoms, symbol, strlen(symbol));
+       if (atom)
+           object = atom->object;
+
+       /* No object found */
+       if (object == NULL || object->data.atom->ext == 0)
+           READ_ERROR2("no extern symbol %s in package %s", symbol, package);
+    }
+
+    return (object);
+}
+
+static LispObj *
+LispParseNumber(char *str, int radix, LispObj *read__stream, int read__line)
+{
+    int len;
+    long integer;
+    double dfloat;
+    char *ratio, *ptr;
+    LispObj *number;
+    mpi *bignum;
+    mpr *bigratio;
+
+    if (radix < 2 || radix > 36)
+       READ_ERROR1("radix %d is not in the range 2 to 36", radix);
+
+    if (*str == '\0')
+       return (NULL);
+
+    ratio = strchr(str, '/');
+    if (ratio) {
+       /* check if looks like a correctly specified ratio */
+       if (ratio[1] == '\0' || strchr(ratio + 1, '/') != NULL)
+           return (ATOM(str));
+
+       /* ratio must point to an integer in radix base */
+       *ratio++ = '\0';
+    }
+    else if (radix == 10) {
+       int dot = 0;
+       int type = 0;
+
+       /* check if it is a floating point number */
+       ptr = str;
+       if (*ptr == '-' || *ptr == '+')
+           ++ptr;
+       else if (*ptr == '.') {
+           dot = 1;
+           ++ptr;
+       }
+       while (*ptr) {
+           if (*ptr == '.') {
+               if (dot)
+                   return (ATOM(str));
+               /* ignore it if last char is a dot */
+               if (ptr[1] == '\0') {
+                   *ptr = '\0';
+                   break;
+               }
+               dot = 1;
+           }
+           else if (!isdigit(*ptr))
+               break;
+           ++ptr;
+       }
+
+       switch (*ptr) {
+           case '\0':
+               if (dot)                /* if dot, it is default float */
+                   type = 'E';
+               break;
+           case 'E': case 'S': case 'F': case 'D': case 'L':
+               type = *ptr;
+               *ptr = 'E';
+               break;
+           default:
+               return (ATOM(str));     /* syntax error */
+       }
+
+       /* if type set, it is not an integer specification */
+       if (type) {
+           if (*ptr) {
+               int itype = *ptr;
+               char *ptype = ptr;
+
+               ++ptr;
+               if (*ptr == '+' || *ptr == '-')
+                   ++ptr;
+               while (*ptr && isdigit(*ptr))
+                   ++ptr;
+               if (*ptr) {
+                   *ptype = itype;
+
+                   return (ATOM(str));
+               }
+           }
+
+           dfloat = strtod(str, NULL);
+           if (!finite(dfloat))
+               READ_ERROR0("floating point overflow");
+
+           return (DFLOAT(dfloat));
+       }
+    }
+
+    /* check if correctly specified in the given radix */
+    len = strlen(str) - 1;
+    if (!ratio && radix != 10 && str[len] == '.')
+       str[len] = '\0';
+
+    if (ratio || radix != 10) {
+       if (!StringInRadix(str, radix, 1)) {
+           if (ratio)
+               ratio[-1] = '/';
+           return (ATOM(str));
+       }
+       if (ratio && !StringInRadix(ratio, radix, 0)) {
+           ratio[-1] = '/';
+           return (ATOM(str));
+       }
+    }
+
+    bignum = NULL;
+    bigratio = NULL;
+
+    errno = 0;
+    integer = strtol(str, NULL, radix);
+
+    /* if does not fit in a long */
+    if (errno == ERANGE &&
+       ((*str == '-' && integer == LONG_MIN) ||
+        (*str != '-' && integer == LONG_MAX))) {
+       bignum = LispMalloc(sizeof(mpi));
+       mpi_init(bignum);
+       mpi_setstr(bignum, str, radix);
+    }
+
+
+    if (ratio && integer != 0) {
+       long denominator;
+
+       errno = 0;
+       denominator = strtol(ratio, NULL, radix);
+       if (denominator == 0)
+           READ_ERROR0("divide by zero");
+
+       if (bignum == NULL) {
+           if (integer == MINSLONG ||
+               (denominator == LONG_MAX && errno == ERANGE)) {
+               bigratio = LispMalloc(sizeof(mpr));
+               mpr_init(bigratio);
+               mpi_seti(mpr_num(bigratio), integer);
+               mpi_setstr(mpr_den(bigratio), ratio, radix);
+           }
+       }
+       else {
+           bigratio = LispMalloc(sizeof(mpr));
+           mpr_init(bigratio);
+           mpi_set(mpr_num(bigratio), bignum);
+           mpi_clear(bignum);
+           LispFree(bignum);
+           mpi_setstr(mpr_den(bigratio), ratio, radix);
+       }
+
+       if (bigratio) {
+           mpr_canonicalize(bigratio);
+           if (mpi_fiti(mpr_num(bigratio)) &&
+               mpi_fiti(mpr_den(bigratio))) {
+               integer = mpi_geti(mpr_num(bigratio));
+               denominator = mpi_geti(mpr_den(bigratio));
+               mpr_clear(bigratio);
+               LispFree(bigratio);
+               if (denominator == 1)
+                   number = INTEGER(integer);
+               else
+                   number = RATIO(integer, denominator);
+           }
+           else
+               number = BIGRATIO(bigratio);
+       }
+       else {
+           long num = integer, den = denominator, rest;
+
+           if (num < 0)
+               num = -num;
+           for (;;) {
+               if ((rest = den % num) == 0)
+                   break;
+               den = num;
+               num = rest;
+           }
+           if (den != 1) {
+               denominator /= num;
+               integer /= num;
+           }
+           if (denominator < 0) {
+               integer = -integer;
+               denominator = -denominator;
+           }
+           if (denominator == 1)
+               number = INTEGER(integer);
+           else
+               number = RATIO(integer, denominator);
+       }
+    }
+    else if (bignum)
+       number = BIGNUM(bignum);
+    else
+       number = INTEGER(integer);
+
+    return (number);
+}
+
+static int
+StringInRadix(char *str, int radix, int skip_sign)
+{
+    if (skip_sign && (*str == '-' || *str == '+'))
+       ++str;
+    while (*str) {
+       if (*str >= '0' && *str <= '9') {
+           if (*str - '0' >= radix)
+               return (0);
+       }
+       else if (*str >= 'A' && *str <= 'Z') {
+           if (radix <= 10 || *str - 'A' + 10 >= radix)
+               return (0);
+       }
+       else
+           return (0);
+       str++;
+    }
+
+    return (1);
+}
+
+static int
+AtomSeparator(int ch, int check_space, int check_backslash)
+{
+    if (check_space && isspace(ch))
+       return (1);
+    if (check_backslash && ch == '\\')
+       return (1);
+    return (strchr("(),\";'`#|,", ch) != NULL);
+}
+
+static LispObj *
+LispReadVector(read_info *info)
+{
+    LispObj *objects;
+    int nodot = info->nodot;
+
+    info->nodot = info->level + 1;
+    objects = LispReadList(info);
+    info->nodot = nodot;
+
+    if (info->discard)
+       return (objects);
+
+    return (VECTOR(objects));
+}
+
+static LispObj *
+LispReadFunction(read_info *info)
+{
+    READ_ENTER();
+    int nodot = info->nodot;
+    LispObj *function;
+
+    info->nodot = info->level + 1;
+    function = LispDoRead(info);
+    info->nodot = nodot;
+
+    if (info->discard)
+       return (function);
+
+    if (INVALIDP(function)) 
+       READ_ERROR_INVARG();
+    else if (CONSP(function)) {
+       if (CAR(function) != Olambda)
+           READ_ERROR_INVARG();
+
+       return (FUNCTION_QUOTE(function));
+    }
+    else if (!SYMBOLP(function))
+       READ_ERROR_INVARG();
+
+    return (FUNCTION_QUOTE(function));
+}
+
+static LispObj *
+LispReadRational(int radix, read_info *info)
+{
+    READ_ENTER();
+    LispObj *number;
+    int ch, len, size;
+    char stk[128], *str;
+
+    len = 0;
+    str = stk;
+    size = sizeof(stk);
+
+    for (;;) {
+       ch = LispGet();
+       if (ch == EOF || isspace(ch))
+           break;
+       else if (AtomSeparator(ch, 0, 1)) {
+           LispUnget(ch);
+           break;
+       }
+       else if (islower(ch))
+           ch = toupper(ch);
+       if ((ch < '0' || ch > '9') && (ch < 'A' || ch > 'Z') &&
+           ch != '+' && ch != '-' && ch != '/') {
+           if (str != stk)
+               LispFree(str);
+           if (!info->discard)
+               READ_ERROR1("bad character %c for rational number", ch);
+       }
+       if (len + 1 >= size) {
+           if (str == stk) {
+               size = 512;
+               str = LispMalloc(size);
+               strcpy(str + 1, stk + 1);
+           }
+           else {
+               size += 512;
+               str = LispRealloc(str, size);
+           }
+       }
+       str[len++] = ch;
+    }
+
+    if (info->discard) {
+       if (str != stk)
+           LispFree(str);
+
+       return (ch == EOF ? NULL : NIL);
+    }
+
+    str[len] = '\0';
+
+    number = LispParseNumber(str, radix, read__stream, read__line);
+    if (str != stk)
+       LispFree(str);
+
+    if (!RATIONALP(number))
+       READ_ERROR0("bad rational number specification");
+
+    return (number);
+}
+
+static LispObj *
+LispReadCharacter(read_info *info)
+{
+    READ_ENTER();
+    long c;
+    int ch, len;
+    char stk[64];
+
+    ch = LispGet();
+    if (ch == EOF)
+       return (NULL);
+
+    stk[0] = ch;
+    len = 1;
+
+    for (;;) {
+       ch = LispGet();
+       if (ch == EOF)
+           break;
+       else if (ch != '-' && !isalnum(ch)) {
+           LispUnget(ch);
+           break;
+       }
+       if (len + 1 < sizeof(stk))
+           stk[len++] = ch;
+    }
+    if (len > 1) {
+       char **names;
+       int found = 0;
+       stk[len] = '\0';
+
+       for (c = ch = 0; ch <= ' ' && !found; ch++) {
+           for (names = LispChars[ch].names; *names; names++)
+               if (strcasecmp(*names, stk) == 0) {
+                   c = ch;
+                   found = 1;
+                   break;
+               }
+       }
+       if (!found) {
+           for (names = LispChars[0177].names; *names; names++)
+               if (strcasecmp(*names, stk) == 0) {
+                   c = 0177;
+                   found = 1;
+                   break;
+               }
+       }
+
+       if (!found) {
+           if (info->discard)
+               return (NIL);
+           READ_ERROR1("unkwnown character %s", stk);
+       }
+    }
+    else
+       c = stk[0];
+
+    return (SCHAR(c));
+}
+
+static void
+LispSkipComment(void)
+{
+    READ_ENTER();
+    int ch, comm = 1;
+
+    for (;;) {
+       ch = LispGet();
+       if (ch == '#') {
+           ch = LispGet();
+           if (ch == '|')
+               ++comm;
+           continue;
+       }
+       while (ch == '|') {
+           ch = LispGet();
+           if (ch == '#' && --comm == 0)
+               return;
+       }
+       if (ch == EOF)
+           READ_ERROR_EOF();
+    }
+}
+
+static LispObj *
+LispReadEval(read_info *info)
+{
+    READ_ENTER();
+    int nodot = info->nodot;
+    LispObj *code;
+
+    info->nodot = info->level + 1;
+    code = LispDoRead(info);
+    info->nodot = nodot;
+
+    if (info->discard)
+       return (code);
+
+    if (INVALIDP(code))
+       READ_ERROR_INVARG();
+
+    return (EVAL(code));
+}
+
+static LispObj *
+LispReadComplex(read_info *info)
+{
+    READ_ENTER();
+    GC_ENTER();
+    int nodot = info->nodot;
+    LispObj *number, *arguments;
+
+    info->nodot = info->level + 1;
+    arguments = LispDoRead(info);
+    info->nodot = nodot;
+
+    /* form read */
+    if (info->discard)
+       return (arguments);
+
+    if (INVALIDP(arguments) || !CONSP(arguments))
+       READ_ERROR_INVARG();
+
+    GC_PROTECT(arguments);
+    number = APPLY(Ocomplex, arguments);
+    GC_LEAVE();
+
+    return (number);
+}
+
+static LispObj *
+LispReadPathname(read_info *info)
+{
+    READ_ENTER();
+    GC_ENTER();
+    int nodot = info->nodot;
+    LispObj *path, *arguments;
+
+    info->nodot = info->level + 1;
+    arguments = LispDoRead(info);
+    info->nodot = nodot;
+
+    /* form read */
+    if (info->discard)
+       return (arguments);
+
+    if (INVALIDP(arguments))
+       READ_ERROR_INVARG();
+
+    GC_PROTECT(arguments);
+    path = APPLY1(Oparse_namestring, arguments);
+    GC_LEAVE();
+
+    return (path);
+}
+
+static LispObj *
+LispReadStruct(read_info *info)
+{
+    READ_ENTER();
+    GC_ENTER();
+    int len, nodot = info->nodot;
+    char stk[128], *str;
+    LispObj *struc, *fields;
+
+    info->nodot = info->level + 1;
+    fields = LispDoRead(info);
+    info->nodot = nodot;
+
+    /* form read */
+    if (info->discard)
+       return (fields);
+
+    if (INVALIDP(fields) || !CONSP(fields) || !SYMBOLP(CAR(fields)))
+       READ_ERROR_INVARG();
+
+    GC_PROTECT(fields);
+
+    len = ATOMID(CAR(fields))->length;
+          /* MAKE- */
+    if (len + 6 > sizeof(stk))
+       str = LispMalloc(len + 6);
+    else
+       str = stk;
+    sprintf(str, "MAKE-%s", ATOMID(CAR(fields))->value);
+    RPLACA(fields, ATOM(str));
+    if (str != stk)
+       LispFree(str);
+    struc = APPLY(Omake_struct, fields);
+    GC_LEAVE();
+
+    return (struc);
+}
+
+/* XXX This is broken, needs a rewritten as soon as true vector/arrays be
+ * implemented. */
+static LispObj *
+LispReadArray(long dimensions, read_info *info)
+{
+    READ_ENTER();
+    GC_ENTER();
+    long count;
+    int nodot = info->nodot;
+    LispObj *arguments, *initial, *dim, *cons, *array, *data;
+
+    info->nodot = info->level + 1;
+    data = LispDoRead(info);
+    info->nodot = nodot;
+
+    /* form read */
+    if (info->discard)
+       return (data);
+
+    if (INVALIDP(data))
+       READ_ERROR_INVARG();
+
+    initial = Kinitial_contents;
+
+    dim = cons = NIL;
+    if (dimensions) {
+       LispObj *array;
+
+       for (count = 0, array = data; count < dimensions; count++) {
+           long length;
+           LispObj *item;
+
+           if (!CONSP(array))
+               READ_ERROR0("bad array for given dimension");
+           item = array;
+           array = CAR(array);
+
+           for (length = 0; CONSP(item); item = CDR(item), length++)
+               ;
+
+           if (dim == NIL) {
+               dim = cons = CONS(FIXNUM(length), NIL);
+               GC_PROTECT(dim);
+           }
+           else {
+               RPLACD(cons, CONS(FIXNUM(length), NIL));
+               cons = CDR(cons);
+           }
+       }
+    }
+
+    arguments = CONS(dim, CONS(initial, CONS(data, NIL)));
+    GC_PROTECT(arguments);
+    array = APPLY(Omake_array, arguments);
+    GC_LEAVE();
+
+    return (array);
+}
+
+static LispObj *
+LispReadFeature(int with, read_info *info)
+{
+    READ_ENTER();
+    LispObj *status;
+    LispObj *feature = LispDoRead(info);
+
+    /* form read */
+    if (info->discard)
+       return (feature);
+
+    if (INVALIDP(feature))
+       READ_ERROR_INVARG();
+
+    /* paranoia check, features must be a list, possibly empty */
+    if (!CONSP(FEATURES) && FEATURES != NIL)
+       READ_ERROR1("%s is not a list", STROBJ(FEATURES));
+
+    status = LispEvalFeature(feature);
+
+    if (with) {
+       if (status == T)
+           return (LispDoRead(info));
+
+       /* need to use the field discard because the following expression
+        * may be #.FORM or #,FORM or any other form that may generate
+        * side effects */
+       info->discard = 1;
+       LispDoRead(info);
+       info->discard = 0;
+
+       return (LispDoRead(info));
+    }
+
+    if (status == NIL)
+       return (LispDoRead(info));
+
+    info->discard = 1;
+    LispDoRead(info);
+    info->discard = 0;
+
+    return (LispDoRead(info));
+}
+
+/*
+ * A very simple eval loop with AND, NOT, and OR functions for testing
+ * the available features.
+ */
+static LispObj *
+LispEvalFeature(LispObj *feature)
+{
+    READ_ENTER();
+    Atom_id test;
+    LispObj *object;
+
+    if (CONSP(feature)) {
+       LispObj *function = CAR(feature), *arguments = CDR(feature);
+
+       if (!SYMBOLP(function))
+           READ_ERROR1("bad feature test function %s", STROBJ(function));
+       if (!CONSP(arguments))
+           READ_ERROR1("bad feature test arguments %s", STROBJ(arguments));
+       test = ATOMID(function);
+       if (test == Sand) {
+           for (; CONSP(arguments); arguments = CDR(arguments)) {
+               if (LispEvalFeature(CAR(arguments)) == NIL)
+                   return (NIL);
+           }
+           return (T);
+       }
+       else if (test == Sor) {
+           for (; CONSP(arguments); arguments = CDR(arguments)) {
+               if (LispEvalFeature(CAR(arguments)) == T)
+                   return (T);
+           }
+           return (NIL);
+       }
+       else if (test == Snot) {
+           if (CONSP(CDR(arguments)))
+               READ_ERROR0("too many arguments to NOT");
+
+           return (LispEvalFeature(CAR(arguments)) == NIL ? T : NIL);
+       }
+       else
+           READ_ERROR1("unimplemented feature test function %s", test);
+    }
+
+    if (KEYWORDP(feature))
+       feature = feature->data.quote;
+    else if (!SYMBOLP(feature))
+       READ_ERROR1("bad feature specification %s", STROBJ(feature));
+
+    test = ATOMID(feature);
+
+    for (object = FEATURES; CONSP(object); object = CDR(object)) {
+       /* paranoia check, elements in the feature list must ge keywords */
+       if (!KEYWORDP(CAR(object)))
+           READ_ERROR1("%s is not a keyword", STROBJ(CAR(object)));
+       if (ATOMID(CAR(object)) == test)
+           return (T);
+    }
+
+    /* unknown feature */
+    return (NIL);
+}
diff --git a/xedit/lisp/read.h b/xedit/lisp/read.h
new file mode 100644 (file)
index 0000000..e36e153
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/read.h,v 1.3tsi Exp $ */
+
+#ifndef Lisp_read_h
+#define Lisp_read_h
+
+#include "lisp/io.h"
+
+/*
+ * Prototypes
+ */
+LispObj *LispRead(void);
+
+LispObj *Lisp_Read(LispBuiltin*);
+LispObj *Lisp_ReadChar(LispBuiltin*);
+LispObj *Lisp_ReadCharNoHang(LispBuiltin*);
+LispObj *Lisp_ReadLine(LispBuiltin*);
+
+#endif /* Lisp_read_h */
diff --git a/xedit/lisp/regex.c b/xedit/lisp/regex.c
new file mode 100644 (file)
index 0000000..5e1de6c
--- /dev/null
@@ -0,0 +1,223 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/regex.c,v 1.10tsi Exp $ */
+
+#include "lisp/regex.h"
+#include "lisp/private.h"
+#include "lisp/helper.h"
+
+/*
+ * Prototypes
+ */
+static re_cod *LispRecomp(LispBuiltin*, char*, int);
+
+/*
+ * Initialization
+ */
+LispObj *Knomatch;
+
+/*
+ * Implementation
+ */
+static re_cod *
+LispRecomp(LispBuiltin *builtin, char *pattern, int cflags)
+{
+    int code;
+    re_cod *regex = LispMalloc(sizeof(re_cod));
+
+    if ((code = recomp(regex, pattern, cflags)) != 0) {
+       char buffer[256];
+
+       reerror(code, regex, buffer, sizeof(buffer));
+       refree(regex);
+       LispFree(regex);
+       LispDestroy("%s: recomp(\"%s\"): %s", STRFUN(builtin), pattern, buffer);
+    }
+
+    return (regex);
+}
+
+void
+LispRegexInit(void)
+{
+    Knomatch = KEYWORD("NOMATCH");
+}
+
+LispObj *
+Lisp_Recomp(LispBuiltin *builtin)
+/*
+ re-comp pattern &key nospec icase nosub newline
+ */
+{
+    re_cod *regex;
+    int cflags = 0;
+
+    LispObj *result;
+
+    LispObj *pattern, *nospec, *icase, *nosub, *newline;
+
+    newline = ARGUMENT(4);
+    nosub = ARGUMENT(3);
+    icase = ARGUMENT(2);
+    nospec = ARGUMENT(1);
+    pattern = ARGUMENT(0);
+
+    /* Don't generate an error if it is already a compiled regex. */
+    if (REGEXP(pattern))
+       return (pattern);
+
+    CHECK_STRING(pattern);
+
+    if (nospec != UNSPEC && nospec != NIL)
+       cflags |= RE_NOSPEC;
+    if (icase != UNSPEC && icase != NIL)
+       cflags |= RE_ICASE;
+    if (nosub != UNSPEC && nosub != NIL)
+       cflags |= RE_NOSUB;
+    if (newline != UNSPEC && newline != NIL)
+       cflags |= RE_NEWLINE;
+
+    regex = LispRecomp(builtin, THESTR(pattern), cflags);
+    result = LispNew(pattern, NIL);
+    result->type = LispRegex_t;
+    result->data.regex.regex = regex;
+    result->data.regex.pattern = pattern;
+    result->data.regex.options = cflags;
+    LispMused(regex);
+
+    return (result);
+}
+
+LispObj *
+Lisp_Reexec(LispBuiltin *builtin)
+/*
+ re-exec regex string &key count start end notbol noteol
+ */
+{
+    size_t nmatch;
+    re_mat match[10];
+    long start, end, length;
+    int code, cflags, eflags;
+    char *string;
+    LispObj *result;
+    re_cod *regexp;
+
+    LispObj *regex, *ostring, *count, *ostart, *oend, *notbol, *noteol;
+
+    noteol = ARGUMENT(6);
+    notbol = ARGUMENT(5);
+    oend = ARGUMENT(4);
+    ostart = ARGUMENT(3);
+    count = ARGUMENT(2);
+    ostring = ARGUMENT(1);
+    regex = ARGUMENT(0);
+
+    if (STRINGP(regex))
+       regexp = LispRecomp(builtin, THESTR(regex), cflags = 0);
+    else {
+       CHECK_REGEX(regex);
+       regexp = regex->data.regex.regex;
+       cflags = regex->data.regex.options;
+    }
+
+    CHECK_STRING(ostring);
+
+    if (count == UNSPEC)
+       nmatch = 1;
+    else {
+       CHECK_INDEX(count);
+       nmatch = FIXNUM_VALUE(count);
+       if (nmatch > 10)
+           LispDestroy("%s: COUNT cannot be larger than 10", STRFUN(builtin));
+    }
+    if (nmatch && (cflags & RE_NOSUB))
+       nmatch = 1;
+
+    eflags = RE_STARTEND;
+    if (notbol != UNSPEC && notbol != NIL)
+       eflags |= RE_NOTBOL;
+    if (noteol != UNSPEC && noteol != NIL)
+       eflags |= RE_NOTEOL;
+
+    string = THESTR(ostring);
+    LispCheckSequenceStartEnd(builtin, ostring, ostart, oend,
+                             &start, &end, &length);
+
+    match[0].rm_so = start;
+    match[0].rm_eo = end;
+    code = reexec(regexp, string, nmatch, &match[0], eflags);
+
+    if (code == 0) {
+       if (nmatch && match[0].rm_eo >= match[0].rm_so) {
+           result = CONS(CONS(FIXNUM(match[0].rm_so),
+                              FIXNUM(match[0].rm_eo)), NIL);
+           if (nmatch > 1 && match[1].rm_eo >= match[1].rm_so) {
+               int i;
+               GC_ENTER();
+               LispObj *cons = result;
+
+               GC_PROTECT(result);
+               for (i = 1;
+                    i < nmatch && match[i].rm_eo >= match[i].rm_so;
+                    i++) {
+                   RPLACD(cons, CONS(CONS(FIXNUM(match[i].rm_so),
+                                          FIXNUM(match[i].rm_eo)), NIL));
+                   cons = CDR(cons);
+               }
+               GC_LEAVE();
+           }
+       }
+       else
+           result = NIL;
+    }
+    else
+       result = Knomatch;
+
+    /* Maybe shoud cache compiled regex, but better the caller do it */
+    if (!XREGEXP(regex)) {
+       refree(regexp);
+       LispFree(regexp);
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_Rep(LispBuiltin *builtin)
+/*
+ re-p object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (REGEXP(object) ? T : NIL);
+}
diff --git a/xedit/lisp/regex.h b/xedit/lisp/regex.h
new file mode 100644 (file)
index 0000000..6a110c3
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/regex.h,v 1.3tsi Exp $ */
+
+#ifndef Lisp_regex_h
+#define Lisp_regex_h
+
+#include "lisp/internal.h"
+
+/*
+ * Prototypes
+ */
+void LispRegexInit(void);
+
+LispObj *Lisp_Recomp(LispBuiltin*);
+LispObj *Lisp_Reexec(LispBuiltin*);
+LispObj *Lisp_Rep(LispBuiltin*);
+
+#endif /* Lisp_regex_h */
diff --git a/xedit/lisp/require.c b/xedit/lisp/require.c
new file mode 100644 (file)
index 0000000..b998dc3
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/require.c,v 1.17tsi Exp $ */
+
+#include "lisp/require.h"
+
+/*
+ * Implementation
+ */
+LispObj *
+Lisp_Load(LispBuiltin *builtin)
+/*
+ load filename &key verbose print if-does-not-exist
+ */
+{
+    LispObj *filename, *verbose, *print, *if_does_not_exist;
+
+    if_does_not_exist = ARGUMENT(3);
+    print = ARGUMENT(2);
+    verbose = ARGUMENT(1);
+    filename = ARGUMENT(0);
+
+    if (PATHNAMEP(filename))
+       filename = CAR(filename->data.pathname);
+    else {
+       CHECK_STRING(filename);
+    }
+
+    return (LispLoadFile(filename,
+                        verbose != UNSPEC && verbose != NIL,
+                        print != UNSPEC && print != NIL,
+                        if_does_not_exist != UNSPEC &&
+                        if_does_not_exist != NIL));
+}
+
+LispObj *
+Lisp_Require(LispBuiltin *builtin)
+/*
+ require module &optional pathname
+ */
+{
+    char filename[1024], *ext;
+    int len;
+
+    LispObj *obj, *module, *pathname;
+
+    pathname = ARGUMENT(1);
+    module = ARGUMENT(0);
+
+    CHECK_STRING(module);
+    if (pathname != UNSPEC) {
+       if (PATHNAMEP(pathname))
+           pathname = CAR(pathname->data.pathname);
+       else {
+           CHECK_STRING(pathname);
+       }
+    }
+    else
+       pathname = module;
+
+    for (obj = MOD; CONSP(obj); obj = CDR(obj)) {
+       if (strcmp(THESTR(CAR(obj)), THESTR(module)) == 0)
+           return (module);
+    }
+
+    if (THESTR(pathname)[0] != '/') {
+#ifdef LISPDIR
+       snprintf(filename, sizeof(filename), "%s", LISPDIR);
+#else
+       getcwd(filename, sizeof(filename));
+#endif
+    }
+    else
+       filename[0] = '\0';
+    *(filename + sizeof(filename) - 5) = '\0'; /* make sure there is place for ext */
+    len = strlen(filename);
+    if (!len || filename[len - 1] != '/') {
+       strcat(filename, "/");
+       ++len;
+    }
+
+    snprintf(filename + len, sizeof(filename) - len - 5, "%s", THESTR(pathname));
+
+    ext = filename + strlen(filename);
+
+#ifdef SHARED_MODULES
+    strcpy(ext, ".so");
+    if (access(filename, R_OK) == 0) {
+       LispModule *lisp_module;
+       char data[64];
+       int len;
+
+       if (lisp__data.module == NULL) {
+           /* export our own symbols */
+           if (dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL) == NULL)
+               LispDestroy("%s: ", STRFUN(builtin), dlerror());
+       }
+
+       lisp_module = (LispModule*)LispMalloc(sizeof(LispModule));
+       if ((lisp_module->handle =
+            dlopen(filename, RTLD_LAZY | RTLD_GLOBAL)) == NULL)
+           LispDestroy("%s: dlopen: %s", STRFUN(builtin), dlerror());
+       snprintf(data, sizeof(data), "%sLispModuleData", THESTR(module));
+       if ((lisp_module->data =
+            (LispModuleData*)dlsym(lisp_module->handle, data)) == NULL) {
+           dlclose(lisp_module->handle);
+           LispDestroy("%s: cannot find LispModuleData for %s",
+                       STRFUN(builtin), STROBJ(module));
+       }
+       LispMused(lisp_module);
+       lisp_module->next = lisp__data.module;
+       lisp__data.module = lisp_module;
+       if (lisp_module->data->load)
+           (lisp_module->data->load)();
+
+       if (MOD == NIL)
+           MOD = CONS(module, NIL);
+       else {
+           RPLACD(MOD, CONS(CAR(MOD), CDR(MOD)));
+           RPLACA(MOD, module);
+       }
+       LispSetVar(lisp__data.modules, MOD);
+
+       return (module);
+    }
+#endif
+
+    strcpy(ext, ".lsp");
+    (void)LispLoadFile(STRING(filename), 0, 0, 0);
+
+    return (module);
+}
diff --git a/xedit/lisp/require.h b/xedit/lisp/require.h
new file mode 100644 (file)
index 0000000..fe6858c
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/require.h,v 1.4tsi Exp $ */
+
+#ifndef Lisp_require_h
+#define Lisp_require_h
+
+#include "lisp/private.h"
+#include "lisp/helper.h"
+#ifdef SHARED_MODULES
+#include <dlfcn.h>
+#endif
+
+LispObj *Lisp_Load(LispBuiltin*);
+LispObj *Lisp_Require(LispBuiltin*);
+
+#endif /* Lisp_require_h */
diff --git a/xedit/lisp/stream.c b/xedit/lisp/stream.c
new file mode 100644 (file)
index 0000000..aad89cf
--- /dev/null
@@ -0,0 +1,866 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/stream.c,v 1.21tsi Exp $ */
+
+#include "lisp/read.h"
+#include "lisp/stream.h"
+#include "lisp/pathname.h"
+#include "lisp/write.h"
+#include "lisp/private.h"
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <string.h>
+#include <sys/wait.h>
+
+/*
+ * Initialization
+ */
+#define DIR_PROBE              0
+#define DIR_INPUT              1
+#define DIR_OUTPUT             2
+#define DIR_IO                 3
+
+#define EXT_NIL                        0
+#define EXT_ERROR              1
+#define EXT_NEW_VERSION                2
+#define EXT_RENAME             3
+#define EXT_RENAME_DELETE      4
+#define EXT_OVERWRITE          5
+#define EXT_APPEND             6
+#define EXT_SUPERSEDE          7
+
+#define NOEXT_NIL              0
+#define NOEXT_ERROR            1
+#define NOEXT_CREATE           2
+#define NOEXT_NOTHING          3
+
+extern char **environ;
+
+LispObj *Oopen, *Oclose, *Otruename;
+
+LispObj *Kif_does_not_exist, *Kprobe, *Kinput, *Koutput, *Kio,
+       *Knew_version, *Krename, *Krename_and_delete, *Koverwrite,
+       *Kappend, *Ksupersede, *Kcreate;
+
+/*
+ * Implementation
+ */
+void
+LispStreamInit(void)
+{
+    Oopen              = STATIC_ATOM("OPEN");
+    Oclose             = STATIC_ATOM("CLOSE");
+    Otruename          = STATIC_ATOM("TRUENAME");
+
+    Kif_does_not_exist = KEYWORD("IF-DOES-NOT-EXIST");
+    Kprobe             = KEYWORD("PROBE");
+    Kinput             = KEYWORD("INPUT");
+    Koutput            = KEYWORD("OUTPUT");
+    Kio                        = KEYWORD("IO");
+    Knew_version       = KEYWORD("NEW-VERSION");
+    Krename            = KEYWORD("RENAME");
+    Krename_and_delete = KEYWORD("RENAME-AND-DELETE");
+    Koverwrite         = KEYWORD("OVERWRITE");
+    Kappend            = KEYWORD("APPEND");
+    Ksupersede         = KEYWORD("SUPERSEDE");
+    Kcreate            = KEYWORD("CREATE");
+}
+
+LispObj *
+Lisp_DeleteFile(LispBuiltin *builtin)
+/*
+ delete-file filename
+ */
+{
+    GC_ENTER();
+    LispObj *filename;
+
+    filename = ARGUMENT(0);
+
+    if (STRINGP(filename)) {
+       filename = APPLY1(Oparse_namestring, filename);
+       GC_PROTECT(filename);
+    }
+    else if (STREAMP(filename)) {
+       if (filename->data.stream.type != LispStreamFile)
+           LispDestroy("%s: %s is not a FILE-STREAM",
+                       STRFUN(builtin), STROBJ(filename));
+       filename = filename->data.stream.pathname;
+    }
+    else {
+       CHECK_PATHNAME(filename);
+    }
+    GC_LEAVE();
+
+    return (LispUnlink(THESTR(CAR(filename->data.pathname))) ? NIL : T);
+}
+
+LispObj *
+Lisp_RenameFile(LispBuiltin *builtin)
+/*
+ rename-file filename new-name
+ */
+{
+    int code;
+    GC_ENTER();
+    char *from, *to;
+    LispObj *old_truename, *new_truename;
+
+    LispObj *filename, *new_name;
+
+    new_name = ARGUMENT(1);
+    filename = ARGUMENT(0);
+
+    if (STRINGP(filename)) {
+       filename = APPLY1(Oparse_namestring, filename);
+       GC_PROTECT(filename);
+    }
+    else if (STREAMP(filename)) {
+       if (filename->data.stream.type != LispStreamFile)
+           LispDestroy("%s: %s is not a FILE-STREAM",
+                       STRFUN(builtin), STROBJ(filename));
+       filename = filename->data.stream.pathname;
+    }
+    else {
+       CHECK_PATHNAME(filename);
+    }
+    old_truename = APPLY1(Otruename, filename);
+    GC_PROTECT(old_truename);
+
+    if (STRINGP(new_name)) {
+       new_name = APPLY3(Oparse_namestring, new_name, NIL, filename);
+       GC_PROTECT(new_name);
+    }
+    else {
+       CHECK_PATHNAME(new_name);
+    }
+
+    from = THESTR(CAR(filename->data.pathname));
+    to = THESTR(CAR(new_name->data.pathname));
+    code = LispRename(from, to);
+    if (code)
+       LispDestroy("%s: rename(%s, %s): %s",
+                   STRFUN(builtin), from, to, strerror(errno));
+    GC_LEAVE();
+
+    new_truename = APPLY1(Otruename, new_name);
+    RETURN_COUNT = 2;
+    RETURN(0) = old_truename;
+    RETURN(1) = new_truename;
+
+    return (new_name);
+}
+
+LispObj *
+Lisp_Streamp(LispBuiltin *builtin)
+/*
+ streamp object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (STREAMP(object) ? T : NIL);
+}
+
+LispObj *
+Lisp_InputStreamP(LispBuiltin *builtin)
+/*
+ input-stream-p stream
+ */
+{
+    LispObj *stream;
+
+    stream = ARGUMENT(0);
+
+    CHECK_STREAM(stream);
+
+    return (stream->data.stream.readable ? T : NIL);
+}
+
+LispObj *
+Lisp_OpenStreamP(LispBuiltin *builtin)
+/*
+ open-stream-p stream
+ */
+{
+   LispObj *stream;
+
+    stream = ARGUMENT(0);
+
+    CHECK_STREAM(stream);
+
+    return (stream->data.stream.readable || stream->data.stream.writable ?
+           T : NIL);
+}
+
+LispObj *
+Lisp_OutputStreamP(LispBuiltin *builtin)
+/*
+ output-stream-p stream
+ */
+{
+    LispObj *stream;
+
+    stream = ARGUMENT(0);
+
+    CHECK_STREAM(stream);
+
+    return (stream->data.stream.writable ? T : NIL);
+}
+
+LispObj *
+Lisp_Open(LispBuiltin *builtin)
+/*
+ open filename &key direction element-type if-exists if-does-not-exist external-format
+ */
+{
+    GC_ENTER();
+    char *string;
+    LispObj *stream = NIL;
+    int mode, flags, direction, exist, noexist, file_exist;
+    LispFile *file;
+
+    LispObj *filename, *odirection, *element_type, *if_exists,
+           *if_does_not_exist, *external_format;
+
+    external_format = ARGUMENT(5);
+    if_does_not_exist = ARGUMENT(4);
+    if_exists = ARGUMENT(3);
+    element_type = ARGUMENT(2);
+    odirection = ARGUMENT(1);
+    filename = ARGUMENT(0);
+
+    if (STRINGP(filename)) {
+       filename = APPLY1(Oparse_namestring, filename);
+       GC_PROTECT(filename);
+    }
+    else if (STREAMP(filename)) {
+       if (filename->data.stream.type != LispStreamFile)
+           LispDestroy("%s: %s is not a FILE-STREAM",
+                       STRFUN(builtin), STROBJ(filename));
+       filename = filename->data.stream.pathname;
+    }
+    else {
+       CHECK_PATHNAME(filename);
+    }
+
+    if (odirection != UNSPEC) {
+       direction = -1;
+       if (KEYWORDP(odirection)) {
+           if (odirection == Kprobe)
+               direction = DIR_PROBE;
+           else if (odirection == Kinput)
+               direction = DIR_INPUT;
+           else if (odirection == Koutput)
+               direction = DIR_OUTPUT;
+           else if (odirection == Kio)
+               direction = DIR_IO;
+       }
+       if (direction == -1)
+           LispDestroy("%s: bad :DIRECTION %s",
+                       STRFUN(builtin), STROBJ(odirection));
+    }
+    else
+       direction = DIR_INPUT;
+
+    if (element_type != UNSPEC) {
+       /* just check argument... */
+       if (SYMBOLP(element_type) &&
+           ATOMID(element_type) == Scharacter)
+           ;   /* do nothing */
+       else if (KEYWORDP(element_type) &&
+           ATOMID(element_type) == Sdefault)
+           ;   /* do nothing */
+       else
+           LispDestroy("%s: only :%s and %s supported for :ELEMENT-TYPE, not %s",
+                       STRFUN(builtin), Sdefault->value, Scharacter->value, STROBJ(element_type));
+    }
+
+    if (if_exists != UNSPEC) {
+       exist = -1;
+       if (if_exists == NIL)
+           exist = EXT_NIL;
+       else if (KEYWORDP(if_exists)) {
+           if (if_exists == Kerror)
+               exist = EXT_ERROR;
+           else if (if_exists == Knew_version)
+               exist = EXT_NEW_VERSION;
+           else if (if_exists == Krename)
+               exist = EXT_RENAME;
+           else if (if_exists == Krename_and_delete)
+               exist = EXT_RENAME_DELETE;
+           else if (if_exists == Koverwrite)
+               exist = EXT_OVERWRITE;
+           else if (if_exists == Kappend)
+               exist = EXT_APPEND;
+           else if (if_exists == Ksupersede)
+               exist = EXT_SUPERSEDE;
+       }
+       if (exist == -1)
+           LispDestroy("%s: bad :IF-EXISTS %s",
+                       STRFUN(builtin), STROBJ(if_exists));
+    }
+    else
+       exist = EXT_ERROR;
+
+    if (if_does_not_exist != UNSPEC) {
+       noexist = -1;
+       if (if_does_not_exist == NIL)
+           noexist = NOEXT_NIL;
+       if (KEYWORDP(if_does_not_exist)) {
+           if (if_does_not_exist == Kerror)
+               noexist = NOEXT_ERROR;
+           else if (if_does_not_exist == Kcreate)
+               noexist = NOEXT_CREATE;
+       }
+       if (noexist == -1)
+           LispDestroy("%s: bad :IF-DOES-NO-EXISTS %s",
+                       STRFUN(builtin), STROBJ(if_does_not_exist));
+    }
+    else
+       noexist = direction != DIR_INPUT ? NOEXT_NOTHING : NOEXT_ERROR;
+
+    if (external_format != UNSPEC) {
+       /* just check argument... */
+       if (SYMBOLP(external_format) &&
+           ATOMID(external_format) == Scharacter)
+           ;   /* do nothing */
+       else if (KEYWORDP(external_format) &&
+           ATOMID(external_format) == Sdefault)
+           ;   /* do nothing */
+       else
+           LispDestroy("%s: only :%s and %s supported for :EXTERNAL-FORMAT, not %s",
+                       STRFUN(builtin), Sdefault->value, Scharacter->value, STROBJ(external_format));
+    }
+
+    /* string representation of pathname */
+    string = THESTR(CAR(filename->data.pathname));
+    mode = 0;
+
+    file_exist = access(string, F_OK) == 0;
+    if (file_exist) {
+       if (exist == EXT_NIL) {
+           GC_LEAVE();
+           return (NIL);
+       }
+    }
+    else {
+       if (noexist == NOEXT_NIL) {
+           GC_LEAVE();
+           return (NIL);
+       }
+       if (noexist == NOEXT_ERROR)
+           LispDestroy("%s: file %s does not exist",
+                       STRFUN(builtin), STROBJ(CAR(filename->data.quote)));
+       else if (noexist == NOEXT_CREATE) {
+           LispFile *tmp = LispFopen(string, FILE_WRITE);
+
+           if (tmp)
+               LispFclose(tmp);
+           else
+               LispDestroy("%s: cannot create file %s",
+                           STRFUN(builtin),
+                           STROBJ(CAR(filename->data.quote)));
+       }
+    }
+
+    if (direction == DIR_OUTPUT || direction == DIR_IO) {
+       if (file_exist) {
+           if (exist == EXT_ERROR)
+               LispDestroy("%s: file %s already exists",
+                           STRFUN(builtin), STROBJ(CAR(filename->data.quote)));
+           if (exist == EXT_RENAME) {
+               /* Add an ending '~' at the end of the backup file */
+               char tmp[PATH_MAX + 1];
+
+               strcpy(tmp, string);
+               if (strlen(tmp) + 1 > PATH_MAX)
+                   LispDestroy("%s: backup name for %s too long",
+                               STRFUN(builtin),
+                               STROBJ(CAR(filename->data.quote)));
+               strcat(tmp, "~");
+               if (rename(string, tmp))
+                   LispDestroy("%s: rename: %s",
+                               STRFUN(builtin), strerror(errno));
+               mode |= FILE_WRITE;
+           }
+           else if (exist == EXT_OVERWRITE)
+               mode |= FILE_WRITE;
+           else if (exist == EXT_APPEND)
+               mode |= FILE_APPEND;
+       }
+       else
+           mode |= FILE_WRITE;
+       if (direction == DIR_IO)
+           mode |= FILE_IO;
+    }
+    else
+       mode |= FILE_READ;
+
+    file = LispFopen(string, mode);
+    if (file == NULL)
+       LispDestroy("%s: open: %s", STRFUN(builtin), strerror(errno));
+
+    flags = 0;
+    if (direction == DIR_PROBE) {
+       LispFclose(file);
+       file = NULL;
+    }
+    else {
+       if (direction == DIR_INPUT || direction == DIR_IO)
+           flags |= STREAM_READ;
+       if (direction == DIR_OUTPUT || direction == DIR_IO)
+           flags |= STREAM_WRITE;
+    }
+    stream = FILESTREAM(file, filename, flags);
+    GC_LEAVE();
+
+    return (stream);
+}
+
+LispObj *
+Lisp_Close(LispBuiltin *builtin)
+/*
+ close stream &key abort
+ */
+{
+    LispObj *stream, *oabort;
+
+    oabort = ARGUMENT(1);
+    stream = ARGUMENT(0);
+
+    CHECK_STREAM(stream);
+
+    if (stream->data.stream.readable || stream->data.stream.writable) {
+       stream->data.stream.readable = stream->data.stream.writable = 0;
+       if (stream->data.stream.type == LispStreamFile) {
+           LispFclose(stream->data.stream.source.file);
+           stream->data.stream.source.file = NULL;
+       }
+       else if (stream->data.stream.type == LispStreamPipe) {
+           if (IPSTREAMP(stream)) {
+               LispFclose(IPSTREAMP(stream));
+               IPSTREAMP(stream) = NULL;
+           }
+           if (OPSTREAMP(stream)) {
+               LispFclose(OPSTREAMP(stream));
+               OPSTREAMP(stream) = NULL;
+           }
+           if (EPSTREAMP(stream)) {
+               LispFclose(EPSTREAMP(stream));
+               EPSTREAMP(stream) = NULL;
+           }
+           if (PIDPSTREAMP(stream) > 0) {
+               kill(PIDPSTREAMP(stream),
+                    oabort == UNSPEC || oabort == NIL ? SIGTERM : SIGKILL);
+               waitpid(PIDPSTREAMP(stream), NULL, 0);
+           }
+       }
+       return (T);
+    }
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_Listen(LispBuiltin *builtin)
+/*
+ listen &optional input-stream
+ */
+{
+    LispFile *file = NULL;
+    LispObj *result = NIL;
+
+    LispObj *stream;
+
+    stream = ARGUMENT(0);
+
+    if (stream == UNSPEC)
+       stream = NIL;
+    else if (stream != NIL) {
+       CHECK_STREAM(stream);
+    }
+    else
+       stream = lisp__data.standard_input;
+
+    if (stream->data.stream.readable) {
+       switch (stream->data.stream.type) {
+           case LispStreamString:
+               if (SSTREAMP(stream)->input < SSTREAMP(stream)->length)
+                   result = T;
+               break;
+           case LispStreamFile:
+               file = FSTREAMP(stream);
+               break;
+           case LispStreamStandard:
+               file = FSTREAMP(stream);
+               break;
+           case LispStreamPipe:
+               file = IPSTREAMP(stream);
+               break;
+       }
+
+       if (file != NULL) {
+           if (file->available || file->offset < file->length)
+               result = T;
+           else {
+               unsigned char c;
+
+               if (!file->nonblock) {
+                   if (fcntl(file->descriptor, F_SETFL, O_NONBLOCK) < 0)
+                       LispDestroy("%s: fcntl: %s",
+                                   STRFUN(builtin), strerror(errno));
+                   file->nonblock = 1;
+               }
+               if (read(file->descriptor, &c, 1) == 1) {
+                   LispFungetc(file, c);
+                   result = T;
+               }
+           }
+       }
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_MakeStringInputStream(LispBuiltin *builtin)
+/*
+ make-string-input-stream string &optional start end
+ */
+{
+    char *string;
+    long start, end, length;
+
+    LispObj *ostring, *ostart, *oend, *result;
+
+    oend = ARGUMENT(2);
+    ostart = ARGUMENT(1);
+    ostring = ARGUMENT(0);
+
+    start = end = 0;
+    CHECK_STRING(ostring);
+    LispCheckSequenceStartEnd(builtin, ostring, ostart, oend,
+                             &start, &end, &length);
+    string = THESTR(ostring);
+
+    if (end - start != length)
+       length = end - start;
+    result = LSTRINGSTREAM(string + start, STREAM_READ, length);
+
+    return (result);
+}
+
+LispObj *
+Lisp_MakeStringOutputStream(LispBuiltin *builtin)
+/*
+ make-string-output-stream &key element-type
+ */
+{
+    LispObj *element_type;
+
+    element_type = ARGUMENT(0);
+
+    if (element_type != UNSPEC) {
+       /* just check argument... */
+       if (SYMBOLP(element_type) && ATOMID(element_type) == Scharacter)
+           ;   /* do nothing */
+       else if (KEYWORDP(element_type) &&
+           ATOMID(element_type) == Sdefault)
+           ;   /* do nothing */
+       else
+           LispDestroy("%s: only :%s and %s supported for :ELEMENT-TYPE, not %s",
+                       STRFUN(builtin), Sdefault->value, Scharacter->value, STROBJ(element_type));
+    }
+
+    return (LSTRINGSTREAM("", STREAM_WRITE, 1));
+}
+
+LispObj *
+Lisp_GetOutputStreamString(LispBuiltin *builtin)
+/*
+ get-output-stream-string string-output-stream
+ */
+{
+    int length;
+    char *string;
+    LispObj *string_output_stream, *result;
+
+    string_output_stream = ARGUMENT(0);
+
+    if (!STREAMP(string_output_stream) ||
+       string_output_stream->data.stream.type != LispStreamString ||
+       string_output_stream->data.stream.readable ||
+       !string_output_stream->data.stream.writable)
+       LispDestroy("%s: %s is not an output string stream",
+                   STRFUN(builtin), STROBJ(string_output_stream));
+
+    string = LispGetSstring(SSTREAMP(string_output_stream), &length);
+    result = LSTRING(string, length);
+
+    /* reset string */
+    SSTREAMP(string_output_stream)->output =
+       SSTREAMP(string_output_stream)->length =
+       SSTREAMP(string_output_stream)->column = 0;
+
+    return (result);
+}
+
+
+/* XXX Non standard functions below
+ */
+LispObj *
+Lisp_MakePipe(LispBuiltin *builtin)
+/*
+ make-pipe command-line &key :direction :element-type :external-format
+ */
+{
+    char *string;
+    LispObj *stream = NIL;
+    int flags, direction;
+    LispFile *error_file;
+    LispPipe *program;
+    int ifd[2];
+    int ofd[2];
+    int efd[2];
+    char *argv[4];
+
+    LispObj *command_line, *odirection, *element_type, *external_format;
+
+    external_format = ARGUMENT(3);
+    element_type = ARGUMENT(2);
+    odirection = ARGUMENT(1);
+    command_line = ARGUMENT(0);
+
+    if (PATHNAMEP(command_line))
+       command_line = CAR(command_line->data.quote);
+    else if (!STRINGP(command_line))
+       LispDestroy("%s: %s is a bad pathname",
+                   STRFUN(builtin), STROBJ(command_line));
+
+    if (odirection != UNSPEC) {
+       direction = -1;
+       if (KEYWORDP(odirection)) {
+           if (odirection == Kprobe)
+               direction = DIR_PROBE;
+           else if (odirection == Kinput)
+               direction = DIR_INPUT;
+           else if (odirection == Koutput)
+               direction = DIR_OUTPUT;
+           else if (odirection == Kio)
+               direction = DIR_IO;
+       }
+       if (direction == -1)
+           LispDestroy("%s: bad :DIRECTION %s",
+                       STRFUN(builtin), STROBJ(odirection));
+    }
+    else
+       direction = DIR_INPUT;
+
+    if (element_type != UNSPEC) {
+       /* just check argument... */
+       if (SYMBOLP(element_type) && ATOMID(element_type) == Scharacter)
+           ;   /* do nothing */
+       else if (KEYWORDP(element_type) && ATOMID(element_type) == Sdefault)
+           ;   /* do nothing */
+       else
+           LispDestroy("%s: only :%s and %s supported for :ELEMENT-TYPE, not %s",
+                       STRFUN(builtin), Sdefault->value, Scharacter->value, STROBJ(element_type));
+    }
+
+    if (external_format != UNSPEC) {
+       /* just check argument... */
+       if (SYMBOLP(external_format) && ATOMID(external_format) == Scharacter)
+           ;   /* do nothing */
+       else if (KEYWORDP(external_format) &&
+                ATOMID(external_format) == Sdefault)
+           ;   /* do nothing */
+       else
+           LispDestroy("%s: only :%s and %s supported for :EXTERNAL-FORMAT, not %s",
+                       STRFUN(builtin), Sdefault->value, Scharacter->value, STROBJ(external_format));
+    }
+
+    string = THESTR(command_line);
+    program = LispMalloc(sizeof(LispPipe));
+    if (direction != DIR_PROBE) {
+       argv[0] = "sh";
+       argv[1] = "-c";
+       argv[2] = string;
+       argv[3] = NULL;
+       pipe(ifd);
+       pipe(ofd);
+       pipe(efd);
+       if ((program->pid = fork()) == 0) {
+           close(0);
+           close(1);
+           close(2);
+           dup2(ofd[0], 0);
+           dup2(ifd[1], 1);
+           dup2(efd[1], 2);
+           close(ifd[0]);
+           close(ifd[1]);
+           close(ofd[0]);
+           close(ofd[1]);
+           close(efd[0]);
+           close(efd[1]);
+           execve("/bin/sh", argv, environ);
+           exit(-1);
+       }
+       else if (program->pid < 0)
+           LispDestroy("%s: fork: %s", STRFUN(builtin), strerror(errno));
+
+       program->input = LispFdopen(ifd[0], FILE_READ | FILE_UNBUFFERED);
+       close(ifd[1]);
+       program->output = LispFdopen(ofd[1], FILE_WRITE | FILE_UNBUFFERED);
+       close(ofd[0]);
+       error_file = LispFdopen(efd[0], FILE_READ | FILE_UNBUFFERED);
+       close(efd[1]);
+    }
+    else {
+       program->pid = -1;
+       program->input = program->output = error_file = NULL;
+    }
+
+    flags = direction == DIR_PROBE ? 0 : STREAM_READ;
+    program->errorp = FILESTREAM(error_file, command_line, flags);
+
+    flags = 0;
+    if (direction != DIR_PROBE) {
+       if (direction == DIR_INPUT || direction == DIR_IO)
+           flags |= STREAM_READ;
+       if (direction == DIR_OUTPUT || direction == DIR_IO)
+           flags |= STREAM_WRITE;
+    }
+    stream = PIPESTREAM(program, command_line, flags);
+    LispMused(program);
+
+    return (stream);
+}
+
+/* Helper function, primarily for use with the xt module
+ */
+LispObj *
+Lisp_PipeBroken(LispBuiltin *builtin)
+/*
+ pipe-broken pipe-stream
+ */
+{
+    int pid, status, retval;
+    LispObj *result = NIL;
+
+    LispObj *pipe_stream;
+
+    pipe_stream = ARGUMENT(0);
+
+    if (!STREAMP(pipe_stream) ||
+       pipe_stream->data.stream.type != LispStreamPipe)
+       LispDestroy("%s: %s is not a pipe stream",
+                   STRFUN(builtin), STROBJ(pipe_stream));
+
+    if ((pid = PIDPSTREAMP(pipe_stream)) > 0) {
+       retval = waitpid(pid, &status, WNOHANG | WUNTRACED);
+       if (retval == pid || (retval == -1 && errno == ECHILD))
+           result = T;
+    }
+
+    return (result);
+}
+
+/*
+ Helper function, so that it is not required to redirect error output
+ */
+LispObj *
+Lisp_PipeErrorStream(LispBuiltin *builtin)
+/*
+ pipe-error-stream pipe-stream
+ */
+{
+    LispObj *pipe_stream;
+
+    pipe_stream = ARGUMENT(0);
+
+    if (!STREAMP(pipe_stream) ||
+       pipe_stream->data.stream.type != LispStreamPipe)
+       LispDestroy("%s: %s is not a pipe stream",
+                   STRFUN(builtin), STROBJ(pipe_stream));
+
+    return (pipe_stream->data.stream.source.program->errorp);
+}
+
+/*
+ Helper function, primarily for use with the xt module
+ */
+LispObj *
+Lisp_PipeInputDescriptor(LispBuiltin *builtin)
+/*
+ pipe-input-descriptor pipe-stream
+ */
+{
+    LispObj *pipe_stream;
+
+    pipe_stream = ARGUMENT(0);
+
+    if (!STREAMP(pipe_stream) ||
+       pipe_stream->data.stream.type != LispStreamPipe)
+       LispDestroy("%s: %s is not a pipe stream",
+                   STRFUN(builtin), STROBJ(pipe_stream));
+    if (!IPSTREAMP(pipe_stream))
+       LispDestroy("%s: pipe %s is unreadable",
+                   STRFUN(builtin), STROBJ(pipe_stream));
+
+    return (INTEGER(LispFileno(IPSTREAMP(pipe_stream))));
+}
+
+/*
+ Helper function, primarily for use with the xt module
+ */
+LispObj *
+Lisp_PipeErrorDescriptor(LispBuiltin *builtin)
+/*
+ pipe-error-descriptor pipe-stream
+ */
+{
+    LispObj *pipe_stream;
+
+    pipe_stream = ARGUMENT(0);
+
+    if (!STREAMP(pipe_stream) ||
+       pipe_stream->data.stream.type != LispStreamPipe)
+       LispDestroy("%s: %s is not a pipe stream",
+                   STRFUN(builtin), STROBJ(pipe_stream));
+    if (!EPSTREAMP(pipe_stream))
+       LispDestroy("%s: pipe %s is closed",
+                   STRFUN(builtin), STROBJ(pipe_stream));
+
+    return (INTEGER(LispFileno(EPSTREAMP(pipe_stream))));
+}
diff --git a/xedit/lisp/stream.h b/xedit/lisp/stream.h
new file mode 100644 (file)
index 0000000..10dda69
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/stream.h,v 1.8tsi Exp $ */
+
+#ifndef Lisp_stream_h
+#define Lisp_stream_h
+
+#include "lisp/io.h"
+#include "lisp/internal.h"
+
+void LispStreamInit(void);
+
+LispObj *Lisp_DeleteFile(LispBuiltin*);
+LispObj *Lisp_RenameFile(LispBuiltin*);
+LispObj *Lisp_InputStreamP(LispBuiltin*);
+LispObj *Lisp_OpenStreamP(LispBuiltin*);
+LispObj *Lisp_OutputStreamP(LispBuiltin*);
+LispObj *Lisp_Open(LispBuiltin*);
+LispObj *Lisp_MakePipe(LispBuiltin*);
+LispObj *Lisp_PipeBroken(LispBuiltin*);
+LispObj *Lisp_PipeErrorStream(LispBuiltin*);
+LispObj *Lisp_PipeInputDescriptor(LispBuiltin*);
+LispObj *Lisp_PipeErrorDescriptor(LispBuiltin*);
+LispObj *Lisp_Close(LispBuiltin*);
+LispObj *Lisp_Listen(LispBuiltin*);
+LispObj *Lisp_Streamp(LispBuiltin*);
+LispObj *Lisp_MakeStringInputStream(LispBuiltin*);
+LispObj *Lisp_MakeStringOutputStream(LispBuiltin*);
+LispObj *Lisp_GetOutputStreamString(LispBuiltin*);
+
+#endif /* Lisp_stream_h */
diff --git a/xedit/lisp/string.c b/xedit/lisp/string.c
new file mode 100644 (file)
index 0000000..604fb6c
--- /dev/null
@@ -0,0 +1,1387 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XdotOrg: xc/programs/xedit/lisp/string.c,v 1.2 2004/04/23 19:54:44 eich Exp $ */
+/* $XFree86: xc/programs/xedit/lisp/string.c,v 1.24tsi Exp $ */
+
+#include "lisp/helper.h"
+#include "lisp/read.h"
+#include "lisp/string.h"
+#include "lisp/private.h"
+#include <ctype.h>
+
+#define CHAR_LESS              1
+#define CHAR_LESS_EQUAL                2
+#define CHAR_EQUAL             3
+#define CHAR_GREATER_EQUAL     4
+#define CHAR_GREATER           5
+#define CHAR_NOT_EQUAL         6
+
+#define CHAR_ALPHAP            1
+#define CHAR_DOWNCASE          2
+#define CHAR_UPCASE            3
+#define CHAR_INT               4
+#define CHAR_BOTHP             5
+#define CHAR_UPPERP            6
+#define CHAR_LOWERP            7
+#define CHAR_GRAPHICP          8
+
+#ifndef MIN
+#define MIN(a, b)              ((a) < (b) ? (a) : (b))
+#endif
+
+/*
+ * Prototypes
+ */
+static LispObj *LispCharCompare(LispBuiltin*, int, int);
+static LispObj *LispStringCompare(LispBuiltin*, int, int);
+static LispObj *LispCharOp(LispBuiltin*, int);
+static LispObj *LispStringTrim(LispBuiltin*, int, int, int);
+static LispObj *LispStringUpcase(LispBuiltin*, int);
+static LispObj *LispStringDowncase(LispBuiltin*, int);
+static LispObj *LispStringCapitalize(LispBuiltin*, int);
+
+/*
+ * Implementation
+ */
+static LispObj *
+LispCharCompare(LispBuiltin *builtin, int operation, int ignore_case)
+{
+    LispObj *object;
+    int cmp, value, next_value;
+
+    LispObj *character, *more_characters;
+
+    more_characters = ARGUMENT(1);
+    character = ARGUMENT(0);
+
+    CHECK_SCHAR(character);
+    value = SCHAR_VALUE(character);
+    if (ignore_case && islower(value))
+       value = toupper(value);
+
+    if (!CONSP(more_characters))
+       return (T);
+
+    /* First check if all parameters are characters */
+    for (object = more_characters; CONSP(object); object = CDR(object))
+       CHECK_SCHAR(CAR(object));
+
+    /* All characters in list must be different */
+    if (operation == CHAR_NOT_EQUAL) {
+       /* Compare all characters */
+       do {
+           for (object = more_characters; CONSP(object); object = CDR(object)) {
+               character = CAR(object);
+               next_value = SCHAR_VALUE(character);
+               if (ignore_case && islower(next_value))
+                   next_value = toupper(next_value);
+               if (value == next_value)
+                   return (NIL);
+           }
+           value = SCHAR_VALUE(CAR(more_characters));
+           if (ignore_case && islower(value))
+               value = toupper(value);
+           more_characters = CDR(more_characters);
+       } while (CONSP(more_characters));
+
+       return (T);
+    }
+
+    /* Linearly compare characters */
+    for (; CONSP(more_characters); more_characters = CDR(more_characters)) {
+       character = CAR(more_characters);
+       next_value = SCHAR_VALUE(character);
+       if (ignore_case && islower(next_value))
+           next_value = toupper(next_value);
+
+       switch (operation) {
+           case CHAR_LESS:             cmp = value < next_value;       break;
+           case CHAR_LESS_EQUAL:       cmp = value <= next_value;      break;
+           case CHAR_EQUAL:            cmp = value == next_value;      break;
+           case CHAR_GREATER_EQUAL:    cmp = value >= next_value;      break;
+           case CHAR_GREATER:          cmp = value > next_value;       break;
+           default:                    cmp = 0;                        break;
+       }
+
+       if (!cmp)
+           return (NIL);
+       value = next_value;
+    }
+
+    return (T);
+}
+
+LispObj *
+Lisp_CharLess(LispBuiltin *builtin)
+/*
+ char< character &rest more-characters
+ */
+{
+    return (LispCharCompare(builtin, CHAR_LESS, 0));
+}
+
+LispObj *
+Lisp_CharLessEqual(LispBuiltin *builtin)
+/*
+ char<= character &rest more-characters
+ */
+{
+    return (LispCharCompare(builtin, CHAR_LESS_EQUAL, 0));
+}
+
+LispObj *
+Lisp_CharEqual_(LispBuiltin *builtin)
+/*
+ char= character &rest more-characters
+ */
+{
+    return (LispCharCompare(builtin, CHAR_EQUAL, 0));
+}
+
+LispObj *
+Lisp_CharGreater(LispBuiltin *builtin)
+/*
+ char> character &rest more-characters
+ */
+{
+    return (LispCharCompare(builtin, CHAR_GREATER, 0));
+}
+
+LispObj *
+Lisp_CharGreaterEqual(LispBuiltin *builtin)
+/*
+ char>= character &rest more-characters
+ */
+{
+    return (LispCharCompare(builtin, CHAR_GREATER_EQUAL, 0));
+}
+
+LispObj *
+Lisp_CharNotEqual_(LispBuiltin *builtin)
+/*
+ char/= character &rest more-characters
+ */
+{
+    return (LispCharCompare(builtin, CHAR_NOT_EQUAL, 0));
+}
+
+LispObj *
+Lisp_CharLessp(LispBuiltin *builtin)
+/*
+ char-lessp character &rest more-characters
+ */
+{
+    return (LispCharCompare(builtin, CHAR_LESS, 1));
+}
+
+LispObj *
+Lisp_CharNotGreaterp(LispBuiltin *builtin)
+/*
+ char-not-greaterp character &rest more-characters
+ */
+{
+    return (LispCharCompare(builtin, CHAR_LESS_EQUAL, 1));
+}
+
+LispObj *
+Lisp_CharEqual(LispBuiltin *builtin)
+/*
+ char-equalp character &rest more-characters
+ */
+{
+    return (LispCharCompare(builtin, CHAR_EQUAL, 1));
+}
+
+LispObj *
+Lisp_CharGreaterp(LispBuiltin *builtin)
+/*
+ char-greaterp character &rest more-characters
+ */
+{
+    return (LispCharCompare(builtin, CHAR_GREATER, 1));
+}
+
+LispObj *
+Lisp_CharNotLessp(LispBuiltin *builtin)
+/*
+ char-not-lessp &rest more-characters
+ */
+{
+    return (LispCharCompare(builtin, CHAR_GREATER_EQUAL, 1));
+}
+
+LispObj *
+Lisp_CharNotEqual(LispBuiltin *builtin)
+/*
+ char-not-equal character &rest more-characters
+ */
+{
+    return (LispCharCompare(builtin, CHAR_NOT_EQUAL, 1));
+}
+
+static LispObj *
+LispCharOp(LispBuiltin *builtin, int operation)
+{
+    int value;
+    LispObj *result, *character;
+
+    character = ARGUMENT(0);
+    CHECK_SCHAR(character);
+    value = (int)SCHAR_VALUE(character);
+
+    switch (operation) {
+       case CHAR_ALPHAP:
+           result = isalpha(value) ? T : NIL;
+           break;
+       case CHAR_DOWNCASE:
+           result = SCHAR(tolower(value));
+           break;
+       case CHAR_UPCASE:
+           result = SCHAR(toupper(value));
+           break;
+       case CHAR_INT:
+           result = FIXNUM(value);
+           break;
+       case CHAR_BOTHP:
+           result = isupper(value) || islower(value) ? T : NIL;
+           break;
+       case CHAR_UPPERP:
+           result = isupper(value) ? T : NIL;
+           break;
+       case CHAR_LOWERP:
+           result = islower(value) ? T : NIL;
+           break;
+       case CHAR_GRAPHICP:
+           result = value == ' ' || isgraph(value) ? T : NIL;
+           break;
+       default:
+           result = NIL;
+           break;
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_AlphaCharP(LispBuiltin *builtin)
+/*
+ alpha-char-p char
+ */
+{
+    return (LispCharOp(builtin, CHAR_ALPHAP));
+}
+
+LispObj *
+Lisp_CharDowncase(LispBuiltin *builtin)
+/*
+ char-downcase character
+ */
+{
+    return (LispCharOp(builtin, CHAR_DOWNCASE));
+}
+
+LispObj *
+Lisp_CharInt(LispBuiltin *builtin)
+/*
+ char-int character
+ char-code character
+ */
+{
+    return (LispCharOp(builtin, CHAR_INT));
+}
+
+LispObj *
+Lisp_CharUpcase(LispBuiltin *builtin)
+/*
+ char-upcase character
+ */
+{
+    return (LispCharOp(builtin, CHAR_UPCASE));
+}
+
+LispObj *
+Lisp_BothCaseP(LispBuiltin *builtin)
+/*
+ both-case-p character
+ */
+{
+    return (LispCharOp(builtin, CHAR_BOTHP));
+}
+
+LispObj *
+Lisp_UpperCaseP(LispBuiltin *builtin)
+/*
+ upper-case-p character
+ */
+{
+    return (LispCharOp(builtin, CHAR_UPPERP));
+}
+
+LispObj *
+Lisp_LowerCaseP(LispBuiltin *builtin)
+/*
+ upper-case-p character
+ */
+{
+    return (LispCharOp(builtin, CHAR_LOWERP));
+}
+
+LispObj *
+Lisp_GraphicCharP(LispBuiltin *builtin)
+/*
+ graphic-char-p char
+ */
+{
+    return (LispCharOp(builtin, CHAR_GRAPHICP));
+}
+
+LispObj *
+Lisp_Char(LispBuiltin *builtin)
+/*
+ char string index
+ schar simple-string index
+ */
+{
+    unsigned char *string;
+    long offset, length;
+
+    LispObj *ostring, *oindex;
+
+    oindex = ARGUMENT(1);
+    ostring = ARGUMENT(0);
+
+    CHECK_STRING(ostring);
+    CHECK_INDEX(oindex);
+    offset = FIXNUM_VALUE(oindex);
+    string = (unsigned char*)THESTR(ostring);
+    length = STRLEN(ostring);
+
+    if (offset >= length)
+       LispDestroy("%s: index %ld too large for string length %ld",
+                   STRFUN(builtin), offset, length);
+
+    return (SCHAR(string[offset]));
+}
+
+/* helper function for setf
+ *     DONT explicitly call. Non standard function
+ */
+LispObj *
+Lisp_XeditCharStore(LispBuiltin *builtin)
+/*
+ xedit::char-store string index value
+ */
+{
+    int character;
+    long offset, length;
+    LispObj *ostring, *oindex, *ovalue;
+
+    ovalue = ARGUMENT(2);
+    oindex = ARGUMENT(1);
+    ostring = ARGUMENT(0);
+
+    CHECK_STRING(ostring);
+    CHECK_INDEX(oindex);
+    length = STRLEN(ostring);
+    offset = FIXNUM_VALUE(oindex);
+    if (offset >= length)
+       LispDestroy("%s: index %ld too large for string length %ld",
+                   STRFUN(builtin), offset, length);
+    CHECK_SCHAR(ovalue);
+    CHECK_STRING_WRITABLE(ostring);
+
+    character = SCHAR_VALUE(ovalue);
+
+    if (character < 0 || character > 255)
+       LispDestroy("%s: cannot represent character %d",
+                   STRFUN(builtin), character);
+
+    THESTR(ostring)[offset] = character;
+
+    return (ovalue);
+}
+
+LispObj *
+Lisp_Character(LispBuiltin *builtin)
+/*
+ character object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (LispCharacterCoerce(builtin, object));
+}
+
+LispObj *
+Lisp_Characterp(LispBuiltin *builtin)
+/*
+ characterp object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (SCHARP(object) ? T : NIL);
+}
+
+LispObj *
+Lisp_DigitChar(LispBuiltin *builtin)
+/*
+ digit-char weight &optional radix
+ */
+{
+    long radix = 10, weight;
+    LispObj *oweight, *oradix, *result = NIL;
+
+    oradix = ARGUMENT(1);
+    oweight = ARGUMENT(0);
+
+    CHECK_FIXNUM(oweight);
+    weight = FIXNUM_VALUE(oweight);
+
+    if (oradix != UNSPEC) {
+       CHECK_INDEX(oradix);
+       radix = FIXNUM_VALUE(oradix);
+    }
+    if (radix < 2 || radix > 36)
+       LispDestroy("%s: radix must be >= 2 and <= 36, not %ld",
+                   STRFUN(builtin), radix);
+
+    if (weight >= 0 && weight < radix) {
+       if (weight < 9)
+           weight += '0';
+       else
+           weight += 'A' - 10;
+       result = SCHAR(weight);
+    }
+
+    return (result);
+}
+
+LispObj *
+Lisp_DigitCharP(LispBuiltin *builtin)
+/*
+ digit-char-p character &optional radix
+ */
+{
+    long radix = 10, character;
+    LispObj *ochar, *oradix, *result = NIL;
+
+    oradix = ARGUMENT(1);
+    ochar = ARGUMENT(0);
+
+    CHECK_SCHAR(ochar);
+    character = SCHAR_VALUE(ochar);
+    if (oradix != UNSPEC) {
+       CHECK_INDEX(oradix);
+       radix = FIXNUM_VALUE(oradix);
+    }
+    if (radix < 2 || radix > 36)
+       LispDestroy("%s: radix must be >= 2 and <= 36, not %ld",
+                   STRFUN(builtin), radix);
+
+    if (character >= '0' && character <= '9')
+       character -= '0';
+    else if (character >= 'A' && character <= 'Z')
+       character -= 'A' - 10;
+    else if (character >= 'a' && character <= 'z')
+       character -= 'a' - 10;
+    if (character < radix)
+       result = FIXNUM(character);
+
+    return (result);
+}
+
+LispObj *
+Lisp_IntChar(LispBuiltin *builtin)
+/*
+ int-char integer
+ code-char integer
+ */
+{
+    long character = 0;
+    LispObj *integer;
+
+    integer = ARGUMENT(0);
+
+    CHECK_FIXNUM(integer);
+    character = FIXNUM_VALUE(integer);
+
+    return (character >= 0 && character < 0xff ? SCHAR(character) : NIL);
+}
+
+/* XXX ignoring element-type */
+LispObj *
+Lisp_MakeString(LispBuiltin *builtin)
+/*
+ make-string size &key initial-element element-type
+ */
+{
+    long length;
+    char *string, initial;
+
+    LispObj *size, *initial_element;
+
+    initial_element = ARGUMENT(1);
+    size = ARGUMENT(0);
+
+    CHECK_INDEX(size);
+    length = FIXNUM_VALUE(size);
+    if (initial_element != UNSPEC) {
+       CHECK_SCHAR(initial_element);
+       initial = SCHAR_VALUE(initial_element);
+    }
+    else
+       initial = 0;
+
+    string = LispMalloc(length + 1);
+    memset(string, initial, length);
+    string[length] = '\0';
+
+    return (LSTRING2(string, length));
+}
+
+LispObj *
+Lisp_ParseInteger(LispBuiltin *builtin)
+/*
+ parse-integer string &key start end radix junk-allowed
+ */
+{
+    GC_ENTER();
+    char *ptr, *string;
+    int character, junk, sign, overflow;
+    long i, start, end, radix, length, integer, check;
+    LispObj *result;
+
+    LispObj *ostring, *ostart, *oend, *oradix, *junk_allowed;
+
+    junk_allowed = ARGUMENT(4);
+    oradix = ARGUMENT(3);
+    oend = ARGUMENT(2);
+    ostart = ARGUMENT(1);
+    ostring = ARGUMENT(0);
+
+    start = end = radix = 0;
+    result = NIL;
+
+    CHECK_STRING(ostring);
+    LispCheckSequenceStartEnd(builtin, ostring, ostart, oend,
+                             &start, &end, &length);
+    string = THESTR(ostring);
+    if (oradix == UNSPEC)
+       radix = 10;
+    else {
+       CHECK_INDEX(oradix);
+       radix = FIXNUM_VALUE(oradix);
+    }
+    if (radix < 2 || radix > 36)
+       LispDestroy("%s: :RADIX %ld must be in the range 2 to 36",
+                   STRFUN(builtin), radix);
+
+    integer = check = 0;
+    ptr = string + start;
+    sign = overflow = 0;
+
+    /* Skip leading white spaces */
+    for (i = start; i < end && *ptr && isspace(*ptr); ptr++, i++)
+       ;
+
+    /* Check for sign specification */
+    if (i < end && (*ptr == '-' || *ptr == '+')) {
+       sign = *ptr == '-';
+       ++ptr;
+       ++i;
+    }
+
+    for (junk = 0; i < end; i++, ptr++) {
+       character = *ptr;
+       if (islower(character))
+           character = toupper(character);
+       if (character >= '0' && character <= '9') {
+           if (character - '0' >= radix)
+               junk = 1;
+           else {
+               check = integer;
+               integer = integer * radix + character - '0';
+           }
+       }
+       else if (character >= 'A' && character <= 'Z') {
+           if (character - 'A' + 10 >= radix)
+               junk = 1;
+           else {
+               check = integer;
+               integer = integer * radix + character - 'A' + 10;
+           }
+       }
+       else {
+           if (isspace(character))
+               break;
+           junk = 1;
+       }
+
+       if (junk)
+           break;
+
+       if (!overflow && check > integer)
+           overflow = 1;
+       /* keep looping just to count read bytes */
+    }
+
+    if (!junk)
+       /* Skip white spaces */
+       for (; i < end && *ptr && isspace(*ptr); ptr++, i++)
+           ;
+
+    if ((junk || ptr == string) &&
+       (junk_allowed == UNSPEC || junk_allowed == NIL))
+       LispDestroy("%s: %s has a bad integer representation",
+                   STRFUN(builtin), STROBJ(ostring));
+    else if (ptr == string)
+       result = NIL;
+    else if (overflow) {
+       mpi *bigi = LispMalloc(sizeof(mpi));
+       char *str;
+
+       length = end - start + sign;
+       str = LispMalloc(length + 1);
+
+       strncpy(str, string - sign, length + sign);
+       str[length + sign] = '\0';
+       mpi_init(bigi);
+       mpi_setstr(bigi, str, radix);
+       LispFree(str);
+       result = BIGNUM(bigi);
+    }
+    else
+       result = INTEGER(sign ? -integer : integer);
+
+    GC_PROTECT(result);
+    RETURN(0) = FIXNUM(i);
+    RETURN_COUNT = 1;
+    GC_LEAVE();
+
+    return (result);
+}
+
+LispObj *
+Lisp_String(LispBuiltin *builtin)
+/*
+ string object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (LispStringCoerce(builtin, object));
+}
+
+LispObj *
+Lisp_Stringp(LispBuiltin *builtin)
+/*
+ stringp object
+ */
+{
+    LispObj *object;
+
+    object = ARGUMENT(0);
+
+    return (STRINGP(object) ? T : NIL);
+}
+
+/* XXX preserve-whitespace is being ignored */
+LispObj *
+Lisp_ReadFromString(LispBuiltin *builtin)
+/*
+ read-from-string string &optional eof-error-p eof-value &key start end preserve-whitespace
+ */
+{
+    GC_ENTER();
+    char *string;
+    LispObj *stream, *result;
+    long length, start, end, bytes_read;
+
+    LispObj *ostring, *eof_error_p, *eof_value, *ostart, *oend;
+
+    oend = ARGUMENT(4);
+    ostart = ARGUMENT(3);
+    eof_value = ARGUMENT(2);
+    eof_error_p = ARGUMENT(1);
+    ostring = ARGUMENT(0);
+
+    CHECK_STRING(ostring);
+    string = THESTR(ostring);
+    LispCheckSequenceStartEnd(builtin, ostring, ostart, oend,
+                             &start, &end, &length);
+
+    if (start > 0 || end < length)
+       length = end - start;
+    stream = LSTRINGSTREAM(string + start, STREAM_READ, length);
+
+    if (eof_value == UNSPEC)
+       eof_value = NIL;
+
+    LispPushInput(stream);
+    result = LispRead();
+    /* stream->data.stream.source.string->input is
+     * the offset of the last byte read in string */
+    bytes_read = stream->data.stream.source.string->input;
+    LispPopInput(stream);
+
+    if (result == NULL) {
+       if (eof_error_p == NIL)
+           result = eof_value;
+       else
+           LispDestroy("%s: unexpected end of input", STRFUN(builtin));
+    }
+
+    GC_PROTECT(result);
+    RETURN(0) = FIXNUM(start + bytes_read);
+    RETURN_COUNT = 1;
+    GC_LEAVE();
+
+    return (result);
+}
+
+static LispObj *
+LispStringTrim(LispBuiltin *builtin, int left, int right, int inplace)
+/*
+ string-{,left-,right-}trim character-bag string
+*/
+{
+    unsigned char *string;
+    long start, end, length;
+
+    LispObj *ochars, *ostring;
+
+    ostring = ARGUMENT(1);
+    ochars = ARGUMENT(0);
+
+    if (!POINTERP(ochars) || !(XSTRINGP(ochars) || XCONSP(ochars))) {
+       if (ARRAYP(ochars) && ochars->data.array.rank == 1)
+           ochars = ochars->data.array.list;
+       else
+           LispDestroy("%s: %s is not a sequence",
+                       STRFUN(builtin), STROBJ(ochars));
+    }
+    CHECK_STRING(ostring);
+
+    string = (unsigned char*)THESTR(ostring);
+    length = STRLEN(ostring);
+
+    start = 0;
+    end = length;
+
+    if (XSTRINGP(ochars)) {
+       unsigned char *chars = (unsigned char*)THESTR(ochars);
+       long i, clength = STRLEN(ochars);
+
+       if (left) {
+           for (; start < end; start++) {
+               for (i = 0; i < clength; i++)
+                   if (string[start] == chars[i])
+                       break;
+               if (i >= clength)
+                   break;
+           }
+       }
+       if (right) {
+           for (--end; end >= 0; end--) {
+               for (i = 0; i < clength; i++)
+                   if (string[end] == chars[i])
+                       break;
+               if (i >= clength)
+                   break;
+           }
+           ++end;
+       }
+    }
+    else {
+       LispObj *ochar, *list;
+
+       if (left) {
+           for (; start < end; start++) {
+               for (list = ochars; CONSP(list); list = CDR(list)) {
+                   ochar = CAR(list);
+                   if (SCHARP(ochar) && string[start] == SCHAR_VALUE(ochar))
+                       break;
+               }
+               if (!CONSP(list))
+                   break;
+           }
+       }
+       if (right) {
+           for (--end; end >= 0; end--) {
+               for (list = ochars; CONSP(list); list = CDR(list)) {
+                   ochar = CAR(list);
+                   if (SCHARP(ochar) && string[end] == SCHAR_VALUE(ochar))
+                       break;
+               }
+               if (!CONSP(list))
+                   break;
+           }
+           ++end;
+       }
+    }
+
+    if (start == 0 && end == length)
+       return (ostring);
+
+    length = end - start;
+
+    if (inplace) {
+       CHECK_STRING_WRITABLE(ostring);
+       memmove(string, string + start, length);
+       string[length] = '\0';
+       STRLEN(ostring) = length;
+    }
+    else {
+       string = LispMalloc(length + 1);
+       memcpy(string, THESTR(ostring) + start, length);
+       string[length] = '\0';
+       ostring = LSTRING2((char*)string, length);
+    }
+
+    return (ostring);
+}
+
+LispObj *
+Lisp_StringTrim(LispBuiltin *builtin)
+/*
+ string-trim character-bag string
+ */
+{
+    return (LispStringTrim(builtin, 1, 1, 0));
+}
+
+LispObj *
+Lisp_NstringTrim(LispBuiltin *builtin)
+/*
+ ext::nstring-trim character-bag string
+ */
+{
+    return (LispStringTrim(builtin, 1, 1, 1));
+}
+
+LispObj *
+Lisp_StringLeftTrim(LispBuiltin *builtin)
+/*
+ string-left-trim character-bag string
+ */
+{
+    return (LispStringTrim(builtin, 1, 0, 0));
+}
+
+LispObj *
+Lisp_NstringLeftTrim(LispBuiltin *builtin)
+/*
+ ext::nstring-left-trim character-bag string
+ */
+{
+    return (LispStringTrim(builtin, 1, 0, 1));
+}
+
+LispObj *
+Lisp_StringRightTrim(LispBuiltin *builtin)
+/*
+ string-right-trim character-bag string
+ */
+{
+    return (LispStringTrim(builtin, 0, 1, 0));
+}
+
+LispObj *
+Lisp_NstringRightTrim(LispBuiltin *builtin)
+/*
+ ext::nstring-right-trim character-bag string
+ */
+{
+    return (LispStringTrim(builtin, 0, 1, 1));
+}
+
+static LispObj *
+LispStringCompare(LispBuiltin *builtin, int function, int ignore_case)
+{
+    int cmp1, cmp2;
+    LispObj *fixnum;
+    unsigned char *string1, *string2;
+    long start1, end1, start2, end2, offset, length;
+
+    LispGetStringArgs(builtin, (char**)&string1, (char**)&string2,
+                     &start1, &end1, &start2, &end2);
+
+    string1 += start1;
+    string2 += start2;
+
+    if (function == CHAR_EQUAL) {
+       length = end1 - start1;
+
+       if (length != (end2 - start2))
+           return (NIL);
+
+       if (!ignore_case)
+           return (memcmp(string1, string2, length) ? NIL : T);
+
+       for (; length; length--, string1++, string2++)
+           if (toupper(*string1) != toupper(*string2))
+               return (NIL);
+       return (T);
+    }
+
+    end1 -= start1;
+    end2 -= start2;
+    length = MIN(end1, end2);
+    for (offset = 0;
+        offset < length;
+        string1++, string2++, offset++, start1++, start2++) {
+       cmp1 = *string1;
+       cmp2 = *string2;
+       if (ignore_case) {
+           cmp1 = toupper(cmp1);
+           cmp2 = toupper(cmp2);
+       }
+       if (cmp1 != cmp2) {
+           fixnum = FIXNUM(start1);
+           switch (function) {
+               case CHAR_LESS:
+                   return ((cmp1 < cmp2) ? fixnum : NIL);
+               case CHAR_LESS_EQUAL:
+                   return ((cmp1 <= cmp2) ? fixnum : NIL);
+               case CHAR_NOT_EQUAL:
+                   return (fixnum);
+               case CHAR_GREATER_EQUAL:
+                   return ((cmp1 >= cmp2) ? fixnum : NIL);
+               case CHAR_GREATER:
+                   return ((cmp1 > cmp2) ? fixnum : NIL);
+           }
+       }
+    }
+
+    fixnum = FIXNUM(start1);
+    switch (function) {
+       case CHAR_LESS:
+           return (start1 >= end1 && start2 < end2 ? fixnum : NIL);
+       case CHAR_LESS_EQUAL:
+           return (start1 >= end1 ? fixnum : NIL);
+       case CHAR_NOT_EQUAL:
+           return (start1 >= end1 && start2 >= end2 ? NIL : fixnum);
+       case CHAR_GREATER_EQUAL:
+           return (start2 >= end2 ? fixnum : NIL);
+       case CHAR_GREATER:
+           return (start2 >= end2 && start1 < end1 ? fixnum : NIL);
+    }
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_StringEqual_(LispBuiltin *builtin)
+/*
+ string= string1 string2 &key start1 end1 start2 end2
+ */
+{
+    return (LispStringCompare(builtin, CHAR_EQUAL, 0));
+}
+
+LispObj *
+Lisp_StringLess(LispBuiltin *builtin)
+/*
+ string< string1 string2 &key start1 end1 start2 end2
+ */
+{
+    return (LispStringCompare(builtin, CHAR_LESS, 0));
+}
+
+LispObj *
+Lisp_StringGreater(LispBuiltin *builtin)
+/*
+ string> string1 string2 &key start1 end1 start2 end2
+ */
+{
+    return (LispStringCompare(builtin, CHAR_GREATER, 0));
+}
+
+LispObj *
+Lisp_StringLessEqual(LispBuiltin *builtin)
+/*
+ string<= string1 string2 &key start1 end1 start2 end2
+ */
+{
+    return (LispStringCompare(builtin, CHAR_LESS_EQUAL, 0));
+}
+
+LispObj *
+Lisp_StringGreaterEqual(LispBuiltin *builtin)
+/*
+ string>= string1 string2 &key start1 end1 start2 end2
+ */
+{
+    return (LispStringCompare(builtin, CHAR_GREATER_EQUAL, 0));
+}
+
+LispObj *
+Lisp_StringNotEqual_(LispBuiltin *builtin)
+/*
+ string/= string1 string2 &key start1 end1 start2 end2
+ */
+{
+    return (LispStringCompare(builtin, CHAR_NOT_EQUAL, 0));
+}
+
+LispObj *
+Lisp_StringEqual(LispBuiltin *builtin)
+/*
+ string-equal string1 string2 &key start1 end1 start2 end2
+ */
+{
+    return (LispStringCompare(builtin, CHAR_EQUAL, 1));
+}
+
+LispObj *
+Lisp_StringLessp(LispBuiltin *builtin)
+/*
+ string-lessp string1 string2 &key start1 end1 start2 end2
+ */
+{
+    return (LispStringCompare(builtin, CHAR_LESS, 1));
+}
+
+LispObj *
+Lisp_StringGreaterp(LispBuiltin *builtin)
+/*
+ string-greaterp string1 string2 &key start1 end1 start2 end2
+ */
+{
+    return (LispStringCompare(builtin, CHAR_GREATER, 1));
+}
+
+LispObj *
+Lisp_StringNotGreaterp(LispBuiltin *builtin)
+/*
+ string-not-greaterp string1 string2 &key start1 end1 start2 end2
+ */
+{
+    return (LispStringCompare(builtin, CHAR_LESS_EQUAL, 1));
+}
+
+LispObj *
+Lisp_StringNotLessp(LispBuiltin *builtin)
+/*
+ string-not-lessp string1 string2 &key start1 end1 start2 end2
+ */
+{
+    return (LispStringCompare(builtin, CHAR_GREATER_EQUAL, 1));
+}
+
+LispObj *
+Lisp_StringNotEqual(LispBuiltin *builtin)
+/*
+ string-not-equal string1 string2 &key start1 end1 start2 end2
+ */
+{
+    return (LispStringCompare(builtin, CHAR_NOT_EQUAL, 1));
+}
+
+LispObj *
+LispStringUpcase(LispBuiltin *builtin, int inplace)
+/*
+ string-upcase string &key start end
+ nstring-upcase string &key start end
+ */
+{
+    LispObj *result;
+    char *string, *newstring;
+    long start, end, length, offset;
+
+    LispObj *ostring, *ostart, *oend;
+
+    oend = ARGUMENT(2);
+    ostart = ARGUMENT(1);
+    ostring = ARGUMENT(0);
+    CHECK_STRING(ostring);
+    LispCheckSequenceStartEnd(builtin, ostring, ostart, oend,
+                             &start, &end, &offset);
+    result = ostring;
+    string = THESTR(ostring);
+    length = STRLEN(ostring);
+
+    /* first check if something need to be done */
+    for (offset = start; offset < end; offset++)
+       if (string[offset] != toupper(string[offset]))
+           break;
+
+    if (offset >= end)
+       return (result);
+
+    if (inplace) {
+       CHECK_STRING_WRITABLE(ostring);
+       newstring = string;
+    }
+    else {
+       /* upcase a copy of argument */
+       newstring = LispMalloc(length + 1);
+       if (offset)
+           memcpy(newstring, string, offset);
+       if (length > end)
+           memcpy(newstring + end, string + end, length - end);
+       newstring[length] = '\0';
+    }
+
+    for (; offset < end; offset++)
+       newstring[offset] = toupper(string[offset]);
+
+    if (!inplace)
+       result = LSTRING2(newstring, length);
+
+    return (result);
+}
+
+LispObj *
+Lisp_StringUpcase(LispBuiltin *builtin)
+/*
+ string-upcase string &key start end
+ */
+{
+    return (LispStringUpcase(builtin, 0));
+}
+
+LispObj *
+Lisp_NstringUpcase(LispBuiltin *builtin)
+/*
+ nstring-upcase string &key start end
+ */
+{
+    return (LispStringUpcase(builtin, 1));
+}
+
+LispObj *
+LispStringDowncase(LispBuiltin *builtin, int inplace)
+/*
+ string-downcase string &key start end
+ nstring-downcase string &key start end
+ */
+{
+    LispObj *result;
+    char *string, *newstring;
+    long start, end, length, offset;
+
+    LispObj *ostring, *ostart, *oend;
+
+    oend = ARGUMENT(2);
+    ostart = ARGUMENT(1);
+    ostring = ARGUMENT(0);
+    CHECK_STRING(ostring);
+    LispCheckSequenceStartEnd(builtin, ostring, ostart, oend,
+                             &start, &end, &offset);
+    result = ostring;
+    string = THESTR(ostring);
+    length = STRLEN(ostring);
+
+    /* first check if something need to be done */
+    for (offset = start; offset < end; offset++)
+       if (string[offset] != tolower(string[offset]))
+           break;
+
+    if (offset >= end)
+       return (result);
+
+    if (inplace) {
+       CHECK_STRING_WRITABLE(ostring);
+       newstring = string;
+    }
+    else {
+       /* downcase a copy of argument */
+       newstring = LispMalloc(length + 1);
+       if (offset)
+           memcpy(newstring, string, offset);
+       if (length > end)
+           memcpy(newstring + end, string + end, length - end);
+       newstring[length] = '\0';
+    }
+    for (; offset < end; offset++)
+       newstring[offset] = tolower(string[offset]);
+
+    if (!inplace)
+       result = LSTRING2(newstring, length);
+
+    return (result);
+}
+
+LispObj *
+Lisp_StringDowncase(LispBuiltin *builtin)
+/*
+ string-downcase string &key start end
+ */
+{
+    return (LispStringDowncase(builtin, 0));
+}
+
+LispObj *
+Lisp_NstringDowncase(LispBuiltin *builtin)
+/*
+ nstring-downcase string &key start end
+ */
+{
+    return (LispStringDowncase(builtin, 1));
+}
+
+LispObj *
+LispStringCapitalize(LispBuiltin *builtin, int inplace)
+/*
+ string-capitalize string &key start end
+ nstring-capitalize string &key start end
+ */
+{
+    LispObj *result;
+    char *string, *newstring;
+    long start, end, length, offset, upcase;
+
+    LispObj *ostring, *ostart, *oend;
+
+    oend = ARGUMENT(2);
+    ostart = ARGUMENT(1);
+    ostring = ARGUMENT(0);
+    CHECK_STRING(ostring);
+    LispCheckSequenceStartEnd(builtin, ostring, ostart, oend,
+                             &start, &end, &offset);
+    result = ostring;
+    string = THESTR(ostring);
+    length = STRLEN(ostring);
+
+    /* first check if something need to be done */
+    for (upcase = 1, offset = start; offset < end; offset++) {
+       if (upcase) {
+           if (!isalnum(string[offset]))
+               continue;
+           if (string[offset] != toupper(string[offset]))
+               break;
+           upcase = 0;
+       }
+       else {
+           if (isalnum(string[offset])) {
+               if (string[offset] != tolower(string[offset]))
+                   break;
+           }
+           else
+               upcase = 1;
+       }
+    }
+
+    if (offset >= end)
+       return (result);
+
+    if (inplace) {
+       CHECK_STRING_WRITABLE(ostring);
+       newstring = string;
+    }
+    else {
+       /* capitalize a copy of argument */
+       newstring = LispMalloc(length + 1);
+       memcpy(newstring, string, length);
+       newstring[length] = '\0';
+    }
+    for (; offset < end; offset++) {
+       if (upcase) {
+           if (!isalnum(string[offset]))
+               continue;
+           newstring[offset] = toupper(string[offset]);
+           upcase = 0;
+       }
+       else {
+           if (isalnum(newstring[offset]))
+               newstring[offset] = tolower(string[offset]);
+           else
+               upcase = 1;
+       }
+    }
+
+    if (!inplace)
+       result = LSTRING2(newstring, length);
+
+    return (result);
+}
+
+LispObj *
+Lisp_StringCapitalize(LispBuiltin *builtin)
+/*
+ string-capitalize string &key start end
+ */
+{
+    return (LispStringCapitalize(builtin, 0));
+}
+
+LispObj *
+Lisp_NstringCapitalize(LispBuiltin *builtin)
+/*
+ nstring-capitalize string &key start end
+ */
+{
+    return (LispStringCapitalize(builtin, 1));
+}
+
+LispObj *
+Lisp_StringConcat(LispBuiltin *builtin)
+/*
+ string-concat &rest strings
+ */
+{
+    char *buffer;
+    long size, length;
+    LispObj *object, *string;
+
+    LispObj *strings;
+
+    strings = ARGUMENT(0);
+
+    if (strings == NIL)
+       return (STRING(""));
+
+    for (length = 1, object = strings; CONSP(object); object = CDR(object)) {
+       string = CAR(object);
+       CHECK_STRING(string);
+       length += STRLEN(string);
+    }
+
+    buffer = LispMalloc(length);
+
+    for (length = 0, object = strings; CONSP(object); object = CDR(object)) {
+       string = CAR(object);
+       size = STRLEN(string);
+       memcpy(buffer + length, THESTR(string), size);
+       length += size;
+    }
+    buffer[length] = '\0';
+    object = LSTRING2(buffer, length);
+
+    return (object);
+}
diff --git a/xedit/lisp/string.h b/xedit/lisp/string.h
new file mode 100644 (file)
index 0000000..7615863
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/string.h,v 1.11tsi Exp $ */
+
+#ifndef Lisp_string_h
+#define Lisp_string_h
+
+#include "lisp/internal.h"
+
+LispObj *Lisp_AlphaCharP(LispBuiltin*);
+LispObj *Lisp_BothCaseP(LispBuiltin*);
+LispObj *Lisp_Char(LispBuiltin*);
+LispObj *Lisp_CharLess(LispBuiltin*);
+LispObj *Lisp_CharLessEqual(LispBuiltin*);
+LispObj *Lisp_CharEqual_(LispBuiltin*);
+LispObj *Lisp_CharGreater(LispBuiltin*);
+LispObj *Lisp_CharGreaterEqual(LispBuiltin*);
+LispObj *Lisp_CharNotEqual_(LispBuiltin*);
+LispObj *Lisp_CharLessp(LispBuiltin*);
+LispObj *Lisp_CharNotGreaterp(LispBuiltin*);
+LispObj *Lisp_CharEqual(LispBuiltin*);
+LispObj *Lisp_CharGreaterp(LispBuiltin*);
+LispObj *Lisp_CharNotLessp(LispBuiltin*);
+LispObj *Lisp_CharNotEqual(LispBuiltin*);
+LispObj *Lisp_Character(LispBuiltin*);
+LispObj *Lisp_Characterp(LispBuiltin*);
+LispObj *Lisp_CharDowncase(LispBuiltin*);
+LispObj *Lisp_CharInt(LispBuiltin*);
+LispObj *Lisp_CharUpcase(LispBuiltin*);
+LispObj *Lisp_DigitChar(LispBuiltin*);
+LispObj *Lisp_DigitCharP(LispBuiltin*);
+LispObj *Lisp_IntChar(LispBuiltin*);
+LispObj *Lisp_GraphicCharP(LispBuiltin*);
+LispObj *Lisp_LowerCaseP(LispBuiltin*);
+LispObj *Lisp_MakeString(LispBuiltin*);
+LispObj *Lisp_ParseInteger(LispBuiltin*);
+LispObj *Lisp_ReadFromString(LispBuiltin*);
+LispObj *Lisp_String(LispBuiltin*);
+LispObj *Lisp_Stringp(LispBuiltin*);
+LispObj *Lisp_StringTrim(LispBuiltin*);
+LispObj *Lisp_StringLeftTrim(LispBuiltin*);
+LispObj *Lisp_StringRightTrim(LispBuiltin*);
+LispObj *Lisp_NstringTrim(LispBuiltin*);
+LispObj *Lisp_NstringLeftTrim(LispBuiltin*);
+LispObj *Lisp_NstringRightTrim(LispBuiltin*);
+LispObj *Lisp_StringEqual_(LispBuiltin*);
+LispObj *Lisp_StringLess(LispBuiltin*);
+LispObj *Lisp_StringGreater(LispBuiltin*);
+LispObj *Lisp_StringLessEqual(LispBuiltin*);
+LispObj *Lisp_StringGreaterEqual(LispBuiltin*);
+LispObj *Lisp_StringNotEqual_(LispBuiltin*);
+LispObj *Lisp_StringEqual(LispBuiltin*);
+LispObj *Lisp_StringGreaterp(LispBuiltin*);
+LispObj *Lisp_StringLessp(LispBuiltin*);
+LispObj *Lisp_StringNotLessp(LispBuiltin*);
+LispObj *Lisp_StringNotGreaterp(LispBuiltin*);
+LispObj *Lisp_StringNotEqual(LispBuiltin*);
+LispObj *Lisp_NstringUpcase(LispBuiltin*);
+LispObj *Lisp_StringUpcase(LispBuiltin*);
+LispObj *Lisp_StringDowncase(LispBuiltin*);
+LispObj *Lisp_NstringDowncase(LispBuiltin*);
+LispObj *Lisp_StringCapitalize(LispBuiltin*);
+LispObj *Lisp_NstringCapitalize(LispBuiltin*);
+LispObj *Lisp_StringConcat(LispBuiltin*);
+LispObj *Lisp_UpperCaseP(LispBuiltin*);
+LispObj *Lisp_XeditCharStore(LispBuiltin*);
+
+#endif /* Lisp_string_h */
diff --git a/xedit/lisp/struct.c b/xedit/lisp/struct.c
new file mode 100644 (file)
index 0000000..b6ecf14
--- /dev/null
@@ -0,0 +1,373 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/struct.c,v 1.22tsi Exp $ */
+
+#include "lisp/struct.h"
+
+/*
+ * Prototypes
+ */
+static LispObj *LispStructAccessOrStore(LispBuiltin*, int);
+
+/*
+ * Initialization
+ */
+LispObj *Omake_struct, *Ostruct_access, *Ostruct_store, *Ostruct_type;
+
+Atom_id Smake_struct, Sstruct_access, Sstruct_store, Sstruct_type;
+
+/*
+ * Implementation
+ */
+LispObj *
+Lisp_Defstruct(LispBuiltin *builtin)
+/*
+ defstruct name &rest description
+ */
+{
+    int intern;
+    LispAtom *atom;
+    int i, size, length, slength;
+    char *name, *strname;
+    LispObj *list, *cons, *object, *definition, *documentation;
+
+    LispObj *oname, *description;
+
+    description = ARGUMENT(1);
+    oname = ARGUMENT(0);
+
+    CHECK_SYMBOL(oname);
+
+    strname = ATOMID(oname)->value;
+    length  = ATOMID(oname)->length;
+
+           /* MAKE- */
+    size = length + 6;
+    name = LispMalloc(size);
+
+    sprintf(name, "MAKE-%s", strname);
+    atom = (object = ATOM(name))->data.atom;
+
+    if (atom->a_builtin)
+       LispDestroy("%s: %s cannot be a structure name",
+                   STRFUN(builtin), STROBJ(oname));
+
+    intern = !atom->ext;
+
+    if (CONSP(description) && STRINGP(CAR(description))) {
+       documentation = CAR(description);
+       description = CDR(description);
+    }
+    else
+       documentation = NIL;
+
+    /* get structure fields and default values */
+    for (list = description; CONSP(list); list = CDR(list)) {
+       object = CAR(list);
+
+       cons = list;
+       if (CONSP(object)) {
+           if ((CONSP(CDR(object)) && CDR(CDR(object)) != NIL) ||
+               (!CONSP(CDR(object)) && CDR(object) != NIL))
+           LispDestroy("%s: bad initialization %s",
+                       STRFUN(builtin), STROBJ(object));
+           cons = object;
+           object = CAR(object);
+       }
+       if (!SYMBOLP(object) || strcmp(ATOMID(object)->value, "P") == 0)
+           /* p is invalid as a field name due to `type'-p */
+           LispDestroy("%s: %s cannot be a field for %s",
+                       STRFUN(builtin), STROBJ(object), ATOMID(oname)->value);
+
+       if (!KEYWORDP(object))
+           CAR(cons) = KEYWORD(ATOMID(object)->value);
+
+       /* check for repeated field names */
+       for (object = description; object != list; object = CDR(object)) {
+           LispObj *left = CAR(object), *right = CAR(list);
+
+           if (CONSP(left))
+               left = CAR(left);
+           if (CONSP(right))
+               right = CAR(right);
+
+           if (ATOMID(left) == ATOMID(right))
+               LispDestroy("%s: only one slot named %s allowed",
+                           STRFUN(builtin), STROBJ(left));
+       }
+    }
+
+    /* atom should not have been modified */
+    definition = CONS(oname, description);
+    LispSetAtomStructProperty(atom, definition, STRUCT_CONSTRUCTOR);
+    if (!intern)
+       LispExportSymbol(object);
+
+    atom = oname->data.atom;
+    if (atom->a_defstruct)
+       LispWarning("%s: structure %s is being redefined",
+                   STRFUN(builtin), strname);
+    LispSetAtomStructProperty(atom, definition, STRUCT_NAME);
+
+    sprintf(name, "%s-P", strname);
+    atom = (object = ATOM(name))->data.atom;
+    LispSetAtomStructProperty(atom, definition, STRUCT_CHECK);
+    if (!intern)
+       LispExportSymbol(object);
+
+    for (i = 0, list = description; CONSP(list); i++, list = CDR(list)) {
+       Atom_id id;
+
+       if (CONSP(CAR(list)))
+           id = ATOMID(CAR(CAR(list)));
+       else
+           id = ATOMID(CAR(list));
+       slength = id->length;
+       if (length + slength + 2 > size) {
+           size = length + slength + 2;
+           name = LispRealloc(name, size);
+       }
+       sprintf(name, "%s-%s", strname, id->value);
+       atom = (object = ATOM(name))->data.atom;
+       LispSetAtomStructProperty(atom, definition, i);
+       if (!intern)
+           LispExportSymbol(object);
+    }
+
+    LispFree(name);
+
+    if (documentation != NIL)
+       LispAddDocumentation(oname, documentation, LispDocStructure);
+
+    return (oname);
+}
+
+/* helper functions
+ *     DONT explicitly call them. Non standard functions.
+ */
+LispObj *
+Lisp_XeditMakeStruct(LispBuiltin *builtin)
+/*
+ lisp::make-struct atom &rest init
+ */
+{
+    int nfld, ncvt, length = lisp__data.protect.length;
+    LispAtom *atom = NULL;
+
+    LispObj *definition, *object, *field, *fields, *value = NIL, *cons, *list;
+    LispObj *struc, *init;
+
+    init = ARGUMENT(1);
+    struc = ARGUMENT(0);
+
+    field = cons = NIL;
+    if (!POINTERP(struc) ||
+       !(XSYMBOLP(struc) || XFUNCTIONP(struc)) ||
+       (atom = struc->data.atom)->a_defstruct == 0 ||
+        atom->property->structure.function != STRUCT_CONSTRUCTOR)
+       LispDestroy("%s: invalid constructor %s",
+                   STRFUN(builtin), STROBJ(struc));
+    definition = atom->property->structure.definition;
+
+    ncvt = nfld = 0;
+    fields = NIL;
+
+    /* check for errors in argument list */
+    for (list = init, nfld = 0; CONSP(list); list = CDR(list)) {
+       CHECK_KEYWORD(CAR(list));
+       if (!CONSP(CDR(list)))
+           LispDestroy("%s: values must be provided as pairs",
+                       ATOMID(struc)->value);
+       nfld++;
+       list = CDR(list);
+    }
+
+    /* create structure, CAR(definition) is structure name */
+    for (list = CDR(definition); CONSP(list); list = CDR(list)) {
+       Atom_id id;
+       LispObj *defvalue = NIL;
+
+       ++nfld;
+       field = CAR(list);
+       if (CONSP(field)) {
+           /* if default value provided */
+           if (CONSP(CDR(field)))
+               defvalue = CAR(CDR(field));
+           field = CAR(field);
+       }
+       id = ATOMID(field);
+
+       for (object = init; CONSP(object); object = CDR(object)) {
+           /* field is a keyword, test above checked it */
+           field = CAR(object);
+           if (id == ATOMID(field)) {
+               /* value provided */
+               value = CAR(CDR(object));
+               ncvt++;
+               break;
+           }
+           object = CDR(object);
+       }
+
+       /* if no initialization given */
+       if (!CONSP(object)) {
+           /* if default value in structure definition */
+           if (defvalue != NIL)
+               value = EVAL(defvalue);
+           else
+               value = NIL;
+       }
+
+       if (fields == NIL) {
+           fields = cons = CONS(value, NIL);
+           if (length + 1 >= lisp__data.protect.space)
+               LispMoreProtects();
+           lisp__data.protect.objects[lisp__data.protect.length++] = fields;
+       }
+       else {
+           RPLACD(cons, CONS(value, NIL));
+           cons = CDR(cons);
+       }
+    }
+
+    /* if not enough arguments were converted, need to check because
+     * it is acceptable to set a field more than once, but in that case,
+     * only the first value will be used. */
+    if (nfld > ncvt) {
+       for (list = init; CONSP(list); list = CDR(list)) {
+           Atom_id id = ATOMID(CAR(list));
+
+           for (object = CDR(definition); CONSP(object);
+                object = CDR(object)) {
+               field = CAR(object);
+               if (CONSP(field))
+                   field = CAR(field);
+               if (ATOMID(field) == id)
+                   break;
+           }
+           if (!CONSP(object))
+               LispDestroy("%s: %s is not a field for %s",
+                           ATOMID(struc)->value, STROBJ(CAR(list)),
+                           ATOMID(CAR(definition))->value);
+           list = CDR(list);
+       }
+    }
+
+    lisp__data.protect.length = length;
+
+    return (STRUCT(fields, definition));
+}
+
+static LispObj *
+LispStructAccessOrStore(LispBuiltin *builtin, int store)
+/*
+ lisp::struct-access atom struct
+ lisp::struct-store atom struct value
+ */
+{
+    long offset;
+    LispAtom *atom;
+    LispObj *definition, *list;
+
+    LispObj *name, *struc, *value = NIL;
+
+    if (store)
+       value = ARGUMENT(2);
+    struc = ARGUMENT(1);
+    name = ARGUMENT(0);
+
+    if (!POINTERP(name) ||
+       !(XSYMBOLP(name) || XFUNCTIONP(name)) ||
+       (atom = name->data.atom)->a_defstruct == 0 ||
+       (offset = atom->property->structure.function) < 0) {
+       LispDestroy("%s: invalid argument %s",
+                   STRFUN(builtin), STROBJ(name));
+       /*NOTREACHED*/
+       offset = 0;
+       atom = NULL;
+    }
+    definition = atom->property->structure.definition;
+
+    /* check if the object is of the required type */
+    if (!STRUCTP(struc) || struc->data.struc.def != definition)
+       LispDestroy("%s: %s is not a %s",
+                   ATOMID(name)->value, STROBJ(struc), ATOMID(CAR(definition))->value);
+
+    for (list = struc->data.struc.fields; offset; list = CDR(list), offset--)
+       ;
+
+    return (store ? RPLACA(list, value) : CAR(list));
+}
+
+LispObj *
+Lisp_XeditStructAccess(LispBuiltin *builtin)
+/*
+ lisp::struct-access atom struct
+ */
+{
+    return (LispStructAccessOrStore(builtin, 0));
+}
+
+LispObj *
+Lisp_XeditStructStore(LispBuiltin *builtin)
+/*
+ lisp::struct-store atom struct value
+ */
+{
+    return (LispStructAccessOrStore(builtin, 1));
+}
+
+LispObj *
+Lisp_XeditStructType(LispBuiltin *builtin)
+/*
+ lisp::struct-type atom struct
+ */
+{
+    LispAtom *atom = NULL;
+
+    LispObj *definition, *struc, *name;
+
+    struc = ARGUMENT(1);
+    name = ARGUMENT(0);
+
+    if (!POINTERP(name) ||
+       !(XSYMBOLP(name) || XFUNCTIONP(name)) ||
+       (atom = name->data.atom)->a_defstruct == 0 ||
+       (atom->property->structure.function != STRUCT_CHECK))
+       LispDestroy("%s: invalid argument %s",
+                   STRFUN(builtin), STROBJ(name));
+    definition = atom->property->structure.definition;
+
+    /* check if the object is of the required type */
+    if (STRUCTP(struc) && struc->data.struc.def == definition)
+       return (T);
+
+    return (NIL);
+}
diff --git a/xedit/lisp/struct.h b/xedit/lisp/struct.h
new file mode 100644 (file)
index 0000000..d5cca85
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/struct.h,v 1.6tsi Exp $ */
+
+#ifndef Lisp_struct_h
+#define Lisp_struct_h
+
+#include "lisp/private.h"
+
+/*
+ * Defines
+ */
+#define XSTRUCTP(object)       ((object)->type == LispStruct_t)
+#define STRUCTP(object)                (POINTERP(object) && XSTRUCTP(object))
+#define STRUCT(fields, def)    LispNewStruct(fields, def)
+
+/*
+ * Prototypes
+ */
+LispObj *Lisp_Defstruct(LispBuiltin*);
+LispObj *Lisp_XeditMakeStruct(LispBuiltin*);
+LispObj *Lisp_XeditStructAccess(LispBuiltin*);
+LispObj *Lisp_XeditStructStore(LispBuiltin*);
+LispObj *Lisp_XeditStructType(LispBuiltin*);
+
+#endif /* Lisp_struct_h */
diff --git a/xedit/lisp/test/hello.lsp b/xedit/lisp/test/hello.lsp
new file mode 100644 (file)
index 0000000..21ad6cf
--- /dev/null
@@ -0,0 +1,72 @@
+;;
+;; Copyright (c) 2001 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/test/hello.lsp,v 1.1 2001/08/31 15:00:15 paulo Exp $
+;;
+(require "xaw")
+(require "xt")
+
+(defun quit-callback (widget user call) (quit))
+
+(defun fix-shell-size (shell)
+    (let ((size (xt-get-values shell '("width" "height"))))
+        (xt-set-values shell
+            (list (cons "minWidth" (cdar size))
+                  (cons "maxWidth" (cdar size))
+                  (cons "minHeight" (cdadr size))
+                  (cons "maxHeight" (cdadr size)))
+        )
+    )
+)
+
+(setq toplevel
+    (xt-app-initialize 'appcontext "Hello"
+       '(("title" . "Hello World!"))))
+
+(setq form
+    (xt-create-managed-widget "form" form-widget-class toplevel
+       '(("background" . "gray85")
+         ("displayList" . "foreground rgb:7/9/7;lines 1,-1,-1,-1,-1,1;foreground gray90;lines -1,0,0,0,0,-1")
+       )))
+
+(setq button
+    (xt-create-managed-widget "button" command-widget-class form
+       '(("label" . "Goodbye world!")
+         ("tip" . "This sample uses some customizations")
+         ("foreground" . "gray10")
+         ("background" . "gray80")
+         ("displayList" . "foreground rgb:7/9/7;lines 1,-1,-1,-1,-1,1;foreground gray90;lines -1,0,0,0,0,-1")
+       )))
+(xt-add-callback button "callback" 'quit-callback)
+
+(xt-realize-widget toplevel)
+
+(fix-shell-size toplevel)
+
+(xt-app-main-loop appcontext)
diff --git a/xedit/lisp/test/list.lsp b/xedit/lisp/test/list.lsp
new file mode 100644 (file)
index 0000000..a06553e
--- /dev/null
@@ -0,0 +1,1895 @@
+;;
+;; Copyright (c) 2002 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/test/list.lsp,v 1.5 2002/11/26 04:06:30 paulo Exp $
+;;
+
+;; basic lisp function tests
+
+;; Most of the tests are just the examples from the
+;;
+;;     Common Lisp HyperSpec (TM)
+;;     Copyright 1996-2001, Xanalys Inc. All rights reserved.
+;;
+;; Some tests are hand crafted, to test how the interpreter treats
+;; uncommon arguments or special conditions
+
+
+#|
+ MAJOR PROBLEMS:
+
+ o NIL and T should be always treated as symbols, actually it is
+   legal to say (defun nil (...) ...)
+ o There aren't true uninterned symbols, there are only symbols that
+   did not yet establish the home package, but once one is created, an
+   interned symbol is always returned.
+|#
+
+(defun compare-test (test expect function arguments
+                    &aux result (error t) unused error-value)
+    (multiple-value-setq
+       (unused error-value)
+       (ignore-errors
+           (setq result (apply function arguments))
+           (setq error nil)
+       )
+    )
+    (if error
+       (format t "ERROR: (~S~{ ~S~}) => ~S~%" function arguments error-value)
+       (or (funcall test result expect)
+           (format t "(~S~{ ~S~}) => should be ~S not ~S~%"
+               function arguments expect result
+           )
+       )
+    )
+)
+
+(defun compare-eval (test expect form
+                    &aux result (error t) unused error-value)
+    (multiple-value-setq
+       (unused error-value)
+       (ignore-errors
+           (setq result (eval form))
+           (setq error nil)
+       )
+    )
+    (if error
+       (format t "ERROR: ~S => ~S~%" form error-value)
+       (or (funcall test result expect)
+           (format t "~S => should be ~S not ~S~%"
+               form expect result
+           )
+       )
+    )
+)
+
+(defun error-test (function &rest arguments &aux result (error t))
+    (ignore-errors
+       (setq result (apply function arguments))
+       (setq error nil)
+    )
+    (or error
+       (format t "ERROR: no error for (~S~{ ~S~}), result was ~S~%"
+           function arguments result)
+    )
+)
+
+(defun error-eval (form &aux result (error t))
+    (ignore-errors
+       (setq result (eval form))
+       (setq error nil)
+    )
+    (or error
+       (format t "ERROR: no error for ~S, result was ~S~%" form result)
+    )
+)
+
+(defun eq-test (expect function &rest arguments)
+    (compare-test #'eq expect function arguments))
+
+(defun eql-test (expect function &rest arguments)
+    (compare-test #'eql expect function arguments))
+
+(defun equal-test (expect function &rest arguments)
+    (compare-test #'equal expect function arguments))
+
+(defun equalp-test (expect function &rest arguments)
+    (compare-test #'equalp expect function arguments))
+
+
+(defun eq-eval (expect form)
+    (compare-eval #'eq expect form))
+
+(defun eql-eval (expect form)
+    (compare-eval #'eql expect form))
+
+(defun equal-eval (expect form)
+    (compare-eval #'equal expect form))
+
+(defun equalp-eval (expect form)
+    (compare-eval #'equalp expect form))
+
+;; clisp treats strings loaded from a file as constants
+(defun xseq (sequence)
+    #+clisp (if *load-pathname* (copy-seq sequence) sequence)
+    #-clisp sequence
+)
+
+;; apply                               - function
+(equal-test '((+ 2 3) . 4) #'apply 'cons '((+ 2 3) 4))
+(eql-test -1 #'apply #'- '(1 2))
+(eql-test 7 #'apply #'max 3 5 '(2 7 3))
+(error-test #'apply #'+ 1)
+(error-test #'apply #'+ 1 2)
+(error-test #'apply #'+ 1 . 2)
+(error-test #'apply #'+ 1 2 3)
+(error-test #'apply #'+ 1 2 . 3)
+(eql-test 6 #'apply #'+ 1 2 3 ())
+
+;; eq                                  - function
+(eq-eval t '(let* ((a #\a) (b a)) (eq a b)))
+(eq-test t #'eq 'a 'a)
+(eq-test nil #'eq 'a 'b)
+(eq-eval t '(eq #1=1 #1#))
+(eq-test nil #'eq "abc" "abc")
+(setq a '('x #c(1 2) #\z))
+(eq-test nil #'eq a (copy-seq a))
+
+;; eql                                 - function
+(eq-test t #'eql 1 1)
+(eq-test t #'eql 1.3d0 1.3d0)
+(eq-test nil #'eql 1 1d0)
+(eq-test t #'eql #c(1 -5) #c(1 -5))
+(eq-test t #'eql 'a 'a)
+(eq-test nil #'eql :a 'a)
+(eq-test t #'eql #c(5d0 0) 5d0)
+(eq-test nil #'eql #c(5d0 0d0) 5d0)
+(eq-test nil #'eql "abc" "abc")
+(equal-eval '(1 5/6 #p"test" #\#) '(setq a '(1 5/6 #p"test" #\#)))
+(eq-test nil #'eql a (copy-seq a))
+
+(setf
+    hash0 (make-hash-table)
+    hash1 (make-hash-table)
+    (gethash 1 hash0) 2
+    (gethash 1 hash1) 2
+    (gethash :foo hash0) :bar
+    (gethash :foo hash1) :bar
+)
+(defstruct test a b c)
+(setq
+    struc0 (make-test :a 1 :b 2 :c #\c)
+    struc1 (make-test :a 1 :b 2 :c #\c)
+)
+
+;; equal                               - function
+(eq-test t #'equal "abc" "abc")
+(eq-test t #'equal 1 1)
+(eq-test t #'equal #c(1 2) #c(1 2))
+(eq-test nil #'equal #c(1 2) #c(1 2d0))
+(eq-test t #'equal #\A #\A)
+(eq-test nil #'equal #\A #\a)
+(eq-test nil #'equal "abc" "Abc")
+(equal-eval '(1 2 3/5 #\a) '(setq a '(1 2 3/5 #\a)))
+(eq-test t #'equal a (copy-seq a))
+(eq-test nil #'equal hash0 hash1)
+(eq-test nil #'equal struc0 struc1)
+(eq-test nil #'equal #(1 2 3 4) #(1 2 3 4))
+
+;; equalp                              - function
+(eq-test t #'equalp hash0 hash1)
+(setf
+    (gethash 2 hash0) "FoObAr"
+    (gethash 2 hash1) "fOoBaR"
+)
+(eq-test t #'equalp hash0 hash1)
+(setf
+    (gethash 3 hash0) 3
+    (gethash 3d0 hash1) 3
+)
+(eq-test nil #'equalp hash0 hash1)
+(eq-test t #'equalp struc0 struc1)
+(setf
+    (test-a struc0) #\a
+    (test-a struc1) #\A
+)
+(eq-test t #'equalp struc0 struc1)
+(setf
+    (test-b struc0) 'test
+    (test-b struc1) :test
+)
+(eq-test nil #'equalp struc0 struc1)
+(eq-test t #'equalp #c(1/2 1d0) #c(0.5d0 1))
+(eq-test t #'equalp 1 1d0)
+(eq-test t #'equalp #(1 2 3 4) #(1 2 3 4))
+(eq-test t #'equalp #(1 #\a 3 4d0) #(1 #\A 3 4))
+
+;; acons                               - function
+(equal-test '((1 . "one")) #'acons 1 "one" nil)
+(equal-test '((2 . "two") (1 . "one")) #'acons 2 "two" '((1 . "one")))
+
+;; adjoin                              - function
+(equal-test '(nil) #'adjoin nil nil)
+(equal-test '(a) #'adjoin 'a nil)
+(equal-test '(1 2 3) #'adjoin 1 '(1 2 3))
+(equal-test '(1 2 3) #'adjoin 2 '(1 2 3))
+(equal-test '((1) (1) (2) (3)) #'adjoin '(1) '((1) (2) (3)))
+(equal-test '((1) (2) (3)) #'adjoin '(1) '((1) (2) (3)) :key #'car)
+(error-test #'adjoin nil 1)
+
+;; alpha-char-p                                - function
+(eq-test t #'alpha-char-p #\a)
+(eq-test nil #'alpha-char-p #\5)
+(error-test #'alpha-char-p 'a)
+
+;; alphanumericp                       - function
+(eq-test t #'alphanumericp #\Z)
+(eq-test t #'alphanumericp #\8)
+(eq-test nil #'alphanumericp #\#)
+
+;; and                                 - macro
+(eql-eval 1 '(setq temp1 1 temp2 1 temp3 1))
+(eql-eval 2 '(and (incf temp1) (incf temp2) (incf temp3)))
+(eq-eval t '(and (eql 2 temp1) (eql 2 temp2) (eql 2 temp3)))
+(eql-eval 1 '(decf temp3))
+(eq-eval nil '(and (decf temp1) (decf temp2) (eq temp3 'nil) (decf temp3)))
+(eq-eval t '(and (eql temp1 temp2) (eql temp2 temp3)))
+(eq-eval t '(and))
+(equal-eval '(1 2 3) '(multiple-value-list (and (values 'a) (values 1 2 3))))
+(equal-eval nil '(and (values) t))
+
+;; append                              - function
+(equal-test '(a b c d e f g) #'append '(a b c) '(d e f) '() '(g))
+(equal-test '(a b c . d) #'append '(a b c) 'd)
+(eq-test nil #'append)
+(eql-test 'a #'append nil 'a)
+(error-test #'append 1 2)
+
+;; assoc                               - function
+(equal-test '(1 . "one") #'assoc 1 '((2 . "two") (1 . "one")))
+(equal-test '(2 . "two") #'assoc 2 '((1 . "one") (2 . "two")))
+(eq-test nil #'assoc 1 nil)
+(equal-test '(2 . "two") #'assoc-if #'evenp '((1 . "one") (2 . "two")))
+(equal-test '(3 . "three") #'assoc-if-not #'(lambda(x) (< x 3))
+       '((1 . "one") (2 . "two") (3 . "three")))
+(equal-test '("two" . 2) #'assoc #\o '(("one" . 1) ("two" . 2) ("three" . 3))
+       :key #'(lambda (x) (char x 2)))
+(equal-test '(a . b) #'assoc 'a '((x . a) (y . b) (a . b) (a . c)))
+
+;; atom                                        - function
+(eq-test t #'atom 1)
+(eq-test t #'atom '())
+(eq-test nil #'atom '(1))
+(eq-test t #'atom 'a)
+
+;; block                               - special operator
+(eq-eval nil '(block empty))
+(eql-eval 2 '(let ((x 1))
+               (block stop (setq x 2) (return-from stop) (setq x 3)) x))
+(eql-eval 2 '(block twin (block twin (return-from twin 1)) 2))
+
+;; both-case-p                         - function
+(eq-test t #'both-case-p #\a)
+(eq-test nil #'both-case-p #\1)
+
+;; boundp                              - function
+(eql-eval 1 '(setq x 1))
+(eq-test t #'boundp 'x)
+(makunbound 'x)
+(eq-test nil #'boundp 'x)
+(eq-eval nil '(let ((x 1)) (boundp 'x)))
+(error-test #'boundp 1)
+
+;; butlast, nbutlast                   - function
+(setq x '(1 2 3 4 5 6 7 8 9))
+(equal-test '(1 2 3 4 5 6 7 8) #'butlast x)
+(equal-eval '(1 2 3 4 5 6 7 8 9) 'x)
+(eq-eval nil '(nbutlast x 9))
+(equal-test '(1) #'nbutlast x 8)
+(equal-eval '(1) 'x)
+(eq-test nil #'butlast nil)
+(eq-test nil #'nbutlast '())
+(error-test #'butlast 1 2)
+(error-test #'butlast -1 '(1 2))
+
+;; car, cdr, caar ...                  - function
+(eql-test 1 #'car '(1 2))
+(eql-test 2 #'cdr '(1 . 2))
+(eql-test 1 #'caar '((1 2)))
+(eql-test 2 #'cadr '(1 2))
+(eql-test 2 #'cdar '((1 . 2)))
+(eql-test 3 #'cddr '(1 2 . 3))
+(eql-test 1 #'caaar '(((1 2))))
+(eql-test 2 #'caadr '(1 (2 3)))
+(eql-test 2 #'cadar '((1 2) 2 3))
+(eql-test 3 #'caddr '(1 2 3 4))
+(eql-test 2 #'cdaar '(((1 . 2)) 3))
+(eql-test 3 #'cdadr '(1 (2 . 3) 4))
+(eql-test 3 #'cddar '((1 2 . 3) 3))
+(eql-test 4 #'cdddr '(1 2 3 . 4))
+(eql-test 1 #'caaaar '((((1 2)))))
+(eql-test 2 #'caaadr '(1 ((2))))
+(eql-test 2 #'caadar '((1 (2)) 3))
+(eql-test 3 #'caaddr '(1 2 (3 4)))
+(eql-test 2 #'cadaar '(((1 2)) 3))
+(eql-test 3 #'cadadr '(1 (2 3) 4))
+(eql-test 3 #'caddar '((1 2 3) 4))
+(eql-test 4 #'cadddr '(1 2 3 4 5))
+(eql-test 2 #'cdaaar '((((1 . 2))) 3))
+(eql-test 3 #'cdaadr '(1 ((2 . 3)) 4))
+(eql-test 3 #'cdadar '((1 (2 . 3)) 4))
+(eql-test 4 #'cdaddr '(1 2 (3 . 4) 5))
+(eql-test 3 #'cddaar '(((1 2 . 3)) 4))
+(eql-test 4 #'cddadr '(1 (2 3 . 4) 5))
+(eql-test 4 #'cdddar '((1 2 3 . 4) 5))
+(eql-test 5 #'cddddr '(1 2 3 4 . 5))
+
+;; first ... tenth, rest               - function
+(eql-test 2 #'rest '(1 . 2))
+(eql-test 1 #'first '(1 2))
+(eql-test 2 #'second '(1 2 3))
+(eql-test 2 #'second '(1 2 3))
+(eql-test 3 #'third '(1 2 3 4))
+(eql-test 4 #'fourth '(1 2 3 4 5))
+(eql-test 5 #'fifth '(1 2 3 4 5 6))
+(eql-test 6 #'sixth '(1 2 3 4 5 6 7))
+(eql-test 7 #'seventh '(1 2 3 4 5 6 7 8))
+(eql-test 8 #'eighth '(1 2 3 4 5 6 7 8 9))
+(eql-test 9 #'ninth '(1 2 3 4 5 6 7 8 9 10))
+(eql-test 10 #'tenth '(1 2 3 4 5 6 7 8 9 10 11))
+(error-test #'car 1)
+(error-test #'car #c(1 2))
+(error-test #'car #(1 2))
+
+;; case                                        - macro
+(eql-eval t '(let ((a 1)) (case a ((4 5 6) nil) ((3 2 1) t) (otherwise :error))))
+(eql-eval t '(let ((a 1)) (case a ((3 2) nil) (1 t) (t :error))))
+(error-eval '(let ((a 1)) (case a (2 :error) (t nil) (otherwise t))))
+(error-eval '(let ((a 1)) (case a (2 :error) (otherwise t) (t nil))))
+
+;; catch                               - special operator
+(eql-eval 3 '(catch 'dummy-tag 1 2 (throw 'dummy-tag 3) 4))
+(eql-eval 4 '(catch 'dummy-tag 1 2 3 4))
+(eq-eval 'throw-back '(defun throw-back (tag) (throw tag t)))
+(eq-eval t '(catch 'dummy-tag (throw-back 'dummy-tag) 2))
+
+;; char                                        - function
+(eql-test #\a #'char "abc" 0)
+(eql-test #\b #'char "abc" 1)
+(error-test #'char "abc" 3)
+
+;; char-*                              - function
+(eq-test nil #'alpha-char-p #\3)
+(eq-test t #'alpha-char-p #\y)
+(eql-test #\a #'char-downcase #\a)
+(eql-test #\a #'char-downcase #\a)
+(eql-test #\1 #'char-downcase #\1)
+(error-test #'char-downcase 1)
+(eql-test #\A #'char-upcase #\a)
+(eql-test #\A #'char-upcase #\A)
+(eql-test #\1 #'char-upcase #\1)
+(error-test #'char-upcase 1)
+(eq-test t #'lower-case-p #\a)
+(eq-test nil #'lower-case-p #\A)
+(eq-test t #'upper-case-p #\W)
+(eq-test nil #'upper-case-p #\w)
+(eq-test t #'both-case-p #\x)
+(eq-test nil #'both-case-p #\%)
+(eq-test t #'char= #\d #\d)
+(eq-test t #'char-equal #\d #\d)
+(eq-test nil #'char= #\A #\a)
+(eq-test t #'char-equal #\A #\a)
+(eq-test nil #'char= #\d #\x)
+(eq-test nil #'char-equal #\d #\x)
+(eq-test nil #'char= #\d #\D)
+(eq-test t #'char-equal #\d #\D)
+(eq-test nil #'char/= #\d #\d)
+(eq-test nil #'char-not-equal #\d #\d)
+(eq-test nil #'char/= #\d #\d)
+(eq-test nil #'char-not-equal #\d #\d)
+(eq-test t #'char/= #\d #\x)
+(eq-test t #'char-not-equal #\d #\x)
+(eq-test t #'char/= #\d #\D)
+(eq-test nil #'char-not-equal #\d #\D)
+(eq-test t #'char= #\d #\d #\d #\d)
+(eq-test t #'char-equal #\d #\d #\d #\d)
+(eq-test nil #'char= #\d #\D #\d #\d)
+(eq-test t #'char-equal #\d #\D #\d #\d)
+(eq-test nil #'char/= #\d #\d #\d #\d)
+(eq-test nil #'char-not-equal #\d #\d #\d #\d)
+(eq-test nil #'char/= #\d #\d #\D #\d)
+(eq-test nil #'char-not-equal #\d #\d #\D #\d)
+(eq-test nil #'char= #\d #\d #\x #\d)
+(eq-test nil #'char-equal #\d #\d #\x #\d)
+(eq-test nil #'char/= #\d #\d #\x #\d)
+(eq-test nil #'char-not-equal #\d #\d #\x #\d)
+(eq-test nil #'char= #\d #\y #\x #\c)
+(eq-test nil #'char-equal #\d #\y #\x #\c)
+(eq-test t #'char/= #\d #\y #\x #\c)
+(eq-test t #'char-not-equal #\d #\y #\x #\c)
+(eq-test nil #'char= #\d #\c #\d)
+(eq-test nil #'char-equal #\d #\c #\d)
+(eq-test nil #'char/= #\d #\c #\d)
+(eq-test nil #'char-not-equal #\d #\c #\d)
+(eq-test t #'char< #\d #\x)
+(eq-test t #'char-lessp #\d #\x)
+(eq-test t #'char-lessp #\d #\X)
+(eq-test t #'char-lessp #\D #\x)
+(eq-test t #'char-lessp #\D #\X)
+(eq-test t #'char<= #\d #\x)
+(eq-test t #'char-not-greaterp #\d #\x)
+(eq-test t #'char-not-greaterp #\d #\X)
+(eq-test t #'char-not-greaterp #\D #\x)
+(eq-test t #'char-not-greaterp #\D #\X)
+(eq-test nil #'char< #\d #\d)
+(eq-test nil #'char-lessp #\d #\d)
+(eq-test nil #'char-lessp #\d #\D)
+(eq-test nil #'char-lessp #\D #\d)
+(eq-test nil #'char-lessp #\D #\D)
+(eq-test t #'char<= #\d #\d)
+(eq-test t #'char-not-greaterp #\d #\d)
+(eq-test t #'char-not-greaterp #\d #\D)
+(eq-test t #'char-not-greaterp #\D #\d)
+(eq-test t #'char-not-greaterp #\D #\D)
+(eq-test t #'char< #\a #\e #\y #\z)
+(eq-test t #'char-lessp #\a #\e #\y #\z)
+(eq-test t #'char-lessp #\a #\e #\y #\Z)
+(eq-test t #'char-lessp #\a #\E #\y #\z)
+(eq-test t #'char-lessp #\A #\e #\y #\Z)
+(eq-test t #'char<= #\a #\e #\y #\z)
+(eq-test t #'char-not-greaterp #\a #\e #\y #\z)
+(eq-test t #'char-not-greaterp #\a #\e #\y #\Z)
+(eq-test t #'char-not-greaterp #\A #\e #\y #\z)
+(eq-test nil #'char< #\a #\e #\e #\y)
+(eq-test nil #'char-lessp #\a #\e #\e #\y)
+(eq-test nil #'char-lessp #\a #\e #\E #\y)
+(eq-test nil #'char-lessp #\A #\e #\E #\y)
+(eq-test t #'char<= #\a #\e #\e #\y)
+(eq-test t #'char-not-greaterp #\a #\e #\e #\y)
+(eq-test t #'char-not-greaterp #\a #\E #\e #\y)
+(eq-test t #'char> #\e #\d)
+(eq-test t #'char-greaterp #\e #\d)
+(eq-test t #'char-greaterp #\e #\D)
+(eq-test t #'char-greaterp #\E #\d)
+(eq-test t #'char-greaterp #\E #\D)
+(eq-test t #'char>= #\e #\d)
+(eq-test t #'char-not-lessp #\e #\d)
+(eq-test t #'char-not-lessp #\e #\D)
+(eq-test t #'char-not-lessp #\E #\d)
+(eq-test t #'char-not-lessp #\E #\D)
+(eq-test t #'char> #\d #\c #\b #\a)
+(eq-test t #'char-greaterp #\d #\c #\b #\a)
+(eq-test t #'char-greaterp #\d #\c #\b #\A)
+(eq-test t #'char-greaterp #\d #\c #\B #\a)
+(eq-test t #'char-greaterp #\d #\C #\b #\a)
+(eq-test t #'char-greaterp #\D #\C #\b #\a)
+(eq-test t #'char>= #\d #\c #\b #\a)
+(eq-test t #'char-not-lessp #\d #\c #\b #\a)
+(eq-test t #'char-not-lessp #\d #\c #\b #\A)
+(eq-test t #'char-not-lessp #\D #\c #\b #\a)
+(eq-test t #'char-not-lessp #\d #\C #\B #\a)
+(eq-test nil #'char> #\d #\d #\c #\a)
+(eq-test nil #'char-greaterp #\d #\d #\c #\a)
+(eq-test nil #'char-greaterp #\d #\d #\c #\A)
+(eq-test nil #'char-greaterp #\d #\D #\c #\a)
+(eq-test nil #'char-greaterp #\d #\D #\C #\a)
+(eq-test t #'char>= #\d #\d #\c #\a)
+(eq-test t #'char-not-lessp #\d #\d #\c #\a)
+(eq-test t #'char-not-lessp #\d #\D #\c #\a)
+(eq-test t #'char-not-lessp #\D #\d #\c #\a)
+(eq-test t #'char-not-lessp #\D #\D #\c #\A)
+(eq-test nil #'char> #\e #\d #\b #\c #\a)
+(eq-test nil #'char-greaterp #\e #\d #\b #\c #\a)
+(eq-test nil #'char-greaterp #\E #\d #\b #\c #\a)
+(eq-test nil #'char-greaterp #\e #\D #\b #\c #\a)
+(eq-test nil #'char-greaterp #\E #\d #\B #\c #\A)
+(eq-test nil #'char>= #\e #\d #\b #\c #\a)
+(eq-test nil #'char-not-lessp #\e #\d #\b #\c #\a)
+(eq-test nil #'char-not-lessp #\e #\d #\b #\c #\A)
+(eq-test nil #'char-not-lessp #\E #\d #\B #\c #\a)
+
+;; char-code                           - function
+;; XXX assumes ASCII
+(eql-test 49 #'char-code #\1)
+(eql-test 90 #'char-code #\Z)
+(eql-test 127 #'char-code #\Delete)
+(eql-test 27 #'char-code #\Escape)
+(eql-test 13 #'char-code #\Return)
+(eql-test 0 #'char-code #\Null)
+(eql-test 10 #'char-code #\Newline)
+(error-test #'char-code 65)
+
+;; character                           - function
+(eql-test #\a #'character #\a)
+(eql-test #\a #'character "a")
+(eql-test #\A #'character 'a)
+
+;; XXX assumes ASCII, and should be allowed to fail?
+(eql-test #\A #'character 65)
+
+(error-test #'character 1/2)
+(error-test #'character "abc")
+(error-test #'character :test)
+(eq-test #\T #'character t)
+(error-test #'character nil)
+
+;; characterp                          - function
+(eq-test t #'characterp #\a)
+(eq-test nil #'characterp 1)
+(eq-test nil #'characterp 1/2)
+(eq-test nil #'characterp 'a)
+(eq-test nil #'characterp '`a)
+
+
+
+
+;; TODO coerce
+
+
+
+
+;; cond                                        - macro
+(eql-eval 2 '(let ((a 1)) (cond ((= a 2) 1) ((= a 1) 2) ((= a 0) 1) (t nil))))
+(eql-eval nil '(let ((a 1)) (cond ((= a 2) 1) (t nil) ((= a 1) 2) ((= a 0) 1))))
+
+;; consp                               - function (predicate)
+(eq-test t #'consp '(1 2))
+(eq-test t #'consp '(1 . 2))
+(eq-test nil #'consp nil)
+(eq-test nil #'consp 1)
+
+;; constantp                           - function (predicate)
+(eq-test t #'constantp 1)
+(eq-test t #'constantp #\x)
+(eq-test t #'constantp :test)
+(eq-test nil #'constantp 'test)
+(eq-test t #'constantp ''1)
+(eq-test t #'constantp '(quote 1))
+(eq-test t #'constantp "string")
+(eq-test t #'constantp #c(1 2))
+(eq-test t #'constantp #(1 2))
+(eq-test nil #'constantp #p"test")
+(eq-test nil #'constantp '(1 2))
+(eq-test nil #'constantp (make-hash-table))
+(eq-test nil #'constantp *package*)
+(eq-test nil #'constantp *standard-input*)
+
+;; copy-list, copy-alist and copy-tree - function
+(equal-test '(1 2) #'copy-list '(1 2))
+(equal-test '(1 . 2) #'copy-list '(1 . 2))
+(eq-test nil #'copy-list nil)
+(error-test #'copy-list 1)
+(equal-eval '(1 (2 3)) '(setq x '(1 (2 3))))
+(equal-eval x '(setq y (copy-list x)))
+(equal-test '("one" (2 3)) #'rplaca x "one")
+(eql-test 1 #'car y)
+(equal-test '("two" 3) #'rplaca (cadr x) "two")
+(eq-test (caadr x) #'caadr y)
+(equal-eval '(1 (2 3) 4) '(setq a '(1 (2 3) 4) b (copy-list a)))
+(eq-eval t '(eq (cadr a) (cadr b)))
+(eq-eval t '(eq (car a) (car b)))
+(setq a '(1 (2 3) 4) b (copy-alist a))
+(eq-eval nil '(eq (cadr a) (cadr b)))
+(eq-eval t '(eq (car a) (car b)))
+(eq-test nil #'copy-alist nil)
+(eq-test nil #'copy-list nil)
+(error-test #'copy-list 1)
+(setq a '(1 (2 (3))))
+(setq as-list (copy-list a))
+(setq as-alist (copy-alist a))
+(setq as-tree (copy-tree a))
+(eq-eval t '(eq (cadadr a) (cadadr as-list)))
+(eq-eval t '(eq (cadadr a) (cadadr as-alist)))
+(eq-eval nil '(eq (cadadr a) (cadadr as-tree)))
+
+;; decf                                        - macro
+(setq n 2)
+(eql-eval 1 '(decf n))
+(eql-eval 1 'n)
+(setq n -2147483648)
+(eql-eval -2147483649 '(decf n))
+(eql-eval -2147483649 'n)
+(setq n 0)
+(eql-eval -0.5d0 '(decf n 0.5d0))
+(eql-eval -0.5d0 'n)
+(setq n 1)
+(eql-eval 1/2 '(decf n 1/2))
+(eql-eval 1/2 'n)
+
+;; delete and remove                   - function
+(setq a '(1 3 4 5 9) b a)
+(equal-test '(1 3 5 9) #'remove 4 a)
+(eq-eval t '(eq a b))
+(setq a (delete 4 a))
+(equal-eval '(1 3 5 9) 'a)
+(setq a '(1 2 4 1 3 4 5) b a)
+(equal-test '(1 2 1 3 5) #'remove 4 a)
+(eq-eval t '(eq a b))
+(equal-test '(1 2 1 3 4 5) #'remove 4 a :count 1)
+(eq-eval t '(eq a b))
+(equal-test '(1 2 4 1 3 5) #'remove 4 a :count 1 :from-end t)
+(eq-eval t '(eq a b))
+(equal-test '(4 3 4 5) #'remove 3 a :test #'>)
+(eq-eval t '(eq a b))
+(setq a (delete 4 '(1 2 4 1 3 4 5)))
+(equal-eval '(1 2 1 3 5) 'a)
+(setq a (delete 4 '(1 2 4 1 3 4 5) :count 1))
+(equal-eval '(1 2 1 3 4 5) 'a)
+(setq a (delete 4 '(1 2 4 1 3 4 5) :count 1 :from-end t))
+(equal-eval '(1 2 4 1 3 5) 'a)
+(equal-test "abc" #'delete-if #'digit-char-p "a1b2c3")
+(equal-test "123" #'delete-if-not #'digit-char-p "a1b2c3")
+(eq-test nil #'delete 1 nil)
+(eq-test nil #'remove 1 nil)
+(setq a '(1 2 3 4 :test 5 6 7 8) b a)
+(equal-test '(1 2 :test 7 8) #'remove-if #'numberp a :start 2 :end 7)
+(eq-eval t '(eq a b))
+(setq a (delete-if #'numberp a :start 2 :end 7))
+(equal-eval '(1 2 :test 7 8) 'a)
+
+;; digit-char                          - function
+(eql-test #\0 #'digit-char 0)
+(eql-test #\A #'digit-char 10 11)
+(eq-test nil #'digit-char 10 10)
+(eql-test 35 #'digit-char-p #\z 36)
+(error-test #'digit-char #\a)
+(error-test #'digit-char-p 1/2)
+
+
+
+;; TODO directory (known to have problems with parameters like "../*/../*/")
+
+
+
+;; elt                                 - function
+(eql-test #\a #'elt "xabc" 1)
+(eql-test 3 #'elt '(0 1 2 3) 3)
+(error-test #'elt nil 0)
+
+;; endp                                        - function
+(eql-test t #'endp nil)
+(error-test #'endp t)
+(eql-test nil #'endp '(1 . 2))
+(error-test #'endp #(1 2))
+
+;; every                               - function
+(eql-test t #'every 'not-used ())
+(eql-test t #'every #'characterp "abc")
+(eql-test nil #'every #'< '(1 2 3) '(4 5 6) #(7 8 -1))
+(eql-test t #'every #'< '(1 2 3) '(4 5 6) #(7 8))
+
+;; fboundp and fmakunbound             - function
+(eq-test t #'fboundp 'car)
+(eq-eval 'test '(defun test ()))
+(eq-test t #'fboundp 'test)
+(eq-test 'test #'fmakunbound 'test)
+(eq-test nil #'fboundp 'test)
+(eq-eval 'test '(defmacro test (x) x))
+(eq-test t #'fboundp 'test)
+(eq-test 'test #'fmakunbound 'test)
+
+;; fill                                        - function
+(setq x (list 1 2 3 4))
+(equal-test '((4 4 4 4) (4 4 4 4) (4 4 4 4) (4 4 4 4)) #'fill x '(4 4 4 4))
+(eq-eval t '(eq (car x) (cadr x)))
+(equalp-test '#(a z z d e) #'fill '#(a b c d e) 'z :start 1 :end 3)
+(equal-test "012ee" #'fill (xseq "01234") #\e :start 3)
+(error-test #'fill 1 #\a)
+
+;; find                                        - function
+(eql-test #\Space #'find #\d "here are some letters that can be looked at" :test #'char>)
+(eql-test 3 #'find-if #'oddp '(1 2 3 4 5) :end 3 :from-end t)
+(eq-test nil #'find-if-not #'complexp '#(3.5 2 #C(1.0 0.0) #C(0.0 1.0)) :start 2)
+(eq-test nil #'find 1 "abc")
+(error-test #'find 1 #c(1 2))
+
+;; find-symbol                         - function
+(equal-eval '(nil nil)
+    '(multiple-value-list (find-symbol "NEVER-BEFORE-USED")))
+(equal-eval '(nil nil)
+    '(multiple-value-list (find-symbol "NEVER-BEFORE-USED")))
+(setq test (multiple-value-list (intern "NEVER-BEFORE-USED")))
+(equal-eval test '(read-from-string "(never-before-used nil)"))
+(equal-eval '(never-before-used :internal)
+    '(multiple-value-list (intern "NEVER-BEFORE-USED")))
+(equal-eval '(never-before-used :internal)
+    '(multiple-value-list (find-symbol "NEVER-BEFORE-USED")))
+(equal-eval '(nil nil)
+    '(multiple-value-list (find-symbol "never-before-used")))
+(equal-eval '(car :inherited)
+    '(multiple-value-list (find-symbol "CAR" 'common-lisp-user)))
+(equal-eval '(car :external)
+   '(multiple-value-list  (find-symbol "CAR" 'common-lisp)))
+;; XXX these will generate wrong results, NIL is not really a symbol
+;; currently in the interpreter
+(equal-eval '(nil :inherited)
+    '(multiple-value-list (find-symbol "NIL" 'common-lisp-user)))
+(equal-eval '(nil :external)
+    '(multiple-value-list (find-symbol "NIL" 'common-lisp)))
+(setq test (multiple-value-list
+     (find-symbol "NIL" (prog1 (make-package "JUST-TESTING" :use '())
+                              (intern "NIL" "JUST-TESTING")))))
+(equal-eval (read-from-string "(just-testing::nil :internal)") 'test)
+(eq-eval t '(export 'just-testing::nil 'just-testing))
+(equal-eval '(just-testing:nil :external)
+    '(multiple-value-list (find-symbol "NIL" 'just-testing)))
+
+#+xedit (equal-eval '(nil nil)
+       '(multiple-value-list (find-symbol "NIL" "KEYWORD")))
+#|
+;; optional result of previous form:
+(equal-eval '(:nil :external)
+    '(multiple-value-list (find-symbol "NIL" "KEYWORD")))
+|#
+
+
+
+;; funcall                             - function
+(eql-test 6 #'funcall #'+ 1 2 3)
+(eql-test 1 #'funcall #'car '(1 2 3))
+(equal-test '(1 2 3) #'funcall #'list 1 2 3)
+
+
+
+;; TODO properly implement ``function''
+
+
+
+;; functionp                           - function (predicate)
+(eq-test nil #'functionp 'append)
+(eq-test t #'functionp #'append)
+(eq-test nil #'functionp '(lambda (x) (* x x)))
+(eq-test t #'functionp #'(lambda (x) (* x x)))
+(eq-test t #'functionp (symbol-function 'append))
+(eq-test nil #'functionp 1)
+(eq-test nil #'functionp nil)
+
+;; gensym                              - function
+(setq sym1 (gensym))
+(eq-test nil #'symbol-package sym1)
+(setq sym1 (gensym 100))
+(setq sym2 (gensym 100))
+(eq-test nil #'eq sym1 sym2)
+(eq-test nil #'equalp (gensym) (gensym))
+
+;; get                                 - accessor
+(defun make-person (first-name last-name)
+  (let ((person (gensym "PERSON")))
+    (setf (get person 'first-name) first-name)
+    (setf (get person 'last-name) last-name)
+    person))
+(eq-eval '*john* '(defvar *john* (make-person "John" "Dow")))
+(eq-eval '*sally* '(defvar *sally* (make-person "Sally" "Jones")))
+(equal-eval "John" '(get *john* 'first-name))
+(equal-eval "Jones" '(get *sally* 'last-name))
+(defun marry (man woman married-name)
+  (setf (get man 'wife) woman)
+  (setf (get woman 'husband) man)
+  (setf (get man 'last-name) married-name)
+  (setf (get woman 'last-name) married-name)
+  married-name)
+(equal-eval "Dow-Jones" '(marry *john* *sally* "Dow-Jones"))
+(equal-eval "Dow-Jones" '(get *john* 'last-name))
+(equal-eval "Sally" '(get (get *john* 'wife) 'first-name))
+(equal-eval `(wife ,*sally* last-name "Dow-Jones" first-name "John")
+    '(symbol-plist *john*))
+(eq-eval 'age
+    '(defmacro age (person &optional (default ''thirty-something))
+      `(get ,person 'age ,default)))
+(eq-eval 'thirty-something '(age *john*))
+(eql-eval 20 '(age *john* 20))
+(eql-eval 25 '(setf (age *john*) 25))
+(eql-eval 25 '(age *john*))
+(eql-eval 25 '(age *john* 20))
+
+;; graphic-char-p                      - function
+(eq-test t #'graphic-char-p #\a)
+(eq-test t #'graphic-char-p #\Space)
+(eq-test nil #'graphic-char-p #\Newline)
+(eq-test nil #'graphic-char-p #\Tab)
+(eq-test nil #'graphic-char-p #\Rubout)
+
+;; if                                  - special operator
+(eq-eval nil '(if nil t))
+(eq-eval nil '(if t nil t))
+(eq-eval nil '(if nil t nil))
+(eq-eval nil '(if nil t (if nil (if nil t) nil)))
+
+;; incf                                        - macro
+(setq n 1)
+(eql-eval 2 '(incf n))
+(eql-eval 2 'n)
+(setq n 2147483647)
+(eql-eval 2147483648 '(incf n))
+(eql-eval 2147483648 'n)
+(setq n 0)
+(eql-eval 0.5d0 '(incf n 0.5d0))
+(eql-eval 0.5d0 'n)
+(setq n 1)
+(eql-eval 3/2 '(incf n 1/2))
+(eql-eval 3/2 'n)
+
+;; intersection                                - function
+(setq list1 (list 1 1 2 3 4 'a 'b 'c "A" "B" "C" "d")
+      list2 (list 1 4 5 'b 'c 'd "a" "B" "c" "D"))
+(equal-test '(1 1 4 b c) #'intersection list1 list2)
+(equal-test '(1 1 4 b c "B") #'intersection list1 list2 :test 'equal)
+(equal-test '(1 1 4 b c "A" "B" "C" "d")
+    #'intersection list1 list2 :test #'equalp)
+(setq list1 (nintersection list1 list2))
+(equal-eval '(1 1 4 b c) 'list1)
+(setq list1 (copy-list '((1 . 2) (2 . 3) (3 . 4) (4 . 5))))
+(setq list2 (copy-list '((1 . 3) (2 . 4) (3 . 6) (4 . 8))))
+(equal-test '((2 . 3) (3 . 4)) #'nintersection list1 list2 :key #'cdr)
+
+;; keywordp                            - function (predicate)
+(eq-test t #'keywordp :test)
+(eq-test nil #'keywordp 'test)
+(eq-test nil #'keywordp '#:test)
+(eq-test nil #'keywordp 1)
+(eq-test nil #'keywordp #'keywordp)
+(eq-test nil #'keywordp nil)
+
+;; last                                        - function
+(equal-test '(3) #'last '(1 2 3))
+(equal-test '(2 . 3) #'last '(1 2 . 3))
+(eq-test nil #'last nil)
+(eql-test () #'last '(1 2 3) 0)
+(setq a '(1 . 2))
+(eql-test 2 #'last a 0)
+(eq-test a #'last a 1)
+(eq-test a #'last a 2)
+(eq-test t #'last t)
+(equal-test #c(1 2) #'last #c(1 2))
+(equalp-test #(1 2 3) #'last #(1 2 3))
+
+;; length                              - function
+(eql-test 3 #'length "abc")
+(eql-test 0 #'length nil)
+(eql-test 1 #'length '(1 . 2))
+(eql-test 2 #'length #(1 2))
+(error-test #'length #c(1 2))
+(error-test #'length t)
+
+;; let                                 - special operator
+(eql-eval 2 '(setq a 1 b 2))
+(eql-eval 2 '(let ((a 2)) a))
+(eql-eval 1 'a)
+(eql-eval 1 '(let ((a 3) (b a)) b))
+(eql-eval 2 'b)
+
+;; let*                                        - special operator
+(setq a 1 b 2)
+(eql-eval 2 '(let* ((a 2)) a))
+(eql-eval 1 'a)
+(eql-eval 3 '(let* ((a 3) (b a)) b))
+(eql-eval 2 'b)
+
+;; list                                        - function
+(equal-test '(1) #'list 1)
+(equal-test '(3 4 a b 4) #'list 3 4 'a (car '(b . c)) (+ 6 -2))
+(eq-test nil #'list)
+
+;; list-length                         - function
+(eql-test 4 #'list-length '(a b c d))
+(eql-test 3 #'list-length '(a (b c) d))
+(eql-test 0 #'list-length '())
+(eql-test 0 #'list-length nil)
+(defun circular-list (&rest elements)
+  (let ((cycle (copy-list elements))) 
+    (nconc cycle cycle)))
+(eq-test nil #'list-length (circular-list 'a 'b))
+(eq-test nil #'list-length (circular-list 'a))
+(eql-test 0 #'list-length (circular-list))
+
+;; list*                               - function
+(eql-test 1 #'list* 1)
+(equal-test '(a b c . d) #'list* 'a 'b 'c 'd)
+(error-test #'list*)
+(setq a '(1 2))
+(eq-test a #'list* a)
+
+;; listp                               - function (predicate)
+(eq-test t #'listp nil)
+(eq-test t #'listp '(1 . 2))
+(eq-test nil #'listp t)
+(eq-test nil #'listp #'listp)
+(eq-test nil #'listp #(1 2))
+(eq-test nil #'listp #c(1 2))
+
+;; lower-case-p                                - function
+(eq-test t #'lower-case-p #\a)
+(eq-test nil #'lower-case-p #\1)
+(eq-test nil #'lower-case-p #\Newline)
+(error-test #'lower-case-p 1)
+
+
+
+;; TODO make-array     (will be rewritten)
+
+
+
+;; make-list                           - function
+(equal-test '(nil nil nil) #'make-list 3)
+(equal-test '((1 2) (1 2)) #'make-list 2 :initial-element '(1 2))
+(eq-test nil #'make-list 0)
+(eq-test nil #'make-list 0 :initial-element 1)
+
+;; make-package                                - function
+(setq pack1 (make-package "PACKAGE-1" :nicknames '("PACK-1" "PACK1")))
+(setq pack2 (make-package "PACKAGE-2" :nicknames '("PACK-2" "PACK2") :use '("PACK1")))
+(equal-test (list pack2) #'package-used-by-list pack1)
+(equal-test (list pack1) #'package-use-list pack2)
+(eq-test pack1 #'symbol-package 'pack1::test)
+(eq-test pack2 #'symbol-package 'pack2::test)
+
+;; make-string                         - function
+(equal-test "55555" #'make-string 5 :initial-element #\5)
+(equal-test "" #'make-string 0)
+(error-test #'make-string 10 :initial-element t)
+(error-test #'make-string 10 :initial-element nil)
+(error-test #'make-string 10 :initial-element 1)
+(eql-test 10 #'length (make-string 10))
+
+;; make-symbol                         - function
+(setq a "TEST")
+;; This will fail
+(eq-test nil #'eq (make-symbol a) (make-symbol a))
+(equal-test a #'symbol-name (make-symbol a))
+(setq temp-string "temp")
+(setq temp-symbol (make-symbol temp-string))
+(equal-test temp-string #'symbol-name temp-symbol)
+(equal-eval '(nil nil) '(multiple-value-list (find-symbol temp-string)))
+
+;; makunbound                          - function
+(eq-eval 1 '(setf (symbol-value 'a) 1))
+(eq-test t #'boundp 'a)
+(eql-eval 1 'a)
+(eq-test 'a #'makunbound 'a)
+(eq-test nil #'boundp 'a)
+(error-test #'makunbound 1)
+
+;; mapc                                        - function
+(setq dummy nil)
+(equal-test '(1 2 3 4)
+    #'mapc #'(lambda (&rest x) (setq dummy (append dummy x)))
+   '(1 2 3 4)
+   '(a b c d e)
+   '(x y z))
+(equal-eval '(1 a x 2 b y 3 c z) 'dummy)
+
+;; mapcan                              - function
+(equal-test '(d 4 e 5)
+    #'mapcan #'(lambda (x y) (if (null x) nil (list x y)))
+    '(nil nil nil d e)
+    '(1 2 3 4 5 6))
+(equal-test '(1 3 4 5)
+    #'mapcan #'(lambda (x) (and (numberp x) (list x)))
+    '(a 1 b c 3 4 d 5))
+
+;; mapcar                              - function
+(equal-test '(1 2 3) #'mapcar #'car '((1 a) (2 b) (3 c)))
+(equal-test '(3 4 2 5 6) #'mapcar #'abs '(3 -4 2 -5 -6))
+(equal-test '((a . 1) (b . 2) (c . 3)) #'mapcar #'cons '(a b c) '(1 2 3))
+(equal-test '((1 3 5)) #'mapcar #'list* '(1 2) '(3 4) '((5)))
+(equal-test '((1 3 5) (2 4 6)) #'mapcar #'list* '(1 2) '(3 4) '((5) (6)))
+
+;; mapcon                              - function
+(equal-test '(1 a 2 b (3) c) #'mapcon #'car '((1 a) (2 b) ((3) c)))
+(equal-test '((1 2 3 4) (2 3 4) (3 4) (4)) #'mapcon #'list '(1 2 3 4))
+
+;; mapl                                        - function
+(setq dummy nil)
+(equal-test '(1 2 3 4) #'mapl #'(lambda (x) (push x dummy)) '(1 2 3 4))
+(equal-eval '((4) (3 4) (2 3 4) (1 2 3 4)) 'dummy)
+
+;; maplist                             - function
+(equal-test '((1 2 3 4 1 2 1 2 3) (2 3 4 2 2 3))
+    #'maplist #'append '(1 2 3 4) '(1 2) '(1 2 3))
+(equal-test '((foo a b c d) (foo b c d) (foo c d) (foo d))
+    #'maplist #'(lambda (x) (cons 'foo x)) '(a b c d))
+(equal-test '(0 0 1 0 1 1 1)
+    #'maplist #'(lambda (x) (if (member (car x) (cdr x)) 0 1)) '(a b a c d b c))
+
+;; member                              - function
+(setq a '(1 2 3))
+(eq-test (cdr a) #'member 2 a)
+(setq a '((1 . 2) (3 . 4)))
+(eq-test (cdr a) #'member 2 a :test-not #'= :key #'cdr)
+(eq-test nil #'member 'e '(a b c d))
+(eq-test nil #'member 1 nil)
+(error-test #'member 2 '(1 . 2))
+(setq a '(a b nil c d))
+(eq-test (cddr a) #'member-if #'listp a)
+(setq a '(a #\Space 5/3 foo))
+(eq-test (cddr a) #'member-if #'numberp a)
+(setq a '(3 6 9 11 . 12))
+(eq-test (cdddr a) #'member-if-not #'zerop a :key #'(lambda (x) (mod x 3)))
+
+;; multiple-value-bind                 - macro
+(equal-eval '(11 9) '(multiple-value-bind (f r) (floor 130 11) (list f r)))
+
+;; multiple-value-call                 - special operator
+(equal-eval '(1 / 2 3 / / 2 0.5)
+    '(multiple-value-call #'list 1 '/ (values 2 3) '/ (values) '/ (floor 2.5)))
+(eql-eval 10 '(multiple-value-call #'+ (floor 5 3) (floor 19 4)))
+
+;; multiple-value-list                 - macro
+(equal-eval '(-1 1) '(multiple-value-list (floor -3 4)))
+(eql-eval nil '(multiple-value-list (values)))
+(equal-eval '(nil) '(multiple-value-list (values nil)))
+
+;; multiple-value-prog1                        - special operator
+(setq temp '(1 2 3))
+(equal-eval temp
+    '(multiple-value-list
+       (multiple-value-prog1
+           (values-list temp)
+           (setq temp nil)
+           (values-list temp))))
+
+;; multiple-value-setq                 - macro
+(eql-eval 1 '(multiple-value-setq (quotient remainder) (truncate 3.5d0 2)))
+(eql-eval 1 quotient)
+(eql-eval 1.5d0 'remainder)
+(eql-eval 1 '(multiple-value-setq (a b c) (values 1 2)))
+(eql-eval 1 'a)
+(eql-eval 2 'b)
+(eq-eval nil 'c)
+(eql-eval 4 '(multiple-value-setq (a b) (values 4 5 6)))
+(eql-eval 4 'a)
+(eql-eval 5 'b)
+(setq a 1)
+(eql-eval nil '(multiple-value-setq (a) (values)))
+(eql-eval nil 'a)
+
+;; nconc                               - function
+(eq-test nil #'nconc)
+(setq x '(a b c))
+(setq y '(d e f))
+(equal-test '(a b c d e f) #'nconc x y)
+(equal-eval '(a b c d e f) 'x)
+(eq-test y #'cdddr x)
+(equal-test '(1 . 2) #'nconc (list 1) 2)
+(error-test #'nconc 1 2 3)
+(equal-eval '(k l m)
+   '(setq foo (list 'a 'b 'c 'd 'e)
+         bar (list 'f 'g 'h 'i 'j)
+         baz (list 'k 'l 'm)))
+(equal-test '(a b c d e f g h i j k l m) #'nconc foo bar baz)
+(equal-eval '(a b c d e f g h i j k l m) 'foo)
+(equal-eval (nthcdr 5 foo) 'bar)
+(equal-eval (nthcdr 10 foo) 'baz)
+(setq foo (list 'a 'b 'c 'd 'e)
+      bar (list 'f 'g 'h 'i 'j)
+      baz (list 'k 'l 'm))
+(equal-eval '(a b c d e f g h i j k l m) '(setq foo (nconc nil foo bar nil baz)))
+(equal-eval '(a b c d e f g h i j k l m) 'foo)
+(equal-eval (nthcdr 5 foo) 'bar)
+(equal-eval (nthcdr 10 foo) 'baz)
+
+;; notany                              - function
+(eql-test t #'notany #'> '(1 2 3 4) '(5 6 7 8) '(9 10 11 12))
+(eql-test t #'notany 'not-used ())
+(eql-test nil #'notany #'characterp #(1 2 3 4 5 #\6 7 8))
+
+;; notevery                            - function
+(eql-test nil #'notevery #'< '(1 2 3 4) '(5 6 7 8) '(9 10 11 12))
+(eql-test nil #'notevery 'not-used ())
+(eql-test t #'notevery #'numberp #(1 2 3 4 5 #\6 7 8))
+
+;; nth                                 - accessor (function)
+(eql-test 'foo #'nth 0 '(foo bar baz))
+(eql-test 'bar #'nth 1 '(foo bar baz))
+(eq-test nil #'nth 3 '(foo bar baz))
+(error-test #'nth 0 #c(1 2))
+(error-test #'nth 0 #(1 2))
+(error-test #'nth 0 "test")
+
+;; nth-value                           - macro
+(equal-eval 'a '(nth-value 0 (values 'a 'b)))
+(equal-eval 'b '(nth-value 1 (values 'a 'b)))
+(eq-eval nil '(nth-value 2 (values 'a 'b)))
+(equal-eval '(3332987528 3332987528 t)
+    '(multiple-value-list
+       (let* ((x 83927472397238947423879243432432432)
+              (y 32423489732)
+              (a (nth-value 1 (floor x y)))
+              (b (mod x y)))
+         (values a b (= a b)))))
+
+;; nthcdr                              - function
+(eq-test nil #'nthcdr 0 '())
+(eq-test nil #'nthcdr 3 '())
+(equal-test '(a b c) #'nthcdr 0 '(a b c))
+(equal-test '(c) #'nthcdr 2 '(a b c))
+(eq-test () #'nthcdr 4 '(a b c))
+(eql-test 1 #'nthcdr 1 '(0 . 1))
+(error-test #'nthcdr -1 '(1 2))
+(error-test #'nthcdr #\Null '(1 2))
+(error-test #'nthcdr 1 t)
+(error-test #'nthcdr 1 #(1 2 3))
+
+;; or                                  - macro
+(eq-eval nil '(or))
+(setq temp0 nil temp1 10 temp2 20 temp3 30)
+(eql-eval 10 '(or temp0 temp1 (setq temp2 37)))
+(eql-eval 20 'temp2)
+(eql-eval 11 '(or (incf temp1) (incf temp2) (incf temp3)))
+(eql-eval 11 'temp1)
+(eql-eval 20 temp2)
+(eql-eval 30 'temp3)
+(eql-eval 11 '(or (values) temp1))
+(eql-eval 11 '(or (values temp1 temp2) temp3))
+(equal-eval '(11 20) '(multiple-value-list (or temp0 (values temp1 temp2))))
+(equal-eval '(20 30)
+    '(multiple-value-list (or (values temp0 temp1) (values temp2 temp3))))
+
+;; packagep                            - function (predicate)
+(eq-test t #'packagep *package*)
+(eq-test nil #'packagep 10)
+(eq-test t #'packagep (make-package "TEST-PACKAGE"))
+(eq-test nil #'packagep 'keyword)
+(eq-test t #'packagep (find-package 'keyword))
+
+;; pairlis                             - function
+#+xedit        ;; order of result may vary
+(progn
+    (equal-test '((one . 1) (two . 2) (three . 3) (four . 19))
+       #'pairlis '(one two) '(1 2) '((three . 3) (four . 19)))
+    (setq keys '(1 2 3)
+         data '("one" "two" "three")
+         alist '((4 . "four")))
+    (equal-test '((1 . "one") (2 . "two") (3 . "three"))
+       #'pairlis keys data)
+    (equal-test '((1 . "one") (2 . "two") (3 . "three") (4 . "four"))
+       #'pairlis keys data alist)
+    (equal-eval '(1 2 3) 'keys)
+    (equal-eval '("one" "two" "three") 'data)
+    (equal-eval '((4 . "four")) 'alist)
+    (eq-test nil #'pairlis 1 2)
+    (error-test #'pairlis '(1 2 3) '(4 5))
+)
+
+;; pop                                 - macro
+(setq stack '(a b c) test stack)
+(eq-eval 'a '(pop stack))
+(eq-eval (cdr test) 'stack)
+(setq llst '((1 2 3 4)) test (car llst))
+(eq-eval 1 '(pop (car llst)))
+(eq-eval (cdr test) '(car llst))
+(error-eval '(pop 1))
+(error-eval '(pop nil))
+;; dotted list
+(setq stack (cons 1 2))
+(eq-eval 1 '(pop stack))
+(error-eval '(pop stack))
+;; circular list
+(setq stack '#1=(1 . #1#) *print-circle* t)
+(eql-eval 1 '(pop stack))
+(eql-eval 1 '(pop stack))
+(eql-eval 1 '(pop (cdr stack)))
+
+;; position                            - function
+(eql-test 4 #'position #\a "baobab" :from-end t)
+(eql-test 2 #'position-if #'oddp '((1) (2) (3) (4)) :start 1 :key #'car)
+(eq-test nil #'position 595 '())
+(eq-test 4 #'position-if-not #'integerp '(1 2 3 4 5.0))
+(eql-test 1 #'position (char-int #\1) "0123" :key #'char-int)
+
+;; prog                                        - macro
+(eq-eval nil '(prog () :error))
+(eq-eval 'ok
+    '(prog ((a 0))
+       l1 (if (< a 10) (go l3) (go l2))
+       (return 'failed)
+       l2 (return 'ok)
+       (return 'failed)
+       l3 (incf a) (go l1)
+       (return 'failed)
+    ))
+(setq a 1)
+(eq-eval '/= '(prog ((a 2) (b a)) (return (if (= a b) '= '/=))))
+
+;; prog*                               - macro
+(setq a 1)
+(eq-eval nil '(prog* () :error))
+(eq-eval 'ok
+    '(prog* ((a 0) (b 0))
+       l1 (if (< a 10) (go l3) (go l2))
+       (return 'failed)
+       l2 (if (< b 10) (go l4) (return 'ok))
+       (return 'failed)
+       l3 (incf a) (go l1)
+       (return 'failed)
+       l4 (incf b) (setq a 0) (go l1)
+       (return 'failed)
+    ))
+(eq-eval '= '(prog* ((a 2) (b a)) (return (if (= a b) '= '/=))))
+
+;; prog1                               - macro
+(setq temp 1)
+(eql-eval 1 '(prog1 temp (incf temp) (eql-eval 2 'temp) temp))
+(eql-eval 2 'temp)
+(eql-eval 2 '(prog1 temp (setq temp nil) (eql-eval nil 'temp) temp))
+(eq-eval nil 'temp)
+(eql-eval 1 '(prog1 (values 1 2 3) 4))
+(setq temp (list 'a 'b 'c))
+(eq-eval 'a '(prog1 (car temp) (setf (car temp) 'alpha)))
+(equal-eval '(alpha b c) 'temp)
+(equal-eval '(1)
+    '(multiple-value-list (prog1 (values 1 2) (values 4 5))))
+
+;; prog2                               - macro
+(setq temp 1)
+(eql-eval 3 '(prog2 (incf temp) (incf temp) (incf temp)))
+(eql-eval 4 'temp)
+(eql-eval 2 '(prog2 1 (values 2 3 4) 5))
+(equal-eval '(3)
+    '(multiple-value-list (prog2 (values 1 2) (values 3 4) (values 5 6))))
+
+;; progn                               - special operator
+(eq-eval nil '(progn))
+(eql-eval 3 '(progn 1 2 3))
+(equal-eval '(1 2 3) '(multiple-value-list (progn (values 1 2 3))))
+(setq a 1)
+(eq-eval 'here '(if a (progn (setq a nil) 'here) (progn (setq a t) 'there)))
+(eq-eval nil 'a)
+
+;; progv                               - special operator
+(makunbound '*x*)      ;; make sure it is not bound
+(setq *x* 1)
+(eql-eval 2 '(progv '(*x*) '(2) *x*))
+(eql-eval 1 '*x*)
+(equal-eval '(3 4)
+    '(let ((*x* 3)) (progv '(*x*) '(4) (list *x* (symbol-value '*x*)))))
+(makunbound '*x*)
+(defvar *x* 1)
+(equal-eval '(4 4)
+    '(let ((*x* 3)) (progv '(*x*) '(4) (list *x* (symbol-value '*x*)))))
+(equal-eval '(4 4)
+    '(multiple-value-list
+       (let ((*x* 3))
+            (progv '(*x*) '(4) (values-list (list *x* (symbol-value '*x*)))))))
+
+;; push                                        - macro
+(setq llst '(nil))
+(equal-eval '(1) '(push 1 (car llst)))
+(equal-eval '((1)) 'llst)
+(equal-eval '(1 1) '(push 1 (car llst)))
+(equal-eval '((1 1)) 'llst)
+(setq x '(a (b c) d))
+(equal-eval '(5 B C) '(push 5 (cadr x)))
+(equal-eval '(a (5 b c) d) 'x)
+
+;; pushnew                             - macro
+(setq x '(a (b c) d))
+(equal-eval '(5 b c) '(pushnew 5 (cadr x)))
+(equal-eval '(a (5 b c) d) 'x)
+(equal-eval '(5 b c) '(pushnew 'b (cadr x)))
+(equal-eval '(a (5 b c) d) 'x)
+(setq lst '((1) (1 2) (1 2 3)))
+(equal-eval '((2) (1) (1 2) (1 2 3)) '(pushnew '(2) lst))
+(equal-eval '((1) (2) (1) (1 2) (1 2 3)) '(pushnew '(1) lst))
+(equal-eval '((1) (2) (1) (1 2) (1 2 3)) '(pushnew '(1) lst :test 'equal))
+(equal-eval '((1) (2) (1) (1 2) (1 2 3)) '(pushnew '(1) lst :key #'car))
+
+;; remove-duplicates                   - function
+(equal-test "aBcD" #'remove-duplicates "aBcDAbCd" :test #'char-equal :from-end t)
+(equal-test '(a c b d e) #'remove-duplicates '(a b c b d d e))
+(equal-test '(a b c d e) #'remove-duplicates '(a b c b d d e) :from-end t)
+(equal-test '((bar #\%) (baz #\A))
+    #'remove-duplicates '((foo #\a) (bar #\%) (baz #\A))
+     :test #'char-equal :key #'cadr)
+(equal-test '((foo #\a) (bar #\%))
+    #'remove-duplicates '((foo #\a) (bar #\%) (baz #\A))
+     :test #'char-equal :key #'cadr :from-end t)
+(setq tester (list 0 1 2 3 4 5 6))
+(equal-test '(0 4 5 6) #'delete-duplicates tester :key #'oddp :start 1 :end 6)
+
+;; replace                             - function
+(equal-test "abcd456hij"
+    #'replace (copy-seq "abcdefghij") "0123456789" :start1 4 :end1 7 :start2 4)
+(setq lst (xseq "012345678"))
+(equal-test "010123456" #'replace lst lst :start1 2 :start2 0)
+(equal-eval "010123456" 'lst)
+
+;; rest                                        - accessor
+(equal-eval '(2) '(rest '(1 2)))
+(eql-eval 2 '(rest '(1 . 2)))
+(eq-eval nil '(rest '(1)))
+(setq *cons* '(1 . 2))
+(equal-eval "two" '(setf (rest *cons*) "two"))
+(equal-eval '(1 . "two") '*cons*)
+
+;; return                              - macro
+(eq-eval nil '(block nil (return) 1))
+(eql-eval 1 '(block nil (return 1) 2))
+(equal-eval '(1 2) '(multiple-value-list (block nil (return (values 1 2)) 3)))
+(eql-eval 1 '(block nil (block alpha (return 1) 2)))
+(eql-eval 2 '(block alpha (block nil (return 1)) 2))
+(eql-eval 1 '(block nil (block nil (return 1) 2)))
+
+;; return-from                         - special operator
+(eq-eval nil '(block alpha (return-from alpha) 1))
+(eql-eval 1 '(block alpha (return-from alpha 1) 2))
+(equal-eval '(1 2)
+    '(multiple-value-list (block alpha (return-from alpha (values 1 2)) 3)))
+(eql-eval 2
+    '(let ((a 0)) (dotimes (i 10) (incf a) (when (oddp i) (return))) a))
+(eq-eval 'temp '(defun temp (x) (if x (return-from temp ''dummy)) 44))
+(eql-eval 44 '(temp nil))
+(eq-eval 'dummy (temp t))
+(eql-eval 2 (block nil (unwind-protect (return-from nil 1) (return-from nil 2))))
+(error-eval '(funcall (block nil #'(lambda () (return-from nil)))))
+
+;; reverse                             - function
+(setq str (xseq "abc") test str)
+(equal-test "cba" #'reverse str)
+(eq-eval test 'str)
+(equal-eval "cba" '(setq test (nreverse str)))
+(equal-eval "cba" 'test)
+(setq l (list 1 2 3) test l)
+(equal-eval '(3 2 1) '(setq test (nreverse l)))
+(equal-eval '(3 2 1) 'test)
+
+;; rplac?                              - function
+(eql-eval '*some-list*
+    '(defparameter *some-list* (list* 'one 'two 'three 'four)))
+(equal-eval '(one two three . four) '*some-list*)
+(equal-test '(uno two three . four) #'rplaca *some-list* 'uno)
+(equal-eval '(uno two three . four) '*some-list*)
+(equal-test '(three iv) #'rplacd (last *some-list*) (list 'iv))
+(equal-eval '(uno two three iv) '*some-list*)
+
+;; search                              - function
+(eql-test 7 #'search "dog" "it's a dog's life")
+(eql-test 2 #'search '(0 1) '(2 4 6 1 3 5) :key #'oddp)
+(eql-test 8 #'search "foo" "foooobarfooooobarfo" :from-end t)
+(eql-test 5
+    #'search "123"
+       (mapcar #'(lambda (x) (+ x (char-code #\0)))
+       '(1 2 34 3 2 1 2 3 4 3 2 1)) :from-end t
+       :key #'(lambda (x) (if (integerp x) (code-char x) x)))
+(eql-test 0 #'search "abc" "abcd" :from-end t)
+(eql-test 3 #'search "bar" "foobar")
+
+;; set                                 - function
+(eql-eval 1 '(setf (symbol-value 'n) 1))
+(eql-test 2 #'set 'n 2)
+(eql-test 2 #'symbol-value 'n)
+(eql-eval 4
+   '(let ((n 3))
+       (setq n (+ n 1))
+       (setf (symbol-value 'n) (* n 10))
+       (set 'n (+ (symbol-value 'n) n))
+       n))
+(eql-eval 44 'n)
+(defvar *n* 2)
+(eql-eval 80
+   '(let ((*n* 3))
+       (setq *n* (+ *n* 1))
+       (setf (symbol-value '*n*) (* *n* 10))
+       (set '*n* (+ (symbol-value '*n*) *n*))
+       *n*))
+(eql-eval 2 '*n*)
+(eq-eval '*even-count* '(defvar *even-count* 0))
+(eq-eval '*odd-count* '(defvar *odd-count* 0))
+(eql-eval 'tally-list
+   '(defun tally-list (list)
+      (dolist (element list)
+       (set (if (evenp element) '*even-count* '*odd-count*)
+            (+ element (if (evenp element) *even-count* *odd-count*))))))
+(eq-eval nil '(tally-list '(1 9 4 3 2 7)))
+(eql-eval 6 '*even-count*)
+(eql-eval 20 '*odd-count*)
+
+;; set-difference                      - function
+(setq lst1 (list "A" "b" "C" "d") lst2 (list "a" "B" "C" "d"))
+(equal-test '("A" "b" "C" "d") #'set-difference lst1 lst2)
+(equal-test '("A" "b") #'set-difference lst1 lst2 :test 'equal)
+(eq-test nil #'set-difference lst1 lst2 :test #'equalp)
+(equal-test '("A" "b") #'nset-difference lst1 lst2 :test #'string=)
+(setq lst1 '(("a" . "b") ("c" . "d") ("e" . "f"))
+      lst2 '(("c" . "a") ("e" . "b") ("d" . "a")))
+(equal-test '(("c" . "d") ("e" . "f"))
+    #'nset-difference lst1 lst2 :test #'string= :key #'cdr)
+(equal-eval '(("c" . "a") ("e" . "b") ("d" . "a")) 'lst2)
+(equal-test '("banana" "lemon" "rhubarb")
+   #'set-difference
+       '("strawberry" "chocolate" "banana" "lemon" "pistachio" "rhubarb")
+       '(#\c #\w) :test #'(lambda (s c) (find c s)))
+
+;; set-exclusive-or                    - function
+(setq lst1 (list 1 "a" "b") lst2 (list 1 "A" "b"))
+(equal-test '("a" "b" "A" "b") #'set-exclusive-or lst1 lst2)
+(equal-test '("a" "A") #'set-exclusive-or lst1 lst2 :test #'equal)
+(eq-test nil #'set-exclusive-or lst1 lst2 :test 'equalp)
+(equal-test '("a" "b" "A" "b") #'nset-exclusive-or lst1 lst2)
+(setq lst1 '(("a" . "b") ("c" . "d") ("e" . "f"))
+      lst2 '(("c" . "a") ("e" . "b") ("d" . "a")))
+(equal-test '(("c" . "d") ("e" . "f") ("c" . "a") ("d" . "a"))
+    #'nset-exclusive-or lst1 lst2 :test #'string= :key #'cdr)
+
+;; setf                                        - macro
+(setq x (cons 'a 'b) y (list 1 2 3))
+(equal-eval '(1 x 3) '(setf (car x) 'x (cadr y) (car x) (cdr x) y))
+(equal-eval '(x 1 x 3) 'x)
+(equal-eval '(1 x 3) 'y)
+(setq x (cons 'a 'b) y (list 1 2 3))
+(eq-eval nil '(psetf (car x) 'x (cadr y) (car x) (cdr x) y))
+(equal-eval '(x 1 a 3) 'x)
+(equal-eval '(1 a 3) 'y)
+(error-eval '(setf x))
+(error-eval '(psetf x))
+
+;; setq                                        - special form
+(eql-eval 3 '(setq a 1 b 2 c 3))
+(eql-eval 1 'a)
+(eql-eval 2 'b)
+(eql-eval 3 'c)
+(eql-eval 7 '(setq a (1+ b) b (1+ a) c (+ a b)))
+(eql-eval 3 'a)
+(eql-eval 4 'b)
+(eql-eval 7 'c)
+(eq-eval nil '(psetq a 1 b 2 c 3))
+(eql-eval 1 'a)
+(eql-eval 2 'b)
+(eql-eval 3 'c)
+(equal-eval '(2 1)
+    '(multiple-value-list (let ((a 1) (b 2)) (psetq a b  b a) (values a b))))
+(error-eval '(setq x))
+(error-eval '(setq x 1 y))
+
+;; some                                        - function
+(eq-test t #'some #'= '(1 2 3 4 5) '(5 4 3 2 1))
+
+;; sort                                        - function
+(setq tester (copy-seq "lkjashd"))
+(equal-test "adhjkls" #'sort tester #'char-lessp)
+(setq tester (list '(1 2 3) '(4 5 6) '(7 8 9)))
+(equal-test '((7 8 9) (4 5 6) (1 2 3)) #'sort tester #'> :key #'car)
+(setq tester (list 1 2 3 4 5 6 7 8 9 0))
+(equal-test '(1 3 5 7 9 2 4 6 8 0)
+    #'stable-sort tester #'(lambda (x y) (and (oddp x) (evenp y))))
+(equalp-test
+  #((("Kathy" "Chapman") "Editorial")
+    (("Dick" "Gabriel") "Objects")
+    (("Gregor" "Kiczales") "Objects")
+    (("Sandra" "Loosemore") "Compiler")
+    (("Larry" "Masinter") "Cleanup")
+    (("David" "Moon") "Objects")
+    (("Kent" "Pitman") "Conditions")
+    (("Dick" "Waters") "Iteration")
+    (("JonL" "White") "Iteration"))
+   #'sort (setq committee-data
+           (vector (list (list "JonL" "White") "Iteration")
+                   (list (list "Dick" "Waters") "Iteration")
+                   (list (list "Dick" "Gabriel") "Objects")
+                   (list (list "Kent" "Pitman") "Conditions")
+                   (list (list "Gregor" "Kiczales") "Objects")
+                   (list (list "David" "Moon") "Objects")
+                   (list (list "Kathy" "Chapman") "Editorial")
+                   (list (list "Larry" "Masinter") "Cleanup")
+                   (list (list "Sandra" "Loosemore") "Compiler")))
+      #'string-lessp :key #'cadar)
+(equalp-eval
+  #((("Larry" "Masinter") "Cleanup")
+    (("Sandra" "Loosemore") "Compiler")
+    (("Kent" "Pitman") "Conditions")
+    (("Kathy" "Chapman") "Editorial")
+    (("Dick" "Waters") "Iteration")
+    (("JonL" "White") "Iteration")
+    (("Dick" "Gabriel") "Objects")
+    (("Gregor" "Kiczales") "Objects")
+    (("David" "Moon") "Objects"))
+    '(setq committee-data
+       (stable-sort committee-data #'string-lessp :key #'cadr)))
+(error-test #'sort #c(1 2))
+
+;; string                              - function
+(setq a "already a string")
+(eq-test a #'string a)
+(equal-test "ELM" #'string 'elm)
+(equal-test "c" #'string #\c)
+
+;; string-*                            - function
+(eq-test t #'string= "foo" "foo")
+(eq-test nil #'string= "foo" "Foo")
+(eq-test nil #'string= "foo" "bar")
+(eq-test t #'string= "together" "frog" :start1 1 :end1 3 :start2 2)
+(eq-test t #'string-equal "foo" "Foo")
+(eq-test t #'string= "abcd" "01234abcd9012" :start2 5 :end2 9)
+(eql-test 3 #'string< "aaaa" "aaab")
+(eql-test 4 #'string>= "aaaaa" "aaaa")
+(eql-test 5 #'string-not-greaterp "Abcde" "abcdE")
+(eql-test 6 #'string-lessp "012AAAA789" "01aaab6" :start1 3 :end1 7
+                                                 :start2 2 :end2 6)
+(eq-test nil #'string-not-equal "AAAA" "aaaA")
+(error-test #'string= #(1 2 3) '(1 2 3))
+(eql-test 0 #'string< "abcd" "efg")
+(eql-test 1 #'string< "abcd" "afg")
+(eql-test 0 #'string/= "foo" "baar")
+(eql-test nil #'string/= "foobar" "foobar")
+
+;; string-{upcase,downcase,capitalize} - function
+(equal-test "ABCDE" #'string-upcase "abcde")
+(equal-test "aBCDe" #'string-upcase "abcde" :start 1 :end 4)
+(equal-test "aBCDe" #'nstring-upcase (xseq "abcde") :start 1 :end 4)
+(equal-test "DR. LIVINGSTON, I PRESUME?"
+    #'string-upcase "Dr. Livingston, I presume?")
+(equal-test "Dr. LIVINGSTON, I Presume?"
+    #'string-upcase "Dr. Livingston, I presume?" :start 4 :end 19)
+(equal-test "Dr. LIVINGSTON, I Presume?"
+    #'nstring-upcase (xseq "Dr. Livingston, I presume?") :start 4 :end 19)
+(equal-test "Dr. LiVINGston, I presume?"
+    #'string-upcase "Dr. Livingston, I presume?" :start 6 :end 10)
+(equal-test "Dr. LiVINGston, I presume?"
+    #'nstring-upcase (xseq "Dr. Livingston, I presume?") :start 6 :end 10)
+(equal-test "dr. livingston, i presume?"
+    #'string-downcase "Dr. Livingston, I presume?")
+(equal-test "Dr. livingston, i Presume?"
+    #'string-downcase "Dr. Livingston, I Presume?" :start 1 :end 17)
+(equal-test "Dr. livingston, i Presume?"
+    #'nstring-downcase (xseq "Dr. Livingston, I Presume?") :start 1 :end 17)
+(equal-test "Elm 13c Arthur;Fig Don'T"
+    #'string-capitalize "elm 13c arthur;fig don't")
+(equal-test "elm 13C Arthur;Fig Don't"
+    #'string-capitalize "elm 13c arthur;fig don't" :start 6 :end 21)
+(equal-test "elm 13C Arthur;Fig Don't"
+    #'nstring-capitalize (xseq "elm 13c arthur;fig don't") :start 6 :end 21)
+(equal-test " Hello " #'string-capitalize " hello ")
+(equal-test " Hello " #'nstring-capitalize (xseq " hello "))
+(equal-test "Occluded Casements Forestall Inadvertent Defenestration"
+   #'string-capitalize "occlUDeD cASEmenTs FOreSTAll iNADVertent DEFenestraTION")
+(equal-test "Don'T!" #'string-capitalize "DON'T!")
+(equal-test "Pipe 13a, Foo16c" #'string-capitalize "pipe 13a, foo16c")
+(setq str (copy-seq "0123ABCD890a"))
+(equal-test "0123AbcD890a" #'nstring-downcase str :start 5 :end 7)
+(equal-eval "0123AbcD890a" 'str)
+(error-test #'nstring-capitalize 1)
+(error-test #'string-capitalize "foobar" :start 4 :end 2)
+(equal-test "foobar" #'string-capitalize "foobar" :start 0 :end 0)
+
+;; string-{,left-,right-}trim          - function
+(equal-test "kaaak" #'string-trim "abc" "abcaakaaakabcaaa")
+#+xedit (equal-test "kaaak" #'nstring-trim "abc" "abcaakaaakabcaaa")
+(equal-test "garbanzo beans"
+    #'string-trim '(#\Space #\Tab #\Newline) " garbanzo beans
+        ")
+#+xedit (equal-test "garbanzo beans"
+    #'nstring-trim '(#\Space #\Tab #\Newline) " garbanzo beans
+        ")
+(equal-test "three (silly) words"
+    #'string-trim " (*)" " ( *three (silly) words* ) ")
+#+xedit (equal-test "three (silly) words"
+    #'nstring-trim " (*)" " ( *three (silly) words* ) ")
+(equal-test "labcabcabc" #'string-left-trim "abc" "labcabcabc")
+#+xedit (equal-test "labcabcabc" #'nstring-left-trim "abc" "labcabcabc")
+(equal-test "three (silly) words* ) "
+    #'string-left-trim " (*)" " ( *three (silly) words* ) ")
+#+xedit (equal-test "three (silly) words* ) "
+    #'nstring-left-trim " (*)" " ( *three (silly) words* ) ")
+(equal-test " ( *three (silly) words"
+    #'string-right-trim " (*)" " ( *three (silly) words* ) ")
+#+xedit (equal-test " ( *three (silly) words"
+    #'nstring-right-trim " (*)" " ( *three (silly) words* ) ")
+(error-test #'string-trim 123 "123")
+(error-test #'string-left-trim 123 "123")
+
+;; stringp                             - function (predicate)
+(eq-test t #'stringp "abc")
+(eq-test nil #'stringp #\a)
+(eq-test nil #'stringp 1)
+(eq-test nil #'stringp #(#\a #\b #\c))
+
+;; subseq                              - accessor
+(setq str (xseq "012345"))
+(equal-test "2345" #'subseq str 2)
+(equal-test "34" #'subseq str 3 5)
+(equal-eval "abc" '(setf (subseq str 4) "abc"))
+(equal-eval "0123ab" 'str)
+(equal-eval "A" '(setf (subseq str 0 2) "A"))
+(equal-eval "A123ab" 'str)
+
+;; subsetp                             - function
+(setq cosmos '(1 "a" (1 2)))
+(eq-test t #'subsetp '(1) cosmos)
+(eq-test nil #'subsetp '((1 2)) cosmos)
+(eq-test t #'subsetp '((1 2)) cosmos :test 'equal)
+(eq-test t #'subsetp '(1 "A") cosmos :test #'equalp)
+(eq-test nil #'subsetp '((1) (2)) '((1) (2)))
+(eq-test t #'subsetp '((1) (2)) '((1) (2)) :key #'car)
+
+;; svref                               - function
+;; XXX vectors will be reimplemented, just a test for the current implementation
+(setq v (vector 1 2 'sirens))
+(eql-eval 1 '(svref v 0))
+(eql-eval 'sirens '(svref v 2))
+(eql-eval 'newcomer '(setf (svref v 1) 'newcomer))
+(equalp-eval #(1 newcomer sirens) 'v)
+
+;; symbol-name                         - function
+(equal-test "TEMP" #'symbol-name 'temp)
+(equal-test "START" #'symbol-name :start)
+(error-test #'symbol-name 1)
+
+;; symbol-package                      - function
+(eq-test (find-package "LISP") #'symbol-package 'car)
+(eql-test *package* #'symbol-package 'bus)
+(eq-test (find-package "KEYWORD") #'symbol-package :optional)
+;; Gensyms are uninterned, so have no home package.
+(eq-test nil #'symbol-package (gensym))
+(setq pk1 (make-package 'pk1))
+(intern "SAMPLE1" "PK1")
+(eq-eval t '(export (find-symbol "SAMPLE1" "PK1") "PK1"))
+(setq pk2 (make-package 'pk2 :use '(pk1)))
+(equal-eval '(pk1:sample1 :inherited)
+    '(multiple-value-list (find-symbol "SAMPLE1" "PK2")))
+(eq-test pk1 #'symbol-package 'pk1::sample1)
+(eq-test pk1 #'symbol-package 'pk2::sample1)
+(eq-test pk1 #'symbol-package 'pk1::sample2)
+(eq-test pk2 #'symbol-package 'pk2::sample2)
+;; The next several forms create a scenario in which a symbol
+;; is not really uninterned, but is "apparently uninterned",
+;; and so SYMBOL-PACKAGE still returns NIL.
+(setq s3 'pk1::sample3)
+(eq-eval t '(import s3 'pk2))
+(eq-eval t '(unintern s3 'pk1))                ;; XXX unintern not yet implemented
+(eq-test nil #'symbol-package s3)      ;; fail due to unintern not implemented
+(eq-test t #'eq s3 'pk2::sample3)
+
+;; symbol-plist                                - accessor
+(setq sym (gensym))
+(eq-eval () '(symbol-plist sym))
+(eq-eval 'val1 '(setf (get sym 'prop1) 'val1))
+(equal-eval '(prop1 val1) '(symbol-plist sym))
+(eq-eval 'val2 '(setf (get sym 'prop2) 'val2))
+(equal-eval '(prop2 val2 prop1 val1) '(symbol-plist sym))
+(setq sym-plist (list 'prop3 'val3))
+(eq-eval sym-plist '(setf (symbol-plist sym) sym-plist))
+(eq-eval sym-plist '(symbol-plist sym))
+
+;; symbol-value                                - accessor
+(eql-eval 1 '(setf (symbol-value 'a) 1))
+(eql-eval 1 '(symbol-value 'a))
+;; SYMBOL-VALUE cannot see lexical variables.
+(eql-eval 1 '(let ((a 2)) (symbol-value 'a)))
+(eql-eval 1 '(let ((a 2)) (setq a 3) (symbol-value 'a)))
+
+#+xedit        ;; incorrect...
+(progn
+    ;; SYMBOL-VALUE can see dynamic variables.
+           ;; declare not yet implemented
+           (proclaim '(special a))
+    (eql-eval 2 '(let ((a 2)) (symbol-value 'a)))
+    (eql-eval 1 'a)
+    (eql-eval 3 '(let ((a 2)) (setq a 3) (symbol-value 'a)))
+    (eql-eval 1 'a)
+           ;; declare not yet implement
+           (makunbound 'a)
+    (eql-eval 2 '(let ((a 2)) (setf (symbol-value 'a) 3) a))
+    (eql-eval 3 'a)
+    (eql-eval 3 '(symbol-value 'a))
+           ;; declare not yet implement
+           (makunbound 'a)
+    (equal-eval '(5 4)
+       '(multiple-value-list
+           (let ((a 4))
+
+                       ;; declare not yet implemented
+                       (defparameter a 3)
+
+             (let ((b (symbol-value 'a)))
+               (setf (symbol-value 'a) 5)
+               (values a b)))))
+    (eql-eval 3 'a)
+)
+(eq-eval :any-keyword '(symbol-value :any-keyword))
+;; XXX these will fail
+(eq-eval nil '(symbol-value 'nil))
+(eq-eval nil '(symbol-value '()))
+
+;; symbolp                             - function (predicate)
+(eq-test t #'symbolp 'elephant)
+(eq-test nil #'symbolp 12)
+;; XXX these will fail
+(eq-test t #'symbolp nil)
+(eq-test t #'symbolp '())
+(eq-test t #'symbolp :test)
+(eq-test nil #'symbolp "hello")
+
+;; remprop                             - function
+(setq test (make-symbol "PSEUDO-PI"))
+(eq-eval () '(symbol-plist test))
+(eq-eval t '(setf (get test 'constant) t))
+(eql-eval 3.14 '(setf (get test 'approximation) 3.14))
+(eql-eval 'noticeable '(setf (get test 'error-range) 'noticeable))
+(equal-eval '(error-range noticeable approximation 3.14 constant t)
+    '(symbol-plist test))
+(eq-eval nil '(setf (get test 'approximation) nil))
+(equal-eval '(error-range noticeable approximation nil constant t)
+    '(symbol-plist test))
+(eq-eval nil (get test 'approximation))
+(eq-test t #'remprop test 'approximation)
+(eq-eval nil '(get test 'approximation))
+(equal-eval '(error-range noticeable constant t) '(symbol-plist test))
+(eq-test nil #'remprop test 'approximation)
+(equal-eval '(error-range noticeable constant t) '(symbol-plist test))
+(eq-test t #'remprop test 'error-range)
+(eql-eval 3 '(setf (get test 'approximation) 3))
+(equal-eval '(approximation 3 constant t) '(symbol-plist test))
+
+;; throw                               - special operator
+(equal-eval '(3 9)
+    '(multiple-value-list
+       (catch 'result
+           (setq i 0 j 0)
+           (loop (incf j 3) (incf i)
+                 (if (= i 3) (throw 'result (values i j)))))))
+(eql-eval 2 '(catch nil (unwind-protect (throw nil 1) (throw nil 2))))
+
+;; XXX undefined consequences
+(eql-eval 2
+   '(catch 'a
+      (catch 'b
+       (unwind-protect (throw 'a 1)
+         (throw 'b 2)))))
+(eq-eval :outer-catch
+   '(catch 'foo
+       (setq string (format nil "The inner catch returns ~s."
+           (catch 'foo
+               (unwind-protect (throw 'foo :first-throw)
+                   (throw 'foo :second-throw)))))
+         :outer-catch))
+(equal-eval "The inner catch returns :SECOND-THROW." 'string)
+
+;; tree-equal                          - function
+(setq tree1 '(1 (1 2))
+      tree2 '(1 (1 2)))
+(eq-test t #'tree-equal tree1 tree2)
+(eq-test nil #'eql tree1 tree2)
+(setq tree1 '('a ('b 'c))
+      tree2 '('a ('b 'c)))
+(eq-test t #'tree-equal tree1 tree2 :test 'eq)
+(eq-test t #'tree-equal 1 1)
+(eq-test nil #'tree-equal (list 1 2) (cons 1 2))
+(eq-test nil #'tree-equal 1 2)
+
+;; union                               - function
+(equal-test '(b c f a d) #'union '(a b c) '(f a d))
+(equal-test '((y 6) (z 2) (x 4))
+    #'union '((x 5) (y 6)) '((z 2) (x 4)) :key #'car)
+(setq lst1 (list 1 2 '(1 2) "a" "b")
+      lst2 (list 2 3 '(2 3) "B" "C"))
+(equal-test '(1 (1 2) "a" "b" 2 3 (2 3) "B" "C") #'nunion lst1 lst2)
+
+;; unless                              - macro
+(eq-eval 'hello '(when t 'hello))
+(eq-eval nil '(unless t 'hello))
+(eq-eval nil (when nil 'hello))
+(eq-eval 'hello '(unless nil 'hello))
+(eq-eval nil (when t))
+(eql-eval nil '(unless nil))
+(setq test nil)
+(equal-eval '(3 2 1) '(when t (push 1 test) (push 2 test) (push 3 test)))
+(equal-eval '(3 2 1) 'test)
+(setq test nil)
+(eq-eval nil '(unless t (push 1 test) (push 2 test) (push 3 test)))
+(eq-eval nil 'test)
+(eq-eval nil '(when nil (push 1 test) (push 2 test) (push 3 test)))
+(eq-eval nil 'test)
+(equal-eval '(3 2 1) '(unless nil (push 1 test) (push 2 test) (push 3 test)))
+(equal-eval '(3 2 1) 'test)
+(equal-eval '((4) nil (5) nil 6 (6) 7 (7))
+   '(let ((x 3))
+      (list (when (oddp x) (incf x) (list x))
+           (when (oddp x) (incf x) (list x))
+           (unless (oddp x) (incf x) (list x))
+           (unless (oddp x) (incf x) (list x))
+           (if (oddp x) (incf x) (list x))
+           (if (oddp x) (incf x) (list x))
+           (if (not (oddp x)) (incf x) (list x))
+           (if (not (oddp x)) (incf x) (list x)))))
+
+;; unwind-protect                      - special operator
+(defun dummy-function (x)
+   (setq state 'running)
+   (unless (numberp x) (throw 'abort 'not-a-number))
+   (setq state (1+ x)))
+(eql-eval 2 '(catch 'abort (dummy-function 1)))
+(eql-eval 2 'state)
+(eq-eval 'not-a-number '(catch 'abort (dummy-function 'trash)))
+(eq-eval 'running 'state)
+(eq-eval 'not-a-number
+    '(catch 'abort (unwind-protect (dummy-function 'trash)
+                  (setq state 'aborted))))
+(eq-eval 'aborted 'state)
+(eql-eval 2 '(block nil (unwind-protect (return 1) (return 2))))
+;; XXX undefined consequences
+(eql-eval 2
+   '(block a
+       (block b
+           (unwind-protect (return-from a 1)
+                           (return-from b 2)))))
+(eql-eval 2 '(catch nil (unwind-protect (throw nil 1) (throw nil 2))))
+;; XXX undefined consequences
+(eql-eval 2
+   '(catch 'a (catch 'b (unwind-protect (throw 'a 1) (throw 'b 2)))))
+(eq-eval ':outer-catch
+   '(catch 'foo
+       (setq string
+           (format nil "The inner catch returns ~s."
+               (catch 'foo
+                   (unwind-protect (throw 'foo :first-throw)
+                   (throw 'foo :second-throw)))))
+         :outer-catch))
+(equal-eval "The inner catch returns :SECOND-THROW." 'string)
+(eql-eval 10
+   '(catch 'a
+       (catch 'b
+           (unwind-protect (1+ (catch 'a (throw 'b 1)))
+               (throw 'a 10)))))
+;; XXX undefined consequences
+(eql-eval 4
+   '(catch 'foo
+       (catch 'bar
+          (unwind-protect (throw 'foo 3)
+            (throw 'bar 4)
+            (print 'xxx)))))
+(eql-eval 4
+   '(catch 'bar
+       (catch 'foo
+          (unwind-protect (throw 'foo 3)
+            (throw 'bar 4)
+            (print 'xxx)))))
+(eql-eval 5
+   '(block nil
+       (let ((x 5))
+        (unwind-protect (return)
+          (return x)))))
+
+;; upper-case-p                                - function
+(eq-test t #'upper-case-p #\A)
+(eq-test nil #'upper-case-p #\a)
+(eq-test nil #'upper-case-p #\5)
+(error-test #'upper-case-p 1)
+
+;; values                              - accessor
+(eq-eval () '(multiple-value-list (values)))
+(equal-eval '(1) '(multiple-value-list (values 1)))
+(equal-eval '(1 2) '(multiple-value-list (values 1 2)))
+(equal-eval '(1 2 3) '(multiple-value-list (values 1 2 3)))
+(equal-eval '(1 4 5) '(multiple-value-list (values (values 1 2 3) 4 5)))
+
+;; values-list                         - function
+(eq-eval nil '(multiple-value-list (values-list nil)))
+(equal-eval '(1) '(multiple-value-list (values-list '(1))))
+(equal-eval '(1 2) '(multiple-value-list (values-list '(1 2))))
+(equal-eval '(1 2 3) '(multiple-value-list (values-list '(1 2 3))))
diff --git a/xedit/lisp/test/math.lsp b/xedit/lisp/test/math.lsp
new file mode 100644 (file)
index 0000000..dd0f8ce
--- /dev/null
@@ -0,0 +1,982 @@
+;;
+;; Copyright (c) 2002 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/test/math.lsp,v 1.4 2002/11/30 23:13:14 paulo Exp $
+;;
+
+;; basic math tests
+;; This is far from a good regression test, but in the current stage of
+;; the interpreter, this is good enough to make sure it is not "so"
+;; broken. But note that this does not test all cases where there is
+;; change in the type of a numeric object.
+
+(setq *default-float-format* 'double-float)
+
+;; floating point results may differ from implementation to implementation (?!)
+
+(defun test (expect function &rest arguments &aux result (error t))
+    (ignore-errors
+       (setq result (apply function arguments))
+       (setq error nil)
+    )
+    (if error
+       (format t "ERROR: (~A~{ ~A~})~%" function arguments)
+       ;; Use eql to make sure result and expect have the same type
+       (or (eql result expect)
+#-xedit        ;; hack...
+           (or
+               (and
+                   (floatp result)
+                   (floatp expect)
+                   (< (abs (- (abs result) (abs expect)))
+                       0.00000000000001d0)
+               )
+               (format t "(~A~{ ~A~}) => should be ~A not ~A~%"
+                   function arguments expect result
+               )
+           )
+#+xedit     (format t "(~A~{ ~A~}) => should be ~A not ~A~%"
+               function arguments expect result
+           )
+       )
+    )
+)
+
+(defun div-test (quotient remainder function &rest arguments
+                &aux quo rem  (error t))
+    (ignore-errors
+       (multiple-value-setq (quo rem) (apply function arguments))
+       (setq error nil)
+    )
+    (if error
+       (format t "ERROR: (~A~{ ~A~})~%" function arguments)
+       (or (and (eql quotient quo) (eql remainder rem))
+#-xedit        ;; hack
+           (or
+               (or
+                   (eql quotient quo)
+                   (and
+                       (floatp quotient)
+                       (floatp quo)
+                       (< (abs (- (abs quotient) (abs quo)))
+                           0.00000000000001d0)
+                   )
+               )
+               (or
+                   (eql remainder rem)
+                   (and
+                       (floatp remainder)
+                       (floatp rem)
+                       (< (abs (- (abs remainder) (abs rem)))
+                           0.00000000000001d0)
+                   )
+               )
+               (format t "(~A~{ ~A~}) => should be ~A; ~A not ~A; ~A~%"
+                   function arguments quotient remainder quo rem
+               )
+           )
+#+xedit            (format t "(~A~{ ~A~}) => should be ~A; ~A not ~A; ~A~%"
+               function arguments quotient remainder quo rem
+           )
+       )
+    )
+)
+
+(defun bool-test (expect function &rest arguments &aux result (error t))
+    (ignore-errors
+       (setq result (apply function arguments))
+       (setq error nil)
+    )
+    (if error
+       (format t "ERROR: (~A~{ ~A~})~%" function arguments)
+       (or (eq result expect)
+           (format t "(~A~{ ~A~}) => should be ~A not ~A~%"
+               function arguments expect result
+           )
+       )
+    )
+)
+
+(defun error-test (function &rest arguments &aux result (error t))
+  (ignore-errors
+    (setq result (apply function arguments))
+    (setq error nil))
+  (unless error
+    (format t "ERROR: no error for (~A~{ ~A}), result was ~A~%"
+      function arguments result)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; fixnum fixnum
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 0 #'+)
+(test 5 #'+ 5)
+(test -2 #'+ -2)
+(test 3 #'+ 2 1)
+(test 134217728 #'+ 134217727 1)
+(test -134217729 #'+ -134217728 -1)
+(test 2147483648 #'+ 2147483647 1)
+(test -2147483649 #'+ -2147483648 -1)
+(test -5 #'- 5)
+(test 6 #'- -6)
+(test 1 #'- 2 1)
+(test 134217728 #'- 134217727 -1)
+(test -2147483649 #'- -2147483648 1)
+(test 4294967295 #'- 2147483647 -2147483648)
+(test 1 #'*)
+(test 4 #'* 4)
+(test -5 #'* -5)
+(test 6 #'* 2 3)
+(test 2147483648 #'* 65536 32768)
+(test 2147418112 #'* 65536 32767)
+(test 134217728 #'* 65536 2048)
+(test -134217728 #'* 65536 -2048)
+(test 1/3 #'/ 3)
+(test -1/4 #'/ -4)
+(test 1/3 #'/ 10 30)
+(test -1/2 #'/ -5 10)
+(test -4 #'/ 20 -5)
+(test 431432412345/32 #'/ 431432412345 32)
+(test -2147483647/2147483648 #'/ 2147483647 -2147483648)
+(test -1 #'/ 2147483648 -2147483648)
+(test 2147483648 #'/ -2147483648 -1)
+(test -1/2147483648 #'/ 1 -2147483648)
+(test 1 #'min 2 3 4 1 5)
+(test 7 #'max 0 -2 7 6 3)
+(test -2147483648 #'min -2147483648 2147483647)
+(test 2147483647 #'max -2147483648 2147483647)
+(bool-test t #'< 1 2)
+(bool-test nil #'< 2 2)
+(bool-test nil #'< 4 3)
+(bool-test t #'< -2147483648 -1)
+(bool-test t #'< -2147483648 2147483648)
+(bool-test t #'<= 3 3)
+(bool-test nil #'<= 3 2)
+(bool-test t #'<= 3 7)
+(bool-test t #'<= -2147483648 2147483648)
+(bool-test t #'= 1 1)
+(bool-test nil #'= 1 -1)
+(bool-test t #'= -2147483648 -2147483648)
+(bool-test t #'>= 4 3)
+(bool-test t #'>= 5 5)
+(bool-test nil #'>= 4 9)
+(bool-test t #'>= 2147483647 -2147483648)
+(bool-test t #'> 7 5)
+(bool-test nil #'> 20 20)
+(bool-test nil #'> 19 31)
+(bool-test nil #'> 2147483647 2147483648)
+(bool-test nil #'> -2147483648 2147483647)
+(bool-test nil #'/= 2147483647 2147483647)
+(bool-test t #'/= 2147483647 -2147483648)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; fixnum bignum
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 4123412341238575768576858308380 #'+
+       431412 4123412341238575768576857876968)
+(test -653653534554686349560628211 #'-
+       4231423 653653534554686349564859634)
+(test 17952112630025927929 #'* 4342423 4134123421423)
+(test 412341/766687896595678 #'/ 412341 766687896595678)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; fixnum flonum
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 566594.4123d0 #'+ 43141 523453.4123d0)
+(test -2.106249523586876d9 #'+ -2147483647 41234123.413124d0)
+(test -6530250.653d0 #'- 4314 6534564.653d0)
+(test -358687.653d0 #'- -324123 34564.653d0)
+(test 3.26338916904d67 #'* 431234 756756d56)
+(test 5.731169192902366d-50 #'/ 3 5234534d43)
+(bool-test t #'< 423421 646454d0)
+(bool-test t #'= 43242113 43242113d0)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; fixnum fixratio
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 38654705646/17 #'+ 2147483647 2147483647/17)
+(test -2146748499/17 #'+ 43244 -2147483647/17)
+(test 17633127/4232 #'- 4321 653345/4232)
+(test 28227714415090/4323 #'* 4312442 6545645/4323)
+(test 639030/1441 #'* 42 15215/1441)
+(test 924444112/547 #'/ 3432342 1641/808)
+(bool-test t #'> 41342 42423/32)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; fixnum bigratio
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 134681902103055335/31231131234 #'+ 4312423 53453535353/31231131234)
+(test 134681795195984629/31231131234 #'- 4312423 53453535353/31231131234)
+(test 230514255287590319/31231131234 #'* 4312423 53453535353/31231131234)
+(test 134681848649519982/53453535353 #'/ 4312423 53453535353/31231131234)
+(bool-test t #'> 4312423 53453535353/31231131234)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; bignum fixnum
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 4123412341234124068 #'+ 4123412341234123412 656)
+(test 2147483647 #'+ 2147483648 -1)
+(test 2147483648 #'- 2147483647 -1)
+(test 3245393337480 #'* 4242344232 765)
+(test 1414114744/255 #'/ 4242344232 765)
+(bool-test nil #'< 2147483648 1)
+(bool-test t #'> 2147483648 -2147483648)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; bignum flonum
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 5.452523543454353d15 #'+ 5452523543454353 423d-6)
+(test -3.41423d205 #'- 54235423452345424443423 341423d200)
+(test 2.7061221650759596d89 #'* 413423412341231232 6.545643242d71)
+(test 9.744908405310087d-29 #'/ 41341234214 4242342d32)
+(bool-test t #'< 4314123412312341234123 4234242d46)
+(bool-test nil #'> 42342342142142421412341242 423423.432423d51)
+(bool-test t #'= 100000000000000000000 1d20)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; bignum fixratio
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 3027180466416641662/7 #'+ 432454352345234523 1/7)
+(test 4294967295/2 #'- 2147483648 1/2)
+(test 14113747078041141/152263 #'* 42341241234123423 1/456789)
+(test 475355357536664/19 #'* 43214123412424 11/19)
+(test 143960192608 #'/ 4234123312 1/34)
+(test 15032385536/5 #'/ 2147483648 5/7)
+(bool-test nil #'< 4123412341234123 423424/23)
+(bool-test nil #'= 2147483648 1/3)
+(bool-test t #'> 2147483648 1/3)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; bignum bigratio
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test -493153721444554600746963362777609/11404707804137
+       #'+ -43241241241241234234 18178448448449/11404707804137)
+(test 22573725350444837506376255369215081106984960/431241324242143434377
+       #'- 52345923457394857234895 455/431241324242143434377)
+(test 355905909219316970540364021939287762325439304380984344811607132990/14374707710807
+       #'* 45523452345234790345923405723902389345782390 23454234524234523623623/43124123132421)
+(test -853356237922877963618542794532291751029677352/21566206170617061706171
+       #'/ 4131234123412342 -43132412341234123412342/413124123412312234123412312312)
+(bool-test nil #'< 9482384762389461234892 463124869123897/43124123456678)
+(bool-test t #'/= 4689123469123846123843 4123894623894612/211)
+(bool-test t #'> 90437849234701234891203 4234123423/37)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; flonum fixnum
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 4.3291328479d86 #'+ 43291328479d76 431243)
+(test 4.123123123432d58 #'- 4123123123432d46 2147483647)
+(test 4.1974800714094d109 #'* 970874791d96 43234)
+(test -1.0004838618250252d55 #'/ -432423.432d56 4322143)
+(bool-test nil #'< 4324932.342d5 4321421)
+(bool-test t #'> 2147483648d0 2147483647)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; flonum bignum
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 4.3124325345d62 #'+ 4312432.5345d56 431241234901234791023479023)
+(test 4.123123443242d39 #'- 41231234.43242d32 -10947390284720389)
+(test 9.81681448753991d48 #'* 42342.89d27 231840917980324712)
+(test 6.837110051466236d49 #'/ -64832d57 -948236894126)
+(bool-test nil #'< 7589079203d56 43214124124312)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; flonum flonum
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 4.12685643412d7 #'+ 34442.3412d0 41234122d0)
+(test -4.23432d84 #'- -45523453d56 423432d79)
+(test 2.0000000000000004d0 #'* 1.4142135623730951d0 1.4142135623730951d0)
+(test -1.414213562373095d0 #'/ -2d0 1.4142135623730951d0)
+(test 0.7071067811865476d0 #'/ 1.4142135623730951d0 2d0)
+(bool-test nil #'< 43124123d56 4231412d43)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; flonum fixratio
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 3.41412d61 #'+ 341412d56 3/652)
+(test 4.312443d72 #'- 43124.43d68 42421/5678)
+(test -4.32112300201218d73 #'* 4321123d67 -2147483648/2147483647)
+(test 3.388443859138533d58 #'/ 432412d54 13744/1077)
+(bool-test t #'> 423194237d43 4231412/23)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; flonum bigratio
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 4.378904431d62 #'+ 4378904.431d56 49230471923047129/32412341234126)
+(test 0d0 #'- 1.7320508075688772d0 3900231685776981/2251799813685248)
+(test 5.000000000000001d0 #'* 2.23606797749979d0 629397181890197/281474976710656)
+(test 7.000000000000001d0 #'/ 2.6457513110645907d0 1125899906842624/2978851154656373)
+(bool-test nil #'< 790412390412d45 1005712007432/10518078881)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; fixratio fixnum
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 23502480199/57 #'+ 1/57 412324214)
+(test -1608505/39 #'- 11/39 41244) 
+(test 241844976595/3121 #'* 45245/3121 5345231)
+(test 4231/30211050 #'/ 4231/67890 445)
+(bool-test nil #'< 43123/12 -3432)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; fixratio bignum
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 290071443963580821646/4115 #'+ -14119/4115 70491237901234711)
+(test 92654360215843653827434431256/1237 #'- 423412/1237 -74902473901247901234789012)
+(test 139081825032265225396/111 #'* 13/777 74890213478912044444)
+(test -22/19000187487170108051697772680759 #'/ -176/31 4903274190237447239147812304712)
+(bool-test t #'< 7094123/312 423412429047)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; fixratio flonum
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 3756.777956289953d0 #'+ 41290/11 3.141592653589793d0)
+(test 3750.494770982774d0 #'- 41290/11 3.141592653589793d0)
+(test 11792.396424247505d0 #'* 41290/11 3.141592653589793d0)
+(test 1194.8195636844289d0 #'/ 41290/11 3.141592653589793d0)
+(bool-test nil #'< 41290/11 3.141592653589793d0)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; fixratio fixratio
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test -2/2147483647 #'+ 2147483646/2147483647 -2147483648/2147483647)
+(test 4611686015206162432/2305843005992468481 #'+ 2147483648/2147483646 2147483648/2147483647)
+(test 114/91 #'+ 5/7 7/13)
+(test 2 #'- 2147483646/2147483647 -2147483648/2147483647)
+(test -6442450939/4611686009837453315 #'- 2147483646/2147483647 2147483647/2147483645)
+(test 214/231 #'- 5/7 -7/33)
+(test 183092240452/408559 #'* '432421/3217 423412/127)
+(test 1057751/7345 #'* 34121/65 31/113)
+(test -93866791/102381559 #'/ 143747/107 -956837/653)
+(test 117/517 #'/ 13/33 47/27)
+(bool-test nil #'< 5/3 7/9)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; fixratio bigratio
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 1211321073398067249731082729214954013/1099249926163926018396018404101914
+       #'+ 23141/21 572903572390457239/52345234579234572304572304957234)
+(test -1210401943424090457832980748892408320175/1099249926163926018396018404101914
+       #'+ -23123441/21 572903572390457239/52345234579234572304572304957234)
+(test -130565585970579643613431728982140/1297324236427391
+       #'- 6/83 1573079349043128237436315709694/15630412487077)
+(test 119377824848653/98027 #'* 4123/61 28954117111/1607)
+(test -533081148/1126543487854337661125 #'/ 4132412/125 -9012347902834701289/129)
+(bool-test nil #'< 4132412/125 -9012347902834701289/129)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; bigratio fixnum
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 48668779872364438/8438103123 #'+ 49032749012471920/8438103123 -43134)
+(test 49396718152579402/8438103123 #'- 49032749012471920/8438103123 -43134)
+(test -704992865301321265760/2812701041 #'* 49032749012471920/8438103123 -43134)
+(test -24516374506235960/181984570053741 #'/ 49032749012471920/8438103123 -43134)
+(bool-test t #'> 49032749012471920/8438103123 -43134)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; bigratio bignum
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 22765322736543569109219273030163417097453878379283263605274270/46382946123894712341
+       #'+ 4692318468912374612389461278/46382946123894712341 490812348912346238794612389461238961238912)
+(test -22765322736543569109219273030163417097453878379283263605274270/46382946123894712341
+       #'- -4692318468912374612389461278/46382946123894712341 490812348912346238794612389461238961238912)
+(test -2303047849571666696101160700266058250647016644840659232609643130849536/46382946123894712341
+       #'* 4692318468912374612389461278/46382946123894712341 -490812348912346238794612389461238961238912)
+(test 2346159234456187306194730639/11382661368271784554609636515081706202567704733454325607906496
+       #'/ -4692318468912374612389461278/46382946123894712341 -490812348912346238794612389461238961238912)
+(bool-test t #'< 4692318468912374612389461278/46382946123894712341 490812348912346238794612389461238961238912)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; bigratio flonum
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 63.2771680782255d0 #'+ 31.63858403911275d0 4452734852783697/140737488355328)
+(test 0d0 #'+ -31.63858403911275d0 4452734852783697/140737488355328)
+(test -1001.0000000000001d0 #'* -31.63858403911275d0 4452734852783697/140737488355328)
+(test 1d0 #'/ -31.63858403911275d0 -4452734852783697/140737488355328)
+(bool-test nil #'< -31.63858403911275d0 -4452734852783697/140737488355328)
+(bool-test nil #'> -31.63858403911275d0 -4452734852783697/140737488355328)
+(bool-test nil #'/= -31.63858403911275d0 -4452734852783697/140737488355328)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; bigratio fixratio
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 0 #'+ 2147483648/2147483647 -2147483648/2147483647)
+(test 3230093924913437/413416372043776 #'+ 45705840067699/8796093022208 123/47)
+(test 4294967296/2147483647 #'- 2147483648/2147483647 -2147483648/2147483647)
+(test 1066255041450269/413416372043776 #'- 45705840067699/8796093022208 123/47)
+(test -5621818328326977/413416372043776 #'* -45705840067699/8796093022208 123/47)
+(test -2148174483181853/1081919441731584 #'/ 45705840067699/8796093022208 -123/47)
+(bool-test t #'> 45705840067699/8796093022208 123/47)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; bigratio bigratio
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 2679495973598190955776211861634126560767052764822779809414184089582/140710542183009389719255843429922029722593
+       #'+ 649812364891236481923461238946128/34124123 -7489023423142/4123491823746192384761238946123891)
+(test 2679495973598190955776211861634126560767052765333892522296541398514/140710542183009389719255843429922029722593
+       #'- 649812364891236481923461238946128/34124123 -7489023423142/4123491823746192384761238946123891)
+(test -4866460021317766216371472892133283923086494176/140710542183009389719255843429922029722593
+       #'* 649812364891236481923461238946128/34124123 -7489023423142/4123491823746192384761238946123891)
+(test -1339747986799095477888105930817063280383526382539168082927681372024/127778178220589327233
+       #'/ 649812364891236481923461238946128/34124123 -7489023423142/4123491823746192384761238946123891)
+(bool-test t #'> 649812364891236481923461238946128/34124123 -7489023423142/4123491823746192384761238946123891)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; complex real
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test #c(2147483648 -1) #'+ #c(1 -1) 2147483647)
+(test #c(2.147483648d9 -1) #'+ #c(2147483647 -1) 1d0)
+(test #c(129642370237029633787/3 0.25d0) #'- #c(-11/3 0.25d0) -43214123412343211266)
+(test #c(23470/21 4.333333333333334d0) #'* #c(2347/7 1.3d0) 10/3)
+(test #c(134217728/11 67108864/11) #'* #c(65536 32768) 2048/11)
+(test #c(1.3133333333333332d0 82304) #'/ #c(1.97d0 123456) 3/2)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; real complex
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test #c(80/7 7/13) #'+ 3/7 #c(11 7/13))
+(test #c(1.2345d47 -1) #'+ 12345d43 #c(-2147483648 -1))
+(test #c(-2147483649 2147483647) #'+ -2147483648 #c(-1 2147483647))
+(test #c(41/15 1.23456d68) #'- #c(7/5 1234.56d65) -4/3)
+(test #c(-41/19 2147483648) #'* #c(41/19 -2147483648) -1)
+(test #c(-88046829568/40802189293 2.147483649d41) #'* #c(41/19 -2147483648d32) -2147483648/2147483647)
+(test #c(-5.0691244239631335d0 1.3911008563333336d16)
+       #'/ #c(-11/7 4312412654633334) 0.31d0)
+(bool-test t #'= #c(1 0.0) 1)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; complex complex
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test #c(-16.0d0 -4.0d0) #'+ #c(-16.0d0 -4.0d0))
+(test #c(0d0 1d0) #'- #c(0d0 -1d0))
+(test #c(1d0 3d0) #'- #c(-1d0 -3d0))
+(test #c(-16.0d0 -4.0d0) #'* #c(-16.0d0 -4.0d0))
+(test #c(-0.058823529411764705d0 0.014705882352941176d0) #'/ #c(-16d0 -4d0))
+(test #c(1.94d0 301868863889/7) #'+ #c(3/5 5/7) #c(1.34d0 43124123412))
+(test #c(8641975242/7 -3.4596d0) #'- #c(1234567890 0.0004d0) #c(-12/7 3.46d0))
+(test #c(2944.315858312371d0 5.59002d13) #'* #c(-11/7 -1234d9) #c(-45.3d0 5/2147483647))
+(test #c(1.9635384272224412d-8 -0.33333333317811176d0)
+       #'/ #c(2147483647/3 -0.5d0) #c(128 2147483648.0d0))
+(test #c(8.154945137073864d11 2.621232365490813d12)
+       #'/ #c(-1.3d0 4312412654633) #c(3/2 7/15))
+(test #c(0.003674737027278924d0 -257.6948748113586d0)
+       #'/ #c(1.5d0 -432412) #c(1678 -567/31313))
+(bool-test t #'= #c(1 2d0) #c(1 2))
+(bool-test nil #'/= #c(1 2) #c(1d0 2d0))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; abs
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 2147483648 #'abs -2147483648)
+(test 2147483647 #'abs -2147483647)
+(test 2147483647 #'abs 2147483647)
+(test 1 #'abs 1)
+(test 5/7 #'abs -5/7)
+(test 2147483648/2147483647 #'abs -2147483648/2147483647)
+(test 3.12d0 #'abs -3.12d0)
+(test 4312412341234124124123412 #'abs 4312412341234124124123412)
+(test 4312412341234124124123412 #'abs -4312412341234124124123412)
+(test 1.0 #'abs #c(1 0.0))
+(test 11.40175425099138d0 #'abs #c(-11 3d0))
+(test 4.47213595499958d0 #'abs #c(-4 -2))
+(test 1.0 #'abs #c(0.0 -1.0))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; sqrt
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 3.4641016151377544d0 #'sqrt 12)
+(test #c(0 12) #'sqrt -144)
+(test 6.429728792199102d18 #'sqrt 41341412341234123412490123470912347210)
+(test 41341412341234123412490123470912347210
+       #'sqrt 1709112374367945085349927261774254951456404621200206927501652414831594784100)
+(test 46340.95001184158d0 #'sqrt 2147483648)
+(test 0.7071067811865476d0 #'sqrt 0.5d0)
+(test 0 #'sqrt 0)
+(test 0d0 #'sqrt 0d0)
+(test 111.1106106544285d0 #'sqrt 12345.5678d0)
+(test #c(0 11.119982014373944d0) #'sqrt -123.654d0)
+(test 3/8 #'sqrt 9/64)
+(test #c(0 1.1832159566199232d0) #'sqrt -7/5)
+(test 514.7536007118473d0 #'sqrt 821974900428408092/3102128401119)
+(test 413412341293461238946192384612893/314212341412341246128361289
+       #'sqrt 170909763933741276657131032282211169869649489782500833989461829449/98729395495825697643724477479624921705328808513741521)
+;; check for overflow
+(error-test #'sqrt 402387260077093773543702433923003985719374864210714632543799910429938512398629020592044208486969404800479988610197196058631666872994808558901323829669944590997424504087073759918823627727188732519779505950995276120874975462497043601418278094646496291056393887437886487337119181045825783647849977012476632889835955735432513185323958463075557409114262417474349347553428646576611667797396668820291207379143853719588249808126867838374559731746136085379534524221586593201928090878297308431392844403281231558611036976801357304216168747609675871348312025478589320767169132448426236131412508780208000261683151027341827977704784635868170164365024153691398281264810213092761244896359928705114964975419909342221566832572080821333186116811553615836546984046708975602900950537616475847728421889679646244945160765353408198901385442487984959953319101723355556602139450399736280750137837615307127761926849034352625200015888535147331611702103968175921510907788019393178114194545257223865541461062892187960223838971476088506276862967146674697562911234082439208160153780889893964518263243671616762179168909779911903754031274622289988005195444414282012187361745992642956581746628302955570299024324153181617210465832036786906117260158783520751516284225540265170483304226143974286933061690897968482590125458327168226458066526769958652682272807075781391858178889652208164348344825993266043367660176999612831860788386150279465955131156552036093988180612138558600301435694527224206344631797460594682573103790084024432438465657245014402821885252470935190620929023136493273497565513958720559654228749774011413346962715422845862377387538230483865688976461927383814900140767310446640259899490222221765904339901886018566526485061799702356193897017860040811889729918311021171229845901641921068884387121855646124960798722908519296819372388642614839657382291123125024186649353143970137428531926649875337218940694281434118520158014123344828015051399694290153483077644569099073152433278288269864602789864321139083506217095002597389863554277196742822248757586765752344220207573630569498825087968928162753848863396909959826280956121450994871701244516461260379029309120889086942028510640182154399457156805941872748998094254742173582401063677404595741785160829230135358081840096996372524230560855903700624271243416909004153690105933983835777939410970027753472000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; mod
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 5 #'mod 5 9)
+(test 4 #'mod -5 9)
+(test -4 #'mod 5 -9)
+(test -5 #'mod -5 -9)
+(test 2147483646 #'mod -2147483648 2147483647)
+(test -1 #'mod -2147483648 -2147483647)
+(test 1 #'mod 2147483648 2147483647)
+(test 0 #'mod -170909763933741276657131032282211169869649489782500833989461829449 413412341293461238946192384612893)
+(test -1709112374367945085349927261774254951415063208858972804089162291360682436890
+       #'mod 41341412341234123412490123470912347210 -1709112374367945085349927261774254951456404621200206927501652414831594784100)
+(test 9.666666666666666d0 #'mod -1/3 10d0)
+(test -9.666666666666666d0 #'mod 1/3 -10d0)
+(test -0.3333333333333333d0 #'mod -1/3 -10d0)
+(test 0.3333333333333333d0 #'mod 1/3 10d0)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; rem
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 2 #'rem 11 3)
+(test 2 #'rem 11 -3)
+(test -2 #'rem -11 3)
+(test -2 #'rem -11 -3)
+(test -1 #'rem -2147483648 2147483647)
+(test  0.1499999999999999d0 #'rem 1.35d0 1/5)
+(test  -0.1499999999999999d0 #'rem -1.35d0 1/5)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; gcd
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 11 #'gcd 33 11)
+(test 7 #'gcd 91 -49)
+(test 4 #'gcd -4)
+(test 0 #'gcd)
+(test 11 #'gcd 3333 -33 1002001)
+(test 1 #'gcd -2147483648 2147483647)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; lcm
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 1 #'lcm)
+(test 10 #'lcm 10)
+(test 5 #'lcm -5)
+(test 4611686016279904256 #'lcm -2147483648 2147483647)
+(test 0 #'lcm 0 5)
+(test 60 #'lcm 1 2 3 4 5 6)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; and
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test -1 #'logand)
+(test 0 #'logand 1 2)
+(test -2147483648 #'logand -2147483648 -1)
+(test 2147483647 #'logand 2147483647 -1)
+(test 2147479552 #'logand 8796093018112 2147483647)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; eqv
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test -1 #'logeqv)
+(test -4 #'logeqv 1 2)
+(test -2147483648 #'logeqv -2147483648 -1)
+(test 2147483647 #'logeqv 2147483647 -1)
+(test -8793945542656 #'logeqv 8796093018112 2147483647)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; or
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 0 #'logior)
+(test 3 #'logior 1 2)
+(test -1 #'logior -2147483648 -1)
+(test -1 #'logior 2147483647 -1)
+(test 8796093022207 #'logior 8796093018112 2147483647)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; xor
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test 0 #'logxor)
+(test 3 #'logxor 1 2)
+(test 2147483647 #'logxor -2147483648 -1)
+(test -2147483648 #'logxor 2147483647 -1)
+(test 8793945542655 #'logxor 8796093018112 2147483647)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; not
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test -1 #'lognot 0)
+(test 0 #'lognot -1)
+(test -2 #'lognot 1)
+(test 1 #'lognot -2)
+(test -3 #'lognot 2)
+(test 2 #'lognot -3)
+(test -2147483648 #'lognot 2147483647)
+(test 2147483647 #'lognot -2147483648)
+(test -8793945542656 #'lognot 8793945542655)
+(test -8796093018113 #'lognot 8796093018112)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; floor
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(div-test 1 1/2 #'floor 3/2)
+(div-test 1d0 1 #'ffloor 3 2)
+(div-test -2 2147483646 #'floor -2147483648 2147483647)
+(div-test 2147483648 0 #'floor -2147483648 -1)
+(div-test 17179869184 0 #'floor 18446744073709551616 1073741824)
+(div-test -17179869201 -1073741807 #'floor 18446744073709551616 -1073741823)
+(div-test 2147483648 0d0 #'floor -2147483648 -1d0)
+(div-test -2 2147483646/2147483647 #'floor -2147483648/2147483647)
+(div-test 32768 32768/2147483647 #'floor 2147483648/2147483647 65535/2147483647)
+(div-test -32769 -32767/2147483647 #'floor 2147483648/2147483647 -65535/2147483647)
+(div-test -32769 32767/2147483647 #'floor -2147483648/2147483647 65535/2147483647)
+(div-test 32768 -32768/2147483647 #'floor -2147483648/2147483647 -65535/2147483647)
+(div-test 2 0.5d0 #'floor 3d0 1.25d0)
+(div-test 2 1d0 #'floor 4d0 1.5d0)
+(div-test -3 -0.5d0 #'floor 4d0 -1.5d0)
+(div-test -3 0.5d0 #'floor -4d0 1.5d0)
+(div-test 2 -1d0 #'floor -4d0 -1.5d0)
+(div-test 1 2/91 #'floor 5/7 9/13)
+(div-test -2 -61/91 #'floor 5/7 -9/13)
+(div-test -2 61/91 #'floor -5/7 9/13)
+(div-test 1 -2/91 #'floor -5/7 -9/13)
+(div-test 1 0 #'floor 2147483648/2147483647 2147483648/2147483647)
+(div-test -1 0 #'floor 2147483648/2147483647 -2147483648/2147483647)
+(div-test -1 0 #'floor -2147483648/2147483647 2147483648/2147483647)
+(div-test 1 0 #'floor -2147483648/2147483647 -2147483648/2147483647)
+(div-test 9437 1416337955817765/144137437447079
+       #'floor 16324116304212832041/144137437447079 12)
+(div-test -9438 -313311293547183/144137437447079
+       #'floor 16324116304212832041/144137437447079 -12)
+(div-test -9438 313311293547183/144137437447079
+       #'floor -16324116304212832041/144137437447079 12)
+(div-test 9437 -1416337955817765/144137437447079
+       #'floor -16324116304212832041/144137437447079 -12)
+(div-test 8081 1138147903718848755797/4324123123412370
+       #'floor 2147483648 1148972348912638496123/4324123123412370)
+(div-test -8082 -1804074198964956721/720687187235395
+       #'floor 2147483648 -1148972348912638496123/4324123123412370)
+(div-test -8082 1804074198964956721/720687187235395
+       #'floor -2147483648 1148972348912638496123/4324123123412370)
+(div-test 8081 -1138147903718848755797/4324123123412370
+       #'floor -2147483648 -1148972348912638496123/4324123123412370)
+(div-test 0 1148972348912638496123/4324123123412370111
+       #'floor 1148972348912638496123/4324123123412370111 2147483648)
+(div-test -1 -9285982550494401861657948805/4324123123412370111
+       #'floor 1148972348912638496123/4324123123412370111 -2147483648)
+(div-test -1 9285982550494401861657948805/4324123123412370111
+       #'floor -1148972348912638496123/4324123123412370111 2147483648)
+(div-test 0 -1148972348912638496123/4324123123412370111
+       #'floor -1148972348912638496123/4324123123412370111 -2147483648)
+(div-test 0.0d0 1.0000000004656613d0 #'ffloor 2147483648/2147483647 2147483648d0)
+(div-test -1.0d0 -2.147483647d9 #'ffloor 2147483648/2147483647 -2147483648d0)
+(div-test -1.0d0 2.147483647d9 #'ffloor -2147483648/2147483647 2147483648d0)
+(div-test 0.0d0 -1.0000000004656613d0 #'ffloor -2147483648/2147483647 -2147483648d0)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ceiling
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(div-test 2 -1/2 #'ceiling 3/2)
+(div-test 2d0 -1 #'fceiling 3 2)
+(div-test -1 -1 #'ceiling -2147483648 2147483647)
+(div-test 2147483648 0 #'ceiling -2147483648 -1)
+(div-test 17179869184 0 #'ceiling 18446744073709551616 1073741824)
+(div-test -17179869200 16 #'ceiling 18446744073709551616 -1073741823)
+(div-test 2147483648 0d0 #'ceiling -2147483648 -1d0)
+(div-test -1 -1/2147483647 #'ceiling -2147483648/2147483647)
+(div-test 32769 -32767/2147483647 #'ceiling 2147483648/2147483647 65535/2147483647)
+(div-test -32768 32768/2147483647 #'ceiling 2147483648/2147483647 -65535/2147483647)
+(div-test -32768 -32768/2147483647 #'ceiling -2147483648/2147483647 65535/2147483647)
+(div-test 32769 32767/2147483647 #'ceiling -2147483648/2147483647 -65535/2147483647)
+(div-test 3 -0.75d0 #'ceiling 3d0 1.25d0)
+(div-test 3 -0.5d0 #'ceiling 4d0 1.5d0)
+(div-test -2 1d0 #'ceiling 4d0 -1.5d0)
+(div-test -2 -1d0 #'ceiling -4d0 1.5d0)
+(div-test 3 0.5d0 #'ceiling -4d0 -1.5d0)
+(div-test 2 -61/91 #'ceiling 5/7 9/13)
+(div-test -1 2/91 #'ceiling 5/7 -9/13)
+(div-test -1 -2/91 #'ceiling -5/7 9/13)
+(div-test 2 61/91 #'ceiling -5/7 -9/13)
+(div-test 1 0 #'ceiling 2147483648/2147483647 2147483648/2147483647)
+(div-test -1 0 #'ceiling 2147483648/2147483647 -2147483648/2147483647)
+(div-test -1 0 #'ceiling -2147483648/2147483647 2147483648/2147483647)
+(div-test 1 0 #'ceiling -2147483648/2147483647 -2147483648/2147483647)
+(div-test 9438 -313311293547183/144137437447079
+       #'ceiling 16324116304212832041/144137437447079 12)
+(div-test -9437 1416337955817765/144137437447079
+       #'ceiling 16324116304212832041/144137437447079 -12)
+(div-test -9437 -1416337955817765/144137437447079
+       #'ceiling -16324116304212832041/144137437447079 12)
+(div-test 9438 313311293547183/144137437447079
+       #'ceiling -16324116304212832041/144137437447079 -12)
+(div-test 8082 -1804074198964956721/720687187235395
+       #'ceiling 2147483648 1148972348912638496123/4324123123412370)
+(div-test -8081 1138147903718848755797/4324123123412370
+       #'ceiling 2147483648 -1148972348912638496123/4324123123412370)
+(div-test -8081 -1138147903718848755797/4324123123412370
+       #'ceiling -2147483648 1148972348912638496123/4324123123412370)
+(div-test 8082 1804074198964956721/720687187235395
+       #'ceiling -2147483648 -1148972348912638496123/4324123123412370)
+(div-test 1 -9285982550494401861657948805/4324123123412370111
+       #'ceiling 1148972348912638496123/4324123123412370111 2147483648)
+(div-test 0 1148972348912638496123/4324123123412370111
+       #'ceiling 1148972348912638496123/4324123123412370111 -2147483648)
+(div-test 0 -1148972348912638496123/4324123123412370111
+       #'ceiling -1148972348912638496123/4324123123412370111 2147483648)
+(div-test 1 9285982550494401861657948805/4324123123412370111
+       #'ceiling -1148972348912638496123/4324123123412370111 -2147483648)
+(div-test 1.0d0 -2.147483647d9 #'fceiling 2147483648/2147483647 2147483648d0)
+(div-test 0d0 1.0000000004656613d0 #'fceiling 2147483648/2147483647 -2147483648d0)
+(div-test 0d0 -1.0000000004656613d0 #'fceiling -2147483648/2147483647 2147483648d0)
+(div-test 1d0 2.147483647d9 #'fceiling -2147483648/2147483647 -2147483648d0)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; truncate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(div-test 1 1/2 #'truncate 3/2)
+(div-test 1d0 1 #'ftruncate 3 2)
+(div-test -1 -1 #'truncate -2147483648 2147483647)
+(div-test 2147483648 0 #'truncate -2147483648 -1)
+(div-test 17179869184 0 #'truncate 18446744073709551616 1073741824)
+(div-test -17179869200 16 #'truncate 18446744073709551616 -1073741823)
+(div-test 2147483648 0d0 #'truncate -2147483648 -1d0)
+(div-test -1 -1/2147483647 #'truncate -2147483648/2147483647)
+(div-test 32768 32768/2147483647 #'truncate 2147483648/2147483647 65535/2147483647)
+(div-test -32768 32768/2147483647 #'truncate 2147483648/2147483647 -65535/2147483647)
+(div-test -32768 -32768/2147483647 #'truncate -2147483648/2147483647 65535/2147483647)
+(div-test 32768 -32768/2147483647 #'truncate -2147483648/2147483647 -65535/2147483647)
+(div-test 2 0.5d0 #'truncate 3d0 1.25d0)
+(div-test 2 1d0 #'truncate 4d0 1.5d0)
+(div-test -2 1d0 #'truncate 4d0 -1.5d0)
+(div-test -2 -1d0 #'truncate -4d0 1.5d0)
+(div-test 2 -1d0 #'truncate -4d0 -1.5d0)
+(div-test 1 2/91 #'truncate 5/7 9/13)
+(div-test -1 2/91 #'truncate 5/7 -9/13)
+(div-test -1 -2/91 #'truncate -5/7 9/13)
+(div-test 1 -2/91 #'truncate -5/7 -9/13)
+(div-test 1 0 #'truncate 2147483648/2147483647 2147483648/2147483647)
+(div-test -1 0 #'truncate 2147483648/2147483647 -2147483648/2147483647)
+(div-test -1 0 #'truncate -2147483648/2147483647 2147483648/2147483647)
+(div-test 1 0 #'truncate -2147483648/2147483647 -2147483648/2147483647)
+(div-test 9437 1416337955817765/144137437447079
+       #'truncate 16324116304212832041/144137437447079 12)
+(div-test -9437 1416337955817765/144137437447079
+       #'truncate 16324116304212832041/144137437447079 -12)
+(div-test -9437 -1416337955817765/144137437447079
+       #'truncate -16324116304212832041/144137437447079 12)
+(div-test 9437 -1416337955817765/144137437447079
+       #'truncate -16324116304212832041/144137437447079 -12)
+(div-test 8081 1138147903718848755797/4324123123412370
+       #'truncate 2147483648 1148972348912638496123/4324123123412370)
+(div-test -8081 1138147903718848755797/4324123123412370
+       #'truncate 2147483648 -1148972348912638496123/4324123123412370)
+(div-test -8081 -1138147903718848755797/4324123123412370
+       #'truncate -2147483648 1148972348912638496123/4324123123412370)
+(div-test 8081 -1138147903718848755797/4324123123412370
+       #'truncate -2147483648 -1148972348912638496123/4324123123412370)
+(div-test 0 1148972348912638496123/4324123123412370111
+       #'truncate 1148972348912638496123/4324123123412370111 2147483648)
+(div-test 0 1148972348912638496123/4324123123412370111
+       #'truncate 1148972348912638496123/4324123123412370111 -2147483648)
+(div-test 0 -1148972348912638496123/4324123123412370111
+       #'truncate -1148972348912638496123/4324123123412370111 2147483648)
+(div-test 0 -1148972348912638496123/4324123123412370111
+       #'truncate -1148972348912638496123/4324123123412370111 -2147483648)
+(div-test 0d0 1.0000000004656613d0 #'ftruncate 2147483648/2147483647 2147483648d0)
+(div-test 0d0 1.0000000004656613d0 #'ftruncate 2147483648/2147483647 -2147483648d0)
+(div-test 0d0 -1.0000000004656613d0 #'ftruncate -2147483648/2147483647 2147483648d0)
+(div-test 0d0 -1.0000000004656613d0 #'ftruncate -2147483648/2147483647 -2147483648d0)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; round
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(div-test 2 -1/2 #'round 3/2)
+(div-test 2d0 -1 #'fround 3 2)
+(div-test -1 -1 #'round -2147483648 2147483647)
+(div-test 2147483648 0 #'round -2147483648 -1)
+(div-test 17179869184 0 #'round 18446744073709551616 1073741824)
+(div-test -17179869200 16 #'round 18446744073709551616 -1073741823)
+(div-test 2147483648 0d0 #'round -2147483648 -1d0)
+(div-test -1 -1/2147483647 #'round -2147483648/2147483647)
+(div-test 32769 -32767/2147483647 #'round 2147483648/2147483647 65535/2147483647)
+(div-test -32769 -32767/2147483647 #'round 2147483648/2147483647 -65535/2147483647)
+(div-test -32769 32767/2147483647 #'round -2147483648/2147483647 65535/2147483647)
+(div-test 32769 32767/2147483647 #'round -2147483648/2147483647 -65535/2147483647)
+(div-test 2 0.5d0 #'round 3d0 1.25d0)
+(div-test 3 -0.5d0 #'round 4d0 1.5d0)
+(div-test -3 -0.5d0 #'round 4d0 -1.5d0)
+(div-test -3 0.5d0 #'round -4d0 1.5d0)
+(div-test 3 0.5d0 #'round -4d0 -1.5d0)
+(div-test 1 2/91 #'round 5/7 9/13)
+(div-test -1 2/91 #'round 5/7 -9/13)
+(div-test -1 -2/91 #'round -5/7 9/13)
+(div-test 1 -2/91 #'round -5/7 -9/13)
+(div-test 1 0 #'round 2147483648/2147483647 2147483648/2147483647)
+(div-test -1 0 #'round 2147483648/2147483647 -2147483648/2147483647)
+(div-test -1 0 #'round -2147483648/2147483647 2147483648/2147483647)
+(div-test 1 0 #'round -2147483648/2147483647 -2147483648/2147483647)
+(div-test 9438 -313311293547183/144137437447079
+       #'round 16324116304212832041/144137437447079 12)
+(div-test -9438 -313311293547183/144137437447079
+       #'round 16324116304212832041/144137437447079 -12)
+(div-test -9438 313311293547183/144137437447079
+       #'round -16324116304212832041/144137437447079 12)
+(div-test 9438 313311293547183/144137437447079
+       #'round -16324116304212832041/144137437447079 -12)
+(div-test 8082 -1804074198964956721/720687187235395
+       #'round 2147483648 1148972348912638496123/4324123123412370)
+(div-test -8082 -1804074198964956721/720687187235395
+       #'round 2147483648 -1148972348912638496123/4324123123412370)
+(div-test -8082 1804074198964956721/720687187235395
+       #'round -2147483648 1148972348912638496123/4324123123412370)
+(div-test 8082 1804074198964956721/720687187235395
+       #'round -2147483648 -1148972348912638496123/4324123123412370)
+(div-test 0 1148972348912638496123/4324123123412370111
+       #'round 1148972348912638496123/4324123123412370111 2147483648)
+(div-test 0 1148972348912638496123/4324123123412370111
+       #'round 1148972348912638496123/4324123123412370111 -2147483648)
+(div-test 0 -1148972348912638496123/4324123123412370111
+       #'round -1148972348912638496123/4324123123412370111 2147483648)
+(div-test 0 -1148972348912638496123/4324123123412370111
+       #'round -1148972348912638496123/4324123123412370111 -2147483648)
+(div-test 0d0 1.0000000004656613d0 #'fround 2147483648/2147483647 2147483648d0)
+(div-test 0d0 1.0000000004656613d0 #'fround 2147483648/2147483647 -2147483648d0)
+(div-test 0d0 -1.0000000004656613d0 #'fround -2147483648/2147483647 2147483648d0)
+(div-test 0d0 -1.0000000004656613d0 #'fround -2147483648/2147483647 -2147483648d0)
+(div-test 2 0.5d0 #'round 2.5d0)
+(div-test -2 -0.5d0 #'round -2.5d0)
+(div-test 5 0d0 #'round 2.5d0 0.5d0)
+(div-test -5 0d0 #'round 2.5d0 -0.5d0)
+(div-test -5 0d0 #'round 2.5d0 -0.5d0)
+(div-test -5 0d0 #'round -2.5d0 0.5d0)
+(div-test 5 0d0 #'round -2.5d0 -0.5d0)
+(div-test 1 -2/7 #'round 5/7)
+(div-test -1 2/7 #'round -5/7)
+(div-test 2 -1/2 #'round 3/2)
+(div-test -2 1/2 #'round -3/2)
+(div-test 2 1 #'round 30/2 7)
+(div-test -2 1 #'round 30/2 -7)
+(div-test -2 -1 #'round -30/2 7)
+(div-test 2 -1 #'round -30/2 -7)
+(div-test 1073741824 -1/2 #'round 2147483647/2)
+(div-test -1073741824 1/2 #'round -2147483647/2)
+(div-test 1 -2147483645/2 #'round 2147483647/2 2147483646)
+(div-test -1 -2147483645/2 #'round 2147483647/2 -2147483646)
+(div-test -1 2147483645/2 #'round -2147483647/2 2147483646)
+(div-test 1 -2147483645/2 #'round 2147483647/2 2147483646)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; misc
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(test #c(5 -5) #'conjugate #c(5 5))
+(test #c(5 5) #'conjugate #c(5 -5))
+(test #c(-5 -5) #'conjugate #c(-5 5))
+(test #c(-5 5) #'conjugate #c(-5 -5))
+
+(test 1 #'denominator 10)
+(test 3 #'denominator 10/3)
+(test 3 #'denominator 1804074198964956721/3)
+(test 4324123123412370111 #'denominator -1148972348912638496123/4324123123412370111)
+
+(bool-test nil #'evenp -1)
+(bool-test t #'evenp -2147483648)
+(bool-test t #'evenp -4294967296)
+(bool-test nil #'evenp -4294967295)
+
+(test 0.5d0 #'float 1/2)
+(test 10.0d0 #'float 10)
+(test 4.978341823462786d22 #'float 49783418234627861238926)
+(test 1.845867531346429d12 #'float 643827946123846123984/348794231)
+
+(bool-test t #'floatp 0.3d0)
+(bool-test nil #'floatp 1/3)
+
+(test 0 #'imagpart 1)
+(test -5 #'imagpart #c(1 -5))
+
+(bool-test t #'integerp 12)
+(bool-test nil #'integerp 1/2)
+(bool-test nil #'integerp :test)
+(bool-test nil #'integerp 0d0)
+(bool-test t #'integerp 49783418234627861238926)
+
+(test 3 #'isqrt 12)
+(test 46340 #'isqrt 2147483648)
+(test 46340 #'isqrt 2147483647)
+(test 25373764918 #'isqrt 643827946123846123984)
+
+(bool-test nil #'logtest 1 2)
+(bool-test t #'logtest 1 3)
+(bool-test t #'logtest 7 -1)
+
+(bool-test nil #'minusp 0)
+(bool-test nil #'minusp 2147483648)
+(bool-test t #'minusp -2147483648)
+(bool-test t #'minusp -1/4)
+(bool-test nil #'minusp 0.2d0)
+(bool-test nil #'minusp 0d0)
+(bool-test nil #'minusp 984723891462817946123897416)
+(bool-test t #'minusp -1148972348912638496123/4324123123412370111)
+
+(bool-test t #'numberp #c(1 2))
+(bool-test t #'numberp -200)
+(bool-test nil #'numberp :test)
+
+(test 10 #'numerator 10)
+(test 10 #'numerator 10/3)
+(test 1804074198964956721 #'numerator 1804074198964956721/3)
+(test -1148972348912638496123 #'numerator -1148972348912638496123/4324123123412370111)
+
+(bool-test t #'oddp -1)
+(bool-test nil #'oddp -2147483648)
+(bool-test nil #'oddp -4294967296)
+(bool-test t #'oddp -4294967295)
+
+(bool-test nil #'plusp 0)
+(bool-test t #'plusp 2147483648)
+(bool-test nil #'plusp -2147483648)
+(bool-test nil #'plusp -1/4)
+(bool-test t #'plusp 0.2d0)
+(bool-test nil #'plusp 0d0)
+(bool-test t #'plusp 984723891462817946123897416)
+(bool-test nil #'plusp -1148972348912638496123/4324123123412370111)
+
+(test 1/4 #'rational 0.25d0)
+(test 5/2 #'rational 2.5d0)
+(test 1/8 #'rational 0.125d0)
+(test -5/8 #'rational -0.625d0)
+(test 524293/8 #'rational 65536.625d0)
+(test 17179869181/8 #'rational 2147483647.625d0)
+
+(bool-test t #'rationalp -3)
+(bool-test t #'rationalp 1/2)
+(bool-test t #'rationalp 1/2412341242424122412)
+(bool-test nil #'rationalp :test)
+(bool-test nil #'rationalp 0d0)
+(bool-test t #'rationalp 49783418234627861238926)
+
+(test -1 #'realpart #c(-1 0.5d0))
+
+(test 1 #'signum 123/5)
+(test 0d0 #'signum 0d0)
+(test -1d0 #'signum -7.3d0)
+
+(bool-test nil #'zerop 1)
+(bool-test nil #'zerop 1/4312412341234123412)
+(bool-test nil #'zerop 0.000003d0)
+(bool-test t #'zerop 0)
+(bool-test t #'zerop 0d0)
+(bool-test t #'zerop #c(0 0d0))
+
+(bool-test t #'= 10 #c(10 0d0))
+
diff --git a/xedit/lisp/test/psql-1.lsp b/xedit/lisp/test/psql-1.lsp
new file mode 100644 (file)
index 0000000..2410fd8
--- /dev/null
@@ -0,0 +1,80 @@
+;; Postgresql C library interface, example program 1, using the xedit
+;; lisp interface
+
+;; Test the C version of libpq, the PostgreSQL frontend library. 
+(require "psql")
+
+(defun exit-nicely (conn)
+    (pq-finish conn)
+    (quit 1)
+)
+
+;; begin, by setting the parameters for a backend connection if the
+;; parameters are null, then the system will try to use reasonable
+;; defaults by looking up environment variables or, failing that,
+;; using hardwired constants
+(setq pghost nil)              ; host name of the backend server
+(setq pgport nil)              ; port of the backend server
+(setq pgoptions nil)           ; special options to start up the backend server
+(setq pgtty nil)               ; debugging tty for the backend server
+(setq pgdbname "template1")
+
+;; make a connection to the database
+(setq conn (pq-setdb pghost pgport pgoptions pgtty pgdbname))
+
+;; check to see that the backend connection was successfully made
+(when (= (pq-status conn) pg-connection-bad)
+    (format t "Connection to database '~A' failed.~%" pgdbname)
+    (format t "~A" (pq-error-message conn))
+    (exit-nicely conn))
+
+;; start a transaction block
+(setq res (pq-exec conn "BEGIN"))
+(when (or (null res) (not (= (pq-result-status res) pgres-command-ok)))
+    (format t "BEGIN command failed~%")
+    (pq-clear res)
+    (exit-nicely conn))
+
+;; Should PQclear PGresult whenever it is no longer needed to avoid memory leaks
+(pq-clear res)
+
+;; fetch rows from the pg_database, the system catalog of databases
+(setq res (pq-exec conn "DECLARE mycursor CURSOR FOR select * from pg_database"))
+(when (or (null res) (not (= (pq-result-status res) pgres-command-ok)))
+    (format t "DECLARE CURSOR command failed~%")
+    (pq-clear res)
+    (exit-nicely conn))
+(pq-clear res)
+(setq res (pq-exec conn "FETCH ALL in mycursor"))
+(when (or (null res) (not (= (pq-result-status res) pgres-tuples-ok)))
+    (format t "FETCH ALL command didn't return tuples properly~%")
+    (pq-clear res)
+    (exit-nicely conn))
+
+;; first, print out the attribute names
+(setq nfields (pq-nfields res))
+(dotimes (i nfields)
+    (format t "~15@<~A~>" (pq-fname res i))
+)
+(format t "~%")
+
+;; next, print out the rows
+(setq ntuples (pq-ntuples res))
+(dotimes (i ntuples)
+    (dotimes (j nfields)
+       (format t "~15@<~A~>" (pq-getvalue res i j))
+    )
+    (format t "~%")
+)
+(pq-clear res)
+
+;; close the cursor
+(setq res (pq-exec conn "CLOSE mycursor"))
+(pq-clear res)
+
+;; commit the transaction
+(setq res (pq-exec conn "COMMIT"))
+(pq-clear res)
+
+;; close the connection to the database and cleanup
+(pq-finish conn)
diff --git a/xedit/lisp/test/psql-2.lsp b/xedit/lisp/test/psql-2.lsp
new file mode 100644 (file)
index 0000000..011512c
--- /dev/null
@@ -0,0 +1,74 @@
+;; Postgresql C library interface, example program 2, using the xedit
+;; lisp interface
+
+;;  Test of the asynchronous notification interface
+;;
+;; Start this program, then from psql in another window do
+;;   NOTIFY TBL2;
+;;
+;; Or, if you want to get fancy, try this:
+;; Populate a database with the following:
+;;
+;;   CREATE TABLE TBL1 (i int4);
+;;
+;;   CREATE TABLE TBL2 (i int4);
+;;
+;;   CREATE RULE r1 AS ON INSERT TO TBL1 DO
+;;     (INSERT INTO TBL2 values (new.i); NOTIFY TBL2);
+;;
+;; and do
+;;
+;;   INSERT INTO TBL1 values (10);
+(require "psql")
+
+(defun exit-nicely (conn)
+    (pq-finish conn)
+    (quit 1)
+)
+
+;; begin, by setting the parameters for a backend connection if the
+;; parameters are null, then the system will try to use reasonable
+;; defaults by looking up environment variables or, failing that,
+;; using hardwired constants
+(setq pghost nil)              ; host name of the backend server
+(setq pgport nil)              ; port of the backend server
+(setq pgoptions nil)           ; special options to start up the backend server
+(setq pgtty nil)               ; debugging tty for the backend server
+(setq pgdbname "test")         ; change this to the name of your test database
+                               ;; XXX Note: getenv not yet implemented in the
+                                ; lisp interpreter
+
+;; make a connection to the database
+(setq conn (pq-setdb pghost pgport pgoptions pgtty pgdbname))
+
+;; check to see that the backend connection was successfully made
+(when (= (pq-status conn) pg-connection-bad)
+    (format t "Connection to database '~A' failed.~%" pgdbname)
+    (format t "~A" (pq-error-message conn))
+    (exit-nicely conn))
+
+(setq res (pq-exec conn "LISTEN TBL2"))
+(when (= (pq-status conn) pg-connection-bad)
+    (format t "LISTEN command failed~%")
+    (format t "~A" (pq-error-message conn))
+    (exit-nicely conn))
+
+;; Should PQclear PGresult whenever it is no longer needed to avoid memory leaks
+(pq-clear res)
+
+(loop
+    ;; wait a little bit between checks; waiting with select()
+    ;; would be more efficient.
+       ;; XXX Note: sleep not yet implemented in the lisp interpreter
+
+    ;; collect any asynchronous backend messages
+    (pq-consume-input conn)
+
+    ;; check for asynchronous notify messages
+    (when (setq notifies (pq-notifies conn))
+       (format t "ASYNC NOTIFY of '~A' from backend pid '~D' received~%"
+        (pg-notify-relname notifies) (pg-notify-be-pid notifies))
+    )
+)
+
+(pq-finish conn)
diff --git a/xedit/lisp/test/psql-3.lsp b/xedit/lisp/test/psql-3.lsp
new file mode 100644 (file)
index 0000000..bb172c9
--- /dev/null
@@ -0,0 +1,118 @@
+;; Postgresql C library interface, example program 3, using the xedit
+;; lisp interface
+
+;;  Test the binary cursor interface
+;;
+;; populate a database by doing the following:
+;;
+;; CREATE TABLE test1 (i int4, d real, p polygon);
+;;
+;; INSERT INTO test1 values (1, 3.567, polygon '(3.0, 4.0, 1.0, 2.0)');
+;;
+;; INSERT INTO test1 values (2, 89.05, polygon '(4.0, 3.0, 2.0, 1.0)');
+;;
+;; the expected output is:
+;;
+;; tuple 0: got i = (4 bytes) 1, d = (4 bytes) 3.567000, p = (4
+;; bytes) 2 points   boundbox = (hi=3.000000/4.000000, lo =
+;; 1.000000,2.000000) tuple 1: got i = (4 bytes) 2, d = (4 bytes)
+;; 89.050003, p = (4 bytes) 2 points   boundbox =
+;; (hi=4.000000/3.000000, lo = 2.000000,1.000000)
+
+;;  Output of the lisp code:
+;;
+;; type[0] = 23, size[0] = 4
+;; type[1] = 700, size[1] = 4
+;; type[2] = 604, size[2] = -1
+;; tuple 0: got
+;;  i = (4 bytes) 1
+;;  d = (4 bytes) 3.567
+;;  p = (4 bytes) 2 points boundbox = (hi=3.0/4.0, lo = 1.0/2.0)
+;; tuple 1: got
+;;  i = (4 bytes) 2
+;;  d = (4 bytes) 89.05
+;;  p = (4 bytes) 2 points boundbox = (hi=4.0/3.0, lo = 2.0/1.0)
+
+
+(require "psql")
+
+(defun exit-nicely (conn)
+    (pq-finish conn)
+    (quit 1)
+)
+
+;; begin, by setting the parameters for a backend connection if the
+;; parameters are null, then the system will try to use reasonable
+;; defaults by looking up environment variables or, failing that,
+;; using hardwired constants
+(setq pghost nil)              ; host name of the backend server
+(setq pgport nil)              ; port of the backend server
+(setq pgoptions nil)           ; special options to start up the backend server
+(setq pgtty nil)               ; debugging tty for the backend server
+(setq pgdbname "test")         ; change this to the name of your test database
+                               ;; XXX Note: getenv not yet implemented in the
+                                ; lisp interpreter
+
+;; make a connection to the database
+(setq conn (pq-setdb pghost pgport pgoptions pgtty pgdbname))
+
+;; check to see that the backend connection was successfully made
+(when (= (pq-status conn) pg-connection-bad)
+    (format t "Connection to database '~A' failed.~%" pgdbname)
+    (format t "~A" (pq-error-message conn))
+    (exit-nicely conn))
+
+(setq res (pq-exec conn "BEGIN"))
+(when (= (pq-status conn) pg-connection-bad)
+    (format t "BEGIN command failed~%")
+    (pq-clear res)
+    (exit-nicely conn))
+
+;; Should PQclear PGresult whenever it is no longer needed to avoid memory leaks
+(pq-clear res)
+
+(setq res (pq-exec conn "DECLARE mycursor BINARY CURSOR FOR select * from test1"))
+(when (= (pq-status conn) pg-connection-bad)
+    (format t "DECLARE CURSOR command failed~%")
+    (pq-clear res)
+    (exit-nicely conn))
+(pq-clear res)
+
+(setq res (pq-exec conn "FETCH ALL in mycursor"))
+(when (or (null res) (not (= (pq-result-status res) pgres-tuples-ok)))
+    (format t "FETCH ALL command didn't return tuples properly~%")
+    (pq-clear res)
+    (exit-nicely conn))
+
+(setq i-fnum (pq-fnumber res "i"))
+(setq d-fnum (pq-fnumber res "d"))
+(setq p-fnum (pq-fnumber res "p"))
+
+(dotimes (i 3)
+    (format t "type[~D] = ~D, size[~D] = ~D~%"
+     i (pq-ftype res i) i (pq-fsize res i))
+)
+
+(dotimes (i (pq-ntuples res))
+    (setq i-val (pq-getvalue res i i-fnum 'int32))
+    (setq d-val (pq-getvalue res i d-fnum 'float))
+    (setq p-val (pq-getvalue res i p-fnum 'pg-polygon))
+    (format t "tuple ~D: got~%" i)
+    (format t " i = (~D bytes) ~D~%" (pq-getlength res i i-fnum) i-val)
+    (format t " d = (~D bytes) ~D~%" (pq-getlength res i d-fnum) d-val)
+    (format t " p = (~D bytes) ~D points~,8@Tboundbox = (hi=~F/~F, lo = ~F/~F)~%"
+     (pq-getlength res i d-fnum) (pg-polygon-num-points p-val)
+     (pg-point-x (pg-box-high (pg-polygon-boundbox p-val)))
+     (pg-point-y (pg-box-high (pg-polygon-boundbox p-val)))
+     (pg-point-x (pg-box-low (pg-polygon-boundbox p-val)))
+     (pg-point-y (pg-box-low (pg-polygon-boundbox p-val))))
+)
+(pq-clear res)
+
+(setq res (pq-exec conn "CLOSE mycursor"))
+(pq-clear res)
+
+(setq res (pq-exec conn "COMMIT"))
+(pq-clear res)
+
+(pq-finish conn)
diff --git a/xedit/lisp/test/regex.lsp b/xedit/lisp/test/regex.lsp
new file mode 100644 (file)
index 0000000..9e28efa
--- /dev/null
@@ -0,0 +1,451 @@
+;;
+;; Copyright (c) 2002 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/test/regex.lsp,v 1.1 2002/12/10 03:59:04 paulo Exp $
+;;
+
+;; Basic regex tests. This file is only for xedit lisp and for it's regex
+;; library. Note that the regex library used by xedit lisp is not mean't
+;; to be fully compatible with most regexes, but to be as fast as possible.
+;; This means that some patterns that looks basic may never be matched,
+;; but it is expected that almost any pattern can be rewritten to be
+;; matched, or in the worst case, it may be required to search in the
+;; regions matched by a previous regex.
+
+(defun re-test (expect &rest arguments &aux result (error t) unused error-value)
+    (multiple-value-setq
+       (unused error-value)
+       (ignore-errors
+           (setq result (apply #'re-exec arguments))
+           (setq error nil)))
+    (if error
+       (format t "ERROR: (re-exec~{ ~S~}) => ~S~%" arguments error-value)
+       (or (equal result expect)
+           (format t "(re-exec~{ ~S~}) => should be ~S not ~S~%"
+               arguments expect result))))
+
+;; errors only generated for regex compilation (or incorrect arguments)
+(defun re-error (&rest arguments &aux result (error t) unused error-value)
+    (multiple-value-setq
+       (unused error-value)
+       (ignore-errors
+           (setq result (apply #'re-comp arguments))
+           (setq error nil)))
+    (or error
+       (format t "ERROR: no error for (re-comp~{ ~S~})" arguments)))
+
+(re-error "")
+(re-error "a**")
+(re-error "[a")
+(re-error "a{")
+(re-error "a(")
+(re-error "a||b")
+(re-error "|b|c")
+(re-error "a|b|")
+
+(setq re (re-comp "abc"))
+(re-test '((0 . 3)) re "abc")
+(re-test '((0 . 3)) re "abc" :notbol t)
+(re-test '((0 . 3)) re "abc" :noteol t)
+(re-test '((0 . 3)) re "abc" :notbol t :noteol t)
+(re-test '((14 . 17)) re "aaaaaaaaaaaaaaabc")
+(re-test '((14 . 17)) re "aaaaaaaaaaaaaaabc" :start 12 :end 17)
+(re-test '((30 . 33)) re "xxxxxxxxxxxxxxaaaaaaaaaaaaaaaaabcxx")
+(re-test '((30 . 33)) re "xxxxxxxxxxxxxxaaaaaaaaaaaaaaaaabcxx" :start 28 :end 34)
+
+(setq re (re-comp "^abc"))
+(re-test '((0 . 3)) re "abc")
+(re-test :nomatch re "xabc")
+(re-test '((1 . 4)) re "xabc" :start 1)
+(re-test :nomatch re "xabc" :start 1 :notbol t)
+
+(setq re (re-comp "abc$"))
+(re-test '((0 . 3)) re "abc")
+(re-test :nomatch re "xabcx")
+(re-test '((1 . 4)) re "xabcx" :end 4)
+(re-test :nomatch re "xabc" :end 4 :noteol t)
+
+(setq re (re-comp "^abc$"))
+(re-test '((0 . 3)) re "abc")
+(re-test :nomatch re "xabcx")
+(re-test '((1 . 4)) re "xabcx" :start 1 :end 4)
+(re-test :nomatch re "xabcx" :start 1 :end 4 :notbol t)
+(re-test :nomatch re "xabcx" :start 1 :end 4 :noteol t)
+(re-test :nomatch re "xabcx" :start 1 :end 4 :notbol t :noteol t)
+(re-test nil re "abc" :count 0)
+
+(setq re (re-comp "abc|bcd|cde"))
+(re-test '((0 . 3)) re "abc")
+(re-test '((1 . 4)) re "aabc")
+(re-test '((3 . 6)) re "xxxbcdef")
+(re-test '((8 . 11)) re "abdzzzcdabcde")
+(re-test '((13 . 16)) re "xxxxabdecdabdcde")
+
+(setq re (re-comp "^abc|bcd$|cde"))
+(re-test '((0 . 3)) re "abcde")
+(re-test '((3 . 6)) re "xabcde")
+(re-test '((1 . 4)) re "xabcde" :start 1)
+(re-test '((3 . 6)) re "xabcde" :start 1 :notbol t)
+(re-test '((2 . 5)) re "xabcd")
+(re-test :nomatch re "xabcd" :noteol t)
+(re-test nil re "xabcd" :count 0)
+(re-test :nomatch re "abcdx" :notbol t)
+
+(setq re (re-comp "a?bc|ab?c|abc?"))
+(re-test '((0 . 3)) re "abc")
+(re-test :nomatch re "xxxb")
+(re-test '((3 . 5)) re "xxxbc")
+(re-test '((5 . 7)) re "sssssab")
+(re-test '((0 . 3)) re "abcd")
+(re-test '((1 . 4)) re "aabcdef")
+(re-test '((1 . 3)) re "aabbccdef")    ;; ab matches abc?
+
+(setq re (re-comp "a?bc"))
+(re-test '((2 . 4)) re "acbcd")
+(re-test '((2 . 5)) re "acabcd")
+
+(setq re (re-comp "ab?c"))
+(re-test '((1 . 3)) re "xacc")
+(re-test '((2 . 5)) re "xxabcc")
+
+(setq re (re-comp "abc?"))
+(re-test '((1 . 3)) re "xababc")
+(re-test '((2 . 5)) re "xxabccabc")
+
+(setq re (re-comp "a*bc|ab*c|abc*"))
+(re-test '((0 . 9)) re "aaaaaaabc")
+(re-test '((1 . 10)) re "xaaaaaaabc")
+(re-test '((3 . 12)) re "xyzaaaaaaabc")
+(re-test '((0 . 4)) re "abbc")
+(re-test '((2 . 9)) re "xxabbbbbc")
+(re-test '((0 . 12)) re "abcccccccccc")
+(re-test '((0 . 12)) re "abccccccccccd")
+(re-test '((16 . 29)) re "xxxxxxxaaaaaaaaaabbbbbbbbbbbccccccccccc")
+(re-test '((11 . 13)) re "xxxbbbbbbbbbc")
+(re-test '((8 . 10)) re "aaaaazbxacd")
+
+(setq re (re-comp "a*bc"))
+(re-test '((2 . 4)) re "acbcd")
+(re-test '((2 . 5)) re "acabcd")
+(re-test '((2 . 8)) re "acaaaabcd")
+
+(setq re (re-comp "ab*c"))
+(re-test '((1 . 3)) re "xacc")
+(re-test '((2 . 5)) re "xxabcc")
+(re-test '((3 . 8)) re "xxaabbbcc")
+
+(setq re (re-comp "abc*"))
+(re-test '((1 . 3)) re "xababc")
+(re-test '((2 . 5)) re "xxabcbabccc")
+(re-test '((3 . 7)) re "axxabccabc")
+
+(setq re (re-comp "a+bc|ab+c|abc+"))
+(re-test :nomatch re "xxxbc")
+(re-test '((1 . 6)) re "xaaabc")
+(re-test '((8 . 12)) re "zzzzaaaaabbc")
+(re-test '((7 . 15)) re "zzzzaaaabbbbbbcccc")
+
+(setq re (re-comp "a.c"))
+(re-test '((0 . 3)) re "abc")
+(re-test '((1 . 4)) re "aaac")
+(re-test :nomatch re "xac")
+(re-test '((3 . 6)) re "xaxaac")
+(re-test '((2 . 5)) re "xxabc")
+(re-test '((3 . 6)) re "acxaxc")
+
+(setq re (re-comp "a*c"))
+(re-test '((0 . 1)) re "c")
+(re-test '((5 . 6)) re "xxxxxc")
+(re-test '((8 . 9)) re "xxxxxxxxc")
+(re-test '((7 . 8)) re "xxxxxxxcc")
+(re-test '((0 . 2)) re "ac")
+(re-test '((0 . 5)) re "aaaac")
+(re-test '((1 . 3)) re "xac")
+(re-test '((3 . 6)) re "xxxaac")
+(re-test '((2 . 4)) re "xxac")
+(re-test '((4 . 6)) re "xxxxac")
+
+(setq re (re-comp "a+c"))
+(re-test '((2 . 5)) re "xxaac")
+(re-test '((3 . 8)) re "xxxaaaac")
+(re-test '((6 . 8)) re "xaaaabac")
+(re-test :nomatch re "xxxc")
+(re-test '((4 . 9)) re "xxxxaaaaccc")
+
+(setq re (re-comp "a{4}b"))
+(re-test '((19 . 24)) re "xabxxaabxxxaaabxxxxaaaab")
+(re-test '((4 . 9)) re "aaabaaaab")
+
+(setq re (re-comp "a{4,}b"))
+(re-test '((3 . 8)) re "xxxaaaab")
+(re-test '((8 . 25)) re "zaaabzzzaaaaaaaaaaaaaaaab")
+
+(setq re (re-comp "a{,4}b"))
+(re-test '((0 . 1)) re "b")
+(re-test '((8 . 9)) re "xxxxxxxxb")
+(re-test '((6 . 11)) re "xaaaaaaaaab")
+(re-test '((3 . 5)) re "xxxab")
+(re-test '((6 . 10)) re "aaaaaxaaab")
+
+(setq re (re-comp "a{2,4}b"))
+(re-test :nomatch re "xab")
+(re-test '((1 . 4)) re "xaab")
+(re-test '((1 . 5)) re "xaaab")
+(re-test '((2 . 7)) re "xxaaaab")
+(re-test '((4 . 9)) re "xxxaaaaab")
+
+(setq re (re-comp "foo(bar|baz)fee"))
+(re-test '((9 . 18)) re "feebarbazfoobarfee")
+(re-test '((9 . 18) (12 . 15)) re "feebarbazfoobarfee" :count 2)
+(re-test '((13 . 22)) re "foofooobazfeefoobazfee")
+(re-test '((13 . 22) (16 . 19)) re "foofooobazfeefoobazfee" :count 3)
+
+(setq re (re-comp "foo(bar|baz)fee" :nosub t))
+(re-test '((9 . 18)) re "feebarbazfoobarfee")
+(re-test '((9 . 18)) re "feebarbazfoobarfee" :count 2)
+(re-test '((13 . 22)) re "foofooobazfeefoobazfee")
+(re-test '((13 . 22)) re "foofooobazfeefoobazfee" :count 3)
+
+(setq re (re-comp "f(oo|ee)ba[rz]"))
+(re-test :nomatch re "barfoebaz")
+(re-test '((3 . 9) (4 . 6)) re "bazfoobar" :count 2)
+(re-test '((3 . 9) (4 . 6)) re "barfeebaz" :count 2)
+
+(setq re (re-comp "f(oo|ee)ba[rz]" :nosub t))
+(re-test :nomatch re "barfoebaz")
+(re-test '((3 . 9)) re "bazfoobar" :count 2)
+(re-test '((3 . 9)) re "barfeebaz" :count 2)
+
+(setq re (re-comp "\\<(int|char)\\>"))
+(re-test '((15 . 18)) re "aint character int foo")
+(re-test '((15 . 18) (15 . 18)) re "aint character int foo" :count 2)
+
+(setq re (re-comp "\\<(int|char)\\>" :nosub t))
+(re-test '((15 . 18)) re "aint character int foo" :count 2)
+
+(setq re (re-comp "foo.*bar"))
+(re-test '((11 . 17)) re "barfoblaboofoobarfoobarfoobar")
+
+(setq re (re-comp "foo.+bar"))
+(re-test :nomatch re "foobar")
+(re-test '((6 . 13)) re "fobbarfooxbarfooybar")
+
+(setq re (re-comp "foo.?bar"))
+(re-test '((1 . 7)) re "xfoobar")
+(re-test :nomatch re "xxfooxxbar")
+(re-test '((3 . 10)) re "yyyfootbar")
+
+(setq re (re-comp "a.*b.*c"))
+(re-test '((0 . 3)) re "abc")
+(re-test '((9 . 18)) re "xxxxxxxxxabbbbbbbccaaaaabbbc")
+
+(setq re (re-comp "a.+b.*c"))
+(re-test :nomatch re "xxxabc")
+(re-test '((2 . 7)) re "xxaxbbc")
+
+(setq re (re-comp "a.+b.?c"))
+(re-test '((1 . 5)) re "xaabc")
+(re-test '((2 . 7)) re "xxaabbc")
+
+(setq re (re-comp "(foo.*|bar)fee"))
+(re-test '((3 . 9) (3 . 6)) re "barfoofee" :count 2)
+(re-test '((0 . 9) (0 . 6)) re "foobarfee" :count 2)
+(re-test '((4 . 10) (4 . 7)) re "xxfobarfee" :count 2)
+(re-test '((3 . 17) (3 . 14)) re "barfooooooobarfee" :count 2)
+(re-test '((4 . 10) (4 . 7)) re "xxfobarfeefoobar" :count 2)
+
+(setq re (re-comp "(foo.+|bar)fee"))
+(re-test :nomatch re "barfoofee" :count 2)
+(re-test '((3 . 10) (3 . 7)) re "barfooxfee" :count 2)
+
+(setq re (re-comp "(foo.?|bar)fee"))
+(re-test :nomatch re "foobar" :count 2)
+(re-test '((2 . 8) (2 . 5)) re "bafoofee" :count 2)
+(re-test '((2 . 9) (2 . 6)) re "bafooofeebarfee" :count 4)
+(re-test '((2 . 8) (2 . 5)) re "bafoofeebarfee" :count 2)
+(re-test nil re "bafoofeebarfee" :count 0)
+(re-test '((2 . 8)) re "bafoofeebarfee" :count 1)
+
+(setq re (re-comp "(a|b|c)\\1"))
+(re-test '((0 . 2) (0 . 1)) re "aa" :count 2)
+
+(setq re (re-comp "(a|b|c)(a|b|c)\\1\\2"))
+(re-test '((0 . 4) (0 . 1) (1 . 2)) re "acac" :count 5)
+(re-test '((4 . 8) (4 . 5) (5 . 6)) re "xxxxacac" :count 4)
+(re-test '((24 . 28) (24 . 25) (25 . 26)) re "xxacabacbcacbbacbcaaccabcaca" :count 3)
+(re-test '((4 . 8) (4 . 5) (5 . 6)) re "xyabcccc" :count 3)
+(re-test '((4 . 8) (4 . 5)) re "xyabcccc" :count 2)
+(re-test '((4 . 8)) re "xyabcccc" :count 1)
+(re-test nil re "xyabcccc" :count 0)
+
+(setq re (re-comp "(a*b)\\1"))
+(re-test '((3 . 15) (3 . 9)) re "xxxaaaaabaaaaab" :count 2)
+(re-test '((7 . 9) (7 . 8)) re "abaabaxbb" :count 2)
+
+(setq re (re-comp "(ab+c)\\1"))
+(re-test '((3 . 13) (3 . 8)) re "xaaabbbcabbbc" :count 3)
+
+(setq re (re-comp "(ab?c)\\1"))
+(re-test :nomatch re "abcac" :count 2)
+(re-test '((4 . 8) (4 . 6)) re "acabacac" :count 2)
+(re-test '((5 . 11) (5 . 8)) re "abcacabcabc" :count 2)
+(re-test '((3 . 7) (3 . 5)) re "abcacac" :count 2)
+
+(setq re (re-comp "a(.*)b\\1"))
+(re-test '((3 . 5) (4 . 4)) re "xxxab" :count 2)
+(re-test '((4 . 12) (5 . 8)) re "xxxxazzzbzzz" :count 2)
+
+(setq re (re-comp "abc" :icase t))
+(re-test '((0 . 3)) re "AbC")
+
+(setq re (re-comp "[0-9][a-z]+" :icase t))
+(re-test '((3 . 10)) re "xxx0aaZxYT9")
+
+(setq re (re-comp "a.b" :icase t))
+(re-test '((10 . 13)) re "aaaaaaaaaaaxB")
+
+(setq re (re-comp "a.*z" :icase t))
+(re-test '((3 . 9)) re "xxxAaaaaZ")
+(re-test '((2 . 6)) re "xxaaaZaaa")
+
+(setq re (re-comp "\\<(lambda|defun|defmacro)\\>" :icase t))
+(re-test '((5 . 11)) re "    (lambda")
+(re-test '((5 . 11) (5 . 11)) re "    (lambda" :count 2)
+(re-test :nomatch re "lamda defunn deffmacro")
+
+(setq re (re-comp "\\<(nil|t)\\>" :icase t))
+(re-test '((3 . 6)) re "it Nil")
+(re-test '((3 . 6) (3 . 6)) re "it Nil" :count 6)
+(re-test :nomatch re "nilo")
+
+(setq re (re-comp "\\<(begin|end)\\>" :icase t))
+(re-test '((21 . 24) (21 . 24)) re "beginning the ending EnD" :count 7)
+
+(setq re (re-comp "a.*" :newline t))
+(re-test '((0 . 1)) re "a
+aaa")
+(re-test '((3 . 4)) re "xyza
+aa")
+
+(setq re (re-comp "a.+" :newline t))
+(re-test '((2 . 5)) re "a
+aaa")
+(re-test '((5 . 7)) re "xyza
+aa")
+
+(setq re (re-comp "a.?" :newline t))
+(re-test '((0 . 1)) re "a
+aaa")
+(re-test '((3 . 4)) re "xyza
+aa")
+
+(setq re (re-comp "a.*b.*c" :newline t))
+(re-test '((11 . 14)) re "xxaa
+zyacb
+abc")
+(re-test '((6 . 9)) re "xxxab
+abc
+c")
+
+(setq re (re-comp "a.+b.*c" :newline t))
+(re-test '((6 . 10)) re "ab
+bc
+abbc")
+
+(setq re (re-comp "a.?b.*c" :newline t))
+(re-test '((4 . 8)) re "ab
+cabbc
+cc")
+
+(setq re (re-comp "^foo$" :newline t))
+(re-test '((11 . 14)) re "bar
+foobar
+foo")
+(re-test '((0 . 3)) re "foo
+bar
+foo
+bar")
+(re-test '((8 . 11)) re "foo
+bar
+foo
+bar" :notbol t)
+(re-test '((8 . 11)) re "foo
+bar
+foo" :notbol t)
+(re-test :nomatch re "foo
+bar
+foo" :notbol t :noteol t)
+
+(setq re (re-comp "^\\s*#\\s*(define|include)\\s+.+" :newline t))
+(re-test '((8 . 18)) re "#define
+#include x")
+(re-test '((8 . 18) (9 . 16)) re "#define
+#include x" :count 2)
+
+(setq re (re-comp "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"))
+(re-test '((3 . 259)) re "zzzxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxzzz")
+
+(setq re (re-comp "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~"))
+(re-test '((13 . 333)) re "String here: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890~/")
+
+(setq re (re-comp "(.*)\\D(\\d+)"))
+(re-test '((0 . 6) (0 . 3) (4 . 6)) re "abcW12" :count 3)
+(re-test '((0 . 6) (0 . 3)) re "abcW12" :count 2)
+(re-test '((0 . 6)) re "abcW12" :count 1)
+(re-test nil re "abcW12" :count 0)
+(re-test '((0 . 6) (0 . 3) (4 . 6)) re "abcW12abcW12" :count 3)
+(re-test '((0 . 6) (0 . 3) (4 . 6)) re "abcW12abcW12a" :count 3)
+
+(setq re (re-comp ".*\\d"))
+(re-test '((0 . 2)) re "a1a1a1aaaaaaa")                        ; minimal match only
+
+(setq re (re-comp "(.*)\\d"))
+(re-test '((0 . 2) (0 . 1)) re "a1a1a1aaaaaaa" :count 2); minimal match only
+
+(setq re (re-comp ".*(\\d)"))
+(re-test '((0 . 2) (1 . 2)) re "a1a1a1aaaaaaa" :count 2); minimal match only
+
+;; XXX this very simple pattern was entering an infinite loop
+;; actually, this pattern is not supported, just test if is not
+;; crashing (not supported because it is not cheap to match variations
+;; of the pattern)
+(setq re (re-comp "(.*a)?"))
+(re-test '((0 . 1)) re "aaaa")         ; expected, minimal match
+(re-test '((0 . 1) (0 . 1)) re "aaaa" :count 2)
+
+
+;; Tue Dec 11 22:22:51 BRST 2007 Fix a regression with the pattern below
+;; returning a match to an empty string.
+;; Note that inverting the order of the "alternatives" works with the
+;; versions of libre prior to this (one line) fix
+(setq re (re-comp "\\\\\\d{3}|\\\\."))
+(re-test  :nomatch re "\\")
+;; previous version should work with the pattern inverted
+(setq re (re-comp "\\\\.|\\\\\\d{3}"))
+(re-test  :nomatch re "\\")
diff --git a/xedit/lisp/test/stream.lsp b/xedit/lisp/test/stream.lsp
new file mode 100644 (file)
index 0000000..e483643
--- /dev/null
@@ -0,0 +1,807 @@
+;;
+;; Copyright (c) 2002 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/test/stream.lsp,v 1.3 2002/12/06 03:25:29 paulo Exp $
+;;
+
+;; most format tests from the cltl second edition samples
+
+;; basic io/format/pathname/stream tests
+
+(defun do-format-test (error-test expect arguments
+                   &aux result (error t) unused error-value)
+    (multiple-value-setq
+       (unused error-value)
+       (ignore-errors
+           (setq result (apply #'format nil arguments))
+           (setq error nil)
+       )
+    )
+    (if error-test
+       (or error
+           (format t "ERROR: no error for (format nil~{ ~S~}), result was ~S~%"
+               arguments result))
+       (if error
+           (format t "ERROR: (format nil~{ ~S~}) => ~S~%" arguments error-value)
+           (or (string= result expect)
+               (format t "(format nil~{ ~S~}) => should be ~S not ~S~%"
+                   arguments expect result)))
+    )
+)
+
+(defun format-test (expect &rest arguments)
+    (do-format-test nil expect arguments))
+
+(defun format-error (&rest arguments)
+    (do-format-test t nil arguments))
+
+
+
+(defun compare-test (test expect function arguments
+                    &aux result (error t) unused error-value)
+    (multiple-value-setq
+       (unused error-value)
+       (ignore-errors
+           (setq result (apply function arguments))
+           (setq error nil)
+       )
+    )
+    (if error
+       (format t "ERROR: (~S~{ ~S~}) => ~S~%" function arguments error-value)
+       (or (funcall test result expect)
+           (format t "(~S~{ ~S~}) => should be ~S not ~S~%"
+               function arguments expect result
+           )
+       )
+    )
+)
+
+(defun compare-eval (test expect form
+                    &aux result (error t) unused error-value)
+    (multiple-value-setq
+       (unused error-value)
+       (ignore-errors
+           (setq result (eval form))
+           (setq error nil)
+       )
+    )
+    (if error
+       (format t "ERROR: ~S => ~S~%" form error-value)
+       (or (funcall test result expect)
+           (format t "~S => should be ~S not ~S~%"
+               form expect result
+           )
+       )
+    )
+)
+
+(defun error-test (function &rest arguments &aux result (error t))
+    (ignore-errors
+       (setq result (apply function arguments))
+       (setq error nil)
+    )
+    (or error
+       (format t "ERROR: no error for (~S~{ ~S~}), result was ~S~%"
+           function arguments result)
+    )
+)
+
+(defun error-eval (form &aux result (error t))
+    (ignore-errors
+       (setq result (eval form))
+       (setq error nil)
+    )
+    (or error
+       (format t "ERROR: no error for ~S, result was ~S~%" form result)
+    )
+)
+
+(defun eq-test (expect function &rest arguments)
+    (compare-test #'eq expect function arguments))
+
+(defun eql-test (expect function &rest arguments)
+    (compare-test #'eql expect function arguments))
+
+(defun equal-test (expect function &rest arguments)
+    (compare-test #'equal expect function arguments))
+
+(defun equalp-test (expect function &rest arguments)
+    (compare-test #'equalp expect function arguments))
+
+(defun eq-eval (expect form)
+    (compare-eval #'eq expect form))
+
+(defun eql-eval (expect form)
+    (compare-eval #'eql expect form))
+
+(defun equal-eval (expect form)
+    (compare-eval #'equal expect form))
+
+(defun equalp-eval (expect form)
+    (compare-eval #'equalp expect form))
+
+(defun bool-test (expect function &rest arguments
+                 &aux result (error t) unused error-value)
+    (multiple-value-setq
+       (unused error-value)
+       (ignore-errors
+           (setq result (apply function arguments))
+           (setq error nil)
+       )
+    )
+    (if error
+       (format t "ERROR: (~S~{ ~S~}) => ~S~%" function arguments error-value)
+       (or (eq (null result) (null expect))
+           (format t "(~S~{ ~S~}) => should be ~A not ~A~%"
+               function arguments expect result
+           )
+       )
+    )
+)
+
+(defun bool-eval (expect form &aux result (error t) unused error-value)
+    (multiple-value-setq
+       (unused error-value)
+       (ignore-errors
+           (setq result (eval form))
+           (setq error nil)
+       )
+    )
+    (if error
+       (format t "ERROR: ~S => ~S~%" form error-value)
+       (or (eq (null result) (null expect))
+           (format t "~S => should be ~A not ~A~%"
+               form expect result
+           )
+       )
+    )
+)
+
+
+;; format                              - function
+
+;; ~c
+(format-test "A" "~C" #\A)
+(format-test " " "~C" #\Space)
+(format-test "A" "~:C" #\A)
+(format-test "Space" "~:C" #\Space)
+(format-test "#\\A" "~@C" #\A)
+(format-test "#\\Space" "~@C" #\Space)
+(format-test " " "~A" #\Space)
+(let ((*print-escape* t)) (format-test " " "~A" #\Space))
+(format-test "#\\Space" "~S" #\Space)
+(let ((*print-escape* nil)) (format-test "#\\Space" "~S" #\Space))
+
+;; ~%
+(format-test "
+" "~%")
+(format-test "
+
+
+" "~3%")
+
+;; ~&
+(format-test "" "~&")
+(format-test "
+" "~2&")
+
+;; ~|
+(format-test "\f" "~|")
+
+;; ~~
+(format-test "~~~" "~3~")
+
+;; radix
+(format-test "1101" "~,,' ,4:B" 13)
+(format-test "1 0001" "~,,' ,4:B" 17)
+(format-test "1101 0000 0101" "~14,,' ,4:B" 3333)
+(format-test "1 22" "~3,,,' ,2:R" 17)
+(format-test "6|55|35" "~,,'|,2:D" #xFFFF)
+(format-test "1,000,000" "~,,,3:D" 1000000)
+(format-test "one hundred and twenty-three thousand, four hundred and fifty-six"
+       "~R" 123456)
+(format-test "six hundred and fifty-four thousand, three hundred twenty-first"
+       "~:R" 654321)
+(format-test "MCCXXXIV" "~@R" 1234)
+(format-test "MCCXXXXVIIII" "~@:R" 1249)
+(format-test "3039" "~X" 12345)
+(format-test "30071" "~O" 12345)
+(format-test "9IX" "~36R" 12345)
+(format-test "11000000111001" "~B" 12345)
+(format-test "The answer is 5." "The answer is ~D." 5)
+(format-test "The answer is   5." "The answer is ~3D." 5)
+(format-test "The answer is 005." "The answer is ~3,'0D." 5)
+(format-test "1111 1010 1100 1110" "~,,' ,4:B" #xFACE)
+(format-test "1 1100 1110" "~,,' ,4:B" #x1CE)
+(format-test "1111 1010 1100 1110" "~19,,' ,4:B" #xFACE)
+(format-test "        1 1100 1110" "~19,,' ,4:B" #x1CE)
+
+;; 6.37 and 6.38 are correct
+#+xedit (format-test "6.38" "~4,2F" 6.375d0)
+(format-test "10.0" "~,1F" 9.995d0)
+;; 6.37E+2 and 6.38E+2 are correct
+#+xedit (format-test " 6.38E+2" "~8,2E" 637.5)
+(do*
+    (
+    (n '(3.14159 -3.14159 100.0 1234.0 0.006) (cdr n))
+    (r '("  3.14| 31.42|  3.14|3.1416|3.14|3.14159"
+        " -3.14|-31.42| -3.14|-3.142|-3.14|-3.14159"
+        "100.00|******|100.00| 100.0|100.00|100.0"
+        "1234.00|******|??????|1234.0|1234.00|1234.0"
+        "  0.01|  0.06|  0.01| 0.006|0.01|0.006") (cdr r))
+    (x (car n) (car n))
+    )
+    ((endp n))
+    (format-test (car r)
+       "~6,2F|~6,2,1,'*F|~6,2,,'?F|~6F|~,2F|~F" x x x x x x)
+)
+(do*
+    (
+    (n '(3.14159 -3.14159 1100.0 1.1e13 #+xedit 1.1e120) (cdr n))
+    (r '("  3.14E+0| 31.42$-01|+.003E+03|  3.14E+0"
+        " -3.14E+0|-31.42$-01|-.003E+03| -3.14E+0"
+        "  1.10E+3| 11.00$+02|+.001E+06|  1.10E+3"
+        "*********| 11.00$+12|+.001E+16| 1.10E+13"
+        #+xedit
+        "*********|??????????|%%%%%%%%%|1.10E+120") (cdr r))
+    (x (car n) (car n))
+    )
+    ((endp n))
+    (format-test (car r)
+       "~9,2,1,,'*E|~10,3,2,2,'?,,'$E|~9,3,2,-2,'%@E|~9,2E" x x x x)
+)
+(do
+    (
+    (k -5 (1+ k))
+    (r '("Scale factor -5: | 0.000003E+06|"
+        "Scale factor -4: | 0.000031E+05|"
+        "Scale factor -3: | 0.000314E+04|"
+        "Scale factor -2: | 0.003142E+03|"
+        "Scale factor -1: | 0.031416E+02|"
+        "Scale factor  0: | 0.314159E+01|"
+        "Scale factor  1: | 3.141590E+00|"
+        "Scale factor  2: | 31.41590E-01|"
+        "Scale factor  3: | 314.1590E-02|"
+        "Scale factor  4: | 3141.590E-03|"
+        "Scale factor  5: | 31415.90E-04|"
+        "Scale factor  6: | 314159.0E-05|"
+        "Scale factor  7: | 3141590.E-06|") (cdr r))
+    )
+    ((endp r))
+    (format-test (car r) "Scale factor ~2D: | ~12,6,2,VE|" k k 3.14159)
+)
+(do*
+    (
+    (n '(0.0314159 0.314159 3.14159 31.4159 314.159 3141.59 3.14E12
+        #+xedit 3.14d120) (cdr n))
+    (r '("  3.14E-2|314.2$-04|0.314E-01|  3.14E-2"
+         "  0.31   |0.314    |0.314    | 0.31    "
+         "   3.1   | 3.14    | 3.14    |  3.1    "
+         "   31.   | 31.4    | 31.4    |  31.    "
+         "  3.14E+2| 314.    | 314.    |  3.14E+2"
+         "  3.14E+3|314.2$+01|0.314E+04|  3.14E+3"
+         "*********|314.0$+10|0.314E+13| 3.14E+12"
+         #+xedit "*********|?????????|%%%%%%%%%|3.14E+120") (cdr r))
+    (x (car n) (car n))
+    )
+    ((endp n))
+    (format-test (car r) "~9,2,1,,'*G|~9,3,2,3,'?,,'$G|~9,3,2,0,'%G|~9,2G"
+       x x x x)
+)
+(format-test "  1." "~4,0f" 0.5)
+(format-test "  0." "~4,0f" 0.4)
+
+;; ~p
+(setq n 3)
+(format-test "3 items found.""~D item~:P found." n)
+(format-test "three dogs are here." "~R dog~:[s are~; is~] here." n (= n 1))
+(format-test "three dogs are here." "~R dog~:*~[s are~; is~:;s are~] here." n)
+(format-test "Here are three puppies.""Here ~[are~;is~:;are~] ~:*~R pupp~:@P." n)
+(format-test "7 tries/1 win" "~D tr~:@P/~D win~:P" 7 1)
+(format-test "1 try/0 wins" "~D tr~:@P/~D win~:P" 1 0)
+(format-test "1 try/3 wins" "~D tr~:@P/~D win~:P" 1 3)
+
+;; ~t
+(format-test "        foo" "~8Tfoo")
+#+xedit (format-test  "         foo" "~8,3Tfoo")
+(format-test "         foo" "~8,3@Tfoo")
+(format-test "   foo" "~1,3@Tfoo")
+
+;; ~*
+(format-test "2" "~*~D" 1 2 3 4)
+(format-test "4" "~3*~D" 1 2 3 4)
+(format-test "2" "~3*~2:*~D" 1 2 3 4)
+(format-test "4 3 2 1 2 3 4" "~3@*~D ~2@*~D ~1@*~D ~0@*~D ~D ~D ~D" 1 2 3 4)
+
+;; ~?
+(format-test "<Foo 5> 7" "~? ~D" "<~A ~D>" '("Foo" 5) 7)
+(format-test "<Foo 5> 7" "~? ~D" "<~A ~D>" '("Foo" 5 14) 7)
+(format-test "<Foo 5> 7" "~@? ~D" "<~A ~D>" "Foo" 5 7)
+(format-test "<Foo 5> 14" "~@? ~D" "<~A ~D>" "Foo" 5 14 7)
+
+
+(format-error "~:[abc~:@(def~;ghi~:@(jkl~]mno~)" 1)
+(format-error "~?ghi~)" "abc~@(def")
+
+
+;; ~(...~)
+(format-test "XIV xiv" "~@R ~(~@R~)" 14 14)
+(format-test "Zero errors detected." "~@(~R~) error~:P detected." 0)
+(format-test "One error detected." "~@(~R~) error~:P detected." 1)
+(format-test "Twenty-three errors detected." "~@(~R~) error~:P detected." 23)
+
+;; ~[...~]
+(format-test "Persian Cat" "~[Siamese~;Manx~;Persian~] Cat" 2)
+(format-test " Cat" "~[Siamese~;Manx~;Persian~] Cat" 3)
+(format-test "Siamese Cat" "~[Siamese~;Manx~;Persian~] Cat" 0)
+(setq *print-level* nil *print-length* 5)
+(format-test " print length = 5"
+  "~@[ print level = ~D~]~@[ print length = ~D~]" *print-level* *print-length*)
+(setq foo "Items:~#[ none~; ~S~; ~S and ~S~:;~@{ ~#[~;and ~]~S~^,~}~].")
+(format-test "Items: none." foo)
+(format-test "Items: FOO." foo 'foo)
+(format-test "Items: FOO and BAR." foo 'foo 'bar)
+(format-test "Items: FOO, BAR, and BAZ." foo 'foo 'bar 'baz)
+(format-test "Items: FOO, BAR, BAZ, and QUUX." foo 'foo 'bar 'baz 'quux)
+
+;; ~{...~}
+(format-test "The winners are: FRED HARRY JILL."
+  "The winners are:~{ ~S~}." '(fred harry jill))
+(format-test "Pairs: <A,1> <B,2> <C,3>." "Pairs:~{ <~S,~S>~}." '(a 1 b 2 c 3))
+(format-test "Pairs: <A,1> <B,2> <C,3>."
+  "Pairs:~:{ <~S,~S>~}." '((a 1) (b 2) (c 3)))
+(format-test "Pairs: <A,1> <B,2> <C,3>."
+  "Pairs:~:@{ <~S,~S>~}." '(a 1) '(b 2) '(c 3))
+
+;; ~<...~>
+(format-test "foo    bar" "~10<foo~;bar~>")
+(format-test "  foo  bar" "~10:<foo~;bar~>")
+(format-test "  foo bar " "~10:@<foo~;bar~>")
+(format-test "    foobar" "~10<foobar~>")
+(format-test "    foobar" "~10:<foobar~>")
+(format-test "foobar    " "~10@<foobar~>")
+(format-test "  foobar  " "~10:@<foobar~>")
+
+;; ~^
+(setq donestr "Done.~^  ~D warning~:P.~^  ~D error~:P.")
+(format-test "Done." donestr)
+(format-test "Done.  3 warnings." donestr 3)
+(format-test "Done.  1 warning.  5 errors." donestr 1 5)
+(format-test "/HOT .../HAMBURGER/ICE .../FRENCH ..."
+  "~:{/~S~^ ...~}" '((hot dog) (hamburger) (ice cream) (french fries)))
+(format-test "/HOT .../HAMBURGER .../ICE .../FRENCH"
+  "~:{/~S~:^ ...~}" '((hot dog) (hamburger) (ice cream) (french fries)))
+(format-test "/HOT .../HAMBURGER"
+  "~:{/~S~:#^ ...~}" '((hot dog) (hamburger) (ice cream) (french fries)))
+(setq tellstr "~@(~@[~R~]~^ ~A.~)")
+(format-test "Twenty-three" tellstr 23)
+(format-test " Losers." tellstr nil "losers")
+(format-test "Twenty-three losers." tellstr 23 "losers")
+(format-test "            FOO" "~15<~S~;~^~S~;~^~S~>" 'foo)
+(format-test "FOO         BAR" "~15<~S~;~^~S~;~^~S~>" 'foo 'bar)
+(format-test "FOO   BAR   BAZ" "~15<~S~;~^~S~;~^~S~>" 'foo 'bar 'baz)
+
+
+;; make-pathname                       - function
+(equal-test #P"/public/games/chess.db"
+    #'make-pathname :directory '(:absolute "public" "games")
+                   :name "chess" :type "db")
+(equal-test #P"/etc/passwd" #'list* #P"/etc/passwd")
+(setq path (make-pathname :directory '(:absolute "public" "games")
+                         :name "chess" :type "db"))
+(eq-test path #'pathname path)
+(eq-test nil #'pathname-host path)
+(eq-test nil #'pathname-device path)
+(equal-test '(:absolute "public" "games") #'pathname-directory path)
+(equal-test "chess" #'pathname-name path)
+(equal-test "db" #'pathname-type path)
+(eq-test nil #'pathname-version path)
+(equal-test #P"/tmp/foo.txt" #'make-pathname :defaults "/tmp/foo.txt")
+
+#+xedit (equal-test #P"/tmp/foo.txt" #'pathname "///tmp///foo.txt")
+;; XXX changed to remove extra separators
+;; (equal-test #P"///tmp///foo.txt" #'pathname "///tmp///foo.txt")
+
+
+;; merge-pathnames                     - function
+(equal-test #P"/tmp/foo.txt" #'merge-pathnames "/tmp/foo" "/tmp/foo.txt")
+(equal-test #P"/tmp/foo.txt" #'merge-pathnames "foo" "/tmp/foo.txt")
+(equal-test #P"/tmp/foo/bar.txt" #'merge-pathnames "foo/bar" "/tmp/foo.txt")
+
+;; namestring                          - function
+(setq path (merge-pathnames "foo/bar" "/tmp/foo.txt"))
+(equal-test "/tmp/foo/bar.txt" #'namestring path)
+(equal-test "" #'host-namestring path)
+(equal-test "/tmp/foo/" #'directory-namestring path)
+(equal-test "bar.txt" #'file-namestring path)
+(equal-test "/tmp/foo/bar.txt" #'enough-namestring path)
+(equal-test "foo/bar.txt" #'enough-namestring path "/tmp/")
+(equal-test "bar.txt" #'enough-namestring path "/tmp/foo/")
+(equal-test "foo/bar.txt" #'enough-namestring path "/tmp/foo")
+
+;; parse-namestring                    - function
+(equal-eval '(#P"foo" 3) '(multiple-value-list (parse-namestring "foo")))
+(equal-eval '(#P"foo" 0) '(multiple-value-list (parse-namestring #P"foo")))
+
+
+
+;; read                                        - function
+(setq is (make-string-input-stream " foo "))
+(eq-test t #'streamp is)
+(eq-test t #'input-stream-p is)
+(eq-test nil #'output-stream-p is)
+(eq-test 'foo #'read is)
+(eq-test t #'close is)
+(setq is (make-string-input-stream "xfooy" 1 4))
+(eq-test 'foo #'read is)
+(eq-test t #'close is)
+(setq is (make-string-input-stream ""))
+(eq-test nil #'read is nil)
+(eq-test 'end-of-string #'read is nil 'end-of-string)
+(close is)
+(error-test #'read is)
+(error-test #'read is nil)
+(error-test #'read is nil 'end-of-string)
+(eq-test t #'streamp is)
+(eq-test nil #'input-stream-p is)
+(eq-test nil #'streamp "test")
+(error-test #'input-stream-p "test")
+
+;; read-char                           - function
+(setq is (make-string-input-stream "0123"))
+(setq test nil)
+(equal-eval '(#\0 #\1 #\2 #\3)
+  '(do ((c (read-char is) (read-char is nil 'the-end)))
+      ((not (characterp c)) test)
+   (setq test (append test (list c)))))
+(close is)
+(setq is (make-string-input-stream "abc"))
+(eql-test #\a #'read-char is)
+(eql-test #\b #'read-char is)
+(eql-test #\c #'read-char is)
+(error-test #'read-char is)
+(eq-test nil #'read-char is nil)
+(eq-test :end-of-string #'read-char is nil :end-of-string)
+(eq-test t #'close is)
+
+;; read-char-no-hang                   - function
+(setq is (make-string-input-stream "0123"))
+(setq test nil)
+(equal-eval '(#\0 #\1 #\2 #\3)
+  '(do ((c (read-char-no-hang is) (read-char-no-hang is nil 'the-end)))
+      ((not (characterp c)) test)
+   (setq test (append test (list c)))))
+(close is)
+(setq is (make-string-input-stream "abc"))
+(eql-test #\a #'read-char-no-hang is)
+(eql-test #\b #'read-char-no-hang is)
+(eql-test #\c #'read-char-no-hang is)
+(error-test #'read-char-no-hang is)
+(eq-test nil #'read-char-no-hang is nil)
+(eq-test :end-of-string #'read-char-no-hang is nil :end-of-string)
+(eq-test t #'close is)
+#+(and xedit unix)
+(progn
+    ;; wait one second for input pooling every 0.1 seconds
+    (defun wait-for-cat ()
+       (let ((time 0.0))
+           (loop
+               (and (listen is) (return))
+               (sleep 0.1)
+               (when (>= (incf time 0.1) 1.0)
+                   (format t "Cat is sleeping~%")
+                   (return)))))
+    (setq is (make-pipe "/bin/cat" :direction :io))
+    (equal-test "dog" #'write-line "dog" is)
+    (wait-for-cat)
+    (eql-test #\d #'read-char-no-hang is)
+    (eql-test #\o #'read-char-no-hang is)
+    (eql-test #\g #'read-char-no-hang is)
+    (eql-test #\Newline #'read-char-no-hang is)
+    (eq-test nil #'read-char-no-hang is)
+    (eq-test nil #'read-char-no-hang is)
+    (equal-test "mouse" #'write-line "mouse" is)
+    (wait-for-cat)
+    (eql-test #\m #'read-char-no-hang is)
+    (eql-test #\o #'read-char-no-hang is)
+    (eql-test #\u #'read-char-no-hang is)
+    (eql-test #\s #'read-char-no-hang is)
+    (eql-test #\e #'read-char-no-hang is)
+    (eql-test #\Newline #'read-char-no-hang is)
+    (eq-test nil #'read-char-no-hang is)
+    (eq-test t #'close is)
+    (error-test #'read-char-no-hang is)
+    (error-test #'read-char-no-hang is nil)
+    (error-test #'read-char-no-hang is nil t)
+)
+
+;; read-from-string                    - function
+(equal-eval '(3 5)
+  '(multiple-value-list (read-from-string " 1 3 5" t nil :start 2)))
+(equal-eval '((a b c) 7)
+  '(multiple-value-list (read-from-string "(a b c)")))
+(error-test #'read-from-string "")
+(eq-test nil #'read-from-string "" nil)
+(eq-test 'end-of-file #'read-from-string "" nil 'end-of-file)
+
+;; read-line                           - function
+(setq is (make-string-input-stream "line 1
+line 2"))
+(equal-eval '("line 1" nil) '(multiple-value-list (read-line is)))
+(equal-eval '("line 2" t) '(multiple-value-list (read-line is)))
+(error-test #'read-line is)
+(equal-eval '(nil t) '(multiple-value-list (read-line is nil)))
+(equal-eval '(end-of-string t)
+  '(multiple-value-list (read-line is nil 'end-of-string)))
+
+
+;; write                               - function
+;; XXX several write options still missing
+(setq os (make-string-output-stream))
+(equal-test '(1 2 3 4) #'write '(1 2 3 4) :stream os)
+(equal-test "(1 2 3 4)" #'get-output-stream-string os)
+(eq-test t #'streamp os)
+(eq-test t #'output-stream-p os)
+(eq-test nil #'input-stream-p os)
+(equal-test '(:foo :bar) #'write '(:foo :bar) :case :downcase :stream os)
+(equal-test "(:foo :bar)" #'get-output-stream-string os)
+(equal-test '(:foo :bar) #'write '(:foo :bar) :case :capitalize :stream os)
+(equal-test "(:Foo :Bar)" #'get-output-stream-string os)
+(equal-test '(:foo :bar) #'write '(:foo :bar) :case :upcase :stream os)
+(equal-test "(:FOO :BAR)" #'get-output-stream-string os)
+(equal-test '(foo bar baz) #'write '(foo bar baz) :length 2 :stream os)
+(equal-test "(FOO BAR ...)" #'get-output-stream-string os)
+(equal-test '(foo (bar) baz) #'write '(foo (bar) baz) :level 1 :stream os)
+(equal-test "(FOO # BAZ)" #'get-output-stream-string os)
+(setq circle '#1=(1 #1#))
+(eq-test circle #'write circle :circle t :stream os)
+(equal-test "#1=(1 #1#)" #'get-output-stream-string os)
+(eql-test #\Space #'write #\Space :stream os)
+(equal-test "#\\Space" #'get-output-stream-string os)
+(eql-test #\Space #'write #\Space :escape nil :stream os)
+(equal-test " " #'get-output-stream-string os)
+(eq-test t #'close os)
+(eq-test nil #'output-stream-p os)
+(error-test #'output-stream-p "test")
+(error-test #'write 'foo :stream "bar")
+
+;; fresh-line                          - function
+(setq os (make-string-output-stream))
+(equal-test "some text" #'write-string "some text" os)
+(eq-test t #'fresh-line os)
+(eq-test nil #'fresh-line os)
+(equal-test "more text" #'write-string "more text" os)
+(equal-test "some text
+more text" #'get-output-stream-string os)
+(equal-test nil #'fresh-line os)
+(equal-test nil #'fresh-line os)
+(equal-test "" #'get-output-stream-string os)
+(close os)
+(error-test #'fresh-line 1)
+
+;; prin1                               - function
+;;  (prin1 object stream) ==
+;;     (write object :stream stream :escape t)
+(setq p-os (make-string-output-stream) w-os (make-string-output-stream))
+(dolist (object (list #\a 1 "string" 2.5d0 '(a . b) '(a b c) #P"foo"
+                    *package* *standard-input* #c(1 2) #(1 2 3)
+                    (make-hash-table)))
+    (eq-test object #'prin1 object p-os)
+    (eq-test object #'write object :stream w-os :escape t)
+    (equal-test (get-output-stream-string p-os)
+       #'get-output-stream-string w-os))
+(close p-os)
+(close w-os)
+(error-test #'prin1 1 1)
+
+;; princ                               - function
+;;  (princ object stream) ==
+;;     (write object :stream stream :escape nil :readably nil)
+;; XXX readably not yet implemented
+(setq p-os (make-string-output-stream) w-os (make-string-output-stream))
+(dolist (object (list #\a 1 "string" 2.5d0 '(a . b) '(a b c) #P"foo"
+                    *package* *standard-input* #c(1 2) #(1 2 3)
+                    (make-hash-table)))
+    (eq-test object #'princ object p-os)
+    (eq-test object #'write object :stream w-os :escape nil)
+    (equal-test (get-output-stream-string p-os)
+       #'get-output-stream-string w-os))
+(close p-os)
+(close w-os)
+(error-test #'princ 1 1)
+
+;; print                               - function
+;;  (print object stream) ==
+;;     (progn
+;;         (terpri stream)
+;;         (write object :stream stream :escape t)
+;;         (write-char #\Space stream))
+(setq p-os (make-string-output-stream) w-os (make-string-output-stream))
+(dolist (object (list #\a 1 "string" 2.5d0 '(a . b) '(a b c) #P"foo"
+                    *package* *standard-input* #c(1 2) #(1 2 3)
+                    (make-hash-table)))
+    (eq-test object #'print object p-os)
+    (progn
+       (eq-test nil #'terpri w-os)
+       (eq-test object #'write object :stream w-os :escape t)
+       (eql-test #\Space #'write-char #\Space w-os))
+    (equal-test (get-output-stream-string p-os)
+       #'get-output-stream-string w-os))
+(close p-os)
+(close w-os)
+(error-test #'print 1 1)
+
+;; terpri                              - function
+(setq os (make-string-output-stream))
+(equal-test "some text" #'write-string "some text" os)
+(eq-test nil #'terpri os)
+(eq-test nil #'terpri os)
+(equal-test "more text" #'write-string "more text" os)
+(equal-test "some text
+
+more text" #'get-output-stream-string os)
+(equal-test nil #'terpri os)
+(equal-test nil #'terpri os)
+(equal-test "
+
+" #'get-output-stream-string os)
+(close os)
+(error-test #'terpri 1)
+
+;; write-char                          - function
+(equal-eval "a b"
+    '(with-output-to-string (s) 
+       (write-char #\a s)
+       (write-char #\Space s)
+       (write-char #\b s)))
+(error-test #'write-char 1)
+
+;; write-line                          - function
+(setq os (make-string-output-stream))
+(equal-test "text" #'write-line "text" os)
+(equal-test "text
+" #'get-output-stream-string os)
+(eql-test #\< #'write-char #\< os)
+(equal-test "text" #'write-line "text" os :start 1 :end 3)
+(eql-test #\> #'write-char #\> os)
+(equal-test "<ex
+>" #'get-output-stream-string os)
+(error-test #'write-line 1)
+(close os)
+
+;; write-string                                - function
+(setq os (make-string-output-stream))
+(equal-test "text" #'write-string "text" os)
+(equal-test "text" #'get-output-stream-string os)
+(eql-test #\< #'write-char #\< os)
+(equal-test "text" #'write-string "text" os :start 1 :end 3)
+(eql-test #\> #'write-char #\> os)
+(equal-test "<ex>" #'get-output-stream-string os)
+(error-test #'write-string #\a)
+(close os)
+
+
+;; open                                        - function
+(setq name #P"delete-me.text")
+(bool-eval t '(setq file (open name :direction :output)))
+(equal-test "some text" #'write-line "some text" file)
+(close file)
+(equal-test "delete-me.text" #'file-namestring (truename name))
+(setq file (open name :direction :output :if-exists :rename))
+(equal-test "other text" #'write-line "other text" file)
+(close file)
+(equal-test "delete-me.text" #'file-namestring (truename name))
+;; Clisp returns the pathname if the file exists
+#+xedit (eq-test t #'delete-file name)
+#+clisp (bool-test t #'delete-file name)
+(setq backup
+       #+xedit "delete-me.text~"
+       #+clisp "delete-me.text%"
+       #+cmu "delete-me.text.BAK")
+(bool-test t #'delete-file backup)
+(eq-test nil #'delete-file name)
+(eq-test nil #'directory name)
+(eq-test nil #'directory backup)
+;; test append
+(with-open-file (s name :direction :output :if-exists :error)
+    (write-line "line 1" s))
+(with-open-file (s name :direction :output :if-exists :append)
+    (write-line "line 2" s))
+(with-open-file (s name :direction :input)
+    (equal-test "line 1" #'read-line s)
+    (equal-test "line 2" #'read-line s)
+    (eq-test 'eof #'read-line s nil 'eof)
+)
+(bool-test t #'delete-file name)
+;; test overwrite
+(with-open-file (s name :direction :output :if-exists :error)
+    (write-line "overwrite-me" s))
+(with-open-file (s name :direction :output :if-exists :overwrite)
+    (write-line "some-text" s))
+(with-open-file (s name :direction :input)
+    (equal-test "some-text" #'read-line s)
+    (eq-test 'eof #'read-line s nil 'eof))
+;; test check for file existence
+(eq-test nil #'open name :direction :output :if-exists nil)
+(error-test #'open name :direction :output :if-exists :error)
+(bool-test t #'delete-file name)
+;; test check for no file existence
+(eq-test nil #'open name :direction :output :if-does-not-exist nil)
+(error-test #'open name :direction :output :if-does-not-exist :error)
+#+xedit        ;; test io -- not sure if this is the expected behaviour
+(progn
+    (with-open-file (s name :direction :io)
+       (write-line "foo" s)
+       (write-line "bar" s))
+    (with-open-file (s name :direction :io :if-exists :append)
+       (equal-test "foo" #'read-line s)
+       (equal-test "bar" #'read-line s)
+       (eq-test 'eof #'read-line s nil 'eof)
+       (write-line "baz" s))
+    (with-open-file (s name :direction :io :if-exists :append)
+       (equal-test "foo" #'read-line s)
+       (equal-test "bar" #'read-line s)
+       (equal-test "baz" #'read-line s)
+       (eq-test 'eof #'read-line s nil 'eof))
+    (bool-test t #'delete-file name)
+)
+
+;; delete-file                         - function
+(eq-eval nil
+    '(with-open-file (s "delete-me.text" :direction :output :if-exists :error)))
+(eq-test t #'pathnamep (setq p (probe-file "delete-me.text")))
+(bool-test t #'delete-file p)
+(eq-test nil #'probe-file "delete-me.text")
+(bool-eval t
+    '(with-open-file (s "delete-me.text" :direction :output :if-exists :error)
+       (delete-file s)))
+(bool-test nil #'probe-file "delete-me.text")
+
+;; rename-file                         - function
+(setq name "foo.bar")
+(bool-eval t '(setq file (open name :direction :output :if-exists :error)))
+(eq-test t #'close file)
+(setq result (multiple-value-list (rename-file name "bar.foo")))
+(eql-test 3 #'length result)
+(eq-test t #'pathnamep (first result))
+(eq-test t #'pathnamep (second result))
+(eq-test t #'pathnamep (third result))
+(equal-test (third result) #'truename "bar.foo")
+(eq-test nil #'directory name)
+(eq-test nil #'directory (second result))
+(equal-test (list (third result)) #'directory (third result))
+(error-test #'truename name)
+(error-test #'truename (second result))
+(eq-test nil #'probe-file name)
+(bool-test t #'probe-file (first result))
+(eq-test nil #'probe-file (second result))
+(bool-test t #'probe-file (third result))
+(bool-test t #'delete-file "bar.foo")
+(eq-test nil #'delete-file (third result))
+(eq-test nil #'delete-file (second result))
diff --git a/xedit/lisp/test/widgets.lsp b/xedit/lisp/test/widgets.lsp
new file mode 100644 (file)
index 0000000..9624720
--- /dev/null
@@ -0,0 +1,71 @@
+;;
+;; Copyright (c) 2001 by The XFree86 Project, Inc.
+;;
+;; 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.
+;;
+;; Author: Paulo César Pereira de Andrade
+;;
+;;
+;; $XFree86: xc/programs/xedit/lisp/test/widgets.lsp,v 1.1 2001/08/31 15:00:15 paulo Exp $
+;;
+(require "xaw")
+(require "xt")
+
+(defun quit-callback (widget user call) (quit))
+
+(setq toplevel
+    (xt-app-initialize 'appcontext "Widgets"
+       '(("title" . "Widgets (without customization)"))))
+
+(setq vpane
+    (xt-create-managed-widget "vpane" paned-widget-class toplevel))
+(setq form
+    (xt-create-managed-widget "form" form-widget-class vpane))
+(xt-create-managed-widget "command" command-widget-class form
+    '(("label" . "Command Widget")))
+(xt-create-managed-widget "label" label-widget-class form
+    '(("label" . "Label Widget") ("fromVert" . "command")))
+(xt-create-managed-widget "button" menu-button-widget-class form
+    '(("label" . "MenuButton Widget") ("fromVert" . "label")))
+
+(setq popup
+    (xt-create-managed-widget "menu" simple-menu-widget-class toplevel))
+(xt-create-managed-widget "smebsb" sme-bsb-object-class popup
+    '(("label" . "SmeBSB Object")))
+(xt-create-managed-widget "smeline" sme-line-object-class popup)
+(xt-create-managed-widget "smebsb2" sme-bsb-object-class popup
+    '(("label" . "SmeBSB Object two")))
+
+(xt-create-managed-widget "toggle" toggle-widget-class form
+    '(("label" . "Toggle Widget") ("fromVert" . "button")))
+(xt-create-managed-widget "repeater" repeater-widget-class form
+    '(("label" . "Repeater Widget") ("fromVert" . "toggle")))
+
+(setq quit
+    (xt-create-managed-widget "quit" command-widget-class vpane
+       '(("label" . "Quit"))))
+(xt-add-callback quit "callback" 'quit-callback)
+
+(xt-realize-widget toplevel)
+(xt-app-main-loop appcontext)
diff --git a/xedit/lisp/time.c b/xedit/lisp/time.c
new file mode 100644 (file)
index 0000000..763ca58
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/time.c,v 1.9tsi Exp $ */
+
+#include "lisp/time.h"
+#include "lisp/bytecode.h"
+
+/*
+ * Implementation
+*/
+LispObj *
+Lisp_Time(LispBuiltin *builtin)
+/*
+ time form
+ */
+{
+#ifndef __UNIXOS2__
+    struct itimerval real, virt, prof;
+    unsigned long count;
+    long sec, usec;
+    LispObj *result;
+#define MONTH  60 * 60 * 31
+
+    LispObj *form;
+
+    form = ARGUMENT(0);
+
+    real.it_value.tv_sec =
+       virt.it_value.tv_sec =
+       prof.it_value.tv_sec =
+       real.it_interval.tv_sec =
+       virt.it_interval.tv_sec =
+       prof.it_interval.tv_sec = MONTH;
+    real.it_value.tv_usec =
+       virt.it_value.tv_usec =
+       prof.it_value.tv_usec =
+       real.it_interval.tv_usec =
+       virt.it_interval.tv_usec =
+       prof.it_interval.tv_usec = 0;
+
+    setitimer(ITIMER_REAL, &real, NULL);
+    setitimer(ITIMER_VIRTUAL, &virt, NULL);
+    setitimer(ITIMER_PROF, &prof, NULL);
+
+    getitimer(ITIMER_REAL, &real);
+    getitimer(ITIMER_VIRTUAL, &virt);
+    getitimer(ITIMER_PROF, &prof);
+
+    lisp__data.gc.gctime = 0;
+    lisp__data.gc.timebits = 1;
+
+    count = lisp__data.gc.count;
+
+#if 0
+    form = CONS(form, NIL);
+    COD = CONS(form, COD);
+    result = LispExecuteBytecode(LispCompileForm(form));
+#else
+    result = EVAL(form);
+#endif
+
+    getitimer(ITIMER_REAL, &real);
+    getitimer(ITIMER_VIRTUAL, &virt);
+    getitimer(ITIMER_PROF, &prof);
+
+    sec = real.it_interval.tv_sec - real.it_value.tv_sec;
+    usec = real.it_interval.tv_usec - real.it_value.tv_usec;
+    if (usec < 0) {
+       --sec;
+       usec += 1000000;
+    }
+    LispMessage("Real time   : %g sec", sec + usec / 1000000.0);
+
+    sec = virt.it_interval.tv_sec - virt.it_value.tv_sec;
+    usec = virt.it_interval.tv_usec - virt.it_value.tv_usec + 10000;
+    if (usec < 0) {
+       --sec;
+       usec += 1000000;
+    }
+    LispMessage("Virtual time: %g sec", sec + usec / 1000000.0);
+
+    sec = prof.it_interval.tv_sec - prof.it_value.tv_sec;
+    usec = prof.it_interval.tv_usec - prof.it_value.tv_usec + 10000;
+    if (usec < 0) {
+       --sec;
+       usec += 1000000;
+    }
+    LispMessage("Profile time: %g sec", sec + usec / 1000000.0);
+
+    real.it_value.tv_sec =
+       virt.it_value.tv_sec =
+       prof.it_value.tv_sec =
+       real.it_interval.tv_sec =
+       virt.it_interval.tv_sec =
+       prof.it_interval.tv_sec =
+       real.it_value.tv_usec =
+       virt.it_value.tv_usec =
+       prof.it_value.tv_usec =
+       real.it_interval.tv_usec =
+       virt.it_interval.tv_usec =
+       prof.it_interval.tv_usec = 0;
+
+    setitimer(ITIMER_REAL, &real, NULL);
+    setitimer(ITIMER_VIRTUAL, &virt, NULL);
+    setitimer(ITIMER_PROF, &prof, NULL);
+
+    LispMessage("GC: %ld times, %g sec",
+               lisp__data.gc.count - count, lisp__data.gc.gctime / 1000000.0);
+    lisp__data.gc.timebits = 0;
+
+    return (result);
+#else
+    LispMessage("\"Lisp_Time\" not implemented under OS/2");
+    return (NIL);
+#endif
+}
diff --git a/xedit/lisp/time.h b/xedit/lisp/time.h
new file mode 100644 (file)
index 0000000..ab3dcd3
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/time.h,v 1.3tsi Exp $ */
+
+#ifndef Lisp_time_h
+#define Lisp_time_h
+
+#include "lisp/private.h"
+
+LispObj *Lisp_Time(LispBuiltin*);
+
+#endif /* Lisp_time_h */
diff --git a/xedit/lisp/write.c b/xedit/lisp/write.c
new file mode 100644 (file)
index 0000000..6c7d979
--- /dev/null
@@ -0,0 +1,2406 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/write.c,v 1.31tsi Exp $ */
+
+#include "lisp/write.h"
+#include "lisp/hash.h"
+#include <math.h>
+#include <ctype.h>
+
+#define        FLOAT_PREC      17
+
+#define UPCASE         0
+#define DOWNCASE       1
+#define CAPITALIZE     2
+
+#define INCDEPTH()                                                     \
+    if (++info->depth > MAX_STACK_DEPTH / 2)                           \
+       LispDestroy("stack overflow")
+#define DECDEPTH()     --info->depth
+
+/*
+ * Types
+ */
+typedef struct _circle_info {
+    long circle_nth;           /* nth circular list */
+    LispObj *object;           /* the circular object */
+} circle_info;
+
+typedef struct _write_info {
+    long depth;
+    long level;                        /* current level */
+    long length;               /* current length */
+    long print_level;          /* *print-level* when started printing */
+    long print_length;         /* *print-length* when started printing */
+
+    int print_escape;
+    int print_case;
+
+    long circle_count;
+    /* used while building circle info */
+    LispObj **objects;
+    long num_objects;
+    /* the circular lists */
+    circle_info *circles;
+    long num_circles;
+} write_info;
+
+/*
+ * Prototypes
+ */
+static void check_stream(LispObj*, LispFile**, LispString**, int);
+static void parse_double(char*, int*, double, int);
+static int float_string_inc(char*, int);
+static void format_integer(char*, long, int);
+static int LispWriteCPointer(LispObj*, void*);
+static int LispWriteCString(LispObj*, char*, long, write_info*);
+static int LispDoFormatExponentialFloat(LispObj*, LispObj*,
+                                       int, int, int*, int, int,
+                                       int, int, int, int);
+
+static int LispWriteInteger(LispObj*, LispObj*);
+static int LispWriteCharacter(LispObj*, LispObj*, write_info*);
+static int LispWriteString(LispObj*, LispObj*, write_info*);
+static int LispWriteFloat(LispObj*, LispObj*);
+static int LispWriteAtom(LispObj*, LispObj*, write_info*);
+static int LispDoWriteAtom(LispObj*, char*, int, int);
+static int LispWriteList(LispObj*, LispObj*, write_info*, int);
+static int LispWriteArray(LispObj*, LispObj*, write_info*);
+static int LispWriteStruct(LispObj*, LispObj*, write_info*);
+static int LispDoWriteObject(LispObj*, LispObj*, write_info*, int);
+static void LispBuildCircle(LispObj*, write_info*);
+static void LispDoBuildCircle(LispObj*, write_info*);
+static long LispCheckCircle(LispObj*, write_info*);
+static int LispPrintCircle(LispObj*, LispObj*, long, int*, write_info*);
+static int LispWriteAlist(LispObj*, LispArgList*, write_info*);
+
+/*
+ * Initialization
+ */
+LispObj *Oprint_level, *Oprint_length, *Oprint_circle,
+       *Oprint_escape, *Oprint_case;
+LispObj *Kupcase, *Kdowncase, *Kcapitalize;
+
+/*
+ * Implementation
+ */
+void
+LispWriteInit(void)
+{
+    Oprint_level       = STATIC_ATOM("*PRINT-LEVEL*");
+    LispProclaimSpecial(Oprint_level, NIL, NIL);
+    LispExportSymbol(Oprint_level);
+
+    Oprint_length      = STATIC_ATOM("*PRINT-LENGTH*");
+    LispProclaimSpecial(Oprint_length, NIL, NIL);
+    LispExportSymbol(Oprint_length);
+
+    Oprint_circle      = STATIC_ATOM("*PRINT-CIRCLE*");
+    LispProclaimSpecial(Oprint_circle, T, NIL);
+    LispExportSymbol(Oprint_circle);
+
+    Oprint_escape      = STATIC_ATOM("*PRINT-ESCAPE*");
+    LispProclaimSpecial(Oprint_escape, T, NIL);
+    LispExportSymbol(Oprint_escape);
+
+    Kupcase            = KEYWORD("UPCASE");
+    Kdowncase          = KEYWORD("DOWNCASE");
+    Kcapitalize                = KEYWORD("CAPITALIZE");
+    Oprint_case                = STATIC_ATOM("*PRINT-CASE*");
+    LispProclaimSpecial(Oprint_case, Kupcase, NIL);
+    LispExportSymbol(Oprint_case);
+}
+
+LispObj *
+Lisp_FreshLine(LispBuiltin *builtin)
+/*
+ fresh-line &optional output-stream
+ */
+{
+    LispObj *output_stream;
+
+    output_stream = ARGUMENT(0);
+
+    if (output_stream == UNSPEC)
+       output_stream = NIL;
+    else if (output_stream != NIL) {
+       CHECK_STREAM(output_stream);
+    }
+    if (LispGetColumn(output_stream)) {
+       LispWriteChar(output_stream, '\n');
+       if (output_stream == NIL ||
+           (output_stream->data.stream.type == LispStreamStandard &&
+            output_stream->data.stream.source.file == Stdout))
+           LispFflush(Stdout);
+       return (T);
+    }
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_Prin1(LispBuiltin *builtin)
+/*
+ prin1 object &optional output-stream
+ */
+{
+    LispObj *object, *output_stream;
+
+    output_stream = ARGUMENT(1);
+    object = ARGUMENT(0);
+
+    if (output_stream == UNSPEC)
+       output_stream = NIL;
+    LispPrint(object, output_stream, 0);
+
+    return (object);
+}
+
+LispObj *
+Lisp_Princ(LispBuiltin *builtin)
+/*
+ princ object &optional output-stream
+ */
+{
+    int head;
+    LispObj *object, *output_stream;
+
+    output_stream = ARGUMENT(1);
+    object = ARGUMENT(0);
+
+    if (output_stream == UNSPEC)
+       output_stream = NIL;
+    head = lisp__data.env.length;
+    LispAddVar(Oprint_escape, NIL);
+    ++lisp__data.env.head;
+    LispPrint(object, output_stream, 0);
+    lisp__data.env.head = lisp__data.env.length = head;
+
+    return (object);
+}
+
+LispObj *
+Lisp_Print(LispBuiltin *builtin)
+/*
+ print object &optional output-stream
+ */
+{
+    LispObj *object, *output_stream;
+
+    output_stream = ARGUMENT(1);
+    object = ARGUMENT(0);
+
+    if (output_stream == UNSPEC)
+       output_stream = NIL;
+    LispWriteChar(output_stream, '\n');
+    LispPrint(object, output_stream, 0);
+    LispWriteChar(output_stream, ' ');
+
+    return (object);
+}
+
+LispObj *
+Lisp_Terpri(LispBuiltin *builtin)
+/*
+ terpri &optional output-stream
+ */
+{
+    LispObj *output_stream;
+
+    output_stream = ARGUMENT(0);
+
+    if (output_stream == UNSPEC)
+       output_stream = NIL;
+    else if (output_stream != NIL) {
+       CHECK_STREAM(output_stream);
+    }
+    LispWriteChar(output_stream, '\n');
+    if (output_stream == NIL ||
+       (output_stream->data.stream.type == LispStreamStandard &&
+        output_stream->data.stream.source.file == Stdout))
+       LispFflush(Stdout);
+
+    return (NIL);
+}
+
+LispObj *
+Lisp_Write(LispBuiltin *builtin)
+/*
+ write object &key case circle escape length level lines pretty readably right-margin stream
+ */
+{
+    int head = lisp__data.env.length;
+
+    LispObj *object, *ocase, *circle, *escape, *length, *level, *stream;
+
+    stream = ARGUMENT(10);
+    level = ARGUMENT(5);
+    length = ARGUMENT(4);
+    escape = ARGUMENT(3);
+    circle = ARGUMENT(2);
+    ocase = ARGUMENT(1);
+    object = ARGUMENT(0);
+
+    if (stream == UNSPEC)
+       stream = NIL;
+    else if (stream != NIL) {
+       CHECK_STREAM(stream);
+    }
+
+    /* prepare the printer environment */
+    if (circle != UNSPEC)
+       LispAddVar(Oprint_circle, circle);
+    if (length != UNSPEC)
+       LispAddVar(Oprint_length, length);
+    if (level != UNSPEC)
+       LispAddVar(Oprint_level, level);
+    if (ocase != UNSPEC)
+       LispAddVar(Oprint_case, ocase);
+    if (escape != UNSPEC)
+       LispAddVar(Oprint_escape, escape);
+
+    lisp__data.env.head = lisp__data.env.length;
+
+    (void)LispWriteObject(stream, object);
+
+    lisp__data.env.head = lisp__data.env.length = head;
+
+    return (object);
+}
+
+LispObj *
+Lisp_WriteChar(LispBuiltin *builtin)
+/*
+ write-char character &optional output-stream
+ */
+{
+    int ch;
+
+    LispObj *character, *output_stream;
+
+    output_stream = ARGUMENT(1);
+    character = ARGUMENT(0);
+
+    if (output_stream == UNSPEC)
+       output_stream = NIL;
+    CHECK_SCHAR(character);
+    ch = SCHAR_VALUE(character);
+
+    LispWriteChar(output_stream, ch);
+
+    return (character);
+}
+
+LispObj *
+Lisp_WriteLine(LispBuiltin *builtin)
+/*
+ write-line string &optional output-stream &key start end
+ */
+{
+    return (LispWriteString_(builtin, 1));
+}
+
+LispObj *
+Lisp_WriteString(LispBuiltin *builtin)
+/*
+ write-string string &optional output-stream &key start end
+ */
+{
+    return (LispWriteString_(builtin, 0));
+}
+
+
+int
+LispWriteObject(LispObj *stream, LispObj *object)
+{
+    write_info info;
+    int bytes;
+    LispObj *level, *length, *circle, *oescape, *ocase;
+
+    /* current state */
+    info.depth = info.level = info.length = 0;
+
+    /* maximum level to descend */
+    level = LispGetVar(Oprint_level);
+    if (level && INDEXP(level))
+       info.print_level = FIXNUM_VALUE(level);
+    else
+       info.print_level = -1;
+
+    /* maximum list length */
+    length = LispGetVar(Oprint_length);
+    if (length && INDEXP(length))
+       info.print_length = FIXNUM_VALUE(length);
+    else
+       info.print_length = -1;
+
+    /* detect circular/shared objects? */
+    circle = LispGetVar(Oprint_circle);
+    info.circle_count = 0;
+    info.objects = NULL;
+    info.num_objects = 0;
+    info.circles = NULL;
+    info.num_circles = 0;
+    if (circle && circle != NIL) {
+       LispBuildCircle(object, &info);
+       /* free this data now */
+       if (info.num_objects) {
+           LispFree(info.objects);
+           info.num_objects = 0;
+       }
+    }
+
+    /* escape characters and strings? */
+    oescape = LispGetVar(Oprint_escape);
+    if (oescape != NULL)
+       info.print_escape = oescape == NIL;
+    else
+       info.print_escape = -1;
+
+    /* don't use the default case printing? */
+    ocase = LispGetVar(Oprint_case);
+    if (ocase == Kdowncase)
+       info.print_case = DOWNCASE;
+    else if (ocase == Kcapitalize)
+       info.print_case = CAPITALIZE;
+    else
+       info.print_case = UPCASE;
+
+    bytes = LispDoWriteObject(stream, object, &info, 1);
+    if (circle && circle != NIL && info.num_circles)
+       LispFree(info.circles);
+
+    return (bytes);
+}
+
+static void
+LispBuildCircle(LispObj *object, write_info *info)
+{
+    LispObj *list;
+
+    switch (OBJECT_TYPE(object)) {
+       case LispCons_t:
+           LispDoBuildCircle(object, info);
+           break;
+       case LispArray_t:
+           /* Currently arrays are implemented as lists, but only
+            * the elements could/should be circular */
+           if (LispCheckCircle(object, info) >= 0)
+               return;
+           LispDoBuildCircle(object, info);
+           for (list = object->data.array.list;
+                CONSP(list); list = CDR(list))
+               LispBuildCircle(CAR(list), info);
+           break;
+       case LispStruct_t:
+           /* Like arrays, structs are currently implemented as lists,
+            * but only the elements could/should be circular */
+           if (LispCheckCircle(object, info) >= 0)
+               return;
+           LispDoBuildCircle(object, info);
+           for (list = object->data.struc.fields;
+                CONSP(list); list = CDR(list))
+               LispBuildCircle(CAR(list), info);
+           break;
+       case LispQuote_t:
+       case LispBackquote_t:
+       case LispFunctionQuote_t:
+           LispDoBuildCircle(object, info);
+           LispBuildCircle(object->data.quote, info);
+           break;
+       case LispComma_t:
+           LispDoBuildCircle(object, info);
+           LispBuildCircle(object->data.comma.eval, info);
+           break;
+       case LispLambda_t:
+           /* Circularity in a function body should fail elsewhere... */
+           if (LispCheckCircle(object, info) >= 0)
+               return;
+           LispDoBuildCircle(object, info);
+           LispBuildCircle(object->data.lambda.code, info);
+           break;
+       default:
+           break;
+    }
+}
+
+static void
+LispDoBuildCircle(LispObj *object, write_info *info)
+{
+    long i;
+
+    if (LispCheckCircle(object, info) >= 0)
+       return;
+
+    for (i = 0; i < info->num_objects; i++)
+       if (info->objects[i] == object) {
+           /* circularity found */
+           info->circles = LispRealloc(info->circles, sizeof(circle_info) *
+                                       (info->num_circles + 1));
+           info->circles[info->num_circles].circle_nth = 0;
+           info->circles[info->num_circles].object = object;
+           ++info->num_circles;
+           return;
+       }
+
+    /* object pointer not yet recorded */
+    if ((i % 16) == 0)
+       info->objects = LispRealloc(info->objects, sizeof(LispObj*) *
+                                   (info->num_objects + 16));
+    info->objects[info->num_objects++] = object;
+
+    if (CONSP(object)) {
+       if (CONSP(CAR(object)))
+           LispDoBuildCircle(CAR(object), info);
+       else
+           LispBuildCircle(CAR(object), info);
+       if (CONSP(CDR(object)))
+           LispDoBuildCircle(CDR(object), info);
+       else
+           LispBuildCircle(CDR(object), info);
+    }
+}
+
+static long
+LispCheckCircle(LispObj *object, write_info *info)
+{
+    long i;
+
+    for (i = 0; i < info->num_circles; i++)
+       if (info->circles[i].object == object)
+           return (i);
+
+    return (-1);
+}
+
+static int
+LispPrintCircle(LispObj *stream, LispObj *object, long circle,
+               int *length, write_info *info)
+{
+    char stk[32];
+
+    if (!info->circles[circle].circle_nth) {
+       sprintf(stk, "#%ld=", ++info->circle_count);
+       *length += LispWriteStr(stream, stk, strlen(stk));
+       info->circles[circle].circle_nth = info->circle_count;
+
+       return (1);
+    }
+    sprintf(stk, "#%ld#", info->circles[circle].circle_nth);
+    *length += LispWriteStr(stream, stk, strlen(stk));
+
+    return (0);
+}
+
+static int
+LispWriteAlist(LispObj *stream, LispArgList *alist, write_info *info)
+{
+    Atom_id name;
+    int i, length = 0, need_space = 0;
+
+#define WRITE_ATOM(object)                                             \
+    name = ATOMID(object);                                             \
+    length += LispDoWriteAtom(stream, name->value, name->length,       \
+                             info->print_case)
+#define WRITE_ATOMID(atomid)                                           \
+    length += LispDoWriteAtom(stream, atomid->value, atomid->length,   \
+                             info->print_case)
+#define WRITE_OBJECT(object)                                           \
+    length += LispDoWriteObject(stream, object, info, 1)
+#define WRITE_OPAREN()                                                 \
+    length += LispWriteChar(stream, '(')
+#define WRITE_SPACE()                                                  \
+    length += LispWriteChar(stream, ' ')
+#define WRITE_CPAREN()                                                 \
+    length += LispWriteChar(stream, ')')
+
+    WRITE_OPAREN();
+    for (i = 0; i < alist->normals.num_symbols; i++) {
+       WRITE_ATOM(alist->normals.symbols[i]);
+       if (i + 1 < alist->normals.num_symbols)
+           WRITE_SPACE();
+       else
+           need_space = 1;
+    }
+    if (alist->optionals.num_symbols) {
+       if (need_space)
+           WRITE_SPACE();
+       WRITE_ATOMID(Soptional);
+       WRITE_SPACE();
+       for (i = 0; i < alist->optionals.num_symbols; i++) {
+           WRITE_OPAREN();
+           WRITE_ATOM(alist->optionals.symbols[i]);
+           WRITE_SPACE();
+           WRITE_OBJECT(alist->optionals.defaults[i]);
+           if (alist->optionals.sforms[i]) {
+               WRITE_SPACE();
+               WRITE_ATOM(alist->optionals.sforms[i]);
+           }
+           WRITE_CPAREN();
+           if (i + 1 < alist->optionals.num_symbols)
+               WRITE_SPACE();
+       }
+       need_space = 1;
+    }
+    if (alist->keys.num_symbols) {
+       if (need_space)
+           WRITE_SPACE();
+       length += LispDoWriteAtom(stream, Skey->value, 4, info->print_case);
+       WRITE_SPACE();
+       for (i = 0; i < alist->keys.num_symbols; i++) {
+           WRITE_OPAREN();
+           if (alist->keys.keys[i]) {
+               WRITE_OPAREN();
+               WRITE_ATOM(alist->keys.keys[i]);
+               WRITE_SPACE();
+           }
+           WRITE_ATOM(alist->keys.symbols[i]);
+           if (alist->keys.keys[i])
+               WRITE_CPAREN();
+           WRITE_SPACE();
+           WRITE_OBJECT(alist->keys.defaults[i]);
+           if (alist->keys.sforms[i]) {
+               WRITE_SPACE();
+               WRITE_ATOM(alist->keys.sforms[i]);
+           }
+           WRITE_CPAREN();
+           if (i + 1 < alist->keys.num_symbols)
+               WRITE_SPACE();
+       }
+       need_space = 1;
+    }
+    if (alist->rest) {
+       if (need_space)
+           WRITE_SPACE();
+       WRITE_ATOMID(Srest);
+       WRITE_SPACE();
+       WRITE_ATOM(alist->rest);
+       need_space = 1;
+    }
+    if (alist->auxs.num_symbols) {
+       if (need_space)
+           WRITE_SPACE();
+       WRITE_ATOMID(Saux);
+       WRITE_SPACE();
+       for (i = 0; i < alist->auxs.num_symbols; i++) {
+           WRITE_OPAREN();
+           WRITE_ATOM(alist->auxs.symbols[i]);
+           WRITE_SPACE();
+           WRITE_OBJECT(alist->auxs.initials[i]);
+           WRITE_CPAREN();
+           if (i + 1 < alist->auxs.num_symbols)
+               WRITE_SPACE();
+       }
+    }
+    WRITE_CPAREN();
+
+#undef WRITE_ATOM
+#undef WRITE_ATOMID
+#undef WRITE_OBJECT
+#undef WRITE_OPAREN
+#undef WRITE_SPACE
+#undef WRITE_CPAREN
+
+    return (length);
+}
+
+static void
+check_stream(LispObj *stream,
+            LispFile **file, LispString **string, int check_writable)
+{
+    /* NIL is UNIX stdout, *STANDARD-OUTPUT* may not be UNIX stdout */
+    if (stream == NIL) {
+       *file = Stdout;
+       *string = NULL;
+    }
+    else {
+       if (!STREAMP(stream))
+           LispDestroy("%s is not a stream", STROBJ(stream));
+       if (check_writable && !stream->data.stream.writable)
+           LispDestroy("%s is not writable", STROBJ(stream));
+       else if (stream->data.stream.type == LispStreamString) {
+           *string = SSTREAMP(stream);
+           *file = NULL;
+       }
+       else {
+           if (stream->data.stream.type == LispStreamPipe)
+               *file = OPSTREAMP(stream);
+           else
+               *file = stream->data.stream.source.file;
+           *string = NULL;
+       }
+    }
+}
+
+/* Assumes buffer has enough storage, 64 bytes should be more than enough */
+static void
+parse_double(char *buffer, int *exponent, double value, int d)
+{
+    char stk[64], fmt[32], *ptr, *fract = NULL;
+    int positive = value >= 0.0;
+
+parse_double_again:
+    if (d >= 8) {
+       double dcheck;
+       int icheck, count;
+
+       /* this should to do the correct rounding */
+       for (count = 2;  count >= 0; count--) {
+           icheck = d <= 0 ? 0 : d > FLOAT_PREC ? FLOAT_PREC - count : d - count;
+           sprintf(fmt, "%%.%de", icheck);
+           sprintf(stk, fmt, value);
+           if (count) {
+               /* if the value read back is the same formatted */
+               sscanf(stk, "%lf", &dcheck);
+               if (dcheck == value)
+                   break;
+           }
+       }
+    }
+    else {
+       sprintf(fmt, "%%.%de", d <= 0 ? 0 : d > FLOAT_PREC ? FLOAT_PREC : d);
+       sprintf(stk, fmt, value);
+    }
+
+    /* this "should" never fail */
+    ptr = strchr(stk, 'e');
+    if (ptr) {
+       *ptr++ = '\0';
+       *exponent = atoi(ptr);
+    }
+    else
+       *exponent = 0;
+
+    /* find start of number representation */
+    for (ptr = stk; *ptr && !isdigit(*ptr); ptr++)
+       ;
+
+    /* check if did not trim any significant digit,
+     * this may happen because '%.e' puts only one digit before the '.' */
+    if (d > 0 && d < FLOAT_PREC && fabs(value) >= 10.0 &&
+       strlen(ptr) - 1 - !positive <= *exponent) {
+       d += *exponent - (strlen(ptr) - 1 - !positive) + 1;
+       goto parse_double_again;
+    }
+
+    /* this "should" never fail */
+    fract = strchr(ptr, '.');
+    if (fract)
+       *fract++ = '\0';
+
+    /* store number representation in buffer */
+    *buffer = positive ? '+' : '-';
+    strcpy(buffer + 1, ptr);
+    if (fract)
+       strcpy(buffer + strlen(buffer), fract);
+}
+
+static void
+format_integer(char *buffer, long value, int radix)
+{
+    if (radix == 10)
+       sprintf(buffer, "%ld", value);
+    else if (radix == 16)
+       sprintf(buffer, "%lx", value);
+    else if (radix == 8)
+       sprintf(buffer, "%lo", value);
+    else {
+       /* use bignum routine to convert number to string */
+       mpi integer;
+
+       mpi_init(&integer);
+       mpi_seti(&integer, value);
+       mpi_getstr(buffer, &integer, radix);
+       mpi_clear(&integer);
+    }
+}
+
+static int
+LispWriteCPointer(LispObj *stream, void *data)
+{
+    char stk[32];
+
+#ifdef LONG64
+    sprintf(stk, "0x%016lx", (long)data);
+#else
+    sprintf(stk, "0x%08lx", (long)data);
+#endif
+
+    return (LispWriteStr(stream, stk, strlen(stk)));
+}
+
+static int
+LispWriteCString(LispObj *stream, char *string, long length, write_info *info)
+{
+    int result;
+
+    if (!info->print_escape) {
+       char *base, *ptr, *end;
+
+       result = LispWriteChar(stream, '"');
+       for (base = ptr = string, end = string + length; ptr < end; ptr++) {
+           if (*ptr == '\\' || *ptr == '"') {
+               result += LispWriteStr(stream, base, ptr - base);
+               result += LispWriteChar(stream, '\\');
+               result += LispWriteChar(stream, *ptr);
+               base = ptr + 1;
+           }
+       }
+       result += LispWriteStr(stream, base, end - base);
+       result += LispWriteChar(stream, '"');
+    }
+    else
+       result = LispWriteStr(stream, string, length);
+
+    return (result);
+}
+
+static int
+LispWriteList(LispObj *stream, LispObj *object, write_info *info, int paren)
+{
+    int length = 0;
+    long circle = 0;
+
+    INCDEPTH();
+    if (info->print_level < 0 || info->level <= info->print_level) {
+       LispObj *car, *cdr;
+       long print_length = info->length;
+
+       if (info->circles && (circle = LispCheckCircle(object, info)) >= 0) {
+           if (!paren) {
+               length += LispWriteStr(stream, ". ", 2);
+               paren = 1;
+           }
+           if (LispPrintCircle(stream, object, circle, &length, info) == 0) {
+               DECDEPTH();
+
+               return (length);
+           }
+       }
+
+       car = CAR(object);
+       cdr = CDR(object);
+
+       if (cdr == NIL) {
+           if (paren)
+               length += LispWriteChar(stream, '(');
+           if (info->print_length < 0 || info->length < info->print_length) {
+               info->length = 0;
+               length += LispDoWriteObject(stream, car, info, 1);
+               info->length = print_length + 1;
+           }
+           else
+               length += LispWriteStr(stream, "...", 3);
+           if (paren)
+               length += LispWriteChar(stream, ')');
+       }
+       else {
+           if (paren)
+               length += LispWriteChar(stream, '(');
+           if (info->print_length < 0 || info->length < info->print_length) {
+               info->length = 0;
+               length += LispDoWriteObject(stream, car, info, 1);
+               info->length = print_length + 1;
+               if (!CONSP(cdr)) {
+                   length += LispWriteStr(stream, " . ", 3);
+                   info->length = 0;
+                   length += LispDoWriteObject(stream, cdr, info, 0);
+               }
+               else {
+                   length += LispWriteChar(stream, ' ');
+                   if (info->print_length < 0 ||
+                       info->length < info->print_length)
+                       length += LispWriteList(stream, cdr, info, 0);
+                   else
+                       length += LispWriteStr(stream, "...", 3);
+               }
+           }
+           else
+               length += LispWriteStr(stream, "...", 3);
+           if (paren)
+               length += LispWriteChar(stream, ')');
+       }
+       info->length = print_length;
+    }
+    else
+       length += LispWriteChar(stream, '#');
+    DECDEPTH();
+
+    return (length);
+}
+
+static int
+LispDoWriteObject(LispObj *stream, LispObj *object, write_info *info, int paren)
+{
+    long print_level;
+    int length = 0;
+    char stk[64], *string = NULL;
+
+write_again:
+    switch (OBJECT_TYPE(object)) {
+       case LispNil_t:
+           if (object == NIL)
+               string = Snil->value;
+           else if (object == T)
+               string = St->value;
+           else if (object == DOT)
+               string = "#<DOT>";
+           else if (object == UNSPEC)
+               string = "#<UNSPEC>";
+           else if (object == UNBOUND)
+               string = "#<UNBOUND>";
+           else
+               string = "#<ERROR>";
+           length += LispDoWriteAtom(stream, string, strlen(string),
+                                     info->print_case);
+           break;
+       case LispOpaque_t: {
+           char *desc = LispIntToOpaqueType(object->data.opaque.type);
+
+           length += LispWriteChar(stream, '#');
+           length += LispWriteCPointer(stream, object->data.opaque.data);
+           length += LispWriteStr(stream, desc, strlen(desc));
+       }   break;
+       case LispAtom_t:
+           length += LispWriteAtom(stream, object, info);
+           break;
+       case LispFunction_t:
+           if (object->data.atom->a_function) {
+               object = object->data.atom->property->fun.function;
+               goto write_lambda;
+           }
+           length += LispWriteStr(stream, "#<", 2);
+           if (object->data.atom->a_compiled)
+               LispDoWriteAtom(stream, "COMPILED", 8, info->print_case);
+           else if (object->data.atom->a_builtin)
+               LispDoWriteAtom(stream, "BUILTIN", 7, info->print_case);
+           /* XXX the function does not exist anymore */
+           /* FIXME not sure if I want this fixed... */
+           else
+               LispDoWriteAtom(stream, "UNBOUND", 7, info->print_case);
+           LispDoWriteAtom(stream, "-FUNCTION", 9, info->print_case);
+           length += LispWriteChar(stream, ' ');
+           length += LispWriteAtom(stream, object->data.atom->object, info);
+           length += LispWriteChar(stream, '>');
+           break;
+       case LispString_t:
+           length += LispWriteString(stream, object, info);
+           break;
+       case LispSChar_t:
+           length += LispWriteCharacter(stream, object, info);
+           break;
+       case LispDFloat_t:
+           length += LispWriteFloat(stream, object);
+           break;
+       case LispFixnum_t:
+       case LispInteger_t:
+       case LispBignum_t:
+           length += LispWriteInteger(stream, object);
+           break;
+       case LispRatio_t:
+           format_integer(stk, object->data.ratio.numerator, 10);
+           length += LispWriteStr(stream, stk, strlen(stk));
+           length += LispWriteChar(stream, '/');
+           format_integer(stk, object->data.ratio.denominator, 10);
+           length += LispWriteStr(stream, stk, strlen(stk));
+           break;
+       case LispBigratio_t: {
+           int sz;
+           char *ptr;
+
+           sz = mpi_getsize(mpr_num(object->data.mp.ratio), 10) + 1 +
+                mpi_getsize(mpr_den(object->data.mp.ratio), 10) + 1 +
+                (mpi_sgn(mpr_num(object->data.mp.ratio)) < 0);
+           if (sz > sizeof(stk))
+               ptr = LispMalloc(sz);
+           else
+               ptr = stk;
+           mpr_getstr(ptr, object->data.mp.ratio, 10);
+           length += LispWriteStr(stream, ptr, sz - 1);
+           if (ptr != stk)
+               LispFree(ptr);
+       }   break;
+       case LispComplex_t:
+           length += LispWriteStr(stream, "#C(", 3);
+           length += LispDoWriteObject(stream,
+                                       object->data.complex.real, info, 0);
+           length += LispWriteChar(stream, ' ');
+           length += LispDoWriteObject(stream,
+                                       object->data.complex.imag, info, 0);
+           length += LispWriteChar(stream, ')');
+           break;
+       case LispCons_t:
+           print_level = info->level;
+           ++info->level;
+           length += LispWriteList(stream, object, info, paren);
+           info->level = print_level;
+           break;
+       case LispQuote_t:
+           length += LispWriteChar(stream, '\'');
+           paren = 1;
+           object = object->data.quote;
+           goto write_again;
+       case LispBackquote_t:
+           length += LispWriteChar(stream, '`');
+           paren = 1;
+           object = object->data.quote;
+           goto write_again;
+       case LispComma_t:
+           if (object->data.comma.atlist)
+               length += LispWriteStr(stream, ",@", 2);
+           else
+               length += LispWriteChar(stream, ',');
+           paren = 1;
+           object = object->data.comma.eval;
+           goto write_again;
+           break;
+       case LispFunctionQuote_t:
+           length += LispWriteStr(stream, "#'", 2);
+           paren = 1;
+           object = object->data.quote;
+           goto write_again;
+       case LispArray_t:
+           length += LispWriteArray(stream, object, info);
+           break;
+       case LispStruct_t:
+           length += LispWriteStruct(stream, object, info);
+           break;
+       case LispLambda_t:
+       write_lambda:
+           switch (object->funtype) {
+               case LispLambda:
+                   string = "#<LAMBDA ";
+                   break;
+               case LispFunction:
+                   string = "#<FUNCTION ";
+                   break;
+               case LispMacro:
+                   string = "#<MACRO ";
+                   break;
+               case LispSetf:
+                   string = "#<SETF ";
+                   break;
+           }
+           length += LispDoWriteAtom(stream, string, strlen(string),
+                                     info->print_case);
+           if (object->funtype != LispLambda) {
+               length += LispWriteAtom(stream, object->data.lambda.name, info);
+               length += LispWriteChar(stream, ' ');
+               length += LispWriteAlist(stream, object->data.lambda.name
+                                        ->data.atom->property->alist, info);
+           }
+           else {
+               length += LispDoWriteAtom(stream, "NIL", 3, info->print_case);
+               length += LispWriteChar(stream, ' ');
+               length += LispWriteAlist(stream, (LispArgList*)object->
+                                        data.lambda.name->data.opaque.data,
+                                        info);
+           }
+           length += LispWriteChar(stream, ' ');
+           length += LispDoWriteObject(stream,
+                                       object->data.lambda.code, info, 0);
+           length += LispWriteChar(stream, '>');
+           break;
+       case LispStream_t:
+           length += LispWriteStr(stream, "#<", 2);
+           if (object->data.stream.type == LispStreamFile)
+               string = "FILE-STREAM ";
+           else if (object->data.stream.type == LispStreamString)
+               string = "STRING-STREAM ";
+           else if (object->data.stream.type == LispStreamStandard)
+               string = "STANDARD-STREAM ";
+           else if (object->data.stream.type == LispStreamPipe)
+               string = "PIPE-STREAM ";
+           length += LispDoWriteAtom(stream, string, strlen(string),
+                                     info->print_case);
+
+           if (!object->data.stream.readable && !object->data.stream.writable)
+               length += LispDoWriteAtom(stream, "CLOSED",
+                                         6, info->print_case);
+           else {
+               if (object->data.stream.readable)
+                   length += LispDoWriteAtom(stream, "READ",
+                                             4, info->print_case);
+               if (object->data.stream.writable) {
+                   if (object->data.stream.readable)
+                       length += LispWriteChar(stream, '-');
+                   length += LispDoWriteAtom(stream, "WRITE",
+                                             5, info->print_case);
+               }
+           }
+           if (object->data.stream.type != LispStreamString) {
+               length += LispWriteChar(stream, ' ');
+               length += LispDoWriteObject(stream,
+                                           object->data.stream.pathname,
+                                           info, 1);
+               /* same address/size for pipes */
+               length += LispWriteChar(stream, ' ');
+               length += LispWriteCPointer(stream,
+                                           object->data.stream.source.file);
+               if (object->data.stream.readable &&
+                   object->data.stream.type == LispStreamFile &&
+                   !object->data.stream.source.file->binary) {
+                   length += LispWriteStr(stream, " @", 2);
+                   format_integer(stk, object->data.stream.source.file->line, 10);
+                   length += LispWriteStr(stream, stk, strlen(stk));
+               }
+           }
+           length += LispWriteChar(stream, '>');
+           break;
+       case LispPathname_t:
+           length += LispWriteStr(stream, "#P", 2);
+           paren = 1;
+           object = CAR(object->data.quote);
+           goto write_again;
+       case LispPackage_t:
+           length += LispDoWriteAtom(stream, "#<PACKAGE ",
+                                     10, info->print_case);
+           length += LispWriteStr(stream,
+                                  THESTR(object->data.package.name),
+                                  STRLEN(object->data.package.name));
+           length += LispWriteChar(stream, '>');
+           break;
+       case LispRegex_t:
+           length += LispDoWriteAtom(stream, "#<REGEX ",
+                                     8, info->print_case);
+           length += LispDoWriteObject(stream,
+                                       object->data.regex.pattern, info, 1);
+           if (object->data.regex.options & RE_NOSPEC)
+               length += LispDoWriteAtom(stream, " :NOSPEC",
+                                         8, info->print_case);
+           if (object->data.regex.options & RE_ICASE)
+               length += LispDoWriteAtom(stream, " :ICASE",
+                                         7, info->print_case);
+           if (object->data.regex.options & RE_NOSUB)
+               length += LispDoWriteAtom(stream, " :NOSUB",
+                                         7, info->print_case);
+           if (object->data.regex.options & RE_NEWLINE)
+               length += LispDoWriteAtom(stream, " :NEWLINE",
+                                         9, info->print_case);
+           length += LispWriteChar(stream, '>');
+           break;
+       case LispBytecode_t:
+           length += LispDoWriteAtom(stream, "#<BYTECODE ",
+                                     11, info->print_case);
+           length += LispWriteCPointer(stream,
+                                       object->data.bytecode.bytecode);
+           length += LispWriteChar(stream, '>');
+           break;
+       case LispHashTable_t:
+           length += LispDoWriteAtom(stream, "#<HASH-TABLE ",
+                                     13, info->print_case);
+           length += LispWriteAtom(stream, object->data.hash.test, info);
+           snprintf(stk, sizeof(stk), " %g %g",
+                    object->data.hash.table->rehash_size,
+                    object->data.hash.table->rehash_threshold);
+           length += LispWriteStr(stream, stk, strlen(stk));
+           snprintf(stk, sizeof(stk), " %ld/%ld>",
+                    object->data.hash.table->count,
+                    object->data.hash.table->num_entries);
+           length += LispWriteStr(stream, stk, strlen(stk));
+           break;
+    }
+
+    return (length);
+}
+
+/* return current column number in stream */
+int
+LispGetColumn(LispObj *stream)
+{
+    LispFile *file;
+    LispString *string;
+
+    check_stream(stream, &file, &string, 0);
+    if (file != NULL)
+       return (file->column);
+    return (string->column);
+}
+
+/* write a character to stream */
+int
+LispWriteChar(LispObj *stream, int character)
+{
+    LispFile *file;
+    LispString *string;
+
+    check_stream(stream, &file, &string, 1);
+    if (file != NULL)
+       return (LispFputc(file, character));
+
+    return (LispSputc(string, character));
+}
+
+/* write a character count times to stream */
+int
+LispWriteChars(LispObj *stream, int character, int count)
+{
+    int length = 0;
+
+    if (count > 0) {
+       char stk[64];
+       LispFile *file;
+       LispString *string;
+
+       check_stream(stream, &file, &string, 1);
+       if (count >= sizeof(stk)) {
+           memset(stk, character, sizeof(stk));
+           for (; count >= sizeof(stk); count -= sizeof(stk)) {
+               if (file != NULL)
+                   length += LispFwrite(file, stk, sizeof(stk));
+               else
+                   length += LispSwrite(string, stk, sizeof(stk));
+           }
+       }
+       else
+           memset(stk, character, count);
+
+       if (count) {
+           if (file != NULL)
+               length += LispFwrite(file, stk, count);
+           else
+               length += LispSwrite(string, stk, count);
+       }
+    }
+
+    return (length);
+}
+
+/* write a string to stream */
+int
+LispWriteStr(LispObj *stream, char *buffer, long length)
+{
+    LispFile *file;
+    LispString *string;
+
+    check_stream(stream, &file, &string, 1);
+    if (file != NULL)
+       return (LispFwrite(file, buffer, length));
+    return (LispSwrite(string, buffer, length));
+}
+
+static int
+LispDoWriteAtom(LispObj *stream, char *string, int length, int print_case)
+{
+    int bytes = 0, cap = 0;
+    char buffer[128], *ptr;
+
+    switch (print_case) {
+       case DOWNCASE:
+           for (ptr = buffer; length > 0; length--, string++) {
+               if (isupper(*string))
+                   *ptr = tolower(*string);
+               else
+                   *ptr = *string;
+               ++ptr;
+               if (ptr - buffer >= sizeof(buffer)) {
+                   bytes += LispWriteStr(stream, buffer, ptr - buffer);
+                   ptr = buffer;
+               }
+           }
+           if (ptr > buffer)
+               bytes += LispWriteStr(stream, buffer, ptr - buffer);
+           break;
+       case CAPITALIZE:
+           for (ptr = buffer; length > 0; length--, string++) {
+               if (isalnum(*string)) {
+                   if (cap && isupper(*string))
+                       *ptr = tolower(*string);
+                   else
+                       *ptr = *string;
+                   cap = 1;
+               }
+               else {
+                   *ptr = *string;
+                   cap = 0;
+               }
+               ++ptr;
+               if (ptr - buffer >= sizeof(buffer)) {
+                   bytes += LispWriteStr(stream, buffer, ptr - buffer);
+                   ptr = buffer;
+               }
+           }
+           if (ptr > buffer)
+               bytes += LispWriteStr(stream, buffer, ptr - buffer);
+           break;
+       default:
+           /* Strings are already stored upcase/quoted */
+           bytes += LispWriteStr(stream, string, length);
+           break;
+    }
+
+    return (bytes);
+}
+
+static int
+LispWriteAtom(LispObj *stream, LispObj *object, write_info *info)
+{
+    int length = 0;
+    LispAtom *atom = object->data.atom;
+    Atom_id id = atom->key;
+
+    if (atom->package != PACKAGE) {
+       if (atom->package == lisp__data.keyword)
+           length += LispWriteChar(stream, ':');
+       else if (atom->package == NULL)
+           length += LispWriteStr(stream, "#:", 2);
+       else {
+           /* Check if the symbol is visible */
+           int i, visible = 0;
+
+           if (atom->ext) {
+               for (i = lisp__data.pack->use.length - 1; i >= 0; i--) {
+                   if (lisp__data.pack->use.pairs[i] == atom->package) {
+                       visible = 1;
+                       break;
+                   }
+               }
+           }
+
+           if (!visible) {
+               /* XXX this assumes that package names are always "readable" */
+               length +=
+                   LispDoWriteAtom(stream,
+                                   THESTR(atom->package->data.package.name),
+                                   STRLEN(atom->package->data.package.name),
+                                   info->print_case);
+               length += LispWriteChar(stream, ':');
+               if (!atom->ext)
+                   length += LispWriteChar(stream, ':');
+           }
+       }
+    }
+    if (atom->unreadable)
+       length += LispWriteChar(stream, '|');
+    length += LispDoWriteAtom(stream, id->value, id->length,
+                             atom->unreadable ? UPCASE : info->print_case);
+    if (atom->unreadable)
+       length += LispWriteChar(stream, '|');
+
+    return (length);
+}
+
+static int
+LispWriteInteger(LispObj *stream, LispObj *object)
+{
+    return (LispFormatInteger(stream, object, 10, 0, 0, 0, 0, 0, 0));
+}
+
+static int
+LispWriteCharacter(LispObj *stream, LispObj *object, write_info *info)
+{
+    return (LispFormatCharacter(stream, object, !info->print_escape, 0));
+}
+
+static int
+LispWriteString(LispObj *stream, LispObj *object, write_info *info)
+{
+    return (LispWriteCString(stream, THESTR(object), STRLEN(object), info));
+}
+
+static int
+LispWriteFloat(LispObj *stream, LispObj *object)
+{
+    double value = DFLOAT_VALUE(object);
+
+    if (value == 0.0 || (fabs(value) < 1.0E7 && fabs(value) > 1.0E-4))
+       return (LispFormatFixedFloat(stream, object, 0, 0, NULL, 0, 0, 0));
+
+    return (LispDoFormatExponentialFloat(stream, object, 0, 0, NULL,
+                                        0, 1, 0, ' ', 'E', 0));
+}
+
+static int
+LispWriteArray(LispObj *stream, LispObj *object, write_info *info)
+{
+    int length = 0;
+    long print_level = info->level, circle;
+
+    if (info->circles && (circle = LispCheckCircle(object, info)) >= 0 &&
+       LispPrintCircle(stream, object, circle, &length, info) == 0)
+       return (length);
+
+    if (object->data.array.rank == 0) {
+       length += LispWriteStr(stream, "#0A", 3);
+       length += LispDoWriteObject(stream, object->data.array.list, info, 1);
+       return (length);
+    }
+
+    INCDEPTH();
+    ++info->level;
+    if (info->print_level < 0 || info->level <= info->print_level) {
+       if (object->data.array.rank == 1)
+           length += LispWriteStr(stream, "#(", 2);
+       else {
+           char stk[32];
+
+           format_integer(stk, object->data.array.rank, 10);
+           length += LispWriteChar(stream, '#');
+           length += LispWriteStr(stream, stk, strlen(stk));
+           length += LispWriteStr(stream, "A(", 2);
+       }
+
+       if (!object->data.array.zero) {
+           long print_length = info->length, local_length = 0;
+
+           if (object->data.array.rank == 1) {
+               LispObj *ary;
+               long count;
+
+               for (ary = object->data.array.dim, count = 1;
+                    ary != NIL; ary = CDR(ary))
+                   count *= FIXNUM_VALUE(CAR(ary));
+               for (ary = object->data.array.list; count > 0;
+                    ary = CDR(ary), count--) {
+                   if (info->print_length < 0 ||
+                       ++local_length <= info->print_length) {
+                       info->length = 0;
+                       length += LispDoWriteObject(stream, CAR(ary), info, 1);
+                   }
+                   else {
+                       length += LispWriteStr(stream, "...", 3);
+                       break;
+                   }
+                   if (count - 1 > 0)
+                       length += LispWriteChar(stream, ' ');
+               }
+           }
+           else {
+               LispObj *ary;
+               int i, k, rank, *dims, *loop;
+
+               rank = object->data.array.rank;
+               dims = LispMalloc(sizeof(int) * rank);
+               loop = LispCalloc(1, sizeof(int) * (rank - 1));
+
+               /* fill dim */
+               for (i = 0, ary = object->data.array.dim; ary != NIL;
+                    i++, ary = CDR(ary))
+                   dims[i] = FIXNUM_VALUE(CAR(ary));
+
+               i = 0;
+               ary = object->data.array.list;
+               while (loop[0] < dims[0]) {
+                   if (info->print_length < 0 ||
+                       local_length < info->print_length) {
+                       for (; i < rank - 1; i++)
+                           length += LispWriteChar(stream, '(');
+                       --i;
+                       for (;;) {
+                           ++loop[i];
+                           if (i && loop[i] >= dims[i])
+                               loop[i] = 0;
+                           else
+                               break;
+                           --i;
+                       }
+                       for (k = 0; k < dims[rank - 1] - 1;
+                            k++, ary = CDR(ary)) {
+                           if (info->print_length < 0 ||
+                               k < info->print_length) {
+                               ++local_length;
+                               info->length = 0;
+                               length += LispDoWriteObject(stream,
+                                                           CAR(ary), info, 1);
+                               length += LispWriteChar(stream, ' ');
+                           }
+                       }
+                       if (info->print_length < 0 || k < info->print_length) {
+                           ++local_length;
+                           info->length = 0;
+                           length += LispDoWriteObject(stream,
+                                                       CAR(ary), info, 0);
+                       }
+                       else
+                           length += LispWriteStr(stream,  "...", 3);
+                       for (k = rank - 1; k > i; k--)
+                           length += LispWriteChar(stream, ')');
+                       if (loop[0] < dims[0])
+                           length += LispWriteChar(stream,  ' ');
+                       ary = CDR(ary);
+                   }
+                   else {
+                       ++local_length;
+                       length += LispWriteStr(stream,  "...)", 4);
+                       for (; local_length < dims[0] - 1; local_length++)
+                           length += LispWriteStr(stream,  " ...)", 5);
+                       if (local_length <= dims[0])
+                           length += LispWriteStr(stream,  " ...", 4);
+                       break;
+                   }
+               }
+               LispFree(dims);
+               LispFree(loop);
+           }
+           info->length = print_length;
+       }
+       length += LispWriteChar(stream, ')');
+    }
+    else
+       length += LispWriteChar(stream, '#');
+    info->level = print_level;
+    DECDEPTH();
+
+    return (length);
+}
+
+static int
+LispWriteStruct(LispObj *stream, LispObj *object, write_info *info)
+{
+    int length;
+    long circle;
+    LispObj *symbol;
+    LispObj *def = object->data.struc.def;
+    LispObj *field = object->data.struc.fields;
+
+    if (info->circles && (circle = LispCheckCircle(object, info)) >= 0 &&
+       LispPrintCircle(stream, object, circle, &length, info) == 0)
+       return (length);
+
+    INCDEPTH();
+    length = LispWriteStr(stream, "#S(", 3);
+    symbol = SYMBOLP(CAR(def)) ? CAR(def) : CAAR(def);
+    length += LispWriteAtom(stream, symbol, info);
+    def = CDR(def);
+    for (; def != NIL; def = CDR(def), field = CDR(field)) {
+       length += LispWriteChar(stream, ' ');
+       symbol = SYMBOLP(CAR(def)) ? CAR(def) : CAAR(def);
+       length += LispWriteAtom(stream, symbol, info);
+       length += LispWriteChar(stream, ' ');
+       length += LispDoWriteObject(stream, CAR(field), info, 1);
+    }
+    length += LispWriteChar(stream, ')');
+    DECDEPTH();
+
+    return (length);
+}
+
+int
+LispFormatInteger(LispObj *stream, LispObj *object, int radix,
+                 int atsign, int collon, int mincol,
+                 int padchar, int commachar, int commainterval)
+{
+    char stk[128], *str = stk;
+    int i, length, sign, intervals;
+
+    if (LONGINTP(object))
+       format_integer(stk, LONGINT_VALUE(object), radix);
+    else {
+       if (mpi_getsize(object->data.mp.integer, radix) >= sizeof(stk))
+           str = mpi_getstr(NULL, object->data.mp.integer, radix);
+       else
+           mpi_getstr(str, object->data.mp.integer, radix);
+    }
+
+    sign = *str == '-';
+    length = strlen(str);
+
+    /* if collon, update length for the number of commachars to be printed */
+    if (collon && commainterval > 0 && commachar) {
+       intervals = length / commainterval;
+       length += intervals;
+    }
+    else
+       intervals = 0;
+
+    /* if sign must be printed, and number is positive */
+    if (atsign && !sign)
+       ++length;
+
+    /* if need padding */
+    if (padchar && mincol > length)
+       LispWriteChars(stream, padchar, mincol - length);
+
+    /* if need to print number sign */
+    if (sign || atsign)
+       LispWriteChar(stream, sign ? '-' : '+');
+
+    /* if need to print commas to separate groups of numbers */
+    if (intervals) {
+       int j;
+       char *ptr;
+
+       i = (length - atsign) - intervals;
+       j = i % commainterval;
+       /* make the loop below easier */
+       if (j == 0)
+           j = commainterval;
+       i -= j;
+       ptr = str + sign;
+       for (; j > 0; j--, ptr++)
+           LispWriteChar(stream, *ptr);
+       for (; i > 0; i -= commainterval) {
+           LispWriteChar(stream, commachar);
+           for (j = 0; j < commainterval; j++, ptr++)
+               LispWriteChar(stream, *ptr);
+       }
+    }
+    /* else, just print the string */
+    else
+       LispWriteStr(stream, str + sign, length - sign);
+
+    /* if number required more than sizeof(stk) bytes */
+    if (str != stk)
+       LispFree(str);
+
+    return (length);
+}
+
+int
+LispFormatRomanInteger(LispObj *stream, long value, int new_roman)
+{
+    char stk[32];
+    int length;
+
+    length = 0;
+    while (value > 1000) {
+       stk[length++] = 'M';
+       value -= 1000;
+    }
+    if (new_roman) {
+       if (value >= 900) {
+           strcpy(stk + length, "CM");
+           length += 2,
+           value -= 900;
+       }
+       else if (value < 500 && value >= 400) {
+           strcpy(stk + length, "CD");
+           length += 2;
+           value -= 400;
+       }
+    }
+    if (value >= 500) {
+       stk[length++] = 'D';
+       value -= 500;
+    }
+    while (value >= 100) {
+       stk[length++] = 'C';
+       value -= 100;
+    }
+    if (new_roman) {
+       if (value >= 90) {
+           strcpy(stk + length, "XC");
+           length += 2,
+           value -= 90;
+       }
+       else if (value < 50 && value >= 40) {
+           strcpy(stk + length, "XL");
+           length += 2;
+           value -= 40;
+       }
+    }
+    if (value >= 50) {
+       stk[length++] = 'L';
+       value -= 50;
+    }
+    while (value >= 10) {
+       stk[length++] = 'X';
+       value -= 10;
+    }
+    if (new_roman) {
+       if (value == 9) {
+           strcpy(stk + length, "IX");
+           length += 2,
+           value -= 9;
+       }
+       else if (value == 4) {
+           strcpy(stk + length, "IV");
+           length += 2;
+           value -= 4;
+       }
+    }
+    if (value >= 5) {
+       stk[length++] = 'V';
+       value -= 5;
+    }
+    while (value) {
+       stk[length++] = 'I';
+       --value;
+    }
+
+    stk[length] = '\0';
+
+    return (LispWriteStr(stream, stk, length));
+}
+
+int
+LispFormatEnglishInteger(LispObj *stream, long number, int ordinal)
+{
+    static char *ds[] = {
+       "",           "one",       "two",        "three",      "four",
+       "five",       "six",       "seven",      "eight",      "nine",
+       "ten",        "eleven",    "twelve",     "thirteen",   "fourteen",
+       "fifteen",    "sixteen",   "seventeen",  "eighteen",   "nineteen"
+    };
+    static char *dsth[] = {
+       "",           "first",     "second",      "third",      "fourth",
+       "fifth",      "sixth",     "seventh",     "eighth",     "ninth",
+       "tenth",      "eleventh",  "twelfth",     "thirteenth", "fourteenth",
+        "fifteenth", "sixteenth", "seventeenth", "eighteenth", "nineteenth"
+    };
+    static char *hs[] = {
+       "",           "",          "twenty",      "thirty",     "forty",
+       "fifty",      "sixty",     "seventy",     "eighty",     "ninety"
+    };
+    static char *hsth[] = {
+       "",           "",          "twentieth",   "thirtieth",  "fortieth",
+       "fiftieth",    "sixtieth",  "seventieth",  "eightieth", "ninetieth"
+    };
+    static char *ts[] = {
+       "",           "thousand",   "million"
+    };
+    static char *tsth[] = {
+       "",          "thousandth", "millionth"
+    };
+    char stk[256];
+    int length, sign;
+
+    sign = number < 0;
+    if (sign)
+       number = -number;
+    length = 0;
+
+#define SIGNLEN                6       /* strlen("minus ") */
+    if (sign) {
+       strcpy(stk, "minus ");
+       length += SIGNLEN;
+    }
+    else if (number == 0) {
+       if (ordinal) {
+           strcpy(stk, "zeroth");
+           length += 6;        /* strlen("zeroth") */
+       }
+       else {
+           strcpy(stk, "zero");
+           length += 4;        /* strlen("zero") */
+       }
+    }
+    for (;;) {
+       int count, temp;
+       char *t, *h, *d;
+       long value = number;
+
+       for (count = 0; value >= 1000; value /= 1000, count++)
+           ;
+
+       t = ds[value / 100];
+       if (ordinal && !count && (value % 10) == 0)
+           h = hsth[(value % 100) / 10];
+       else
+           h = hs[(value % 100) / 10];
+
+       if (ordinal && !count)
+           d = *h ? dsth[value % 10] : dsth[value % 20];
+       else
+           d = *h ? ds[value % 10] : ds[value % 20];
+
+       if (((!sign && length) || length > SIGNLEN) && (*t || *h || *d)) {
+           if (!ordinal || count || *h || *t) {
+               strcpy(stk + length, ", ");
+               length += 2;
+           }
+           else {
+               strcpy(stk + length, " ");
+               ++length;
+           }
+       }
+
+       if (*t) {
+           if (ordinal && !count && (value % 100) == 0)
+               temp = sprintf(stk + length, "%s hundredth", t);
+           else
+               temp = sprintf(stk + length, "%s hundred", t);
+           length += temp;
+       }
+
+       if (*h) {
+           if (*t) {
+               if (ordinal && !count) {
+                   strcpy(stk + length, " ");
+                   ++length;
+               }
+               else {
+                   strcpy(stk + length, " and ");
+                   length += 5;        /* strlen(" and ") */
+               }
+           }
+           strcpy(stk + length, h);
+           length += strlen(h);
+       }
+
+       if (*d) {
+           if (*h) {
+               strcpy(stk + length, "-");
+               ++length;
+           }
+           else if (*t) {
+               if (ordinal && !count) {
+                   strcpy(stk + length, " ");
+                   ++length;
+               }
+               else {
+                   strcpy(stk + length, " and ");
+                   length += 5;        /* strlen(" and ") */
+               }
+           }
+           strcpy(stk + length, d);
+           length += strlen(d);
+       }
+
+       if (!count)
+           break;
+       else
+           temp = count;
+
+       if (count > 1) {
+           value *= 1000;
+           while (--count)
+               value *= 1000;
+           number -= value;
+       }
+       else
+           number %= 1000;
+
+       if (ordinal && number == 0 && !*t && !*h)
+           temp = sprintf(stk + length, " %s", tsth[temp]);
+       else
+           temp = sprintf(stk + length, " %s", ts[temp]);
+       length += temp;
+
+       if (!number)
+           break;
+    }
+
+    return (LispWriteStr(stream, stk, length));
+}
+
+int
+LispFormatCharacter(LispObj *stream, LispObj *object,
+                   int atsign, int collon)
+{
+    int length = 0;
+    int ch = SCHAR_VALUE(object);
+
+    if (atsign && !collon)
+       length += LispWriteStr(stream, "#\\", 2);
+    if ((atsign || collon) && (ch <= ' ' || ch == 0177)) {
+       char *name = LispChars[ch].names[0];
+
+       length += LispWriteStr(stream, name, strlen(name));
+    }
+    else
+       length += LispWriteChar(stream, ch);
+
+    return (length);
+}
+
+/* returns 1 if string size must grow, done inplace */
+static int
+float_string_inc(char *buffer, int offset)
+{
+    int i;
+
+    for (i = offset; i >= 0; i--) {
+       if (buffer[i] == '9')
+           buffer[i] = '0';
+       else if (buffer[i] != '.') {
+           ++buffer[i];
+           break;
+       }
+    }
+    if (i < 0) {
+       int length = strlen(buffer);
+
+       /* string size must change */
+       memmove(buffer + 1, buffer, length + 1);
+       buffer[0] = '1';
+
+       return (1);
+    }
+
+    return (0);
+}
+
+int
+LispFormatFixedFloat(LispObj *stream, LispObj *object,
+                    int atsign, int w, int *pd, int k, int overflowchar,
+                    int padchar)
+{
+    char buffer[512], stk[64];
+    int sign, exponent, length, offset, d = pd ? *pd : FLOAT_PREC, again;
+    double value = DFLOAT_VALUE(object);
+
+    if (value == 0.0) {
+       exponent = k = 0;
+       strcpy(stk, "+0");
+    }
+    else
+       /* calculate format parameters, adjusting scale factor */
+       parse_double(stk, &exponent, value, d + 1 + k);
+
+    /* make sure k won't cause overflow */
+    if (k > 128)
+       k = 128;
+    else if (k < -128)
+       k = -128;
+
+    /* make sure d won't cause overflow */
+    if (d > 128)
+       d = 128;
+    else if (d < -128)
+       d = -128;
+
+    /* adjust scale factor, exponent is used as an index in stk */
+    exponent += k + 1;
+
+    /* how many bytes in float representation */
+    length = strlen(stk) - 1;
+
+    /* need to print a sign? */
+    sign = atsign || (stk[0] == '-');
+
+    /* format number, cannot overflow, as control variables were checked */
+    offset = 0;
+    if (sign)
+       buffer[offset++] = stk[0];
+    if (exponent > 0) {
+       if (exponent > length) {
+           memcpy(buffer + offset, stk + 1, length);
+           memset(buffer + offset + length, '0', exponent - length);
+       }
+       else
+           memcpy(buffer + offset, stk + 1, exponent);
+       offset += exponent;
+       buffer[offset++] = '.';
+       if (length > exponent) {
+           memcpy(buffer + offset, stk + 1 + exponent, length - exponent);
+           offset += length - exponent;
+       }
+       else
+           buffer[offset++] = '0';
+    }
+    else {
+       buffer[offset++] = '0';
+       buffer[offset++] = '.';
+       while (exponent < 0) {
+           buffer[offset++] = '0';
+           exponent++;
+       }
+       memcpy(buffer + offset, stk + 1, length);
+       offset += length;
+    }
+    buffer[offset] = '\0';
+
+    again = 0;
+fixed_float_check_again:
+    /* make sure only d digits are printed after decimal point */
+    if (d > 0) {
+       char *dptr = strchr(buffer, '.');
+
+       length = strlen(dptr) - 1;
+       /* check if need to remove excess digits */
+       if (length > d) {
+           int digit;
+
+           offset = (dptr - buffer) + 1 + d;
+           digit = buffer[offset];
+
+           /* remove extra digits */
+           buffer[offset] = '\0';
+
+           /* check if need to round */
+           if (!again && offset > 1 && isdigit(digit) && digit >= '5' &&
+               isdigit(buffer[offset - 1]) &&
+               float_string_inc(buffer, offset - 1))
+               ++offset;
+       }
+       /* check if need to add extra zero digits to fill space */
+       else if (length < d) {
+           offset += d - length;
+           for (++length; length <= d; length++)
+               dptr[length] = '0';
+           dptr[length] = '\0';
+       }
+    }
+    else {
+       /* no digits after decimal point */
+       int digit, inc = 0;
+       char *dptr = strchr(buffer, '.') + 1;
+
+       digit = *dptr;
+       if (!again && digit >= '5' && dptr >= buffer + 2 && isdigit(dptr[-2]))
+           inc = float_string_inc(buffer, dptr - buffer - 2);
+
+       offset = (dptr - buffer) + inc;
+       buffer[offset] = '\0';
+    }
+
+    /* if d was not specified, remove any extra zeros */
+    if (pd == NULL) {
+       while (offset > 2 && buffer[offset - 2] != '.' &&
+              buffer[offset - 1] == '0')
+           --offset;
+       buffer[offset] = '\0';
+    }
+
+    if (w > 0 && offset > w) {
+       /* first check if can remove extra fractional digits */
+       if (pd == NULL) {
+           char *ptr = strchr(buffer, '.') + 1;
+
+           if (ptr - buffer < w) {
+               d = w - (ptr - buffer);
+               goto fixed_float_check_again;
+           }
+       }
+
+       /* remove leading "zero" to save space */
+       if ((!sign && buffer[0] == '0') || (sign && buffer[1] == '0')) {
+           /* ending nul also copied */
+           memmove(buffer + sign, buffer + sign + 1, offset);
+           --offset;
+       }
+       /* remove leading '+' to "save" space */
+       if (offset > w && buffer[0] == '+') {
+           /* ending nul also copied */
+           memmove(buffer, buffer + 1, offset);
+           --offset;
+       }
+    }
+
+    /* if cannot represent number in given width */
+    if (overflowchar && offset > w) {
+       again = 1;
+       goto fixed_float_overflow;
+    }
+
+    length = 0;
+    /* print padding if required */
+    if (w > offset)
+       length += LispWriteChars(stream, padchar, w - offset);
+
+    /* print float number representation */
+    return (LispWriteStr(stream, buffer, offset) + length);
+
+fixed_float_overflow:
+    return (LispWriteChars(stream, overflowchar, w));
+}
+
+int
+LispFormatExponentialFloat(LispObj *stream, LispObj *object,
+                          int atsign, int w, int *pd, int e, int k,
+                          int overflowchar, int padchar, int exponentchar)
+{
+    return (LispDoFormatExponentialFloat(stream, object, atsign, w,
+                                        pd, e, k, overflowchar, padchar,
+                                        exponentchar, 1));
+}
+
+int
+LispDoFormatExponentialFloat(LispObj *stream, LispObj *object,
+                            int atsign, int w, int *pd, int e, int k,
+                            int overflowchar, int padchar, int exponentchar,
+                            int format)
+{
+    char buffer[512], stk[64];
+    int sign, exponent, length, offset, d = pd ? *pd : FLOAT_PREC;
+    double value = DFLOAT_VALUE(object);
+
+    if (value == 0.0) {
+       exponent = 0;
+       k = 1;
+       strcpy(stk, "+0");
+    }
+    else
+       /* calculate format parameters, adjusting scale factor */
+       parse_double(stk, &exponent, value, d + k - 1);
+
+    /* set e to a value that won't overflow */
+    if (e > 16)
+       e = 16;
+
+    /* set k to a value that won't overflow */
+    if (k > 128)
+       k = 128;
+    else if (k < -128)
+       k = -128;
+
+    /* set d to a value that won't overflow */
+    if (d > 128)
+       d = 128;
+    else if (d < -128)
+       d = -128;
+
+    /* how many bytes in float representation */
+    length = strlen(stk) - 1;
+
+    /* need to print a sign? */
+    sign = atsign || (stk[0] == '-');
+
+    /* adjust number of digits after decimal point */
+    if (k > 0)
+       d -= k - 1;
+
+    /* adjust exponent, based on scale factor */
+    exponent -= k - 1;
+
+    /* format number, cannot overflow, as control variables were checked */
+    offset = 0;
+    if (sign)
+       buffer[offset++] = stk[0];
+    if (k > 0) {
+       if (k > length) {
+           memcpy(buffer + offset, stk + 1, length);
+           offset += length;
+       }
+       else {
+           memcpy(buffer + offset, stk + 1, k);
+           offset += k;
+       }
+       buffer[offset++] = '.';
+       if (length > k) {
+           memcpy(buffer + offset, stk + 1 + k, length - k);
+           offset += length - k;
+       }
+       else
+           buffer[offset++] = '0';
+    }
+    else {
+       int tmp = k;
+
+       buffer[offset++] = '0';
+       buffer[offset++] = '.';
+       while (tmp < 0) {
+           buffer[offset++] = '0';
+           tmp++;
+       }
+       memcpy(buffer + offset, stk + 1, length);
+       offset += length;
+    }
+
+    /* if format, then always add a sign to exponent */
+    buffer[offset++] = exponentchar;
+    if (format || exponent < 0)
+       buffer[offset++] = exponent < 0 ? '-' : '+';
+
+    /* XXX destroy stk contents */
+    sprintf(stk, "%%0%dd", e);
+    /* format scale factor*/
+    length = sprintf(buffer + offset, stk,
+                    exponent < 0 ? -exponent : exponent);
+    /* check for overflow in exponent */
+    if (length > e && overflowchar)
+       goto exponential_float_overflow;
+    offset += length;
+
+    /* make sure only d digits are printed after decimal point */
+    if (d > 0) {
+       int currd;
+       char *dptr = strchr(buffer, '.'),
+            *eptr = strchr(dptr, exponentchar);
+
+       currd = eptr - dptr - 1;
+       length = strlen(eptr);
+
+       /* check if need to remove excess digits */
+       if (currd > d) {
+           int digit, dpos;
+
+           dpos = offset = (dptr - buffer) + 1 + d;
+           digit = buffer[offset];
+
+           memmove(buffer + offset, eptr, length + 1);
+           /* also copy ending nul character */
+
+           /* adjust offset to length of total string */
+           offset += length;
+
+           /* check if need to round */
+           if (dpos > 1 && isdigit(digit) && digit >= '5' &&
+               isdigit(buffer[dpos - 1]) &&
+               float_string_inc(buffer, dpos - 1))
+               ++offset;
+       }
+       /* check if need to add extra zero digits to fill space */
+       else if (pd && currd < d) {
+           memmove(eptr + d - currd, eptr, length + 1);
+           /* also copy ending nul character */
+
+           offset += d - currd;
+           for (++currd; currd <= d; currd++)
+               dptr[currd] = '0';
+       }
+       /* check if need to remove zeros */
+       else if (pd == NULL) {
+           int zeros = 1;
+
+           while (eptr[-zeros] == '0')
+               ++zeros;
+           if (eptr[-zeros] == '.')
+               --zeros;
+           if (zeros > 1) {
+               memmove(eptr - zeros + 1, eptr, length + 1);
+               offset -= zeros - 1;
+           }
+       }
+    }
+    else {
+       /* no digits after decimal point */
+       int digit, inc = 0;
+       char *dptr = strchr(buffer, '.'),
+            *eptr = strchr(dptr, exponentchar);
+
+       digit = dptr[1];
+
+       offset = (dptr - buffer) + 1;
+       length = strlen(eptr);
+       memmove(buffer + offset, eptr, length + 1);
+       /* also copy ending nul character */
+
+       if (digit >= '5' && dptr >= buffer + 2 &&
+           isdigit(dptr[-2]))
+           inc = float_string_inc(buffer, dptr - buffer - 2);
+
+       /* adjust offset to length of total string */
+       offset += length + inc;
+    }
+
+    if (w > 0 && offset > w) {
+       /* remove leading "zero" to save space */
+       if ((!sign && buffer[0] == '0') || (sign && buffer[1] == '0')) {
+           /* ending nul also copied */
+           memmove(buffer + sign, buffer + sign + 1, offset);
+           --offset;
+       }
+       /* remove leading '+' to "save" space */
+       if (offset > w && buffer[0] == '+') {
+           /* ending nul also copied */
+           memmove(buffer, buffer + 1, offset);
+           --offset;
+       }
+    }
+
+    /* if cannot represent number in given width */
+    if (overflowchar && offset > w)
+       goto exponential_float_overflow;
+
+    length = 0;
+    /* print padding if required */
+    if (w > offset)
+       length += LispWriteChars(stream, padchar, w - offset);
+
+    /* print float number representation */
+    return (LispWriteStr(stream, buffer, offset) + length);
+
+exponential_float_overflow:
+    return (LispWriteChars(stream, overflowchar, w));
+}
+
+int
+LispFormatGeneralFloat(LispObj *stream, LispObj *object,
+                      int atsign, int w, int *pd, int e, int k,
+                      int overflowchar, int padchar, int exponentchar)
+{
+    char stk[64];
+    int length, exponent, n, dd, ee, ww, d = pd ? *pd : FLOAT_PREC;
+    double value = DFLOAT_VALUE(object);
+
+    if (value == 0.0) {
+       exponent = 0;
+       n = 0;
+       d = 1;
+       strcpy(stk, "+0");
+    }
+    else {
+       /* calculate format parameters, adjusting scale factor */
+       parse_double(stk, &exponent, value, d + k - 1);
+       n = exponent + 1;
+    }
+
+    /* Let ee equal e+2, or 4 if e is omitted. */
+    if (e)
+       ee = e + 2;
+    else
+       ee = 4;
+
+    /* Let ww equal w-ee, or nil if w is omitted. */
+    if (w)
+       ww = w - ee;
+    else
+       ww = 0;
+
+    dd = d - n;
+    if (d >= dd && dd >= 0) {
+       length = LispFormatFixedFloat(stream, object, atsign, ww,
+                                     &dd, 0, overflowchar, padchar);
+
+       /* ~ee@T */
+       length += LispWriteChars(stream, padchar, ee);
+    }
+    else
+       length = LispFormatExponentialFloat(stream, object, atsign,
+                                           w, pd, e, k, overflowchar,
+                                           padchar, exponentchar);
+
+    return (length);
+}
+
+int
+LispFormatDollarFloat(LispObj *stream, LispObj *object,
+                     int atsign, int collon, int d, int n, int w, int padchar)
+{
+    char buffer[512], stk[64];
+    int sign, exponent, length, offset;
+    double value = DFLOAT_VALUE(object);
+
+    if (value == 0.0) {
+       exponent = 0;
+       strcpy(stk, "+0");
+    }
+    else
+       /* calculate format parameters, adjusting scale factor */
+       parse_double(stk, &exponent, value, d == 0 ? FLOAT_PREC : d + 1);
+
+    /* set d to a "sane" value */
+    if (d > 128)
+       d = 128;
+
+    /* set n to a "sane" value */
+    if (n > 128)
+       n = 128;
+
+    /* use exponent as index in stk */
+    ++exponent;
+
+    /* don't put sign in buffer,
+     * if collon specified, must go before padding */
+    sign = atsign || (stk[0] == '-');
+
+    offset = 0;
+
+    /* pad with zeros if required */
+    if (exponent > 0)
+       n -= exponent;
+    while (n > 0) {
+       buffer[offset++] = '0';
+       n--;
+    }
+
+    /* how many bytes in float representation */
+    length = strlen(stk) - 1;
+
+    if (exponent > 0) {
+       if (exponent > length) {
+           memcpy(buffer + offset, stk + 1, length);
+           memset(buffer + offset + length, '0', exponent - length);
+       }
+       else
+           memcpy(buffer + offset, stk + 1, exponent);
+       offset += exponent;
+       buffer[offset++] = '.';
+       if (length > exponent) {
+           memcpy(buffer + offset, stk + 1 + exponent, length - exponent);
+           offset += length - exponent;
+       }
+       else
+           buffer[offset++] = '0';
+    }
+    else {
+       if (n > 0)
+           buffer[offset++] = '0';
+       buffer[offset++] = '.';
+       while (exponent < 0) {
+           buffer[offset++] = '0';
+           exponent++;
+       }
+       memcpy(buffer + offset, stk + 1, length);
+       offset += length;
+    }
+    buffer[offset] = '\0';
+
+    /* make sure only d digits are printed after decimal point */
+    if (d > 0) {
+       char *dptr = strchr(buffer, '.');
+
+       length = strlen(dptr) - 1;
+       /* check if need to remove excess digits */
+       if (length > d) {
+           int digit;
+
+           offset = (dptr - buffer) + 1 + d;
+           digit = buffer[offset];
+
+           /* remove extra digits */
+           buffer[offset] = '\0';
+
+           /* check if need to round */
+           if (offset > 1 && isdigit(digit) && digit >= '5' &&
+               isdigit(buffer[offset - 1]) &&
+               float_string_inc(buffer, offset - 1))
+               ++offset;
+       }
+       /* check if need to add extra zero digits to fill space */
+       else if (length < d) {
+           offset += d - length;
+           for (++length; length <= d; length++)
+               dptr[length] = '0';
+           dptr[length] = '\0';
+       }
+    }
+    else {
+       /* no digits after decimal point */
+       int digit, inc = 0;
+       char *dptr = strchr(buffer, '.') + 1;
+
+       digit = *dptr;
+       if (digit >= '5' && dptr >= buffer + 2 && isdigit(dptr[-2]))
+           inc = float_string_inc(buffer, dptr - buffer - 2);
+
+       offset = (dptr - buffer) + inc;
+       buffer[offset] = '\0';
+    }
+
+    length = 0;
+    if (sign) {
+       ++offset;
+       if (atsign && collon)
+           length += LispWriteChar(stream, value >= 0.0 ? '+' : '-');
+    }
+
+    /* print padding if required */
+    if (w > offset)
+       length += LispWriteChars(stream, padchar, w - offset);
+
+    if (atsign && !collon)
+       length += LispWriteChar(stream, value >= 0.0 ? '+' : '-');
+
+    /* print float number representation */
+    return (LispWriteStr(stream, buffer, offset) + length);
+}
diff --git a/xedit/lisp/write.h b/xedit/lisp/write.h
new file mode 100644 (file)
index 0000000..b66ba6b
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/write.h,v 1.9tsi Exp $ */
+
+#ifndef Lisp_write_h
+#define Lisp_write_h
+
+#include "lisp/io.h"
+
+/*
+ * Prototypes
+ */
+void LispWriteInit(void);
+
+LispObj *Lisp_FreshLine(LispBuiltin*);
+LispObj *Lisp_Prin1(LispBuiltin*);
+LispObj *Lisp_Princ(LispBuiltin*);
+LispObj *Lisp_Print(LispBuiltin*);
+LispObj *Lisp_Terpri(LispBuiltin*);
+LispObj *Lisp_Write(LispBuiltin*);
+LispObj *Lisp_WriteChar(LispBuiltin*);
+LispObj *Lisp_WriteLine(LispBuiltin*);
+LispObj *Lisp_WriteString(LispBuiltin*);
+
+int LispGetColumn(LispObj*);
+
+int LispWriteChar(LispObj*, int);
+int LispWriteChars(LispObj*, int, int);
+int LispWriteStr(LispObj*, char*, long);
+
+       /* write any lisp object to stream */
+int LispWriteObject(LispObj*, LispObj*);
+
+/* formatted output */
+       /* object must be an integer */
+int LispFormatInteger(LispObj*, LispObj*, int, int, int, int, int, int, int);
+       /* must be in range 1 to 3999 for new roman, 1 to 4999 for old roman */
+int LispFormatRomanInteger(LispObj*, long, int);
+       /* must be in range -9999999 to 9999999 */
+int LispFormatEnglishInteger(LispObj*, long, int);
+       /* object must be a character */
+int LispFormatCharacter(LispObj*, LispObj*, int, int);
+       /* object must be a float */
+int LispFormatFixedFloat(LispObj*, LispObj*, int, int, int*, int, int, int);
+       /* object must be a float */
+int LispFormatExponentialFloat(LispObj*, LispObj*,
+                              int, int, int*, int, int, int, int, int);
+       /* object must be a float */
+int LispFormatGeneralFloat(LispObj*, LispObj*, int,
+                          int, int*, int, int, int, int, int);
+int LispFormatDollarFloat(LispObj*, LispObj*, int, int, int, int, int, int);
+
+#endif /* Lisp_write_h */
diff --git a/xedit/lisp/xedit.c b/xedit/lisp/xedit.c
new file mode 100644 (file)
index 0000000..a337912
--- /dev/null
@@ -0,0 +1,1636 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/xedit.c,v 1.25 2003/04/27 18:17:35 tsi Exp $ */
+
+#include "../xedit.h"
+#include <X11/Xaw/TextSrcP.h>  /* Needs some private definitions */
+#include <X11/Xaw/TextSinkP.h> /* Also needs private definitions... */
+#include <X11/Xmu/Xmu.h>
+#define XEDIT_LISP_PRIVATE
+#include "xedit.h"
+#include <signal.h>
+
+/* Initialize to enter lisp */
+#define LISP_SETUP()                                           \
+    int lisp__running = lisp__data.running
+
+/* XXX Maybe should use ualarm or better, setitimer, but one
+ *     second seens good enough to check for interrupts */
+
+#define        ENABLE_SIGALRM()                                        \
+    old_sigalrm = signal(SIGALRM, SigalrmHandler);             \
+    alarm(1)
+
+#define DISABLE_SIGALRM()                                      \
+    alarm(0);                                                  \
+    signal(SIGALRM, old_sigalrm)
+
+/* Enter lisp */
+#define LISP_ENTER()                                           \
+    if (!lisp__running) {                                      \
+       lisp__data.running = 1;                                 \
+       XFlush(XtDisplay(textwindow));                          \
+       ENABLE_SIGALRM();                                       \
+       if (sigsetjmp(lisp__data.jmp, 1) != 0) {                \
+           DISABLE_SIGALRM();                                  \
+           lisp__data.running = 0;                             \
+           return;                                             \
+       }                                                       \
+    }
+
+/* Leave lisp */
+#define LISP_LEAVE()                                           \
+    if (!lisp__running) {                                      \
+       DISABLE_SIGALRM();                                      \
+       LispTopLevel();                                         \
+       lisp__data.running = 0;                                 \
+    }
+
+/*
+ * Types
+ */
+typedef struct {
+    XawTextPosition left, right;
+    XrmQuark property;
+} EntityInfo;
+
+/*
+ * Prototypes
+ */
+static Bool ControlGPredicate(Display*, XEvent*, XPointer);
+static ssize_t WriteToStdout(int, const void*, size_t);
+static ssize_t WriteToStderr(int, const void*, size_t);
+static ssize_t WrapWrite(Widget, const void*, size_t);
+static void XeditUpdateModeInfos(void);
+static void XeditPrint(Widget, LispObj*, int);
+static void XeditInteractiveCallback(Widget, XtPointer, XtPointer);
+static void XeditIndentationCallback(Widget, XtPointer, XtPointer);
+static LispObj *XeditCharAt(LispBuiltin*, int);
+static LispObj *XeditSearch(LispBuiltin*, XawTextScanDirection);
+
+/*
+ * Initialization
+ */
+#ifdef SIGNALRETURNSINT
+static int (*old_sigalrm)(int);
+#else
+static void (*old_sigalrm)(int);
+#endif
+
+EditModeInfo *mode_infos;
+Cardinal num_mode_infos;
+
+static LispObj *Oauto_modes, *Oauto_mode, *Osyntax_highlight, *Osyntable_indent;
+
+/* Just to make calling interactive reparse easier */
+static LispObj interactive_arguments[4];
+
+static LispObj *justify_modes[4];
+static LispObj *wrap_modes[3];
+static LispObj *scan_types[6];
+static LispObj *scan_directions[2];
+static LispObj execute_stream;
+static LispString execute_string;
+static LispObj result_stream;
+static LispString result_string;
+static XawTextPropertyList **property_lists;
+static Cardinal num_property_lists;
+
+/* Some hacks to (at lest try to) avoid problems reentering Xlib while
+ * testing for user interrupts */
+static volatile int disable_timeout, request_timeout;
+
+extern int pagesize;
+
+static LispBuiltin xeditbuiltins[] = {
+    {LispFunction, Xedit_AddEntity, "add-entity offset length identifier"},
+    {LispFunction, Xedit_AutoFill, "auto-fill &optional value"},
+    {LispFunction, Xedit_Background, "background &optional color"},
+    {LispFunction, Xedit_CharAfter, "char-after &optional offset"},
+    {LispFunction, Xedit_CharBefore, "char-before &optional offset"},
+    {LispFunction, Xedit_ClearEntities, "clear-entities left right"},
+    {LispFunction, Xedit_ConvertPropertyList, "convert-property-list name definition"},
+    {LispFunction, Xedit_Font, "font &optional font"},
+    {LispFunction, Xedit_Foreground, "foreground &optional color"},
+    {LispFunction, Xedit_GotoChar, "goto-char offset"},
+    {LispFunction, Xedit_HorizontalScrollbar, "horizontal-scrollbar &optional state"},
+    {LispFunction, Xedit_Insert, "insert text"},
+    {LispFunction, Xedit_Justification, "justification &optional value"},
+    {LispFunction, Xedit_LeftColumn, "left-column &optional left"},
+    {LispFunction, Xedit_Point, "point"},
+    {LispFunction, Xedit_PointMax, "point-max"},
+    {LispFunction, Xedit_PointMin, "point-min"},
+    {LispFunction, Xedit_PropertyList, "property-list &optional value"},
+    {LispFunction, Xedit_ReadText, "read-text offset length"},
+    {LispFunction, Xedit_ReplaceText, "replace-text left right text"},
+    {LispFunction, Xedit_RightColumn, "right-column &optional right"},
+    {LispFunction, Xedit_Scan, "scan offset type direction &key count include"},
+    {LispFunction, Xedit_SearchBackward, "search-backward string &optional offset ignore-case"},
+    {LispFunction, Xedit_SearchForward, "search-forward string &optional offset ignore-case"},
+    {LispFunction, Xedit_VerticalScrollbar, "vertical-scrollbar &optional state"},
+    {LispFunction, Xedit_WrapMode, "wrap-mode &optional value"},
+
+       /* This should be available from elsewhere at some time... */
+    {LispFunction, Xedit_XrmStringToQuark, "xrm-string-to-quark string"},
+};
+
+/*
+ * Implementation
+ */
+/*ARGUSED*/
+static Bool
+ControlGPredicate(Display *display, XEvent *event, XPointer arguments)
+{
+    char buffer[2];
+
+    return ((event->type == KeyPress || event->type == KeyRelease) &&
+           (event->xkey.state & ControlMask) &&
+           XLookupString(&(event->xkey), buffer, sizeof(buffer), NULL, NULL) &&
+           buffer[0] == '\a');
+}
+
+/*ARGSUSED*/
+static
+#ifdef SIGNALRETURNSINT
+int
+#else
+void
+#endif
+SigalrmHandler(int signum)
+{
+    XEvent event;
+
+    if (disable_timeout) {
+       request_timeout = 1;
+       return;
+    }
+
+    /* Check if user pressed C-g */
+    if (XCheckIfEvent(XtDisplay(textwindow), &event, ControlGPredicate, NULL)) {
+       XPutBackEvent(XtDisplay(textwindow), &event);
+       alarm(0);
+       /* Tell a signal was received, print message for SIGINT */
+       LispSignal(SIGINT);
+    }
+    else
+       alarm(1);
+#ifdef SIGNALRETURNSINT
+    return (0);
+#endif
+}
+
+static ssize_t
+WrapWrite(Widget output, const void *buffer, size_t nbytes)
+{
+    XawTextBlock block;
+    XawTextPosition position;
+
+    disable_timeout = 1;
+    position = XawTextGetInsertionPoint(output);
+    block.firstPos = 0;
+    block.format = FMT8BIT;
+    block.length = nbytes;
+    block.ptr = (String)buffer;
+    XawTextReplace(output, position, position, &block);
+    XawTextSetInsertionPoint(output, position + block.length);
+    disable_timeout = 0;
+
+    if (request_timeout) {
+       XFlush(XtDisplay(output));
+       request_timeout = 0;
+       SigalrmHandler(SIGALRM);
+    }
+
+    return ((ssize_t)nbytes);
+}
+
+static ssize_t
+WriteToStdout(int fd, const void *buffer, size_t nbytes)
+{
+    return (WrapWrite(textwindow, buffer, nbytes));
+}
+
+static ssize_t
+WriteToStderr(int fd, const void *buffer, size_t nbytes)
+{
+    return (WrapWrite(messwidget, buffer, nbytes));
+}
+
+void
+LispXeditInitialize(void)
+{
+    int i;
+    char *string;
+    LispObj *xedit, *list, *savepackage;
+
+    LispSetFileWrite(Stdout, WriteToStdout);
+    LispSetFileWrite(Stderr, WriteToStderr);
+
+    justify_modes[0]   = KEYWORD("LEFT");
+    justify_modes[1]   = KEYWORD("RIGHT");
+    justify_modes[2]   = KEYWORD("CENTER");
+    justify_modes[3]   = KEYWORD("FULL");
+
+    wrap_modes[0]      = KEYWORD("NEVER");
+    wrap_modes[1]      = KEYWORD("LINE");
+    wrap_modes[2]      = KEYWORD("WORD");
+
+    scan_types[0]      = KEYWORD("POSITIONS");
+    scan_types[1]      = KEYWORD("WHITE-SPACE");
+    scan_types[2]      = KEYWORD("EOL");
+    scan_types[3]      = KEYWORD("PARAGRAPH");
+    scan_types[4]      = KEYWORD("ALL");
+    scan_types[5]      = KEYWORD("ALPHA-NUMERIC");
+
+    scan_directions[0] = justify_modes[0];
+    scan_directions[1] = justify_modes[1];
+
+    /* Remember value of current package */
+    savepackage = PACKAGE;
+
+    /* Create the XEDIT package */
+    xedit = LispNewPackage(STRING("XEDIT"), NIL);
+
+    /* Update list of packages */
+    PACK = CONS(xedit, PACK);
+
+    /* Temporarily switch to the XEDIT package */
+    lisp__data.pack = lisp__data.savepack = xedit->data.package.package;
+    PACKAGE = xedit;
+
+    /* Add XEDIT builtin functions */
+    for (i = 0; i < sizeof(xeditbuiltins) / sizeof(xeditbuiltins[0]); i++)
+       LispAddBuiltinFunction(&xeditbuiltins[i]);
+
+    /* Create these objects in the xedit package */
+    Oauto_modes                = STATIC_ATOM("*AUTO-MODES*");
+    Oauto_mode         = STATIC_ATOM("AUTO-MODE");
+    Osyntax_highlight  = STATIC_ATOM("SYNTAX-HIGHLIGHT");
+    Osyntable_indent   = STATIC_ATOM("SYNTABLE-INDENT");
+
+    /*  Import symbols from the LISP and EXT packages */
+    for (list = PACK; CONSP(list); list = CDR(list)) {
+       string = THESTR(CAR(list)->data.package.name);
+       if (strcmp(string, "LISP") == 0 || strcmp(string, "EXT") == 0)
+           LispUsePackage(CAR(list));
+    }
+
+    /* Restore previous package */
+    lisp__data.pack = savepackage->data.package.package;
+    PACKAGE = savepackage;
+
+    /* Initialize helper static objects used when executing expressions */
+    execute_stream.type = LispStream_t;
+    execute_stream.data.stream.source.string = &execute_string;
+    execute_stream.data.stream.pathname = NIL;
+    execute_stream.data.stream.type = LispStreamString;
+    execute_stream.data.stream.readable = 1;
+    execute_stream.data.stream.writable = 0;
+    execute_string.output = 0;
+    result_stream.type = LispStream_t;
+    result_stream.data.stream.source.string = &result_string;
+    result_stream.data.stream.pathname = NIL;
+    result_stream.data.stream.type = LispStreamString;
+    result_stream.data.stream.readable = 0;
+    result_stream.data.stream.writable = 1;
+    result_string.string = XtMalloc(pagesize);
+    result_string.space = pagesize;
+
+    /* Initialize interactive edition function arguments */
+    /* first argument is syntax table */
+    interactive_arguments[0].type = LispCons_t;
+    interactive_arguments[0].data.cons.cdr = &interactive_arguments[1];
+    /* second argument is where to start reparsing */
+    interactive_arguments[1].type = LispCons_t;
+    interactive_arguments[1].data.cons.cdr = &interactive_arguments[2];
+    /* third argument is where to stop reparsing */
+    interactive_arguments[2].type = LispCons_t;
+    interactive_arguments[2].data.cons.cdr = &interactive_arguments[3];
+    /* fourth argument is interactive flag */
+    interactive_arguments[3].type = LispCons_t;
+    interactive_arguments[3].data.cons.car = T;
+    interactive_arguments[3].data.cons.cdr = NIL;
+
+    /* Load extra functions and data type definitions */
+    EXECUTE("(require \"xedit\")");
+
+
+    /*
+     * This assumes that the *auto-modes* variable is a list where every
+     * item has the format:
+     *     (regexp string-desc load-file-desc . symbol-name)
+     * Minimal error checking is done.
+     */
+
+    if (Oauto_modes->data.atom->a_object) {
+       LispObj *desc, *modes = Oauto_modes->data.atom->property->value;
+
+       for (; CONSP(modes); modes = CDR(modes)) {
+           list = CAR(modes);
+
+           desc = NIL;
+           for (i = 0; i < 3 && CONSP(list); i++, list = CDR(list)) {
+               if (i == 1)
+                   desc = CAR(list);
+           }
+           if (i == 3 && STRINGP(desc)) {
+               mode_infos = (EditModeInfo*)
+                   XtRealloc((XtPointer)mode_infos, sizeof(EditModeInfo) *
+                             (num_mode_infos + 1));
+               mode_infos[num_mode_infos].desc = XtNewString(THESTR(desc));
+               mode_infos[num_mode_infos].symbol = list;
+               mode_infos[num_mode_infos].syntax = NULL;
+               ++num_mode_infos;
+           }
+       }
+    }
+}
+
+static void
+XeditUpdateModeInfos(void)
+{
+    int i;
+
+    for (i = 0; i < num_mode_infos; i++) {
+       if (mode_infos[i].symbol &&
+           mode_infos[i].syntax == NULL &&
+           XSYMBOLP(mode_infos[i].symbol) &&
+           mode_infos[i].symbol->data.atom->a_object)
+           mode_infos[i].syntax =
+               mode_infos[i].symbol->data.atom->property->value;
+    }
+}
+
+void
+XeditLispExecute(Widget output, XawTextPosition left, XawTextPosition right)
+{
+    GC_ENTER();
+    LISP_SETUP();
+    int alloced, return_count;
+    XawTextBlock block;
+    XawTextPosition position;
+    char *string, *ptr;
+    LispObj *result, *code, *_cod, *returns;
+
+    LISP_ENTER();
+
+    position = left;
+    XawTextSourceRead(XawTextGetSource(textwindow), left, &block, right - left);
+    if (block.length < right - left) {
+       alloced = 1;
+       string = ptr = LispMalloc(right - left);
+       memcpy(ptr, block.ptr, block.length);
+       position = left + block.length;
+       ptr += block.length;
+       for (; position < right;) {
+           XawTextSourceRead(XawTextGetSource(textwindow),
+                             position, &block, right - position);
+           memcpy(ptr, block.ptr, block.length);
+           position += block.length;
+           ptr += block.length;
+       }
+    }
+    else {
+       alloced = 0;
+       string = block.ptr;
+    }
+
+    execute_string.string = string;
+    execute_string.length = right - left;
+    execute_string.input = 0;
+    LispPushInput(&execute_stream);
+    _cod = COD;
+    result = NIL;
+    if ((code = LispRead()) != NULL)
+       result = EVAL(code);
+    COD = _cod;
+    LispPopInput(&execute_stream);
+
+    returns = NIL;
+    if (RETURN_COUNT > 0) {
+       GC_PROTECT(result);
+       returns = _cod = CONS(RETURN(0), NIL);
+       GC_PROTECT(returns);
+       for (return_count = 1; return_count < RETURN_COUNT; return_count++) {
+           RPLACD(_cod, CONS(RETURN(return_count), NIL));
+           _cod = CDR(_cod);
+       }
+    }
+    LispFflush(Stdout);
+    LispUpdateResults(code, result);
+    if (RETURN_COUNT >= 0) {
+       XeditPrint(output, result, 1);
+       for (; CONSP(returns); returns = CDR(returns))
+           XeditPrint(output, CAR(returns), 0);
+    }
+
+    if (alloced)
+       LispFree(string);
+    GC_LEAVE();
+
+    LISP_LEAVE();
+}
+
+static void
+XeditPrint(Widget output, LispObj *object, int newline)
+{
+    XawTextBlock block;
+    XawTextPosition position;
+
+    result_string.length = result_string.output = 0;
+    if (newline) {
+       position = XawTextGetInsertionPoint(output);
+       if (position != XawTextSourceScan(XawTextGetSource(output),
+                                         position, XawstEOL,
+                                         XawsdLeft, 1, False))
+           LispSputc(&result_string, '\n');
+    }
+    LispWriteObject(&result_stream, object);
+    LispSputc(&result_string, '\n');
+
+    position = XawTextGetInsertionPoint(output);
+    block.firstPos = 0;
+    block.format = FMT8BIT;
+    block.length = result_string.length;
+    block.ptr = result_string.string;
+    XawTextReplace(output, position, position, &block);
+    XawTextSetInsertionPoint(output, position + block.length);
+}
+
+/*
+ *  This function is defined here to avoid exporting all the lisp interfaces
+ * to the core xedit code.
+ */
+void
+XeditLispSetEditMode(xedit_flist_item *item, LispObj *symbol)
+{
+    GC_ENTER();
+    LISP_SETUP();
+    LispObj *syntax, *name;
+
+    item->xldata = (XeditLispData*)XtCalloc(1, sizeof(XeditLispData));
+
+    LISP_ENTER();
+
+    /* Create an object that represents the buffer filename.
+     * Note that the entire path is passed to the auto-mode
+     * function, so that directory names may be also be used
+     * when determining a file type. */
+    name = STRING(item->filename);
+    GC_PROTECT(name);
+
+    /*  Call the AUTO-MODE function to check if there is a
+     * syntax definition for the file being loaded */
+    if (symbol == NULL)
+       syntax = APPLY1(Oauto_mode, name);
+    else
+       syntax = APPLY2(Oauto_mode, name, symbol);
+
+    /* Don't need the name object anymore */
+    GC_LEAVE();
+
+    if (syntax != NIL) {
+       Arg arg[1];
+       LispObj arguments;
+       XawTextPropertyList *property_list;
+
+       item->xldata->syntax = syntax;
+
+       /* Apply the syntax highlight to the current buffer */
+       arguments.type = LispCons_t;
+       arguments.data.cons.car = syntax;
+       arguments.data.cons.cdr = NIL;
+       LispFuncall(Osyntax_highlight, &arguments, 1);
+
+       /*  The previous call added the property list to the widget,
+        * remember it when switching sources. */
+       XtSetArg(arg[0], XawNtextProperties, &property_list);
+       XtGetValues(XawTextGetSink(textwindow), arg, 1);
+       item->properties = property_list;
+
+       /* Add callback for interactive changes */
+       XtAddCallback(item->source, XtNpropertyCallback,
+                     XeditInteractiveCallback, item->xldata);
+
+       /* Update information as a new file may have been loaded */
+       XeditUpdateModeInfos();
+    }
+    else
+       item->properties = NULL;
+
+    LISP_LEAVE();
+}
+
+void
+XeditLispUnsetEditMode(xedit_flist_item *item)
+{
+    if (item->xldata) {
+       XtRemoveCallback(item->source, XtNpropertyCallback,
+                        XeditInteractiveCallback, item->xldata);
+       XtFree((XtPointer)item->xldata);
+       item->xldata = NULL;
+    }
+}
+
+#define MAX_INFOS      32
+/*
+ *  This callback tries to do it's best in generating correct output while
+ * also doing minimal work/redrawing of the screen. It probably will fail
+ * for some syntax-definitions, or will just not properly repaint the
+ * screen. In the later case, just press Ctrl+L.
+ *  There isn't yet any command to force reparsing of some regions, and if
+ * the parser becomes confused, you may need to go to a line, press a space
+ * and undo, just to force it to reparse the line, and possibly some extra
+ * lines until the parser thinks the display is in sync.
+ *  Sometimes it will repaint a lot more of text than what is being requested
+ * by this callback, this should be fixed at some time, as for certain cases
+ * it is also required some redesign in the Xaw interface.
+ */
+static void
+XeditInteractiveCallback(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    LISP_SETUP();
+    XeditLispData *data = (XeditLispData*)client_data;
+    LispObj *syntax = data->syntax;
+    XawTextPropertyInfo *info = (XawTextPropertyInfo*)call_data;
+    LispObj *result, *syntable;
+    XawTextAnchor *anchor;
+    XawTextEntity *entity;
+    XawTextPosition first, last, left, right, begin, next, tmp, position;
+    int i, j, indent;
+    TextSrcObject src = (TextSrcObject)w;
+    EntityInfo oinfo[MAX_INFOS], ninfo[MAX_INFOS];
+    XrmQuark props[MAX_INFOS];
+    int num_oinfo, num_ninfo, num_props;
+    XmuScanline *clip, *oclip, *nclip;
+    XmuSegment segment, *seg;
+
+    if (data->disable_highlight)
+       return;
+
+    LISP_ENTER();
+
+    first = XawTextSourceScan(w, 0, XawstAll, XawsdLeft, 1, True);
+    last = XawTextSourceScan(w, 0, XawstAll, XawsdRight, 1, True);
+
+    left = info->left;
+    right = left + info->block->length;
+
+    /* For now, only call the indent hook if a single character was typed */
+    indent = (info->right == left) && (right == left + 1);
+
+    /* Always reparse full lines */
+    left = begin = XawTextSourceScan(w, left, XawstEOL, XawsdLeft, 1, False);
+    right = next = XawTextSourceScan(w, right, XawstEOL, XawsdRight, 1, False);
+
+
+    /*  Check properties in the modified text. If a complex nested syntax
+     * table was parsed, the newline has it's default property, so, while
+     * the newline has a property, backup a line to make sure everything is
+     * properly parsed.
+     *  Maybe should limit the number of backuped lines, but if the parsing
+     * becomes noticeable slow, better to rethink the syntax definition. */
+    while (left > first) {
+       position = XawTextSourceScan(w, left, XawstEOL, XawsdLeft, 1, True);
+       if (XawTextSourceAnchorAndEntity(w, position, &anchor, &entity))
+           left = XawTextSourceScan(w, left, XawstEOL, XawsdLeft, 2, False);
+       else
+           break;
+    }
+
+    /* While the newline after the right position has a "hidden" property,
+     * keep incrementing a line to be reparsed. */
+    while (right < last) {
+       if (XawTextSourceAnchorAndEntity(w, right, &anchor, &entity))
+           right = XawTextSourceScan(w, right, XawstEOL, XawsdRight, 2, False);
+       else
+           break;
+    }
+
+#ifndef MAX
+#define MAX(a, b)      ((a) > (b) ? (a) : (b))
+#endif
+
+#ifndef MIN
+#define MIN(a, b)      ((a) < (b) ? (a) : (b))
+#endif
+
+#define STORE_STATE(count, info, from, to)                             \
+    (count) = 0;                                                       \
+    if ((anchor = XawTextSourceFindAnchor(w, (from))) != NULL) {       \
+       entity = anchor->entities;                                      \
+       /* Find first entity in the region to parse */                  \
+       while (entity &&                                                \
+              anchor->position + entity->offset + entity->length <=    \
+              (from))                                                  \
+           entity = entity->next;                                      \
+       /* Loop storing information */                                  \
+       while (entity &&                                                \
+           (position = anchor->position + entity->offset) < (to)) {    \
+           (info)[(count)].left = MAX(position, (from));               \
+           position += entity->length;                                 \
+           (info)[(count)].right = MIN(position, (to));                \
+           (info)[(count)].property = entity->property;                \
+           /* If the changes are so complex, user need press Ctrl+L */ \
+           if (++(count) >= MAX_INFOS)                                 \
+               break;                                                  \
+           if ((entity = entity->next) == NULL &&                      \
+               (anchor = XawTextSourceNextAnchor(w, anchor)) != NULL)  \
+               entity = anchor->entities;                              \
+       }                                                               \
+    }
+
+    /* Remember old state */
+    STORE_STATE(num_oinfo, oinfo, begin, right);
+
+    /* Reparse the lines in the modified/edited range of text */
+    interactive_arguments[0].data.cons.car = syntax;
+    interactive_arguments[1].data.cons.car = FIXNUM(left);
+    interactive_arguments[2].data.cons.car = FIXNUM(right);
+    result = APPLY(Osyntax_highlight, &interactive_arguments[0]);
+    /* Indent table is the second return value */
+    if (RETURN_COUNT)
+       syntable = RETURN(0);
+    else
+       syntable = NIL;
+
+    /* This normally is the same value as right, but the parser may have
+     * continued when the syntax table stack did not finish. */
+    if (FIXNUMP(result))
+       right = FIXNUM_VALUE(result);
+
+    LISP_LEAVE();
+
+    /* Check what have changed */
+    STORE_STATE(num_ninfo, ninfo, begin, right);
+
+    /* Initialize to redraw everything. */
+    clip = XmuNewScanline(0, begin, right);
+
+#define CLIP_MASK(mask, from, to)                                      \
+    if ((from) < (to)) {                                               \
+       segment.x1 = (from);                                            \
+       segment.x2 = (to);                                              \
+       XmuScanlineOrSegment((mask), &segment);                         \
+    }
+
+    oclip = XmuNewScanline(0, 0, 0);
+    nclip = XmuNewScanline(0, 0, 0);
+
+#define CLIP_DEFAULT(mask, from, info, num_info)                       \
+    for (tmp = (from), i = 0; i < (num_info); i++) {                   \
+       CLIP_MASK((mask), tmp, (info)[i].left);                         \
+       tmp = (info)[i].right;                                          \
+    }
+
+    /* First generate masks of regions with the default property */
+    CLIP_DEFAULT(oclip, begin, oinfo, num_oinfo);
+    CLIP_DEFAULT(nclip, begin, ninfo, num_ninfo);
+
+    /* Store unchanged region in oclip */
+    XmuScanlineAnd(oclip, nclip);
+
+    /* Don't need to redraw the region in oclip */
+    XmuScanlineXor(clip, oclip);
+
+#define LIST_PROPERTIES(prop, num_prop, info, num_info)                        \
+    (num_prop) = 0;                                                    \
+    for (i = 0; i < (num_info); i++) {                                 \
+       for (j = 0; j < (num_prop); j++)                                \
+           if ((prop)[j] == (info)[i].property)                        \
+               break;                                                  \
+       if (j == (num_prop))                                            \
+           (prop)[(num_prop)++] = (info)[i].property;                  \
+    }
+
+    /* Prepare to generate masks of regions of text with defined properties */
+    LIST_PROPERTIES(props, num_props, oinfo, num_oinfo);
+
+#define CLIP_PROPERTY(mask, prop, info, num_info)                      \
+    for (j = 0; j < (num_info); j++) {                                 \
+       if ((info)[j].property == (prop)) {                             \
+           CLIP_MASK((mask), (info)[j].left, (info)[j].right);         \
+       }                                                               \
+    }
+
+    /* Only care about the old properties, new ones need to be redrawn */
+    for (i = 0; i < num_props; i++) {
+       XrmQuark property = props[i];
+
+       /* Reset oclip and nclip */
+       XmuScanlineXor(oclip, oclip);
+       XmuScanlineXor(nclip, nclip);
+
+       /* Generate masks */
+       CLIP_PROPERTY(oclip, property, oinfo, num_oinfo);
+       CLIP_PROPERTY(nclip, property, ninfo, num_ninfo);
+
+       /* Store unchanged region in oclip */
+       XmuScanlineAnd(oclip, nclip);
+
+       /* Don't need to redraw the region in oclip */
+       XmuScanlineXor(clip, oclip);
+       XmuOptimizeScanline(clip);
+    }
+
+    XmuDestroyScanline(oclip);
+    XmuDestroyScanline(nclip);
+
+    /* Tell Xaw that need update some regions */
+    for (seg = clip->segment; seg; seg = seg->next) {
+       for (i = 0; i < src->textSrc.num_text; i++)
+           /* This really should have an exported interface... */
+           _XawTextNeedsUpdating((TextWidget)(src->textSrc.text[i]),
+                                 seg->x1, seg->x2 + (seg->x2 > next));
+    }
+    XmuDestroyScanline(clip);
+
+    data->syntable = syntable;
+    /* XXX check lisp__running to know if at the toplevel parsing state */
+    if (indent && syntable != NIL && !lisp__running &&
+       /* Doing an undo, probably will need an exported interface for this
+        * case. Should not change the text now. */
+       (!src->textSrc.enable_undo || !src->textSrc.undo_state))
+       XtAddCallback(textwindow, XtNpositionCallback,
+                     XeditIndentationCallback, data);
+}
+
+/*
+ * This callback is called if the syntax table where the cursor is located
+ * defines an indentation function.
+ */
+static void
+XeditIndentationCallback(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    LISP_SETUP();
+    LispObj *indentp;
+    XeditLispData *data = (XeditLispData*)client_data;
+
+    data->disable_highlight = True;
+    XtRemoveCallback(w, XtNpositionCallback, XeditIndentationCallback, data);
+
+    LISP_ENTER();
+
+    /* Get pointer to indentation function */
+    indentp = APPLY1(Osyntable_indent, data->syntable);
+
+    /* Execute indentation function */
+    if (indentp != NIL)
+       APPLY2(indentp, data->syntax, data->syntable);
+
+    data->disable_highlight = False;
+
+    LISP_LEAVE();
+}
+
+/************************************************************************
+ * Builtin functions
+ ************************************************************************/
+LispObj *
+Xedit_AddEntity(LispBuiltin *builtin)
+/*
+ add-entity offset length identifier
+ */
+{
+    LispObj *offset, *length, *identifier;
+
+    identifier = ARGUMENT(2);
+    length = ARGUMENT(1);
+    offset = ARGUMENT(0);
+
+    CHECK_INDEX(offset);
+    CHECK_INDEX(length);
+    CHECK_LONGINT(identifier);
+
+    return (XawTextSourceAddEntity(XawTextGetSource(textwindow), 0, 0, NULL,
+                                  FIXNUM_VALUE(offset), FIXNUM_VALUE(length),
+                                  LONGINT_VALUE(identifier)) ? T : NIL);
+}
+
+LispObj *
+Xedit_AutoFill(LispBuiltin *builtin)
+/*
+ auto-fill &optional value
+ */
+{
+    Arg arg[1];
+    Boolean state;
+
+    LispObj *value;
+
+    value = ARGUMENT(0);
+
+    if (value != UNSPEC) {
+       XtSetArg(arg[0], XtNautoFill, value == NIL ? False : True);
+       XtSetValues(textwindow, arg, 1);
+    }
+    else {
+       XtSetArg(arg[0], XtNautoFill, &state);
+       XtGetValues(textwindow, arg, 1);
+       value = state ? T : NIL;
+    }
+
+    return (value);
+}
+
+LispObj *
+Xedit_Background(LispBuiltin *builtin)
+/*
+ background &optional color
+ */
+{
+    Pixel pixel;
+    Arg arg[1];
+    XrmValue from, to;
+
+    LispObj *color;
+
+    color = ARGUMENT(0);
+
+    if (color != UNSPEC) {
+       CHECK_STRING(color);
+
+       from.size = STRLEN(color);
+       from.addr = (XtPointer)THESTR(color);
+       to.size = sizeof(Pixel);
+       to.addr = (XtPointer)&pixel;
+
+       if (!XtConvertAndStore(XawTextGetSink(textwindow),
+                              XtRString, &from, XtRPixel, &to))
+           LispDestroy("cannot convert %s to Pixel", STROBJ(color));
+
+       XtSetArg(arg[0], XtNbackground, pixel);
+       XtSetValues(textwindow, arg, 1);
+    }
+    else {
+       from.size = sizeof(Pixel);
+       from.addr = (XtPointer)&pixel;
+       to.size = 0;
+       to.addr = NULL;
+
+       XtSetArg(arg[0], XtNbackground, &pixel);
+       XtGetValues(XawTextGetSink(textwindow), arg, 1);
+       /* This cannot fail */
+       XtConvertAndStore(textwindow, XtRPixel, &from, XtRString, &to);
+
+       color = STRING(to.addr);
+    }
+
+    return (color);
+}
+
+static LispObj *
+XeditCharAt(LispBuiltin *builtin, int before)
+{
+    Widget source = XawTextGetSource(textwindow);
+    XawTextPosition first, point, last;
+    XawTextBlock block;
+
+    LispObj *offset;
+
+    offset = ARGUMENT(0);
+    if (offset != UNSPEC) {
+       CHECK_INDEX(offset);
+    }
+
+    first = XawTextSourceScan(source, 0, XawstAll, XawsdLeft, 1, True);
+    if (FIXNUMP(offset))
+       point = FIXNUM_VALUE(offset);
+    else
+       point = XawTextGetInsertionPoint(textwindow);
+    if (before && point > first) {
+       XawTextPosition position =
+           XawTextSourceScan(source, point, XawstPositions, XawsdLeft, 1, True);
+
+       if (position < point)
+           point = position;
+       else
+           return (NIL);
+    }
+    last = XawTextSourceScan(source, 0, XawstAll, XawsdRight, 1, True);
+
+    if (point < first || point > last)
+       return (NIL);
+
+    XawTextSourceRead(source, point, &block, 1);
+
+    return (block.length ? SCHAR(*(unsigned char*)block.ptr) : NIL);
+}
+
+LispObj *
+Xedit_CharAfter(LispBuiltin *builtin)
+/*
+ char-after &optional offset
+ */
+{
+    return (XeditCharAt(builtin, 0));
+}
+
+LispObj *
+Xedit_CharBefore(LispBuiltin *builtin)
+/*
+ char-before &optional offset
+ */
+{
+    return (XeditCharAt(builtin, 1));
+}
+
+LispObj *
+Xedit_ClearEntities(LispBuiltin *builtin)
+/*
+ clear-entities left right
+ */
+{
+    LispObj *left, *right;
+
+    right = ARGUMENT(1);
+    left = ARGUMENT(0);
+
+    CHECK_INDEX(left);
+    CHECK_INDEX(right);
+
+    XawTextSourceClearEntities(XawTextGetSource(textwindow),
+                              FIXNUM_VALUE(left), FIXNUM_VALUE(right));
+
+    return (T);
+}
+
+LispObj *
+Xedit_ConvertPropertyList(LispBuiltin *builtin)
+/*
+ convert-property-list name definition
+ */
+{
+    LispObj *result;
+    XawTextPropertyList *property_list;
+
+    LispObj *name, *definition;
+
+    definition = ARGUMENT(1);
+    name = ARGUMENT(0);
+
+    CHECK_STRING(name);
+    CHECK_STRING(definition);
+
+    result = NIL;
+    property_list = XawTextSinkConvertPropertyList(THESTR(name),
+                                                  THESTR(definition),
+                                                  topwindow->core.screen,
+                                                  topwindow->core.colormap,
+                                                  topwindow->core.depth);
+
+    if (property_list) {
+       Cardinal i;
+
+       for (i = 0; i < num_property_lists; i++)
+           /* Check if a new property list was created */
+           if (property_lists[i]->identifier == property_list->identifier)
+               break;
+
+       /* Remember this pointer when asked back for it */
+       if (i == num_property_lists) {
+           property_lists = (XawTextPropertyList**)
+               XtRealloc((XtPointer)property_lists,
+                         sizeof(XawTextPropertyList) *
+                         (num_property_lists + 1));
+           property_lists[num_property_lists++] = property_list;
+       }
+       result = INTEGER(property_list->identifier);
+    }
+
+    return (result);
+}
+
+LispObj *
+Xedit_Font(LispBuiltin *builtin)
+/*
+ font &optional font
+ */
+{
+    XFontStruct *font_struct;
+    Arg arg[1];
+    XrmValue from, to;
+
+    LispObj *font;
+
+    font = ARGUMENT(0);
+
+    if (font != UNSPEC) {
+       CHECK_STRING(font);
+
+       from.size = STRLEN(font);
+       from.addr = (XtPointer)THESTR(font);
+       to.size = sizeof(XFontStruct*);
+       to.addr = (XtPointer)&font_struct;
+
+       if (!XtConvertAndStore(textwindow, XtRString, &from, XtRFontStruct, &to))
+           LispDestroy("cannot convert %s to FontStruct", STROBJ(font));
+
+       XtSetArg(arg[0], XtNfont, font_struct);
+       XtSetValues(textwindow, arg, 1);
+    }
+    else {
+       from.size = sizeof(XFontStruct*);
+       from.addr = (XtPointer)&font_struct;
+       to.size = 0;
+       to.addr = NULL;
+
+       XtSetArg(arg[0], XtNfont, &font_struct);
+       XtGetValues(XawTextGetSink(textwindow), arg, 1);
+       /* This cannot fail */
+       XtConvertAndStore(textwindow, XtRFontStruct, &from, XtRString, &to);
+
+       font = STRING(to.addr);
+    }
+
+    return (font);
+}
+
+LispObj *
+Xedit_Foreground(LispBuiltin *builtin)
+/*
+ foreground &optional color
+ */
+{
+    Pixel pixel;
+    Arg arg[1];
+    XrmValue from, to;
+
+    LispObj *color;
+
+    color = ARGUMENT(0);
+
+    if (color != UNSPEC) {
+       CHECK_STRING(color);
+
+       from.size = STRLEN(color);
+       from.addr = (XtPointer)THESTR(color);
+       to.size = sizeof(Pixel);
+       to.addr = (XtPointer)&pixel;
+
+       if (!XtConvertAndStore(XawTextGetSink(textwindow),
+                              XtRString, &from, XtRPixel, &to))
+           LispDestroy("cannot convert %s to Pixel", STROBJ(color));
+
+       XtSetArg(arg[0], XtNforeground, pixel);
+       XtSetValues(textwindow, arg, 1);
+    }
+    else {
+       from.size = sizeof(Pixel);
+       from.addr = (XtPointer)&pixel;
+       to.size = 0;
+       to.addr = NULL;
+
+       XtSetArg(arg[0], XtNforeground, &pixel);
+       XtGetValues(XawTextGetSink(textwindow), arg, 1);
+       /* This cannot fail */
+       XtConvertAndStore(textwindow, XtRPixel, &from, XtRString, &to);
+
+       color = STRING(to.addr);
+    }
+
+    return (color);
+}
+
+LispObj *
+Xedit_GotoChar(LispBuiltin *builtin)
+/*
+ goto-char offset
+ */
+{
+    LispObj *offset;
+    XawTextPosition point;
+
+    offset = ARGUMENT(0);
+
+    CHECK_INDEX(offset);
+    XawTextSetInsertionPoint(textwindow, FIXNUM_VALUE(offset));
+    point = XawTextGetInsertionPoint(textwindow);
+    if (point != FIXNUM_VALUE(offset))
+       offset = FIXNUM(point);
+
+    return (offset);
+}
+
+LispObj *
+Xedit_HorizontalScrollbar(LispBuiltin *builtin)
+/*
+ horizontal-scrollbar &optional state
+ */
+{
+    Arg arg[1];
+    XawTextScrollMode scroll;
+
+    LispObj *state;
+
+    state = ARGUMENT(0);
+
+    if (state != UNSPEC) {
+       scroll = state == NIL ? XawtextScrollNever : XawtextScrollAlways;
+       XtSetArg(arg[0], XtNscrollHorizontal, scroll);
+       XtSetValues(textwindow, arg, 1);
+    }
+    else {
+       XtSetArg(arg[0], XtNscrollHorizontal, &scroll);
+       XtGetValues(textwindow, arg, 1);
+       state = scroll == XawtextScrollAlways ? T : NIL;
+    }
+
+    return (state);
+}
+
+LispObj *
+Xedit_Insert(LispBuiltin *builtin)
+/*
+ insert text
+ */
+{
+    XawTextPosition point = XawTextGetInsertionPoint(textwindow);
+    XawTextBlock block;
+
+    LispObj *text;
+
+    text = ARGUMENT(0);
+
+    CHECK_STRING(text);
+    
+    block.firstPos = 0;
+    block.format = FMT8BIT;
+    block.length = STRLEN(text);
+    block.ptr = THESTR(text);
+    XawTextReplace(textwindow, point, point, &block);
+    XawTextSetInsertionPoint(textwindow, point + block.length);
+
+    return (text);
+}
+
+LispObj *
+Xedit_Justification(LispBuiltin *builtin)
+/*
+ justification &optional value
+ */
+{
+    int i;
+    Arg arg[1];
+    XawTextJustifyMode justify;
+
+    LispObj *value;
+
+    value = ARGUMENT(0);
+
+    if (value != UNSPEC) {
+       for (i = 0; i < 4; i++)
+           if (value == justify_modes[i])
+               break;
+       if (i >= 4)
+           LispDestroy("%s: argument must be "
+                       ":LEFT, :RIGHT, :CENTER, or :FULL, not %s",
+                       STRFUN(builtin), STROBJ(value));
+       XtSetArg(arg[0], XtNjustifyMode, (XawTextJustifyMode)i);
+       XtSetValues(textwindow, arg, 1);
+    }
+    else {
+       XtSetArg(arg[0], XtNjustifyMode, &justify);
+       XtGetValues(textwindow, arg, 1);
+       i = (int)justify;
+       if (i <= 0 || i >= 4)
+           i = 0;
+       value = justify_modes[i];
+    }
+
+    return (value);
+}
+
+LispObj *
+Xedit_LeftColumn(LispBuiltin *builtin)
+/*
+ left-column &optional left
+ */
+{
+    short left;
+    Arg arg[1];
+
+    LispObj *oleft;
+
+    oleft = ARGUMENT(0);
+
+    if (oleft != UNSPEC) {
+       CHECK_INDEX(oleft);
+       if (FIXNUM_VALUE(oleft) >= 32767)
+           left = 32767;
+       else
+           left = FIXNUM_VALUE(oleft);
+
+       XtSetArg(arg[0], XtNleftColumn, left);
+       XtSetValues(textwindow, arg, 1);
+    }
+    else {
+       XtSetArg(arg[0], XtNleftColumn, &left);
+       XtGetValues(textwindow, arg, 1);
+
+       oleft = FIXNUM((long)left);
+    }
+
+    return (oleft);
+}
+
+LispObj *
+Xedit_Point(LispBuiltin *builtin)
+/*
+ point
+ */
+{
+    return (FIXNUM(XawTextGetInsertionPoint(textwindow)));
+}
+
+LispObj *
+Xedit_PointMax(LispBuiltin *builtin)
+/*
+ point-max
+ */
+{
+    return (FIXNUM(XawTextSourceScan(XawTextGetSource(textwindow), 0,
+                                    XawstAll, XawsdRight, 1, True)));
+}
+
+LispObj *
+Xedit_PointMin(LispBuiltin *builtin)
+/*
+ point-min
+ */
+{
+    return (FIXNUM(XawTextSourceScan(XawTextGetSource(textwindow), 0,
+                                    XawstAll, XawsdLeft, 1, True)));
+}
+
+LispObj *
+Xedit_PropertyList(LispBuiltin *builtin)
+/*
+ property-list &optional value
+ */
+{
+    Arg arg[1];
+    XawTextPropertyList *property_list;
+
+    LispObj *value;
+
+    value = ARGUMENT(0);
+
+    if (value != UNSPEC) {
+       Cardinal i;
+       XrmQuark quark;
+
+       CHECK_LONGINT(value);
+       property_list = NULL;
+       quark = LONGINT_VALUE(value);
+       for (i = 0; i < num_property_lists; i++)
+           if (property_lists[i]->identifier == quark) {
+               property_list = property_lists[i];
+               break;
+           }
+
+       if (property_list) {
+           XtSetArg(arg[0], XawNtextProperties, property_list);
+           XtSetValues(XawTextGetSink(textwindow), arg, 1);
+       }
+       else
+           /* Maybe should generate an error here */
+           value = NIL;
+    }
+    else {
+       XtSetArg(arg[0], XawNtextProperties, &property_list);
+       XtGetValues(XawTextGetSink(textwindow), arg, 1);
+       if (property_list)
+           value = INTEGER(property_list->identifier);
+    }
+
+    return (value);
+}
+
+LispObj *
+Xedit_ReadText(LispBuiltin *builtin)
+/*
+ read-text offset length
+ */
+{
+    XawTextPosition last = XawTextSourceScan(XawTextGetSource(textwindow), 0,
+                                            XawstAll, XawsdRight, 1, True);
+    XawTextPosition from, to, len;
+    XawTextBlock block;
+    char *string, *ptr;
+
+    LispObj *offset, *length;
+
+    length = ARGUMENT(1);
+    offset = ARGUMENT(0);
+
+    CHECK_INDEX(offset);
+    CHECK_INDEX(length);
+
+    from = FIXNUM_VALUE(offset);
+    to = from + FIXNUM_VALUE(length);
+    if (from > last)
+       from = last;
+    if (to > last)
+       to = last;
+
+    if (from == to)
+       return (STRING(""));
+
+    len = to - from;
+    string = LispMalloc(len);
+
+    for (ptr = string; from < to;) {
+       XawTextSourceRead(XawTextGetSource(textwindow), from, &block, to - from);
+       memcpy(ptr, block.ptr, block.length);
+       ptr += block.length;
+       from += block.length;
+    }
+
+    return (LSTRING2(string, len));
+}
+
+LispObj *
+Xedit_ReplaceText(LispBuiltin *builtin)
+/*
+ replace-text left right text
+ */
+{
+    XawTextPosition last = XawTextSourceScan(XawTextGetSource(textwindow), 0,
+                                            XawstAll, XawsdRight, 1, True);
+    XawTextPosition left, right;
+    XawTextBlock block;
+
+    LispObj *oleft, *oright, *text;
+
+    text = ARGUMENT(2);
+    oright = ARGUMENT(1);
+    oleft = ARGUMENT(0);
+
+    CHECK_INDEX(oleft);
+    CHECK_INDEX(oright);
+    CHECK_STRING(text);
+
+    left = FIXNUM_VALUE(oleft);
+    right = FIXNUM_VALUE(oright);
+    if (left > last)
+       left = last;
+    if (left > right)
+       right = left;
+    else if (right > last)
+       right = last;
+
+    block.firstPos = 0;
+    block.format = FMT8BIT;
+    block.length = STRLEN(text);
+    block.ptr = THESTR(text);
+    XawTextReplace(textwindow, left, right, &block);
+
+    return (text);
+}
+
+LispObj *
+Xedit_RightColumn(LispBuiltin *builtin)
+/*
+ right-column &optional right
+ */
+{
+    short right;
+    Arg arg[1];
+
+    LispObj *oright;
+
+    oright = ARGUMENT(0);
+
+    if (oright != UNSPEC) {
+       CHECK_INDEX(oright);
+       if (FIXNUM_VALUE(oright) >= 32767)
+           right = 32767;
+       else
+           right = FIXNUM_VALUE(oright);
+
+       XtSetArg(arg[0], XtNrightColumn, right);
+       XtSetValues(textwindow, arg, 1);
+    }
+    else {
+       XtSetArg(arg[0], XtNrightColumn, &right);
+       XtGetValues(textwindow, arg, 1);
+
+       oright = FIXNUM(right);
+    }
+
+    return (oright);
+}
+
+LispObj *
+Xedit_Scan(LispBuiltin *builtin)
+/*
+ scan offset type direction &key count include
+ */
+{
+    int i;
+    XawTextPosition offset;
+    XawTextScanType type;
+    XawTextScanDirection direction;
+    int count;
+
+    LispObj *ooffset, *otype, *odirection, *ocount, *include;
+
+    include = ARGUMENT(4);
+    if (include == UNSPEC)
+       include = NIL;
+    ocount = ARGUMENT(3);
+    odirection = ARGUMENT(2);
+    otype = ARGUMENT(1);
+    ooffset = ARGUMENT(0);
+
+    CHECK_INDEX(ooffset);
+    offset = FIXNUM_VALUE(ooffset);
+
+    for (i = 0; i < 2; i++)
+       if (odirection == scan_directions[i])
+           break;
+    if (i >= 2)
+       LispDestroy("%s: direction must be "
+                   ":LEFT or :RIGHT, not %s",
+                   STRFUN(builtin), STROBJ(odirection));
+    direction = (XawTextScanDirection)i;
+
+    for (i = 0; i < 6; i++)
+       if (otype == scan_types[i])
+           break;
+    if (i >= 6)
+       LispDestroy("%s: direction must be "
+                   ":POSITIONS, :WHITE-SPACE, :EOL, "
+                   ":PARAGRAPH, :ALL, or :ALPHA-NUMERIC, not %s",
+                   STRFUN(builtin), STROBJ(otype));
+    type = (XawTextScanType)i;
+
+    if (ocount == UNSPEC)
+       count = 1;
+    else {
+       CHECK_INDEX(ocount);
+       count = FIXNUM_VALUE(ocount);
+    }
+
+    offset = XawTextSourceScan(XawTextGetSource(textwindow),
+                              offset, type, direction, count,
+                              include != NIL);
+
+    return (FIXNUM(offset));
+}
+
+static LispObj *
+XeditSearch(LispBuiltin *builtin, XawTextScanDirection direction)
+{
+    XawTextBlock block;
+    XawTextPosition position;
+
+    LispObj *string, *offset, *ignore_case;
+
+    ignore_case = ARGUMENT(2);
+    offset = ARGUMENT(1);
+    string = ARGUMENT(0);
+
+    CHECK_STRING(string);
+    if (offset != UNSPEC) {
+       CHECK_INDEX(offset);
+       position = FIXNUM_VALUE(offset);
+    }
+    else
+       position = XawTextGetInsertionPoint(textwindow);
+
+    block.firstPos = (ignore_case != UNSPEC && ignore_case != NIL) ? 1 : 0;
+    block.format = FMT8BIT;
+    block.length = STRLEN(string);
+    block.ptr = THESTR(string);
+    position = XawTextSourceSearch(XawTextGetSource(textwindow),
+                                  position, direction, &block);
+
+    return (position != XawTextSearchError ? FIXNUM(position) : NIL);
+}
+
+
+LispObj *
+Xedit_SearchBackward(LispBuiltin *builtin)
+/*
+ search-backward string &optional offset ignore-case
+ */
+{
+    return (XeditSearch(builtin, XawsdLeft));
+}
+
+LispObj *
+Xedit_SearchForward(LispBuiltin *builtin)
+/*
+ search-forward string &optional offset ignore-case
+ */
+{
+    return (XeditSearch(builtin, XawsdRight));
+}
+
+LispObj *
+Xedit_VerticalScrollbar(LispBuiltin *builtin)
+/*
+ vertical-scrollbar &optional state
+ */
+{
+    Arg arg[1];
+    XawTextScrollMode scroll;
+
+    LispObj *state;
+
+    state = ARGUMENT(0);
+
+    if (state != UNSPEC) {
+       scroll = state == NIL ? XawtextScrollNever : XawtextScrollAlways;
+       XtSetArg(arg[0], XtNscrollVertical, scroll);
+       XtSetValues(textwindow, arg, 1);
+    }
+    else {
+       XtSetArg(arg[0], XtNscrollVertical, &scroll);
+       XtGetValues(textwindow, arg, 1);
+       state = scroll == XawtextScrollAlways ? T : NIL;
+    }
+
+    return (state);
+}
+
+LispObj *
+Xedit_WrapMode(LispBuiltin *builtin)
+/*
+ wrap-mode &optional value
+ */
+{
+    int i;
+    Arg arg[1];
+    XawTextWrapMode wrap;
+
+    LispObj *value;
+
+    value = ARGUMENT(0);
+
+    if (value != UNSPEC) {
+       for (i = 0; i < 3; i++)
+           if (value == wrap_modes[i])
+               break;
+       if (i >= 3)
+           LispDestroy("%s: argument must be "
+                       ":NEVER, :LINE, or :WORD, not %s",
+                       STRFUN(builtin), STROBJ(value));
+       XtSetArg(arg[0], XtNwrap, (XawTextWrapMode)i);
+       XtSetValues(textwindow, arg, 1);
+    }
+    else {
+       XtSetArg(arg[0], XtNwrap, &wrap);
+       XtGetValues(textwindow, arg, 1);
+       i = (int)wrap;
+       if (i <= 0 || i >= 3)
+           i = 0;
+       value = wrap_modes[i];
+    }
+
+    return (value);
+}
+
+LispObj *
+Xedit_XrmStringToQuark(LispBuiltin *builtin)
+/*
+ xrm-string-to-quark string
+ */
+{
+    LispObj *string;
+
+    string = ARGUMENT(0);
+
+    CHECK_STRING(string);
+
+    return (INTEGER(XrmStringToQuark(THESTR(string))));
+}
diff --git a/xedit/lisp/xedit.h b/xedit/lisp/xedit.h
new file mode 100644 (file)
index 0000000..f3db6cb
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/lisp/xedit.h,v 1.5tsi Exp $ */
+
+#ifndef Lisp_xedit_h
+#define Lisp_xedit_h
+
+#ifdef XEDIT_LISP_PRIVATE
+#include "lisp/private.h"
+#include "lisp/io.h"
+#include "lisp/read.h"
+#include "lisp/write.h"
+
+LispObj *Xedit_AddEntity(LispBuiltin*);
+LispObj *Xedit_AutoFill(LispBuiltin*);
+LispObj *Xedit_Background(LispBuiltin*);
+LispObj *Xedit_CharAfter(LispBuiltin*);
+LispObj *Xedit_CharBefore(LispBuiltin*);
+LispObj *Xedit_ClearEntities(LispBuiltin*);
+LispObj *Xedit_ConvertPropertyList(LispBuiltin*);
+LispObj *Xedit_Font(LispBuiltin*);
+LispObj *Xedit_Foreground(LispBuiltin*);
+LispObj *Xedit_GotoChar(LispBuiltin*);
+LispObj *Xedit_HorizontalScrollbar(LispBuiltin*);
+LispObj *Xedit_Insert(LispBuiltin*);
+LispObj *Xedit_Justification(LispBuiltin*);
+LispObj *Xedit_LeftColumn(LispBuiltin*);
+LispObj *Xedit_Point(LispBuiltin*);
+LispObj *Xedit_PointMax(LispBuiltin*);
+LispObj *Xedit_PointMin(LispBuiltin*);
+LispObj *Xedit_PropertyList(LispBuiltin*);
+LispObj *Xedit_ReadText(LispBuiltin*);
+LispObj *Xedit_ReplaceText(LispBuiltin*);
+LispObj *Xedit_RightColumn(LispBuiltin*);
+LispObj *Xedit_Scan(LispBuiltin*);
+LispObj *Xedit_SearchBackward(LispBuiltin*);
+LispObj *Xedit_SearchForward(LispBuiltin*);
+LispObj *Xedit_VerticalScrollbar(LispBuiltin*);
+LispObj *Xedit_WrapMode(LispBuiltin*);
+LispObj *Xedit_XrmStringToQuark(LispBuiltin*);
+#else
+#define LispObj void
+#endif /* XEDIT_LISP_PRIVATE */
+
+typedef struct _EditModeInfo {
+    char *desc;                        /* Mode description */
+    Widget sme;                        /* Menu entry */
+    LispObj *symbol;           /* Symbol holding syntax data */
+    LispObj *syntax;           /* The syntax definition */
+} EditModeInfo;
+
+/* Typedef'ed to XeditLispData in ../xedit.h */
+struct _XeditLispData {
+    LispObj *syntax;           /* Syntax definition */
+    LispObj *syntable;         /* Syntax-table the cursor is located */
+    int disable_highlight;     /* Working in the buffer */
+};
+
+void LispXeditInitialize(void);
+void XeditLispExecute(Widget, XawTextPosition, XawTextPosition);
+void XeditLispSetEditMode(xedit_flist_item*, LispObj*);
+void XeditLispUnsetEditMode(xedit_flist_item*);
+
+extern EditModeInfo *mode_infos;
+extern Cardinal num_mode_infos;
+
+#endif /* Lisp_xedit_h */
diff --git a/xedit/missing b/xedit/missing
new file mode 100755 (executable)
index 0000000..28055d2
--- /dev/null
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# 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=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+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'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  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]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
+# 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).  This is about non-GNU programs, so use $1 not
+# $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 $program 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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if test ! -f y.tab.h; then
+       echo >y.tab.h
+    fi
+    if test ! -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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if test ! -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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit $?
+    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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+       /^@setfilename/{
+         s/.* \([^ ]*\) *$/\1/
+         p
+         q
+       }' $infile`
+      # ... 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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xedit/options.c b/xedit/options.c
new file mode 100644 (file)
index 0000000..553fa94
--- /dev/null
@@ -0,0 +1,524 @@
+/*
+ * Copyright (c) 1999 by The XFree86 Project, Inc.
+ *
+ * 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/* $XFree86: xc/programs/xedit/options.c,v 1.13 2002/09/22 07:09:05 paulo Exp $ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "xedit.h"
+
+#include <X11/Xaw/SmeBSB.h>
+#include <X11/Xaw/SimpleMenu.h>
+
+/*
+ * Prototypes
+ */
+static void SetColumns(Widget, XEvent*, String*, Cardinal*);
+static void ChangeField(Widget, XEvent*, String*, Cardinal*);
+static void EditCallback(Widget, XtPointer, XtPointer);
+static void PopupColumnsCallback(Widget, XtPointer, XtPointer);
+static void CreateColumnsShell(void);
+static void ProcessColumnsCallback(Widget, XtPointer, XtPointer);
+
+/*
+ * Initialization
+ */
+extern Widget texts[3];
+
+static Widget edit_popup, wrap_popup, justify_popup, scroll_popup,
+             columns_shell, left_text, right_text;
+
+static XFontStruct *fonts[3];
+static Pixel foregrounds[3], backgrounds[3];
+
+static XtActionsRec actions[] = {
+    {"set-columns", SetColumns},
+    {"change-field", ChangeField},
+};
+
+#define WRAP_NEVER     1
+#define WRAP_LINE      2
+#define WRAP_WORD      3
+#define        AUTO_FILL       4
+#define JUST_LEFT      5
+#define JUST_RIGHT     6
+#define JUST_CENTER    7
+#define JUST_FULL      8
+#define SCROLL_VERT    9
+#define SCROLL_HORIZ   10
+
+static Widget autoFill, wrapNever, wrapLine, wrapWord,
+             justifyLeft, justifyRight, justifyCenter, justifyFull,
+             breakColumns, scrollVert, scrollHoriz;
+
+void
+CreateEditPopup(void)
+{
+    Arg args[1];
+
+    edit_popup         = XtCreatePopupShell("editMenu", simpleMenuWidgetClass,
+                                            topwindow, NULL, 0);
+    XtRealizeWidget(edit_popup);
+
+    wrap_popup         = XtCreatePopupShell("wrapMenu", simpleMenuWidgetClass,
+                                            edit_popup, NULL, 0);
+    XtRealizeWidget(wrap_popup);
+
+    XtSetArg(args[0], XtNmenuName, "wrapMenu");
+    XtCreateManagedWidget("wrapMenuItem", smeBSBObjectClass, edit_popup, args, 1);
+
+    wrapNever          = XtCreateManagedWidget("never", smeBSBObjectClass,
+                                               wrap_popup, NULL, 0);
+    XtAddCallback(wrapNever, XtNcallback, EditCallback, (XtPointer)WRAP_NEVER);
+    wrapLine           = XtCreateManagedWidget("line", smeBSBObjectClass,
+                                               wrap_popup, NULL, 0);
+    XtAddCallback(wrapLine, XtNcallback, EditCallback, (XtPointer)WRAP_LINE);
+    wrapWord           = XtCreateManagedWidget("word", smeBSBObjectClass,
+                                               wrap_popup, NULL, 0);
+    XtAddCallback(wrapWord, XtNcallback, EditCallback, (XtPointer)WRAP_WORD);
+
+    autoFill           = XtCreateManagedWidget("autoFill", smeBSBObjectClass,
+                                               edit_popup, NULL, 0);
+    XtAddCallback(autoFill, XtNcallback, EditCallback, (XtPointer)AUTO_FILL);
+
+    justify_popup      = XtCreatePopupShell("justifyMenu", simpleMenuWidgetClass,
+                                            edit_popup, NULL, 0);
+    XtRealizeWidget(justify_popup);
+
+    XtSetArg(args[0], XtNmenuName, "justifyMenu");
+    XtCreateManagedWidget("justifyMenuItem", smeBSBObjectClass, edit_popup, args, 1);
+
+    justifyLeft                = XtCreateManagedWidget("left", smeBSBObjectClass,
+                                               justify_popup, NULL, 0);
+    XtAddCallback(justifyLeft, XtNcallback, EditCallback, (XtPointer)JUST_LEFT);
+    justifyRight       = XtCreateManagedWidget("right", smeBSBObjectClass,
+                                               justify_popup, NULL, 0);
+    XtAddCallback(justifyRight, XtNcallback, EditCallback, (XtPointer)JUST_RIGHT);
+    justifyCenter      = XtCreateManagedWidget("center", smeBSBObjectClass,
+                                               justify_popup, NULL, 0);
+    XtAddCallback(justifyCenter, XtNcallback, EditCallback, (XtPointer)JUST_CENTER);
+    justifyFull                = XtCreateManagedWidget("full", smeBSBObjectClass,
+                                               justify_popup, NULL, 0);
+    XtAddCallback(justifyFull, XtNcallback, EditCallback, (XtPointer)JUST_FULL);
+
+    breakColumns       = XtCreateManagedWidget("breakColumns", smeBSBObjectClass,
+                                               edit_popup, NULL, 0);
+    XtAddCallback(breakColumns, XtNcallback, PopupColumnsCallback, NULL);
+
+    scroll_popup       = XtCreatePopupShell("scrollMenu", simpleMenuWidgetClass,
+                                            edit_popup, NULL, 0);
+    XtRealizeWidget(scroll_popup);
+
+    XtSetArg(args[0], XtNmenuName, "scrollMenu");
+    XtCreateManagedWidget("scrollMenuItem", smeBSBObjectClass, edit_popup, args, 1);
+
+    scrollVert         = XtCreateManagedWidget("vertical", smeBSBObjectClass,
+                                               scroll_popup, NULL, 0);
+    XtAddCallback(scrollVert, XtNcallback, EditCallback, (XtPointer)SCROLL_VERT);
+    scrollHoriz                = XtCreateManagedWidget("horizontal", smeBSBObjectClass,
+                                               scroll_popup, NULL, 0);
+    XtAddCallback(scrollHoriz, XtNcallback, EditCallback, (XtPointer)SCROLL_HORIZ);
+
+    CreateEditModePopup(edit_popup);
+}
+
+void
+SetEditMenu(void)
+{
+    Arg args[7];
+    Cardinal num_args;
+    Boolean auto_fill;
+    XawTextWrapMode wrap_mode;
+    XawTextJustifyMode justify;
+    XawTextScrollMode vscroll, hscroll;
+    short left, right;
+
+    num_args = 0;
+    XtSetArg(args[num_args], XtNwrap, &wrap_mode);             ++num_args;
+    XtSetArg(args[num_args], XtNautoFill, &auto_fill);         ++num_args;
+    XtSetArg(args[num_args], XtNjustifyMode, &justify);                ++num_args;
+    XtSetArg(args[num_args], XtNleftColumn, &left);            ++num_args;
+    XtSetArg(args[num_args], XtNrightColumn, &right);          ++num_args;
+    XtSetArg(args[num_args], XtNscrollVertical, &vscroll);     ++num_args;
+    XtSetArg(args[num_args], XtNscrollHorizontal, &hscroll);   ++num_args;
+    XtGetValues(textwindow, args, num_args);
+
+    if (flist.pixmap) {
+       XtSetArg(args[0], XtNleftBitmap, None);
+       XtSetArg(args[1], XtNleftBitmap, flist.pixmap);
+       if (!auto_fill)
+           XtSetValues(autoFill, &args[0], 1);
+       else
+           XtSetValues(autoFill, &args[1], 1);
+       switch (wrap_mode) {
+           case XawtextWrapNever:
+               XtSetValues(wrapLine, &args[0], 1);
+               XtSetValues(wrapWord, &args[0], 1);
+               XtSetValues(wrapNever, &args[1], 1);
+               break;
+           case XawtextWrapLine:
+               XtSetValues(wrapNever, &args[0], 1);
+               XtSetValues(wrapWord, &args[0], 1);
+               XtSetValues(wrapLine, &args[1], 1);
+               break;
+           case XawtextWrapWord:
+               XtSetValues(wrapNever, &args[0], 1);
+               XtSetValues(wrapLine, &args[0], 1);
+               XtSetValues(wrapWord, &args[1], 1);
+               break;
+       }
+       switch (justify) {
+           case XawjustifyLeft:
+               XtSetValues(justifyRight, &args[0], 1);
+               XtSetValues(justifyCenter, &args[0], 1);
+               XtSetValues(justifyFull, &args[0], 1);
+               XtSetValues(justifyLeft, &args[1], 1);
+               break;
+           case XawjustifyRight:
+               XtSetValues(justifyLeft, &args[0], 1);
+               XtSetValues(justifyCenter, &args[0], 1);
+               XtSetValues(justifyFull, &args[0], 1);
+               XtSetValues(justifyRight, &args[1], 1);
+               break;
+           case XawjustifyCenter:
+               XtSetValues(justifyLeft, &args[0], 1);
+               XtSetValues(justifyRight, &args[0], 1);
+               XtSetValues(justifyFull, &args[0], 1);
+               XtSetValues(justifyCenter, &args[1], 1);
+               break;
+           case XawjustifyFull:
+               XtSetValues(justifyLeft, &args[0], 1);
+               XtSetValues(justifyRight, &args[0], 1);
+               XtSetValues(justifyCenter, &args[0], 1);
+               XtSetValues(justifyFull, &args[1], 1);
+               break;
+       }
+       if (!vscroll)
+           XtSetValues(scrollVert, &args[0], 1);
+       else
+           XtSetValues(scrollVert, &args[1], 1);
+       if (!hscroll)
+           XtSetValues(scrollHoriz, &args[0], 1);
+       else
+           XtSetValues(scrollHoriz, &args[1], 1);
+    }
+    if (!auto_fill) {
+       XtSetSensitive(wrapNever, True);
+       XtSetSensitive(wrapLine, True);
+       XtSetSensitive(wrapWord, True);
+
+       XtSetSensitive(justifyLeft, False);
+       XtSetSensitive(justifyRight, False);
+       XtSetSensitive(justifyCenter, False);
+       XtSetSensitive(justifyFull, False);
+       XtSetSensitive(breakColumns, False);
+    }
+    else {
+       XtSetSensitive(wrapNever, False);
+       XtSetSensitive(wrapLine, False);
+       XtSetSensitive(wrapWord, False);
+
+       XtSetSensitive(justifyLeft, left < right);
+       XtSetSensitive(justifyRight, left < right);
+       XtSetSensitive(justifyCenter, left < right);
+       XtSetSensitive(justifyFull, left < right);
+       XtSetSensitive(breakColumns, True);
+    }
+
+    SetEditModeMenu();
+}
+
+/*ARGSUSED*/
+static void
+EditCallback(Widget sme, XtPointer client_data, XtPointer call_data)
+{
+    Arg args[1];
+    Boolean auto_fill;
+    XawTextScrollMode scroll;
+    xedit_flist_item *item = FindTextSource(XawTextGetSource(textwindow), NULL);
+    Bool foreach = False;
+
+    switch ((long)client_data) {
+       case WRAP_NEVER:
+           XtSetArg(args[0], XtNwrap, XawtextWrapNever);
+           if (item) {
+               item->flags |= WRAP_BIT;
+               item->wrap = XawtextWrapNever;
+               foreach = True;
+           }
+           break;
+       case WRAP_LINE:
+           XtSetArg(args[0], XtNwrap, XawtextWrapLine);
+           if (item) {
+               item->flags |= WRAP_BIT;
+               item->wrap = XawtextWrapLine;
+               foreach = True;
+           }
+           break;
+       case WRAP_WORD:
+           XtSetArg(args[0], XtNwrap, XawtextWrapWord);
+           if (item) {
+               item->flags |= WRAP_BIT;
+               item->wrap = XawtextWrapWord;
+               foreach = True;
+           }
+           break;
+       case AUTO_FILL:
+           XtSetArg(args[0], XtNautoFill, &auto_fill);
+           XtGetValues(textwindow, args, 1);
+           XtSetArg(args[0], XtNautoFill, !auto_fill);
+           break;
+       case JUST_LEFT:
+           XtSetArg(args[0], XtNjustifyMode, XawjustifyLeft);
+           break;
+       case JUST_RIGHT:
+           XtSetArg(args[0], XtNjustifyMode, XawjustifyRight);
+           break;
+       case JUST_CENTER:
+           XtSetArg(args[0], XtNjustifyMode, XawjustifyCenter);
+           break;
+       case JUST_FULL:
+           XtSetArg(args[0], XtNjustifyMode, XawjustifyFull);
+           break;
+       case SCROLL_VERT:
+           XtSetArg(args[0], XtNscrollVertical, &scroll);
+           XtGetValues(textwindow, args, 1);
+           XtSetArg(args[0], XtNscrollVertical, scroll == XawtextScrollNever ?
+                    XawtextScrollAlways : XawtextScrollNever);
+           break;
+       case SCROLL_HORIZ:
+           XtSetArg(args[0], XtNscrollHorizontal, &scroll);
+           XtGetValues(textwindow, args, 1);
+           XtSetArg(args[0], XtNscrollHorizontal, scroll == XawtextScrollNever ?
+                    XawtextScrollAlways : XawtextScrollNever);
+           break;
+    }
+
+    if (foreach) {
+       int i;
+       for (i = 0; i < 3; i++)
+           XtSetValues(texts[i], args, 1);
+    }
+    else
+       XtSetValues(textwindow, args, 1);
+}
+
+static void
+CreateColumnsShell(void)
+{
+    Atom delete_window;
+    Widget form, ok, cancel;
+
+    if (columns_shell)
+       return;
+
+    XtAppAddActions(XtWidgetToApplicationContext(topwindow),
+                   actions, XtNumber(actions));
+
+    columns_shell      = XtCreatePopupShell("columns", transientShellWidgetClass,
+                                            topwindow, NULL, 0);
+    form               = XtCreateManagedWidget("form", formWidgetClass,
+                                               columns_shell, NULL, 0);
+    XtCreateManagedWidget("leftLabel", labelWidgetClass, form, NULL, 0);
+    left_text          = XtVaCreateManagedWidget("left", asciiTextWidgetClass,
+                                                 form, XtNeditType, XawtextEdit,
+                                                 NULL);
+    XtCreateManagedWidget("rightLabel", labelWidgetClass, form, NULL, 0);
+    right_text         = XtVaCreateManagedWidget("right", asciiTextWidgetClass,
+                                                 form, XtNeditType, XawtextEdit,
+                                                 NULL);
+    ok                 = XtCreateManagedWidget("ok", commandWidgetClass,
+                                               form, NULL, 0);
+    XtAddCallback(ok, XtNcallback, ProcessColumnsCallback, (XtPointer)True);
+    cancel             = XtCreateManagedWidget("cancel", commandWidgetClass,
+                                               form, NULL, 0);
+    XtAddCallback(cancel, XtNcallback, ProcessColumnsCallback, (XtPointer)False);
+
+    XtRealizeWidget(columns_shell);
+    delete_window = XInternAtom(XtDisplay(columns_shell), "WM_DELETE_WINDOW", False);
+    XSetWMProtocols(XtDisplay(columns_shell), XtWindow(columns_shell), &delete_window, 1);
+
+    XtSetKeyboardFocus(columns_shell, left_text);
+}
+
+/*ARGSUSED*/
+static void
+PopupColumnsCallback(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    Arg args[3];
+    char sleft[6], sright[6];
+    short left, right;
+    Dimension width, height, b_width;
+    Window r, c;
+    int x, y, wx, wy, max_x, max_y;
+    unsigned mask;
+
+    CreateColumnsShell();
+
+    XQueryPointer(XtDisplay(columns_shell), XtWindow(columns_shell),
+                 &r, &c, &x, &y, &wx, &wy, &mask);
+
+    XtSetArg(args[0], XtNwidth, &width);
+    XtSetArg(args[1], XtNheight, &height);
+    XtSetArg(args[2], XtNborderWidth, &b_width);
+    XtGetValues(columns_shell, args, 3);
+
+    width += b_width << 1;
+    height += b_width << 1;
+
+    x -= (Position)(width >> 1);
+    if (x < 0)
+       x = 0;
+    if (x > (max_x = (Position)(XtScreen(columns_shell)->width - width)))
+       x = max_x;
+
+    y -= (Position)(height >> 1);
+    if (y < 0)
+       y = 0;
+    if (y > (max_y = (Position)(XtScreen(columns_shell)->height - height)))
+       y = max_y;
+
+    XtSetArg(args[0], XtNx, x);
+    XtSetArg(args[1], XtNy, y);
+    XtSetValues(columns_shell, args, 2);
+
+    XtSetArg(args[0], XtNleftColumn, &left);
+    XtSetArg(args[1], XtNrightColumn, &right);
+    XtGetValues(textwindow, args, 2);
+    XmuSnprintf(sleft, sizeof(sleft), "%d", left);
+    XmuSnprintf(sright, sizeof(sright), "%d", right);
+    XtSetArg(args[0], XtNstring, sleft);
+    XtSetValues(left_text, args, 1);
+    XtSetArg(args[0], XtNstring, sright);
+    XtSetValues(right_text, args, 1);
+    XtPopup(columns_shell, XtGrabExclusive);
+}
+
+/*ARGSUSED*/
+static void
+ProcessColumnsCallback(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    if (client_data) {
+       Arg args[2];
+       char *left, *right;
+       short leftc, rightc;
+
+       left = GetString(left_text);
+       right = GetString(right_text);
+
+       leftc = atoi(left);
+       rightc = atoi(right);
+       XtSetArg(args[0], XtNleftColumn, leftc);
+       XtSetArg(args[1], XtNrightColumn, rightc);
+
+       XtSetValues(textwindow, args, 2);
+    }
+
+    XtPopdown(columns_shell);
+}
+
+/*ARGSUSED*/
+static void
+SetColumns(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    Bool ok = False;
+
+    if (*num_params &&
+       (params[0][0] == 'o' || params[0][0] == 'O'))
+       ok = True;
+
+    ProcessColumnsCallback(w, (XtPointer)(long)ok, NULL);
+}
+
+/*ARGSUSED*/
+static void
+ChangeField(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    Widget focus = XtGetKeyboardFocusWidget(columns_shell);
+
+    XtSetKeyboardFocus(columns_shell,
+                      focus == left_text ? right_text : left_text);
+}
+
+void
+UpdateTextProperties(int force)
+{
+    Arg args[4];
+    Cardinal num_args;
+    xedit_flist_item *item;
+    XawTextPropertyList *prop;
+    Widget text, source, sink;
+    int i;
+
+    /* save default information */
+    if (fonts[0] == NULL) {
+       for (i = 0; i < 3; i++) {
+           num_args = 0;
+           XtSetArg(args[num_args], XtNfont, &fonts[i]);             ++num_args;
+           XtSetArg(args[num_args], XtNforeground, &foregrounds[i]); ++num_args;
+           XtSetArg(args[num_args], XtNbackground, &backgrounds[i]); ++num_args;
+           XtGetValues(XawTextGetSink(texts[i]), args, num_args);
+       }
+    }
+
+    for (i = 0; i < 3; i++) {
+       text = texts[i];
+       source = XawTextGetSource(text);
+       sink = XawTextGetSink(text);
+       item = FindTextSource(source, NULL);
+
+       XtSetArg(args[0], XawNtextProperties, &prop);
+       XtGetValues(sink, args, 1);
+
+       if (item == NULL || (!force && prop == item->properties))
+           continue;
+
+       XtSetArg(args[0], XawNtextProperties, item->properties);
+       num_args = 1;
+       if (item->properties == NULL) {
+           XtSetArg(args[num_args], XtNfont, fonts[i]);             ++num_args;
+           XtSetArg(args[num_args], XtNforeground, foregrounds[i]); ++num_args;
+           XtSetArg(args[num_args], XtNbackground, backgrounds[i]); ++num_args;
+       }
+       XtSetValues(sink, args, num_args);
+
+       if (text == textwindow) {
+           XtSetArg(args[0], XtNdisplayCaret, False);
+           XtSetValues(text, args, 1);
+       }
+       _XawTextBuildLineTable((TextWidget)text,
+                              XawTextTopPosition(text), True);
+       XawTextDisplay(text);
+       if (text == textwindow) {
+           XtSetArg(args[0], XtNdisplayCaret, True);
+           XtSetValues(text, args, 1);
+       }
+    }
+}
diff --git a/xedit/print.c b/xedit/print.c
new file mode 100644 (file)
index 0000000..fbb260b
--- /dev/null
@@ -0,0 +1,435 @@
+/*
+ * $Xorg: print.c,v 1.1 2004/04/30 02:05:54 gisburn Exp $
+ *
+Copyright 2004 Roland Mainz <roland.mainz@nrubsig.org>
+
+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.
+ *
+ */
+
+/* Turn a NULL pointer string into an empty string */
+#define NULLSTR(x) (((x)!=NULL)?(x):(""))
+
+#define Error(x) { printf x ; exit(EXIT_FAILURE); }
+#define Assertion(expr, msg) { if (!(expr)) { Error msg } }
+#define Log(x)   { if(True) printf x; }
+
+#ifdef XEDIT
+#include "xedit.h"
+#endif /* XEDIT */
+#include "print.h"
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/AsciiText.h> 
+#include <stdio.h>
+#include <stdlib.h>
+
+static Widget
+CreatePrintShell(Widget    videoshell,
+                 Screen   *pscreen,
+                 Visual   *pvisual,
+                 String    printshell_name,
+                 ArgList   args,
+                 Cardinal  numargs)
+{
+    String   videoname,
+             videoclass;
+    Widget   pappshell,
+             printshell;
+    Display *pdpy = XDisplayOfScreen(pscreen);
+    int      dummyc = 0;
+    String   dummys = "";
+    Cardinal shell_n;
+    Arg      shell_args[5];
+
+    XtGetApplicationNameAndClass(XtDisplay(videoshell), 
+                                 &videoname, &videoclass);
+
+    /* XXX: Why is the |dummyc|&&|dummys| stuff needed here ? */
+    XtDisplayInitialize(XtWidgetToApplicationContext(videoshell), pdpy,
+                        videoname, videoclass,
+                        NULL, 0,
+                        &dummyc, &dummys);
+
+    shell_n = 0;
+    XtSetArg(shell_args[shell_n], XtNscreen, pscreen); shell_n++;
+    if (pvisual) {
+        XtSetArg(shell_args[shell_n], XtNvisual, pvisual); shell_n++;
+    }
+    pappshell = XtAppCreateShell(videoname, videoclass,
+                                   applicationShellWidgetClass,
+                                   pdpy,
+                                   shell_args, shell_n);
+    printshell = XtCreatePopupShell(printshell_name,
+                                    xawPrintShellWidgetClass,
+                                    pappshell, args, numargs);
+                                
+
+    /* we're mapping/unmapping at start/end page time */
+    XtSetMappedWhenManaged(printshell, False);
+
+    /* We realise the widget when we're done with building the widget tree... */
+    
+    return printshell;
+}
+
+typedef struct
+{
+  const char       *programname;
+  Widget            toplevel;
+  Bool              isPrinting;
+  Widget            printshell;
+  struct
+  {
+      Widget  form;
+      Widget  pageheaderlabel;
+      Widget  text;
+  } content; /* content to print */
+  int               numpages;
+  Display          *pdpy;
+  Screen           *pscreen;
+  XPContext         pcontext;
+  XtCallbackProc    pdpyDestroyCallback;
+  void             *printtofile_handle;
+  const char       *jobtitle;
+} AppPrintData;
+
+static AppPrintData  apdx;
+static AppPrintData *apd = &apdx;
+
+/* Count pages in a text widget
+ * WARNING: This will reset the current position of the text widget
+ * back to the beginning */
+static
+long CountPages(Widget textWidget)
+{
+    long numpages = 0;
+
+    XawTextPosition prevpagepos = -1,
+                    currpos = 0;        
+
+    /* Move to the top of the file... */
+    XtCallActionProc(textWidget, "beginning-of-file", NULL, NULL, 0);
+    
+    /* ... count pages ...*/
+    do
+    {
+        prevpagepos = XawTextTopPosition(textWidget);
+        XtCallActionProc(textWidget, "next-page", NULL, NULL, 0);        
+        currpos     = XawTextTopPosition(textWidget);
+        numpages++;
+    } while(prevpagepos != currpos);            
+
+    /* ... and move to the top of the file... */
+    XtCallActionProc(textWidget, "beginning-of-file", NULL, NULL, 0);
+    
+    Log(("CountPages() found %ld pages.\n", numpages))
+
+    return numpages;
+}
+
+static void 
+PageSetupCB(Widget widget, XtPointer client_data, XtPointer call_data)
+{
+    Widget                       pshell = widget;
+    XawPrintShellCallbackStruct *psp    = (XawPrintShellCallbackStruct *)call_data;
+    AppPrintData                *p      = (AppPrintData *)client_data;
+   
+    Log(("--> PageSetupCB\n"));
+
+    if (!psp->last_page_in_job) {
+        int  currpage;
+        char buffer[256];
+
+        XtVaGetValues(pshell, XawNcurrPageNumInJob, &currpage, NULL);
+
+        sprintf(buffer, "Title: %s / Page: %d/%d", p->jobtitle, currpage, p->numpages);
+        XtVaSetValues(apd->content.pageheaderlabel, XtNlabel, buffer, NULL);
+
+        /* Note: XawPrintShell's pagecount starts with '1'
+         * (=first page is page no. '1') */
+        if (currpage > 1) {
+            Log(("pagedown %d\n", currpage));
+            XtCallActionProc(p->content.text, "next-page", NULL, NULL, 0);
+        }
+        else
+        {
+            Log(("first page\n"));
+        }              
+      
+        if (currpage >= p->numpages) {
+            psp->last_page_in_job = True;
+        }
+    }
+}
+
+static
+void FinishPrinting(AppPrintData *p)
+{
+    char *scr;
+
+    if (p->printtofile_handle) {
+        if (XpuWaitForPrintFileChild(p->printtofile_handle) != XPGetDocFinished) {
+            PrintMsg(("Error while printing to file.\n"));
+        }
+        p->printtofile_handle = NULL;
+    }
+    
+    /* Job completed, check if there are any messages from the spooler command */
+    scr = XpGetOneAttribute(p->pdpy, p->pcontext, XPJobAttr, "xp-spooler-command-results");
+    if( scr )
+    {
+      if( strlen(scr) > 0 )
+      {
+        const char *msg = XpuCompoundTextToXmb(p->pdpy, scr);
+        if( msg )
+        {
+          PrintMsg(("Spooler command returned:\n%s", msg));
+          XpuFreeXmbString(msg);
+        }
+        else
+        {
+          PrintMsg(("Spooler command returned (unconverted):\n%s", scr));
+        }
+      }
+
+      XFree((void *)scr);
+    }
+    
+    if (p->printshell) {
+        XtDestroyWidget(p->printshell);
+        p->printshell = NULL;
+    }
+  
+    /* Two issues here:
+     * 1. The print display connection is owned by the print dialog
+     *    To avoid any problems with that use a callback back to the main
+     *    application which calls
+     *    |XawPrintDialogClosePrinterConnection(w, False)| to ask the
+     *    print dialog widget to close all print display resources and
+     *    disown the object.
+     * 2. We have to use XpDestroyContext() and XtCloseDisplay()
+     *    instead of XpuClosePrinterDisplay() to make libXt happy...
+     *
+     * Call callback... */
+    (*apd->pdpyDestroyCallback)(NULL, NULL, NULL); /* HACK! */
+
+    /* ... and then get rid of the display */
+    if (p->pcontext != None) {
+        XpDestroyContext(p->pdpy, p->pcontext);
+    }
+    XtCloseDisplay(p->pdpy);
+
+    p->toplevel   = NULL;
+    p->isPrinting = False;
+    p->pdpy       = NULL;
+    p->pscreen    = NULL;
+    p->pcontext   = None;
+}
+
+static
+void PrintEndJobCB(Widget pshell, XtPointer client_data, XtPointer call_data)
+{
+    AppPrintData *p = (AppPrintData *)client_data;
+
+    Log(("--> PrintEndJobCB\n"));
+
+    /* Finish printing and destroy print shell (it's legal to destroy Xt
+     * widgets from within it's own callbacks) */
+    FinishPrinting(p);
+}
+
+static
+XFontSet GetPrintTextFontSet(const char *appname, Display *pdpy, long dpi_x, long dpi_y)
+{
+    XFontSet     fontset;
+    char         fontname[1024];
+    char       **missing_charset_list_return;
+    int          missing_charset_count_return;
+    char        *def_string_return;
+    int          i;
+    
+    sprintf(fontname, /* Default font for CDE */
+                      "-dt-interface user-medium-r-normal-s*-*-120-%ld-%ld-*-*,"
+                      /* Default font */
+                      "-adobe-courier-medium-r-normal--*-120-%ld-%ld-*-*,"
+                      /* Default font for Linux/Japanese locales (ja_JP.SJIS) */
+                      "-watanabe-mincho-medium-r-normal--*-120-%ld-%ld-*-*,"
+                      "-wadalab-gothic-medium-r-normal--*-120-%ld-%ld-*-*,"
+                      /* Fallback */
+                      "-*-*-*-*-*--*-120-%ld-%ld-*-*",
+                      dpi_x, dpi_y,
+                      dpi_x, dpi_y,
+                      dpi_x, dpi_y,
+                      dpi_x, dpi_y,
+                      dpi_x, dpi_y);
+    fontset = XCreateFontSet(pdpy, fontname,
+                             &missing_charset_list_return,
+                             &missing_charset_count_return,
+                             &def_string_return);
+
+    for( i=0 ; i < missing_charset_count_return ; i++ ) {
+        fprintf(stderr, "%s: warning: font for charset %s is lacking.\n",
+                appname, missing_charset_list_return[i]);
+    }
+
+    if (!fontset)
+        Error(("GetPrintTextFontSet: XCreateFontSet() failure.\n"));
+    return fontset;
+}
+
+void DoPrintTextSource(const char *programname,
+                       Widget textsource, Widget toplevel,
+                       Display *pdpy, XPContext pcontext,
+                       XpuColorspaceRec *colorspace,
+                       XtCallbackProc pdpyDestroyCB,
+                       const char *jobtitle, const char *toFile)
+{
+    long               dpi_x = 0L,
+                       dpi_y = 0L;
+    int                n;
+    Arg                args[20];
+    XFontSet           textfontset = NULL;
+    XFontSetExtents   *font_extents;
+    
+    apd->programname         = programname;
+    apd->pdpyDestroyCallback = pdpyDestroyCB;
+  
+    if (apd->isPrinting) {
+        PrintMsg(("Already busy with printing.\n"));
+        return;
+    } 
+        
+    /* Configure the print context (paper size, title etc.)
+     * We must do this before creating any Xt widgets - otherwise they will
+     * make wrong assuptions about fonts, resultions etc. ...
+     */
+    XpuSetJobTitle(pdpy, pcontext, jobtitle);
+    
+    /* Configuration done, set the context */
+    XpSetContext(pdpy, pcontext);   
+
+    /* Get default printer resolution */   
+    if (XpuGetResolution(pdpy, pcontext, &dpi_x, &dpi_y) != 1) {
+        PrintMsg(("No default resolution for printer.\n"));
+        XpuClosePrinterDisplay(pdpy, pcontext);
+        return;
+    }
+    
+    apd->toplevel = toplevel;
+    apd->pdpy     = pdpy;
+    apd->pcontext = pcontext;
+    apd->pscreen  = XpGetScreenOfContext(pdpy, pcontext);
+    apd->jobtitle = jobtitle;
+
+    n = 0;
+    /* Override any geometry resource settings as XawPrintShell adjusts it's size
+     * to the current page siue when |XawPrintLAYOUTMODE_DRAWABLEAREA| or
+     * |XawPrintLAYOUTMODE_PAGESIZE| are used. */
+    XtSetArg(args[n], XtNgeometry,    "+0+0");                          n++;
+    XtSetArg(args[n], XawNlayoutMode, XawPrintLAYOUTMODE_DRAWABLEAREA); n++;
+    if (colorspace) {
+        printf("Setting visual to id=0x%lx.\n", colorspace->visualinfo.visualid);
+    }
+    apd->printshell = CreatePrintShell(toplevel, apd->pscreen, 
+                                       (colorspace?(colorspace->visualinfo.visual):(NULL)),
+                                       "printshell", args, n);
+    n = 0;
+    XtSetArg(args[n], XtNresizable,            True);            n++;
+    XtSetArg(args[n], XtNright,                XtChainRight);    n++;
+    apd->content.form = XtCreateManagedWidget("form", formWidgetClass, apd->printshell, args, n);
+
+    textfontset = GetPrintTextFontSet(apd->programname, pdpy, dpi_x, dpi_y);
+
+    n = 0;
+    XtSetArg(args[n], XtNinternational,        True);            n++;
+    XtSetArg(args[n], XtNfromHoriz,            NULL);            n++;
+    XtSetArg(args[n], XtNfromVert,             NULL);            n++;
+    XtSetArg(args[n], XtNtop,                  XtChainTop);      n++;
+    XtSetArg(args[n], XtNright,                XtChainRight);    n++;
+    XtSetArg(args[n], XtNresizable,            True);            n++;
+    XtSetArg(args[n], XtNfontSet,              textfontset);     n++;
+    XtSetArg(args[n], XtNlabel,                "Page: n/n");     n++;
+    XtSetArg(args[n], XtNjustify,              XtJustifyRight);  n++;
+    apd->content.pageheaderlabel = XtCreateManagedWidget("pageinfo", labelWidgetClass, apd->content.form, args, n);
+
+    font_extents = XExtentsOfFontSet(textfontset);
+
+    n = 0;
+    XtSetArg(args[n], XtNinternational,    True);                         n++;
+    XtSetArg(args[n], XtNtextSource,       textsource);                   n++;
+    XtSetArg(args[n], XtNscrollHorizontal, XawtextScrollNever);           n++;
+    XtSetArg(args[n], XtNscrollVertical,   XawtextScrollNever);           n++;
+
+/* Usually I would expect that using |XtNfromVert, apd->content.pageheaderlabel|
+ * would be the correct way to place the text widget with the main content below
+ * the page header widget - but for an unknown reason this doesn not work: The
+ * text widget squishes itself into the bottom half of the page and only occupies
+ * 1/2 of the page's with... ;-(( */
+#define WORKAROUND_FOR_SOMETHING_IS_WRONG 1
+#ifdef WORKAROUND_FOR_SOMETHING_IS_WRONG
+    XtSetArg(args[n], XtNtop,              XtChainTop);                   n++;
+    XtSetArg(args[n], XtNright,            XtChainRight);                 n++;
+    XtSetArg(args[n], XtNvertDistance,     (font_extents->max_logical_extent.height+2)*2); n++;    
+#else
+    XtSetArg(args[n], XtNfromHoriz,        NULL);                         n++;
+    XtSetArg(args[n], XtNfromVert,         apd->content.pageheaderlabel); n++;
+#endif
+    XtSetArg(args[n], XtNfontSet,          textfontset);                  n++;
+    apd->content.text = XtCreateManagedWidget("text", asciiTextWidgetClass, apd->content.form, args, n);
+
+    /* Disable the caret - that is not needed for printing */
+    XawTextDisplayCaret(apd->content.text, False);
+    
+    XtAddCallback(apd->printshell, XawNpageSetupCallback, PageSetupCB,   (XtPointer)apd);
+    XtAddCallback(apd->printshell, XawNendJobCallback,    PrintEndJobCB, (XtPointer)apd);
+
+    /* Realise print shell (which will set position+size of the child
+     * widgets based on the current page size) */
+    XtRealizeWidget(apd->printshell);
+    
+    /* Count number of pages in the text widget */
+    apd->numpages = CountPages(apd->content.text);
+
+    /* Make sure that the Xt machinery is really using the right screen (assertion) */
+    if (XpGetScreenOfContext(XtDisplay(apd->printshell), apd->pcontext) != XtScreen(apd->printshell))
+        Error(("Widget's screen != print screen. BAD.\n"));
+
+    apd->isPrinting = True;
+
+    if (toFile) {
+        PrintMsg(("Printing to file '%s'...\n", toFile));
+        apd->printtofile_handle = XpuStartJobToFile(pdpy, pcontext, toFile);
+        if (!apd->printtofile_handle) {
+            perror("XpuStartJobToFile failure");
+            PrintMsg(("Printing failed: XpuStartJobToFile\n"));
+            apd->isPrinting = False;
+            return;
+        }
+    }
+    else
+    {
+        PrintMsg(("Printing to printer...\n"));
+        XpuStartJobToSpooler(pdpy);
+    }
+}
+
+
diff --git a/xedit/print.h b/xedit/print.h
new file mode 100644 (file)
index 0000000..a87779c
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * $Xorg: print.h,v 1.1 2004/04/30 02:05:54 gisburn Exp $
+ *
+Copyright 2004 Roland Mainz <roland.mainz@nrubsig.org>
+
+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.
+ *
+ */
+
+#ifndef XMORE_PRINT_H
+#define XMORE_PRINT_H 1
+
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Shell.h>
+#include <X11/Xaw/Print.h>
+#include <X11/Xaw/Cardinals.h>
+#include <X11/XprintUtil/xprintutil.h>
+
+#if defined(XMORE)
+#define PrintMsg(x) { printf("xmore: "); printf x ; }
+#elif defined(XEDIT)
+#define PrintMsg(x) { XeditPrintf x ; }
+#else
+#error unknown application
+#endif 
+
+/* Prototypes */
+void DoPrintTextSource(const char *programname,
+                       Widget textsource,
+                       Widget toplevel, 
+                       Display *pdpy, XPContext pcontext,
+                       XpuColorspaceRec *colorspace,
+                       XtCallbackProc printDisplayDestroyCallback,
+                       const char *jobTitle,
+                       const char *toFile);
+
+#endif /* !XMORE_PRINT_H */
diff --git a/xedit/printdialog.c b/xedit/printdialog.c
new file mode 100644 (file)
index 0000000..50d2a88
--- /dev/null
@@ -0,0 +1,1396 @@
+/*
+ * $Xorg: printdialog.c,v 1.1 2004/05/12 02:05:54 gisburn Exp $
+ *
+Copyright 2004 Roland Mainz <roland.mainz@nrubsig.org>
+
+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.
+ *
+ */
+
+/* Force ANSI C prototypes from X11 headers */
+#ifndef FUNCPROTO 
+#define FUNCPROTO 15
+#endif /* !FUNCPROTO */
+
+#include <X11/StringDefs.h> 
+#include <X11/Intrinsic.h> 
+#include <X11/Shell.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Toggle.h>
+#include <X11/Xaw/List.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Dialog.h>
+
+#ifdef XKB
+#include <X11/extensions/XKBbells.h>
+#endif /* XKB */
+
+#ifdef XEDIT
+#include "xedit.h"
+#endif /* XEDIT */
+#include "printdialog.h"
+#include "printdialogprivates.h"
+#include "print.h"
+
+#include <stdlib.h>
+#include <ctype.h>
+#include <stdio.h>
+
+/* Turn a NULL pointer string into an empty string */
+#define NULLSTR(x) (((x)!=NULL)?(x):(""))
+
+#define Error(x) { printf x ; exit(EXIT_FAILURE); }
+#define Assertion(expr, msg) { if (!(expr)) { Error msg } }
+#ifdef DEBUG
+#  define Log(x)   { if(True)  printf x; }
+#else
+#  define Log(x)   { if(False) printf x; }
+#endif /* DEBUG */
+
+/* Local prototypes */
+static void     do_beep(PrintDialogWidget pdw);
+static void     center_popup(Widget parent, Widget popup);
+static void     updateWidgetStates(PrintDialogWidget pdw);
+static void     printSetupClose(PrintDialogWidget pdw);
+static void     printSetupOKXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printSetupCancelXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printSetupJobCopiesXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printDialogDestXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printSelectFileXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printOKXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printSetupXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printFileSelectedXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     buildFileDialog(PrintDialogWidget pdw);
+static void     closePrinterConnection(PrintDialogWidget  pdw, Bool closeDisplay);
+static Bool     openPrinterConnection(PrintDialogWidget  pdw);
+static void     destroyPrintSetupDialog(PrintDialogWidget pdw);
+static Widget   buildPrintSetupDialog(PrintDialogWidget pdw);
+static String  *xpprinterlist_to_widget_printerlist(XPPrinterList printerlist, int num_printers);
+static String  *xppaperlist_to_widget_paperlist(XpuMediumSourceSizeList paperlist, int num_papers);
+static String  *xpresolutionlist_to_widget_resolutionlist(XpuResolutionList reslist, int num_resolutions);
+static String  *xporientationlist_to_widget_orientationlist(XpuOrientationList orientationlist, int num_orientations);
+static String  *xpplexlist_to_widget_plexlist(XpuPlexList plexlist, int num_plex);
+static String  *xpcolorspacelist_to_widget_colorspacelist(XpuColorspaceList colorspacelist, int num_colorspaces);
+static void     printerSelectionPrinterSelectedXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printSelectPrinterXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printerSelectionClose(PrintDialogWidget  pdw);
+static void     printerSelectionOKXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printerSelectionCancelXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static Bool     buildPrinterSelectionDialog(PrintDialogWidget  pdw);
+static void     destroyPrinterSelectionDialog(PrintDialogWidget pdw);
+static void     createprintdialogchildren(Widget w);
+
+static
+void do_beep(PrintDialogWidget pdw)
+{
+    Log(("*** Beep!\n"));
+#ifdef XKB
+    XkbStdBell(XtDisplay((Widget)pdw), XtWindow((Widget)pdw), 0, XkbBI_MinorError);
+#else
+    XBell(XtDisplay((Widget)pdw), 0);
+#endif /* XKB */
+}
+
+/* Center popup (on parent, not on screen - which would be a bad idea
+ * in the Xinerama case) */
+static
+void center_popup(Widget parent, Widget popup)
+{
+    Dimension width,
+              height;
+    Position  x,
+              y;
+
+    XtVaGetValues(parent,
+        XtNx,  &x,
+        XtNy,  &y,
+        NULL);
+    XtVaGetValues(popup,
+        XtNwidth,  &width,
+        XtNheight, &height,
+        NULL);
+
+    x += (Position)width  / 2;
+    y += (Position)height / 3;
+
+    XtVaSetValues(popup,
+        XtNx, x,
+        XtNy, y,
+        NULL);
+}
+
+static
+void updateWidgetStates(PrintDialogWidget pdw)
+{
+    PrintDialogPart *pdp = &pdw->printdialog;
+    
+    /* Do not update anything if we will be destroyed */
+    if (pdw->core.being_destroyed)
+        return;
+
+    if (pdp->printToFile == False) {  
+        XtVaSetValues(pdp->main.printtoprinter, XtNstate,     True,  NULL);
+        XtVaSetValues(pdp->main.printtofile,    XtNstate,     False, NULL);
+        /* Disable the widgets which depend on print-to-file */
+        XtVaSetValues(pdp->main.filenamelabel,  XtNsensitive, False, NULL);
+        XtVaSetValues(pdp->main.filename,       XtNsensitive, False, NULL);
+        XtVaSetValues(pdp->main.selectfile,     XtNsensitive, False, NULL);
+    }
+    else
+    {
+        XtVaSetValues(pdp->main.printtoprinter, XtNstate, False, NULL);
+        XtVaSetValues(pdp->main.printtofile,    XtNstate, True,  NULL);
+        /* Enable the widgets which depend on print-to-file */
+        XtVaSetValues(pdp->main.filenamelabel,  XtNsensitive, True, NULL);
+        XtVaSetValues(pdp->main.filename,       XtNsensitive, True, NULL);
+        XtVaSetValues(pdp->main.selectfile,     XtNsensitive, True, NULL);
+    }
+
+    /* Update file name */
+    XtVaSetValues(pdp->main.filename, XtNlabel, pdp->filename?pdp->filename:"-", NULL);
+    
+    /* General check whether we can print... */
+    pdp->canPrint = True;
+    if (pdp->printer_name == NULL) {
+        pdp->canPrint = False;
+    }
+    else if (strlen(pdp->printer_name) == 0) {
+        pdp->canPrint = False;
+    }
+
+    pdp->canReallyPrint = pdp->canPrint;
+
+    /* Some extra checks for print-to-file */
+    if (pdp->printToFile) {
+        if (pdp->filename == NULL) {
+            pdp->canReallyPrint = False;
+        }
+        else if (strlen(pdp->filename) == 0) {
+            pdp->canReallyPrint = False;
+        }
+    }
+
+    XtVaSetValues(pdp->main.ok,    XtNsensitive, pdp->canReallyPrint, NULL);
+    XtVaSetValues(pdp->main.setup, XtNsensitive, pdp->canPrint,       NULL);
+}
+
+static void
+printSetupClose(PrintDialogWidget pdw)
+{ 
+    PrintDialogPart *pdp = &pdw->printdialog;
+    if (pdp->setup.popup) {
+        XtPopdown(pdp->setup.popup);
+    }
+}
+
+static void
+printSetupOKXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget    pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart     *pdp = &pdw->printdialog;
+    char                *s;
+    XawListReturnStruct *lrs;    
+    Log(("## printSetupOK: closing print setup!\n"));
+    
+    /* Set copy count (if the value is invalid beep and return to the user ) */
+    XtVaGetValues(pdp->setup.jobcopies, XtNstring, &s, NULL);
+    if (s) {
+        int c = atoi(s);
+        if (c < 1 || c > 999) {
+            do_beep(pdw);
+            XtVaSetValues(pdp->setup.jobcopies, XtNstring, "1", NULL);
+            Log(("## printSetupOKXtProc: not a valid copy count value\n"));
+            return;
+        }
+        
+        /* Fix me: We should set the number of _job_ copies here, not _doc_ copies */
+        XpuSetDocumentCopies(pdp->pdpy, pdp->pcontext, c);
+    }
+    
+    /* Set paper size */
+    lrs = XawListShowCurrent(pdp->setup.paperlist);
+    if (lrs->list_index != XAW_LIST_NONE) {
+        Log(("selected paper is '%s'/'%d'\n", lrs->string, lrs->list_index));
+        Assertion(lrs->list_index < pdp->num_papers, (("Error: lrs->list_index < pdp->num_papers\n")));
+        XpuSetDocMediumSourceSize(pdp->pdpy, pdp->pcontext, &pdp->paperlist[lrs->list_index]);
+    }
+    XtFree((char *)lrs);
+
+    /* Set resolution */
+    lrs = XawListShowCurrent(pdp->setup.resolutionlist);
+    if (lrs->list_index != XAW_LIST_NONE) {
+        Log(("selected resolution is '%s'/'%d'\n", lrs->string, lrs->list_index));
+        Assertion(lrs->list_index < pdp->num_resolutions, (("Error: lrs->list_index < pdp->num_resolutions\n")));
+        XpuSetDocResolution(pdp->pdpy, pdp->pcontext, &pdp->resolutionlist[lrs->list_index]);
+    }
+    XtFree((char *)lrs);
+
+    /* Set orientation */
+    lrs = XawListShowCurrent(pdp->setup.orientationlist);
+    if (lrs->list_index != XAW_LIST_NONE) {
+        Log(("selected orientation is '%s'/'%d'\n", lrs->string, lrs->list_index));
+        Assertion(lrs->list_index < pdp->num_orientations, (("Error: lrs->list_index < pdp->num_orientations\n")));
+        XpuSetDocOrientation(pdp->pdpy, pdp->pcontext, &pdp->orientationlist[lrs->list_index]);
+    }
+    XtFree((char *)lrs);
+
+    /* Set plex mode */
+    lrs = XawListShowCurrent(pdp->setup.plexlist);
+    if (lrs->list_index != XAW_LIST_NONE) {
+        Log(("selected plex is '%s'/'%d'\n", lrs->string, lrs->list_index));
+        Assertion(lrs->list_index < pdp->num_plex, (("Error: lrs->list_index < pdp->num_plex\n")));
+        XpuSetDocPlex(pdp->pdpy, pdp->pcontext, &pdp->plexlist[lrs->list_index]);
+    }
+    XtFree((char *)lrs);
+
+    /* Set colorspace */
+    lrs = XawListShowCurrent(pdp->setup.colorspacelist);
+    if (lrs->list_index != XAW_LIST_NONE) {
+        Log(("selected colorspace is '%s'/'%d'\n", lrs->string, lrs->list_index));
+        Assertion(lrs->list_index < pdp->num_colorspaces, (("Error: lrs->list_index < pdp->num_colorspaces\n")));
+        pdp->selected_colorspace = &pdp->colorspacelist[lrs->list_index];
+    }
+    XtFree((char *)lrs);
+    
+    printSetupClose(pdw);
+}
+
+static void
+printSetupCancelXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget  pdw = (PrintDialogWidget)client_data;
+    Log(("## printSetupCancel: closing print setup!\n"));
+
+    printSetupClose(pdw);
+}
+
+static void
+printSetupJobCopiesXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget pdw    = (PrintDialogWidget)client_data;
+    PrintDialogPart  *pdp    = &pdw->printdialog;
+    char             *string = NULL;
+    
+    Log(("## printSetupJobCopiesXtProc!\n"));
+
+    /* Check whether the input is a valid number - and in the case of invalid input reset the value */    
+    XtVaGetValues(pdp->setup.jobcopies, XtNstring, &string, NULL);
+    if (string) {
+        char *s;
+        int   i;
+        Bool  isValidNumber = True;
+
+        /* First check for invalid characters... */
+        for( s = string ; *s != '\0' ; s++ ) {
+            if (!isdigit(*s)) {
+                isValidNumber = False;
+                break;
+            }
+        }
+        
+        /* .. and the do a range check... */
+        i = atoi(string);
+        if (i < 1 || i > 999) {
+            isValidNumber = False;
+        }
+        
+        if (!isValidNumber) {
+            do_beep(pdw);
+            XtVaSetValues(pdp->setup.jobcopies, XtNstring, "1", NULL);
+            Log(("## printSetupJobCopiesXtProc: not a valid number\n"));
+        }
+    }
+}
+
+static void
+printCancelXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart  *pdp = &pdw->printdialog;
+
+    printSetupClose(pdw);
+
+    if (pdp->cancel_callback) {
+        Log(("printCancelXtProc: calling callback\n"));
+        XtCallCallbackList((Widget)pdw, pdp->cancel_callback, NULL);
+    }
+}
+
+static void
+printDialogDestXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget  pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart   *pdp = &pdw->printdialog;
+
+    if (w == pdp->main.printtoprinter) {  
+        pdp->printToFile = False;
+    }
+    else if (w == pdp->main.printtofile) {
+        pdp->printToFile = True;
+    }
+    else
+    {
+        Log(("printDialogDestXtProc: ERROR: Unknown widget.\n"));
+    }
+
+    updateWidgetStates(pdw);
+}
+
+static void
+printSelectFileXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget   pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart    *pdp = &pdw->printdialog;
+
+    Log(("## printSelectFileXtProc!\n"));
+
+    if (!pdp->selectFile.shell) {
+        buildFileDialog(pdw);
+    }
+    
+    center_popup((Widget)pdw, pdp->selectFile.shell);
+
+    XtPopup(pdp->selectFile.shell, XtGrabExclusive);
+}
+
+static void
+printOKXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget  pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart   *pdp = &pdw->printdialog;
+    Log(("## printing!\n"));
+    
+    if (!pdp->pdpy) {
+        Log(("printOKXtProc: no printer connection, opening one....\n"));
+        openPrinterConnection(pdw);
+
+        if (!pdp->pdpy) {
+            Log(("printOKXtProc: still no printer connection - BAD (this should never happen).\n"));
+            do_beep(pdw);
+            return;
+        }
+    }    
+
+    if (pdp->ok_callback) {
+        XawPrintDialogCallbackStruct pdcs;
+
+        Log(("printOKXtProc: calling callbacks...\n"));
+        memset(&pdcs, 0, sizeof(pdcs));
+        pdcs.pdpy            = pdp->pdpy;
+        pdcs.pcontext        = pdp->pcontext;
+        pdcs.printToFile     = pdp->printToFile;
+        pdcs.printToFileName = (const char *)pdp->filename;
+        pdcs.colorspace      = pdp->selected_colorspace;
+        XtCallCallbackList((Widget)pdw, pdp->ok_callback, &pdcs);
+    }
+
+    printSetupClose(pdw);
+}
+
+static void
+printSetupXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget   pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart    *pdp = &pdw->printdialog;
+
+    Log(("## setup!\n"));
+
+    if (!pdp->setup.popup) {
+        if (buildPrintSetupDialog(pdw) == NULL) {
+            Log(("printSetupXtProc: buildPrintSetupDialog failure.\n"));
+            return;
+        }
+    }
+
+    center_popup((Widget)pdw, pdp->setup.popup);
+
+    XtPopup(pdp->setup.popup, XtGrabExclusive);
+}
+
+static void
+printFileSelectedXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget  pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart   *pdp = &pdw->printdialog;
+    const char        *filename;
+    
+    Log(("printFileSelectedXtProc: User selected file.\n"));
+    filename = XawDialogGetValueString(pdp->selectFile.dialog);
+    
+    if (pdp->filename)
+        free(pdp->filename);
+    pdp->filename = strdup(filename);
+    
+    XtPopdown(pdp->selectFile.shell);
+    
+    updateWidgetStates(pdw);
+}
+
+static
+void buildFileDialog(PrintDialogWidget pdw)
+{
+    PrintDialogPart *pdp = &pdw->printdialog;
+    int              n;
+    Arg              args[20];
+
+    pdp->selectFile.shell = XtCreatePopupShell("selectfile",
+                                               transientShellWidgetClass,
+                                               (Widget)pdw, NULL, 0);
+    n = 0;
+    XtSetArg(args[n], XtNvalue, pdp->filename?pdp->filename:""); n++;  
+    pdp->selectFile.dialog = XtCreateManagedWidget("dialog", dialogWidgetClass,
+                                                   pdp->selectFile.shell, args, n);
+    XawDialogAddButton(pdp->selectFile.dialog, "Accept", printFileSelectedXtProc, pdw);
+
+    XtRealizeWidget(pdp->selectFile.shell);
+}
+
+static
+void closePrinterConnection(PrintDialogWidget pdw, Bool closeDisplay)
+{ 
+    PrintDialogPart *pdp = &pdw->printdialog;
+    
+    Log(("# closePrinterConnection\n"));
+
+    destroyPrintSetupDialog(pdw);
+
+    if (pdp->paperlist) {
+        XpuFreeMediumSourceSizeList(pdp->paperlist);
+        pdp->paperlist = NULL;
+    }
+
+    if (pdp->widget_paperlist) {
+        free(pdp->widget_paperlist);
+        pdp->widget_paperlist = NULL;
+    }
+
+    if (pdp->resolutionlist) {
+        XpuFreeResolutionList(pdp->resolutionlist);
+        pdp->resolutionlist = NULL;
+    }
+
+    if (pdp->widget_resolutionlist) {
+        free(pdp->widget_resolutionlist);
+        pdp->widget_resolutionlist = NULL;
+    }
+
+
+    if (pdp->orientationlist) {
+        XpuFreeOrientationList(pdp->orientationlist);
+        pdp->orientationlist = NULL;
+    }  
+
+    if (pdp->widget_orientationlist) {
+        free(pdp->widget_orientationlist);
+        pdp->widget_orientationlist = NULL;
+    }
+
+    if (pdp->plexlist) {
+        XpuFreePlexList(pdp->plexlist);
+        pdp->plexlist = NULL;
+    }  
+
+    if (pdp->widget_plexlist) {
+        free(pdp->widget_plexlist);
+        pdp->widget_plexlist = NULL;
+    }
+
+    if (pdp->colorspacelist) {
+        XpuFreeColorspaceList(pdp->colorspacelist);
+        pdp->colorspacelist = NULL;
+    }  
+
+    if (pdp->widget_colorspacelist) {
+        free(pdp->widget_colorspacelist);
+        pdp->widget_colorspacelist = NULL;
+    }
+    pdp->selected_colorspace = NULL;
+
+    if (pdp->pdpy) {
+        if (closeDisplay) {
+            XpuClosePrinterDisplay(pdp->pdpy, pdp->pcontext);
+        }
+        pdp->pdpy     = NULL;
+        pdp->pcontext = None;
+    }
+
+    updateWidgetStates(pdw);
+}
+
+static
+Bool openPrinterConnection(PrintDialogWidget pdw)
+{
+    PrintDialogPart   *pdp = &pdw->printdialog;
+
+    Log(("# openPrinterConnection\n"));
+
+    /* Close any outstanding connection first... */
+    closePrinterConnection(pdw, True);
+
+    if (!pdp->printer_name) {
+        Log(("# error: openPrinterConnection: No printer name.\n"));
+        return False;
+    }
+
+    if (XpuGetPrinter(pdp->printer_name, &pdp->pdpy, &pdp->pcontext) == False) {
+        Log(("openPrinterConnection: could not open printer.\n"));
+        return False;
+    }
+
+    pdp->paperlist       = XpuGetMediumSourceSizeList(pdp->pdpy, pdp->pcontext, &pdp->num_papers);
+    pdp->resolutionlist  =       XpuGetResolutionList(pdp->pdpy, pdp->pcontext, &pdp->num_resolutions);
+    pdp->orientationlist =      XpuGetOrientationList(pdp->pdpy, pdp->pcontext, &pdp->num_orientations);
+    pdp->plexlist        =             XpuGetPlexList(pdp->pdpy, pdp->pcontext, &pdp->num_plex);  
+    pdp->colorspacelist  =       XpuGetColorspaceList(pdp->pdpy, pdp->pcontext, &pdp->num_colorspaces);  
+
+    pdp->widget_paperlist       = xppaperlist_to_widget_paperlist(pdp->paperlist, pdp->num_papers);
+    pdp->widget_resolutionlist  = xpresolutionlist_to_widget_resolutionlist(pdp->resolutionlist, pdp->num_resolutions);
+    pdp->widget_orientationlist = xporientationlist_to_widget_orientationlist(pdp->orientationlist, pdp->num_orientations);
+    pdp->widget_plexlist        = xpplexlist_to_widget_plexlist(pdp->plexlist, pdp->num_plex);
+    pdp->widget_colorspacelist  = xpcolorspacelist_to_widget_colorspacelist(pdp->colorspacelist, pdp->num_colorspaces);
+
+    updateWidgetStates(pdw);
+
+    return True;
+}
+
+#undef DEFAULT_WIDTH
+#define DEFAULT_WIDTH 120
+#undef DEFAULT_INFOLABEL_WIDTH
+#define DEFAULT_INFOLABEL_WIDTH 250
+
+static
+void destroyPrintSetupDialog(PrintDialogWidget pdw)
+{
+    PrintDialogPart *pdp = &pdw->printdialog;
+
+    if (pdp->setup.popup) {
+        XtDestroyWidget(pdp->setup.popup);
+    }
+
+    /* |XtDestroyWidget(pdp->setup.popup);| above will recursively destroy
+     * all children so we only have to reset the pointers here... */
+    pdp->setup.popup            = NULL;
+    pdp->setup.form             = NULL;
+    pdp->setup.paperlist        = NULL;
+    pdp->setup.resolutionlist   = NULL;
+    pdp->setup.orientationlist  = NULL;
+    pdp->setup.plexlist         = NULL;
+    pdp->setup.colorspacelist   = NULL;
+    pdp->setup.ok               = NULL;
+    pdp->setup.cancel           = NULL;
+}
+
+static
+Widget buildPrintSetupDialog(PrintDialogWidget pdw)
+{
+    PrintDialogPart  *pdp = &pdw->printdialog;
+    int               n;
+    Arg               args[20];
+    Widget            listform;
+    XpuSupportedFlags jobflags,
+                      docflags;
+    Bool              canChangeJobCopies,
+                      canChangePaperSize,
+                      canChangeResolution,
+                      canChangeOrientation,
+                      canChangePlex;
+
+    if (!pdp->pdpy) {
+        Log(("buildPrintSetupDialog: no printer connection, opening one....\n"));
+        openPrinterConnection(pdw);
+
+        if (!pdp->pdpy) {
+            Log(("buildPrintSetupDialog: still no printer connection - BAD.\n"));
+            do_beep(pdw);
+            return NULL;
+        }
+    }
+
+    /* Get flags which types of attributes can be modified */
+    jobflags = XpuGetSupportedDocAttributes(pdp->pdpy, pdp->pcontext);
+    docflags = XpuGetSupportedDocAttributes(pdp->pdpy, pdp->pcontext);
+    canChangeJobCopies   = (jobflags & XPUATTRIBUTESUPPORTED_COPY_COUNT) == XPUATTRIBUTESUPPORTED_COPY_COUNT;
+    canChangePaperSize   = (docflags & XPUATTRIBUTESUPPORTED_DEFAULT_MEDIUM) == XPUATTRIBUTESUPPORTED_DEFAULT_MEDIUM;
+    canChangeResolution  = (docflags & XPUATTRIBUTESUPPORTED_DEFAULT_PRINTER_RESOLUTION) == XPUATTRIBUTESUPPORTED_DEFAULT_PRINTER_RESOLUTION;
+    canChangeOrientation = (docflags & XPUATTRIBUTESUPPORTED_CONTENT_ORIENTATION) == XPUATTRIBUTESUPPORTED_CONTENT_ORIENTATION;
+    canChangePlex        = (docflags & XPUATTRIBUTESUPPORTED_PLEX) == XPUATTRIBUTESUPPORTED_PLEX;
+
+    n = 0;
+    XtSetArg(args[n], XtNallowShellResize, True); n++;
+    pdp->setup.popup = XtCreatePopupShell("setup", transientShellWidgetClass, (Widget)pdw, args, n);
+
+    n = 0;
+    pdp->setup.form = XtCreateManagedWidget("form", formWidgetClass, pdp->setup.popup, args, n);
+
+    n = 0;
+    listform = XtCreateManagedWidget("list", formWidgetClass, pdp->setup.form, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNresizable,           True);                        n++;
+    XtSetArg(args[n], XtNforceColumns,        True);                        n++;
+    XtSetArg(args[n], XtNdefaultColumns,      1);                           n++;
+    XtSetArg(args[n], XtNsensitive,           canChangePaperSize);          n++;
+    XtSetArg(args[n], XtNlist,                pdp->widget_paperlist);       n++;
+    XtSetArg(args[n], XtNwidth,               DEFAULT_WIDTH);               n++;
+    pdp->setup.paperlist = XtCreateManagedWidget("paperlist", listWidgetClass, listform, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNresizable,           True);                        n++;
+    XtSetArg(args[n], XtNforceColumns,        True);                        n++;
+    XtSetArg(args[n], XtNdefaultColumns,      1);                           n++;
+    XtSetArg(args[n], XtNsensitive,           canChangeResolution);         n++;
+    XtSetArg(args[n], XtNlist,                pdp->widget_resolutionlist);  n++;
+    XtSetArg(args[n], XtNwidth,               DEFAULT_WIDTH);               n++;
+    pdp->setup.resolutionlist = XtCreateManagedWidget("resolutionlist", listWidgetClass, listform, args, n);
+    
+    n = 0;
+    XtSetArg(args[n], XtNresizable,           True);                        n++;
+    XtSetArg(args[n], XtNforceColumns,        True);                        n++;
+    XtSetArg(args[n], XtNdefaultColumns,      1);                           n++;
+    XtSetArg(args[n], XtNsensitive,           canChangeOrientation);        n++;
+    XtSetArg(args[n], XtNlist,                pdp->widget_orientationlist); n++;
+    XtSetArg(args[n], XtNwidth,               DEFAULT_WIDTH);               n++;
+    pdp->setup.orientationlist = XtCreateManagedWidget("orientationlist", listWidgetClass, listform, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNresizable,           True);                        n++;
+    XtSetArg(args[n], XtNforceColumns,        True);                        n++;
+    XtSetArg(args[n], XtNdefaultColumns,      1);                           n++;
+    XtSetArg(args[n], XtNsensitive,           canChangePlex);               n++;
+    XtSetArg(args[n], XtNlist,                pdp->widget_plexlist);        n++;
+    XtSetArg(args[n], XtNwidth,               DEFAULT_WIDTH);               n++;
+    pdp->setup.plexlist = XtCreateManagedWidget("plexlist", listWidgetClass, listform, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNresizable,           True);                        n++;
+    XtSetArg(args[n], XtNforceColumns,        True);                        n++;
+    XtSetArg(args[n], XtNdefaultColumns,      1);                           n++;
+    XtSetArg(args[n], XtNsensitive,           True);                        n++;
+    XtSetArg(args[n], XtNlist,                pdp->widget_colorspacelist);  n++;
+    XtSetArg(args[n], XtNwidth,               DEFAULT_WIDTH);               n++;
+    pdp->setup.colorspacelist = XtCreateManagedWidget("colorspacelist", listWidgetClass, listform, args, n);
+    
+    n = 0;
+    XtSetArg(args[n], XtNborderWidth,         0);                           n++;
+    XtSetArg(args[n], XtNresizable,           False);                       n++;
+    XtSetArg(args[n], XtNjustify,             XtJustifyRight);              n++;
+    XtSetArg(args[n], XtNwidth,               DEFAULT_WIDTH);               n++;
+    XtSetArg(args[n], XtNsensitive,           canChangeJobCopies);          n++;
+    pdp->setup.jobcopieslabel = XtCreateManagedWidget("jobcopieslabel", labelWidgetClass, listform, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNstring,              "1");                         n++;
+    XtSetArg(args[n], XtNresizable,           True);                        n++;
+    XtSetArg(args[n], XtNeditType,            XawtextEdit);                 n++;
+    XtSetArg(args[n], XtNsensitive,           canChangeJobCopies);          n++;
+    pdp->setup.jobcopies = XtCreateManagedWidget("jobcopies", asciiTextWidgetClass, listform, args, n);
+    XtAddCallback(pdp->setup.jobcopies, XtNpositionCallback, printSetupJobCopiesXtProc, pdw);
+
+    n = 0;
+    pdp->setup.ok = XtCreateManagedWidget("ok", commandWidgetClass, pdp->setup.form, args, n);
+    XtAddCallback(pdp->setup.ok, XtNcallback, printSetupOKXtProc, pdw);
+
+    n = 0;
+    pdp->setup.cancel = XtCreateManagedWidget("cancel", commandWidgetClass, pdp->setup.form, args, n);
+    XtAddCallback(pdp->setup.cancel, XtNcallback, printSetupCancelXtProc, pdw);
+
+    XtRealizeWidget(pdp->setup.popup); 
+
+    return pdp->setup.popup;
+}
+
+#undef DEFAULT_WIDTH
+#define DEFAULT_WIDTH 150
+
+static
+String *xpprinterlist_to_widget_printerlist(XPPrinterList printerlist, int num_printers)
+{
+    int     i;
+    String *names;
+
+    names = malloc(sizeof(String *) * (num_printers+1));
+    if(!names)
+      return NULL;
+
+    for(i = 0 ; i < num_printers ; i++)
+        names[i] = printerlist[i].name;
+
+    names[i] = NULL; /* Terminate the list */
+
+    return names;
+}
+
+static
+String *xppaperlist_to_widget_paperlist(XpuMediumSourceSizeList paperlist, int num_papers)
+{
+    int     i;
+    String *names;
+
+    names = malloc(sizeof(String *) * (num_papers+1));
+    if (!names)
+      return NULL;
+
+    for(i = 0 ; i < num_papers ; i++)
+        names[i] = (char *)paperlist[i].medium_name; /* FixMe: tray selection missing */
+
+    names[i] = NULL; /* Terminate the list */
+
+    return names;
+}
+
+static
+String *xpresolutionlist_to_widget_resolutionlist(XpuResolutionList reslist, int num_resolutions)
+{
+    int     i;
+    String *names;
+
+    names = malloc(sizeof(String *) * (num_resolutions+1));
+    if (!names)
+        return NULL;
+
+    for(i = 0 ; i < num_resolutions ; i++)
+        names[i] = (char *)reslist[i].name;
+
+    names[i] = NULL; /* Terminate the list */
+
+    return names;
+}
+
+static
+String *xporientationlist_to_widget_orientationlist(XpuOrientationList orientationlist, int num_orientations)
+{
+    int     i;
+    String *names;
+
+    names = malloc(sizeof(String *) * (num_orientations+1));
+    if (!names)
+        return NULL;
+
+    for(i = 0 ; i < num_orientations ; i++)
+        names[i] = (char *)orientationlist[i].orientation;
+
+    names[i] = NULL; /* Terminate the list */
+
+    return names;
+}
+
+static
+String *xpplexlist_to_widget_plexlist(XpuPlexList plexlist, int num_plex)
+{
+    int     i;
+    String *names;
+
+    names = malloc(sizeof(String *) * (num_plex+1));
+    if(!names)
+      return NULL;
+
+    for(i = 0 ; i < num_plex ; i++)
+      names[i] = (char *)plexlist[i].plex;
+
+    names[i] = NULL; /* Terminate the list */
+
+    return names;
+}
+
+static
+String *xpcolorspacelist_to_widget_colorspacelist(XpuColorspaceList colorspacelist, int num_colorspaces)
+{
+    int     i;
+    String *names;
+
+    names = malloc(sizeof(String *) * (num_colorspaces+1));
+    if(!names)
+      return NULL;
+
+    for(i = 0 ; i < num_colorspaces ; i++)
+      names[i] = (char *)colorspacelist[i].name;
+
+    names[i] = NULL; /* Terminate the list */
+
+    return names;
+}
+
+static void
+printerSelectionPrinterSelectedXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget    pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart     *pdp = &pdw->printdialog;
+    XawListReturnStruct *lrs = (XawListReturnStruct *)callData;
+    int                  list_index;
+
+    Log(("## user selected a printer\n"));
+
+    list_index = lrs->list_index;
+    if (list_index == XAW_LIST_NONE) {
+        Log(("printerSelectionPrinterSelectedXtProc: Nothing selected.\n"));
+        return;
+    }
+    
+    Log(("selected printer is '%d'/'%s'/'%s'\n", 
+        list_index, lrs->string, NULLSTR(pdp->printerlist[list_index].name)));
+
+    /* Enable OK button */
+    XtVaSetValues(pdp->selectPrinter.ok, XtNsensitive, True, NULL);
+}
+
+static void
+printSelectPrinterXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget   pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart    *pdp = &pdw->printdialog;
+
+    Log(("## select printer!\n"));
+
+    if (!pdp->selectPrinter.popup) {
+        if (!buildPrinterSelectionDialog(pdw)) {
+            Log(("printSelectPrinterXtProc: buildPrinterSelectionDialog failure.\n"));
+            return;
+        }
+    }
+
+    center_popup((Widget)pdw, pdp->selectPrinter.popup);
+
+    XtPopup(pdp->selectPrinter.popup, XtGrabExclusive);
+}
+
+static void
+printerSelectionClose(PrintDialogWidget  pdw)
+{ 
+    PrintDialogPart *pdp = &pdw->printdialog;
+
+    if (pdp->selectPrinter.popup) {
+        XtPopdown(pdp->selectPrinter.popup);
+    }
+}
+
+static void
+printerSelectionOKXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget    pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart     *pdp = &pdw->printdialog;
+    XawListReturnStruct *lrs;
+    int                  list_index;
+
+    Log(("## printerSelectionOKXtProc: closing printer selection!\n"));
+
+    /* Copy current selection in printer list widget and open a printer connection */
+    lrs = XawListShowCurrent(pdp->selectPrinter.list);
+    if (!lrs) {
+        Log(("printerSelectionOKXtProc: |lrs|==NULL\n"));
+        return;
+    }
+
+    list_index = lrs->list_index;
+    if (lrs->list_index == XAW_LIST_NONE) {
+        Log(("printerSelectionOKXtProc: rs->list_index == XAW_LIST_NONE\n"));
+        XtFree((char *)lrs);
+        return;
+    }
+
+    /* Set printer name and description in main dialog */
+    XtVaSetValues(pdp->main.name, XtNlabel, NULLSTR(pdp->printerlist[list_index].name), NULL);
+    XtVaSetValues(pdp->main.desc, XtNlabel, NULLSTR(pdp->printerlist[list_index].desc), NULL);
+
+    if (pdp->printer_name)
+        free(pdp->printer_name);
+    pdp->printer_name = strdup(lrs->string);
+
+    /* Close any outstanding printer connection since user has selected
+     * a different printer */
+    closePrinterConnection(pdw, True);
+
+    printerSelectionClose(pdw);
+    
+    XtFree((char *)lrs);
+}
+
+static void
+printerSelectionCancelXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget  pdw = (PrintDialogWidget)client_data;
+    Log(("## printerSelectionCancelXtProc: closing printer selection!\n"));
+
+    printerSelectionClose(pdw);
+}
+
+static
+Bool buildPrinterSelectionDialog(PrintDialogWidget  pdw)
+{
+    PrintDialogPart   *pdp = &pdw->printdialog;
+
+    int  n;
+    Arg  args[20];
+
+    n = 0;
+    XtSetArg(args[n], XtNallowShellResize, True);                    n++;
+    pdp->selectPrinter.popup = XtCreatePopupShell("printerselection", transientShellWidgetClass, (Widget)pdw, args, n);
+
+    n = 0;
+    pdp->selectPrinter.form = XtCreateManagedWidget("form", formWidgetClass, pdp->selectPrinter.popup, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNresizable,        True);                    n++;
+    XtSetArg(args[n], XtNforceColumns,     True);                    n++;
+    XtSetArg(args[n], XtNdefaultColumns,   1);                       n++;
+    XtSetArg(args[n], XtNlist,             pdp->widget_printerlist); n++;
+    XtSetArg(args[n], XtNwidth,            DEFAULT_WIDTH);           n++;
+    pdp->selectPrinter.list = XtCreateManagedWidget("list", listWidgetClass, pdp->selectPrinter.form, args, n);
+    XtAddCallback(pdp->selectPrinter.list, XtNcallback, printerSelectionPrinterSelectedXtProc, pdw);
+
+    n = 0;
+    XtSetArg(args[n], XtNsensitive,        False);                   n++;
+    pdp->selectPrinter.ok = XtCreateManagedWidget("ok", commandWidgetClass, pdp->selectPrinter.form, args, n);
+    XtAddCallback(pdp->selectPrinter.ok, XtNcallback, printerSelectionOKXtProc, pdw);
+
+    n = 0;
+    pdp->selectPrinter.cancel = XtCreateManagedWidget("cancel", commandWidgetClass, pdp->selectPrinter.form, args, n);
+    XtAddCallback(pdp->selectPrinter.cancel, XtNcallback, printerSelectionCancelXtProc, pdw);
+
+    XtRealizeWidget(pdp->selectPrinter.popup);
+
+    return True;
+}
+
+static
+void destroyPrinterSelectionDialog(PrintDialogWidget pdw)
+{
+    PrintDialogPart *pdp = &pdw->printdialog;
+
+    if (pdp->selectPrinter.popup) {
+        XtDestroyWidget(pdp->selectPrinter.popup);
+    }
+
+    /* |XtDestroyWidget(pdp->setup.popup);| above will recursively destroy
+     * all children so we only have to reset the pointers here... */
+    pdp->selectPrinter.popup   = NULL;
+    pdp->selectPrinter.form    = NULL;
+    pdp->selectPrinter.list    = NULL;
+    pdp->selectPrinter.popup   = NULL;
+    pdp->selectPrinter.cancel  = NULL;
+}
+
+/*
+ * Function:
+ *      createprintdialogchildren
+ *
+ * Parameters:
+ *      w - print dialog widget
+ *
+ * Description:
+ *      Creates the print dialog widgets.
+ *
+ * Note
+ *      -
+ */
+static void
+createprintdialogchildren(Widget w)
+{
+    int                n;
+    Arg                args[20];
+    PrintDialogWidget  pdw = (PrintDialogWidget)w;
+    PrintDialogPart   *pdp = &pdw->printdialog;
+    const char        *default_printername = NULL,
+                      *default_printerdesc = NULL;
+    Bool               has_default_printer = False;
+
+    pdp->printerlist = XpuGetPrinterList(NULL, &pdp->num_printers);
+    pdp->widget_printerlist = xpprinterlist_to_widget_printerlist(pdp->printerlist, pdp->num_printers);
+
+    if (pdp->num_printers > 0) {
+        if (pdp->printerlist[0].name && strlen(pdp->printerlist[0].name)) {
+            /* XprintUtils moves the default printer to the top */
+            default_printername = pdp->printerlist[0].name;
+            default_printerdesc = pdp->printerlist[0].desc;
+            pdp->printer_name   = strdup(pdp->printerlist[0].name);
+            has_default_printer = True;
+        }
+    }
+    else
+    {
+      PrintMsg(("No Xprint servers could be found.\n"
+                "Check whether the XPSERVERLIST environment variable contains any valid Xprint server(s).\n"));
+    }
+    
+    n = 0;
+    XtSetArg(args[n], XtNborderWidth,     0);                        n++;
+    pdp->main.form = XtCreateManagedWidget("main", formWidgetClass, (Widget)pdw, args, n);
+
+    n = 0;
+    pdp->main.innerform = XtCreateManagedWidget("innerform", formWidgetClass, pdp->main.form, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNborderWidth,     0);                        n++;
+    XtSetArg(args[n], XtNresizable,       False);                    n++;
+    XtSetArg(args[n], XtNjustify,         XtJustifyRight);           n++;
+    XtSetArg(args[n], XtNwidth,           DEFAULT_WIDTH);            n++;
+    pdp->main.desclabel = XtCreateManagedWidget("desclabel", labelWidgetClass, pdp->main.innerform, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNborderWidth,     0);                        n++;
+    XtSetArg(args[n], XtNresizable,       False);                    n++;
+    XtSetArg(args[n], XtNjustify,         XtJustifyLeft);            n++;
+    XtSetArg(args[n], XtNwidth,           DEFAULT_INFOLABEL_WIDTH);  n++;
+    XtSetArg(args[n], XtNlabel,           default_printerdesc?default_printerdesc:"-"); n++;
+    pdp->main.desc = XtCreateManagedWidget("desc", labelWidgetClass, pdp->main.innerform, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNsensitive,       has_default_printer);      n++;
+    pdp->main.info = XtCreateManagedWidget("info", commandWidgetClass, pdp->main.innerform, args, n);
+  /*
+    XtAddCallback(pdp->main.info, XtNcallback, printerInfoXtProc, pdw);
+  */
+    n = 0;
+    XtSetArg(args[n], XtNborderWidth,     0);                        n++;
+    XtSetArg(args[n], XtNresizable,       False);                    n++;
+    XtSetArg(args[n], XtNjustify,         XtJustifyRight);           n++;
+    XtSetArg(args[n], XtNwidth,           DEFAULT_WIDTH);            n++;
+    pdp->main.namelabel = XtCreateManagedWidget("namelabel", labelWidgetClass, pdp->main.innerform, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNborderWidth,     0);                        n++;
+    XtSetArg(args[n], XtNresizable,       False);                    n++;
+    XtSetArg(args[n], XtNjustify,         XtJustifyLeft);            n++;
+    XtSetArg(args[n], XtNlabel,           default_printername?default_printername:"-"); n++;
+    XtSetArg(args[n], XtNwidth,           DEFAULT_INFOLABEL_WIDTH);  n++;
+    pdp->main.name = XtCreateManagedWidget("name", labelWidgetClass, pdp->main.innerform, args, n);
+
+    n = 0;
+    pdp->main.selectprinter = XtCreateManagedWidget("selectprinter", commandWidgetClass, pdp->main.innerform, args, n);
+    XtAddCallback(pdp->main.selectprinter, XtNcallback, printSelectPrinterXtProc, pdw);
+
+    /* Line: "File selection" */
+
+    n = 0;
+    XtSetArg(args[n], XtNborderWidth,     0);                        n++;
+    XtSetArg(args[n], XtNresizable,       False);                    n++;
+    XtSetArg(args[n], XtNjustify,         XtJustifyRight);           n++;
+    XtSetArg(args[n], XtNwidth,           DEFAULT_WIDTH);            n++;
+    XtSetArg(args[n], XtNsensitive,       False);                    n++;
+    pdp->main.filenamelabel = XtCreateManagedWidget("filenamelabel", labelWidgetClass, pdp->main.innerform, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNborderWidth,     0);                        n++;
+    XtSetArg(args[n], XtNresizable,       False);                    n++;
+    XtSetArg(args[n], XtNjustify,         XtJustifyLeft);            n++;
+    XtSetArg(args[n], XtNlabel,           "-");                      n++;
+    XtSetArg(args[n], XtNwidth,           DEFAULT_INFOLABEL_WIDTH);  n++;
+    XtSetArg(args[n], XtNsensitive,       False);                    n++;
+    pdp->main.filename = XtCreateManagedWidget("filename", labelWidgetClass, pdp->main.innerform, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNsensitive,       False);                    n++;
+    pdp->main.selectfile = XtCreateManagedWidget("selectfile", commandWidgetClass, pdp->main.innerform, args, n);
+    XtAddCallback(pdp->main.selectfile, XtNcallback, printSelectFileXtProc, pdw);
+
+    /* Line: Misc (Print destination toggles, copy-count etc.)*/
+    n = 0;
+    XtSetArg(args[n], XtNstate,           True);                     n++;
+    pdp->main.printtoprinter = XtCreateManagedWidget("printtoprinter", toggleWidgetClass, pdp->main.innerform, args, n);
+    XtAddCallback(pdp->main.printtoprinter, XtNcallback, printDialogDestXtProc, pdw);
+
+    n = 0;
+    XtSetArg(args[n], XtNstate,           False);                    n++;
+    pdp->main.printtofile = XtCreateManagedWidget("printtofile", toggleWidgetClass, pdp->main.innerform, args, n);
+    XtAddCallback(pdp->main.printtofile, XtNcallback, printDialogDestXtProc, pdw);
+
+    /* End-of-Inner-Form-Content */
+
+    n = 0;
+    XtSetArg(args[n], XtNsensitive,       has_default_printer);       n++;
+    pdp->main.ok = XtCreateManagedWidget("ok", commandWidgetClass, pdp->main.form, args, n);
+    XtAddCallback(pdp->main.ok, XtNcallback, printOKXtProc, pdw);
+
+    n = 0;
+    XtSetArg(args[n], XtNsensitive,       has_default_printer);       n++;
+    pdp->main.setup = XtCreateManagedWidget("setup", commandWidgetClass, pdp->main.form, args, n);
+    XtAddCallback(pdp->main.setup, XtNcallback, printSetupXtProc, pdw);
+
+    n = 0;
+    pdp->main.cancel = XtCreateManagedWidget("cancel", commandWidgetClass, pdp->main.form, args, n);
+    XtAddCallback(pdp->main.cancel, XtNcallback, printCancelXtProc, pdw);
+}
+
+/*
+ * Class Methods
+ */
+static void    XawPrintDialogConstraintInitialize(Widget, Widget, ArgList, Cardinal *);
+static void    XawPrintDialogGetValuesHook(Widget, ArgList, Cardinal*);
+static void    XawPrintDialogInitialize(Widget, Widget, ArgList, Cardinal*);
+static void    XawPrintDialogDestroy(Widget);
+static Boolean XawPrintDialogSetValues(Widget, Widget, Widget, ArgList, Cardinal *);
+
+/*
+ * Initialization
+ */
+static XtResource resources[] = {
+  {
+    XtNicon,
+    XtCIcon,
+    XtRBitmap,
+    sizeof(Pixmap),
+    XtOffsetOf(PrintDialogRec, printdialog.icon),
+    XtRImmediate,
+    0
+  },
+  {
+    XawNOkCallback, XtCCallback, XtRCallback,
+    sizeof(XtCallbackList), XtOffsetOf(PrintDialogRec, printdialog.ok_callback),
+    XtRImmediate, (XtPointer)NULL
+  },
+  {
+    XawNCancelCallback, XtCCallback, XtRCallback,
+    sizeof(XtCallbackList), XtOffsetOf(PrintDialogRec, printdialog.cancel_callback),
+    XtRImmediate, (XtPointer)NULL
+  },
+};
+
+PrintDialogClassRec printdialogClassRec = {
+  /* core */
+  {
+    (WidgetClass)&formClassRec,         /* superclass */
+    "PrintDialog",                      /* class_name */
+    sizeof(PrintDialogRec),             /* widget_size */
+    XawInitializeWidgetSet,             /* class_initialize */
+    NULL,                               /* class_part init */
+    False,                              /* class_inited */
+    XawPrintDialogInitialize,           /* initialize */
+    NULL,                               /* initialize_hook */
+    XtInheritRealize,                   /* realize */
+    NULL,                               /* actions */
+    0,                                  /* num_actions */
+    resources,                          /* resources */
+    XtNumber(resources),                /* num_resources */
+    NULLQUARK,                          /* xrm_class */
+    True,                               /* compress_motion */
+    True,                               /* compress_exposure */
+    True,                               /* compress_enterleave */
+    False,                              /* visible_interest */
+    XawPrintDialogDestroy,              /* destroy */
+    XtInheritResize,                    /* resize */
+    XtInheritExpose,                    /* expose */
+    XawPrintDialogSetValues,            /* set_values */
+    NULL,                               /* set_values_hook */
+    XtInheritSetValuesAlmost,           /* set_values_almost */
+    XawPrintDialogGetValuesHook,        /* get_values_hook */
+    NULL,                               /* accept_focus */
+    XtVersion,                          /* version */
+    NULL,                               /* callback_private */
+    NULL,                               /* tm_table */
+    XtInheritQueryGeometry,             /* query_geometry */
+    XtInheritDisplayAccelerator,        /* display_accelerator */
+    NULL,                               /* extension */
+  },
+  /* composite */
+  {
+    XtInheritGeometryManager,           /* geometry_manager */
+    XtInheritChangeManaged,             /* change_managed */
+    XtInheritInsertChild,               /* insert_child */
+    XtInheritDeleteChild,               /* delete_child */
+    NULL,                               /* extension */
+  },
+  /* constraint */
+  {
+    NULL,                               /* subresourses */
+    0,                                  /* subresource_count */
+    sizeof(PrintDialogConstraintsRec),  /* constraint_size */
+    XawPrintDialogConstraintInitialize, /* initialize */
+    NULL,                               /* destroy */
+    NULL,                               /* set_values */
+    NULL,                               /* extension */
+  },
+  /* form */
+  {
+    XtInheritLayout,                    /* layout */
+  },
+  /* printdialog */
+  {
+    NULL,                               /* extension */
+  }
+};
+
+WidgetClass printDialogWidgetClass = (WidgetClass)&printdialogClassRec;
+
+/*
+ * Implementation
+ */
+/*ARGSUSED*/
+static void
+XawPrintDialogInitialize(Widget request, Widget cnew, ArgList args, Cardinal *num_args)
+{
+    PrintDialogWidget dw = (PrintDialogWidget)cnew;
+    Arg               arglist[9];
+    Cardinal          arg_cnt = 0;
+
+    XtSetArg(arglist[arg_cnt], XtNborderWidth, 0);     arg_cnt++;
+    XtSetArg(arglist[arg_cnt], XtNleft, XtChainLeft);  arg_cnt++;
+
+    if (dw->printdialog.icon != (Pixmap)0) {
+        XtSetArg(arglist[arg_cnt], XtNbitmap, dw->printdialog.icon);     arg_cnt++;
+        XtSetArg(arglist[arg_cnt], XtNright, XtChainLeft);               arg_cnt++;
+        dw->printdialog.iconW = XtCreateManagedWidget("icon", labelWidgetClass,
+                                                      cnew, arglist, arg_cnt);
+        arg_cnt = 2;
+        XtSetArg(arglist[arg_cnt], XtNfromHoriz, dw->printdialog.iconW); arg_cnt++;
+    }
+    else {
+        dw->printdialog.iconW = NULL;
+    }
+    
+    createprintdialogchildren((Widget)dw);
+}
+
+/*ARGSUSED*/
+static void
+XawPrintDialogConstraintInitialize(Widget request, Widget cnew,
+                                   ArgList args, Cardinal *num_args)
+{
+    PrintDialogWidget dw = (PrintDialogWidget)cnew->core.parent;
+    PrintDialogConstraints constraint = (PrintDialogConstraints)cnew->core.constraints;
+
+    if (!XtIsSubclass(cnew, commandWidgetClass)) /* if not a button */
+        return;                                  /* then just use defaults */
+
+    constraint->form.left = constraint->form.right = XtChainLeft;
+    constraint->form.vert_base = dw->printdialog.main.form;
+
+    if (dw->composite.num_children > 1) {
+        WidgetList  children = dw->composite.children;
+        Widget     *childP;
+
+        for (childP = children + dw->composite.num_children - 1;
+           childP >= children; childP-- ) {
+            if (*childP == dw->printdialog.main.form)
+                break;
+            if (XtIsManaged(*childP) &&
+                XtIsSubclass(*childP, commandWidgetClass)) {
+                constraint->form.horiz_base = *childP;
+                break;
+            }
+        }
+    }
+}
+
+#define ICON       0
+#define NUM_CHECKS 1
+/*ARGSUSED*/
+static Boolean
+XawPrintDialogSetValues(Widget current, Widget request, Widget cnew,
+                        ArgList in_args, Cardinal *in_num_args)
+{
+    PrintDialogWidget w   = (PrintDialogWidget)cnew;
+    PrintDialogWidget old = (PrintDialogWidget)current;
+    Arg               args[5];
+    unsigned int      i;
+    Bool              checks[NUM_CHECKS];
+
+    for (i = 0; i < NUM_CHECKS; i++)
+        checks[i] = False;
+
+    for (i = 0; i < *in_num_args; i++) {
+        if (!strcmp(XtNicon, in_args[i].name))
+            checks[ICON]  = True;
+    }
+
+    if (checks[ICON]) {
+        if (w->printdialog.icon != 0) {
+            XtSetArg(args[0], XtNbitmap, w->printdialog.icon);
+            if (old->printdialog.iconW != NULL) {
+                XtSetValues(old->printdialog.iconW, args, 1);
+            }
+            else {
+                XtSetArg(args[1], XtNborderWidth, 0);
+                XtSetArg(args[2], XtNleft,        XtChainLeft);
+                XtSetArg(args[3], XtNright,       XtChainLeft);
+                w->printdialog.iconW = XtCreateWidget("icon", labelWidgetClass,
+                                                      cnew, args, 4);
+                XtManageChild(w->printdialog.iconW);
+            }
+        }
+        else if (old->printdialog.icon != 0) {
+            XtDestroyWidget(old->printdialog.iconW);
+            w->printdialog.iconW = NULL;
+        }
+    }
+
+    return True;
+}
+
+/*
+ * Function:
+ *      XawPrintDialogGetValuesHook
+ *
+ * Parameters:
+ *      w        - Print Dialog Widget
+ *      args     - argument list
+ *      num_args - number of args
+ *
+ * Description:
+ *      This is a get values hook routine that gets the values in the dialog.
+ */
+static void
+XawPrintDialogGetValuesHook(Widget w, ArgList args, Cardinal *num_args)
+{
+    /* NO-OP for now */
+}
+
+static void 
+XawPrintDialogDestroy(Widget w)
+{
+    PrintDialogWidget pdw = (PrintDialogWidget)w;
+    Log(("# XawPrintDialogDestroy: start.\n"));
+
+    destroyPrintSetupDialog(pdw);
+    destroyPrinterSelectionDialog(pdw);
+    closePrinterConnection(pdw, True);
+    
+    Log(("# XawPrintDialogDestroy: done.\n"));
+}
+
+/*
+ * Function:
+ *      XawPrintDialogClosePrinterConnection
+ *
+ * Parameters:
+ *      w            - Print Dialog Widget
+ *      closeDisplay - Boolean which decides whether |Display *|
+ *                     and |XPContext| should be disposed, too.
+ *
+ * Description:
+ *      The print display connection is owned by the print dialog
+ *      by default.
+ *      If the application wishes to close the display connection
+ *      to the print server, either to close it itself or force
+ *      a disconnection for other reasons this function can be used.
+ *
+ * Notes
+ *      1. PUBLIC API
+ *      2. After this function returns all resources returned by the
+ *         print dialog which are related to the status of the printer
+ *         connection are stale.
+ */
+void
+XawPrintDialogClosePrinterConnection(Widget w, Bool closeDisplay)
+{
+    closePrinterConnection((PrintDialogWidget)w, closeDisplay);
+}
+
diff --git a/xedit/printdialog.h b/xedit/printdialog.h
new file mode 100644 (file)
index 0000000..f166a27
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * $Xorg: printdialog.h,v 1.1 2004/04/30 02:05:54 gisburn Exp $
+ *
+Copyright 2004 Roland Mainz <roland.mainz@nrubsig.org>
+
+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.
+ *
+ */
+
+#ifndef XMORE_PRINTDIALOG_H
+#define XMORE_PRINTDIALOG_H 1
+
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Shell.h>
+#include <X11/Xaw/Print.h>
+#include <X11/Xaw/Cardinals.h>
+#include <X11/Xaw/Form.h>
+#include <X11/XprintUtil/xprintutil.h>
+
+/* Resources:
+   NOT WRITTEN YET
+*/
+
+#define XtCIcon "Icon"
+#define XtNicon "icon"
+
+#define XawNOkCallback             "okCallback"
+#define XawNCancelCallback         "cancelCallback"
+
+typedef struct
+{
+    Display            *pdpy;
+    XPContext           pcontext;
+    const char         *printToFileName;
+    Boolean             printToFile;
+    XpuColorspaceRec   *colorspace;
+} XawPrintDialogCallbackStruct;
+
+typedef struct _PrintDialogClassRec *PrintDialogWidgetClass;
+typedef struct _PrintDialogRec      *PrintDialogWidget;
+
+extern WidgetClass printDialogWidgetClass;
+
+_XFUNCPROTOBEGIN
+
+/* Prototypes */
+void XawPrintDialogClosePrinterConnection(Widget w, Bool closeDisplay);
+
+_XFUNCPROTOEND
+
+#endif /* !XMORE_PRINTDIALOG_H */
diff --git a/xedit/printdialogprivates.h b/xedit/printdialogprivates.h
new file mode 100644 (file)
index 0000000..1e66eb8
--- /dev/null
@@ -0,0 +1,182 @@
+/*
+ * $Xorg: printdialogprivates.h,v 1.1 2004/05/12 02:05:54 gisburn Exp $
+ *
+Copyright 2004 Roland Mainz <roland.mainz@nrubsig.org>
+
+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.
+ *
+ */
+
+#ifndef _XawPrintDialogP_h
+#define _XawPrintDialogP_h 1
+
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <X11/Xos.h>
+#include <X11/Xmu/Misc.h>
+#include <X11/CoreP.h>
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Cardinals.h>
+#include <X11/Xaw/Command.h>    
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/DialogP.h>
+#include <X11/Xaw/XawInit.h>
+#include <X11/Xaw/Dialog.h>
+#include <X11/Xaw/FormP.h>
+
+/* From Xaw/Privates.h */
+#ifndef XtWidth
+#define XtWidth(w)        (((RectObj)w)->rectangle.width)
+#endif
+#ifndef XtHeight
+#define XtHeight(w)       (((RectObj)w)->rectangle.height)
+#endif
+
+
+typedef struct {
+    XtPointer extension;
+} PrintDialogClassPart;
+
+typedef struct _PrintDialogClassRec {
+    CoreClassPart         core_class;
+    CompositeClassPart    composite_class;
+    ConstraintClassPart   constraint_class;
+    FormClassPart         form_class;
+    PrintDialogClassPart  print_dialog_class;
+} PrintDialogClassRec;
+
+extern PrintDialogClassRec printDialogClassRec;
+
+typedef struct _PrintDialogPart {
+    /* resources */
+    String        label;               /* description of the dialog     */
+    String        value;               /* for the user response         */
+    Pixmap        icon;                /* icon bitmap                   */
+    XtCallbackList ok_callback,
+                   cancel_callback;
+        
+    /* private */
+    Widget     iconW;          /* widget to display the icon    */
+    
+    struct
+    {
+        Widget form,
+               innerform,
+               desclabel,
+               desc,
+               info,
+               namelabel,
+               name,
+               selectprinter,
+               filenamelabel,
+               filename,
+               selectfile,
+               printtoprinter,
+               printtofile,
+               ok,
+               setup,
+               cancel;
+    } main;
+
+    Bool   printToFile;
+    char  *filename;
+    Bool   canPrint,       /* can we print ? */
+           canReallyPrint; /* is it really save to print ? */
+    XpuColorspaceRec *selected_colorspace;
+
+    struct
+    {
+        Widget popup,
+               form,
+               list,
+               ok,
+               cancel;
+    } selectPrinter;
+
+    struct
+    {
+      Widget popup,
+             form,
+             paperlist,
+             resolutionlist,
+             orientationlist,
+             plexlist,
+             colorspacelist,
+             jobcopieslabel,
+             jobcopies,
+             ok,
+             cancel;
+    } setup;
+
+    struct
+    {
+        Widget dialog,
+               shell;
+    } selectFile;
+
+    XPPrinterList  printerlist;
+    int            num_printers;
+    String        *widget_printerlist;
+
+    String     printer_name;
+    Display   *pdpy;
+    XPContext  pcontext;
+
+    XpuMediumSourceSizeList  paperlist;
+    int                      num_papers;
+    String                  *widget_paperlist;
+    
+    XpuResolutionList        resolutionlist;
+    int                      num_resolutions;
+    String                  *widget_resolutionlist;
+
+    XpuOrientationList       orientationlist;
+    int                      num_orientations;
+    String                  *widget_orientationlist;
+
+    XpuPlexList              plexlist;
+    int                      num_plex;
+    String                  *widget_plexlist;
+
+    XpuColorspaceList        colorspacelist;
+    int                      num_colorspaces;
+    String                  *widget_colorspacelist;
+} PrintDialogPart;
+
+typedef struct _PrintDialogRec {
+    CorePart            core;
+    CompositePart       composite;
+    ConstraintPart      constraint;
+    FormPart            form;
+    PrintDialogPart     printdialog;
+} PrintDialogRec;
+
+typedef struct {
+    XtPointer extension;
+} PrintDialogConstraintsPart;
+
+typedef struct _PrintDialogConstraintsRec {
+    FormConstraintsPart        form;
+    PrintDialogConstraintsPart printdialog;
+} PrintDialogConstraintsRec, *PrintDialogConstraints;
+
+#endif /* !_XawPrintDialogP_h */
+
diff --git a/xedit/realpath.c b/xedit/realpath.c
new file mode 100644 (file)
index 0000000..4d58b75
--- /dev/null
@@ -0,0 +1,208 @@
+/*
+ * Copyright (c) 1994
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Jan-Simon Pendry.
+ *
+ * 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/realpath.c,v 1.4 2000/02/12 20:45:45 dawes Exp $ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)realpath.c 8.1 (Berkeley) 2/16/94";
+#endif /* LIBC_SCCS and not lint */
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#ifndef LISP
+#include "xedit.h"
+#endif
+
+#if defined(__Lynx__)
+#define NO_FCHDIR
+#endif
+
+#if defined(ISC)
+#ifndef MAXPATHLEN
+#define MAXPATHLEN     1024
+#endif
+#endif
+#ifndef MAXSYMLINKS
+#define MAXSYMLINKS    256
+#endif
+
+/*
+ * char *realpath(const char *path, char resolved_path[MAXPATHLEN]);
+ *
+ * Find the real name of path, by removing all ".", ".." and symlink
+ * components.  Returns (resolved) on success, or (NULL) on failure,
+ * in which case the path which caused trouble is left in (resolved).
+ */
+char *
+realpath(path, resolved)
+       const char *path;
+       char *resolved;
+{
+       struct stat sb;
+#ifdef NO_FCHDIR
+       char start[MAXPATHLEN];
+#else
+       int fd;
+#endif
+       int n, rootd, serrno;
+       char *p, *q, wbuf[MAXPATHLEN];
+       int symlinks = 0;
+
+       /* Save the starting point. */
+#ifdef NO_FCHDIR
+       if (getcwd(start, MAXPATHLEN) == NULL) {
+               (void)strcpy(resolved, ".");
+               return (NULL);
+       }
+#else
+       if ((fd = open(".", O_RDONLY)) < 0) {
+               (void)strcpy(resolved, ".");
+               return (NULL);
+       }
+#endif
+
+       /*
+        * Find the dirname and basename from the path to be resolved.
+        * Change directory to the dirname component.
+        * lstat the basename part.
+        *     if it is a symlink, read in the value and loop.
+        *     if it is a directory, then change to that directory.
+        * get the current directory name and append the basename.
+        */
+       (void)strncpy(resolved, path, MAXPATHLEN - 1);
+       resolved[MAXPATHLEN - 1] = '\0';
+loop:
+       q = strrchr(resolved, '/');
+       if (q != NULL) {
+               p = q + 1;
+               if (q == resolved)
+                       q = "/";
+               else {
+                       do {
+                               --q;
+                       } while (q > resolved && *q == '/');
+                       q[1] = '\0';
+                       q = resolved;
+               }
+               if (chdir(q) < 0)
+                       goto err1;
+       } else
+               p = resolved;
+
+       /* Deal with the last component. */
+       if (*p != '\0' && lstat(p, &sb) == 0) {
+               if (S_ISLNK(sb.st_mode)) {
+                      if (++symlinks > MAXSYMLINKS) {
+                              errno = ELOOP;
+                              goto err1;
+                      }
+                       n = readlink(p, resolved, MAXPATHLEN);
+                       if (n < 0)
+                               goto err1;
+                       resolved[n] = '\0';
+                       goto loop;
+               }
+               if (S_ISDIR(sb.st_mode)) {
+                       if (chdir(p) < 0)
+                               goto err1;
+                       p = "";
+               }
+       }
+
+       /*
+        * Save the last component name and get the full pathname of
+        * the current directory.
+        */
+       (void)strcpy(wbuf, p);
+       if (getcwd(resolved, MAXPATHLEN) == 0)
+               goto err1;
+
+       /*
+        * Join the two strings together, ensuring that the right thing
+        * happens if the last component is empty, or the dirname is root.
+        */
+       if (resolved[0] == '/' && resolved[1] == '\0')
+               rootd = 1;
+       else
+               rootd = 0;
+
+       if (*wbuf) {
+               if (strlen(resolved) + strlen(wbuf) + rootd + 1 > MAXPATHLEN) {
+                       errno = ENAMETOOLONG;
+                       goto err1;
+               }
+               if (rootd == 0)
+                       (void)strcat(resolved, "/");
+               (void)strcat(resolved, wbuf);
+       }
+
+       /* Go back to where we came from. */
+#ifdef NO_FCHDIR
+       if (chdir(start) < 0)
+#else
+       if (fchdir(fd) < 0)
+#endif
+       {
+               serrno = errno;
+               goto err2;
+       }
+
+       /* It's okay if the close fails, what's an fd more or less? */
+#ifndef NO_FCHDIR
+       (void)close(fd);
+#endif
+       return (resolved);
+
+err1:  serrno = errno;
+#ifdef NO_FCHDIR
+       (void)chdir(start);
+#else
+       (void)fchdir(fd);
+#endif
+err2:
+#ifndef NO_FCHDIR
+       (void)close(fd);
+#endif
+       errno = serrno;
+       return (NULL);
+}
diff --git a/xedit/strcasecmp.c b/xedit/strcasecmp.c
new file mode 100644 (file)
index 0000000..77ff4c3
--- /dev/null
@@ -0,0 +1,40 @@
+/* $XFree86: xc/programs/xedit/strcasecmp.c,v 1.1 1999/06/14 02:38:07 dawes Exp $ */
+
+#include <ctype.h>
+#include <sys/types.h>
+
+#ifndef LISP
+#include "xedit.h"
+#endif
+
+/* Just like the BSD version.  It assumes that tolower() is ANSI-compliant */
+
+int
+strcasecmp(const char *s1, const char *s2)
+{
+       const unsigned char *us1 = (const unsigned char *)s1;
+       const unsigned char *us2 = (const unsigned char *)s2;
+
+       while (tolower(*us1) == tolower(*us2++))
+               if (*us1++ == '\0')
+                       return 0;
+       return tolower(*us1) - tolower(*--us2);
+}
+
+int
+strncasecmp(const char *s1, const char *s2, size_t n)
+{
+       if (n != 0) {
+               const unsigned char *us1 = (const unsigned char *)s1;
+               const unsigned char *us2 = (const unsigned char *)s2;
+
+               do {
+                       if (tolower(*us1) != tolower(*us2++))
+                               return tolower(*us1) - tolower(*--us2);
+                       if (*us1++ == '\0')
+                               break;
+               } while (--n != 0);
+       }
+       return 0;
+}
+
diff --git a/xedit/tags.c b/xedit/tags.c
new file mode 100644 (file)
index 0000000..b8f3970
--- /dev/null
@@ -0,0 +1,635 @@
+/*
+ * Copyright © 2007 Paulo César Pereira de Andrade
+ *
+ * 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 (including the next
+ * paragraph) 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.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+/*
+ *   Certain tag files may require quite some time and memory to load.
+ * Linux kernel 2.6x is an example, the tags file itself is almost 80Mb
+ * and xedit will use over 100Mb to store the data, and take quite some
+ * time to load it (and can grow drastically with every loaded files
+ * due to the memory used by the file contents and internal structures,
+ * like the syntax highlight ones).
+ *   Possible workarounds could be to load the tags file in a separate
+ * process or thread. The memory problem would be hard to circunvent,
+ * as the tags file metadata would need to be stored in some very fast
+ * database, or at least some special format that would not require
+ * a linear search in a huge tags file.
+ */
+
+#include "xedit.h"
+#include "util.h"
+#include "re.h"
+#include <unistd.h>
+
+/*
+ * Types
+ */
+typedef struct _TagsEntry      TagsEntry;
+typedef struct _RegexEntry     RegexEntry;
+
+struct _TagsEntry {
+    hash_key   *symbol;
+    TagsEntry  *next;
+
+    int                nentries;
+    hash_entry **filenames;
+    char       **patterns;
+};
+
+struct _RegexEntry {
+    hash_key   *pattern;
+    RegexEntry *next;
+
+    re_cod     regex;
+};
+
+struct _XeditTagsInfo {
+    hash_key           *pathname;
+    XeditTagsInfo      *next;
+
+    hash_table         *entries;
+    hash_table         *filenames;
+    hash_table         *patterns;
+
+    /* Used when searching for alternate tags and failing descending to
+     * root directory */
+    Boolean            visited;
+
+    /* Flag to know if tags file is in xedit cwd and allow using relative
+     * pathnames when loading a file with some tag definition, so that
+     * other code will not fail to write file (or even worse, write to
+     * wrong file) if file is edited and tags is not in the current dir */
+    Boolean            incwd;
+
+    /* Cache information for circulating over multiple definitions */
+    XeditTagsInfo      *tags;          /* If trying another TagsInfo */
+    TagsEntry          *entry;         /* Entry in tags->tags */
+    int                        offset;
+    Widget             textwindow;
+    XawTextPosition    position;
+};
+
+/*
+ * Prototypes
+ */
+static XeditTagsInfo *LoadTagsFile(char *tagsfile);
+static XeditTagsInfo *DoLoadTagsFile(char *tagsfile, int length);
+static void FindTagFirst(XeditTagsInfo *tags, char *symbol, int length);
+static void FindTagNext(XeditTagsInfo *tags,
+                       Widget window, XawTextPosition position);
+static void FindTag(XeditTagsInfo *tags);
+
+/*
+ * Initialization
+ */
+extern Widget texts[3];
+static hash_table *ht_tags;
+
+/*
+ * Implementation
+ */
+void
+TagsAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    xedit_flist_item   *item;
+    char               buffer[1024];
+    XawTextPosition    position, left, right;
+    XawTextBlock       block;
+    int                        length;
+    Widget             source;
+
+    source = XawTextGetSource(w);
+    item = FindTextSource(source, NULL);
+    if (item->tags == NULL)
+       SearchTagsFile(item);
+
+    if (item->tags) {
+       position = XawTextGetInsertionPoint(w);
+       XawTextGetSelectionPos(w, &left, &right);
+       if (right > left) {
+           XawTextSourceRead(source, left, &block, right - left);
+           length = block.length + 1;
+           if (length >= sizeof(buffer))
+               length = sizeof(buffer);
+           XmuSnprintf(buffer, length, "%s", block.ptr);
+           item->tags->textwindow = w;
+           item->tags->position = position;
+           FindTagFirst(item->tags, buffer, length - 1);
+       }
+       else
+           FindTagNext(item->tags, w, position);
+    }
+    else
+       Feep();
+}
+
+void
+SearchTagsFile(xedit_flist_item *item)
+{
+    if (app_resources.loadTags) {
+       char            buffer[BUFSIZ];
+       char            *ptr, *tagsfile;
+       int             length;
+       Boolean         exists;
+       FileAccess      file_access;
+
+       tagsfile = NULL;
+
+       /* If path fully specified in resource */
+       if (app_resources.tagsName[0] == '/')
+           tagsfile = ResolveName(app_resources.tagsName);
+       /* Descend up to root directory searching for a tags file */
+       else {
+           /* *scratch* buffer */
+           if (item->filename[0] != '/') {
+               ptr = ResolveName(app_resources.tagsName);
+               strncpy(buffer, ptr ? ptr : "", sizeof(buffer));
+           }
+           else
+               strncpy(buffer, item->filename, sizeof(buffer));
+
+           /* Make sure buffer is nul terminated */
+           buffer[sizeof(buffer) - 1] = '\0';
+           ptr = buffer + strlen(buffer);
+
+           for (;;) {
+               while (ptr > buffer && ptr[-1] != '/')
+                   --ptr;
+               if (ptr <= buffer)
+                   break;
+               length = ptr - buffer;
+               if (length >= sizeof(buffer))
+                   length = sizeof(buffer);
+               strncpy(ptr, app_resources.tagsName,
+                       sizeof(buffer) - length);
+               buffer[sizeof(buffer) - 1] = '\0';
+
+               /* Check if tags filename exists */
+               tagsfile = ResolveName(buffer);
+               if (tagsfile != NULL) {
+                   file_access = CheckFilePermissions(tagsfile, &exists);
+                   /* Check if can read tagsfile */
+                   if (exists &&
+                       (file_access == READ_OK || file_access == WRITE_OK))
+                       break;
+                   else
+                       tagsfile = NULL;
+               }
+               *--ptr = '\0';
+           }
+       }
+
+       if (tagsfile)
+           item->tags = LoadTagsFile(tagsfile);
+       else {
+           XeditPrintf("No tags file found."
+                       " Run \"ctags -R\" to build a tags file.\n");
+           item->tags = NULL;
+       }
+    }
+}
+
+static void
+FindTagFirst(XeditTagsInfo *tags, char *symbol, int length)
+{
+    char       *ptr;
+    TagsEntry  *entry;
+    char       buffer[BUFSIZ];
+
+    /* Check for malformed parameters */
+    ptr = symbol;
+    while (*ptr) {
+       if (*ptr == ' ' || *ptr == '\t' || *ptr == '\n' || *ptr == '\r' ||
+           *ptr == '(' || *ptr == ')') {
+           Feep();
+           return;
+       }
+       ptr++;
+    }
+
+    /* First try in buffer tags */
+    tags->tags = tags;
+    entry = (TagsEntry *)hash_check(tags->entries, symbol, length);
+    if (entry == NULL) {
+       /* Try to find in alternate tags */
+       strncpy(buffer, tags->pathname->value, tags->pathname->length);
+       buffer[tags->pathname->length] = '\0';
+       ptr = buffer + tags->pathname->length - 1;
+
+       for (tags->tags = (XeditTagsInfo *)hash_iter_first(ht_tags);
+            tags->tags;
+            tags->tags = (XeditTagsInfo *)hash_iter_next(ht_tags))
+           tags->tags->visited = False;
+
+       tags->visited = True;
+
+       while (ptr > buffer && entry == NULL) {
+           --ptr;
+           while (ptr > buffer && ptr[-1] != '/')
+               --ptr;
+           if (ptr <= buffer)
+               break;
+           *ptr = '\0';
+
+           /* Try an upper directory tags */
+           tags->tags = (XeditTagsInfo *)
+               hash_check(ht_tags, buffer, ptr - buffer);
+           if (tags->tags) {
+               tags->tags->visited = True;
+               entry = (TagsEntry *)
+                   hash_check(tags->tags->entries, symbol, length);
+           }
+       }
+
+       /* If still failed, check other available tags
+        * for possible different projects */
+       if (entry == NULL) {
+           for (tags->tags = (XeditTagsInfo *)hash_iter_first(ht_tags);
+                tags->tags;
+                tags->tags = (XeditTagsInfo *)hash_iter_next(ht_tags)) {
+               if (tags->tags->visited == False) {
+                   entry = (TagsEntry *)
+                       hash_check(tags->tags->entries, symbol, length);
+                   /* Stop on first match */
+                   if (entry != NULL)
+                       break;
+               }
+           }
+       }
+
+       if (entry == NULL) {
+           XeditPrintf("Symbol %s not in tags\n", symbol);
+           Feep();
+           return;
+       }
+    }
+
+    tags->entry = entry;
+    tags->offset = 0;
+
+    FindTag(tags);
+}
+
+static void
+FindTagNext(XeditTagsInfo *tags, Widget window, XawTextPosition position)
+{
+    if (window != tags->textwindow || position != tags->position)
+       Feep();
+    else {
+       if (tags->entry->nentries > 1) {
+           if (++tags->offset >= tags->entry->nentries)
+               tags->offset = 0;
+           FindTag(tags);
+       }
+       else
+           Feep();
+    }
+}
+
+static XeditTagsInfo *
+LoadTagsFile(char *tagsfile)
+{
+    XeditTagsInfo      *tags;
+    int                        length;
+
+    if (ht_tags == NULL)
+       ht_tags = hash_new(11, NULL);
+
+    /* tags key is only the directory name with ending '/' */
+    length = strlen(tagsfile) - strlen(app_resources.tagsName);
+    tags = (XeditTagsInfo *)hash_check(ht_tags, tagsfile, length);
+
+    return (tags ? tags : DoLoadTagsFile(tagsfile, length));
+}
+
+static XeditTagsInfo *
+DoLoadTagsFile(char *tagsfile, int length)
+{
+    char               *ptr;
+    FILE               *file;
+    XeditTagsInfo      *tags;
+    TagsEntry          *entry;
+    hash_entry         *file_entry;
+    char               buffer[BUFSIZ];
+    char               *symbol, *filename, *pattern;
+
+    file = fopen(tagsfile, "r");
+    if (file) {
+       char *cwd;
+
+       tags = XtNew(XeditTagsInfo);
+
+       cwd = getcwd(buffer, sizeof(buffer));
+       tags->incwd = cwd &&
+           (strlen(cwd) == length - 1 &&
+            memcmp(cwd, tagsfile, length - 1) == 0);
+
+       /* Build pathname as a nul terminated directory specification string */
+       tags->pathname = XtNew(hash_key);
+       tags->pathname->value = XtMalloc(length + 1);
+       tags->pathname->length = length;
+       memcpy(tags->pathname->value, tagsfile, length);
+       tags->pathname->value[length] = '\0';
+       tags->next = NULL;
+
+       tags->entries = hash_new(809, NULL);
+       tags->filenames = hash_new(31, NULL);
+       tags->patterns = hash_new(47, NULL);
+
+       /* Cache information */
+       tags->tags = tags;      /* :-) */
+       tags->entry = NULL;
+       tags->offset = 0;
+       tags->textwindow = NULL;
+       tags->position = 0;
+
+       while (fgets(buffer, sizeof(buffer) - 1, file)) {
+           /* XXX Ignore malformed lines and tags file format information */
+           if (isspace(buffer[0]) || buffer[0] == '!')
+               continue;
+
+           /* Symbol name */
+           symbol = ptr = buffer;
+           while (*ptr && !isspace(*ptr))
+               ptr++;
+           *ptr++ = '\0';
+           while (isspace(*ptr))
+               ptr++;
+
+           /* Filename with basename of tagsfile for symbol definition */
+           filename = ptr;
+           while (*ptr && !isspace(*ptr))
+               ptr++;
+           *ptr++ = '\0';
+           while (isspace(*ptr))
+               ptr++;
+
+           pattern = ptr;
+           /* Check for regex */
+           if (*pattern == '/' || *pattern == '?') {
+               ptr++;
+               while (*ptr && *ptr != *pattern) {
+                   if (*ptr == '\\') {
+                       if (ptr[1] == *pattern || ptr[1] == '\\') {
+                           /* XXX tags will escape pattern end, and backslash
+                            * not sure about other special characters */
+                           memmove(ptr, ptr + 1, strlen(ptr));
+                       }
+                       else {
+                           ++ptr;
+                           if (!*ptr)
+                               break;
+                       }
+                   }
+                   ptr++;
+               }
+
+               if (*ptr != *pattern)
+                   continue;
+               ++pattern;
+               /*   Will do a RE_NOSPEC search, that means ^ and $
+                 * would be literally search (do this to avoid escaping
+                * other regex characters and building a fast/simple literal
+                * string search pattern.
+                *   Expect patterns to be full line */
+               if (*pattern == '^' && ptr[-1] == '$') {
+                   ++pattern;
+                   --ptr;
+               }
+           }
+           /* Check for line number */
+           else if (isdigit(*ptr)) {
+               while (isdigit(*ptr))
+                   ptr++;
+           }
+           /* Format not understood */
+           else
+               continue;
+
+           *ptr = '\0';
+
+           length = strlen(symbol);
+           entry = (TagsEntry *)hash_check(tags->entries,
+                                           symbol, length);
+           if (entry == NULL) {
+               entry = XtNew(TagsEntry);
+               entry->symbol = XtNew(hash_key);
+               entry->symbol->value = XtNewString(symbol);
+               entry->symbol->length = length;
+               entry->next = NULL;
+               entry->nentries = 0;
+               entry->filenames = NULL;
+               entry->patterns = NULL;
+               hash_put(tags->entries, (hash_entry *)entry);
+           }
+
+           length = strlen(filename);
+           file_entry = hash_check(tags->filenames, filename, length);
+           if (file_entry == NULL) {
+               file_entry = XtNew(hash_entry);
+               file_entry->key = XtNew(hash_key);
+               file_entry->key->value = XtNewString(filename);
+               file_entry->key->length = length;
+               file_entry->next = NULL;
+               hash_put(tags->filenames, file_entry);
+           }
+
+           if ((entry->nentries % 4) == 0) {
+               entry->filenames = (hash_entry **)
+                       XtRealloc((char *)entry->filenames,
+                                 sizeof(hash_entry *) *
+                                 (entry->nentries + 4));
+               entry->patterns = (char **)
+                       XtRealloc((char *)entry->patterns,
+                                 sizeof(char *) *
+                                 (entry->nentries + 4));
+           }
+           entry->filenames[entry->nentries] = file_entry;
+           entry->patterns[entry->nentries] = XtNewString(pattern);
+           ++entry->nentries;
+       }
+       fclose(file);
+
+       /* Add tags information to global hash table */
+       hash_put(ht_tags, (hash_entry *)tags);
+       XeditPrintf("Tags file %s loaded\n", tagsfile);
+    }
+    else {
+       XeditPrintf("Failed to load tags file %s\n", tagsfile);
+       tags = NULL;
+    }
+
+    return (tags);
+}
+
+static void
+FindTag(XeditTagsInfo *tags)
+{
+    static String      params[] = { "vertical", NULL };
+
+    char               buffer[BUFSIZ];
+    char               *pattern;
+    int                        length;
+    char               *line;
+    char               *text;
+    RegexEntry         *regex;
+    re_mat             match;
+    XawTextPosition    position, left, right, last;
+    Widget             source;
+    XawTextBlock       block;
+    int                        size;
+    int                        lineno;
+    Boolean            found;
+    xedit_flist_item   *item;
+    Widget             otherwindow;
+
+    XmuSnprintf(buffer, sizeof(buffer), "%s%s", tags->tags->pathname->value,
+               tags->entry->filenames[tags->offset]->key->value);
+
+    pattern = tags->entry->patterns[tags->offset];
+    if (isdigit(*pattern)) {
+       lineno = atoi(pattern);
+       regex = NULL;
+    }
+    else {
+       lineno = 0;
+       length = strlen(pattern);
+       regex = (RegexEntry *)hash_check(tags->patterns, pattern, length);
+       if (regex == NULL) {
+           regex = XtNew(RegexEntry);
+           regex->pattern = XtNew(hash_key);
+           regex->pattern->value = XtNewString(pattern);
+           regex->pattern->length = length;
+           regex->next = NULL;
+           if (recomp(&regex->regex, pattern, RE_NOSUB | RE_NOSPEC)) {
+               XeditPrintf("Failed to compile regex %s\n", pattern);
+               Feep();
+               return;
+           }
+           hash_put(tags->patterns, (hash_entry *)regex);
+       }
+    }
+
+    /* Short circuit to know if split horizontally */
+    if (!XtIsManaged(texts[1]))
+       XtCallActionProc(textwindow, "split-window", NULL, params, 1);
+
+    /* Switch to "other" buffer */
+    XtCallActionProc(textwindow, "other-window", NULL, NULL, 0);
+
+    /* This should print an error message if tags file cannot be read */
+    if (!LoadFileInTextwindow(tags->incwd ?
+                             tags->entry->filenames[tags->offset]->key->value :
+                             buffer, buffer))
+       return;
+
+    otherwindow = textwindow;
+
+    item = FindTextSource(XawTextGetSource(textwindow), NULL);
+    source = item->source;
+    left = XawTextSourceScan(source, 0, XawstAll, XawsdLeft, 1, True);
+
+    found = False;
+
+    if (lineno) {
+       right = RSCAN(left, lineno, False);
+       left = LSCAN(right, 1, False);
+       found = True;
+    }
+    else {
+       right = RSCAN(left, 1, True);
+       last = XawTextSourceScan(source, 0, XawstAll, XawsdRight, 1, True);
+       text = buffer;
+
+       size = sizeof(buffer);
+       for (;;) {
+           length = right - left;
+           match.rm_so = 0;
+           match.rm_eo = length;
+           XawTextSourceRead(source, left, &block, right - left);
+           if (block.length >= length)
+               line = block.ptr;
+           else {
+               if (length > size) {
+                   if (text == buffer)
+                       text = XtMalloc(length);
+                   else
+                       text = XtRealloc(text, length);
+                   size = length;
+               }
+               line = text;
+               memcpy(line, block.ptr, block.length);
+               length = block.length;
+               for (position = left + length;
+                    position < right;
+                    position += block.length) {
+                   XawTextSourceRead(source, position, &block, right - position);
+                   memcpy(line + length, block.ptr, block.length);
+                   length += block.length;
+               }
+           }
+
+           /* If not last line or if it ends in a newline */
+           if (right < last ||
+               (right > left && line[match.rm_eo - 1] == '\n')) {
+               --match.rm_eo;
+               length = match.rm_eo;
+           }
+
+           /* Accept as a match when matching the entire line, as the regex
+            * search pattern is optmized to not need to start with ^ and not
+            * need to end with $*/
+           if (reexec(&regex->regex, line, 1, &match, RE_STARTEND) == 0 &&
+               match.rm_eo > match.rm_so &&
+               match.rm_so == 0 && match.rm_eo == length) {
+               right = left + match.rm_so + (match.rm_eo - match.rm_so);
+               found = True;
+               break;
+           }
+           else if (right >= last) {
+               XeditPrintf("Failed to match regex %s\n", pattern);
+               Feep();
+               break;
+           }
+           else {
+               left = LSCAN(right + 1, 1, False);
+               right = RSCAN(left, 1, True);
+           }
+       }
+
+       if (text != buffer)
+           XtFree(text);
+    }
+
+    /* Switch back to editing buffer */
+    XtCallActionProc(otherwindow, "other-window", NULL, NULL, 0);
+
+    if (found) {
+       if (source != XawTextGetSource(tags->textwindow) ||
+           right < tags->position || left > tags->position) {
+           XawTextSetInsertionPoint(otherwindow, left);
+           XawTextSetSelection(otherwindow, left, right);
+       }
+    }
+}
diff --git a/xedit/util.c b/xedit/util.c
new file mode 100644 (file)
index 0000000..f65bf4d
--- /dev/null
@@ -0,0 +1,995 @@
+/* $XConsortium: util.c,v 1.16 92/08/12 16:46:22 converse Exp $ */
+
+/*
+ *                       COPYRIGHT 1987
+ *                DIGITAL EQUIPMENT CORPORATION
+ *                    MAYNARD, MASSACHUSETTS
+ *                     ALL RIGHTS RESERVED.
+ *
+ * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
+ * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
+ * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR
+ * ANY PURPOSE.  IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
+ *
+ * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT RIGHTS,
+ * APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN ADDITION TO THAT
+ * SET FORTH ABOVE.
+ *
+ *
+ * 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 Equipment Corporation not be 
+ * used in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission.
+ */
+/* $XFree86: xc/programs/xedit/util.c,v 1.26 2003/05/07 20:54:43 herrb Exp $ */
+
+#include <stdio.h>
+#include <stdarg.h>
+
+#include <libgen.h>            /* POSIX basename() */
+#include <stdlib.h>            /* for realpath() */
+#include <errno.h>             /* for ENOENT */
+#include "xedit.h"
+
+#include <X11/Xfuncs.h>
+#include <X11/Xos.h>           /* for types.h */
+
+#include <sys/stat.h>
+#include <X11/Xmu/CharSet.h>
+#include <X11/Xaw/SmeBSB.h>
+#include <X11/Xaw/SimpleMenu.h>
+
+/*
+ * Prototypes
+ */
+static void SwitchSourceCallback(Widget, XtPointer, XtPointer);
+static int WindowIndex(Widget);
+static void ChangeTextWindow(Widget);
+
+/*
+ * External
+ */
+extern void _XawTextShowPosition(TextWidget);
+
+/*
+ * Initialization
+ */
+extern Widget scratch;
+extern Widget vpanes[2], labels[3], texts[3], forms[3];
+extern XawTextWrapMode wrapmodes[3];
+
+#ifndef va_copy
+# ifdef __va_copy
+#  define va_copy __va_copy
+# else
+#  error "no working va_copy was found"
+# endif
+#endif
+    
+/*
+ * Implementation
+ */
+void
+XeditPrintf(const char *format, ...)
+{
+    static struct {
+       XawTextPosition last;
+       int             size;
+       int             length;
+       int             repeat;
+       char            *buffer;
+    } info;
+
+    size_t             size;
+    va_list            va;
+    XawTextBlock       text;
+    XawTextPosition    left, right;
+    char               buffer[BUFSIZ];
+    char               *string, rbuffer[32];
+
+    va_start(va, format);
+    size = vsnprintf(buffer, sizeof(buffer), format, va);
+    va_end(va);
+
+    /* Should never happen... */
+    if (size >= sizeof(buffer)) {
+       strcpy(buffer + sizeof(buffer) - 5, "...\n");
+       size = sizeof(buffer) - 1;
+    }
+    else if (size) {
+       left = right = XawTextSourceScan(XawTextGetSource(messwidget),
+                                        0, XawstAll, XawsdRight, 1, True);
+
+       if (left == info.last &&
+           info.buffer &&
+           strcmp(buffer, info.buffer) == 0) {
+           string = rbuffer;
+           if (info.repeat == 1)
+               left -= info.buffer[strlen(info.buffer) - 1] == '\n';
+           else
+               left -= info.length;
+           size = info.length = XmuSnprintf(rbuffer, sizeof(rbuffer),
+                                            " [%d times]\n", ++info.repeat);
+       }
+       else {
+           string = buffer;
+           if (size >= info.size)
+               info.buffer = XtMalloc(size + 1);
+           strcpy(info.buffer, buffer);
+           info.repeat = 1;
+       }
+
+       text.length = size;
+       text.ptr = string;
+       text.firstPos = 0;
+       text.format = FMT8BIT;
+
+       XawTextReplace(messwidget, left, right, &text);
+
+       info.last = left + text.length;
+       XawTextSetInsertionPoint(messwidget, info.last);
+    }
+}
+
+Widget
+MakeCommandButton(Widget box, char *name, XtCallbackProc function)
+{
+  Widget w = XtCreateManagedWidget(name, commandWidgetClass, box, NULL, ZERO);
+  if (function != NULL)
+    XtAddCallback(w, XtNcallback, function, (caddr_t) NULL);
+  else
+    XtVaSetValues(w, XtNsensitive, False, NULL);
+  return w;
+}
+
+Widget 
+MakeStringBox(Widget parent, String name, String string)
+{
+  Arg args[5];
+  Cardinal numargs = 0;
+  Widget StringW;
+
+  XtSetArg(args[numargs], XtNeditType, XawtextEdit); numargs++;
+  XtSetArg(args[numargs], XtNstring, string); numargs++;
+
+  StringW = XtCreateManagedWidget(name, asciiTextWidgetClass, 
+                                 parent, args, numargs);
+  return(StringW);  
+}
+/*     Function Name: GetString
+ *     Description: retrieves the string from a asciiText widget.
+ *     Arguments: w - the ascii text widget.
+ *     Returns: the filename.
+ */
+
+String
+GetString(Widget w)
+{
+  String str;
+  Arg arglist[1];
+  
+  XtSetArg(arglist[0], XtNstring, &str);
+  XtGetValues( w, arglist, ONE);
+  return(str);
+}
+
+/*     Function Name: MaybeCreateFile
+ *     Description: Checks to see if file exists, and if not, creates it.
+ *     Arguments: file - name of file to check.
+ *     Returns: permissions status
+ */
+
+FileAccess
+MaybeCreateFile(char *file)
+{
+    Boolean exists;
+    int fd;
+
+    if (access(file, F_OK) != 0) {
+       fd = creat(file, 0666);
+       if (fd != -1)
+           close(fd);
+    }
+
+    return(CheckFilePermissions(file, &exists));
+}
+
+
+FileAccess
+CheckFilePermissions(char *file, Boolean *exists)
+{
+    char temp[BUFSIZ], *ptr;
+
+    if (access(file, F_OK) == 0) {
+       *exists = TRUE;
+
+       if (access(file, R_OK) != 0) 
+           return(NO_READ);
+       
+       if (access(file, R_OK | W_OK) == 0) 
+           return(WRITE_OK);
+       return(READ_OK);
+    }
+
+    *exists = FALSE;
+    
+    strncpy(temp, file, sizeof(temp) - 1);
+    temp[sizeof(temp) - 1] = '\0';
+    if ( (ptr = rindex(temp, '/')) == NULL) 
+       strcpy(temp, ".");
+    else 
+       *ptr = '\0';
+    
+    if (access(temp, R_OK | W_OK | X_OK) == 0)
+       return(WRITE_OK);
+    return(NO_READ);
+}
+
+xedit_flist_item *
+AddTextSource(Widget source, char *name, char *filename, int flags,
+             FileAccess file_access)
+{
+    xedit_flist_item *item;
+    char *wid_name;
+
+    item = (xedit_flist_item*)XtMalloc(sizeof(xedit_flist_item));
+    item->source = source;
+    item->name = XtNewString(name);
+    item->filename = XtNewString(filename);
+    item->flags = flags;
+    item->file_access = file_access;
+    item->display_position = item->insert_position = 0;
+    item->mode = 0;
+    item->mtime = 0;
+    item->properties = NULL;
+    item->xldata = NULL;
+    /* Try to load associated tags file */
+    SearchTagsFile(item);
+
+    flist.itens = (xedit_flist_item**)
+       XtRealloc((char*)flist.itens, sizeof(xedit_flist_item*)
+                 * (flist.num_itens + 1));
+
+    flist.itens[flist.num_itens++] = item;
+
+    if (!flist.popup) {
+       flist.popup = XtCreatePopupShell("fileMenu", simpleMenuWidgetClass,
+                                        topwindow, NULL, 0);
+       /* XXX hack: this don't allow setting the geometry of the popup widget
+        * as it will override any settings when a menu entry is inserted
+        * or deleted, but saves us the trouble generated by a resource
+        * setting like: '*geometry: <width>x<height>'
+        */
+       XtRealizeWidget(flist.popup);
+    }
+    if ((wid_name = strrchr(item->name, '/')) == NULL)
+       wid_name = item->name;
+    else
+       ++wid_name;
+    item->sme = XtVaCreateManagedWidget(wid_name, smeBSBObjectClass,
+                                       flist.popup, XtNlabel, item->filename,
+                                       NULL, NULL);
+    XtAddCallback(item->sme, XtNcallback,
+                 SwitchSourceCallback, (XtPointer)item);
+
+    SetTextProperties(item);
+
+    return (item);
+}
+
+Bool
+KillTextSource(xedit_flist_item *item)
+{
+    xedit_flist_item *nitem = NULL;
+    unsigned idx, i;
+    Arg targs[3];
+    Cardinal tnum_args;
+    Arg largs[2];
+    Cardinal lnum_args;
+    char label_buf[BUFSIZ];
+
+    for (idx = 0; idx < flist.num_itens; idx++)
+       if (flist.itens[idx] == item) {
+           if (idx + 1 < flist.num_itens)
+               nitem = flist.itens[idx + 1];
+           else if (idx >= 1)
+               nitem = flist.itens[idx - 1];
+           break;
+       }
+
+    if (idx >= flist.num_itens)
+       return (False);
+
+    flist.current = nitem;
+    if (item == flist.other)
+       flist.other = NULL;
+
+    if (nitem->file_access == READ_OK)
+       XmuSnprintf(label_buf, sizeof(label_buf), "%s       READ ONLY",
+                   nitem->name);
+    else if (nitem->file_access == WRITE_OK)
+       XmuSnprintf(label_buf, sizeof(label_buf), "%s       Read - Write",
+                   nitem->name);
+    lnum_args = 0;
+    XtSetArg(largs[lnum_args], XtNlabel, label_buf);           ++lnum_args;
+    if (nitem->flags & CHANGED_BIT)
+       XtSetArg(largs[lnum_args], XtNleftBitmap, flist.pixmap);
+    else
+       XtSetArg(largs[lnum_args], XtNleftBitmap, None);
+    ++lnum_args;
+
+    tnum_args = 0;
+    XtSetArg(targs[tnum_args], XtNtextSource,
+            nitem->source);                            ++tnum_args;
+    XtSetArg(targs[tnum_args], XtNdisplayPosition,
+            nitem->display_position);                  ++tnum_args;
+    XtSetArg(targs[tnum_args], XtNinsertPosition,
+            nitem->insert_position);                   ++tnum_args;
+    for (i = 0; i < 3; i++)
+       if (XawTextGetSource(texts[i]) == item->source) {
+           XtSetValues(labels[i], largs, lnum_args);
+           XawTextDisableRedisplay(texts[i]);
+           XtSetValues(texts[i], targs, tnum_args);
+
+           UpdateTextProperties(0);
+
+           _XawTextShowPosition((TextWidget)texts[i]);
+           XawTextEnableRedisplay(texts[i]);
+           if (texts[i] == textwindow) {
+               Arg args[1];
+
+               if (nitem->source != scratch)
+                   XtSetArg(args[0], XtNstring, nitem->name);
+               else
+                   XtSetArg(args[0], XtNstring, NULL);
+               XtSetValues(filenamewindow, args, 1);
+           }
+       }
+
+    UnsetTextProperties(item);
+    XtFree(item->name);
+    XtFree(item->filename);
+    XtDestroyWidget(item->sme);
+    XtDestroyWidget(item->source);
+    XtFree((char*)item);
+
+    if (idx < flist.num_itens - 1)
+       memmove(&flist.itens[idx], &flist.itens[idx + 1],
+               (flist.num_itens - idx) * sizeof(xedit_flist_item*));
+
+    --flist.num_itens;
+
+    return (True);
+}
+
+xedit_flist_item *
+FindTextSource(Widget source, char *filename)
+{
+    unsigned i;
+
+    if (source) {
+       for (i = 0; i < flist.num_itens; i++)
+           if (flist.itens[i]->source == source)
+               return (flist.itens[i]);
+    }
+    else if (filename) {
+       for (i = 0; i < flist.num_itens; i++)
+           if (strcmp(flist.itens[i]->filename, filename) == 0)
+               return (flist.itens[i]);
+    }
+
+    return (NULL);
+}
+
+void
+SwitchTextSource(xedit_flist_item *item)
+{
+    Arg args[4];
+    Cardinal num_args;
+    char label_buf[BUFSIZ];
+    xedit_flist_item *old_item =
+       FindTextSource(XawTextGetSource(textwindow), NULL);
+    int i;
+
+    if (old_item != item)
+       flist.other = old_item;
+    flist.current = item;
+
+    XawTextDisableRedisplay(textwindow);
+    if (item->file_access == READ_OK)
+       XmuSnprintf(label_buf, sizeof(label_buf), "%s       READ ONLY",
+                   item->name);
+    else if (item->file_access == WRITE_OK)
+       XmuSnprintf(label_buf, sizeof(label_buf), "%s       Read - Write",
+                   item->name);
+    num_args = 0;
+    XtSetArg(args[num_args], XtNlabel, label_buf);             ++num_args;
+    if (item->flags & CHANGED_BIT)
+       XtSetArg(args[num_args], XtNleftBitmap, flist.pixmap);
+    else
+       XtSetArg(args[num_args], XtNleftBitmap, None);
+    ++num_args;
+    XtSetValues(labelwindow, args, num_args);
+
+    for (i = 0; i < 3; i++)
+       if (XawTextGetSource(texts[i]) == item->source
+           && XtIsManaged(texts[i]))
+           break;
+
+    if (i < 3) {
+       num_args = 0;
+       XtSetArg(args[num_args], XtNdisplayPosition,
+            &(item->display_position));                        ++num_args;
+       XtSetArg(args[num_args], XtNinsertPosition,
+            &(item->insert_position));                         ++num_args;
+       XtGetValues(texts[i], args, num_args);
+    }
+    if (old_item != item) {
+       int count, idx = 0;
+
+       num_args = 0;
+       XtSetArg(args[num_args], XtNdisplayPosition,
+            &(old_item->display_position));                    ++num_args;
+       XtSetArg(args[num_args], XtNinsertPosition,
+            &(old_item->insert_position));                     ++num_args;
+       XtGetValues(textwindow, args, num_args);
+
+       for (count = 0, i = 0; i < 3; i++)
+           if (XawTextGetSource(texts[i]) == old_item->source
+               && XtIsManaged(texts[i])) {
+               if (++count > 1)
+                   break;
+               idx = i;
+           }
+
+       if (count == 1) {
+           num_args = 0;
+           XtSetArg(args[num_args], XtNdisplayPosition,
+                    &(old_item->display_position));            ++num_args;
+               XtSetArg(args[num_args], XtNinsertPosition,
+                    &(old_item->insert_position));             ++num_args;
+           XtGetValues(texts[idx], args, num_args);
+       }
+    }
+
+    num_args = 0;
+    XtSetArg(args[num_args], XtNtextSource, item->source);     ++num_args;
+    XtSetArg(args[num_args], XtNdisplayPosition, item->display_position);
+    ++num_args;
+    XtSetArg(args[num_args], XtNinsertPosition, item->insert_position);
+    ++num_args;
+    if (item->flags & WRAP_BIT)
+       XtSetArg(args[num_args], XtNwrap, item->wrap);
+    else
+       XtSetArg(args[num_args], XtNwrap, wrapmodes[WindowIndex(textwindow)]);
+    ++num_args;
+    XtSetValues(textwindow, args, num_args);
+
+    UpdateTextProperties(0);
+
+    _XawTextShowPosition((TextWidget)textwindow);
+    XawTextEnableRedisplay(textwindow);
+
+    num_args = 0;
+    if (item->source != scratch) {
+       XtSetArg(args[num_args], XtNstring, item->name);        ++num_args;
+    }
+    else {
+       XtSetArg(args[num_args], XtNstring, NULL);              ++num_args;
+    }
+    XtSetValues(filenamewindow, args, num_args);
+    /* XXX This probably should be done by the TextWidget, i.e. notice
+     * if the cursor became inivisible due to an horizontal scroll */
+    _XawTextShowPosition((TextWidget)filenamewindow);
+}
+
+char *
+ResolveName(char *filename)
+{
+#ifndef __UNIXOS2__
+    static char *name;
+    char       *result, *tmp = name;
+#endif
+
+    if (filename == NULL)
+       filename = GetString(filenamewindow);
+
+#ifndef __UNIXOS2__
+    /* Ensure not passing the same pointer again to realpath */
+    name = XtMalloc(BUFSIZ);
+    XtFree(tmp);
+    result = realpath(filename, name);
+
+    if (result == NULL && errno == ENOENT) {
+       int     length;
+       char    *dir, *file;
+
+       length = strlen(filename);
+       tmp = dir = XtMalloc(length + 1);
+       strcpy(dir, filename);
+
+       file = basename(filename);
+       dir = dirname(tmp);
+
+       /* Creating a new file? */
+       if (dir && file && strcmp(dir, file) &&
+           access(dir, F_OK) == 0 &&
+           (result = realpath(dir, name)) == name) {
+           int length = strlen(result);
+
+           XmuSnprintf(result + length, BUFSIZ - length, "%s%s",
+                       dir[length - 1] == '/' ? "" : "/", file);
+       }
+
+       XtFree(tmp);
+    }
+
+    return (result);
+#else
+    return filename;
+#endif
+}
+
+static void
+ChangeTextWindow(Widget w)
+{
+    Arg args[1];
+
+    if (textwindow != w) {
+       xedit_flist_item *other, *current;
+
+       other = FindTextSource(XawTextGetSource(textwindow), NULL);
+       current = FindTextSource(XawTextGetSource(w), NULL);
+       if (other != current)
+           flist.other = other;
+       if (current)
+           flist.current = current;
+       XtSetArg(args[0], XtNdisplayCaret, False);
+       XtSetValues(textwindow, args, 1);
+       XtSetArg(args[0], XtNdisplayCaret, True);
+       XtSetValues(w, args, 1);
+       XawTextUnsetSelection(textwindow);
+       textwindow = w;
+    }
+}
+
+/*ARGSUSED*/
+void
+XeditFocus(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    Arg args[1];
+    xedit_flist_item *item;
+    int idx = WindowIndex(w);
+
+    XtSetKeyboardFocus(topwindow, w);
+
+    ChangeTextWindow(w);
+
+    labelwindow = labels[idx];
+    item = FindTextSource(XawTextGetSource(textwindow), NULL);
+
+    if (item->source != scratch)
+       XtSetArg(args[0], XtNstring, item->name);
+    else
+       XtSetArg(args[0], XtNstring, NULL);
+
+    XtSetValues(filenamewindow, args, 1);
+
+    line_edit = False;
+}
+
+void
+PopupMenu(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    Cardinal n_params = num_params ? *num_params : 0;
+
+    if (*num_params && XmuCompareISOLatin1(*params, "editMenu") == 0)
+       SetEditMenu();
+
+    XtCallActionProc(w, "XawPositionSimpleMenu", event, params, n_params);
+    XtCallActionProc(w, "XtMenuPopup", event, params, n_params);
+}
+
+/*ARGSUSED*/
+static void
+SwitchSourceCallback(Widget entry, XtPointer client_data, XtPointer call_data)
+{
+    SwitchTextSource((xedit_flist_item*)client_data);
+}
+
+static int
+WindowIndex(Widget w)
+{
+    int i;
+
+    for (i = 0; i < 3; i++)
+       if (texts[i] == w)
+           return (i);
+
+    return (-1);
+}
+
+void
+DeleteWindow(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    Widget unmanage[2];
+    int idx = WindowIndex(w), uidx;
+    Bool current = False;
+
+    if (*num_params == 1 && (*params[0] == 'd' || *params[0] == 'D')) {
+       if (XtIsManaged(XtParent(dirwindow)))
+           SwitchDirWindow(False);
+       return;
+    }
+
+    if (idx < 0 || (!XtIsManaged(texts[1]) && !XtIsManaged(texts[2]))) {
+       Feep();
+       return;
+    }
+
+    if (num_params && *num_params == 1 &&
+       (*params[0] == 'o' || *params[0] == 'O'))
+       current = True;
+
+    uidx = XtIsManaged(texts[1]) ? 1 : 2;
+
+    unmanage[0] = forms[uidx];
+    unmanage[1] = texts[uidx];
+    XtUnmanageChildren(unmanage, 2);
+
+    if (!XtIsManaged(texts[2]))
+       XtUnmanageChild(vpanes[1]);
+
+    if ((!current && idx == 0) || (current && idx != 0)) {
+       Arg args[4];
+       Cardinal num_args;
+       String label_str;
+       Pixmap label_pix;
+       XawTextPosition d_pos, i_pos;
+       Widget source;
+       xedit_flist_item *item;
+
+       num_args = 0;
+       XtSetArg(args[num_args], XtNlabel, &label_str);         ++num_args;
+       XtSetArg(args[num_args], XtNleftBitmap, &label_pix);    ++num_args;
+       XtGetValues(labels[current ? idx : uidx], args, num_args);
+
+       num_args = 0;
+       XtSetArg(args[num_args], XtNlabel, label_str);          ++num_args;
+       XtSetArg(args[num_args], XtNleftBitmap, label_pix);     ++num_args;
+       XtSetValues(labels[0], args, num_args);
+
+       num_args = 0;
+       XtSetArg(args[num_args], XtNdisplayPosition, &d_pos);   ++num_args;
+       XtSetArg(args[num_args], XtNinsertPosition, &i_pos);    ++num_args;
+       XtSetArg(args[num_args], XtNtextSource, &source);       ++num_args;
+       XtGetValues(texts[current ? idx : uidx], args, num_args);
+
+       num_args = 0;
+       XtSetArg(args[num_args], XtNdisplayPosition, d_pos);    ++num_args;
+       XtSetArg(args[num_args], XtNinsertPosition, i_pos);     ++num_args;
+       XtSetArg(args[num_args], XtNtextSource, source);        ++num_args;
+
+       item = FindTextSource(source, NULL);
+       if (item && (item->flags & WRAP_BIT))
+           XtSetArg(args[num_args], XtNwrap, item->wrap);
+       else
+           XtSetArg(args[num_args], XtNwrap,
+                    wrapmodes[WindowIndex(texts[current ? idx : uidx])]);
+       XtSetValues(texts[0], args, num_args);
+
+       UpdateTextProperties(0);
+    }
+
+    labelwindow = labels[0];
+    XeditFocus(texts[0], NULL, NULL, NULL);
+}
+
+void
+SwitchSource(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    int idx = WindowIndex(w);
+    Widget source;
+    int i;
+
+    if (idx < 0 || textwindow != texts[idx]) {
+       Feep();
+       return;
+    }
+
+    source = XawTextGetSource(textwindow);
+
+    for (i = 0; i < flist.num_itens; i++)
+       if (flist.itens[i]->source == source) {
+           if (i > 0 && i == flist.num_itens - 1)
+               i = 0;
+           else if (i < flist.num_itens - 1)
+               ++i;
+           else {
+               Feep();
+               return;
+           }
+           break;
+       }
+
+    if (i >= flist.num_itens) {
+       Feep();
+       return;
+    }
+
+    SwitchTextSource(flist.itens[i]);
+}
+
+void
+OtherWindow(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    int oidx, idx = WindowIndex(w);
+
+    if (idx < 0 || (!XtIsManaged(texts[1]) && !XtIsManaged(texts[2]))) {
+       Feep();
+       return;
+    }
+
+    if (idx == 0)
+       oidx = XtIsManaged(texts[1]) ? 1 : 2;
+    else
+       oidx = 0;
+
+    XeditFocus(texts[oidx], event, params, num_params);
+}
+
+void
+SplitWindow(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    Arg args[6];
+    Cardinal num_args;
+    Widget nlabel, ntext, source, sink, manage[2];
+    Dimension width, height, bw;
+    XawTextPosition i_pos, d_pos;
+    String label_str;
+    Pixmap label_pix;
+    int idx = WindowIndex(w), dimension;
+    Bool vert = True;
+    xedit_flist_item *item;
+
+    if (num_params && *num_params == 1
+       && (*params[0] == 'h' || *params[0] == 'H'))
+       vert = False;
+
+    if (idx < 0
+       || (vert && XtIsManaged(texts[1]))
+       || (!vert && XtIsManaged(vpanes[1]))) {
+       Feep();
+       return;
+    }
+
+    if (vert) {
+       nlabel = labels[1];
+       ntext = texts[1];
+    }
+    else {
+       nlabel = labels[2];
+       ntext = texts[2];
+    }
+    ChangeTextWindow(texts[idx]);
+    labelwindow = labels[idx];
+
+    num_args = 0;
+    XtSetArg(args[num_args], XtNinsertPosition, &i_pos);       ++num_args;
+    XtSetArg(args[num_args], XtNdisplayPosition, &d_pos);      ++num_args;
+    XtSetArg(args[num_args], XtNtextSource, &source);          ++num_args;
+    XtSetArg(args[num_args], XtNtextSink, &sink);              ++num_args;
+    XtSetArg(args[num_args], XtNwidth, &width);                        ++num_args;
+    XtSetArg(args[num_args], XtNheight, &height);              ++num_args;
+    XtGetValues(w, args, num_args);
+
+    num_args = 0;
+    XtSetArg(args[num_args], XtNinternalBorderWidth, &bw);     ++num_args;
+    XtGetValues(XtParent(w), args, num_args);
+
+    if (vert) {
+       dimension = (int)height - (((int)bw) << 1);
+       num_args = 0;
+       XtSetArg(args[num_args], XtNheight, &height);           ++num_args;
+       XtGetValues(labelwindow, args, num_args);
+       dimension -= (int)height;
+    }
+    else
+       dimension = (int)width - (int)bw;
+
+    dimension >>= 1;
+
+    if (dimension <= 0 || dimension < XawTextSinkMaxHeight(sink, 3)) {
+       Feep();
+       return;
+    }
+
+    num_args = 0;
+    XtSetArg(args[num_args], XtNlabel, &label_str);            ++num_args;
+    XtSetArg(args[num_args], XtNleftBitmap, &label_pix);       ++num_args;
+    XtGetValues(labelwindow, args, num_args);
+
+    if (vert) {
+       if (XtIsManaged(texts[2])) {
+           manage[0] = forms[2];
+           manage[1] = texts[2];
+           XtUnmanageChildren(manage, 2);
+           XtUnmanageChild(vpanes[1]);
+       }
+    }
+    else {
+       if (XtIsManaged(texts[1])) {
+           manage[0] = forms[1];
+           manage[1] = texts[1];
+           XtUnmanageChildren(manage, 2);
+       }
+    }
+
+    XawTextDisableRedisplay(texts[0]);
+    XawTextDisableRedisplay(ntext);
+    if (textwindow == texts[1] || textwindow == texts[2]) {
+       num_args = 0;
+       XtSetArg(args[num_args], XtNdisplayPosition, d_pos);    ++num_args;
+       XtSetArg(args[num_args], XtNinsertPosition, i_pos);     ++num_args;
+       XtSetArg(args[num_args], XtNtextSource, source);        ++num_args;
+       ChangeTextWindow(texts[0]);
+       XtSetValues(textwindow, args, num_args);
+       XtSetKeyboardFocus(topwindow, textwindow);
+
+       num_args = 0;
+       XtSetArg(args[num_args], XtNlabel, label_str);          ++num_args;
+       XtSetArg(args[num_args], XtNleftBitmap, label_pix);     ++num_args;
+       XtSetValues(labelwindow = labels[0], args, num_args);
+    }
+
+    num_args = 0;
+    XtSetArg(args[num_args], XtNlabel, label_str);             ++num_args;
+    XtSetArg(args[num_args], XtNleftBitmap, label_pix);                ++num_args;
+    XtSetValues(nlabel, args, num_args);
+
+    num_args = 0;
+    XtSetArg(args[num_args], XtNmin, dimension);               ++num_args;
+    XtSetArg(args[num_args], XtNmax, dimension);               ++num_args;
+    if (!vert)
+       XtSetValues(vpanes[1], args, num_args);
+    else
+       XtSetValues(ntext, args, num_args);
+
+    manage[0] = XtParent(nlabel);
+    manage[1] = ntext;
+    XtManageChildren(manage, 2);
+    if (!vert)
+       XtManageChild(vpanes[1]);
+
+    num_args = 0;
+    XtSetArg(args[num_args], XtNmin, 1);                       ++num_args;
+    XtSetArg(args[num_args], XtNmax, 65535);                   ++num_args;
+    if (!vert) {
+       XtSetValues(vpanes[1], args, num_args);
+       num_args = 0;
+    }
+    XtSetArg(args[num_args], XtNtextSource, source);           ++num_args;
+    XtSetArg(args[num_args], XtNdisplayPosition, d_pos);       ++num_args;
+    XtSetArg(args[num_args], XtNinsertPosition, i_pos);                ++num_args;
+    item = FindTextSource(source, NULL);
+    if (item && (item->flags & WRAP_BIT))
+       XtSetArg(args[num_args], XtNwrap, item->wrap);
+    else
+       XtSetArg(args[num_args], XtNwrap, wrapmodes[WindowIndex(ntext)]);
+    ++num_args;
+    XtSetValues(ntext, args, num_args);
+
+    UpdateTextProperties(0);
+
+    _XawTextShowPosition((TextWidget)textwindow);
+    _XawTextShowPosition((TextWidget)ntext);
+
+    XawTextEnableRedisplay(textwindow);
+    XawTextEnableRedisplay(ntext);
+}
+
+void
+SwitchDirWindow(Bool show)
+{
+    static int map;    /* There must be one instance of this
+                        * variable per top level window */
+    Widget manage[2];
+
+    if (!show && XtIsManaged(XtParent(dirwindow))) {
+       manage[0] = dirlabel;
+       manage[1] = XtParent(dirwindow);
+       XtUnmanageChildren(manage, 2);
+       XtUnmanageChild(vpanes[1]);
+
+       XtManageChild(vpanes[0]);
+       if (map == 2) {
+           Arg args[2];
+           Dimension width, bw;
+
+           XtSetArg(args[0], XtNwidth, &width);
+           XtGetValues(texts[0], args, 1);
+           XtSetArg(args[0], XtNinternalBorderWidth, &bw);
+           XtGetValues(XtParent(texts[0]), args, 1);
+           width = (width - bw) >> 1;
+           XtSetArg(args[0], XtNmin, width);
+           XtSetArg(args[0], XtNmax, width);
+           XtSetValues(vpanes[0], args, 1);
+           manage[0] = forms[2];
+           manage[1] = texts[2];
+           XtManageChildren(manage, 2);
+           XtManageChild(vpanes[1]);
+           XtSetArg(args[0], XtNmin, 1);
+           XtSetArg(args[0], XtNmax, 65535);
+           XtSetValues(vpanes[0], args, 1);
+       }
+    }
+    else if (show && !XtIsManaged(XtParent(dirwindow))) {
+       XtUnmanageChild(vpanes[0]);
+       if (XtIsManaged(texts[2])) {
+           manage[0] = forms[2];
+           manage[1] = texts[2];
+           XtUnmanageChildren(manage, 2);
+           map = 2;
+       }
+       else {
+           map = XtIsManaged(texts[1]);
+           XtManageChild(vpanes[1]);
+       }
+
+       manage[0] = dirlabel;
+       manage[1] = XtParent(dirwindow);
+       XtManageChildren(manage, 2);
+    }
+}
+
+/*ARGSUSED*/
+void
+DirWindow(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    Arg args[1];
+    char path[BUFSIZ + 1], *dir;
+
+    if (XtIsManaged(XtParent(dirwindow)))
+       return;
+
+    if (*num_params == 1) {
+       strncpy(path, params[0], sizeof(path) - 2);
+       path[sizeof(path) - 2] = '\0';
+    }
+    else {
+       char *slash;
+       xedit_flist_item *item = FindTextSource(XawTextGetSource(textwindow), NULL);
+
+       if (item == NULL || item->source == scratch
+           || (slash = rindex(item->filename, '/')) == NULL)
+           strcpy(path, "./");
+       else {
+           int len = slash - item->filename + 1;
+
+           if (len > sizeof(path) - 2)
+               len = sizeof(path) - 2;
+           strncpy(path, item->filename, len);
+           path[len] = '\0';
+       }
+    }
+
+    dir = ResolveName(path);
+    if (dir != NULL) {
+       strncpy(path, dir, sizeof(path) - 2);
+       path[sizeof(path) - 2] = '\0';
+       if (*path && path[strlen(path) - 1] != '/')
+           strcat(path, "/");
+
+       XtSetArg(args[0], XtNlabel, "");
+       XtSetValues(dirlabel, args, 1);
+
+       SwitchDirWindow(True);
+       DirWindowCB(dirwindow, path, NULL);
+    }
+    else
+       Feep();
+}
diff --git a/xedit/util.h b/xedit/util.h
new file mode 100644 (file)
index 0000000..9717589
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2007,2008 Paulo Cesar Pereira de Andrade
+ *
+ * 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 (including the next
+ * paragraph) 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.
+ *
+ * Author: Paulo Cesar Pereira de Andrade
+ */
+
+/* Generic hash table */
+
+#ifndef _util_h
+#define _util_h
+
+/*
+ * Types
+ */
+typedef struct _hash_key       hash_key;
+typedef struct _hash_entry     hash_entry;
+typedef struct _hash_table     hash_table;
+typedef int (*hash_compare)(hash_key *left, hash_key *right);
+
+struct _hash_key {
+    char               *value;
+    unsigned int       length;
+};
+
+struct _hash_entry {
+    hash_key           *key;
+    hash_entry         *next;
+};
+
+struct _hash_table {
+    hash_entry         **entries;
+    unsigned int       count;          /* length of entries */
+    unsigned int       length;         /* sum of entries */
+    hash_compare       compare;
+
+    struct {
+       int             offset;
+       hash_entry      *entry;
+    } iter;
+};
+
+/*
+ * Prototypes
+ */
+hash_table *hash_new(unsigned int length, hash_compare compare);
+hash_entry *hash_put(hash_table *hash, hash_entry *entry);
+hash_entry *hash_get(hash_table *hash, hash_key *name);
+hash_entry * hash_check(hash_table *hash, char *name, unsigned int length);
+void hash_rem(hash_table *hash, hash_entry *entry);
+/* Removes from hash table but doesn't release any memory */
+hash_entry *hash_rem_no_free(hash_table *hash, hash_entry *entry);
+void hash_rehash(hash_table *hash, unsigned int length);
+hash_entry *hash_iter_first(hash_table *hash);
+hash_entry *hash_iter_next(hash_table *hash);
+
+/* Frees all data. When casting to another type, use the
+ * iterator to free extra data */
+void hash_clr(hash_table *hash);
+void hash_del(hash_table *hash);
+
+#endif /* _util_h */
diff --git a/xedit/xedit.c b/xedit/xedit.c
new file mode 100644 (file)
index 0000000..0b49226
--- /dev/null
@@ -0,0 +1,677 @@
+/* $XConsortium: xedit.c,v 1.28 94/03/26 17:06:28 rws Exp $ */
+/*
+ *                       COPYRIGHT 1987
+ *                DIGITAL EQUIPMENT CORPORATION
+ *                    MAYNARD, MASSACHUSETTS
+ *                     ALL RIGHTS RESERVED.
+ *
+ * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
+ * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
+ * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR
+ * ANY PURPOSE.  IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
+ *
+ * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT RIGHTS,
+ * APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN ADDITION TO THAT
+ * SET FORTH ABOVE.
+ *
+ *
+ * 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 Equipment Corporation not be 
+ * used in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission.
+ */
+/* $XFree86: xc/programs/xedit/xedit.c,v 1.17 2002/09/22 07:09:05 paulo Exp $ */
+
+#include "xedit.h"
+#include <X11/Xaw/SmeBSB.h>
+#include <time.h>
+#include <sys/stat.h>
+#include <X11/CoreP.h>
+
+#include <stdlib.h> 
+
+#define randomize()    srand((unsigned)time((time_t*)NULL))
+
+static XtActionsRec actions[] = {
+{"quit", QuitAction},
+{"save-file", SaveFile},
+{"load-file", LoadFile},
+#ifdef INCLUDE_XPRINT_SUPPORT
+{"print-file", PrintFile},
+#endif /* INCLUDE_XPRINT_SUPPORT */
+{"find-file", FindFile},
+{"cancel-find-file", CancelFindFile},
+{"file-completion", FileCompletion},
+{"popup-menu", PopupMenu},
+{"kill-file", KillFile},
+{"split-window", SplitWindow},
+{"dir-window", DirWindow},
+{"delete-window", DeleteWindow},
+{"xedit-focus", XeditFocus},
+{"other-window", OtherWindow},
+{"switch-source", SwitchSource},
+#ifndef __UNIXOS2__
+{"lisp-eval", XeditLispEval},
+{"xedit-print-lisp-eval", XeditPrintLispEval},
+{"xedit-keyboard-reset",XeditKeyboardReset},
+#endif
+{"ispell", IspellAction},
+{"line-edit", LineEditAction},
+{"tags", TagsAction}
+};
+
+#define DEF_HINT_INTERVAL      300     /* in seconds, 5 minutes */
+
+static Atom wm_delete_window;
+static Widget hintswindow;
+static int position_format_mask;
+static XawTextPositionInfo infos[3];
+
+Widget topwindow, textwindow, messwidget, labelwindow, filenamewindow;
+Widget scratch, hpane, vpanes[2], labels[3], texts[3], forms[3], positions[3];
+Widget options_popup, dirlabel, dirwindow;
+Boolean international;
+Boolean line_edit;
+XawTextWrapMode wrapmodes[3];
+
+extern void ResetSourceChanged(xedit_flist_item*);
+
+static void makeButtonsAndBoxes(Widget);
+static void HintsTimer(XtPointer, XtIntervalId*);
+static void PositionChanged(Widget, XtPointer, XtPointer);
+static void StartFormatPosition(void);
+static void StartHints(void);
+
+Display *CurDpy;
+
+struct _app_resources app_resources;
+struct _xedit_flist flist;
+
+#define Offset(field) XtOffsetOf(struct _app_resources, field)
+
+static XtResource resources[] = {
+   {"enableBackups", "EnableBackups", XtRBoolean, sizeof(Boolean),
+         Offset(enableBackups), XtRImmediate, FALSE},
+   {"backupNamePrefix", "BackupNamePrefix", XtRString, sizeof(char *),
+         Offset(backupNamePrefix),XtRString, ""},
+   {"backupNameSuffix", "BackupNameSuffix", XtRString, sizeof(char *),
+         Offset(backupNameSuffix),XtRString, ".BAK"},
+   {"hints", "Hint", XtRString, sizeof(char *),
+        Offset(hints.resource), XtRImmediate, NULL},
+   {"hintsInterval", XtCInterval, XtRInt, sizeof(long),
+        Offset(hints.interval), XtRImmediate, (XtPointer)DEF_HINT_INTERVAL},
+   {"changedBitmap", XtRBitmap, XtRString, sizeof(char*),
+        Offset(changed_pixmap_name), XtRString, "dot"},
+   {"positionFormat", "Format", XtRString, sizeof(char*),
+        Offset(position_format), XtRString, "L%l"},
+   {"autoReplace", "Replace", XtRString, sizeof(char*),
+        Offset(auto_replace), XtRImmediate, NULL},
+   {"tagsName", "TagsName", XtRString, sizeof(char *),
+         Offset(tagsName), XtRString, "tags"},
+   {"loadTags", "LoadTags", XtRBoolean, sizeof(Boolean),
+        Offset(loadTags), XtRImmediate, (XtPointer)TRUE},
+};
+
+#undef Offset
+
+#ifdef INCLUDE_XPRINT_SUPPORT
+String fallback_resources[] = {
+    "*international:     True", /* set this globally for ALL widgets to avoid wiered crashes */
+    NULL
+};
+#endif
+
+int
+main(int argc, char *argv[])
+{
+    Boolean            exists;
+    char               *filename;
+    FileAccess         file_access;
+    Widget             source;
+    XtAppContext       appcon;
+    unsigned int       i, num_loaded, lineno;
+
+    num_loaded = lineno = 0;
+
+#ifdef INCLUDE_XPRINT_SUPPORT
+    XtSetLanguageProc(NULL, NULL, NULL);
+#endif
+    topwindow = XtAppInitialize(&appcon, "Xedit", NULL, 0, &argc, argv,
+#ifdef INCLUDE_XPRINT_SUPPORT
+                               fallback_resources,
+#else
+                               NULL,
+#endif
+                               NULL, 0);
+
+    XtAppAddActions(appcon, actions, XtNumber(actions));
+    XtOverrideTranslations(topwindow,
+                          XtParseTranslationTable("<Message>WM_PROTOCOLS: quit()"));
+
+    XtGetApplicationResources(topwindow, (XtPointer) &app_resources, resources,
+                             XtNumber(resources), NULL, 0);
+
+    CurDpy = XtDisplay(topwindow);
+    XawSimpleMenuAddGlobalActions(appcon);
+    XtRegisterGrabAction(PopupMenu, True,
+                        ButtonPressMask | ButtonReleaseMask,
+                        GrabModeAsync, GrabModeAsync);
+
+    makeButtonsAndBoxes(topwindow);
+
+    StartHints();
+    StartFormatPosition();
+    (void)StartHooks(appcon);
+    if (position_format_mask == 0) {
+       for (i = 0; i < 3; i++)
+           XtRemoveCallback(texts[i], XtNpositionCallback,
+                            PositionChanged, NULL);
+    }
+    XtRealizeWidget(topwindow);
+
+#ifndef __UNIXOS2__
+    XeditLispInitialize();
+#endif
+
+    options_popup = XtCreatePopupShell("optionsMenu", simpleMenuWidgetClass,
+                                      topwindow, NULL, 0);
+    XtRealizeWidget(options_popup);
+    XtAddCallback(XtCreateManagedWidget("ispell", smeBSBObjectClass,
+                                       options_popup, NULL, 0),
+                 XtNcallback, IspellCallback, NULL);
+    CreateEditPopup();
+
+    wm_delete_window = XInternAtom(XtDisplay(topwindow), "WM_DELETE_WINDOW",
+                                  False);
+    (void)XSetWMProtocols(XtDisplay(topwindow), XtWindow(topwindow),
+                         &wm_delete_window, 1);
+
+    /* This first call is just to save the default font and colors */
+    UpdateTextProperties(0);
+
+    if (argc > 1) {
+       xedit_flist_item        *item;
+       Arg                     args[2];
+       unsigned int            num_args;
+
+       for (i = 1; i < argc; i++) {
+           struct stat st;
+
+           if (argv[i][0] == '+') {
+               char    *endptr;
+
+               lineno = strtol(argv[i], &endptr, 10);
+               /* Don't warn or anything about incorrect input? */
+               if (*endptr)
+                   lineno = 0;
+               continue;
+           }
+
+           filename = ResolveName(argv[i]);
+           if (filename == NULL || FindTextSource(NULL, filename) != NULL)
+               continue;
+
+           num_args = 0;
+           if (stat(filename, &st) == 0 && !S_ISREG(st.st_mode)) {
+               if (S_ISDIR(st.st_mode)) {
+                   if (!num_loaded) {
+                       char path[BUFSIZ + 1];
+
+                       strncpy(path, filename, sizeof(path) - 2);
+                       path[sizeof(path) - 2] = '\0';
+                       if (*path) {
+                           if (path[strlen(path) - 1] != '/')
+                               strcat(path, "/");
+                       }
+                       else
+                           strcpy(path, "./");
+                       XtSetArg(args[0], XtNlabel, "");
+                       XtSetValues(dirlabel, args, 1);
+                       SwitchDirWindow(True);
+                       DirWindowCB(dirwindow, path, NULL);
+                       ++num_loaded;
+                   }
+                   continue;
+               }
+           }
+
+           switch (file_access = CheckFilePermissions(filename, &exists)) {
+           case NO_READ:
+               if (exists)
+                   XeditPrintf("File %s exists, and could not be opened for "
+                               "reading.\n", argv[i]);
+               else
+                   XeditPrintf("File %s does not exist, and the directory "
+                               "could not be opened for writing.\n", argv[i]);
+               break;
+           case READ_OK:
+               XtSetArg(args[num_args], XtNeditType, XawtextRead); num_args++;
+               XeditPrintf("File %s opened READ ONLY.\n", argv[i]);
+               break;
+           case WRITE_OK:
+               XtSetArg(args[num_args], XtNeditType, XawtextEdit); num_args++;
+               XeditPrintf("File %s opened read - write.\n", argv[i]);
+               break;
+           }
+           if (file_access != NO_READ) {
+               int flags;
+
+               if (exists) {
+                   flags = EXISTS_BIT;
+                   XtSetArg(args[num_args], XtNstring, filename);num_args++;
+               }
+               else {
+                   flags = 0;
+                   XtSetArg(args[num_args], XtNstring, NULL);    num_args++;
+               }
+               source = XtVaCreateWidget("textSource", international ?
+                                         multiSrcObjectClass
+                                         : asciiSrcObjectClass, topwindow,
+                                         XtNtype, XawAsciiFile,
+                                         XtNeditType, XawtextEdit,
+                                         NULL, NULL);
+               XtSetValues(source, args, num_args);
+               item = AddTextSource(source, argv[i], filename,
+                                    flags, file_access);
+               XtAddCallback(item->source, XtNcallback, SourceChanged,
+                             (XtPointer)item);
+               if (exists && file_access == WRITE_OK) {
+                   item->mode = st.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
+                   item->mtime = st.st_mtime;
+               }
+               if (!num_loaded)
+                   SwitchTextSource(item);
+               ++num_loaded;
+               ResetSourceChanged(item);
+           }
+       }
+    }
+
+    if (!flist.pixmap && strlen(app_resources.changed_pixmap_name)) {
+       XrmValue from, to;
+
+       from.size = strlen(app_resources.changed_pixmap_name);
+       from.addr = app_resources.changed_pixmap_name;
+       to.size = sizeof(Pixmap);
+       to.addr = (XtPointer)&(flist.pixmap);
+
+       XtConvertAndStore(flist.popup, XtRString, &from, XtRBitmap, &to);
+    }
+
+    if (num_loaded == 0) {
+       XtSetKeyboardFocus(topwindow, filenamewindow);
+       XtVaSetValues(textwindow, XtNwrap, XawtextWrapLine, NULL);
+    }
+    else {
+       XtSetKeyboardFocus(topwindow, textwindow);
+       if (lineno) {
+           XawTextPosition position;
+
+           source = XawTextGetSource(textwindow);
+           position = RSCAN(XawTextGetInsertionPoint(textwindow),
+                            lineno, False);
+           position = LSCAN(position, 1, False);
+           XawTextSetInsertionPoint(textwindow, position);
+       }
+    }
+
+    XtAppMainLoop(appcon);
+    return EXIT_SUCCESS;
+}
+
+static void
+makeButtonsAndBoxes(Widget parent)
+{
+    Widget outer, b_row, viewport;
+    Arg arglist[10];
+    Cardinal num_args;
+    xedit_flist_item *item;
+    static char *labelWindow = "labelWindow", *editWindow = "editWindow";
+    static char *formWindow = "formWindow", *positionWindow = "positionWindow";
+
+    outer = XtCreateManagedWidget("paned", panedWidgetClass, parent,
+                                 NULL, ZERO);
+    b_row = XtCreateManagedWidget("buttons", panedWidgetClass, outer, NULL, ZERO);
+    {
+       MakeCommandButton(b_row, "quit", DoQuit);
+       MakeCommandButton(b_row, "save", DoSave);
+       MakeCommandButton(b_row, "load", DoLoad);
+#ifdef INCLUDE_XPRINT_SUPPORT
+       MakeCommandButton(b_row, "print", DoPrint);
+#endif /* INCLUDE_XPRINT_SUPPORT */
+       filenamewindow = MakeStringBox(b_row, "filename", NULL);
+    }
+    hintswindow = XtCreateManagedWidget("bc_label", labelWidgetClass,
+                                       outer, NULL, ZERO);
+
+    num_args = 0;
+    XtSetArg(arglist[num_args], XtNeditType, XawtextEdit);             ++num_args;
+    messwidget = XtCreateManagedWidget("messageWindow", asciiTextWidgetClass,
+                                      outer, arglist, num_args);
+
+    num_args = 0;
+    XtSetArg(arglist[num_args], XtNorientation, XtorientHorizontal);   ++num_args;
+    hpane = XtCreateManagedWidget("hpane", panedWidgetClass, outer,
+                                 arglist, num_args);
+
+    num_args = 0;
+    XtSetArg(arglist[num_args], XtNorientation, XtorientVertical);     ++num_args;
+    vpanes[0] = XtCreateManagedWidget("vpane", panedWidgetClass, hpane,
+                                     arglist, num_args);
+    XtSetArg(arglist[num_args], XtNheight, 1);                         ++num_args;
+    XtSetArg(arglist[num_args], XtNwidth, 1);                          ++num_args;
+    vpanes[1] = XtCreateWidget("vpane", panedWidgetClass, hpane,
+                              arglist, num_args);
+
+    forms[0] = XtCreateManagedWidget(formWindow, formWidgetClass,
+                                    vpanes[0], NULL, 0);
+    labelwindow = XtCreateManagedWidget(labelWindow,labelWidgetClass,
+                                       forms[0], NULL, 0);
+    labels[0] = labelwindow;
+    positions[0] = XtCreateManagedWidget(positionWindow,labelWidgetClass,
+                                        forms[0], NULL, 0);
+
+    forms[2] = XtCreateWidget(formWindow, formWidgetClass,
+                             vpanes[1], NULL, 0);
+    labels[2] = XtCreateManagedWidget(labelWindow,labelWidgetClass,
+                                     forms[2], NULL, 0);
+    positions[2] = XtCreateManagedWidget(positionWindow,labelWidgetClass,
+                                        forms[2], NULL, 0);
+
+    num_args = 0;
+    XtSetArg(arglist[num_args], XtNtype, XawAsciiFile);                        ++num_args;
+    XtSetArg(arglist[num_args], XtNeditType, XawtextEdit);             ++num_args;
+    textwindow =  XtCreateManagedWidget(editWindow, asciiTextWidgetClass,
+                                       vpanes[0], arglist, num_args);
+
+#ifdef INCLUDE_XPRINT_SUPPORT
+    international = True;
+#else
+    /* Get international resource value form the textwindow */
+    num_args = 0;
+    XtSetArg(arglist[num_args], XtNinternational, &international);     ++num_args;
+    XtGetValues(textwindow, arglist, num_args);
+#endif
+
+    num_args = 0;
+    XtSetArg(arglist[num_args], XtNtype, XawAsciiFile);                        ++num_args;
+    XtSetArg(arglist[num_args], XtNeditType, XawtextEdit);             ++num_args;
+    scratch = XtVaCreateWidget("textSource", international ?
+                              multiSrcObjectClass :
+                              asciiSrcObjectClass, topwindow,
+                              XtNtype, XawAsciiFile,
+                              XtNeditType, XawtextEdit,
+                              NULL, NULL);
+    XtSetValues(scratch, arglist, num_args);
+
+    num_args = 0;
+    XtSetArg(arglist[num_args], XtNtextSource, scratch);               ++num_args;
+    XtSetValues(textwindow, arglist, num_args);
+
+    texts[0] = textwindow;
+    num_args = 0;
+    XtSetArg(arglist[num_args], XtNtextSource, scratch);               ++num_args;
+    XtSetArg(arglist[num_args], XtNdisplayCaret, False);               ++num_args;
+    texts[2] = XtCreateWidget(editWindow, asciiTextWidgetClass,
+                             vpanes[1], arglist, num_args);
+
+    forms[1] = XtCreateWidget(formWindow, formWidgetClass,
+                             vpanes[0], NULL, 0);
+    labels[1] = XtCreateManagedWidget(labelWindow,labelWidgetClass,
+                                     forms[1], NULL, 0);
+    positions[1] = XtCreateManagedWidget(positionWindow,labelWidgetClass,
+                                        forms[1], NULL, 0);
+
+    texts[1] = XtCreateWidget(editWindow, asciiTextWidgetClass,
+                             vpanes[0], arglist, num_args);
+
+    dirlabel = XtCreateWidget("dirlabel", labelWidgetClass,
+                             vpanes[1], NULL, 0);
+    num_args = 0;
+    XtSetArg(arglist[num_args], XtNheight, 1);                         ++num_args;
+    XtSetArg(arglist[num_args], XtNwidth, 1);                          ++num_args;
+    viewport = XtCreateWidget("viewport", viewportWidgetClass,
+                             vpanes[1], arglist, num_args);
+    dirwindow = XtCreateManagedWidget("dirwindow", listWidgetClass,
+                                     viewport, NULL, 0);
+
+    item = AddTextSource(scratch, "*scratch*", "*scratch*",
+                        0, WRITE_OK);
+    item->wrap = XawtextWrapLine;
+    item->flags |= WRAP_BIT;
+    XtAddCallback(item->source, XtNcallback, SourceChanged,
+                 (XtPointer)item);
+    ResetSourceChanged(item);
+    flist.current = item;
+
+    for (num_args = 0; num_args < 3; num_args++)
+       XtAddCallback(texts[num_args], XtNpositionCallback, PositionChanged, NULL);
+
+    for (num_args = 0; num_args < 3; num_args++) {
+       XtSetArg(arglist[0], XtNwrap, &wrapmodes[num_args]);
+       XtGetValues(texts[num_args], arglist, 1);
+    }
+
+    XtAddCallback(dirwindow, XtNcallback, DirWindowCB, NULL);
+}
+
+/*     Function Name: Feep
+ *     Description: feeps the bell.
+ *     Arguments: none.
+ *     Returns: none.
+ */
+
+void
+Feep(void)
+{
+  XBell(CurDpy, 0);
+}
+
+#define        l_BIT           0x01
+#define        c_BIT           0x02
+#define        p_BIT           0x04
+#define        s_BIT           0x08
+#define MAX_FMT_LEN    30
+
+static void
+StartFormatPosition(void)
+{
+    char *fmt = app_resources.position_format;
+
+    if (fmt)
+       while (*fmt)
+           if (*fmt++ == '%') {
+               int len = 0;
+
+               if (*fmt == '-') {
+                   ++fmt;
+                   ++len;
+               }
+               while (*fmt >= '0' && *fmt <= '9') {
+                   ++fmt;
+                   if (++len >= MAX_FMT_LEN) {
+                       XtAppWarning(XtWidgetToApplicationContext(topwindow),
+                                    "Format too large to formatPosition");
+                       position_format_mask = 0;
+                       return;
+                   }
+               }
+               switch (*fmt++) {
+                   case 'l':   position_format_mask |= l_BIT;  break;
+                   case 'c':   position_format_mask |= c_BIT;  break;
+                   case 'p':   position_format_mask |= p_BIT;  break;
+                   case 's':   position_format_mask |= s_BIT;  break;
+                   case '%':   break;
+                   default: {
+                       char msg[256];
+
+                       XmuSnprintf(msg, sizeof(msg),
+                                   "Unknown format \"%%%c\" in positionFormat",
+                                   fmt[-1]);
+                       XtAppWarning(XtWidgetToApplicationContext(topwindow),
+                                    msg);
+                       position_format_mask = 0;
+                       return;
+                   }
+               }
+           }
+}
+
+/*ARGSUSED*/
+static void
+PositionChanged(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    int idx;
+    XawTextPositionInfo *info = (XawTextPositionInfo*)call_data;
+
+    for (idx = 0; idx < 3; idx++)
+       if (w == texts[idx])
+           break;
+    if (idx > 2)
+       return;
+
+    if (((position_format_mask & l_BIT)
+         && infos[idx].line_number != info->line_number)
+       || ((position_format_mask & c_BIT)
+           && infos[idx].column_number != info->column_number)
+       || ((position_format_mask & p_BIT)
+           && infos[idx].insert_position != info->insert_position)
+       || ((position_format_mask & s_BIT)
+           && infos[idx].last_position != info->last_position)
+       || infos[idx].overwrite_mode != info->overwrite_mode) {
+       int len = 6;
+       Arg args[1];
+       char buffer[256], *str = app_resources.position_format;
+       char fmt_buf[MAX_FMT_LEN + 2], *fmt;
+
+       memcpy(&infos[idx], info, sizeof(XawTextPositionInfo));
+       if (info->overwrite_mode)
+           strcpy(buffer, "Ovrwt ");
+       else
+           strcpy(buffer, "      ");
+       while (*str) {
+           switch (*str) {
+               case '%':
+                   fmt = fmt_buf;
+                   *fmt++ = *str++;
+                   if (*str == '-')
+                       *fmt++ = *str++;
+                   /*CONSTCOND*/
+                   while (*str >= '0' && *str <= '9') {
+                       /* StartPositionFormat() already checked the format
+                        * length.
+                        */
+                       *fmt++ = *str++;
+                   }
+                   *fmt++ = 'd';
+                   *fmt = '\0';
+                   switch (*str) {
+                       case 'l':
+                           XmuSnprintf(&buffer[len], sizeof(buffer) - len,
+                                       fmt_buf, info->line_number);
+                           break;
+                       case 'c':
+                           XmuSnprintf(&buffer[len], sizeof(buffer) - len,
+                                       fmt_buf, info->column_number);
+                           break;
+                       case 'p':
+                           XmuSnprintf(&buffer[len], sizeof(buffer) - len,
+                                       fmt_buf, info->insert_position);
+                           break;
+                       case 's':
+                           XmuSnprintf(&buffer[len], sizeof(buffer) - len,
+                                       fmt_buf, info->last_position);
+                           break;
+                       case '%':
+                           strcpy(&buffer[len], "%");
+                           break;
+                   }
+                   len += strlen(&buffer[len]);
+                   break;
+               default:
+                   buffer[len++] = *str;
+                   break;
+           }
+           if (len >= sizeof(buffer) - 1)
+               break;
+           ++str;
+       }
+       buffer[len] = '\0';
+
+       XtSetArg(args[0], XtNlabel, buffer);
+       XtSetValues(positions[idx], args, 1);
+    }
+}
+
+/*ARGSUSED*/
+static void
+HintsTimer(XtPointer closure, XtIntervalId *id)
+{
+    Arg args[1];
+    xedit_hints *hints = (xedit_hints*)closure;
+
+    hints->cur_hint = rand() % hints->num_hints;
+
+    XtSetArg(args[0], XtNlabel, hints->hints[hints->cur_hint]);
+    XtSetValues(hintswindow, args, 1);
+
+    hints->timer = XtAppAddTimeOut(XtWidgetToApplicationContext(topwindow),
+                                  hints->interval, HintsTimer, closure);
+}
+
+#define MAX_HINT_LEN           255
+#define MIN_HINT_INTERVAL      5
+static void
+StartHints(void)
+{
+    char *str, *p;
+    unsigned i, len;
+    xedit_hints *hints = &(app_resources.hints);
+
+    /* if resource was not set, or was overriden */
+    if (hints->resource == NULL || !*hints->resource)
+       return;
+
+    randomize();
+
+    if (hints->interval < MIN_HINT_INTERVAL)
+       hints->interval = DEF_HINT_INTERVAL;
+    hints->interval *= 1000;
+    hints->hints = (char**)XtMalloc(sizeof(char*));
+    hints->hints[hints->cur_hint = 0] = p = hints->resource;
+    hints->num_hints = 1;
+
+    while ((p = strchr(p, '\n')) != NULL) {
+       if (*++p == '\0')
+           break;
+       hints->hints = (char**)
+           XtRealloc((char*)hints->hints,
+                     sizeof(char*) * (hints->num_hints + 1));
+       hints->hints[hints->num_hints++] = p;
+    }
+
+    /* make a private copy of the resource values, so that one can change
+     * the Xrm database safely.
+     */
+    for (i = 0; i < hints->num_hints; i++) {
+       if ((p = strchr(hints->hints[i], '\n')) != NULL)
+           len = p - hints->hints[i];
+       else
+           len = strlen(hints->hints[i]);
+       if (len > MAX_HINT_LEN)
+           len = MAX_HINT_LEN;
+       str = XtMalloc(len + 1);
+       strncpy(str, hints->hints[i], len);
+       str[len] = '\0';
+       hints->hints[i] = str;
+    }
+
+    hints->timer = XtAppAddTimeOut(XtWidgetToApplicationContext(topwindow),
+                                  hints->interval, HintsTimer,
+                                  (XtPointer)hints);
+}
diff --git a/xedit/xedit.h b/xedit/xedit.h
new file mode 100644 (file)
index 0000000..0abda4c
--- /dev/null
@@ -0,0 +1,204 @@
+/*
+ *     rcs_id[] = "$XConsortium: xedit.h,v 1.19 89/10/07 14:59:46 kit Exp $";
+ */
+/*
+ *                       COPYRIGHT 1987
+ *                DIGITAL EQUIPMENT CORPORATION
+ *                    MAYNARD, MASSACHUSETTS
+ *                     ALL RIGHTS RESERVED.
+ *
+ * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
+ * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
+ * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR
+ * ANY PURPOSE.  IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
+ *
+ * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT RIGHTS,
+ * APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN ADDITION TO THAT
+ * SET FORTH ABOVE.
+ *
+ *
+ * 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 Equipment Corporation not be 
+ * used in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission.
+ */
+/* $XFree86: xc/programs/xedit/xedit.h,v 1.17 2002/10/06 17:11:39 paulo Exp $ */
+
+#include <stdio.h>
+#include <time.h>
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/cursorfont.h>
+#include <X11/Xatom.h>
+
+#include <X11/Xaw/Box.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/List.h>
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Paned.h>
+#include <X11/Xaw/Viewport.h>
+#include <X11/Xaw/Cardinals.h>
+#include <X11/Xaw/SimpleMenu.h>
+
+#include <X11/IntrinsicP.h>
+#include <X11/Xaw/TextSinkP.h>         /* for the property list definition */
+
+#include <X11/Xmu/SysUtil.h>
+
+#define LSCAN(from, count, include)    \
+       XawTextSourceScan(source, from, XawstEOL, XawsdLeft, count, include)
+#define RSCAN(from, count, include)    \
+       XawTextSourceScan(source, from, XawstEOL, XawsdRight, count, include)
+
+typedef struct _xedit_hints {
+    char *resource;
+    unsigned long interval;
+    XtIntervalId timer;
+    char **hints;
+    unsigned num_hints;
+    unsigned cur_hint;
+} xedit_hints;
+
+typedef enum {NO_READ, READ_OK, WRITE_OK} FileAccess;
+
+typedef struct _XeditLispData XeditLispData;
+typedef struct _XeditTagsInfo XeditTagsInfo;
+
+#define CHANGED_BIT    0x01
+#define EXISTS_BIT     0x02
+#define WRAP_BIT       0x10
+typedef struct _xedit_flist_item {
+    Widget source, sme;
+    String name;
+    String filename;
+    int flags;
+    FileAccess file_access;
+    XawTextPosition display_position, insert_position;
+    int mode;
+    time_t mtime;
+    XawTextPropertyList *properties;
+    XawTextWrapMode wrap;
+    XeditLispData *xldata;
+    XeditTagsInfo *tags;
+} xedit_flist_item;
+
+extern struct _xedit_flist {
+    Widget popup;
+    Pixmap pixmap;
+    xedit_flist_item **itens;
+    xedit_flist_item *current, *other;
+    Cardinal num_itens;
+} flist;
+
+extern Widget options_popup;
+
+extern struct _app_resources {
+    Boolean enableBackups;
+    char *backupNamePrefix;
+    char *backupNameSuffix;
+    xedit_hints hints;
+    char *changed_pixmap_name;
+    char *position_format;
+    char *auto_replace;
+    char *tagsName;
+    Boolean loadTags;
+} app_resources;
+
+extern Widget topwindow, textwindow, labelwindow, filenamewindow, messwidget;
+extern Widget dirlabel, dirwindow;
+extern Boolean international;
+extern Boolean line_edit;
+
+/*     externals in xedit.c    */
+void Feep(void);
+
+/*     externals in util.c     */
+void XeditPrintf(const char *format, ...);
+Widget MakeCommandButton(Widget, char*, XtCallbackProc);
+Widget MakeStringBox(Widget, String, String);
+String GetString(Widget);
+FileAccess MaybeCreateFile(char*), CheckFilePermissions(char*, Boolean*);
+xedit_flist_item *AddTextSource(Widget, String, String, int, FileAccess);
+xedit_flist_item *FindTextSource(Widget, char*);
+Bool KillTextSource(xedit_flist_item*);
+char *ResolveName(char*);
+void DeleteWindow(Widget, XEvent*, String*, Cardinal*);
+void SplitWindow(Widget, XEvent*, String*, Cardinal*);
+void SwitchTextSource(xedit_flist_item*);
+void PopupMenu(Widget, XEvent*, String*, Cardinal*);
+void OtherWindow(Widget, XEvent*, String*, Cardinal*);
+void SwitchSource(Widget, XEvent*, String*, Cardinal*);
+void XeditFocus(Widget, XEvent*, String*, Cardinal*);
+void SwitchDirWindow(Bool);
+void DirWindow(Widget, XEvent*, String*, Cardinal*);
+
+/*     externs in commands.c   */
+void DoQuit(Widget, XtPointer, XtPointer);
+void QuitAction(Widget, XEvent*, String*, Cardinal*);
+void DoSave(Widget, XtPointer, XtPointer);
+void SaveFile(Widget, XEvent*, String*, Cardinal*);
+void DoLoad(Widget, XtPointer, XtPointer);
+#ifdef INCLUDE_XPRINT_SUPPORT
+void DoPrint(Widget, XtPointer, XtPointer);
+#endif /* INCLUDE_XPRINT_SUPPORT */
+void CancelFindFile(Widget, XEvent*, String*, Cardinal*);
+void FindFile(Widget, XEvent*, String*, Cardinal*);
+void LoadFile(Widget, XEvent*, String*, Cardinal*);
+Bool LoadFileInTextwindow(char *name, char *resolved_name);
+#ifdef INCLUDE_XPRINT_SUPPORT
+void PrintFile(Widget, XEvent*, String*, Cardinal*);
+#endif /* INCLUDE_XPRINT_SUPPORT */
+void FileCompletion(Widget, XEvent*, String*, Cardinal*);
+void KillFile(Widget, XEvent*, String*, Cardinal*);
+void DirWindowCB(Widget, XtPointer, XtPointer);
+void SourceChanged(Widget, XtPointer, XtPointer);
+
+/*     externs in ispell.c     */
+void IspellAction(Widget, XEvent*, String*, Cardinal*);
+void IspellCallback(Widget, XtPointer, XtPointer);
+
+/*     externs in options.c    */
+void CreateEditPopup(void);
+void SetEditMenu(void);
+void UpdateTextProperties(int);
+
+/*     externs in hook.c       */
+Bool StartHooks(XtAppContext);
+void LineEditAction(Widget, XEvent*, String*, Cardinal*);
+void LineEdit(Widget);
+
+/*     externs in lisp.c       */
+void XeditLispInitialize(void);
+void XeditLispEval(Widget, XEvent*, String*, Cardinal*);
+void XeditPrintLispEval(Widget, XEvent*, String*, Cardinal*);
+void XeditKeyboardReset(Widget, XEvent*, String*, Cardinal*);
+void XeditLispCleanUp(void);
+void SetTextProperties(xedit_flist_item*);
+void UnsetTextProperties(xedit_flist_item*);
+void CreateEditModePopup(Widget);
+void SetEditModeMenu(void);
+
+/* tags.c */
+void TagsAction(Widget, XEvent*, String*, Cardinal*);
+void SearchTagsFile(xedit_flist_item *item);
+
+/*     externs for system replacement functions */
+#ifdef NEED_STRCASECMP
+int strcasecmp(const char *s1, const char *s2);
+int strncasecmp(const char *s1, const char *s2, size_t n);
+#endif
+#ifdef NEED_REALPATH
+#include <sys/param.h>
+#if defined(ISC)
+#ifndef MAXPATHLEN
+#define MAXPATHLEN      1024
+#endif
+#endif
+char *realpath(const char *pathname, char resolvedname[MAXPATHLEN]);
+#endif
+
diff --git a/xedit/xedit.man b/xedit/xedit.man
new file mode 100644 (file)
index 0000000..3491bd1
--- /dev/null
@@ -0,0 +1,451 @@
+.\" $XConsortium: xedit.man,v 1.23 94/04/17 20:43:39 matt Exp $
+.\" 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 CONNECTION 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 dealings in this Software without prior written authorization
+.\" from the X Consortium.
+.\"
+.\" $XFree86: xc/programs/xedit/xedit.man,v 1.18 2002/10/12 16:06:48 herrb Exp $
+.\"
+.TH XEDIT 1 __vendorversion__
+.SH NAME
+xedit \- simple text editor for X
+.SH SYNTAX
+.B xedit
+[
+.I \-toolkitoption
+\&.\|.\|. ] [
+.I filename
+\&.\|.\|. ]
+.SH DESCRIPTION
+.I Xedit
+provides a window consisting of the following four areas:
+.IP "Commands Section" 25
+A set of commands that allow you to exit \fIxedit\fP, save the file, or
+load a new file into the edit window.
+.IP "Message Window" 25
+Displays \fIxedit\fP messages. In addition, this window can be also used as
+a scratch pad. 
+.IP "Filename Display"
+Displays the name of the file currently being edited, and whether this file
+is \fIRead-Write\fP or \fIRead Only\fP.
+.IP "Edit Window" 25
+Displays the text of the file that you are editing or creating.  
+.SH OPTIONS
+.I Xedit
+accepts all of the standard X Toolkit command line
+options (see
+.IR X (__miscmansuffix__)).
+The order of the command line options is not important.
+.TP 8
+.I filename
+Specifies the file(s) that are to be loaded during start-up. This is the
+file which will be edited. If a file is not specified,
+.I xedit
+lets you load files or create new files after it has started up.
+.SH EDITING
+The Athena Text widget is used for the three sections of this
+application that allow text input.  The characters typed will go to
+the Text widget that has the input focus, or the Text widget that the pointer
+cursor is currently over.
+.PP
+
+The following keystroke combinations are defined:
+.sp
+.nf
+.ta 1.0i 3.0i 4.5i
+Ctrl-a Beginning Of Line       Meta-b  Backward Word
+Ctrl-b Backward Character      Meta-f  Forward Word
+Ctrl-d Delete Next Character   Meta-i  Insert File
+Ctrl-e End Of Line     Meta-k  Kill To End Of Paragraph
+Ctrl-f Forward Character       Meta-q  Form Paragraph
+Ctrl-g Keyboard Reset  Meta-v  Previous Page
+Ctrl-h Delete Previous Character       Meta-y  Insert Current Selection
+Ctrl-j Newline And Indent      Meta-z  Scroll One Line Down
+Ctrl-k Kill To End Of Line     Meta-d  Delete Next Word
+Ctrl-l Redraw Display  Meta-D  Kill Word
+Ctrl-m Newline Meta-h  Delete Previous Word
+Ctrl-n Next Line       Meta-H  Backward Kill Word
+Ctrl-o Newline And Backup      Meta-<  Beginning Of File
+Ctrl-p Previous Line   Meta->  End Of File
+Ctrl-r Search/Replace Backward Meta-]  Forward Paragraph
+Ctrl-s Search/Replace Forward  Meta-[  Backward Paragraph
+Ctrl-t Transpose Characters
+Ctrl-u [\fInumber\fP]  Multiply by 4 or \fInumber\fP   Meta-Delete     Delete Previous Word
+Ctrl-v Next Page       Meta-Shift Delete       Kill Previous Word
+Ctrl-w Kill Selection  Meta-Backspace  Delete Previous Word
+Ctrl-y Unkill  Meta-Shift Backspace    Kill Previous Word
+Ctrl-z Scroll One Line Up      Meta-z  Scroll One Line Down
+Ctrl-_ Undo
+Escape Line Edit Mode
+.sp
+In addition, the pointer may be used to cut and paste text:
+.ta .5i 2.0i
+       Button 1 Down   Start Selection
+       Button 1 Motion Adjust Selection
+       Button 1 Up     End Selection (cut)
+
+       Button 2 Down   Insert Current Selection (paste)
+
+       Button 3 Down   Extend Current Selection
+       Button 3 Motion Adjust Selection
+       Button 3 Up     End Selection (cut)
+.fi
+.sp
+
+.SH LINE EDIT MODE
+.I Line edit mode
+enables several shortcut commands for searching and replacing text in a
+xedit buffer.
+.I Line edit mode
+commands have the format:
+.br
+.nf
+
+       [\fIline-number\fP[,\fIline-number\fP]]\fIcommand\fP[\fIparameters\fP]
+
+.fi
+.I Line number
+may be specified as:
+.TP 8
+\&.
+The current text line.
+.TP 8
+$
+The last line of the file.
+.TP 8
+number
+The literal line \fInumber\fP.
+.TP 8
+- or ^
+The previous line. Equivalent to \fI-1\fP.
+.TP 8
+-number or ^number
+The current line minus \fInumber\fP.
+.TP 8
++
+The next line. Equivalent to \fI+1\fP.
+.TP 8
++number
+The current line plus \fInumber\fP.
+.TP 8
+, or %
+From the first to the last line. Equivalent to \fI1,$\fP.
+.TP 8
+;
+From the current to the last line. Equivalent to \fI.,$\fP.
+
+.PP
+.I Command
+may be specified as:
+.TP 8
+s
+Substitute text in the specified lines.
+.TP 8
+/re/
+Search forward for the regular expression pattern \fIre\fP.
+.TP 8
+?re?
+Search backward for the regular expression pattern \fIre\fP.
+
+.PP
+.I Parameters
+may be specified as:
+.TP 8
+/re/
+Works as a parameter to \fIi\fP or as a command.
+.TP 8
+/re/text/
+Search forward for \fIre\fP and substitute by \fItext\fP.
+
+.PP
+.I Options
+may follow or be parameters, known values are:
+.TP 8
+i
+Case insensitive search.
+.TP 8
+g
+\fIGlobal\fP match when replacing text. Unless specified, only the nth,
+that defaults to 1, match will be replaced.
+.TP 8
+c
+\fIConfirm\fP before replacing text.
+.TP 8
+number
+Replace only the occurrence referenced by \fInumber\fP.
+.PP
+
+Commands accept some variations, examples:
+.br
+.nf
+       /pattern/i
+       i/pattern/
+       i/pattern
+.fi
+Search forward for \fIpattern\fP.
+.br
+.nf
+
+       ,sc/pattern/text
+       ,sc/pattern/text/
+       ,s/pattern/text/c
+.fi
+Search the entire buffer and ask confirmation to replace \fIpattern\fP
+with \fItext\fP.
+.br
+.nf
+
+       ,s/pattern/text/number
+.fi
+Replace the match \fInumber\fP in the text line. If not specified,
+defaults to the first occurrence.
+
+.PP
+When searching for text, type <Return> to go to the next match.
+When interactively replacing text, type \fIy\fP or \fIY\fP to accept the
+change, and \fIn\fP or \fIN\fP to ignore it and go to the next match.
+
+.SH COMMANDS
+.IP Quit 8
+Quits the current editing session. If any changes have not been saved,
+.I xedit 
+displays a warning message, allowing the user to save them.
+.IP Save 
+If file backups are enabled (see RESOURCES, below)
+.I xedit
+stores a copy of the
+original, unedited file in <prefix>\fIfile\fP<suffix>,
+then overwrites the \fIfile\fP with the contents of the edit window.  The
+filename is retrieved from the Text widget directly to the right of
+the \fILoad\fP button.
+.IP Load
+Loads the file named in the text widget immediately to the right
+of the this button and displays it in the Edit window.
+.SH RESOURCES
+For \fIxedit\fP the available resources are:
+.TP 8
+.B tagsName (\fPClass\fB TagsName)
+Specifies the name of the tags file to search when loading a new file.
+Default value is \fItags\fP.
+.TP 8
+.B loadTags (\fPClass\fB LoadTags)
+Boolean value to enable or disabling searching for tags files.
+Default is \fITrue\fP.
+.TP 8
+.B enableBackups (\fPClass\fB EnableBackups)
+Specifies that, when edits made to an existing file are saved,
+.I xedit
+is to copy the original version of that file to <prefix>\fIfile\fP<suffix>
+before it saves the changes.  The default value for this resource is
+``on,'' stating that backups should be created.
+.TP 8
+.B backupNamePrefix (\fPClass\fB BackupNamePrefix)
+Specifies a string that is to be prepended to the backup filename.  The
+default is that no string shall be prepended.
+.TP 8
+.B backupNameSuffix (\fPClass\fB BackupNameSuffix)
+Specifies a string that is to be appended to the backup filename.  The
+default is to use ``~'' as the suffix.
+.TP 8
+.B positionFormat (\fPClass\fB Format)
+Specifies a format string used to display the cursor position.  This
+string uses printf(3) like notation, where
+.B %l
+prints the line number,
+.B %c
+prints the column number,
+.B %p
+prints the insert position offset, and
+.B %s
+prints the current file size.  It is also allowed to specify field sizes,
+with the notation
+.B %\-?[0\-9]+
+\&.  The default format string is ``L%l'', which shows the character ``L''
+followed by the line number.
+.TP 8
+.B hints (\fPClass\fB Hints)
+Specifies a list of strings, separated by new lines, that will be
+displayed in the bc_label window.
+.TP 8
+.B hintsInterval (\fPClass \fBInterval)
+Specifies the interval in seconds, which the hint string in the bc_label
+window will be changed.
+.TP 8
+.B changedBitmap (\fPClass \fBBitmap)
+Specifies the name of the Bitmap that will be displayed in the fileMenu, when
+the file being edited is changed.
+.TP 8
+.B autoReplace (\fPClass \fBReplace)
+This resource is useful to automatically correct common misspelling errors, but
+can also be used to create simple macros. The format is
+\fI{non-blanks}{blanks}[{string}]\fP. Fields are separeted by newlines.
+Example of use:
+\"
+.br
+.nf
+nto      not\\n\\
+/macro some long string with \\\\\\n newlines \\\\\\n
+.fi
+\"
+.br
+Will automatically replace the word \fInto\fP by \fInot\fP, and \fI/macro\fP
+by \fIsome long string with
+ newlines
+\fP
+when you type that words.
+.TP 8
+.B ispell.dictionaries (\fPClass \fBispell.Dictionary)
+Specifies a list of dictionary names, separeted by spaces, available to the
+ispell program. The default value is \fI"american americamed+ english"\fP.
+.TP 8
+.B ispell.dictionary (\fPClass \fBispell.Dictionary)
+Specifies the default dictionary to use.
+.TP 8
+.B ispell*<DICTIONARY>.wordChars (\fPClass \fBispell*Chars)
+Specifies a set of characters that can be part of a legal word. The
+\fI<DICTIONARY>\fP field is one of the dictionaries specified in the
+\fIdictionaries\fP resource.
+.TP 8
+.B ispell.ispellCommand (\fPClass \fBispell.CommandLine)
+The path to the ispell program, and possibly, additional arguments. You don't
+need to specify the ``-w'' option, neither the ``-a'' option.
+Refer to the \fIispell\fP(1) manpage for more information on ispell options.
+.TP 8
+.B ispell.formatting (\fPClass \fPispell.TextFormat)
+Specifies which text formatting to use while spell checking the file. The
+available formats are \fItext\fP and \fIhtml\fP.
+.TP 8
+.B ispell*text.skipLines (\fPClass \fBispell*text.Skip)
+Lines starting with one of the characters in this string will not be spell
+checked. This resource is only used in \fItext\fP mode.
+.TP 8
+.B ispell.terseMode (\fPClass \fBispell.Terse)
+When enabled, runs ispell in terse mode, not asking user interaction for words
+generated through compound formation (when using the ispell ``-C'' option), or
+words generated through affix removal. The default value is False.
+.TP 8
+.B ispell.lookCommand (\fPClass \fBispell.CommandLine)
+The path to the program to search for alternate words, and possibly,
+additional arguments. The default program used is \fI/usr/bin/egrep\fP.
+.TP 8
+.B ispell.wordsFile (\fPClass \fBispell.Words)
+The path to the file[s] to search for alternate words. The default file is
+\fI/usr/share/dict/words\fP.
+.TP 8
+.B ispell.guessLabel (\fPClass \fBispell.Status)
+String displayed in the ispell status bar when ispell returns a guess list
+of one or more words. The default value is \fIGuess\fP.
+.TP 8
+.B ispell.missLabel (\fPClass \fBispell.Status)
+String displayed in the ispell status bar when ispell returns a list of one
+or more words to match a misspelled one. The default value is \fIMiss\fP.
+.TP 8
+.B ispell.rootLabel (\fPClass \fBispell.Status)
+String displayed in the ispell status bar when the word is not in the dictionary,
+but it can be formed through a root one. The default value is \fIRoot:\fP, and is
+followed by a space and the root word.
+.TP 8
+.B ispell.noneLabel (\fPClass \fBispell.Status)
+String displayed in the ispell status bar when there is no near misses. The default
+value is \fINone\fP.
+.TP 8
+.B ispell.compoundLabel (\fPClass \fBispell.Status)
+String displayed in the ispell status bar when the word being checked is formed by
+concatenation of two words. The default value is \fICompound\fP.
+.TP 8
+.B ispell.okLabel (\fPClass \fBispell.Status)
+String displayed in the ispell status bar when the checked word is in the dictionary.
+This string is only displayed when using the \fIcheck\fP button in the xedit ispell
+interface. The default value is \fIOk\fP.
+.TP 8
+.B ispell.eofLabel (\fPClass \fBispell.Status)
+The string displayed in the ispell status bar when the end of the file is reached.
+The default value is \fIEnd Of File\fP.
+.TP 8
+.B ispell.repeatLabel (\fPClass \fBispell.Status)
+The string displayed in the ispell status bar when two identical words are found
+together in the file. The default value is \fIRepeat\fP.
+.TP 8
+.B ispell.lookLabel (\fPClass \fBispell.Status)
+The string displayed in the ispell status bar after displaying the results of
+the \fILook\fP command. If no results are found, the value of the
+\fIispell.noneLabel\fP resource is shown.
+.TP 8
+.B ispell.workingLabel (\fPClass \fBispell.Status)
+The string displayed in the ispell status bar while xedit is communicating with
+ispell. The default value is \fI...\fP.
+.SH WIDGETS
+In order to specify resources, it is useful to know the hierarchy of
+the widgets which compose \fIxedit\fR.  In the notation below,
+indentation indicates hierarchical structure.  The widget class name
+is given first, followed by the widget instance name.
+.sp
+.nf
+.ta .5i 1.0i 1.5i 2.0i
+Xedit  xedit
+       Paned  paned
+               Paned  buttons
+                       Command  quit
+                       Command  save
+                       Command  load
+                       Text     filename
+               Label  bc_label
+               Text   messageWindow
+               Label  labelWindow
+               Text   editWindow
+.fi
+.sp
+.SH ENVIRONMENT
+.PP
+.TP 20
+.I DISPLAY
+to get the default host and display number.
+.TP 20
+.I XENVIRONMENT
+to get the name of a resource file that overrides the global resources
+stored in the RESOURCE_MANAGER property.
+.SH FILES
+.TP 20
+.I __apploaddir__/Xedit
+specifies required resources
+.SH "SEE ALSO"
+.IR X (__miscmansuffix__),
+.IR xrdb (1),
+.I "Athena Widget Set"
+.SH RESTRICTIONS
+Xedit is not a replacement to Emacs.
+.SH COPYRIGHT
+Copyright 1988, Digital Equipment Corporation.
+.br
+Copyright 1989, X Consortium
+.br
+Copyright 1998, The XFree86 Project
+.br
+See
+.IR X (__miscmansuffix__)
+for a full statement of rights and permissions.
+.SH AUTHORS
+Chris D. Peterson, MIT X Consortium
+.br
+Paulo Cesar Pereira de Andrade, The XFree86 Project
diff --git a/xeyes/COPYING b/xeyes/COPYING
new file mode 100644 (file)
index 0000000..7f33cbf
--- /dev/null
@@ -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/xeyes/ChangeLog b/xeyes/ChangeLog
new file mode 100644 (file)
index 0000000..d8e40d1
--- /dev/null
@@ -0,0 +1,372 @@
+commit a2c8bc28a57474cda77769292aabe1d9f73839a5
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Fri Dec 18 09:44:32 2009 -0500
+
+    xeyes 1.1.0
+    
+    Signed-off-by: James Cloos <cloos@jhcloos.com>
+
+commit e134d57ac54b77269252b7f73f0e84d08ded5212
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Nov 26 09:19:29 2009 -0500
+
+    Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES
+    
+    Now that the INSTALL file is generated.
+    Allows running make maintainer-clean.
+
+commit 6e387e3329722dc9a09b481dbd15f441f39aa054
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Wed Oct 28 14:08:44 2009 -0400
+
+    INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206
+    
+    Add missing INSTALL file. Use standard GNU file on building tarball
+    README may have been updated
+    Remove AUTHORS file as it is empty and no content available yet.
+    Remove NEWS file as it is empty and no content available yet.
+
+commit 34ddbb1213cc4c061409cf6e3883683f6ed8dc92
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Tue Oct 27 15:07:00 2009 -0400
+
+    Deploy the new XORG_DEFAULT_OPTIONS #24242
+    
+    This macro aggregate a number of existing macros that sets commmon
+    X.Org components configuration options. It shields the configuration file from
+    future changes.
+
+commit d1c05b6bb985c00447b3eef598fc6c9b5a95134b
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Mon Oct 26 22:08:14 2009 -0400
+
+    Makefile.am: ChangeLog not required: EXTRA_DIST or *CLEANFILES #24432
+    
+    ChangeLog filename is known to Automake and requires no further
+    coding in the makefile.
+
+commit 3195a5dc486e6daa2ed9754ffd7d2e12da7906a2
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Oct 22 12:33:51 2009 -0400
+
+    .gitignore: use common defaults with custom section # 24239
+    
+    Using common defaults will reduce errors and maintenance.
+    Only the very small or inexistent custom section need periodic maintenance
+    when the structure of the component changes. Do not edit defaults.
+
+commit 6054c8c98d25752492b57b8ad7fd1d3679d23369
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Wed Oct 21 12:46:56 2009 -0700
+
+    This is not a GNU project, so declare it foreign.
+    
+    On Wed, 2009-10-21 at 13:36 +1000, Peter Hutterer wrote:
+    > On Tue, Oct 20, 2009 at 08:23:55PM -0700, Jeremy Huddleston wrote:
+    > > I noticed an INSTALL file in xlsclients and libXvMC today, and it
+    > > was quite annoying to work around since 'autoreconf -fvi' replaces
+    > > it and git wants to commit it.  Should these files even be in git?
+    > > Can I nuke them for the betterment of humanity and since they get
+    > > created by autoreconf anyways?
+    >
+    > See https://bugs.freedesktop.org/show_bug.cgi?id=24206
+    
+    As an interim measure, replace AM_INIT_AUTOMAKE([dist-bzip2]) with
+    AM_INIT_AUTOMAKE([foreign dist-bzip2]). This will prevent the generation
+    of the INSTALL file. It is also part of the 24206 solution.
+    
+    Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
+
+commit 59a5be39cdbddb070cd4e4758848fd08aa5910a4
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Mon Oct 5 18:07:53 2009 -0400
+
+    Bump version for second beta release.
+    
+    1.0.991 as first beta of 1.1.0.
+    
+    (The first beta was meant to be 1.0.90 rather than 1.0.99.
+    Having gotten that wrong, switch to three-digit release numbers
+    for subsequent betas.)
+
+commit 610889785caf41146505458beccc5e3662c233db
+Author: Dylan Simon <dylan@dylex.net>
+Date:   Sun Oct 4 17:41:30 2009 -0400
+
+    New -distance mapping option
+    
+    Distance mapping makes more efficient use of eye space.
+    
+    Signed-off-by: Dylan Simon <dylan@dylex.net>
+    Signed-off-by: James Cloos <cloos@jhcloos.com>
+
+commit dc0f730a4a49f0e436a0a915955997b07bbf56e0
+Author: Dylan Simon <dylan@dylex.net>
+Date:   Sun Oct 4 17:38:43 2009 -0400
+
+    Cleanup and simplify calculation and drawing
+    
+    By transforming the eyes’s space when calculating where to place the
+    pupils, the code effectively assumed that EYE_HEIGHT == EYE_WIDTH.
+    
+    Make this assumption explicit and remove calculations which
+    are therefore unnecessary.
+    
+    Clean up related code and, consequently, reduced redraw time
+    and tearing.
+    
+    Signed-off-by: Dylan Simon <dylan@dylex.net>
+    Signed-off-by: James Cloos <cloos@jhcloos.com>
+
+commit 7cc3aa8ce30990e12e7b102f61dfcaaf8baa4d16
+Author: Dylan Simon <dylan@dylex.net>
+Date:   Sun Oct 4 17:29:59 2009 -0400
+
+    Fix excessive redraw bug
+    
+    introduced by dbb8401026c421d64a2962e6ac6eb900f6dc141e
+    
+    Signed-off-by: Dylan Simon <dylan@dylex.net>
+    Signed-off-by: James Cloos <cloos@jhcloos.com>
+
+commit 6d9fdcfb076f4c261b071cc5c454c8b9ce560e68
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Sat Oct 3 21:32:48 2009 -0400
+
+    Bump version for beta release.
+    
+    1.0.99 as first beta of 1.1.0.
+    
+    Signed-off-by: James Cloos <cloos@jhcloos.com>
+
+commit 41f604009c3c7b4a3d05311faa649c8152494700
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Sat Oct 3 21:28:35 2009 -0400
+
+    Migrate to xorg macros 1.3 & XORG_DEFAULT_OPTIONS
+    
+    Signed-off-by: James Cloos <cloos@jhcloos.com>
+
+commit fd754c702c789f15ac1c0241e50dbb23aed354fc
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Oct 1 14:53:59 2009 -0700
+
+    Add README with pointers to mailing lists, bugzilla, & git
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 5e825a140f4022b88dd7a1a20a9a01b653f1a95c
+Author: Dylan Simon <dylan@dylex.net>
+Date:   Sun Sep 27 14:44:11 2009 -0400
+
+    Add xrender support
+    
+    Optionally draw all components (except shape) with xrender.
+    Enabled by default.  Xlib rendering can be restored by
+    "configure --without-xrender" or "xeyes +render".
+    
+    Signed-off-by: Dylan Simon <dylan@dylex.net>
+    Signed-off-by: James Cloos <cloos@jhcloos.com>
+
+commit dbb8401026c421d64a2962e6ac6eb900f6dc141e
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Jul 17 19:21:15 2009 +1000
+
+    Split drawing code into multiple functions.
+
+commit 85f1441378b47c01aa68dd1479850c4cd1c8eb72
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Jul 17 18:41:07 2009 +1000
+
+    Remove unused NUM_EYES define.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit e8bd6bcaf2cbe8306cc9a4821e8ea7a54a7e56a2
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Jan 13 17:42:23 2009 -0200
+
+    Ansification and compile warning fixes.
+    
+      This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects
+    make distcheck and all gcc 4.3 and sparse warnings.
+
+commit 7e3208d263050d0ad4502f7d7d7d64d7ec84a4ad
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Thu Nov 27 22:46:26 2008 -0800
+
+    AM_CFLAGS instead of xeyes_CFLAGS to shut automake up
+
+commit 53488fad7ef10ff8c4835bcd497cd3980be38b7a
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Dec 6 16:36:49 2007 -0500
+
+    Replace static ChangeLog with dist-hook to generate from git log
+
+commit ab449267ea2fcae6261e57f42bfb54d2205c470f
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Mon Sep 3 05:50:58 2007 -0400
+
+    Add *~ to .gitignore to skip patch/emacs droppings
+
+commit 07dfa4cb3ff0c9a94bea85db0e571fbb2cfe9161
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Aug 23 19:24:22 2007 -0400
+
+    Rename .cvsignore to .gitignore
+
+commit ecb2095318d7233e8cfa3a58626c31f770be6ee7
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 21 02:29:27 2005 +0000
+
+    Update package version for X11R7 release.
+
+commit 3aae44d6b3c9332f73fbeacb39e9c928a2002164
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Dec 19 16:22:21 2005 +0000
+
+    Stub COPYING files
+
+commit 41b039a4861154d82bdd3e6ea1b6697b16205b93
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:23:44 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+commit bc99738464950416207d43a4a4db970bd0563d56
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 6 22:47:59 2005 +0000
+
+    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit 266b7244e16ec2f82bdfb1bd346951761e0d27e2
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Dec 3 05:48:58 2005 +0000
+
+    Update package version number for X11R7 RC3 release.
+
+commit 4298a74b61a6aa8ac36b2d820e147e44ab0f5e32
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Nov 28 22:01:19 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 69160791a057704e9a83794420d2349ae8bbbe1c
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Mon Nov 21 10:34:38 2005 +0000
+
+    Another pass at .cvsignores for apps.
+
+commit ba6118981be2d3a058a08cd1621113cc8e4a42f8
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Sun Nov 20 22:08:30 2005 +0000
+
+    Add/improve .cvsignore files for apps.
+
+commit 6772ce855c078b40635ad62f47da741c037e05c5
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:47:31 2005 +0000
+
+    Update package version number for RC1 release.
+
+commit 8001fd04f2d893e147b3b21fb4702c54e2919b1d
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Oct 17 23:56:00 2005 +0000
+
+    Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to
+        work better with BSD make
+
+commit 1f61a27ce249d94b4be20db22cb84642a4d8a480
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Fri Oct 14 00:25:23 2005 +0000
+
+    Use sed to fill in variables in man page
+
+commit 79456c023b864e06b3ab3c6c93106772286b10ae
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Aug 1 20:25:07 2005 +0000
+
+    Install man pages to section 1 instead of section m (Patch from Donnie
+        Berkholz)
+
+commit 8119360377d17461578cfb26e07c98df6bbe560d
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Jul 29 21:22:10 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 9da2af8715937921c718733e309471f565614c99
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Jul 28 15:56:50 2005 +0000
+
+    Fix distcheck for remaining apps
+
+commit ae49bb18f5feab2b70e6faae046bb26058421d61
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed Jul 20 19:31:31 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 c903caebf875d510cbd1f720ccc02bd03250d7c6
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Fri Jul 1 18:06:56 2005 +0000
+
+    Xeyes build system
+
+commit 160c9f4f69bb2fd273c6223c7e4c6cda1523757f
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 19:54:25 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+commit 37db892d918e67bb13652d48f76d3da4c67f5d58
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:34:58 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit e1eda60fd5b4634652d0505a13a2516515d8ff88
+Author: Egbert Eich <eich@suse.de>
+Date:   Wed Mar 3 12:12:43 2004 +0000
+
+    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit f8eb90ffc747cd45db069212031e1e41c797d378
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:36:02 2004 +0000
+
+    readding XFree86's cvs IDs
+
+commit cd8a87f77a8ee8b4d29c34cc2066a840964fe3b8
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 09:23:45 2004 +0000
+
+    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit bd6d337e78c95b6cd3d831f6e6ad44afc6595520
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:28:50 2003 +0000
+
+    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit 2d36e110b8dbfa073bd533d7d0c720a4e51339a4
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:49:00 2003 +0000
+
+    XFree86 4.3.0.1
+
+commit dfc0320568e5237fff45b3f7fb6f332d1bf5e9bf
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:49:00 2003 +0000
+
+    Initial revision
diff --git a/xeyes/Eyes.c b/xeyes/Eyes.c
new file mode 100644 (file)
index 0000000..e792445
--- /dev/null
@@ -0,0 +1,643 @@
+/* $XConsortium: Eyes.c,v 1.28 94/04/17 20:45:22 eswu Exp $ */
+/* $XFree86: xc/programs/xeyes/Eyes.c,v 1.3 2001/07/25 15:05:21 dawes Exp $ */
+/*
+
+Copyright (c) 1991  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+
+/*
+ * Eyes.c
+ *
+ * a widget which follows the mouse around
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+# include <X11/Xos.h>
+# include <stdio.h>
+# include <X11/IntrinsicP.h>
+# include <X11/StringDefs.h>
+# include <X11/Xmu/Converters.h>
+# include "EyesP.h"
+# include <math.h>
+# include <X11/extensions/shape.h>
+# include <X11/Xlibint.h>
+# include <stdlib.h>
+
+#if (defined(SVR4) || defined(SYSV) && defined(i386))
+extern double hypot(double, double);
+#endif
+
+#define offset(field) XtOffsetOf(EyesRec, eyes.field)
+#define goffset(field) XtOffsetOf(WidgetRec, core.field)
+
+static XtResource resources[] = {
+    {XtNwidth, XtCWidth, XtRDimension, sizeof(Dimension),
+       goffset(width), XtRImmediate, (XtPointer) 150},
+    {XtNheight, XtCHeight, XtRDimension, sizeof(Dimension),
+       goffset(height), XtRImmediate, (XtPointer) 100},
+    {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
+        offset(pixel[PART_PUPIL]), XtRString, XtDefaultForeground},
+    {XtNoutline, XtCForeground, XtRPixel, sizeof(Pixel),
+        offset(pixel[PART_OUTLINE]), XtRString, XtDefaultForeground},
+    {XtNcenterColor, XtCBackground, XtRPixel, sizeof (Pixel),
+       offset(pixel[PART_CENTER]), XtRString, XtDefaultBackground},
+    {XtNreverseVideo, XtCReverseVideo, XtRBoolean, sizeof (Boolean),
+       offset (reverse_video), XtRImmediate, (XtPointer) FALSE},
+    {XtNbackingStore, XtCBackingStore, XtRBackingStore, sizeof (int),
+       offset (backing_store), XtRString, "default"},
+    {XtNshapeWindow, XtCShapeWindow, XtRBoolean, sizeof (Boolean),
+       offset (shape_window), XtRImmediate, (XtPointer) TRUE},
+#ifdef XRENDER
+    {XtNrender, XtCBoolean, XtRBoolean, sizeof(Boolean),
+       offset(render), XtRImmediate, (XtPointer) TRUE },
+#endif
+    {XtNdistance, XtCBoolean, XtRBoolean, sizeof(Boolean),
+       offset(distance), XtRImmediate, (XtPointer) FALSE },
+};
+
+#undef offset
+#undef goffset
+
+# define EYE_X(n)      ((n) * 2.0)
+# define EYE_Y(n)      (0.0)
+# define EYE_OFFSET    (0.1)   /* padding between eyes */
+# define EYE_THICK     (0.175) /* thickness of eye rim */
+# define BALL_DIAM     (0.3)
+# define BALL_PAD      (0.175)
+# define EYE_DIAM      (2.0 - (EYE_THICK + EYE_OFFSET) * 2)
+# define BALL_DIST     ((EYE_DIAM - BALL_DIAM) / 2.0 - BALL_PAD)
+# define W_MIN_X       (-1.0 + EYE_OFFSET)
+# define W_MAX_X       (3.0 - EYE_OFFSET)
+# define W_MIN_Y       (-1.0 + EYE_OFFSET)
+# define W_MAX_Y       (1.0 - EYE_OFFSET)
+
+# define TPOINT_NONE   (-1000) /* special value meaning "not yet set" */
+# define TPointEqual(a, b)  ((a).x == (b).x && (a).y == (b).y)
+# define XPointEqual(a, b)  ((a).x == (b).x && (a).y == (b).y)
+# define AngleBetween(A, A0, A1) (A0 <= A1 ? A0 <= A && A <= A1 : \
+                                            A0 <= A || A <= A1)
+
+static int delays[] = { 50, 100, 200, 400, 0 };
+
+static void ClassInitialize(void)
+{
+    XtAddConverter( XtRString, XtRBackingStore, XmuCvtStringToBackingStore,
+                   NULL, 0 );
+}
+
+WidgetClass eyesWidgetClass = (WidgetClass) &eyesClassRec;
+
+/* ARGSUSED */
+static void Initialize (
+    Widget greq,
+    Widget gnew,
+    ArgList args,
+    Cardinal *num_args)
+{
+    EyesWidget w = (EyesWidget)gnew;
+    XtGCMask   valuemask;
+    XGCValues  myXGCV;
+    int shape_event_base, shape_error_base;
+#ifdef XRENDER
+    enum EyesPart i;
+#endif
+
+    /*
+     * set the colors if reverse video; these are the colors used:
+     *
+     *     background - paper          white
+     *     foreground - text, ticks    black
+     *     border - border             black (foreground)
+     *
+     * This doesn't completely work since the parent has already made up a
+     * border.  Sigh.
+     */
+    if (w->eyes.reverse_video) {
+       Pixel fg = w->eyes.pixel[PART_PUPIL];
+       Pixel bg = w->core.background_pixel;
+
+       if (w->core.border_pixel == fg)
+           w->core.border_pixel = bg;
+       if (w->eyes.pixel[PART_OUTLINE] == fg)
+           w->eyes.pixel[PART_OUTLINE] = bg;
+       if (w->eyes.pixel[PART_CENTER] == bg)
+           w->eyes.pixel[PART_CENTER] = fg;
+       w->eyes.pixel[PART_PUPIL] = bg;
+       w->core.background_pixel = fg;
+    }
+
+    myXGCV.foreground = w->eyes.pixel[PART_PUPIL];
+    myXGCV.background = w->core.background_pixel;
+    valuemask = GCForeground | GCBackground;
+    w->eyes.gc[PART_PUPIL] = XtGetGC(gnew, valuemask, &myXGCV);
+
+    myXGCV.foreground = w->eyes.pixel[PART_OUTLINE];
+    valuemask = GCForeground | GCBackground;
+    w->eyes.gc[PART_OUTLINE] = XtGetGC(gnew, valuemask, &myXGCV);
+
+    myXGCV.foreground = w->eyes.pixel[PART_CENTER];
+    myXGCV.background = w->eyes.pixel[PART_PUPIL];
+    valuemask = GCForeground | GCBackground;
+    w->eyes.gc[PART_CENTER] = XtGetGC(gnew, valuemask, &myXGCV);
+
+    w->eyes.update = 0;
+    /* wait for Realize to add the timeout */
+    w->eyes.interval_id = 0;
+
+    w->eyes.pupil[0].x = w->eyes.pupil[1].x = TPOINT_NONE;
+    w->eyes.pupil[0].y = w->eyes.pupil[1].y = TPOINT_NONE;
+
+    w->eyes.mouse.x = w->eyes.mouse.y = TPOINT_NONE;
+
+    if (w->eyes.shape_window && !XShapeQueryExtension (XtDisplay (w),
+                                                      &shape_event_base,
+                                                      &shape_error_base))
+       w->eyes.shape_window = False;
+    w->eyes.shape_mask = 0;
+    w->eyes.gc[PART_SHAPE] = NULL;
+
+#ifdef XRENDER
+    for (i = 0; i < PART_SHAPE; i ++) {
+       XColor c;
+       XRenderColor rc;
+
+       c.pixel = w->eyes.pixel[i];
+       XQueryColor(XtDisplay (w), w->core.colormap, &c);
+
+       rc.red = c.red;
+       rc.green = c.green;
+       rc.blue = c.blue;
+       rc.alpha = -1;
+       w->eyes.fill[i] = XRenderCreateSolidFill(XtDisplay (w), &rc);
+    }
+#endif
+}
+
+static void
+drawEllipse(EyesWidget w, enum EyesPart part,
+           double centerx, double centery,
+           double oldx, double oldy,
+           double diam)
+{
+    const TRectangle tpos = {
+       centerx - diam/2.0,
+       centery - diam/2.0,
+       diam, diam };
+    TRectangle pos;
+    Trectangle(&w->eyes.t, &tpos, &pos);
+
+    if (part == PART_CLEAR) {
+       XFillRectangle(XtDisplay(w), XtWindow(w),
+                      w->eyes.gc[PART_CENTER],
+                      (int)pos.x, (int)pos.y,
+                      (int)pos.width+2, (int)pos.height+2);
+       return;
+    }
+#ifdef XRENDER
+    if (w->eyes.render && part != PART_SHAPE && (!w->eyes.shape_window ||
+                                                part != PART_OUTLINE) &&
+       w->eyes.picture) {
+       int n, i;
+       double hd, c, s, sx, sy, x, y, px, py;
+       XPointDouble *p;
+
+       pos.x = pos.x + pos.width/2.0;
+       pos.y = pos.y + pos.height/2.0;
+
+       /* determine number of segments to draw */
+       hd = hypot(pos.width, pos.height)/2;
+       n = (M_PI / acos(hd/(hd+1.0))) + 0.5;
+       if (n < 2) n = 2;
+
+       c = cos(M_PI/n);
+       s = sin(M_PI/n);
+       sx = -(pos.width*s)/pos.height;
+       sy = (pos.height*s)/pos.width;
+
+       n *= 2;
+       p = Xmalloc(sizeof(*p)*n);
+       if (!p)
+           return;
+       x = 0;
+       y = pos.height/2.0;
+       for (i = 0; i < n; i ++)
+       {
+           p[i].x = x + pos.x;
+           p[i].y = y + pos.y;
+           px = x;
+           py = y;
+           x = c*px + sx*py;
+           y = c*py + sy*px;
+       }
+
+       if (oldx != TPOINT_NONE || oldy != TPOINT_NONE)
+           drawEllipse(w, PART_CLEAR, oldx, oldy,
+                       TPOINT_NONE, TPOINT_NONE, diam);
+
+       XRenderCompositeDoublePoly(XtDisplay(w), PictOpOver,
+                                  w->eyes.fill[part], w->eyes.picture,
+                                  XRenderFindStandardFormat(XtDisplay(w),
+                                                            PictStandardA8),
+                                  0, 0, 0, 0, p, n, 0);
+
+       Xfree(p);
+       return;
+    }
+#endif
+    if (oldx != TPOINT_NONE || oldy != TPOINT_NONE)
+       drawEllipse(w, PART_CLEAR, oldx, oldy,
+                   TPOINT_NONE, TPOINT_NONE, diam);
+
+    XFillArc(XtDisplay(w),
+            part == PART_SHAPE ? w->eyes.shape_mask : XtWindow(w),
+            w->eyes.gc[part],
+            (int)(pos.x + 0.5), (int)(pos.y + 0.5),
+            (int)(pos.width + 0.0), (int)(pos.height + 0.0),
+            90*64, 360*64);
+}
+
+
+static void
+eyeLiner(EyesWidget    w,
+        Boolean        draw,
+        int            num)
+{
+    drawEllipse(w, draw ? PART_OUTLINE : PART_SHAPE,
+               EYE_X(num), EYE_Y(num),
+               TPOINT_NONE, TPOINT_NONE,
+               EYE_DIAM + 2.0*EYE_THICK);
+    if (draw) {
+       drawEllipse(w, PART_CENTER, EYE_X(num), EYE_Y(num),
+                   TPOINT_NONE, TPOINT_NONE,
+                   EYE_DIAM);
+    }
+}
+
+static TPoint computePupil (
+    int                num,
+    TPoint     mouse,
+    const TRectangle *screen)
+{
+       double  cx, cy;
+       double  dist;
+       double  angle;
+       double  dx, dy;
+       double  cosa, sina;
+       TPoint  ret;
+
+       cx = EYE_X(num); dx = mouse.x - cx;
+       cy = EYE_Y(num); dy = mouse.y - cy;
+       if (dx == 0 && dy == 0);
+       else {
+               angle = atan2 ((double) dy, (double) dx);
+               cosa = cos (angle);
+               sina = sin (angle);
+               dist = BALL_DIST;
+               if (screen)
+               {
+                   /* use distance mapping */
+                   double x0, y0, x1, y1;
+                   double a[4];
+                   x0 = screen->x - cx;
+                   y0 = screen->y - cy;
+                   x1 = x0 + screen->width;
+                   y1 = y0 + screen->height;
+                   a[0] = atan2(y0, x0);
+                   a[1] = atan2(y1, x0);
+                   a[2] = atan2(y1, x1);
+                   a[3] = atan2(y0, x1);
+                   if (AngleBetween(angle, a[0], a[1]))
+                   {
+                       /* left */
+                       dist *= dx / x0;
+                   }
+                   else if (AngleBetween(angle, a[1], a[2]))
+                   {
+                       /* bottom */
+                       dist *= dy / y1;
+                   }
+                   else if (AngleBetween(angle, a[2], a[3]))
+                   {
+                       /* right */
+                       dist *= dx / x1;
+                   }
+                   else if (AngleBetween(angle, a[3], a[0]))
+                   {
+                       /* top */
+                       dist *= dy / y0;
+                   }
+                   if (dist > BALL_DIST)
+                       dist = BALL_DIST;
+               }
+               if (dist > hypot ((double) dx, (double) dy)) {
+                       cx += dx;
+                       cy += dy;
+               } else {
+                       cx += dist * cosa;
+                       cy += dist * sina;
+               }
+       }
+       ret.x = cx;
+       ret.y = cy;
+       return ret;
+}
+
+static void computePupils (
+    EyesWidget w,
+    TPoint     mouse,
+    TPoint     pupils[2])
+{
+    TRectangle screen, *sp = NULL;
+    if (w->eyes.distance) {
+       Window r, cw;
+       int x, y;
+       r = RootWindowOfScreen(w->core.screen);
+       XTranslateCoordinates(XtDisplay(w), XtWindow(w), r, 0, 0, &x, &y, &cw);
+       screen.x = Tx(-x, -y, &w->eyes.t);
+       screen.y = Ty(-x, -y, &w->eyes.t);
+       screen.width  = Twidth (w->core.screen->width, w->core.screen->height,
+                               &w->eyes.t);
+       screen.height = Theight(w->core.screen->width, w->core.screen->height,
+                               &w->eyes.t);
+       sp = &screen;
+    }
+    pupils[0] = computePupil (0, mouse, sp);
+    pupils[1] = computePupil (1, mouse, sp);
+}
+
+static void
+eyeBall(EyesWidget     w,
+       Boolean draw,
+       TPoint  *old,
+       int     num)
+{
+    drawEllipse(w, draw ? PART_PUPIL : PART_CLEAR,
+               w->eyes.pupil[num].x, w->eyes.pupil[num].y,
+               old ? old->x : TPOINT_NONE, old ? old->y : TPOINT_NONE,
+               BALL_DIAM);
+}
+
+static void repaint_window (EyesWidget w)
+{
+       if (XtIsRealized ((Widget) w)) {
+               eyeLiner (w, TRUE, 0);
+               eyeLiner (w, TRUE, 1);
+               computePupils (w, w->eyes.mouse, w->eyes.pupil);
+               eyeBall (w, TRUE, NULL, 0);
+               eyeBall (w, TRUE, NULL, 1);
+       }
+}
+
+static void
+drawEye(EyesWidget w, TPoint newpupil, int num)
+{
+    XPoint             xnewpupil, xpupil;
+
+    xpupil.x = Xx(w->eyes.pupil[num].x, w->eyes.pupil[num].y, &w->eyes.t);
+    xpupil.y = Xy(w->eyes.pupil[num].x, w->eyes.pupil[num].y, &w->eyes.t);
+    xnewpupil.x = Xx(newpupil.x, newpupil.y, &w->eyes.t);
+    xnewpupil.y = Xy(newpupil.x, newpupil.y, &w->eyes.t);
+    if (
+#ifdef XRENDER
+       w->eyes.picture ? !TPointEqual(w->eyes.pupil[num], newpupil) :
+#endif
+       !XPointEqual(xpupil, xnewpupil)) {
+       TPoint oldpupil = w->eyes.pupil[num];
+       w->eyes.pupil[num] = newpupil;
+       eyeBall (w, TRUE, &oldpupil, num);
+    }
+}
+
+static void
+drawEyes(EyesWidget w, TPoint mouse)
+{
+    TPoint             newpupil[2];
+    int                        num;
+
+    if (TPointEqual (mouse, w->eyes.mouse)) {
+       if (delays[w->eyes.update + 1] != 0)
+           ++w->eyes.update;
+       return;
+    }
+    computePupils (w, mouse, newpupil);
+    for (num = 0; num < 2; num ++) {
+       drawEye(w, newpupil[num], num);
+    }
+
+    w->eyes.mouse = mouse;
+    w->eyes.update = 0;
+}
+
+static void draw_it_core(EyesWidget w)
+{
+    Window             rep_root, rep_child;
+    int                        rep_rootx, rep_rooty;
+    unsigned int       rep_mask;
+    int                        dx, dy;
+    TPoint             mouse;
+    Display            *dpy = XtDisplay (w);
+    Window             win = XtWindow (w);
+
+    XQueryPointer (dpy, win, &rep_root, &rep_child,
+           &rep_rootx, &rep_rooty, &dx, &dy, &rep_mask);
+    mouse.x = Tx(dx, dy, &w->eyes.t);
+    mouse.y = Ty(dx, dy, &w->eyes.t);
+
+    drawEyes(w, mouse);
+}
+
+/* ARGSUSED */
+static void draw_it (
+     XtPointer client_data,
+     XtIntervalId *id)         /* unused */
+{
+        EyesWidget     w = (EyesWidget)client_data;
+
+       if (XtIsRealized((Widget)w)) {
+               draw_it_core(w);
+       }
+       w->eyes.interval_id =
+               XtAppAddTimeOut(XtWidgetToApplicationContext((Widget) w),
+                               delays[w->eyes.update], draw_it, (XtPointer)w);
+} /* draw_it */
+
+static void Resize (Widget gw)
+{
+    EyesWidget w = (EyesWidget) gw;
+    XGCValues  xgcv;
+    Widget     parent;
+    Display    *dpy = XtDisplay (w);
+    int                x, y;
+
+    if (XtIsRealized (gw))
+    {
+       XClearWindow (dpy, XtWindow (w));
+       SetTransform (&w->eyes.t,
+                       0, w->core.width,
+                       w->core.height, 0,
+                       W_MIN_X, W_MAX_X,
+                       W_MIN_Y, W_MAX_Y);
+#ifdef XRENDER
+       if (w->eyes.picture) {
+           XRenderFreePicture(dpy, w->eyes.picture);
+           w->eyes.picture = 0;
+       }
+#endif
+       if (w->eyes.shape_window) {
+           w->eyes.shape_mask = XCreatePixmap (dpy, XtWindow (w),
+                   w->core.width, w->core.height, 1);
+           if (!w->eyes.gc[PART_SHAPE])
+               w->eyes.gc[PART_SHAPE] = XCreateGC (dpy, w->eyes.shape_mask,
+                                                   0, &xgcv);
+           XSetForeground (dpy, w->eyes.gc[PART_SHAPE], 0);
+           XFillRectangle (dpy, w->eyes.shape_mask, w->eyes.gc[PART_SHAPE],
+                           0, 0, w->core.width, w->core.height);
+           XSetForeground (dpy, w->eyes.gc[PART_SHAPE], 1);
+           eyeLiner (w, FALSE, 0);
+           eyeLiner (w, FALSE, 1);
+           x = y = 0;
+           for (parent = (Widget) w; XtParent (parent); parent = XtParent (parent)) {
+               x += parent->core.x + parent->core.border_width;
+               x += parent->core.y + parent->core.border_width;
+           }
+           XShapeCombineMask (XtDisplay (parent), XtWindow (parent), ShapeBounding,
+                              x, y, w->eyes.shape_mask, ShapeSet);
+           XFreePixmap (dpy, w->eyes.shape_mask);
+       }
+#ifdef XRENDER
+       if (w->eyes.render) {
+           XRenderPictureAttributes pa;
+           XRenderPictFormat *pf;
+           pf = XRenderFindVisualFormat(dpy,
+                                        DefaultVisualOfScreen(w->core.screen));
+           if (pf)
+               w->eyes.picture = XRenderCreatePicture(dpy, XtWindow (w),
+                                                      pf, 0, &pa);
+       }
+#endif
+    }
+}
+
+static void Realize (
+     Widget gw,
+     XtValueMask *valueMask,
+     XSetWindowAttributes *attrs)
+{
+    EyesWidget w = (EyesWidget)gw;
+
+    if (w->eyes.backing_store != Always + WhenMapped + NotUseful) {
+       attrs->backing_store = w->eyes.backing_store;
+       *valueMask |= CWBackingStore;
+    }
+    XtCreateWindow( gw, (unsigned)InputOutput, (Visual *)CopyFromParent,
+                    *valueMask, attrs );
+    Resize (gw);
+    w->eyes.interval_id =
+       XtAppAddTimeOut(XtWidgetToApplicationContext(gw),
+                       delays[w->eyes.update], draw_it, (XtPointer)gw);
+}
+
+static void Destroy (Widget gw)
+{
+     EyesWidget w = (EyesWidget)gw;
+     int i;
+
+     if (w->eyes.interval_id)
+       XtRemoveTimeOut (w->eyes.interval_id);
+     for (i = 0; i < PART_MAX; i ++)
+            XtReleaseGC(gw, w->eyes.gc[i]);
+#ifdef XRENDER
+     if (w->eyes.picture)
+            XRenderFreePicture (XtDisplay(w), w->eyes.picture);
+#endif
+}
+
+/* ARGSUSED */
+static void Redisplay(
+     Widget gw,
+     XEvent *event,
+     Region region)
+{
+    EyesWidget w;
+
+    w = (EyesWidget) gw;
+    w->eyes.pupil[0].x = TPOINT_NONE;
+    w->eyes.pupil[0].y = TPOINT_NONE;
+    w->eyes.pupil[1].x = TPOINT_NONE;
+    w->eyes.pupil[1].y = TPOINT_NONE;
+    (void) repaint_window ((EyesWidget)gw);
+}
+
+/* ARGSUSED */
+static Boolean SetValues (
+    Widget current,
+    Widget request,
+    Widget new,
+    ArgList args,
+    Cardinal *num_args)
+{
+    return( FALSE );
+}
+
+EyesClassRec eyesClassRec = {
+    { /* core fields */
+    /* superclass              */      &widgetClassRec,
+    /* class_name              */      "Eyes",
+    /* size                    */      sizeof(EyesRec),
+    /* class_initialize                */      ClassInitialize,
+    /* class_part_initialize   */      NULL,
+    /* class_inited            */      FALSE,
+    /* initialize              */      Initialize,
+    /* initialize_hook         */      NULL,
+    /* realize                 */      Realize,
+    /* actions                 */      NULL,
+    /* num_actions             */      0,
+    /* resources               */      resources,
+    /* num_resources           */      XtNumber(resources),
+    /* xrm_class               */      NULLQUARK,
+    /* compress_motion         */      TRUE,
+    /* compress_exposure       */      TRUE,
+    /* compress_enterleave     */      TRUE,
+    /* visible_interest                */      FALSE,
+    /* destroy                 */      Destroy,
+    /* resize                  */      Resize,
+    /* expose                  */      Redisplay,
+    /* set_values              */      SetValues,
+    /* set_values_hook         */      NULL,
+    /* set_values_almost       */      NULL,
+    /* get_values_hook         */      NULL,
+    /* accept_focus            */      NULL,
+    /* version                 */      XtVersion,
+    /* callback_private                */      NULL,
+    /* tm_table                        */      NULL,
+    /* query_geometry          */      XtInheritQueryGeometry,
+    }
+};
diff --git a/xeyes/Eyes.h b/xeyes/Eyes.h
new file mode 100644 (file)
index 0000000..424967b
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+* $XConsortium: Eyes.h,v 1.7 90/12/01 13:04:51 rws Exp $
+*/
+
+#ifndef _XtEyes_h
+#define _XtEyes_h
+
+/***********************************************************************
+ *
+ * Eyes Widget
+ *
+ ***********************************************************************/
+
+/* Parameters:
+
+ Name               Class              RepType         Default Value
+ ----               -----              -------         -------------
+ background         Background         pixel           White
+ border                     BorderColor        pixel           Black
+ borderWidth        BorderWidth        int             1
+ foreground         Foreground         Pixel           Black
+ outline            Outline            Pixel           Black
+ height                     Height             int             120
+ mappedWhenManaged   MappedWhenManaged Boolean         True
+ reverseVideo       ReverseVideo       Boolean         False
+ width              Width              int             120
+ x                  Position           int             0
+ y                  Position           int             0
+
+*/
+
+#define XtNoutline     "outline"
+#define XtNcenterColor "center"
+
+#define XtNshapeWindow "shapeWindow"
+#define XtCShapeWindow "ShapeWindow"
+
+#define XtNrender      "render"
+#define XtNdistance    "distance"
+
+enum EyesPart {
+       PART_CLEAR = -1,
+
+       PART_OUTLINE,
+       PART_CENTER,
+       PART_PUPIL,
+
+       PART_SHAPE,
+       PART_MAX
+};
+
+typedef struct _EyesRec *EyesWidget;  /* completely defined in EyesPrivate.h */
+typedef struct _EyesClassRec *EyesWidgetClass;    /* completely defined in EyesPrivate.h */
+
+extern WidgetClass eyesWidgetClass;
+
+#endif /* _XtEyes_h */
+/* DON'T ADD STUFF AFTER THIS #endif */
diff --git a/xeyes/EyesP.h b/xeyes/EyesP.h
new file mode 100644 (file)
index 0000000..3a04b13
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+* $XConsortium: EyesP.h,v 1.9 90/12/01 13:04:43 rws Exp $
+*/
+
+#ifndef _EyesP_h
+#define _EyesP_h
+
+#include "Eyes.h"
+#include <X11/CoreP.h>
+#ifdef XRENDER
+#include <X11/extensions/Xrender.h>
+#endif
+#include "transform.h"
+
+#define SEG_BUFF_SIZE          128
+
+/* New fields for the eyes widget instance record */
+typedef struct {
+        Pixel          pixel[PART_SHAPE];
+        GC             gc[PART_MAX];
+/* start of graph stuff */
+        int            backing_store;  /* backing store variety */
+        Boolean        reverse_video;  /* swap fg and bg pixels */
+        Boolean        shape_window;   /* use SetWindowShapeMask */
+        int            update;         /* current timeout index */
+        TPoint         mouse;          /* old mouse position */
+        TPoint         pupil[2];       /* pupil position */
+        Transform      t;
+        Transform      maskt;
+        XtIntervalId   interval_id;
+        Pixmap         shape_mask;     /* window shape */
+#ifdef XRENDER
+        Boolean        render;
+        Picture        picture;
+        Picture        fill[PART_SHAPE];
+#endif
+        Boolean        distance;
+   } EyesPart;
+
+/* Full instance record declaration */
+typedef struct _EyesRec {
+   CorePart core;
+   EyesPart eyes;
+   } EyesRec;
+
+/* New fields for the Eyes widget class record */
+typedef struct {int dummy;} EyesClassPart;
+
+/* Full class record declaration. */
+typedef struct _EyesClassRec {
+   CoreClassPart core_class;
+   EyesClassPart eyes_class;
+   } EyesClassRec;
+
+/* Class pointer. */
+extern EyesClassRec eyesClassRec;
+
+#endif /* _EyesP_h */
diff --git a/xeyes/INSTALL b/xeyes/INSTALL
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xeyes/Makefile.am b/xeyes/Makefile.am
new file mode 100644 (file)
index 0000000..cffa4ef
--- /dev/null
@@ -0,0 +1,81 @@
+# 
+#  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 = xeyes
+
+AM_CFLAGS = $(XEYES_CFLAGS)
+xeyes_LDADD = $(XEYES_LIBS) -lm
+
+xeyes_SOURCES =        \
+        Eyes.c \
+        Eyes.h \
+        EyesP.h \
+        transform.c \
+        transform.h \
+        xeyes.c
+
+appman_PRE = \
+        xeyes.man
+
+EXTRA_DIST = eyes.bit eyesmask.bit
+
+appmandir = $(APP_MAN_DIR)
+
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+
+EXTRA_DIST += $(appman_PRE)
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+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):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/xeyes/Makefile.in b/xeyes/Makefile.in
new file mode 100644 (file)
index 0000000..673d50d
--- /dev/null
@@ -0,0 +1,775 @@
+# Makefile.in generated by automake 1.11 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = xeyes$(EXEEXT)
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+       $(top_srcdir)/configure COPYING ChangeLog INSTALL config.guess \
+       config.sub depcomp install-sh missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_xeyes_OBJECTS = Eyes.$(OBJEXT) transform.$(OBJEXT) xeyes.$(OBJEXT)
+xeyes_OBJECTS = $(am_xeyes_OBJECTS)
+am__DEPENDENCIES_1 =
+xeyes_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(xeyes_SOURCES)
+DIST_SOURCES = $(xeyes_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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+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@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+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@
+CHANGELOG_CMD = @CHANGELOG_CMD@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
+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@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_CMD = @INSTALL_CMD@
+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@
+MAKEINFO = @MAKEINFO@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+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@
+XEYES_CFLAGS = @XEYES_CFLAGS@
+XEYES_LIBS = @XEYES_LIBS@
+XRENDER_CFLAGS = @XRENDER_CFLAGS@
+XRENDER_LIBS = @XRENDER_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__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@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CFLAGS = $(XEYES_CFLAGS)
+xeyes_LDADD = $(XEYES_LIBS) -lm
+xeyes_SOURCES = \
+        Eyes.c \
+        Eyes.h \
+        EyesP.h \
+        transform.c \
+        transform.h \
+        xeyes.c
+
+appman_PRE = \
+        xeyes.man
+
+EXTRA_DIST = eyes.bit eyesmask.bit $(appman_PRE)
+appmandir = $(APP_MAN_DIR)
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+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) --foreign'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign 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)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+       @if test ! -f $@; then \
+         rm -f stamp-h1; \
+         $(MAKE) $(AM_MAKEFLAGS) 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) 
+       ($(am__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)'; test -n "$(bindir)" || list=; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p; \
+         then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+xeyes$(EXEEXT): $(xeyes_OBJECTS) $(xeyes_DEPENDENCIES) 
+       @rm -f xeyes$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(xeyes_OBJECTS) $(xeyes_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Eyes.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transform.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xeyes.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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) '$<'`
+install-appmanDATA: $(appman_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)"
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \
+       done
+
+uninstall-appmanDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appmandir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appmandir)" && rm -f $$files
+
+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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       set x; \
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       $(am__remove_distdir)
+       test -d "$(distdir)" || mkdir "$(distdir)"
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$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
+       -test -n "$(am__skip_mode_fix)" \
+       || 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 $(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-lzma: distdir
+       tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+       $(am__remove_distdir)
+
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+       $(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.lzma*) \
+         unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(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)
+       test -d $(distdir)/_build || exit 0; \
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && am__cwd=`pwd` \
+         && $(am__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 \
+         && cd "$$am__cwd" \
+         || exit 1
+       $(am__remove_distdir)
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+       @$(am__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)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-appmanDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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
+
+.MAKE: all install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+       clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
+       dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \
+       dist-zip distcheck distclean distclean-compile \
+       distclean-generic distclean-hdr distclean-tags distcleancheck \
+       distdir distuninstallcheck dvi dvi-am html html-am info \
+       info-am install install-am install-appmanDATA \
+       install-binPROGRAMS install-data install-data-am install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+       tags uninstall uninstall-am uninstall-appmanDATA \
+       uninstall-binPROGRAMS
+
+
+.man.$(APP_MAN_SUFFIX):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
+
+# 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/xeyes/README b/xeyes/README
new file mode 100644 (file)
index 0000000..a155d7c
--- /dev/null
@@ -0,0 +1,25 @@
+xeyes - a follow the mouse X demo, using the X SHAPE extension
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+        http://lists.freedesktop.org/mailman/listinfo/xorg
+
+Please submit bug reports to the Xorg bugzilla:
+
+        https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+The master development code repository can be found at:
+
+        git://anongit.freedesktop.org/git/xorg/app/xeyes
+
+        http://cgit.freedesktop.org/xorg/app/xeyes
+
+For patch submission instructions, see:
+
+       http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
+For more information on the git code manager, see:
+
+        http://wiki.x.org/wiki/GitPage
+
diff --git a/xeyes/aclocal.m4 b/xeyes/aclocal.m4
new file mode 100644 (file)
index 0000000..31385f9
--- /dev/null
@@ -0,0 +1,1783 @@
+# generated automatically by aclocal 1.11 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009  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.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
+[m4_warning([this file was generated for autoconf 2.63.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# 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 "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _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 --print-errors "$2" 2>&1`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       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 <http://pkg-config.freedesktop.org/>.])],
+               [$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 xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
+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 ensure that this macro is defined, also add:
+# m4_ifndef([XORG_MACROS_VERSION],
+#     [m4_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.
+m4_defun([XORG_MACROS_VERSION],[
+m4_define([vers_have], [1.3.0])
+m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
+m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
+m4_if(m4_cmp(maj_have, maj_needed), 0,,
+    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
+m4_if(m4_version_compare(vers_have, [$1]), -1,
+    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
+m4_undefine([vers_have])
+m4_undefine([maj_have])
+m4_undefine([maj_needed])
+]) # 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])
+       # under Cygwin unix is still defined even with -undef
+       elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+               RAWCPPFLAGS="-undef -ansi"
+               AC_MSG_RESULT([yes, with -ansi])
+       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],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+
+if test x"$cross_compiling" = x"yes" ; then
+  HAVE_DEFS_ENT=no
+else
+  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+fi
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+AC_PATH_PROG(PS2PDF, ps2pdf)
+
+AC_MSG_CHECKING([Whether to build documentation])
+
+if test x$HAVE_DEFS_ENT != 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 && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([Whether to build text documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([Whether to build PDF documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([Whether to build PostScript documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([Whether to build HTML documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# 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,
+       AS_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, [AS_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, [AS_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
+
+# XORG_CWARNFLAGS
+# ---------------
+# Minimum version: 1.2.0
+#
+# Defines CWARNFLAGS to enable C compiler warnings.
+#
+AC_DEFUN([XORG_CWARNFLAGS], [
+AC_REQUIRE([AC_PROG_CC])
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+AC_SUBST(CWARNFLAGS)
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+]) # XORG_CWARNFLAGS
+
+# XORG_STRICT_OPTION
+# -----------------------
+# Minimum version: 1.3.0
+#
+# Add configure option to enable strict compilation
+AC_DEFUN([XORG_STRICT_OPTION], [
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CC_C99])
+AC_REQUIRE([XORG_CWARNFLAGS])
+
+AC_ARG_ENABLE(strict-compilation,
+                         AS_HELP_STRING([--enable-strict-compilation],
+                         [Enable all warnings from compiler and make them errors (default: disabled)]),
+                         [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
+if test "x$STRICT_COMPILE" = "xyes"; then
+       AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+       AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+AC_SUBST([CWARNFLAGS])
+]) # XORG_STRICT_OPTION
+
+# XORG_DEFAULT_OPTIONS
+# --------------------
+# Minimum version: 1.3.0
+#
+# Defines default options for X.Org modules.
+#
+AC_DEFUN([XORG_DEFAULT_OPTIONS], [
+XORG_CWARNFLAGS
+XORG_STRICT_OPTION
+XORG_RELEASE_VERSION
+XORG_CHANGELOG
+XORG_INSTALL
+XORG_MANPAGE_SECTIONS
+]) # XORG_DEFAULT_OPTIONS
+
+# XORG_INSTALL()
+# ----------------
+# Minimum version: 1.4.0
+#
+# Defines the variable INSTALL_CMD as the command to copy
+# INSTALL from $prefix/share/doc/util-macros.
+#
+AC_DEFUN([XORG_INSTALL], [
+AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+macros_docdir=$($PKG_CONFIG --print-errors --variable=docdir xorg-macros)
+INSTALL_CMD="(cp -f "$macros_docdir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"docdir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+AC_SUBST([INSTALL_CMD])
+]) # XORG_INSTALL
+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.  Also
+# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+AC_DEFUN([XORG_RELEASE_VERSION],[
+       AC_ARG_WITH(release-version,
+                       AS_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
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+               [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+               [Major version of this package])
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+               [$PVM],
+               [Minor version of this package])
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+               [$PVP],
+               [Patch version of this package])
+])
+
+# XORG_CHANGELOG()
+# ----------------
+# Minimum version: 1.2.0
+#
+# Defines the variable CHANGELOG_CMD as the command to generate
+# ChangeLog from git.
+#
+#
+AC_DEFUN([XORG_CHANGELOG], [
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+AC_SUBST([CHANGELOG_CMD])
+]) # XORG_CHANGELOG
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# 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, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# 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])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+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, 2006, 2009
+# 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 10
+
+# 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], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$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
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    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, 2006, 2008, 2009 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 16
+
+# 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.62])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
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+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
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_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)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+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
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_AM_DEPENDENCIES(OBJC)],
+                 [define([AC_PROG_OBJC],
+                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# 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_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
+                         (and sometimes confusing) to the casual installer],
+      [USE_MAINTAINER_MODE=$enableval],
+      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  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, 2009  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_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.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
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+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, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# 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
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# 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, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _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],
+[m4_foreach_w([_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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# 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
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# 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) 2009  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 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# 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="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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/xeyes/config.guess b/xeyes/config.guess
new file mode 100755 (executable)
index 0000000..12734a7
--- /dev/null
@@ -0,0 +1,1554 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+#   Free Software Foundation, Inc.
+
+timestamp='2009-08-19'
+
+# 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 (context
+# diff format) to <config-patches@gnu.org> and include a 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.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+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 <config-patches@gnu.org>."
+
+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, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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 "$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
+
+case "${UNAME_SYSTEM}" in
+Linux|GNU/*)
+       eval $set_cc_for_build
+       cat << EOF > $dummy.c
+       #include <features.h>
+       #ifdef __UCLIBC__
+       # ifdef __UCLIBC_CONFIG_VERSION__
+       LIBC=uclibc __UCLIBC_CONFIG_VERSION__
+       # else
+       LIBC=uclibc
+       # endif
+       #else
+       LIBC=gnu
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'`
+       ;;
+esac
+
+# 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 ;;
+           sh5el) machine=sh5le-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 -q __ELF__
+               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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    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.*:* | i86xen:SunOS:5.*:*)
+       eval $set_cc_for_build
+       SUN_ARCH="i386"
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       echo ${SUN_ARCH}-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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:*:[456])
+       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+               IBM_ARCH=rs6000
+       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 <stdlib.h>
+              #include <unistd.h>
+
+              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 -q __LP64__
+           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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       exit ;;
+    i*:CYGWIN*:*)
+       echo ${UNAME_MACHINE}-pc-cygwin
+       exit ;;
+    *: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 ;;
+    *:Interix*:[3456]*)
+       case ${UNAME_MACHINE} in
+           x86)
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           EM64T | authenticamd | genuineintel)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+           IA64)
+               echo ia64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+       esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       exit ;;
+    8664:Windows_NT:*)
+       echo x86_64-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*:*:* | x86_64: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/[-(].*//'`-${LIBC}
+       exit ;;
+    i*86:Minix:*:*)
+       echo ${UNAME_MACHINE}-pc-minix
+       exit ;;
+    arm*:Linux:*:*)
+       eval $set_cc_for_build
+       if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_EABI__
+       then
+           echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       else
+           echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+       fi
+       exit ;;
+    avr32*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    cris:Linux:*:*)
+       echo cris-axis-linux-${LIBC}
+       exit ;;
+    crisv32:Linux:*:*)
+       echo crisv32-axis-linux-${LIBC}
+       exit ;;
+    frv:Linux:*:*)
+       echo frv-unknown-linux-${LIBC}
+       exit ;;
+    ia64:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    m32r*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    m68*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    mips:Linux:*:* | mips64:Linux:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #undef CPU
+       #undef ${UNAME_MACHINE}
+       #undef ${UNAME_MACHINE}el
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=${UNAME_MACHINE}el
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       CPU=${UNAME_MACHINE}
+       #else
+       CPU=
+       #endif
+       #endif
+EOF
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-unknown-linux-${LIBC}
+       exit ;;
+    ppc:Linux:*:*)
+       echo powerpc-unknown-linux-${LIBC}
+       exit ;;
+    ppc64:Linux:*:*)
+       echo powerpc64-unknown-linux-${LIBC}
+       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 -q ld.so.1
+       if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-${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-${LIBC} ;;
+         PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+         *)    echo hppa-unknown-linux-${LIBC} ;;
+       esac
+       exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+       echo hppa64-unknown-linux-${LIBC}
+       exit ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+       echo ${UNAME_MACHINE}-ibm-linux
+       exit ;;
+    sh64*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    sh*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+       exit ;;
+    x86_64:Linux:*:*)
+       echo x86_64-unknown-linux-${LIBC}
+       exit ;;
+    xtensa*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       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-${LIBC}"
+               ;;
+       esac
+       # This should get integrated into the C code below, but now we hack
+       if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi
+       # Determine whether the default compiler is a.out or elf
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #include <features.h>
+       #ifdef __ELF__
+       # ifdef __GLIBC__
+       #  if __GLIBC__ >= 2
+       LIBC=gnu
+       #  else
+       LIBC=gnulibc1
+       #  endif
+       # else
+       LIBC=gnulibc1
+       # endif
+       #else
+       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+       LIBC=gnu
+       #else
+       LIBC=gnuaout
+       #endif
+       #endif
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^LIBC/{
+               s: ::g
+               p
+           }'`"
+       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.[02]*:*)
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-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; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       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; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; 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.[02]*:*)
+       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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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 ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       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 ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-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
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/xeyes/config.h.in b/xeyes/config.h.in
new file mode 100644 (file)
index 0000000..51a69e0
--- /dev/null
@@ -0,0 +1,64 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* 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
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to use X Render Extension */
+#undef XRENDER
diff --git a/xeyes/config.sub b/xeyes/config.sub
new file mode 100755 (executable)
index 0000000..3243784
--- /dev/null
@@ -0,0 +1,1717 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+#   Free Software Foundation, Inc.
+
+timestamp='2009-08-19'
+
+# 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 <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted GNU 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.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# 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 <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-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 | -microblaze)
+               os=
+               basic_machine=$1
+               ;;
+        -bluegene*)
+               os=-cnk
+               ;;
+       -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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | bfin \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx | dvp \
+       | fido | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | lm32 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore | mep | metag \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64octeon | mips64octeonel \
+       | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | moxie \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | z8k | z80)
+               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)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64octeon-* | mips64octeonel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | 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[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+       | tron-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa*-* \
+       | ymp-* \
+       | z8k-* | z80-*)
+               ;;
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               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
+               ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       bluegene*)
+               basic_machine=powerpc-ibm
+               os=-cnk
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+        cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
+       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
+               ;;
+       cr16)
+               basic_machine=cr16-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
+               ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
+       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
+               ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       m88k-omron*)
+               basic_machine=m88k-omron
+               ;;
+       magnum | m3230)
+               basic_machine=mips-mips
+               os=-sysv
+               ;;
+       merlin)
+               basic_machine=ns32k-utek
+               os=-sysv
+               ;;
+        microblaze)
+               basic_machine=microblaze-xilinx
+               ;;
+       mingw32)
+               basic_machine=i386-pc
+               os=-mingw32
+               ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
+       miniframe)
+               basic_machine=m68000-convergent
+               ;;
+       *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+               basic_machine=m68k-atari
+               os=-mint
+               ;;
+       mipsEE* | ee | ps2)
+               basic_machine=mips64r5900el-scei
+               case $os in
+                   -linux*)
+                       ;;
+                   *)
+                       os=-elf
+                       ;;
+               esac
+               ;;
+       iop)
+               basic_machine=mipsel-scei
+               os=-irx
+               ;;
+       dvp)
+               basic_machine=dvp-scei
+               os=-elf
+               ;;
+       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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       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
+               ;;
+       tile*)
+               basic_machine=tile-unknown
+               os=-linux-gnu
+               ;;
+       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
+               ;;
+       z80-*-coff)
+               basic_machine=z80-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[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+               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* | -cnk* | -sunos | -sunos[34]*\
+             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+             | -kopensolaris* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* | -aros* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
+             | -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* | -cegcc* \
+             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -linux-newlib* | -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* | -rdos* | -toppers* | -drops* | -irx*)
+       # 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
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+       -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
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
+       *-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
+               ;;
+        mep-*)
+               os=-elf
+               ;;
+       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
+                               ;;
+                       -cnk*|-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/xeyes/configure b/xeyes/configure
new file mode 100755 (executable)
index 0000000..772389f
--- /dev/null
@@ -0,0 +1,7579 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.63 for xeyes 1.1.0.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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 ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&    (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    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=.
+  case $as_dir in
+        /*)
+          for as_base in sh bash ksh sh5; do
+            as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+          done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+        # Try only shells that exist, to save several forks.
+        if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+               { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+              as_have_required=yes
+              if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+       do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+       done
+       export CONFIG_SHELL
+       exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell bug-autoconf@gnu.org about your system,
+  echo including any error possibly output before this message.
+  echo This can help us improve future autoconf versions.
+  echo Configuration will now proceed without shell functions.
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# 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`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='xeyes'
+PACKAGE_TARNAME='xeyes'
+PACKAGE_VERSION='1.1.0'
+PACKAGE_STRING='xeyes 1.1.0'
+PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+XRENDER_LIBS
+XRENDER_CFLAGS
+XEYES_LIBS
+XEYES_CFLAGS
+ADMIN_MAN_DIR
+DRIVER_MAN_DIR
+MISC_MAN_DIR
+FILE_MAN_DIR
+LIB_MAN_DIR
+APP_MAN_DIR
+ADMIN_MAN_SUFFIX
+DRIVER_MAN_SUFFIX
+MISC_MAN_SUFFIX
+FILE_MAN_SUFFIX
+LIB_MAN_SUFFIX
+APP_MAN_SUFFIX
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+INSTALL_CMD
+PKG_CONFIG
+CHANGELOG_CMD
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+CWARNFLAGS
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_silent_rules
+enable_strict_compilation
+with_release_version
+with_xrender
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+PKG_CONFIG
+XEYES_CFLAGS
+XEYES_LIBS
+XRENDER_CFLAGS
+XRENDER_LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)   ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=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 ;;
+
+  -*) { $as_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 &&
+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_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'`
+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+   { (exit 1); exit 1; }; } ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+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
+    $as_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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 xeyes 1.1.0 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/xeyes]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_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 xeyes 1.1.0:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --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
+  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')
+  --enable-strict-compilation
+                          Enable all warnings from compiler and make them
+                          errors (default: disabled)
+
+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
+  --with-xrender          Use Xrender for rendering (Default is YES)
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  PKG_CONFIG  path to pkg-config utility
+  XEYES_CFLAGS
+              C compiler flags for XEYES, overriding pkg-config
+  XEYES_LIBS  linker flags for XEYES, overriding pkg-config
+  XRENDER_CFLAGS
+              C compiler flags for XRENDER, overriding pkg-config
+  XRENDER_LIBS
+              linker flags for XRENDER, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+xeyes configure 1.1.0
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 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
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by xeyes $as_me 1.1.0, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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=.
+  $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&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_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=`$as_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_arg'"
+      ;;
+    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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+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,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r 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 -f -r conftest* 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 an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test -r "$ac_site_file"; then
+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_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
+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_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 $ac_precious_vars; 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,)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_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
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_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
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_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.11'
+
+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
+  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$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'
+
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5
+$as_echo "$as_me: error: unsafe absolute working directory name" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5
+$as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+
+# 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".
+      { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+$as_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
+   { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+$as_echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "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 $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# 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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+done
+IFS=$as_save_IFS
+
+fi
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+# test whether we have cygpath
+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='xeyes'
+ VERSION='1.1.0'
+
+
+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"}
+
+# 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 -'
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-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
+
+  { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$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"
+
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+
+
+
+
+
+
+
+
+
+
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-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
+
+
+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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+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
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_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.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_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.out.dSYM 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.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+$as_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
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&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'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_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
+       { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_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
+$as_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
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+$as_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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then
+  $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+$as_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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       CFLAGS=""
+      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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=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 <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+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
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&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
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$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
+
+
+
+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
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&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
+
+
+{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+  $as_echo_n "(cached) " >&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 <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+   { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if test "${ac_cv_prog_cc_c99+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=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 <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+       {
+       case 's': // string
+         str = va_arg (args_copy, const char *);
+         break;
+       case 'd': // int
+         number = va_arg (args_copy, int);
+         break;
+       case 'f': // float
+         fnumber = va_arg (args_copy, double);
+         break;
+       default:
+         break;
+       }
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+         || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c99=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+
+
+
+
+
+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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    { $as_echo "$as_me:$LINENO: checking whether __SUNPRO_C is declared" >&5
+$as_echo_n "checking whether __SUNPRO_C is declared... " >&6; }
+if test "${ac_cv_have_decl___SUNPRO_C+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __SUNPRO_C
+  (void) __SUNPRO_C;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl___SUNPRO_C=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl___SUNPRO_C=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___SUNPRO_C" >&5
+$as_echo "$ac_cv_have_decl___SUNPRO_C" >&6; }
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=0;;
+esac
+AM_BACKSLASH='\'
+
+
+
+
+
+
+
+# Check whether --enable-strict-compilation was given.
+if test "${enable_strict_compilation+set}" = set; then
+  enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval
+else
+  STRICT_COMPILE=no
+fi
+
+if test "x$STRICT_COMPILE" = "xyes"; then
+       { $as_echo "$as_me:$LINENO: checking whether __SUNPRO_C is declared" >&5
+$as_echo_n "checking whether __SUNPRO_C is declared... " >&6; }
+if test "${ac_cv_have_decl___SUNPRO_C+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __SUNPRO_C
+  (void) __SUNPRO_C;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl___SUNPRO_C=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl___SUNPRO_C=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___SUNPRO_C" >&5
+$as_echo "$ac_cv_have_decl___SUNPRO_C" >&6; }
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+       { $as_echo "$as_me:$LINENO: checking whether __INTEL_COMPILER is declared" >&5
+$as_echo_n "checking whether __INTEL_COMPILER is declared... " >&6; }
+if test "${ac_cv_have_decl___INTEL_COMPILER+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __INTEL_COMPILER
+  (void) __INTEL_COMPILER;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl___INTEL_COMPILER=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl___INTEL_COMPILER=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___INTEL_COMPILER" >&5
+$as_echo "$ac_cv_have_decl___INTEL_COMPILER" >&6; }
+if test "x$ac_cv_have_decl___INTEL_COMPILER" = x""yes; then
+  INTELCC="yes"
+else
+  INTELCC="no"
+fi
+
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+
+
+
+
+# Check whether --with-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"
+               { $as_echo "$as_me:$LINENO: Building with package name set to $PACKAGE" >&5
+$as_echo "$as_me: Building with package name set to $PACKAGE" >&6;}
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+
+
+
+
+macros_docdir=$($PKG_CONFIG --print-errors --variable=docdir xorg-macros)
+INSTALL_CMD="(cp -f "$macros_docdir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"docdir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+
+
+
+
+
+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_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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+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
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_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.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       CFLAGS=""
+      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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=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 <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+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
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&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
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$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.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$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
+
+pkg_failed=no
+{ $as_echo "$as_me:$LINENO: checking for XEYES" >&5
+$as_echo_n "checking for XEYES... " >&6; }
+
+if test -n "$XEYES_CFLAGS"; then
+    pkg_cv_XEYES_CFLAGS="$XEYES_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"x11 xt xext xmu\"") >&5
+  ($PKG_CONFIG --exists --print-errors "x11 xt xext xmu") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_XEYES_CFLAGS=`$PKG_CONFIG --cflags "x11 xt xext xmu" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XEYES_LIBS"; then
+    pkg_cv_XEYES_LIBS="$XEYES_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"x11 xt xext xmu\"") >&5
+  ($PKG_CONFIG --exists --print-errors "x11 xt xext xmu") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_XEYES_LIBS=`$PKG_CONFIG --libs "x11 xt xext xmu" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               XEYES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "x11 xt xext xmu" 2>&1`
+        else
+               XEYES_PKG_ERRORS=`$PKG_CONFIG --print-errors "x11 xt xext xmu" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XEYES_PKG_ERRORS" >&5
+
+       { { $as_echo "$as_me:$LINENO: error: Package requirements (x11 xt xext xmu) were not met:
+
+$XEYES_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 XEYES_CFLAGS
+and XEYES_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&5
+$as_echo "$as_me: error: Package requirements (x11 xt xext xmu) were not met:
+
+$XEYES_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 XEYES_CFLAGS
+and XEYES_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
+       { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_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 XEYES_CFLAGS
+and XEYES_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&5
+$as_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 XEYES_CFLAGS
+and XEYES_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+else
+       XEYES_CFLAGS=$pkg_cv_XEYES_CFLAGS
+       XEYES_LIBS=$pkg_cv_XEYES_LIBS
+        { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       :
+fi
+XEYES_CFLAGS="$CWARNFLAGS $XEYES_CFLAGS"
+
+
+
+
+# Check whether --with-xrender was given.
+if test "${with_xrender+set}" = set; then
+  withval=$with_xrender; use_xrender="$withval"
+else
+  use_xrender="try"
+fi
+
+if test x$use_xrender != xno ; then
+
+pkg_failed=no
+{ $as_echo "$as_me:$LINENO: checking for XRENDER" >&5
+$as_echo_n "checking for XRENDER... " >&6; }
+
+if test -n "$XRENDER_CFLAGS"; then
+    pkg_cv_XRENDER_CFLAGS="$XRENDER_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xrender >= 0.4\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xrender >= 0.4") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_XRENDER_CFLAGS=`$PKG_CONFIG --cflags "xrender >= 0.4" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XRENDER_LIBS"; then
+    pkg_cv_XRENDER_LIBS="$XRENDER_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xrender >= 0.4\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xrender >= 0.4") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_XRENDER_LIBS=`$PKG_CONFIG --libs "xrender >= 0.4" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               XRENDER_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xrender >= 0.4" 2>&1`
+        else
+               XRENDER_PKG_ERRORS=`$PKG_CONFIG --print-errors "xrender >= 0.4" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XRENDER_PKG_ERRORS" >&5
+
+       { { $as_echo "$as_me:$LINENO: error: Package requirements (xrender >= 0.4) were not met:
+
+$XRENDER_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 XRENDER_CFLAGS
+and XRENDER_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&5
+$as_echo "$as_me: error: Package requirements (xrender >= 0.4) were not met:
+
+$XRENDER_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 XRENDER_CFLAGS
+and XRENDER_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
+       { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_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 XRENDER_CFLAGS
+and XRENDER_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&5
+$as_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 XRENDER_CFLAGS
+and XRENDER_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+else
+       XRENDER_CFLAGS=$pkg_cv_XRENDER_CFLAGS
+       XRENDER_LIBS=$pkg_cv_XRENDER_LIBS
+        { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       :
+fi
+       XEYES_CFLAGS="$XEYES_CFLAGS $XRENDER_CFLAGS"
+       XEYES_LIBS="$XEYES_LIBS $XRENDER_LIBS"
+
+cat >>confdefs.h <<\_ACEOF
+#define XRENDER 1
+_ACEOF
+
+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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     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" &&
+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+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_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_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
+  { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_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
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_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 "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_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_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $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 || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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 ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by xeyes $as_me 1.1.0, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet, --silent
+                   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 <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+xeyes config.status 1.1.0
+configured by $0, generated by GNU Autoconf 2.63,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+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
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { $as_echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { $as_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"
+     ac_need_defaults=false ;;
+
+  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 || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr='\r'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+   { (exit 1); exit 1; }; }
+_ACEOF
+
+# 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
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #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.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
+$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
+   { (exit 1); exit 1; }; }
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      ac_file_inputs="$ac_file_inputs '$ac_f'"
+    done
+
+    # 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.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+       || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
+$as_echo "$as_me: error: could not create -" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$_am_arg" : 'X\(//\)[^/]' \| \
+        X"$_am_arg" : 'X\(//\)$' \| \
+        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_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=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+
+# 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
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/xeyes/configure.ac b/xeyes/configure.ac
new file mode 100644 (file)
index 0000000..55a7a1e
--- /dev/null
@@ -0,0 +1,56 @@
+
+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(xeyes,[1.1.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xeyes)
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+AM_CONFIG_HEADER(config.h)
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+          [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+XORG_DEFAULT_OPTIONS
+
+AC_PROG_CC
+AC_PROG_INSTALL
+
+
+# Checks for pkg-config packages
+PKG_CHECK_MODULES(XEYES, x11 xt xext xmu)
+XEYES_CFLAGS="$CWARNFLAGS $XEYES_CFLAGS"
+AC_SUBST(XEYES_CFLAGS)
+AC_SUBST(XEYES_LIBS)
+
+dnl Optional dependencies
+AC_ARG_WITH(xrender, AC_HELP_STRING([--with-xrender],[Use Xrender for rendering (Default is YES)]),use_xrender="$withval",use_xrender="try")
+if test x$use_xrender != xno ; then
+       PKG_CHECK_MODULES(XRENDER, [xrender >= 0.4])
+       XEYES_CFLAGS="$XEYES_CFLAGS $XRENDER_CFLAGS"
+       XEYES_LIBS="$XEYES_LIBS $XRENDER_LIBS"
+       AC_DEFINE([XRENDER],1,[Define to use X Render Extension])
+fi
+
+AC_OUTPUT([Makefile])
diff --git a/xeyes/depcomp b/xeyes/depcomp
new file mode 100755 (executable)
index 0000000..df8eea7
--- /dev/null
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s,\\\\\\\\,/,g"
+   depmode=msvisualcpp
+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.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    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.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[     ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "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"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${
+              s/^ *//
+              s/ \\*$//
+              s/$/:/
+              p
+            }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # 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 mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $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 "X$1" != 'X--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 "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    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.
+    -arch)
+      eat=yes ;;
+    -*|$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 "X$1" != 'X--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.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::     \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # 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
+  ;;
+
+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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xeyes/eyes.bit b/xeyes/eyes.bit
new file mode 100644 (file)
index 0000000..4948216
--- /dev/null
@@ -0,0 +1,21 @@
+#define eyes_width 48
+#define eyes_height 32
+#define eyes_x_hot 0
+#define eyes_y_hot 0
+static unsigned char eyes_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x78, 0x00, 0x00, 0x1e, 0x00, 0x00, 0xfe, 0x01, 0x80, 0x7f, 0x00,
+   0x00, 0x87, 0x03, 0xc0, 0xe1, 0x00, 0x80, 0x01, 0x06, 0x60, 0x80, 0x01,
+   0xc0, 0x00, 0x0c, 0x30, 0x00, 0x03, 0x60, 0x00, 0x18, 0x18, 0x00, 0x06,
+   0x30, 0x00, 0x30, 0x0c, 0x00, 0x0c, 0x30, 0x00, 0x30, 0x0c, 0x00, 0x0c,
+   0x10, 0x00, 0x20, 0x04, 0x00, 0x08, 0x18, 0x00, 0x60, 0x06, 0x00, 0x18,
+   0x18, 0x00, 0x60, 0x06, 0x00, 0x18, 0x18, 0x00, 0x60, 0x06, 0x00, 0x18,
+   0x18, 0x00, 0x60, 0x06, 0x00, 0x18, 0x18, 0x00, 0x60, 0x06, 0x00, 0x18,
+   0x18, 0x00, 0x60, 0x06, 0x00, 0x18, 0x18, 0x80, 0x63, 0x06, 0x00, 0x18,
+   0x18, 0x80, 0x63, 0x06, 0xe0, 0x18, 0x18, 0x80, 0x63, 0x06, 0xe0, 0x18,
+   0x18, 0x00, 0x60, 0x06, 0xe0, 0x18, 0x18, 0x00, 0x20, 0x06, 0x00, 0x08,
+   0x10, 0x00, 0x30, 0x04, 0x00, 0x0c, 0x10, 0x00, 0x10, 0x04, 0x00, 0x04,
+   0x30, 0x00, 0x18, 0x0c, 0x00, 0x06, 0x60, 0x00, 0x08, 0x18, 0x00, 0x02,
+   0x40, 0x00, 0x0c, 0x10, 0x00, 0x03, 0xc0, 0x00, 0x06, 0x30, 0x80, 0x01,
+   0x80, 0x83, 0x03, 0xe0, 0xe0, 0x00, 0x00, 0xff, 0x01, 0xc0, 0x7f, 0x00,
+   0x00, 0xfe, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/xeyes/eyesmask.bit b/xeyes/eyesmask.bit
new file mode 100644 (file)
index 0000000..0e4116b
--- /dev/null
@@ -0,0 +1,21 @@
+#define eyesmask_width 48
+#define eyesmask_height 32
+#define eyesmask_x_hot 0
+#define eyesmask_y_hot 0
+static unsigned char eyesmask_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x78, 0x00, 0x00, 0x1e, 0x00, 0x00, 0xfe, 0x01, 0x80, 0x7f, 0x00,
+   0x00, 0xff, 0x03, 0xc0, 0xff, 0x00, 0x80, 0xff, 0x07, 0xe0, 0xff, 0x01,
+   0xc0, 0xff, 0x0f, 0xf0, 0xff, 0x03, 0xe0, 0xff, 0x1f, 0xf8, 0xff, 0x07,
+   0xf0, 0xff, 0x3f, 0xfc, 0xff, 0x0f, 0xf0, 0xff, 0x3f, 0xfc, 0xff, 0x0f,
+   0xf0, 0xff, 0x3f, 0xfc, 0xff, 0x0f, 0xf8, 0xff, 0x7f, 0xfe, 0xff, 0x1f,
+   0xf8, 0xff, 0x7f, 0xfe, 0xff, 0x1f, 0xf8, 0xff, 0x7f, 0xfe, 0xff, 0x1f,
+   0xf8, 0xff, 0x7f, 0xfe, 0xff, 0x1f, 0xf8, 0xff, 0x7f, 0xfe, 0xff, 0x1f,
+   0xf8, 0xff, 0x7f, 0xfe, 0xff, 0x1f, 0xf8, 0xff, 0x7f, 0xfe, 0xff, 0x1f,
+   0xf8, 0xff, 0x7f, 0xfe, 0xff, 0x1f, 0xf8, 0xff, 0x7f, 0xfe, 0xff, 0x1f,
+   0xf8, 0xff, 0x7f, 0xfe, 0xff, 0x1f, 0xf8, 0xff, 0x3f, 0xfe, 0xff, 0x0f,
+   0xf0, 0xff, 0x3f, 0xfc, 0xff, 0x0f, 0xf0, 0xff, 0x1f, 0xfc, 0xff, 0x07,
+   0xf0, 0xff, 0x1f, 0xfc, 0xff, 0x07, 0xe0, 0xff, 0x0f, 0xf8, 0xff, 0x03,
+   0xc0, 0xff, 0x0f, 0xf0, 0xff, 0x03, 0xc0, 0xff, 0x07, 0xf0, 0xff, 0x01,
+   0x80, 0xff, 0x03, 0xe0, 0xff, 0x00, 0x00, 0xff, 0x01, 0xc0, 0x7f, 0x00,
+   0x00, 0xfe, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/xeyes/install-sh b/xeyes/install-sh
new file mode 100755 (executable)
index 0000000..6781b98
--- /dev/null
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# 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.
+
+nl='
+'
+IFS=" ""       $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+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:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+       shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+       case $mode in
+         *' '* | *'    '* | *'
+'*       | *'*'* | *'?'* | *'['*)
+           echo "$0: invalid mode: $mode" >&2
+           exit 1;;
+       esac
+       shift;;
+
+    -o) chowncmd="$chownprog $2"
+       shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+       shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)        shift
+       break;;
+
+    -*)        echo "$0: invalid option: $1" >&2
+       exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # 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: $dst_arg: Is a directory" >&2
+       exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+       (dirname "$dst") 2>/dev/null ||
+       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+            X"$dst" : 'X\(//\)[^/]' \| \
+            X"$dst" : 'X\(//\)$' \| \
+            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+       echo X"$dst" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+       # Create intermediate dirs using mode 755 as modified by the umask.
+       # This is like FreeBSD 'install' as of 1997-10-28.
+       umask=`umask`
+       case $stripcmd.$umask in
+         # Optimize common cases.
+         *[2367][2367]) mkdir_umask=$umask;;
+         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+         *[0-7])
+           mkdir_umask=`expr $umask + 22 \
+             - $umask % 100 % 40 + $umask % 20 \
+             - $umask % 10 % 4 + $umask % 2
+           `;;
+         *) mkdir_umask=$umask,go-w;;
+       esac
+
+       # With -d, create the new directory with the user-specified mode.
+       # Otherwise, rely on $mkdir_umask.
+       if test -n "$dir_arg"; then
+         mkdir_mode=-m$mode
+       else
+         mkdir_mode=
+       fi
+
+       posix_mkdir=false
+       case $umask in
+         *[123567][0-7][0-7])
+           # POSIX mkdir -p sets u+wx bits regardless of umask, which
+           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+           ;;
+         *)
+           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+           if (umask $mkdir_umask &&
+               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+           then
+             if test -z "$dir_arg" || {
+                  # Check for POSIX incompatibilities with -m.
+                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                  # other-writeable bit of parent directory when it shouldn't.
+                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                  case $ls_ld_tmpdir in
+                    d????-?r-*) different_mode=700;;
+                    d????-?--*) different_mode=755;;
+                    *) false;;
+                  esac &&
+                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                  }
+                }
+             then posix_mkdir=:
+             fi
+             rmdir "$tmpdir/d" "$tmpdir"
+           else
+             # Remove any dirs left behind by ancient mkdir implementations.
+             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+           fi
+           trap '' 0;;
+       esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+       umask $mkdir_umask &&
+       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+       /*) prefix='/';;
+       -*) prefix='./';;
+       *)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+       test -z "$d" && continue
+
+       prefix=$prefix$d
+       if test -d "$prefix"; then
+         prefixes=
+       else
+         if $posix_mkdir; then
+           (umask=$mkdir_umask &&
+            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+           # Don't fail if two instances are running concurrently.
+           test -d "$prefix" || exit 1
+         else
+           case $prefix in
+             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+             *) qprefix=$prefix;;
+           esac
+           prefixes="$prefixes '$qprefix'"
+         fi
+       fi
+       prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+       # Don't fail if two instances are running concurrently.
+       (umask $mkdir_umask &&
+        eval "\$doit_exec \$mkdirprog $prefixes") ||
+         test -d "$dstdir" || exit 1
+       obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # 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
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"    2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+       # Now remove or move aside any old file at destination location.
+       # We try this two ways since rm can't unlink itself on some
+       # systems and the destination file might be busy for other
+       # reasons.  In this case, the final cleanup might fail but the new
+       # file should still install successfully.
+       {
+         test ! -f "$dst" ||
+         $doit $rmcmd -f "$dst" 2>/dev/null ||
+         { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+           { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+         } ||
+         { echo "$0: cannot unlink or rename $dst" >&2
+           (exit 1); exit 1
+         }
+       } &&
+
+       # Now rename the file to the real destination.
+       $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xeyes/missing b/xeyes/missing
new file mode 100755 (executable)
index 0000000..28055d2
--- /dev/null
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# 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=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+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'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  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]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
+# 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).  This is about non-GNU programs, so use $1 not
+# $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 $program 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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if test ! -f y.tab.h; then
+       echo >y.tab.h
+    fi
+    if test ! -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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if test ! -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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit $?
+    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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+       /^@setfilename/{
+         s/.* \([^ ]*\) *$/\1/
+         p
+         q
+       }' $infile`
+      # ... 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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xeyes/transform.c b/xeyes/transform.c
new file mode 100644 (file)
index 0000000..5f63516
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * transformed coordinate system objects for X
+ */
+/* $XFree86: xc/programs/xeyes/transform.c,v 1.3 2000/02/17 14:00:35 dawes Exp $ */
+
+# include      <X11/Xos.h>
+# include      <stdlib.h>
+# include      <X11/Xlib.h>
+# include      "transform.h"
+
+#if 0
+static XPoint *
+TranslatePoints (TPoint *points, int n_points, Transform *t, int mode)
+{
+       XPoint  *xpoints;
+       int     i;
+       double  xoff = 0.0, yoff = 0.0;
+
+       xpoints = (XPoint *) malloc (n_points * sizeof (*xpoints));
+       if (!xpoints)
+               return NULL;
+       for (i = 0; i < n_points; i++) {
+               xpoints[i].x = Xx(points[i].x + xoff, points[i].y + yoff, t);
+               xpoints[i].y = Xy(points[i].x + xoff, points[i].y + yoff, t);
+               if (mode == CoordModePrevious) {
+                       xoff += points[i].x;
+                       yoff += points[i].y;
+               }
+       }
+       return xpoints;
+}
+
+static void
+TFillPolygon (
+    Display    *dpy,
+    Drawable   d,
+    GC         gc,
+    Transform  *t,
+    TPoint     *points,
+    int                n_points,
+    int                shape,
+    int                mode)
+{
+       XPoint  *xpoints;
+
+       xpoints = TranslatePoints (points, n_points, t, mode);
+       if (xpoints) {
+               XFillPolygon (dpy, d, gc, xpoints, n_points, shape,
+                               CoordModeOrigin);
+               free (xpoints);
+       }
+}
+
+static void
+TDrawArc (
+    Display    *dpy,
+    Drawable   d,
+    GC         gc,
+    Transform  *t,
+    double     x,
+    double     y,
+    double     width,
+    double     height,
+    int                angle1,
+    int                angle2)
+{
+       int     xx, xy, xw, xh;
+
+       xx = Xx(x,y,t);
+       xy = Xy(x,y,t);
+       xw = Xwidth (width, height, t);
+       xh = Xheight (width, height, t);
+       if (xw < 0) {
+               xx += xw;
+               xw = -xw;
+       }
+       if (xh < 0) {
+               xy += xh;
+               xh = -xh;
+       }
+       XDrawArc (dpy, d, gc, xx, xy, xw, xh, angle1, angle2);
+}
+#endif
+
+void
+Trectangle(const Transform *t, const TRectangle *i, TRectangle *o)
+{
+    o->x = t->mx * i->x + t->bx;
+    o->y = t->my * i->y + t->by;
+    o->width = t->mx * i->width;
+    o->height = t->my * i->height;
+    if (o->width < 0) {
+       o->x += o->width;
+       o->width = -o->width;
+    }
+    if (o->height < 0) {
+       o->y += o->height;
+       o->height = -o->height;
+    }
+}
+
+void
+SetTransform (Transform *t,
+             int xx1, int xx2, int xy1, int xy2,
+             double tx1, double tx2, double ty1, double ty2)
+{
+       t->mx = ((double) xx2 - xx1) / (tx2 - tx1);
+       t->bx = ((double) xx1) - t->mx * tx1;
+       t->my = ((double) xy2 - xy1) / (ty2 - ty1);
+       t->by = ((double) xy1) - t->my * ty1;
+}
diff --git a/xeyes/transform.h b/xeyes/transform.h
new file mode 100644 (file)
index 0000000..7567fcc
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * header file for transformed coordinate system.  No rotations
+ * supported, as elipses cannot be rotated in X.
+ */
+/* $XFree86$ */
+
+typedef struct _transform {
+       double  mx, bx;
+       double  my, by;
+} Transform;
+
+typedef struct _TPoint {
+       double  x, y;
+} TPoint;
+
+typedef struct _TRectangle {
+       double  x, y, width, height;
+} TRectangle;
+
+# define Xx(x,y,t)     ((int)((t)->mx * (x) + (t)->bx + 0.5))
+# define Xy(x,y,t)     ((int)((t)->my * (y) + (t)->by + 0.5))
+# define Xwidth(w,h,t) ((int)((t)->mx * (w) + 0.5))
+# define Xheight(w,h,t)        ((int)((t)->my * (h) + 0.5))
+# define Tx(x,y,t)     ((((double) (x)) - (t)->bx) / (t)->mx)
+# define Ty(x,y,t)     ((((double) (y)) - (t)->by) / (t)->my)
+# define Twidth(w,h,t) (((double) (w)) / (t)->mx)
+# define Theight(w,h,t)        (((double) (h)) / (t)->my)
+
+extern void Trectangle (const Transform *t, const TRectangle *in, TRectangle *out);
+extern void SetTransform (Transform *t,
+                          int xx1, int xx2, int xy1, int xy2,
+                          double tx1, double tx2, double ty1, double ty2);
diff --git a/xeyes/xeyes.c b/xeyes/xeyes.c
new file mode 100644 (file)
index 0000000..276a084
--- /dev/null
@@ -0,0 +1,145 @@
+/* $XConsortium: xeyes.c,v 1.16 94/04/17 20:45:23 rws Exp $ */
+/*
+
+Copyright (c) 1991  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86: xc/programs/xeyes/xeyes.c,v 1.3 2000/02/17 14:00:35 dawes Exp $ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Shell.h>
+#include "Eyes.h"
+#include <stdio.h> 
+#include <stdlib.h> 
+#include "eyes.bit"
+#include "eyesmask.bit"
+
+/* Exit with message describing command line format */
+
+static void
+usage(void)
+{
+    fprintf(stderr,
+"usage: xeyes\n");
+    fprintf (stderr, 
+"       [-geometry [{width}][x{height}][{+-}{xoff}[{+-}{yoff}]]] [-display [{host}]:[{vs}]]\n");
+    fprintf(stderr,
+"       [-fg {color}] [-bg {color}] [-bd {color}] [-bw {pixels}]");
+    fprintf(stderr, " [-shape | +shape]");
+    fprintf(stderr, "\n");
+    fprintf(stderr,
+"       [-outline {color}] [-center {color}] [-backing {backing-store}] [-distance]\n");
+#ifdef XRENDER
+    fprintf(stderr,
+"       [-render | +render]\n");
+#endif
+    exit(1);
+}
+
+/* Command line options table.  Only resources are entered here...there is a
+   pass over the remaining options after XtParseCommand is let loose. */
+
+static XrmOptionDescRec options[] = {
+{"-outline",   "*eyes.outline",        XrmoptionSepArg,        NULL},
+{"-center",    "*eyes.center",         XrmoptionSepArg,        NULL},
+{"-backing",   "*eyes.backingStore",   XrmoptionSepArg,        NULL},
+{"-shape",     "*eyes.shapeWindow",    XrmoptionNoArg,         "TRUE"},
+{"+shape",     "*eyes.shapeWindow",    XrmoptionNoArg,         "FALSE"},
+#ifdef XRENDER
+{"-render",    "*eyes.render",         XrmoptionNoArg,         "TRUE"},
+{"+render",    "*eyes.render",         XrmoptionNoArg,         "FALSE"},
+#endif
+{"-distance",  "*eyes.distance",       XrmoptionNoArg,         "TRUE"},
+};
+
+static Atom wm_delete_window;
+
+/*ARGSUSED*/
+static void
+quit(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    if (event->type == ClientMessage && 
+       event->xclient.data.l[0] != wm_delete_window) {
+       XBell(XtDisplay(w), 0);
+    } else {
+       XtDestroyApplicationContext(XtWidgetToApplicationContext(w));
+       exit(0);
+    }
+}
+
+static XtActionsRec actions[] = {
+    {"quit",   quit}
+};
+
+int
+main(int argc, char **argv)
+{
+    XtAppContext app_context;
+    Widget toplevel;
+    Arg arg[2];
+    Cardinal i;
+    
+    XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
+
+    toplevel = XtAppInitialize(&app_context, "XEyes", 
+                              options, XtNumber(options), &argc, argv,
+                              NULL, arg, (Cardinal) 0);
+    if (argc != 1) usage();
+
+    wm_delete_window = XInternAtom(XtDisplay(toplevel), "WM_DELETE_WINDOW",
+                                  False);
+    XtAppAddActions(app_context, actions, XtNumber(actions));
+    XtOverrideTranslations
+       (toplevel, XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()"));
+    
+    i = 0;
+    XtSetArg (arg[i], XtNiconPixmap, 
+             XCreateBitmapFromData (XtDisplay(toplevel),
+                                    XtScreen(toplevel)->root,
+                                    (char *)eyes_bits, eyes_width, eyes_height));
+    i++;
+    XtSetArg (arg[i], XtNiconMask, 
+             XCreateBitmapFromData (XtDisplay(toplevel),
+                                    XtScreen(toplevel)->root,
+                                    (char *)eyesmask_bits,
+                                    eyesmask_width, eyesmask_height));
+    i++;
+    XtSetValues (toplevel, arg, i);
+
+    (void) XtCreateManagedWidget ("eyes", eyesWidgetClass, toplevel, NULL, 0);
+    XtRealizeWidget (toplevel);
+    (void) XSetWMProtocols (XtDisplay(toplevel), XtWindow(toplevel),
+                            &wm_delete_window, 1);
+    XtAppMainLoop(app_context);
+
+    return 0;
+}
diff --git a/xeyes/xeyes.man b/xeyes/xeyes.man
new file mode 100644 (file)
index 0000000..1685af2
--- /dev/null
@@ -0,0 +1,66 @@
+.\" $XConsortium: xeyes.man,v 1.12 94/04/17 20:45:24 gildea Exp $
+.\"
+.\" $XFree86: xc/programs/xeyes/xeyes.man,v 1.3 2001/01/27 18:21:12 dawes Exp $
+.\"
+.TH XEYES 1 __xorgversion__
+.SH NAME
+xeyes \- a follow the mouse X demo
+.SH SYNOPSIS
+.B xeyes
+[-option ...]
+.SH DESCRIPTION
+.I Xeyes
+watches what you do and reports to the Boss.
+.SH OPTIONS
+.TP 8
+.B \-fg \fIforeground color\fB
+choose a different color for the pupil of the eyes.
+.TP 8
+.B \-bg \fIbackground color\fB
+choose a different color for the background.
+.TP 8
+.B \-outline \fIoutline color\fB
+choose a different color for the outline of the eyes.
+.TP 8
+.B \-center \fIcenter color\fB
+choose a different color for the center of the eyes.
+.TP 8
+.B \-backing \fI{ WhenMapped Always NotUseful }\fB
+selects an appropriate level of backing store.
+.TP 8
+.B \-geometry \fIgeometry\fB
+define the initial window geometry; see \fIX(__miscmansuffix__)\fP.
+.TP 8
+.B \-display \fIdisplay\fB
+specify the display to use; see \fIX(__miscmansuffix__)\fP.
+.TP 8
+.B \-bd \fIborder color\fB
+choose a different color for the window border.
+.TP 8
+.B \-bw \fIborder width\fB
+choose a different width for the window border.
+.TP 8
+.B \-shape
+uses the SHAPE extension to shape the window.  This is the default.
+.TP 8
+.B \+shape
+disables use of the SHAPE extension to shape the window.
+.TP 8
+.B \-render
+uses Xrender to draw anti-aliased eyes.
+This is the default if \fIxeyes\fP has been compiled with Xrender support.
+.TP 8
+.B \+render
+disables Xrender and draws traditional eyes.
+.TP 8
+.B \-distance
+uses an alternative mapping, as if the eyes were set back from the screen, thus following the mouse more precisely.
+.SH "SEE ALSO"
+X(__miscmansuffix__), X Toolkit documentation
+.br
+See \fIX(__miscmansuffix__)\fP for a full statement of rights and permissions.
+.SH AUTHOR
+Keith Packard, MIT X Consortium
+.br
+Copied from the NeWS version written (apparently) by Jeremy Huxtable as seen
+at SIGGRAPH '88
diff --git a/xgc/AUTHORS b/xgc/AUTHORS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xgc/Bugs b/xgc/Bugs
new file mode 100644 (file)
index 0000000..c8ed6f2
--- /dev/null
+++ b/xgc/Bugs
@@ -0,0 +1,11 @@
+Bugs found with xbench
+----------------------
+Lines, FillStyle Solid, Planemask 0, LineWidth 0 - draws lines anyways.
+  other FillStyles work correctly.
+Rectangles - same problem.
+Filled Rectangles, FillStyle other than OpaqueStippled, Planemask 0 - draws
+  rectangles anyways.
+  OpaqueStippled works fine.
+Dashed Lines - sometimes hangs.
+  only happens when lots of lines/short dashes/long lines.
+Lines, Function equiv, LineWidth > 1 - copies instead of equiving.
diff --git a/xgc/COPYING b/xgc/COPYING
new file mode 100644 (file)
index 0000000..1d7ad39
--- /dev/null
@@ -0,0 +1,53 @@
+Copyright (c) 1991  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+Copyright 2009 Sun Microsystems, 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, and/or sell copies of the Software, and to permit persons
+to whom the Software is furnished to do so, provided that the above
+copyright notice(s) and this permission notice appear in all copies of
+the Software and that both the above copyright notice(s) and this
+permission notice appear in supporting documentation.
+
+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
+OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale, use
+or other dealings in this Software without prior written authorization
+of the copyright holder.
+
diff --git a/xgc/ChangeLog b/xgc/ChangeLog
new file mode 100644 (file)
index 0000000..9df271c
--- /dev/null
@@ -0,0 +1,334 @@
+commit e3247097e61ddd8432921f8d52b73f09f6bf23c4
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Nov 10 22:55:23 2009 -0800
+
+    xgc 1.0.2
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 543917eccecd94261ff3cde8f617ca2801fefcd6
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Nov 10 22:54:08 2009 -0800
+
+    Fill in COPYING with notices from main.c & xgc.man
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit fab6c10f50649961059607ff6a43981d72e28c72
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Nov 10 22:25:32 2009 -0800
+
+    Migrate to xorg macros 1.3 & XORG_DEFAULT_OPTIONS
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 90877de1d293d9f0ec47e588a518327b43536c6e
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Nov 10 22:21:23 2009 -0800
+
+    Include more detailed xgc man page description from Solaris
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit d1abdda8c4e84b7df4927260753a8f47d027c6be
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Oct 1 14:54:24 2009 -0700
+
+    Add README with pointers to mailing lists, bugzilla, & git
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 038f559845ac8b8b45f5a53537b011e169d45f59
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Wed Jan 14 19:02:22 2009 -0200
+
+    Xgc now in Technicolor
+    
+      Added a simple Xgc-color resources file.
+      Corrected a bug that would prevent it from showing 100 in percent
+    label, due to using a buffer of 3 bytes.
+      Hardcode "test area" foreground&background to black&white.
+      Remove a few hardcoded resource values to better work with the new
+    resources file (some settings may require moving data from Xgc-color
+    to Xgc, if you don't have a color display).
+
+commit cc62903f999ba0c5076861888106365e3561f775
+Author: Jens Stroebel <dr-xorg@bcsoft.de>
+Date:   Wed Jan 14 06:24:16 2009 -0800
+
+    correcting typo w. regards to XGC_CFLAGS
+    
+    Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
+
+commit 04b994830dfebfed9311f1c3714620ebbdc1f75a
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Jan 13 15:55:19 2009 -0200
+
+    Ansification and compile warning fixes.
+    
+      This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects
+    make distcheck and most gcc 4.3 and sparse warnings.
+
+commit d662fac7b6541571ab9852f4e0290d48f0e97561
+Author: Peter Breitenlohner <peb@mppmu.mpg.de>
+Date:   Mon Nov 10 20:08:37 2008 +0100
+
+    enable VPATH build, reorganize app default files
+
+commit f964031d5f702ad17c76f7e7b1ab91efd56e0f01
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Wed Aug 20 10:32:51 2008 -0400
+
+    xaw8 is gone, use xaw7
+
+commit 16f631981143cdac06f3b7125c8ef2fb45962970
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Thu Mar 27 20:08:02 2008 -0700
+
+    Build fix for file systems that are not case sensitive
+
+commit a269f72e27d1bc368b6ecc5bc076f6f4e08bc1c2
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Jan 22 16:02:26 2008 -0800
+
+    Change xgc_CFLAGS to AM_CFLAGS to make automake-1.10 happier
+    
+    Makefile.am:29: compiling `choice.c' with per-target flags requires `AM_PROG_CC_C_O' in `configure.ac'
+
+commit 8b87daa805cd684eb765872a73c6981eb90fcf9f
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Jan 22 16:01:11 2008 -0800
+
+    Bug 14185: MAINTAINERCLEANFILES multiply defined in Makefile.am
+    
+    <http://bugs.freedesktop.org/show_bug.cgi?id=14185>
+
+commit fa7c9e5a92664b214f2787d07ce8737df75e8e85
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Dec 6 16:37:17 2007 -0500
+
+    Replace static ChangeLog with dist-hook to generate from git log
+
+commit 39311d4f5de1648379dbb0d954090ff6ee82f80f
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Mon Sep 3 05:51:25 2007 -0400
+
+    Add *~ to .gitignore to skip patch/emacs droppings
+
+commit a45aff7c0231080087f15707a0628f71cef60adf
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Aug 23 19:24:51 2007 -0400
+
+    Rename .cvsignore to .gitignore
+
+commit c31f20376c03da9395d6ab4bd46423ffe55d15df
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 21 02:29:50 2005 +0000
+
+    Update package version for X11R7 release.
+
+commit 3371db03f5ee610d5b4538b3c8206775ca8c4aea
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Dec 19 16:22:44 2005 +0000
+
+    Stub COPYING files
+
+commit 225fada87719040b7da4a4a4cf7651704d5f4203
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:24:07 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+commit 62a334ff8c8ad8aac1800096a65885cadc0e4857
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 7 16:18:00 2005 +0000
+
+    Change to use the app-defaults default dir configured in libXt.
+
+commit 676cb92b59b998681eec1f94e549b131357f5f4a
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 6 22:48:22 2005 +0000
+
+    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit eda7026e7b05b60d028acac0adaa95fff5136cf5
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Dec 3 05:49:24 2005 +0000
+
+    Update package version number for X11R7 RC3 release.
+
+commit 5dfb2831c12bfbeff3f8f54f27f4d8f0e35c3134
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Nov 28 22:01:42 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 ac983da50c30042cd3c408b8fb6125d20009b274
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Mon Nov 21 10:35:01 2005 +0000
+
+    Another pass at .cvsignores for apps.
+
+commit 24ade0e366b9dd681c8956005853dd86d14e9623
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Sun Nov 20 22:08:53 2005 +0000
+
+    Add/improve .cvsignore files for apps.
+
+commit 9e1414070bef650f18e326fcd1427f8e2b9c7d7d
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:47:54 2005 +0000
+
+    Update package version number for RC1 release.
+
+commit 677a1f2616a47bec64bddf2d7424551dbf9bcae3
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Oct 18 00:32:54 2005 +0000
+
+    Change default install dir for app-default files from
+        $(sysconfdir)/X11/app-defaults to $(libdir)/X11/app-defaults to match
+        the monolith & allow localization
+
+commit e76fafcfd736eb3a0ee87ad5ba9b51a5e8e8649c
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Oct 17 23:56:22 2005 +0000
+
+    Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to
+        work better with BSD make
+
+commit 68cf52e97a8f3051eb515847f6274998af4e8037
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Oct 15 19:22:35 2005 +0000
+
+    Have generated files be cleaned by maintainer in order to pass
+        check-tarball test.
+
+commit 64d7716266320d32acd3c804060a587623e4f054
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Fri Oct 14 00:25:45 2005 +0000
+
+    Use sed to fill in variables in man page
+
+commit da90b92a612915f9d7053015025785e338ee7a0c
+Author: Keith Packard <keithp@keithp.com>
+Date:   Tue Aug 2 18:10:32 2005 +0000
+
+    Mark generated files as BUILT_SOURCES and CLEANFILES to ensure they are
+        regenerated after 'make clean' and to make parallel builds work right.
+
+commit dea36bb8cdeed1629110cbc407fdb18482d59651
+Author: Keith Packard <keithp@keithp.com>
+Date:   Mon Aug 1 22:20:34 2005 +0000
+
+    dont initialize yylineno in case the lex variant defines it separately (as
+        flex does)
+
+commit ead3a2dc87122b8d6af79efe719362e2d7d4d697
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Aug 1 20:25:30 2005 +0000
+
+    Install man pages to section 1 instead of section m (Patch from Donnie
+        Berkholz)
+
+commit 97cfe91fdcc59406eba5fb2f085362593ea84e72
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sat Jul 30 21:07:26 2005 +0000
+
+    Add prototypes of Xalloc/free functions.
+    Export ImUtil.h to match modular tree install.
+    Define SVR4 to 1 to avoid warning about redefining to different values.
+    Include missing headers to clear more compiler warnings.
+
+commit c6e2c72275eeb266abecc5273fb3257f45e71687
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Jul 29 21:22:34 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 afa5fe1308479c6605c59922b1c61183f259a154
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Jul 26 15:44:02 2005 +0000
+
+    Replace more GNU make-ism's with more portable macros
+
+commit 18b73d71673d73bfb03b238bc20e50ebf2ae48e8
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Sat Jul 23 16:33:41 2005 +0000
+
+    Fix GNU-make only app-defaults rule
+
+commit e32351b3b39517f94e976062f91403a154488359
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed Jul 20 19:31:57 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 23e06fb205c2494dc8c44e976e27ca0a30c30ed2
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Thu Jul 14 22:40:16 2005 +0000
+
+    Add _BSD_SOURCE to lots of applications - patch from Stefan Dirsch
+
+commit 07ed043059d5fc7e8d694f6814eb1ba63946d646
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Tue Jul 5 21:11:37 2005 +0000
+
+    Add build system for xgc
+
+commit ace744607cc888bafb3ba487a11785fd46b65818
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 19:54:48 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+commit 2d5c3705b18672d88db46343c3a55b1768aaeaee
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:35:24 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit ce3e739625e75b9caf59f0a2e0290e3528f0cc8a
+Author: Egbert Eich <eich@suse.de>
+Date:   Wed Mar 3 12:13:08 2004 +0000
+
+    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit 8f8ef8a10885b51d38ef4aad7b36af5897f90e7b
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:36:24 2004 +0000
+
+    readding XFree86's cvs IDs
+
+commit 40d4328f4b4e1a70a227d2359532a667d79cee1c
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 09:24:08 2004 +0000
+
+    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit c059776a3a8a7c760799d1a55c1a130c2179ecc9
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:29:13 2003 +0000
+
+    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit e3dfd7a6398174ae8db6a1c0d5e5590d1dabcf31
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:49:22 2003 +0000
+
+    XFree86 4.3.0.1
+
+commit 82a6e01af6c39e22855495b912c23efddfb17224
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:49:22 2003 +0000
+
+    Initial revision
diff --git a/xgc/INSTALL b/xgc/INSTALL
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xgc/Makefile.am b/xgc/Makefile.am
new file mode 100644 (file)
index 0000000..b7e2fd9
--- /dev/null
@@ -0,0 +1,112 @@
+# 
+#  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 = xgc
+
+AM_CFLAGS = $(CWARNFLAGS) $(XGC_CFLAGS) -D_BSD_SOURCE
+xgc_LDADD = $(XGC_LIBS) -lm
+
+xgc_SOURCES =  \
+        choice.c \
+        constants.h \
+        dashlist.c \
+        getfile.c \
+       gram.y \
+        interpret.c \
+       lex.l \
+        main.c \
+        planemask.c \
+        record.c \
+        testfrac.c \
+        tests.c \
+        text.c \
+        xgc.h
+
+appman_PRE = \
+        xgc.man
+
+BUILT_SOURCES = gram.h gram.c lex.c
+MAINTAINERCLEANFILES = $(BUILT_SOURCES)
+
+gram.h: gram.c
+
+# App default files
+
+DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
+
+appdefaultdir = @appdefaultdir@
+
+dist_appdefault_DATA = \
+        app-defaults/Xgc \
+        app-defaults/Xgc-color
+
+EXTRA_DIST = tile Bugs \
+       Written/FilledRects                                             \
+       Written/Interface                                               \
+       Written/Jim                                                     \
+       Written/Notes                                                   \
+       Written/Notes2                                                  \
+       Written/Outline                                                 \
+       Written/Widget
+
+
+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):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+EXTRA_DIST += ChangeLog
+MAINTAINERCLEANFILES += ChangeLog
+
+.PHONY: ChangeLog
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog
diff --git a/xgc/Makefile.in b/xgc/Makefile.in
new file mode 100644 (file)
index 0000000..fe07316
--- /dev/null
@@ -0,0 +1,857 @@
+# Makefile.in generated by automake 1.11 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = xgc$(EXEEXT)
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(dist_appdefault_DATA) \
+       $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+       $(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \
+       ChangeLog INSTALL NEWS config.guess config.sub depcomp gram.c \
+       gram.h install-sh lex.c missing ylwrap
+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 config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" \
+       "$(DESTDIR)$(appdefaultdir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_xgc_OBJECTS = choice.$(OBJEXT) dashlist.$(OBJEXT) getfile.$(OBJEXT) \
+       gram.$(OBJEXT) interpret.$(OBJEXT) lex.$(OBJEXT) \
+       main.$(OBJEXT) planemask.$(OBJEXT) record.$(OBJEXT) \
+       testfrac.$(OBJEXT) tests.$(OBJEXT) text.$(OBJEXT)
+xgc_OBJECTS = $(am_xgc_OBJECTS)
+am__DEPENDENCIES_1 =
+xgc_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+@MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ ||
+LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS)
+AM_V_LEX = $(am__v_LEX_$(V))
+am__v_LEX_ = $(am__v_LEX_$(AM_DEFAULT_VERBOSITY))
+am__v_LEX_0 = @echo "  LEX   " $@;
+YLWRAP = $(top_srcdir)/ylwrap
+@MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ ||
+YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
+AM_V_YACC = $(am__v_YACC_$(V))
+am__v_YACC_ = $(am__v_YACC_$(AM_DEFAULT_VERBOSITY))
+am__v_YACC_0 = @echo "  YACC  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(xgc_SOURCES)
+DIST_SOURCES = $(xgc_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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+DATA = $(appman_DATA) $(dist_appdefault_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
+ACLOCAL = @ACLOCAL@
+ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
+ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPDEFS_CFLAGS = @APPDEFS_CFLAGS@
+APPDEFS_LIBS = @APPDEFS_LIBS@
+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@
+CHANGELOG_CMD = @CHANGELOG_CMD@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
+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@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+GREP = @GREP@
+INSTALL = @INSTALL@
+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@
+MAKEINFO = @MAKEINFO@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+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@
+XGC_CFLAGS = @XGC_CFLAGS@
+XGC_LIBS = @XGC_LIBS@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+appdefaultdir = @appdefaultdir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+distcleancheck_listfiles = @distcleancheck_listfiles@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_YFLAGS = -d
+AM_CFLAGS = $(CWARNFLAGS) $(XGC_CFLAGS) -D_BSD_SOURCE
+xgc_LDADD = $(XGC_LIBS) -lm
+xgc_SOURCES = \
+        choice.c \
+        constants.h \
+        dashlist.c \
+        getfile.c \
+       gram.y \
+        interpret.c \
+       lex.l \
+        main.c \
+        planemask.c \
+        record.c \
+        testfrac.c \
+        tests.c \
+        text.c \
+        xgc.h
+
+appman_PRE = \
+        xgc.man
+
+BUILT_SOURCES = gram.h gram.c lex.c
+MAINTAINERCLEANFILES = $(BUILT_SOURCES) ChangeLog
+
+# App default files
+DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
+dist_appdefault_DATA = \
+        app-defaults/Xgc \
+        app-defaults/Xgc-color
+
+EXTRA_DIST = tile Bugs Written/FilledRects Written/Interface \
+       Written/Jim Written/Notes Written/Notes2 Written/Outline \
+       Written/Widget $(appman_PRE) ChangeLog
+appmandir = $(APP_MAN_DIR)
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+CLEANFILES = $(appman_DATA)
+SED = sed
+
+# Strings to replace in man pages
+XORGRELSTRING = @PACKAGE_STRING@
+XORGMANNAME = X Version 11
+MAN_SUBSTS = \
+       -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
+       -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
+       -e 's|__xservername__|Xorg|g' \
+       -e 's|__xconfigfile__|xorg.conf|g' \
+       -e 's|__projectroot__|$(prefix)|g' \
+       -e 's|__apploaddir__|$(appdefaultdir)|' \
+       -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
+       -e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \
+       -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
+       -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
+       -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
+
+SUFFIXES = .$(APP_MAN_SUFFIX) .man
+all: $(BUILT_SOURCES) config.h
+       $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .$(APP_MAN_SUFFIX) .man .c .l .o .obj .y
+am--refresh:
+       @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+       $(am__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)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+       @if test ! -f $@; then \
+         rm -f stamp-h1; \
+         $(MAKE) $(AM_MAKEFLAGS) 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) 
+       ($(am__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)'; test -n "$(bindir)" || list=; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p; \
+         then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+xgc$(EXEEXT): $(xgc_OBJECTS) $(xgc_DEPENDENCIES) 
+       @rm -f xgc$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(xgc_OBJECTS) $(xgc_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/choice.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dashlist.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getfile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gram.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interpret.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lex.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/planemask.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/record.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testfrac.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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) '$<'`
+
+.l.c:
+       $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE)
+
+.y.c:
+       $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE)
+install-appmanDATA: $(appman_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)"
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \
+       done
+
+uninstall-appmanDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appmandir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appmandir)" && rm -f $$files
+install-dist_appdefaultDATA: $(dist_appdefault_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appdefaultdir)" || $(MKDIR_P) "$(DESTDIR)$(appdefaultdir)"
+       @list='$(dist_appdefault_DATA)'; test -n "$(appdefaultdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appdefaultdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appdefaultdir)" || exit $$?; \
+       done
+
+uninstall-dist_appdefaultDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_appdefault_DATA)'; test -n "$(appdefaultdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appdefaultdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appdefaultdir)" && rm -f $$files
+
+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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       set x; \
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       $(am__remove_distdir)
+       test -d "$(distdir)" || mkdir "$(distdir)"
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$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
+       -test -n "$(am__skip_mode_fix)" \
+       || 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 $(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-lzma: distdir
+       tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+       $(am__remove_distdir)
+
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+       $(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.lzma*) \
+         unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(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)
+       test -d $(distdir)/_build || exit 0; \
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && am__cwd=`pwd` \
+         && $(am__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 \
+         && cd "$$am__cwd" \
+         || exit 1
+       $(am__remove_distdir)
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+       @$(am__cd) '$(distuninstallcheck_dir)' \
+       && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+          || { echo "ERROR: files left after uninstall:" ; \
+               if test -n "$(DESTDIR)"; then \
+                 echo "  (check DESTDIR support)"; \
+               fi ; \
+               $(distuninstallcheck_listfiles) ; \
+               exit 1; } >&2
+distcleancheck: distclean
+       @if test '$(srcdir)' = . ; then \
+         echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+         exit 1 ; \
+       fi
+       @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+         || { echo "ERROR: files left in build directory after distclean:" ; \
+              $(distcleancheck_listfiles) ; \
+              exit 1; } >&2
+check-am: all-am
+check: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(PROGRAMS) $(DATA) config.h
+installdirs:
+       for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(appdefaultdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 -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
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-appmanDATA install-dist_appdefaultDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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_appdefaultDATA
+
+.MAKE: all check install install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+       clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
+       dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \
+       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-dist_appdefaultDATA install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+       uninstall-am uninstall-appmanDATA uninstall-binPROGRAMS \
+       uninstall-dist_appdefaultDATA
+
+
+gram.h: gram.c
+
+.man.$(APP_MAN_SUFFIX):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+.PHONY: ChangeLog
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+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/xgc/NEWS b/xgc/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xgc/README b/xgc/README
new file mode 100644 (file)
index 0000000..696305b
--- /dev/null
@@ -0,0 +1,26 @@
+xgc is an X11 graphics demo that shows various features of the X11
+core protocol graphics primitives.
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+        http://lists.freedesktop.org/mailman/listinfo/xorg
+
+Please submit bug reports to the Xorg bugzilla:
+
+        https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+The master development code repository can be found at:
+
+        git://anongit.freedesktop.org/git/xorg/app/xgc
+
+        http://cgit.freedesktop.org/xorg/app/xgc
+
+For patch submission instructions, see:
+
+       http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
+For more information on the git code manager, see:
+
+        http://wiki.x.org/wiki/GitPage
+
diff --git a/xgc/Written/FilledRects b/xgc/Written/FilledRects
new file mode 100644 (file)
index 0000000..d72849e
--- /dev/null
@@ -0,0 +1,93 @@
+General concerns
+----------------
+
+Machine type
+Display type
+Display on different machine?
+Visual
+Clipping
+Obscured by cursor
+Background tiling
+The whole software vs. hardware bit: computational overhead vs. time spent
+  drawing
+Planemask
+
+PolyFillRectangle
+-----------------
+Use same test as PolyRectangle?
+Perhaps give FillPoly some of these too, see if it special cases them.
+Fill Rectangle vs. Fill Poly for same size areas would be an
+  interesting comparison.
+
+Things to look for:
+       All it's really doing is setting or unsetting planes.
+       When a whole word is filled, it should be quite fast (just
+       setting it to 0 or ~0).
+       Otherwise, the speed of a single rectangle should be about
+       equal to its size.
+
+Data: 
+       Pixels per second.
+       Average size of rectangle.
+
+GC fields: 
+       function:
+       Tiling: likely to be a lot slower, although for whole words
+               you're just setting it to a certain value, rather than 0.
+               (You also have to look at the y value).  Strange width
+               tiles (are these allowed?) are likely to be real bad.
+       Stippling: also slower - I'm not sure whether or not this would
+               be slower than tiling.  This probably has a greater
+               chance of being done in hardware.
+
+       plane-mask:
+               plane of 0 would be real fast, since it doesn't modify
+               anything.  plane of ~0 should be fast, since it doesn't
+               have to think.  Anything else would probably be
+               proportional to the number of planes...
+
+       subwindow-mode: I don't believe it matters.
+
+       clip-x-origin
+       clip-y-origin
+       clip-mask:
+               Clipping in general should probably increase speed rather
+               than decrease it, unless the clipping region is strange.
+               Possible increase in speed because less change to the
+               display is being made; possible decrease in speed because
+               more thought has to be given to what is drawn or not.
+               Software vs. hardware, I suppose.
+
+Possibly 
+       foreground: similar to plane-mask in its effect, I would think.
+
+       tile: "nice" width tiles would probably be better.  A width which
+               is not a divisor of the length of a word would be
+               significantly slower.  A width the size of a word is
+               probably perfect.  The actual contents of the tile
+               probably don't matter: Any code to check for tiles
+               which could be "simplified" would probably take too much
+               time to execute to do any good.
+
+       stipple: like tile
+
+Other:
+       alignment on word bounaries: fastest when one is changing whole
+       words at a time.  That way, you're just setting whole words to
+       0 or ~0 and not doing any computation.  A 32x1 rectangle should
+       be much faster than a 1x32 rectangle.
+
+---------
+Things to put in test:
+
+Check all alignments.
+Perhaps some sort of comparison between thin rectangles oriented
+  horizontally and oriented vertically.
+Small rectangles, big rectangles: compare pixels/second for each.
+  Good way of computing overhead costs.
+
+---------
+test
+(1-32)x32 at all 32 bits in a word.
+(97-128)x32
+(97-128)x128
diff --git a/xgc/Written/Interface b/xgc/Written/Interface
new file mode 100644 (file)
index 0000000..7b40562
--- /dev/null
@@ -0,0 +1,9 @@
+The command buttons at the top -
+
+  Benchmark Options, Graphics Options, etc. 
+
+should just bring up the window, not force you to use it.
+
+1) It is nicer to the person who might want to have both up at once.
+
+2) It is nicer to the programmer who doesn't know how to focus events.
diff --git a/xgc/Written/Jim b/xgc/Written/Jim
new file mode 100644 (file)
index 0000000..e370cd5
--- /dev/null
@@ -0,0 +1,255 @@
+The Commands menu should contain the following items:
+
+    Run                                                [the selected benchmark]
+    Benchmark Options.../Hide Benchmark Options                        [toggle]
+    Graphics Options.../Hide Graphics Options                          [toggle]
+    Describe Test.../Hide Test Description                             [toggle]
+    Start Recording/Stop Recording                                     [toggle]
+    Playback                        [pop up a dialogue box asking for filename]
+    --------
+    Quit                   [pop up a dialogue box asking if we are really done]
+
+
+The Benchmark Options sheet should contain the information shown below.  The
+list of graphics primitives was derived from the "Definition of the Porting
+Layer for the X v11 Sample Server" by Angebranndt et al. and from the Protocol
+document.
+
+
+                              Benchmark Options
+
+
+            +-----------------------+-----------------------+
+ Test       |      Copy Area        |      Copy Plane       |
+            +-----------------------+-----------------------+
+            |        Points         |        Lines          |
+            +-----------------------+-----------------------+
+            |       Segments        |      Rectangles       |
+            +-----------------------+-----------------------+
+            |         Arcs          |    Filled Polygons    |
+            +-----------------------+-----------------------+
+            |   Filled Rectangles   |      Filled Arcs      |
+            +-----------------------+-----------------------+
+            |       Put Image       |       Get Image       |
+            +-----------------------+-----------------------+
+            |        Text 8         |      Image Text 8     |
+            +-----------------------+-----------------------+
+            |        Text 16        |      Image Text 16    |
+            +-----------------------+-----------------------+
+
+            +---------+
+ Iterations |   10000 |
+            +---------+
+
+            +----+-----+                         +----+-----+
+ Record     | on | off |          Describe Test  | on | off |
+            +----+-----+                         +----+-----+
+
+            +-----------------------------------------------+
+ Filename   |                                  ./xbench.log |
+            +-----------------------------------------------+
+
+
+*******************************************************************************
+
+
+The Graphics Options area would contain the following entries:
+
+    Function - one-of { clear, and, andReverse, copy, andInverted, noop, xor, 
+                       or, nor, equiv, invert, orReverse, copyInverted, 
+                       orInverted, nand, set }
+    PlaneMask - unsigned value or many-of-n representing bits
+    Foreground - unsigned value in range 0..2^nplanes
+    Background - unsigned value in range 0..2^nplanes
+    ForegroundColor - set rgb value of Foreground
+    BackgroundColor - set rgb value of background
+    LineWidth - unsigned number in range 0..65535
+    LineStyle - oneof { Solid, OnOffDash, DoubleDash }
+    CapStyle - one-of { NotLast, Butt, Round, Projecting }
+    JoinStyle - one-of { Miter, Round, Bevel }
+    FillStyle - one-of { Solid, Tiled, OpaqueStippled, Stippled }
+    FillRule - one-of { EvenOdd, Winding }
+    ArcMode - one-of { Chord, PieSlice }
+    # Tile - pixmap [probably not edittable in first version]
+    # Stipple - pixmap [probably not edittable in first version]
+    TileStipXOrigin - signed number in range -32768..32767
+    TileStipYOrigin - signed number in range -32768..32767
+    Font - name of font
+    ClipXOrigin - signed number in range -32768..32767
+    ClipYOrigin - signed number in range -32768..32767
+    ClipMask - one-of { None, select } [user selects by clicking in work area]
+    DashOffset - unsigned number in range -32768..32767
+    DashList - many-of-n of 8 boxes for defining dashes
+
+
+
+
+                              Graphics Options
+
+
+             +--------------+--------------+--------------+--------------+
+ Function    |     clear    |      and     |  andReverse  |     copy     |
+             +--------------+--------------+--------------+--------------+
+             | andInverted  |     noop     |      xor     |      or      |
+             +--------------+--------------+--------------+--------------+
+             |      nor     |     equiv    |    invert    |   orReverse  |
+             +--------------+--------------+--------------+--------------+
+             | copyInverted |  orInverted  |     nand     |      set     |
+             +--------------+--------------+--------------+--------------+
+
+             +-----+---------+
+ Colormap    | new | default |
+             +-----+---------+
+
+             +----------+                     +--------+--------+--------+
+ Foreground  |        1 |    ForegroundColor  |  ffff  |  ffff  |  ffff  |
+             +----------+                     +--------+--------+--------+
+
+             +----------+                     +--------+--------+--------+
+ Background  |        0 |    BackgroundColor  |  0000  |  0000  |  0000  |
+             +----------+                     +--------+--------+--------+
+
+             +------+                   +-------+-----------+------------+
+ LineWidth   |    3 |        LineStyle  | Solid | OnOffDash | DoubleDash |
+             +------+                   +-------+-----------+------------+
+
+             +---------+------+-------+------------+
+ CapStyle    | NotLast | Butt | Round | Projecting |
+             +---------+------+-------+------------+
+
+             +-------+-------+-------+
+ JoinStyle   | Miter | Round | Bevel |
+             +-------+-------+-------+
+
+             +-------+-------+----------+----------------+
+ FillStyle   | Solid | Tiled | Stippled | OpaqueStippled |
+             +-------+-------+----------+----------------+
+
+             +---------+---------+
+ FillRule    | EvenOdd | Winding |
+             +---------+---------+
+
+             +-------+----------+
+ ArcMode     | Chord | PieSlice |
+             +-------+----------+
+
+             +--------------+
+ TStipOrigin | +####, +#### |
+             +--------------+
+
+             +-+-+-+-+-+-+-+-+                                   +-------+
+ DashList    | | |X|X| | |X|X|                       DashOffset  | +#### |
+             +-+-+-+-+-+-+-+-+                                   +-------+
+
+             +----+-----+-----+-------+                         +--------+
+ ClipMask    | on | off | set | clear |             PlaneMask   |  ffff  |
+             +----+-----+-----+-------+                         +--------+
+
+
+*******************************************************************************
+
+                                   Grammar
+
+
+Both to support Record/Playback (used for debugging, demonstrations, and for
+creating benchmark scripts), there needs to be a command line language that
+can be used to set all options.  Although we won't be doing anything as
+sophisticated as what is provided in many UIMS's, it would be nice to keep
+the application section of the benchmark as separate as possible from the
+user interface.
+
+    test  { CopyArea, CopyPlane, PolyPoint, PolyLine, PolySegment, 
+           PolyRectangle, PolyArc, FillPolygon, PolyFillRect, PolyFillArc,
+           PutImage, GetImage, ImageText8, PolyText8, ImageText16,
+           PolyText16 }
+       -  selects the test to be performed.
+
+    colormap  { new, default }
+       -  selects which colormap should be used for test
+
+    iterations UNSIGNEDNUMBER
+       -  specifies the number of times that the test should be run.
+
+    record BOOLEAN
+       -  indicates whether or not to record commands into the record-file.
+
+    record-file  FILENAME
+       -  specifies the name of the file into which commands are recorded.
+
+    describe  BOOLEAN
+       -  indicates whether or not a description of the test should be 
+          displayed whenever a test is selected (or when this option is
+          specified).
+
+    function  { clear, and, andReverse, copy, andInverted, noop, xor, or, nor,
+               equiv, invert, orReverse, copyInverted, orInverted, nand, set }
+       -  selects the alu function to use in the GC.
+
+    foreground UNSIGNEDNUMBER
+       -  selects the foreground pixel value to use in the GC; if a new
+          colormap is being used, the RGB value for this slot may be changed.
+
+    background UNSIGNEDNUMBER
+       -  selects the background pixel value to use in the GC; if a new
+          colormap is being used, the RGB value for this slot may be changed.
+
+    forecolor COLORNAME
+       -  specifies the RGB value or name of the color to be used for the 
+          foreground pixel, if settable.
+
+    backcolor COLORNAME
+       -  specifies the RGB value or name of the color to be used for the 
+          background pixel, if settable.
+
+    linewidth NUMBER
+       -  specifies width of lines to use in the GC.
+
+    linestyle  { Solid, OnOffDash, DoubleDash }
+       -  selects the type of lines to use in the GC.
+
+    capstyle  { NotLast, Butt, Round, Projecting }
+       -  selects the type of caps to use in the GC.
+
+    joinstyle  { Miter, Round, Bevel }
+       -  selects the type of joins to use in the GC.
+
+    fillstyle  { Solid, Tiled, Stippled, OpaqueStippled }
+       -  selects the type of fills to use in the GC.
+
+    fillrule  { EvenOdd, Winding }
+       -  selects the fill rule to be used in the GC.
+
+    arcmode  { Chord, PieSlice }
+       -  selects the type of arcs to be drawn in the GC.
+
+    tsorigin  NUMBER  NUMBER
+       -  specifies the X and Y values of the TileStippleOrigin in the GC.
+
+    dashlist  DASHPATTERN
+       -  specifies a pattern of 8 binary digits to use in the dashlist
+          in the GC; the characters are given in big-endian order such that
+          they may be read in binary to form a number between 0 and 255.
+
+    dashoffset  NUMBER
+       -  specifies the dashoffset to use in the GC.
+
+    cliporigin  NUMBER  NUMBER
+       -  specifies the X and Y values of the cliporigin in the GC.
+
+    clipmask  { on, off, set NUMBER NUMBER NUMBER NUMBER, clear }
+       -  selects a clipping mode.  If "on", then use the most recently
+          defined set of clipping rectangles; if "off", then do not do
+          any clipping but keep the clipping rectangles for future
+          reference; if "set", then add the rectangle specified by
+          the remaining numeric arguments as X1 Y1 X2 Y2 relative to the
+          cliporigin.
+
+    planemask  NUMBER
+       -  specifies the set of planes on to which graphics may be drawn
+          in the GC.
+
+    run
+       -  run the currently configured test.
+
+    quit
+       -  exit the program
diff --git a/xgc/Written/Notes b/xgc/Written/Notes
new file mode 100644 (file)
index 0000000..3b9f416
--- /dev/null
@@ -0,0 +1,296 @@
+
+
+ClearArea
+---------
+Basically a special case of PolyFillRect.  Put up some sort of image first
+so we can clear it away.  Try both small areas and big areas, to give
+credit to servers for optimizing small ones.
+
+Data: Pixels per second.
+      Breaking that down into large and small areas would probably not
+        be userful.
+      
+GC Fields: None.
+
+
+CopyArea
+--------
+Putting up some image and then repeatedly copying from one part of it
+to another would do the right thing and could look neat if done right.
+
+We probably want to see what happens when the source area is clipped,
+as that as mentioned specifically in the protocol document.
+
+Data: Pixels per second.
+      
+GC Fields: function             (*)
+           plane-mask
+          subwindow-mode
+          graphics-exposures
+          clip-x-origin
+          clip-y-origin
+          clip-mask
+
+
+CopyPlane
+---------
+Special case of CopyArea again.
+
+
+PolyPoint
+---------
+Draw lots of points.
+Either start out with an image that's 50/50 black and white
+(preferred) or draw enough points that some points will get drawn at
+least twice (to test functions other than copy).
+
+Data: Points per second.
+
+GC fields: function             (*)
+           plane-mask
+           foreground
+           subwindow-mode
+           clip-x-origin
+           clip-y-origin
+          clip-mask
+
+
+PolyLine
+--------
+Circular test like there is now.
+Try clipping at window boundaries?
+
+Data: Lines per second.
+      Pixels per second (is this valid - do lines that are twice as
+        long take twice as long to draw? Also, is it valid to compare
+        thin lines and fat lines?)
+GC fields: function             (*)
+           plane-mask
+           line-width           (*)
+           line-style          (*)
+           cap-style           (*)
+           join-style          (*)
+           fill-style          (*)
+           subwindow-mode
+           clip-x-origin
+           clip-y-origin
+           clip-mask
+Possibly   foreground
+           background
+           tile                        (*)
+           stipple             (*)
+           tile-stipple-x-origin
+          tile-stipple-y-origin
+          dash-offset
+          dashes               (*)
+
+
+PolySegment
+-----------
+Just like PolyLine but lines don't have to be connected. Crosshatching?
+
+Data: Lines per second, pixels per second(?)
+
+GC fields: function
+       plane-mask
+       line-width
+       line-style
+       cap-style
+       fill-style
+       subwindow-mode
+       clip-x-origin
+       clip-y-origin
+       clip-mask
+Possibly  foreground
+       background
+       tile
+       stipple
+       tile-stipple-x-origin
+       tile-stipple-y-origin
+       dash-offset
+       dashes
+
+
+PolyRectangle
+-------------
+Lots of five point PolyLines.  Partly concentric ones would look nice; we
+also need overlap for testing different functions.
+
+Data: Rectangles per second.
+       Pixels per second? (divide by perimeter)
+
+GC fields: function
+       plane-mask
+       line-width
+       line-style
+       join-style
+       fill-style
+       subwindow-mode
+       clip-x-origin
+       clip-y-origin
+       clip-mask
+Possibly foreground
+       background
+       tile
+       stipple
+       tile-stipple-x-origin
+       tile-stipple-y-origin
+       dash-offset
+       dashes
+
+
+PolyArc
+-------
+Overlapping concentric things (ripples) would look cool.
+Is it possible to special-case circles?  Test for this?
+
+Data: Arcs per second?  If we had the same test each time this might
+        be OK.
+      Pixels per second?  Finding the length of an arc could be
+        annoying.
+
+GC fields: function
+       plane-mask
+       line-width
+       line-style
+       cap-style
+       join-style
+       fill-style
+       subwindow-mode
+       clip-x-origin
+       clip-y-origin
+       clip-mask
+Possibly foreground
+       background
+       tile
+       stipple
+       tile-stipple-x-origin
+       tile-stipple-y-origin
+       dash-offset
+       dashes
+
+
+FillPoly
+--------
+Use the same test as PolyLine?
+Overlapping is a must to test functions.
+Convex vs. Concave polygons.
+
+Data: Pixels per second, I guess.
+      Data for convex vs. concave could be interesting.
+
+GC fields: function
+       plane-mask
+       fill-style
+       fill-rule
+       subwindow-mode
+       clip-x-origin
+       clip-y-origin
+       clip-mask
+Possibly foreground
+       background
+       tile
+       stipple
+       tile-stipple-x-origin
+       tile-stipple-y-origin
+
+
+PolyFillRectangle
+-----------------
+Use same test as PolyRectangle?
+Perhaps give FillPoly some of these too, see if it special cases them.
+Fill Rectangle vs. Fill Poly for same size areas would be an
+  interesting comparison.
+
+Data: Pixels per second.
+
+GC fields: function
+       plane-mask
+       fill-style
+       subwindow-mode
+       clip-x-origin
+       clip-y-origin
+       clip-mask
+Possibly foreground
+       background
+       tile
+       stipple
+       tile-stipple-x-origin
+       tile-stipple-y-origin
+
+
+PolyFillArc
+-----------
+Use same test as PolyArc?
+
+Data: Pixels per second would be hard to compute, but what else is there?
+
+GC fields: function
+       plane-mask
+       fill-style
+       arc-mode
+       subwindow-mode
+       clip-x-origin
+       clip-y-origin
+       clip-mask
+Possibly foreground
+       background
+       tile
+       stipple
+       tile-stipple-x-origin
+       tile-stipple-y-origin
+
+
+PutImage
+--------
+
+GC fields: function
+       plane-mask
+       subwindow-mode
+       clip-x-origin
+       clip-y-origin
+       clip-mask
+Possibly foreground
+       background
+
+
+GetImage
+--------
+
+PolyText8
+---------
+
+GC fields: function
+       plane-mask
+       fill-style
+       font
+       subwindow-mode
+       clip-x-origin
+       clip-y-origin
+       clip-mask
+Possibly foreground
+       background
+       tile
+       stipple
+       tile-stipple-x-origin
+       tile-stipple-y-origin
+
+
+PolyText16
+----------
+
+ImageText8
+----------
+
+GC fields: plane-mask
+       foreground
+       background
+       font
+       subwindow-mode
+       clip-x-origin
+       clip-y-origin
+       clip-mask
+
+ImageText16
+---------
diff --git a/xgc/Written/Notes2 b/xgc/Written/Notes2
new file mode 100644 (file)
index 0000000..cf3d99d
--- /dev/null
@@ -0,0 +1,68 @@
+                     C |C |C |P |P |P |P |P |F |P |P |P |G |P |P |I |I |
+             l |o |o |o |o |o |o |o |i |o |o |u |e |o |o |m |m |
+             e |p |p |l |l |l |l |l |l |l |l |t |t |l |l |a |a |
+             a |y |y |y |y |y |y |y |l |y |y |I |I |y |y |g |g |
+             r |A |P |P |L |S |R |A |P |F |F |m |m |T |T |e |e |
+             A |r |l |o |i |e |e |r |o |i |i |a |a |e |e |T |T |
+             r |e |a |i |n |g |c |c |l |l |l |g |g |x |x |e |e |
+             e |a |n |n |e |m |t |  |y |l |l |e |e |t |t |x |x |
+             a |  |e |t |  |e |a |  |  |R |A |  |  |8 |1 |t |t |
+               |  |  |  |  |n |n |  |  |e |r |  |  |  |6 |8 |1 |
+               |  |  |  |  |t |g |  |  |c |c |  |  |  |  |  |6 |
+               |  |  |  |  |  |l |  |  |t |  |  |  |  |  |  |  |
+               |  |  |  |  |  |e |  |  |a |  |  |  |  |  |  |  |
+                |  |  |  |  |  |  |  |  |n |  |  |  |  |  |  | |
+                |  |  |  |  |  |  |  |  |g |  |  |  |  |  |  | |
+                |  |  |  |  |  |  |  |  |l |  |  |  |  |  |  | |
+                |  |  |  |  |  |  |  |  |e |  |  |  |  |  |  | |
+                |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | |
+                |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | |
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+function        |XX|  |XX|XX|XX|XX|XX|XX|XX|XX|XX|  |XX|XX|  | |
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+plane_mask     |XX|  |XX|XX|XX|XX|XX|XX|XX|XX|XX|  |XX|XX|XX|XX|
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+foreground      |  |  |XX|**|**|**|**|**|**|**|**|  |**|**|XX|XX|
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+background     |  |  |  |**|**|**|**|**|**|**|**|  |**|**|XX|XX|
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+line_width     |  |  |  |XX|XX|XX|XX|  |  |  |  |  |  |  |  |  |
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+line_style     |  |  |  |XX|XX|XX|XX|  |  |  |  |  |  |  |  |  |
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+cap_style      |  |  |  |XX|XX|  |XX|  |  |  |  |  |  |  |  |  |
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+join_style     |  |  |  |XX|  |XX|XX|  |  |  |  |  |  |  |  |  |
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+fill_style     |  |  |  |XX|XX|XX|XX|XX|XX|XX|  |  |XX|XX|  |  |
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+fill_rule      |  |  |  |  |  |  |  |XX|  |  |  |  |  |  |  |  |
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+arc_mode       |  |  |  |  |  |  |  |  |  |XX|  |  |  |  |  |  |
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+tile           |  |  |  |**|**|**|**|**|**|**|  |  |**|**|  |  |
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+stipple         |  |  |         |**|**|**|**|**|**|**|  |  |**|**|  |  |
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+ts_x_origin    |  |  |  |**|**|**|**|**|**|**|  |  |**|**|  |  |
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+ts_y_origin    |  |  |  |**|**|**|**|**|**|**|  |  |**|**|  |  |
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+font           |  |  |  |  |  |  |  |  |  |  |  |  |XX|XX|XX|XX|
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+subwindow_mode |XX|  |XX|XX|XX|XX|XX|XX|XX|XX|XX|  |XX|XX|XX|XX|
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+exposures              |XX|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+clip_x_origin  |XX|  |XX|XX|XX|XX|XX|XX|XX|XX|XX|  |XX|XX|XX|XX|
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+clip_y_origin  |XX|  |XX|XX|XX|XX|XX|XX|XX|XX|XX|  |XX|XX|XX|XX|
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+clip_mask      |XX|  |XX|XX|XX|XX|XX|XX|XX|XX|XX|  |XX|XX|XX|XX|
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+dash_offset    |  |  |  |**|**|**|**|  |  |  |  |  |  |  |  |  |
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+dashes         |  |  |  |**|**|**|**|  |  |  |  |  |  |  |  |  |
+----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 
+
+
diff --git a/xgc/Written/Outline b/xgc/Written/Outline
new file mode 100644 (file)
index 0000000..d83f3e5
--- /dev/null
@@ -0,0 +1,191 @@
+
+                        Outline for Xbench
+                        ------------------
+
+GENERAL
+-------
+
+Stuff starting with '-' are callbacks for that widget.
+'<>' means whatever is appropriate.
+
+Choice widgets will either be implemented as a new type of widget or a
+form containing a bunch of Command widgets.  The automatic callbacks for
+the commands are:
+   - set all children of parent to normal colors
+   - set oneself to reverse colors
+There will be a
+   - put <> in buffer, specified by the parent widget
+There will also be a
+   - put <>\n in buffer
+specific to each command.
+
+In general, the buffer does not need to be looked at until the test is
+actually run; however, if we decide to "gray out" choices in the Graphics
+Options window that have nothing to do with the benchmark, then choosing
+a benchmark must flush also.
+
+Widgets - we need to decide whether the windows that are turn-on-and-offable
+should be children of Form, or of TopLevel.  If they're children of Form,
+then the user won't be able to stack them or have a say in where they go.
+We also might run out of space.  If they're children of TopLevel, the user
+can decide where they go, but he's going to have to choose their location
+(with the wm) every time they come up.  I would vote for the latter approach.
+(Uh oh... I don't think that the TopLevel widget can have more than one
+child...)
+
+All choosing Widgets should write strings in the Xbench language to some
+buffer, where the actual testing thing can pull them out.
+
+
+
+HIERARCHY OF WIDGETS
+--------------------
+
+Form (form) surrounding the whole thing (owned by TopLevel)
+Title (label) on top describing version & current test (owned by Form)
+MenuLine (form) under Title giving top level choices (owned by Form)
+MenuLine contains these Commands:
+   Run
+       - flush the buffer
+       - run benchmark
+   BenchmarkOptionsOn
+       - map benchmark options window (BenchmarkOptions)
+   BenchmarkOptionsOff
+       - unmap benchmark options window
+   GraphicsOptionsOn
+       - map graphics options window (GraphicsOptions)
+   GraphicsOptionsOff
+       - unmap graphics options window
+   DescriptionOn
+       - map description window (Description)
+   DescriptionOff
+       - unmap description window
+   RecordingOn
+       - bring up dialog box for name of file
+       - start saving commands into file (set a global boolean TRUE)
+   RecordingOff
+       - stop saving commands into file (set the global boolean FALSE)
+   Playback
+       - bring up dialog box for name of file
+       - read from file until EOF
+   Quit
+       - quit
+   
+The toggling command buttons exist in pairs, of which only one is visible at
+any one point.  This makes callbacks/names of buttons easier to implement.
+
+---
+
+BenchmarkOptions (form) describing benchmark options (owned by Toplevel?)
+BenchmarkOptions contains:
+   TestChoice (choice) the 16 different test choices.
+       - put "test <>" in buffer
+       - put description of test in Description window
+       - call disable_gc_choices() with the GC field flags
+   Iterations (text) the number of times to run.
+       - put "iterations <>" in buffer
+   
+---
+
+GraphicsOptions (form) describing graphics options (owned by Toplevel?)
+GraphicsOptions contains:
+   ChooseFunction (choice)
+       - put "function <>" in buffer
+   ChooseColormap (choice)
+       - put "colormap <>" in buffer
+   Foreground (text)
+       - put "foreground <>" in buffer
+   Background (text)
+       - put "background <>" in buffer
+   LineWidth (text)
+       - put "linewidth <>" in buffer
+   LineStyle (choice)
+       - put "linestyle <>" in buffer
+   CapStyle (choice)
+       - put "capstyle <>" in buffer
+   JoinStyle (choice)
+       - put "joinstyle <>" in buffer
+   FillStyle (choice)
+       - put "fillstyle <>" in buffer
+   FillRule (choice)
+       - put "fillrule <>" in buffer
+   ArcMode (choice)
+       - put "arcmode <>" in buffer
+   TStipOrigin (text * 2)
+       - put "tsorigin <>" in buffer
+   DashList (???)
+       - put "dashlist <>" in buffer
+   DashOffset (text?)
+       - put "dashoffset <>" in buffer
+   ClipMask (choice)
+       - put "clipmask <>" in buffer
+   Planemask (text)
+       - put "planemask <>" in buffer
+
+We need specialized widgets for DashList, possibly TStipOrigin and DashOffset.
+
+Still to be decided: can one choose GC options that have no meaning for that
+  particular benchmark? I don't think it should be a problem.
+
+---
+
+Description (text) describing the current test (owned by Toplevel?)
+
+I really need to find out how to use sources and sinks for Text widgets -
+the documentation does not say how to do it.
+
+Every test will have a block of text associated with it.  When a new 
+benchmark is chosen, its associated text will become the source for the
+Description widget.  Note that we don't have to worry about whether 
+Description is mapped or not; we're just setting a source.
+
+---
+
+Analysis (text) describing the results of the current test (owned by Form -
+we always want this to be around)
+
+This will display the name of the test, the important values of the GC,
+the results of the test, and a short analysis thereof.  If more than
+one test of a particular benchmark is performed, it will be appended to
+the analysis source (not replacing it).  This will allow for comparing
+results obtained with different GC's.
+
+---
+
+Test (core + expose event handler) for doing the test.
+
+All this really needs to do, besides actually doing the test, is to
+time it and make sure the Analysis part knows about it.
+
+---
+
+RecordingOn / RecordingOff / Playback
+
+When the user presses Playback, pretty much all we have to do is to
+1) change the buffer to the file that he wants, and 2) start reading.
+The rest should be taken care of the buffer-interpreting module.
+
+RecordingOn changes the output buffer _and_ the input buffer to the 
+desired file.
+       
+RecordingOff changes them both back to the usual.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/xgc/Written/Widget b/xgc/Written/Widget
new file mode 100644 (file)
index 0000000..c653dfd
--- /dev/null
@@ -0,0 +1,26 @@
+What we need is a widget which presents a collection of buttons.  The user
+can select only one of them at a time.  When one is selected, its 
+foreground and background colors should be reversed and stay that way
+until another one is selected.  Exactly one button can be selected at
+any one time.
+
+Possible implementations:
+
+1.  As a new kind of widget.  bleah.
+
+
+2.  Box surrounding a lot of command buttons.  The command buttons have
+    the appropriate callbacks.
+
+Callbacks:  a) set all buttons to normal colors
+            b) set this button to reverse colors
+            c) change the appropriate variable to the desired value.
+
+    This can all be done at the time of creation, thus the buttons would
+    be invisible to the rest of the program (a good thing).
+
+
+
+(2) would be a heck of a lot easier to program, since creating widgets is
+a bitch.  However, (1) could come in handy outside of this program.  Perhaps
+write it using (2) and switch to (1) if/when we can get the widget working.
diff --git a/xgc/aclocal.m4 b/xgc/aclocal.m4
new file mode 100644 (file)
index 0000000..684599f
--- /dev/null
@@ -0,0 +1,1766 @@
+# generated automatically by aclocal 1.11 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009  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.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
+[m4_warning([this file was generated for autoconf 2.63.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# 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, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# 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])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+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, 2006, 2009
+# 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 10
+
+# 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], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$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
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    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, 2006, 2008, 2009 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 16
+
+# 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.62])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
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+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
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_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)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+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
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_AM_DEPENDENCIES(OBJC)],
+                 [define([AC_PROG_OBJC],
+                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# 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_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
+                         (and sometimes confusing) to the casual installer],
+      [USE_MAINTAINER_MODE=$enableval],
+      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  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, 2009  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_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.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
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+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, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# 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
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# 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, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _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],
+[m4_foreach_w([_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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# 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
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# 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) 2009  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 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# 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="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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
+
+dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
+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 ensure that this macro is defined, also add:
+# m4_ifndef([XORG_MACROS_VERSION],
+#     [m4_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.
+m4_defun([XORG_MACROS_VERSION],[
+m4_define([vers_have], [1.3.0])
+m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
+m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
+m4_if(m4_cmp(maj_have, maj_needed), 0,,
+    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
+m4_if(m4_version_compare(vers_have, [$1]), -1,
+    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
+m4_undefine([vers_have])
+m4_undefine([maj_have])
+m4_undefine([maj_needed])
+]) # 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])
+       # under Cygwin unix is still defined even with -undef
+       elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+               RAWCPPFLAGS="-undef -ansi"
+               AC_MSG_RESULT([yes, with -ansi])
+       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],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+
+if test x"$cross_compiling" = x"yes" ; then
+  HAVE_DEFS_ENT=no
+else
+  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+fi
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+AC_PATH_PROG(PS2PDF, ps2pdf)
+
+AC_MSG_CHECKING([Whether to build documentation])
+
+if test x$HAVE_DEFS_ENT != 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 && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([Whether to build text documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([Whether to build PDF documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([Whether to build PostScript documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([Whether to build HTML documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# 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,
+       AS_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, [AS_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, [AS_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
+
+# XORG_CWARNFLAGS
+# ---------------
+# Minimum version: 1.2.0
+#
+# Defines CWARNFLAGS to enable C compiler warnings.
+#
+AC_DEFUN([XORG_CWARNFLAGS], [
+AC_REQUIRE([AC_PROG_CC])
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+AC_SUBST(CWARNFLAGS)
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+]) # XORG_CWARNFLAGS
+
+# XORG_STRICT_OPTION
+# -----------------------
+# Minimum version: 1.3.0
+#
+# Add configure option to enable strict compilation
+AC_DEFUN([XORG_STRICT_OPTION], [
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CC_C99])
+AC_REQUIRE([XORG_CWARNFLAGS])
+
+AC_ARG_ENABLE(strict-compilation,
+                         AS_HELP_STRING([--enable-strict-compilation],
+                         [Enable all warnings from compiler and make them errors (default: disabled)]),
+                         [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
+if test "x$STRICT_COMPILE" = "xyes"; then
+       AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+       AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+AC_SUBST([CWARNFLAGS])
+]) # XORG_STRICT_OPTION
+
+# XORG_DEFAULT_OPTIONS
+# --------------------
+# Minimum version: 1.3.0
+#
+# Defines default options for X.Org modules.
+#
+AC_DEFUN([XORG_DEFAULT_OPTIONS], [
+XORG_CWARNFLAGS
+XORG_STRICT_OPTION
+XORG_RELEASE_VERSION
+XORG_CHANGELOG
+XORG_MANPAGE_SECTIONS
+]) # XORG_DEFAULT_OPTIONS
+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.  Also
+# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+AC_DEFUN([XORG_RELEASE_VERSION],[
+       AC_ARG_WITH(release-version,
+                       AS_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
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+               [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+               [Major version of this package])
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+               [$PVM],
+               [Minor version of this package])
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+               [$PVP],
+               [Patch version of this package])
+])
+
+# XORG_CHANGELOG()
+# ----------------
+# Minimum version: 1.2.0
+#
+# Defines the variable CHANGELOG_CMD as the command to generate
+# ChangeLog from git.
+#
+# Arrange that distcleancheck ignores ChangeLog left over by distclean.
+#
+AC_DEFUN([XORG_CHANGELOG], [
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
+mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+AC_SUBST([CHANGELOG_CMD])
+AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
+]) # XORG_CHANGELOG
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# 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 "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _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 --print-errors "$2" 2>&1`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       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 <http://pkg-config.freedesktop.org/>.])],
+               [$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
+
diff --git a/xgc/app-defaults/Xgc b/xgc/app-defaults/Xgc
new file mode 100644 (file)
index 0000000..7695abb
--- /dev/null
@@ -0,0 +1,2 @@
+*planemask*ShapeStyle: rectangle
+*dashlist*ShapeStyle: rectangle
diff --git a/xgc/app-defaults/Xgc-color b/xgc/app-defaults/Xgc-color
new file mode 100644 (file)
index 0000000..e70d869
--- /dev/null
@@ -0,0 +1,55 @@
+*Foreground:                           rgb:2/3/1
+*Background:                           rgb:c/d/b
+*BorderWidth:                          0
+
+*Label.justify:                                left
+*Text.Background:                      rgb:d/e/c
+*Text.displayList:                     foreground rgb:f/f/d;segments 1,-1,-2,-1, -1,-2,-1,1;foreground rgb:7/7/5;segments -2,0,1,0, 0,1,0,-2
+*Form.displayList:                     foreground rgb:7/7/5;segments 1,-1,-2,-1, -1,-2,-1,1;foreground rgb:f/f/d;segments -2,0,1,0, 0,1,0,-2
+
+*Label.width:                          130
+*Label.left:                           chainLeft
+*Label.right:                          chainLeft
+*topform.Form.displayList:             foreground rgb:e/e/e;segments 1,-1,-2,-1, -1,-2,-1,1;foreground rgb:4/4/4;segments -2,0,1,0, 0,1,0,-2
+*topform.Form.Form.displayList:
+
+*topform.Form.linestyle.Toggle.width:  123
+*topform.Form.capstyle.Toggle.width:   185
+*topform.Form.joinstyle.Toggle.width:  123
+*topform.Form.fillstyle.Toggle.width:  185
+*topform.Form.fillrule.Toggle.width:   185
+*topform.Form.arcmode.Toggle.width:    185
+*topform.Form.linewidth.Text.width:    372
+*topform.Form.font.Text.width:         372
+*topform.Form.foreground.Text.width:   110
+*topform.Form.background.Text.width:   110
+*topform.Form.testpercent.100.Background:      rgb:b/c/a
+*topform.Form.testpercent.100.displayList:     foreground rgb:e/e/c;segments 1,-1,-2,-1, -1,-2,-1,1;foreground rgb:5/5/3;segments -2,0,1,0, 0,1,0,-2
+*topform.Form.testpercent.100.justify:right
+*topform.Form.testpercent.100.width:   30
+*topform.Form.testpercent.100.left:    chainLeft
+*topform.Form.testpercent.100.right:   chainRight
+*topform.Form.testpercent.100.borderWidth:     0
+*topform.Form.testpercent.Scrollbar.width:     332
+*topform.Form.testpercent.Scrollbar.displayList:       foreground rgb:e/e/c;segments 1,-1,-2,-1, -1,-2,-1,1;foreground rgb:5/5/3;segments -2,0,1,0, 0,1,0,-2
+
+*topform.Form.testpercent.Scrollbar.Background:        rgb:b/c/a
+
+*Toggle.borderWidth:                   1
+*Toggle.borderColor:                   rgb:6/8/6
+*Toggle.justify:                       left
+*Toggle.foreground:                    rgb:2/4/2
+*Toggle.background:                    rgb:8/a/8
+*Toggle.highlightThickness:            0
+*Toggle.displayList:                   foreground rgb:4/6/4;draw-rect 1,1,-2,-2;foreground rgb:8/a/8;draw-rect 0,0,-1,-1
+
+*Command.width:                        102
+*Command.borderWidth:          1
+*Command.borderColor:          rgb:a/8/6
+*Command.justify:              left
+*Command.foreground:           rgb:6/6/2
+*Command.background:           rgb:c/c/8
+*Command.highlightThickness:   2
+*Command.displayList:          line-style solid;foreground rgb:8/8/4;draw-rect 1,1,-2,-2;dashes 2,2;line-style onoffdash;foreground rgb:c/c/8;draw-rect 0,0,-1,-1
+
+*test.BorderWidth:             1
diff --git a/xgc/choice.c b/xgc/choice.c
new file mode 100644 (file)
index 0000000..42ca1cb
--- /dev/null
@@ -0,0 +1,268 @@
+/* $XFree86$ */
+/*
+** xgc
+**
+** choice.c
+**
+** All the generic stuff for dealing with choice widgets.
+*/
+
+#include <stdio.h>
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/Toggle.h>
+
+#include "xgc.h"
+
+static void print_text_to_buffer(Widget, caddr_t, caddr_t);
+
+/* create_choice(w,info)
+** ---------------------
+** What a choice widget is:  A collection of toggle buttons placed inside
+** a form widget.  Exactly one of these toggle buttons can be "on" at
+** any given time;  the rest are "off".  "On" toggle buttons have
+** the foreground and background colors reversed.
+** Also, specifically because it comes in handy in xgc, choosing one
+** of the buttons causes a string associated with it to be printed out
+** (and interpreted).  Half of the string is global to the whole form
+** and the other half is local to each button.
+**
+** For example, pressing the "xor" button in the "function" form would
+** cause xgc to interpret the string "function xor", thus changing the
+** function in the GC to xor.
+**
+** There's also a label widget to the left of that mess, with an
+** incredibly descriptive title.
+**
+** create_choice() makes one.
+**
+** w is the form widget (already created) into which we will place the
+** toggle buttons.  info contains lots of useful information, such
+** as the names of the buttons and their strings (see xgc.h).
+*/
+
+ChoiceDesc *
+create_choice(Widget w, XgcStuff *info)
+{
+  ChoiceDesc *choice;          /* What we will return.  Contains
+                               ** Widget ID's of the label and toggles. */
+  int i;                       /* Counter */
+  char *text;                  /* Text to be interpreted when the
+                               ** toggle widget is selected. */
+
+  /* ArgList for the label widget */
+  static Arg labelargs[] = {   
+    {XtNborderWidth,  (XtArgVal) 0}, 
+    {XtNjustify,      (XtArgVal) XtJustifyRight},
+    {XtNvertDistance, (XtArgVal) 4}
+  };
+
+  /* ArgList for the toggle widgets */
+  static Arg toggleargs[] = {
+    {XtNfromHoriz,     (XtArgVal) NULL},
+    {XtNfromVert,      (XtArgVal) NULL},
+    {XtNhorizDistance, (XtArgVal) 4},
+    {XtNvertDistance,  (XtArgVal) 4},
+    {XtNradioGroup,    (XtArgVal) NULL},
+    {XtNcallback,      (XtArgVal) NULL}
+  };
+
+  /* Callback list for the toggle widgets */
+  static XtCallbackRec callbacklist[] = {
+    {(XtCallbackProc)  print_text_to_buffer, NULL},
+    {NULL,                                   NULL}
+  };
+
+  /* Allocate space for the widgets and initialize choice */
+  choice = (ChoiceDesc *) XtMalloc(sizeof(ChoiceDesc));
+  choice->widgets = (WidgetList) XtMalloc(sizeof(Widget) * 
+                                         info->choice.num_toggles);
+  choice->size = info->choice.num_toggles;
+  choice->label = XtCreateManagedWidget(info->choice.name,labelWidgetClass,w,
+                                       labelargs,XtNumber(labelargs));
+
+  /* set up the toggle widgets */
+  toggleargs[5].value = (XtArgVal) callbacklist;
+  for (i = 0; i < info->choice.num_toggles; ++i) {
+    if (i == 0) {
+      /* the upper left toggle; put it next to the label
+       and don't worry about radio groups */
+      toggleargs[0].value = (XtArgVal) choice->label;
+      toggleargs[1].value = (XtArgVal) NULL;
+      toggleargs[2].value = (XtArgVal) 10;
+      toggleargs[3].value = (XtArgVal) 4;
+      toggleargs[4].value = (XtArgVal) NULL;
+    }
+    else {
+      toggleargs[4].value = (XtArgVal) choice->widgets[0];
+                               /* are we starting a new row? */
+      if (info->choice.columns > 0 && 
+         i > 1 && 
+         (i % (info->choice.columns) == 0)) {
+       toggleargs[0].value = (XtArgVal) choice->label;
+       /* under the appropriate toggle */
+       toggleargs[1].value = (XtArgVal) choice->widgets[i - info->choice.columns];
+       toggleargs[2].value = (XtArgVal) 10;
+       toggleargs[3].value = (XtArgVal) 4;
+      }
+      else {                   /* we're in the middle of a row */
+       /* to the right of the previous toggle */
+       toggleargs[0].value = (XtArgVal) choice->widgets[i - 1];
+       toggleargs[1].value = (XtArgVal) NULL;
+       toggleargs[2].value = (XtArgVal) -1; /* overlapping slightly */
+       toggleargs[3].value = (XtArgVal) 4;
+      }
+
+      if (info->choice.columns > 0 &&
+         i >= info->choice.columns) {
+       /* correct vertical spacing */
+       toggleargs[1].value = (XtArgVal) choice->widgets[i - info->choice.columns];
+       toggleargs[3].value = (XtArgVal) -1;
+      }
+    }
+
+    /* Put the correct stuff in the text field */
+    text = (char *) XtMalloc((unsigned) (strlen(info->choice.text) +
+                                        strlen((info->data)[i].text) + 3));
+    strcpy(text, info->choice.text);
+    strcat(text, " ");
+    strcat(text, (info->data)[i].text);
+    strcat(text, "\n");
+    callbacklist[0].closure = (caddr_t) text;
+    
+    /* Create it finally */
+    choice->widgets[i] = XtCreateManagedWidget((info->data[i]).name, 
+                                              toggleWidgetClass,
+                                              w,
+                                              toggleargs,
+                                              XtNumber(toggleargs));
+  }
+  
+  /* The toggle widgets have all been created;
+  ** now make the all the same width if that's
+  ** what we want to do.                    */
+
+  if (info->choice.columns > 0) {
+    Dimension maxwidth = 0;    /* maximum width we've found */
+    Dimension width;           /* width of the current widget */
+    static Arg args[] = {      /* for getting and setting the width */
+      {XtNwidth,    (XtArgVal) NULL}
+    };
+
+    args[0].value = (XtArgVal) &width;
+
+    /* Find the maximum width of any toggle widget */
+    for (i = 0; i < info->choice.num_toggles; ++i) {
+      XtGetValues(choice->widgets[i],args,1);
+      maxwidth = max(maxwidth,width);
+    }
+
+    /* Now set them all to that width */
+    args[0].value = (XtArgVal) maxwidth;
+    for (i = 0; i < info->choice.num_toggles; ++i)
+      XtSetValues(choice->widgets[i],args,1);
+  }
+
+  /* return the list of toggles that were just created */
+  return (choice);
+}
+
+
+
+/* select_button(choice,togglenum)
+** -------------------------------
+** "Selects" the togglenumth toggle widget in the choice layout
+** represented by choice.  It simply turns the widget on, as if the
+** user had selected it, without calling any callbacks.  It's used
+** to give feedback when reading from a script.
+*/
+
+void
+select_button(ChoiceDesc *choice, int togglenum)
+{
+  static Arg toggleargs[] = {
+    {XtNstate,   (XtArgVal) True}
+  };
+
+  XtSetValues(choice->widgets[togglenum],toggleargs,XtNumber(toggleargs));
+}
+
+/* line_up_labels(descs,numdescs)
+** ------------------------------
+** descs represents a bunch of choice layouts (numdescs is the size of
+** descs).  This function sets each label in descs to the same width,
+** thus making them line up nicely since they're all on the left margin.
+*/
+
+void
+line_up_labels(ChoiceDesc *descs[], int numdescs)
+{
+  int i;                       /* counter */
+  Dimension width;             /* current width */
+  Dimension maxwidth = (Dimension) 0; /* max width found */
+
+  static Arg widthargs[] = {
+    {XtNwidth,     (XtArgVal) NULL }
+  };
+
+  widthargs[0].value = (XtArgVal) &width;
+
+  /* Find the maximum width */
+  for (i = 0; i < numdescs; ++i) {
+    XtGetValues(descs[i]->label, widthargs, XtNumber(widthargs));
+    maxwidth = max(maxwidth,width);
+  }
+
+  /* Set all labels to that width */
+  widthargs[0].value = (XtArgVal) maxwidth;
+  for (i = 0; i < numdescs; ++i) {
+    XtSetValues(descs[i]->label, widthargs, XtNumber(widthargs));
+  }
+}
+
+/* choose_defaults(descs,numdescs)
+** -------------------------------
+** descs represents a bunch of choice layouts (numdescs is the size of
+** descs).  This function goes through all of descs and selects the
+** appropriate toggle widget for each one.  This includes calling
+** the callbacks associated with that widget.
+**
+** This function ends up initializing both the screen and the GC, and
+** ensures that they are consistent.
+*/
+
+void
+choose_defaults(ChoiceDesc *descs[], int numdescs)
+{
+  int i;                       /* which choice layout */
+  int j;                       /* which toggle within it */
+
+  for (i = 0; i < numdescs; ++i) {
+    j = 0;
+    if (i == 0)
+      j = 3;
+    select_button(descs[i],j);
+    XtCallCallbacks(descs[i]->widgets[j], XtNcallback, (caddr_t) NULL);
+  }
+}
+
+
+/* print_text_to_buffer(w,closure,call_data)
+** -----------------------------------------
+** This is also in the list of callbacks for the toggle buttons in a
+** choice widget.  It sends the string contained in closure (which
+** was set way back in create_choice()) over to interpret(), which
+** decides what to do with it.
+*/
+
+/*ARGSUSED*/
+static void
+print_text_to_buffer(
+    Widget  w,
+    caddr_t closure,           /* contains the string */
+    caddr_t call_data)
+{
+  interpret((char *) closure);          /* Gee, that was easy */
+}
diff --git a/xgc/config.guess b/xgc/config.guess
new file mode 100755 (executable)
index 0000000..da83314
--- /dev/null
@@ -0,0 +1,1561 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
+
+timestamp='2009-04-27'
+
+# 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 <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+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, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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 "$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 ;;
+           sh5el) machine=sh5le-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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    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.*:* | i86xen:SunOS:5.*:*)
+       eval $set_cc_for_build
+       SUN_ARCH="i386"
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       echo ${SUN_ARCH}-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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:*:[456])
+       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+               IBM_ARCH=rs6000
+       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 <stdlib.h>
+              #include <unistd.h>
+
+              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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       exit ;;
+    i*:CYGWIN*:*)
+       echo ${UNAME_MACHINE}-pc-cygwin
+       exit ;;
+    *: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 ;;
+    *:Interix*:[3456]*)
+       case ${UNAME_MACHINE} in
+           x86)
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           EM64T | authenticamd | genuineintel)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+           IA64)
+               echo ia64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+       esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       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*:*:* | x86_64: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:*:*)
+       eval $set_cc_for_build
+       if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_EABI__
+       then
+           echo ${UNAME_MACHINE}-unknown-linux-gnu
+       else
+           echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+       fi
+       exit ;;
+    avr32*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-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 ;;
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-gnu
+       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 ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-gnu
+       exit ;;
+    x86_64:Linux:*:*)
+       echo x86_64-unknown-linux-gnu
+       exit ;;
+    xtensa*:Linux:*:*)
+       echo ${UNAME_MACHINE}-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 ;;
+         "")
+               # 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 <features.h>
+       #ifdef __ELF__
+       # ifdef __GLIBC__
+       #  if __GLIBC__ >= 2
+       LIBC=gnu
+       #  else
+       LIBC=gnulibc1
+       #  endif
+       # else
+       LIBC=gnulibc1
+       # endif
+       #else
+       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+       LIBC=gnu
+       #else
+       LIBC=gnuaout
+       #endif
+       #endif
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^LIBC/{
+               s: ::g
+               p
+           }'`"
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-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; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       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; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; 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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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 ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       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 ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-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
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/xgc/config.h.in b/xgc/config.h.in
new file mode 100644 (file)
index 0000000..c74df8b
--- /dev/null
@@ -0,0 +1,65 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* 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
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* 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/xgc/config.sub b/xgc/config.sub
new file mode 100755 (executable)
index 0000000..a39437d
--- /dev/null
@@ -0,0 +1,1686 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
+
+timestamp='2009-04-17'
+
+# 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 <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | bfin \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fido | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | lm32 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore | mep | metag \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64octeon | mips64octeonel \
+       | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | moxie \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | z8k | z80)
+               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)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64octeon-* | mips64octeonel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | 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[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+       | tron-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa*-* \
+       | ymp-* \
+       | z8k-* | z80-*)
+               ;;
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               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
+               ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+        cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
+       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
+               ;;
+       cr16)
+               basic_machine=cr16-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
+               ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
+       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
+               ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       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
+               ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
+       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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       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
+               ;;
+       tile*)
+               basic_machine=tile-unknown
+               os=-linux-gnu
+               ;;
+       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
+               ;;
+       z80-*-coff)
+               basic_machine=z80-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[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+               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* \
+             | -kopensolaris* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* | -aros* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
+             | -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* | -cegcc* \
+             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -linux-newlib* | -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* | -rdos* | -toppers* | -drops*)
+       # 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
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+       -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
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
+       *-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
+               ;;
+        mep-*)
+               os=-elf
+               ;;
+       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/xgc/configure b/xgc/configure
new file mode 100755 (executable)
index 0000000..5cfb156
--- /dev/null
@@ -0,0 +1,7830 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.63 for xgc 1.0.2.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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 ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&    (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    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=.
+  case $as_dir in
+        /*)
+          for as_base in sh bash ksh sh5; do
+            as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+          done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+        # Try only shells that exist, to save several forks.
+        if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+               { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+              as_have_required=yes
+              if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+       do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+       done
+       export CONFIG_SHELL
+       exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell bug-autoconf@gnu.org about your system,
+  echo including any error possibly output before this message.
+  echo This can help us improve future autoconf versions.
+  echo Configuration will now proceed without shell functions.
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# 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`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='xgc'
+PACKAGE_TARNAME='xgc'
+PACKAGE_VERSION='1.0.2'
+PACKAGE_STRING='xgc 1.0.2'
+PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+appdefaultdir
+APPDEFS_LIBS
+APPDEFS_CFLAGS
+XGC_LIBS
+XGC_CFLAGS
+PKG_CONFIG
+YFLAGS
+YACC
+LEXLIB
+LEX_OUTPUT_ROOT
+LEX
+ADMIN_MAN_DIR
+DRIVER_MAN_DIR
+MISC_MAN_DIR
+FILE_MAN_DIR
+LIB_MAN_DIR
+APP_MAN_DIR
+ADMIN_MAN_SUFFIX
+DRIVER_MAN_SUFFIX
+MISC_MAN_SUFFIX
+FILE_MAN_SUFFIX
+LIB_MAN_SUFFIX
+APP_MAN_SUFFIX
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+distcleancheck_listfiles
+CHANGELOG_CMD
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+CWARNFLAGS
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_silent_rules
+enable_strict_compilation
+with_release_version
+with_appdefaultdir
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+YACC
+YFLAGS
+PKG_CONFIG
+XGC_CFLAGS
+XGC_LIBS
+APPDEFS_CFLAGS
+APPDEFS_LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)   ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=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 ;;
+
+  -*) { $as_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 &&
+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_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'`
+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+   { (exit 1); exit 1; }; } ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+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
+    $as_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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 xgc 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/xgc]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_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 xgc 1.0.2:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --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
+  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')
+  --enable-strict-compilation
+                          Enable all warnings from compiler and make them
+                          errors (default: disabled)
+
+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
+  --with-appdefaultdir=<pathname>
+                          specify directory for app-defaults files (default is
+                          autodetected)
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  YACC        The `Yet Another C Compiler' implementation to use. Defaults to
+              the first program found out of: `bison -y', `byacc', `yacc'.
+  YFLAGS      The list of arguments that will be passed by default to $YACC.
+              This script will default YFLAGS to the empty string to avoid a
+              default value of `-d' given by some make applications.
+  PKG_CONFIG  path to pkg-config utility
+  XGC_CFLAGS  C compiler flags for XGC, overriding pkg-config
+  XGC_LIBS    linker flags for XGC, overriding pkg-config
+  APPDEFS_CFLAGS
+              C compiler flags for APPDEFS, overriding pkg-config
+  APPDEFS_LIBS
+              linker flags for APPDEFS, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+xgc configure 1.0.2
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 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
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by xgc $as_me 1.0.2, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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=.
+  $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&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_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=`$as_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_arg'"
+      ;;
+    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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+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,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r 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 -f -r conftest* 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 an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test -r "$ac_site_file"; then
+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_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
+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_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 $ac_precious_vars; 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,)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_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
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_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
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_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.11'
+
+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
+  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$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'
+
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5
+$as_echo "$as_me: error: unsafe absolute working directory name" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5
+$as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+
+# 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".
+      { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+$as_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
+   { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+$as_echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "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 $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# 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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+done
+IFS=$as_save_IFS
+
+fi
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+# test whether we have cygpath
+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='xgc'
+ 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"}
+
+# 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 -'
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-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
+
+  { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$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"
+
+
+# Require xorg-macros 1.3 or later: XORG_DEFAULT_OPTIONS
+
+
+
+
+
+
+
+
+
+
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-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
+
+
+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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+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
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_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.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_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.out.dSYM 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.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+$as_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
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&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'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_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
+       { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_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
+$as_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
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+$as_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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then
+  $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+$as_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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       CFLAGS=""
+      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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=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 <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+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
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&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
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$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
+
+
+
+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
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&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
+
+
+{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+  $as_echo_n "(cached) " >&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 <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+   { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if test "${ac_cv_prog_cc_c99+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=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 <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+       {
+       case 's': // string
+         str = va_arg (args_copy, const char *);
+         break;
+       case 'd': // int
+         number = va_arg (args_copy, int);
+         break;
+       case 'f': // float
+         fnumber = va_arg (args_copy, double);
+         break;
+       default:
+         break;
+       }
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+         || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c99=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    { $as_echo "$as_me:$LINENO: checking whether __SUNPRO_C is declared" >&5
+$as_echo_n "checking whether __SUNPRO_C is declared... " >&6; }
+if test "${ac_cv_have_decl___SUNPRO_C+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __SUNPRO_C
+  (void) __SUNPRO_C;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl___SUNPRO_C=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl___SUNPRO_C=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___SUNPRO_C" >&5
+$as_echo "$ac_cv_have_decl___SUNPRO_C" >&6; }
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=0;;
+esac
+AM_BACKSLASH='\'
+
+
+
+
+
+
+
+# Check whether --enable-strict-compilation was given.
+if test "${enable_strict_compilation+set}" = set; then
+  enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval
+else
+  STRICT_COMPILE=no
+fi
+
+if test "x$STRICT_COMPILE" = "xyes"; then
+       { $as_echo "$as_me:$LINENO: checking whether __SUNPRO_C is declared" >&5
+$as_echo_n "checking whether __SUNPRO_C is declared... " >&6; }
+if test "${ac_cv_have_decl___SUNPRO_C+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __SUNPRO_C
+  (void) __SUNPRO_C;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl___SUNPRO_C=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl___SUNPRO_C=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___SUNPRO_C" >&5
+$as_echo "$ac_cv_have_decl___SUNPRO_C" >&6; }
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+       { $as_echo "$as_me:$LINENO: checking whether __INTEL_COMPILER is declared" >&5
+$as_echo_n "checking whether __INTEL_COMPILER is declared... " >&6; }
+if test "${ac_cv_have_decl___INTEL_COMPILER+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __INTEL_COMPILER
+  (void) __INTEL_COMPILER;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl___INTEL_COMPILER=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl___INTEL_COMPILER=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___INTEL_COMPILER" >&5
+$as_echo "$ac_cv_have_decl___INTEL_COMPILER" >&6; }
+if test "x$ac_cv_have_decl___INTEL_COMPILER" = x""yes; then
+  INTELCC="yes"
+else
+  INTELCC="no"
+fi
+
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+
+
+
+
+# Check whether --with-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"
+               { $as_echo "$as_me:$LINENO: Building with package name set to $PACKAGE" >&5
+$as_echo "$as_me: Building with package name set to $PACKAGE" >&6;}
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
+mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+
+distcleancheck_listfiles='find . -type f ! -name ChangeLog -print'
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_LEX+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_LEX="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+LEX=$ac_cv_prog_LEX
+if test -n "$LEX"; then
+  { $as_echo "$as_me:$LINENO: result: $LEX" >&5
+$as_echo "$LEX" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$LEX" && break
+done
+test -n "$LEX" || LEX=":"
+
+if test "x$LEX" != "x:"; then
+  cat >conftest.l <<_ACEOF
+%%
+a { ECHO; }
+b { REJECT; }
+c { yymore (); }
+d { yyless (1); }
+e { yyless (input () != 0); }
+f { unput (yytext[0]); }
+. { BEGIN INITIAL; }
+%%
+#ifdef YYTEXT_POINTER
+extern char *yytext;
+#endif
+int
+main (void)
+{
+  return ! yylex () + ! yywrap ();
+}
+_ACEOF
+{ (ac_try="$LEX conftest.l"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$LEX conftest.l") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ $as_echo "$as_me:$LINENO: checking lex output file root" >&5
+$as_echo_n "checking lex output file root... " >&6; }
+if test "${ac_cv_prog_lex_root+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+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
+  { { $as_echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
+$as_echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
+$as_echo "$ac_cv_prog_lex_root" >&6; }
+LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
+
+if test -z "${LEXLIB+set}"; then
+  { $as_echo "$as_me:$LINENO: checking lex library" >&5
+$as_echo_n "checking lex library... " >&6; }
+if test "${ac_cv_lib_lex+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+    ac_save_LIBS=$LIBS
+    ac_cv_lib_lex='none needed'
+    for ac_lib in '' -lfl -ll; do
+      LIBS="$ac_lib $ac_save_LIBS"
+      cat >conftest.$ac_ext <<_ACEOF
+`cat $LEX_OUTPUT_ROOT.c`
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_lex=$ac_lib
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+      test "$ac_cv_lib_lex" != 'none needed' && break
+    done
+    LIBS=$ac_save_LIBS
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5
+$as_echo "$ac_cv_lib_lex" >&6; }
+  test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
+$as_echo_n "checking whether yytext is a pointer... " >&6; }
+if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
+  $as_echo_n "(cached) " >&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
+ac_save_LIBS=$LIBS
+LIBS="$LEXLIB $ac_save_LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#define YYTEXT_POINTER 1
+`cat $LEX_OUTPUT_ROOT.c`
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_prog_lex_yytext_pointer=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_save_LIBS
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
+$as_echo "$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
+rm -f conftest.l $LEX_OUTPUT_ROOT.c
+
+fi
+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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_YACC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_YACC="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+YACC=$ac_cv_prog_YACC
+if test -n "$YACC"; then
+  { $as_echo "$as_me:$LINENO: result: $YACC" >&5
+$as_echo "$YACC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$YACC" && break
+done
+test -n "$YACC" || YACC="yacc"
+
+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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+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
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_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.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       CFLAGS=""
+      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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=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 <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+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
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&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
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$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.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$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'
+
+
+
+
+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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+
+pkg_failed=no
+{ $as_echo "$as_me:$LINENO: checking for XGC" >&5
+$as_echo_n "checking for XGC... " >&6; }
+
+if test -n "$XGC_CFLAGS"; then
+    pkg_cv_XGC_CFLAGS="$XGC_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xaw7\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xaw7") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_XGC_CFLAGS=`$PKG_CONFIG --cflags "xaw7" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XGC_LIBS"; then
+    pkg_cv_XGC_LIBS="$XGC_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xaw7\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xaw7") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_XGC_LIBS=`$PKG_CONFIG --libs "xaw7" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               XGC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xaw7" 2>&1`
+        else
+               XGC_PKG_ERRORS=`$PKG_CONFIG --print-errors "xaw7" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XGC_PKG_ERRORS" >&5
+
+       { { $as_echo "$as_me:$LINENO: error: Package requirements (xaw7) were not met:
+
+$XGC_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 XGC_CFLAGS
+and XGC_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&5
+$as_echo "$as_me: error: Package requirements (xaw7) were not met:
+
+$XGC_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 XGC_CFLAGS
+and XGC_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
+       { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_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 XGC_CFLAGS
+and XGC_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&5
+$as_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 XGC_CFLAGS
+and XGC_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+else
+       XGC_CFLAGS=$pkg_cv_XGC_CFLAGS
+       XGC_LIBS=$pkg_cv_XGC_LIBS
+        { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       :
+fi
+
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:$LINENO: checking for APPDEFS" >&5
+$as_echo_n "checking for APPDEFS... " >&6; }
+
+if test -n "$APPDEFS_CFLAGS"; then
+    pkg_cv_APPDEFS_CFLAGS="$APPDEFS_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_APPDEFS_CFLAGS=`$PKG_CONFIG --cflags "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$APPDEFS_LIBS"; then
+    pkg_cv_APPDEFS_LIBS="$APPDEFS_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_APPDEFS_LIBS=`$PKG_CONFIG --libs "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xt" 2>&1`
+        else
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --print-errors "xt" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$APPDEFS_PKG_ERRORS" >&5
+
+       { { $as_echo "$as_me:$LINENO: error: Package requirements (xt) were not met:
+
+$APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&5
+$as_echo "$as_me: error: Package requirements (xt) were not met:
+
+$APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_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
+       { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&5
+$as_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+else
+       APPDEFS_CFLAGS=$pkg_cv_APPDEFS_CFLAGS
+       APPDEFS_LIBS=$pkg_cv_APPDEFS_LIBS
+        { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       :
+fi
+xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+
+# Check whether --with-appdefaultdir was given.
+if test "${with_appdefaultdir+set}" = set; then
+  withval=$with_appdefaultdir; appdefaultdir="$withval"
+else
+  appdefaultdir="${xt_appdefaultdir}"
+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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     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" &&
+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+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_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_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
+  { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_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
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_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 "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_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_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $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 || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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 ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by xgc $as_me 1.0.2, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet, --silent
+                   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 <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+xgc config.status 1.0.2
+configured by $0, generated by GNU Autoconf 2.63,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+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
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { $as_echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { $as_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"
+     ac_need_defaults=false ;;
+
+  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 || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr='\r'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+   { (exit 1); exit 1; }; }
+_ACEOF
+
+# 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
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #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.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
+$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
+   { (exit 1); exit 1; }; }
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      ac_file_inputs="$ac_file_inputs '$ac_f'"
+    done
+
+    # 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.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+       || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
+$as_echo "$as_me: error: could not create -" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$_am_arg" : 'X\(//\)[^/]' \| \
+        X"$_am_arg" : 'X\(//\)$' \| \
+        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_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=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+
+# 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
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/xgc/configure.ac b/xgc/configure.ac
new file mode 100644 (file)
index 0000000..8c1bbbd
--- /dev/null
@@ -0,0 +1,53 @@
+
+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(xgc, [1.0.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xgc)
+AM_INIT_AUTOMAKE([dist-bzip2])
+AM_MAINTAINER_MODE
+AM_CONFIG_HEADER(config.h)
+
+# Require xorg-macros 1.3 or later: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+         [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+XORG_DEFAULT_OPTIONS
+
+AC_PROG_LEX
+AC_PROG_YACC
+AC_PROG_CC
+AC_PROG_INSTALL
+
+PKG_CHECK_MODULES(XGC, xaw7)
+AC_SUBST(XGC_CFLAGS)
+AC_SUBST(XGC_LIBS)
+
+PKG_CHECK_MODULES(APPDEFS, xt)
+xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+AC_ARG_WITH(appdefaultdir,
+       AC_HELP_STRING([--with-appdefaultdir=<pathname>],
+         [specify directory for app-defaults files (default is autodetected)]),
+       [appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"])
+AC_SUBST(appdefaultdir)
+
+AC_OUTPUT([Makefile])
diff --git a/xgc/constants.h b/xgc/constants.h
new file mode 100644 (file)
index 0000000..495ff94
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+** xgc
+**
+** constants.h
+**
+** Lots of constants which many files need.
+*/
+
+/* Find the max of two numbers */
+#ifndef max
+#define max(x,y) (((x)>(y))?(x):(y))
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#define MAXCHOICES 16           /* Max # of choices for any option */
+
+#define Black BlackPixel(X.dpy,0) 
+#define White WhitePixel(X.dpy,0)
+
+#define CopyArea      0                /* different tests */
+#define CopyPlane     1
+#define PolyPoint     2
+#define PolyLine      3
+#define PolySegment   4
+#define PolyRectangle 5
+#define PolyArc       6
+#define FillPolygon   7
+#define PolyFillRect  8
+#define PolyFillArc   9
+#define PutImage     10
+#define GetImage     11
+#define PolyText8    12
+#define ImageText8   13
+#define PolyText16   14
+#define ImageText16  15
+
+#define CFunction     0                /* different GC things you can choose */
+#define CLinestyle    1
+#define CCapstyle     2
+#define CJoinstyle    3
+#define CFillstyle    4
+#define CFillrule     5
+#define CArcmode      6
+#define NUMCHOICES    7
+#define CTest         7
+
+#define TLineWidth     0       /* different editable text widgets */
+#define TFont          1
+#define TForeground    2
+#define TBackground    3
+#define NUMTEXTWIDGETS 4
+
+#define StartTimer   0         /* flags for timing tests */
+#define EndTimer     1
+#define start_timer()   timer(StartTimer)
+#define end_timer()     timer(EndTimer)
+
+/* the number of toggle widgets in various groups */
+#define NUM_TESTS       16
+#define NUM_FUNCTIONS   16
+#define NUM_LINESTYLES   3
+#define NUM_CAPSTYLES    4
+#define NUM_JOINSTYLES   3
+#define NUM_FILLSTYLES   4
+#define NUM_FILLRULES    2
+#define NUM_ARCMODES     2
+
+/* The number of bits in the dash description */
+#define DASHLENGTH       8
diff --git a/xgc/dashlist.c b/xgc/dashlist.c
new file mode 100644 (file)
index 0000000..14a67c3
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+** dashlist.c
+**
+** How to make a widget to choose a dashlist.
+**
+** NOTE: This file uses static variables.  Therefore, trying to use these
+**       functions to create more than one of these dashlist choice things
+**       will fail in a big way.
+*/
+/* $XFree86: xc/programs/xgc/dashlist.c,v 1.3 2001/07/29 21:23:21 tsi Exp $ */
+
+#include <stdio.h>
+#include <X11/Xos.h>
+#include <stdlib.h>
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/Toggle.h>
+#include "xgc.h"
+
+static void change_dashlist(Widget, caddr_t, caddr_t);
+
+static short dashlist = 240;   /* in binary, becomes the dashlist
+                                  (240 = XXXX____) */
+static Widget *dashes;         /* the toggle widgets */
+
+/* create_dashlist_choice(w)
+** -------------------------
+** Inside w (a form widget), creates a bunch of little toggle buttons
+** in a row, representing the dash list.  There's also a label so
+** the user knows what it is.
+*/
+
+void
+create_dashlist_choice(Widget w)
+{
+  /* callback list for the toggle widgets */
+  static XtCallbackRec callbacklist[] = {
+    {(XtCallbackProc) change_dashlist, NULL},
+    {NULL,                             NULL}
+  };
+
+  /* ArgList for the label */
+  static Arg labelargs[] = {
+    {XtNborderWidth,  (XtArgVal) 0},
+    {XtNjustify,      (XtArgVal) XtJustifyRight},
+    {XtNvertDistance, (XtArgVal) 4}
+  };
+
+  /* ArgList for the toggles */
+  static Arg dashargs[] = {
+    {XtNcallback,           (XtArgVal) NULL},
+    {XtNhorizDistance,      (XtArgVal) NULL},
+    {XtNfromHoriz,          (XtArgVal) NULL},
+    {XtNwidth,              (XtArgVal) 10},
+    {XtNheight,             (XtArgVal) 10},
+    {XtNhighlightThickness, (XtArgVal) 1},
+    {XtNstate,              (XtArgVal) False},
+    {XtNlabel,              (XtArgVal) ""}
+  };
+
+  static Widget label;         /* the label, of course */
+  static int *dashinfo;                /* contains integers saying which bit
+                                  a particular button is; sent to
+                                  change_dashlist to tell it which
+                                  bit got changed */
+  int i;                       /* counter */
+
+  char name[11];
+
+  /* allocate space for stuff that we don't know the size of yet */
+  dashes = (Widget *) malloc(DASHLENGTH * sizeof(Widget));
+  dashinfo = (int *) malloc(DASHLENGTH * sizeof(int));
+
+  /* make the label widget */
+  label = XtCreateManagedWidget("dashlist",labelWidgetClass,w,
+                               labelargs,XtNumber(labelargs));
+
+  dashargs[0].value = (XtArgVal) callbacklist;
+
+  for (i=0;i<DASHLENGTH;++i) { /* go through all the buttons */
+    if (i==0) {                        /* offset the first one from the label */
+      dashargs[1].value = (XtArgVal) 10;
+      dashargs[2].value = (XtArgVal) label;
+    }
+    else {                     /* put it directly to the right of the
+                                  last one, no space in between */
+      dashargs[1].value = (XtArgVal) -1;
+      dashargs[2].value = (XtArgVal) dashes[i-1];
+    }
+
+    /* set its original state depending on the state of that
+    ** bit of the dashlist */
+
+    if (dashlist&1<<i)
+      dashargs[6].value = (XtArgVal) True;
+    else
+      dashargs[6].value = (XtArgVal) False;
+
+    snprintf(name, sizeof name, "dashlist%d",i);
+
+    dashinfo[i] = i;           /* which bit we're on; this is needed
+                                  in change_dashlist (the callback) */
+    callbacklist[0].closure = (caddr_t) &dashinfo[i];
+
+    dashes[i] = XtCreateManagedWidget(name,toggleWidgetClass,w,
+                                 dashargs,XtNumber(dashargs));
+  }
+}
+
+/* change_dashlist(w,closure,call_data)
+** ------------------------------------
+** This function is called when the user toggles a toggle widget.  It
+** makes the appropriate change to the dashlist and sends it off
+** to interpret().
+** Funny args are because it's a callback.
+*/
+
+/*ARGSUSED*/
+static void
+change_dashlist(Widget w, caddr_t closure, caddr_t call_data)
+{
+  int num;                     /* what number button it is */
+  Boolean on;                  /* is it currently on or off? */
+
+  char buf[80];                        /* string to send to interpret() */
+
+  static Arg args[] = {
+    {XtNstate,    (XtArgVal) NULL}
+  };
+
+  /* set up ArgList so that 'on' will contain the state */
+  args[0].value = (XtArgVal) &on;
+
+  num = * (int *) closure;     /* we put it here back in the last function */
+  XtGetValues(w,args,XtNumber(args));
+
+  /* modify the dashlist as appropriate. */
+  if (on) {                    
+    dashlist |= 1<<num;                
+  }
+  else {                       
+    dashlist &= ~(1<<num);     
+  }
+
+  /* now tell interpret() about it */
+  snprintf(buf, sizeof buf, "dashlist %d\n",dashlist); 
+  interpret(buf);
+}
+
+/* update_dashlist(newdash)
+** ------------------------
+** Updates the display of the dashlist so that it corresponds to
+** newdash.
+*/
+
+void
+update_dashlist(int newdash)
+{
+  int i;                       /* counter */
+  static Arg dashargs[] = {    /* Arglist for setting toggle state */
+    {XtNstate,   (XtArgVal) NULL}
+  };
+
+  /* first set the internal representation */
+  dashlist = newdash;
+
+  for (i = 0; i < DASHLENGTH; ++i) {
+    if (newdash & 1<<i)        /* if it's set, make it look that way */
+      dashargs[0].value = (XtArgVal) True;
+    else
+      dashargs[0].value = (XtArgVal) False;
+
+    XtSetValues(dashes[i],dashargs,XtNumber(dashargs));
+  }
+}
diff --git a/xgc/depcomp b/xgc/depcomp
new file mode 100755 (executable)
index 0000000..df8eea7
--- /dev/null
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s,\\\\\\\\,/,g"
+   depmode=msvisualcpp
+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.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    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.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[     ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "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"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${
+              s/^ *//
+              s/ \\*$//
+              s/$/:/
+              p
+            }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # 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 mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $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 "X$1" != 'X--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 "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    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.
+    -arch)
+      eat=yes ;;
+    -*|$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 "X$1" != 'X--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.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::     \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # 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
+  ;;
+
+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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xgc/getfile.c b/xgc/getfile.c
new file mode 100644 (file)
index 0000000..43bba8b
--- /dev/null
@@ -0,0 +1,155 @@
+/*
+** getfilename.c
+**
+*/
+/* $XFree86: xc/programs/xgc/getfile.c,v 1.4tsi Exp $ */
+
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Shell.h>
+#include <X11/Xaw/AsciiText.h>
+#include <stdio.h>
+
+#include "xgc.h"
+
+
+static Widget popupshell = NULL;       /* popup dialog box */
+Widget filename_text_widget;   /* Widget containing the name of
+                                  the file the user has selected */
+
+static void kill_popup_shell(void);
+
+void
+get_filename(
+     void (*success)(void),    /* what function to call when a filename is
+                                  chosen */
+     void (*failure)(void))    /* what function to call when the user
+                                  cancels */
+{
+  static Widget popupform;     /* form inside shell */
+  static Widget label;         /* "Filename :" */
+
+  Window dummy1, dummy2;
+  int x1,y1,x2,y2;
+  unsigned int mask;
+
+  /* The translation table for the text widget.  Things such as <RETURN>
+  ** confirm the user's choice.  Other keys which would move out of
+  ** the range of a one-line window are disabled. */
+
+  static const char *translationtable = 
+    "Ctrl<Key>J:    KillPopup() Done()\n\
+     Ctrl<Key>M:    KillPopup() Done()\n\
+     <Key>Linefeed: KillPopup() Done()\n\
+     <Key>Return:   KillPopup() Done()\n\
+     Ctrl<Key>O:    Nothing()\n\
+     Meta<Key>I:    Nothing()\n\
+     Ctrl<Key>N:    Nothing()\n\
+     Ctrl<Key>P:    Nothing()\n\
+     Ctrl<Key>Z:    Nothing()\n\
+     Meta<Key>Z:    Nothing()\n\
+     Ctrl<Key>V:    Nothing()\n\
+     Meta<Key>V:    Nothing()";
+
+  /* What the actions in the translation table correspond to. */
+
+  static XtActionsRec actiontable[] = {
+    {"KillPopup", (XtActionProc) kill_popup_shell},
+    {"Done",      NULL},
+    {"Nothing",   NULL}
+  };
+
+  static Arg popupshellargs[] = {     /* Where to put the popup shell. */
+    {XtNx,         (XtArgVal) NULL},
+    {XtNy,         (XtArgVal) NULL}
+  };
+
+  static Arg labelargs[] = {   /* ArgList for the label */
+    {XtNborderWidth,    (XtArgVal) 0},
+    {XtNjustify,        (XtArgVal) XtJustifyRight}
+  };
+
+  static Arg textargs[] = {    /* ArgList for the text widget */
+    {XtNeditType,       (XtArgVal) XawtextEdit},
+    {XtNwidth,          (XtArgVal) 200},
+    {XtNhorizDistance,  (XtArgVal) 10},
+    {XtNfromHoriz,      (XtArgVal) NULL},
+  };
+
+  static Arg cancelargs[] = {  /* ArgList for the cancel button */
+    {XtNfromHoriz,      (XtArgVal) NULL},
+    {XtNcallback,       (XtArgVal) NULL}
+  };
+
+  /* Procedures to call when the user selects 'cancel' */
+  static XtCallbackRec cancelcallbacklist[] = {
+    {(XtCallbackProc) kill_popup_shell, NULL},
+    {NULL, NULL},
+    {NULL, NULL}
+  };
+
+  if (popupshell != NULL) {
+      XtPopup(popupshell,XtGrabExclusive);
+      return;
+  }
+
+  /* Find out where the pointer is, so we can put the popup window there */
+
+  (void) XQueryPointer(X.dpy,XtWindow(topform),&dummy1,&dummy2,&x1,&y1,
+                      &x2,&y2,&mask);
+  
+  popupshellargs[0].value = (XtArgVal) x2;
+  popupshellargs[1].value = (XtArgVal) y2;
+  
+  popupshell = XtCreatePopupShell("popup",overrideShellWidgetClass,
+                        topform,popupshellargs,XtNumber(popupshellargs));
+
+  popupform = XtCreateManagedWidget("form",formWidgetClass,popupshell,
+                           NULL, 0);
+
+  label = XtCreateManagedWidget("Filename: ",labelWidgetClass,popupform,
+                              labelargs,XtNumber(labelargs));
+
+  textargs[3].value = (XtArgVal) label;
+
+  filename_text_widget = XtCreateManagedWidget("text",asciiTextWidgetClass,
+                                              popupform,
+                                              textargs,XtNumber(textargs));
+
+  /* Complete the action table.  We have to do it here because success
+  ** isn't known at compile time. */
+
+  actiontable[1].proc = (XtActionProc) success;
+
+  /* Register actions, translations, callbacks */
+
+  XtAppAddActions(appcontext,actiontable,XtNumber(actiontable));
+  XtOverrideTranslations(filename_text_widget,
+                        XtParseTranslationTable(translationtable));
+  cancelcallbacklist[1].callback = (XtCallbackProc) failure;
+
+  cancelargs[0].value = (XtArgVal) filename_text_widget;
+  cancelargs[1].value = (XtArgVal) cancelcallbacklist;
+
+  (void) XtCreateManagedWidget("Cancel",commandWidgetClass,popupform,
+                              cancelargs,XtNumber(cancelargs));
+
+  /* Bring up the popup.  When the user presses cancel or the return key,
+  ** the function kill_popup_shell (below) will be called to remove it. */
+
+  XtPopup(popupshell,XtGrabExclusive);
+}
+
+/* kill_popup_shell()
+** ------------------
+** Remove the popup window that get_filename popped up.
+*/
+
+static void
+kill_popup_shell(void)
+{
+  XtPopdown(popupshell);
+}
diff --git a/xgc/gram.c b/xgc/gram.c
new file mode 100644 (file)
index 0000000..42fe99c
--- /dev/null
@@ -0,0 +1,1731 @@
+/* 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 {
+     STRING = 258,
+     NUMBER = 259,
+     RUN = 260,
+     FUNCTION = 261,
+     FUNCTIONTYPE = 262,
+     TEST = 263,
+     TESTTYPE = 264,
+     LINESTYLE = 265,
+     LINESTYLETYPE = 266,
+     CAPSTYLE = 267,
+     CAPSTYLETYPE = 268,
+     JOINSTYLE = 269,
+     JOINSTYLETYPE = 270,
+     ROUND = 271,
+     SOLID = 272,
+     FILLSTYLE = 273,
+     FILLSTYLETYPE = 274,
+     FILLRULE = 275,
+     FILLRULETYPE = 276,
+     ARCMODE = 277,
+     ARCMODETYPE = 278,
+     FOREGROUND = 279,
+     BACKGROUND = 280,
+     LINEWIDTH = 281,
+     PLANEMASK = 282,
+     DASHLIST = 283,
+     PERCENT = 284,
+     FONT = 285
+   };
+#endif
+/* Tokens.  */
+#define STRING 258
+#define NUMBER 259
+#define RUN 260
+#define FUNCTION 261
+#define FUNCTIONTYPE 262
+#define TEST 263
+#define TESTTYPE 264
+#define LINESTYLE 265
+#define LINESTYLETYPE 266
+#define CAPSTYLE 267
+#define CAPSTYLETYPE 268
+#define JOINSTYLE 269
+#define JOINSTYLETYPE 270
+#define ROUND 271
+#define SOLID 272
+#define FILLSTYLE 273
+#define FILLSTYLETYPE 274
+#define FILLRULE 275
+#define FILLRULETYPE 276
+#define ARCMODE 277
+#define ARCMODETYPE 278
+#define FOREGROUND 279
+#define BACKGROUND 280
+#define LINEWIDTH 281
+#define PLANEMASK 282
+#define DASHLIST 283
+#define PERCENT 284
+#define FONT 285
+
+
+
+
+/* Copy the first part of user declarations.  */
+#line 6 "gram.y"
+
+#define YYDEBUG 1
+
+#include <stdio.h>
+#include <X11/X.h>
+#include <X11/Intrinsic.h>
+#include "xgc.h"
+
+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 19 "gram.y"
+{
+  int num;
+  char *ptr;
+}
+/* Line 187 of yacc.c.  */
+#line 173 "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 186 "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 <stddef.h> /* 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 <libintl.h> /* 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 <alloca.h> /* INFRINGES ON USER NAME SPACE */
+#   elif defined _AIX
+#    define YYSTACK_ALLOC __alloca
+#   elif defined _MSC_VER
+#    include <malloc.h> /* 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 <stdlib.h> /* 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 <stdlib.h> /* 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   40
+
+/* YYNTOKENS -- Number of terminals.  */
+#define YYNTOKENS  32
+/* YYNNTS -- Number of nonterminals.  */
+#define YYNNTS  4
+/* YYNRULES -- Number of rules.  */
+#define YYNRULES  26
+/* YYNRULES -- Number of states.  */
+#define YYNSTATES  43
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   285
+
+#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,
+      31,     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
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+   YYRHS.  */
+static const yytype_uint8 yyprhs[] =
+{
+       0,     0,     3,     5,     6,     9,    13,    15,    17,    20,
+      23,    26,    29,    32,    35,    38,    41,    44,    47,    50,
+      53,    56,    59,    62,    65,    68,    71
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
+static const yytype_int8 yyrhs[] =
+{
+      33,     0,    -1,    34,    -1,    -1,    34,    31,    -1,    34,
+      35,    31,    -1,     1,    -1,     5,    -1,     8,     9,    -1,
+       6,     7,    -1,    10,    11,    -1,    10,    17,    -1,    12,
+      13,    -1,    12,    16,    -1,    14,    15,    -1,    14,    16,
+      -1,    18,    19,    -1,    18,    17,    -1,    20,    21,    -1,
+      22,    23,    -1,    24,     4,    -1,    25,     4,    -1,    26,
+       4,    -1,    27,     4,    -1,    28,     4,    -1,    30,     3,
+      -1,    29,     4,    -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+static const yytype_uint8 yyrline[] =
+{
+       0,    41,    41,    44,    45,    46,    49,    50,    52,    54,
+      56,    58,    60,    62,    64,    66,    68,    70,    72,    74,
+      76,    78,    80,    82,    84,    86,    88
+};
+#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", "STRING", "NUMBER", "RUN", "FUNCTION",
+  "FUNCTIONTYPE", "TEST", "TESTTYPE", "LINESTYLE", "LINESTYLETYPE",
+  "CAPSTYLE", "CAPSTYLETYPE", "JOINSTYLE", "JOINSTYLETYPE", "ROUND",
+  "SOLID", "FILLSTYLE", "FILLSTYLETYPE", "FILLRULE", "FILLRULETYPE",
+  "ARCMODE", "ARCMODETYPE", "FOREGROUND", "BACKGROUND", "LINEWIDTH",
+  "PLANEMASK", "DASHLIST", "PERCENT", "FONT", "'\\n'", "$accept", "all",
+  "stmts", "stmt", 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,    10
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const yytype_uint8 yyr1[] =
+{
+       0,    32,    33,    34,    34,    34,    35,    35,    35,    35,
+      35,    35,    35,    35,    35,    35,    35,    35,    35,    35,
+      35,    35,    35,    35,    35,    35,    35
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+static const yytype_uint8 yyr2[] =
+{
+       0,     2,     1,     0,     2,     3,     1,     1,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2
+};
+
+/* 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,     6,     7,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     4,     0,     9,     8,    10,    11,    12,    13,    14,
+      15,    17,    16,    18,    19,    20,    21,    22,    23,    24,
+      26,    25,     5
+};
+
+/* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int8 yydefgoto[] =
+{
+      -1,     1,     2,    22
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
+#define YYPACT_NINF -10
+static const yytype_int8 yypact[] =
+{
+     -10,     2,     0,   -10,   -10,   -10,     8,    10,    -8,    -9,
+       1,    -6,    11,    -2,    19,    29,    30,    31,    32,    33,
+      35,   -10,     9,   -10,   -10,   -10,   -10,   -10,   -10,   -10,
+     -10,   -10,   -10,   -10,   -10,   -10,   -10,   -10,   -10,   -10,
+     -10,   -10,   -10
+};
+
+/* YYPGOTO[NTERM-NUM].  */
+static const yytype_int8 yypgoto[] =
+{
+     -10,   -10,   -10,   -10
+};
+
+/* 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 -3
+static const yytype_int8 yytable[] =
+{
+      -2,     4,     3,    25,    27,     5,     6,    28,     7,    26,
+       8,    31,     9,    32,    10,    23,    29,    30,    11,    24,
+      12,    34,    13,    35,    14,    15,    16,    17,    18,    19,
+      20,    21,    33,    36,    37,    38,    39,    40,    41,     0,
+      42
+};
+
+static const yytype_int8 yycheck[] =
+{
+       0,     1,     0,    11,    13,     5,     6,    16,     8,    17,
+      10,    17,    12,    19,    14,     7,    15,    16,    18,     9,
+      20,    23,    22,     4,    24,    25,    26,    27,    28,    29,
+      30,    31,    21,     4,     4,     4,     4,     4,     3,    -1,
+      31
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+   symbol of state STATE-NUM.  */
+static const yytype_uint8 yystos[] =
+{
+       0,    33,    34,     0,     1,     5,     6,     8,    10,    12,
+      14,    18,    20,    22,    24,    25,    26,    27,    28,    29,
+      30,    31,    35,     7,     9,    11,    17,    13,    16,    15,
+      16,    17,    19,    21,    23,     4,     4,     4,     4,     4,
+       4,     3,    31
+};
+
+#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 <stdio.h> /* 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
+
+\f
+
+#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 */
+\f
+
+/*-----------------------------------------------.
+| 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;
+    }
+}
+\f
+
+/* 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 7:
+#line 51 "gram.y"
+    { run_test(); }
+    break;
+
+  case 8:
+#line 53 "gram.y"
+    { change_test ((yyvsp[(2) - (2)].num), TRUE); }
+    break;
+
+  case 9:
+#line 55 "gram.y"
+    { GC_change_function ((yyvsp[(2) - (2)].num), TRUE); }
+    break;
+
+  case 10:
+#line 57 "gram.y"
+    { GC_change_linestyle ((yyvsp[(2) - (2)].num), TRUE); }
+    break;
+
+  case 11:
+#line 59 "gram.y"
+    { GC_change_linestyle (LineSolid, TRUE); }
+    break;
+
+  case 12:
+#line 61 "gram.y"
+    { GC_change_capstyle ((yyvsp[(2) - (2)].num), TRUE); }
+    break;
+
+  case 13:
+#line 63 "gram.y"
+    { GC_change_capstyle (CapRound, TRUE); }
+    break;
+
+  case 14:
+#line 65 "gram.y"
+    { GC_change_joinstyle ((yyvsp[(2) - (2)].num), TRUE); }
+    break;
+
+  case 15:
+#line 67 "gram.y"
+    { GC_change_joinstyle (JoinRound, TRUE); }
+    break;
+
+  case 16:
+#line 69 "gram.y"
+    { GC_change_fillstyle ((yyvsp[(2) - (2)].num), TRUE); }
+    break;
+
+  case 17:
+#line 71 "gram.y"
+    { GC_change_fillstyle (FillSolid, TRUE); }
+    break;
+
+  case 18:
+#line 73 "gram.y"
+    { GC_change_fillrule ((yyvsp[(2) - (2)].num), TRUE); }
+    break;
+
+  case 19:
+#line 75 "gram.y"
+    { GC_change_arcmode ((yyvsp[(2) - (2)].num), TRUE); }
+    break;
+
+  case 20:
+#line 77 "gram.y"
+    { GC_change_foreground ((yyvsp[(2) - (2)].num), TRUE); }
+    break;
+
+  case 21:
+#line 79 "gram.y"
+    { GC_change_background ((yyvsp[(2) - (2)].num), TRUE); }
+    break;
+
+  case 22:
+#line 81 "gram.y"
+    { GC_change_linewidth ((yyvsp[(2) - (2)].num), TRUE); }
+    break;
+
+  case 23:
+#line 83 "gram.y"
+    { GC_change_planemask ((yyvsp[(2) - (2)].num), TRUE); }
+    break;
+
+  case 24:
+#line 85 "gram.y"
+    { GC_change_dashlist ((yyvsp[(2) - (2)].num), TRUE); }
+    break;
+
+  case 25:
+#line 87 "gram.y"
+    { GC_change_font ((yyvsp[(2) - (2)].ptr), TRUE); }
+    break;
+
+  case 26:
+#line 89 "gram.y"
+    { change_percent ((yyvsp[(2) - (2)].num), TRUE); }
+    break;
+
+
+/* Line 1267 of yacc.c.  */
+#line 1511 "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 92 "gram.y"
+
+void
+yyerror(const char *s)
+{
+  fprintf(stderr, "xgc: syntax error, line %d\n", yylineno);
+}
+
diff --git a/xgc/gram.h b/xgc/gram.h
new file mode 100644 (file)
index 0000000..a9b285f
--- /dev/null
@@ -0,0 +1,121 @@
+/* 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 {
+     STRING = 258,
+     NUMBER = 259,
+     RUN = 260,
+     FUNCTION = 261,
+     FUNCTIONTYPE = 262,
+     TEST = 263,
+     TESTTYPE = 264,
+     LINESTYLE = 265,
+     LINESTYLETYPE = 266,
+     CAPSTYLE = 267,
+     CAPSTYLETYPE = 268,
+     JOINSTYLE = 269,
+     JOINSTYLETYPE = 270,
+     ROUND = 271,
+     SOLID = 272,
+     FILLSTYLE = 273,
+     FILLSTYLETYPE = 274,
+     FILLRULE = 275,
+     FILLRULETYPE = 276,
+     ARCMODE = 277,
+     ARCMODETYPE = 278,
+     FOREGROUND = 279,
+     BACKGROUND = 280,
+     LINEWIDTH = 281,
+     PLANEMASK = 282,
+     DASHLIST = 283,
+     PERCENT = 284,
+     FONT = 285
+   };
+#endif
+/* Tokens.  */
+#define STRING 258
+#define NUMBER 259
+#define RUN 260
+#define FUNCTION 261
+#define FUNCTIONTYPE 262
+#define TEST 263
+#define TESTTYPE 264
+#define LINESTYLE 265
+#define LINESTYLETYPE 266
+#define CAPSTYLE 267
+#define CAPSTYLETYPE 268
+#define JOINSTYLE 269
+#define JOINSTYLETYPE 270
+#define ROUND 271
+#define SOLID 272
+#define FILLSTYLE 273
+#define FILLSTYLETYPE 274
+#define FILLRULE 275
+#define FILLRULETYPE 276
+#define ARCMODE 277
+#define ARCMODETYPE 278
+#define FOREGROUND 279
+#define BACKGROUND 280
+#define LINEWIDTH 281
+#define PLANEMASK 282
+#define DASHLIST 283
+#define PERCENT 284
+#define FONT 285
+
+
+
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 19 "gram.y"
+{
+  int num;
+  char *ptr;
+}
+/* Line 1489 of yacc.c.  */
+#line 114 "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/xgc/gram.y b/xgc/gram.y
new file mode 100644 (file)
index 0000000..e9cc92c
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+** grammar for xgc syntax
+*/
+/* $XFree86: xc/programs/xgc/gram.y,v 1.3 2000/02/17 14:00:36 dawes Exp $ */
+
+%{
+#define YYDEBUG 1
+
+#include <stdio.h>
+#include <X11/X.h>
+#include <X11/Intrinsic.h>
+#include "xgc.h"
+
+extern int yylineno;
+
+%}
+
+%union
+{
+  int num;
+  char *ptr;
+};
+
+%token <ptr> STRING
+%token <num> NUMBER
+%token <num> RUN
+%token <num> FUNCTION FUNCTIONTYPE
+%token <num> TEST TESTTYPE
+%token <num> LINESTYLE LINESTYLETYPE
+%token <num> CAPSTYLE CAPSTYLETYPE
+%token <num> JOINSTYLE JOINSTYLETYPE
+%token <num> ROUND SOLID
+%token <num> FILLSTYLE FILLSTYLETYPE
+%token <num> FILLRULE FILLRULETYPE
+%token <num> ARCMODE ARCMODETYPE
+%token <num> FOREGROUND BACKGROUND LINEWIDTH PLANEMASK DASHLIST PERCENT
+%token <num> FONT
+
+%%
+
+all            : stmts
+               ;
+
+stmts          : /* empty */
+               | stmts '\n'
+               | stmts stmt '\n'
+               ;
+
+stmt           : error
+               | RUN 
+       { run_test(); }  
+               | TEST TESTTYPE 
+       { change_test ($2, TRUE); }
+               | FUNCTION FUNCTIONTYPE 
+       { GC_change_function ($2, TRUE); }
+               | LINESTYLE LINESTYLETYPE 
+       { GC_change_linestyle ($2, TRUE); }
+               | LINESTYLE SOLID
+       { GC_change_linestyle (LineSolid, TRUE); }
+               | CAPSTYLE CAPSTYLETYPE 
+       { GC_change_capstyle ($2, TRUE); }
+               | CAPSTYLE ROUND 
+       { GC_change_capstyle (CapRound, TRUE); }
+               | JOINSTYLE JOINSTYLETYPE 
+       { GC_change_joinstyle ($2, TRUE); }
+               | JOINSTYLE ROUND 
+       { GC_change_joinstyle (JoinRound, TRUE); }
+               | FILLSTYLE FILLSTYLETYPE
+       { GC_change_fillstyle ($2, TRUE); }
+               | FILLSTYLE SOLID
+       { GC_change_fillstyle (FillSolid, TRUE); }
+               | FILLRULE FILLRULETYPE
+       { GC_change_fillrule ($2, TRUE); }
+               | ARCMODE ARCMODETYPE
+       { GC_change_arcmode ($2, TRUE); }
+               | FOREGROUND NUMBER
+       { GC_change_foreground ($2, TRUE); }
+               | BACKGROUND NUMBER
+       { GC_change_background ($2, TRUE); }
+               | LINEWIDTH NUMBER
+       { GC_change_linewidth ($2, TRUE); }
+               | PLANEMASK NUMBER
+       { GC_change_planemask ($2, TRUE); }
+               | DASHLIST NUMBER
+       { GC_change_dashlist ($2, TRUE); }
+               | FONT STRING
+       { GC_change_font ($2, TRUE); }
+               | PERCENT NUMBER
+       { change_percent ($2, TRUE); }
+               ;
+
+%%
+void
+yyerror(const char *s)
+{
+  fprintf(stderr, "xgc: syntax error, line %d\n", yylineno);
+}
diff --git a/xgc/install-sh b/xgc/install-sh
new file mode 100755 (executable)
index 0000000..6781b98
--- /dev/null
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# 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.
+
+nl='
+'
+IFS=" ""       $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+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:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+       shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+       case $mode in
+         *' '* | *'    '* | *'
+'*       | *'*'* | *'?'* | *'['*)
+           echo "$0: invalid mode: $mode" >&2
+           exit 1;;
+       esac
+       shift;;
+
+    -o) chowncmd="$chownprog $2"
+       shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+       shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)        shift
+       break;;
+
+    -*)        echo "$0: invalid option: $1" >&2
+       exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # 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: $dst_arg: Is a directory" >&2
+       exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+       (dirname "$dst") 2>/dev/null ||
+       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+            X"$dst" : 'X\(//\)[^/]' \| \
+            X"$dst" : 'X\(//\)$' \| \
+            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+       echo X"$dst" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+       # Create intermediate dirs using mode 755 as modified by the umask.
+       # This is like FreeBSD 'install' as of 1997-10-28.
+       umask=`umask`
+       case $stripcmd.$umask in
+         # Optimize common cases.
+         *[2367][2367]) mkdir_umask=$umask;;
+         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+         *[0-7])
+           mkdir_umask=`expr $umask + 22 \
+             - $umask % 100 % 40 + $umask % 20 \
+             - $umask % 10 % 4 + $umask % 2
+           `;;
+         *) mkdir_umask=$umask,go-w;;
+       esac
+
+       # With -d, create the new directory with the user-specified mode.
+       # Otherwise, rely on $mkdir_umask.
+       if test -n "$dir_arg"; then
+         mkdir_mode=-m$mode
+       else
+         mkdir_mode=
+       fi
+
+       posix_mkdir=false
+       case $umask in
+         *[123567][0-7][0-7])
+           # POSIX mkdir -p sets u+wx bits regardless of umask, which
+           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+           ;;
+         *)
+           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+           if (umask $mkdir_umask &&
+               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+           then
+             if test -z "$dir_arg" || {
+                  # Check for POSIX incompatibilities with -m.
+                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                  # other-writeable bit of parent directory when it shouldn't.
+                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                  case $ls_ld_tmpdir in
+                    d????-?r-*) different_mode=700;;
+                    d????-?--*) different_mode=755;;
+                    *) false;;
+                  esac &&
+                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                  }
+                }
+             then posix_mkdir=:
+             fi
+             rmdir "$tmpdir/d" "$tmpdir"
+           else
+             # Remove any dirs left behind by ancient mkdir implementations.
+             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+           fi
+           trap '' 0;;
+       esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+       umask $mkdir_umask &&
+       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+       /*) prefix='/';;
+       -*) prefix='./';;
+       *)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+       test -z "$d" && continue
+
+       prefix=$prefix$d
+       if test -d "$prefix"; then
+         prefixes=
+       else
+         if $posix_mkdir; then
+           (umask=$mkdir_umask &&
+            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+           # Don't fail if two instances are running concurrently.
+           test -d "$prefix" || exit 1
+         else
+           case $prefix in
+             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+             *) qprefix=$prefix;;
+           esac
+           prefixes="$prefixes '$qprefix'"
+         fi
+       fi
+       prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+       # Don't fail if two instances are running concurrently.
+       (umask $mkdir_umask &&
+        eval "\$doit_exec \$mkdirprog $prefixes") ||
+         test -d "$dstdir" || exit 1
+       obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # 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
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"    2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+       # Now remove or move aside any old file at destination location.
+       # We try this two ways since rm can't unlink itself on some
+       # systems and the destination file might be busy for other
+       # reasons.  In this case, the final cleanup might fail but the new
+       # file should still install successfully.
+       {
+         test ! -f "$dst" ||
+         $doit $rmcmd -f "$dst" 2>/dev/null ||
+         { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+           { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+         } ||
+         { echo "$0: cannot unlink or rename $dst" >&2
+           (exit 1); exit 1
+         }
+       } &&
+
+       # Now rename the file to the real destination.
+       $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xgc/interpret.c b/xgc/interpret.c
new file mode 100644 (file)
index 0000000..9b05c55
--- /dev/null
@@ -0,0 +1,348 @@
+/*
+** interpret.c
+**
+** interprets and executes lines in the Xgc syntax.
+*/
+/* $XFree86: xc/programs/xgc/interpret.c,v 1.4 2002/01/07 20:38:30 dawes Exp $ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include "xgc.h"
+#include "tile"
+
+
+/* interpret(string)
+** -----------------
+** Takes string, which is a line written in the xgc syntax, figures
+** out what it means, and passes the buck to the right procedure.
+** That procedure gets called with feedback set to FALSE; interpret()
+** is only called if the user is selecting things interactively.
+**
+** This procedure will go away when I can figure out how to make yacc
+** and lex read from strings as well as files.
+*/
+
+void
+interpret(const char *string)
+{
+  char word1[20], word2[80];
+  int i;
+
+  sscanf(string,"%s",word1);
+  if (!strcmp(word1,"run")) run_test();
+
+  else {
+    sscanf(string,"%s %s",word1,word2);
+    print_if_recording(string);
+
+    /* So word1 is the first word on the line and word2 is the second.
+       Now the fun begins... */
+    
+    if (!strcmp(word1,TestStuff.choice.text))  {
+      for (i=0;i<NUM_TESTS;++i) {
+       if (!strcmp(word2,(TestStuff.data)[i].text)) {
+         change_test((TestStuff.data)[i].code,FALSE);
+         break;
+       }
+      }
+    }
+    else if (!strcmp(word1,FunctionStuff.choice.text)) {
+      for (i=0;i<NUM_FUNCTIONS;++i) {
+       if (!strcmp(word2,(FunctionStuff.data)[i].text)) {
+         GC_change_function((FunctionStuff.data)[i].code,FALSE);
+         break;
+       }
+      }
+    }
+    else if (!strcmp(word1,LinestyleStuff.choice.text)) {
+      for (i=0;i<NUM_LINESTYLES;++i) {
+       if (!strcmp(word2,(LinestyleStuff.data)[i].text)) {
+         GC_change_linestyle((LinestyleStuff.data)[i].code,FALSE);
+         break;
+       }
+      }
+    }
+    else if (!strcmp(word1,"linewidth"))
+      GC_change_linewidth(atoi(word2),FALSE);
+    else if (!strcmp(word1,CapstyleStuff.choice.text)) {
+      for (i=0;i<NUM_CAPSTYLES;++i) {
+       if (!strcmp(word2,(CapstyleStuff.data)[i].text)) {
+         GC_change_capstyle((CapstyleStuff.data)[i].code,FALSE);
+         break;
+       }
+      }
+    }
+    else if (!strcmp(word1,JoinstyleStuff.choice.text)) {
+      for (i=0;i<NUM_JOINSTYLES;++i) {
+       if (!strcmp(word2,(JoinstyleStuff.data)[i].text)) {
+         GC_change_joinstyle((JoinstyleStuff.data)[i].code,FALSE);
+         break;
+       }
+      }
+    }
+    else if (!strcmp(word1,FillstyleStuff.choice.text)) {
+      for (i=0;i<NUM_FILLSTYLES;++i) {
+       if (!strcmp(word2,(FillstyleStuff.data)[i].text)) {
+         GC_change_fillstyle((FillstyleStuff.data)[i].code,FALSE);
+         break;
+       }
+      }
+    }
+    else if (!strcmp(word1,FillruleStuff.choice.text)) {
+      for (i=0;i<NUM_FILLRULES;++i) {
+       if (!strcmp(word2,(FillruleStuff.data)[i].text)) {
+         GC_change_fillrule((FillruleStuff.data)[i].code,FALSE);
+         break;
+       }
+      }
+    }
+    else if (!strcmp(word1,ArcmodeStuff.choice.text)) {
+      for (i=0;i<NUM_ARCMODES;++i) {
+       if (!strcmp(word2,(ArcmodeStuff.data)[i].text)) {
+         GC_change_arcmode((ArcmodeStuff.data)[i].code,FALSE);
+         break;
+       }
+      }
+    }
+    else if (!strcmp(word1,"planemask")) 
+      GC_change_planemask((unsigned long) atoi(word2),FALSE);
+    else if (!strcmp(word1,"dashlist"))
+      GC_change_dashlist(atoi(word2),FALSE);
+    else if (!strcmp(word1,"font"))
+      GC_change_font(word2,FALSE);
+    else if (!strcmp(word1,"foreground"))
+      GC_change_foreground((unsigned long) atoi(word2),FALSE);
+    else if (!strcmp(word1,"background"))
+      GC_change_background((unsigned long) atoi(word2),FALSE);
+    else if (!strcmp(word1,"percent"))
+      change_percent(atoi(word2), FALSE);
+    else fprintf(stderr,"Ack... %s %s\n",word1,word2);
+  }
+}
+
+#ifdef notdef
+void
+interpret(const char *instring)
+{
+  FILE *inend;
+  
+  print_if_recording(instring);
+  yyin = outend;
+  inend = fdopen(fildes[1],"w");
+  fprintf(inend,"%s",instring);
+  fclose(inend);
+  yyparse();
+}
+#endif
+
+#define select_correct_button(which,number) \
+  select_button(GCdescs[(which)],(number));
+
+/* GC_change_blahzee(foo,feedback)
+** ---------------------
+** Changes the blahzee field in xgc's GC to foo.  If feedback is TRUE,
+** changes the display to reflect this (makes it look like the user
+** selected the button, or typed in the text, or whatever).
+*/
+
+void
+GC_change_function(int function, Boolean feedback)
+{
+  XSetFunction(X.dpy,X.gc,function);
+  X.gcv.function = function;
+  if (feedback) select_correct_button(CFunction,function);
+}
+
+void
+GC_change_foreground(unsigned long foreground, Boolean feedback)
+{
+  char text[40];
+
+  XSetForeground(X.dpy,X.miscgc,foreground);
+  XCopyPlane(X.dpy,X.stipple,X.tile,X.miscgc,0,0,tile_width,tile_height,0,0,1);
+  XSetForeground(X.dpy,X.gc,foreground);
+  X.gcv.foreground = foreground;
+  XSetTile(X.dpy,X.gc,X.tile);
+  XSetTile(X.dpy,X.miscgc,X.tile);
+  if (feedback) {
+    snprintf(text, sizeof text, "%lu",foreground);
+    change_text(foregroundtext,text);
+  }
+}
+
+void
+GC_change_background(unsigned long background, Boolean feedback)
+{
+  char text[40];
+
+  XSetBackground(X.dpy,X.miscgc,background);
+  XCopyPlane(X.dpy,X.stipple,X.tile,X.miscgc,0,0,tile_width,tile_height,0,0,1);
+  XSetBackground(X.dpy,X.gc,background);
+  X.gcv.background = background;
+  XSetTile(X.dpy,X.gc,X.tile);
+  XSetTile(X.dpy,X.miscgc,X.tile);
+
+  /* Update the background of the test window NOW. */
+
+  XSetWindowBackground(X.dpy,XtWindow(test),background);
+  XClearWindow(X.dpy,XtWindow(test));
+
+  if (feedback) {
+    snprintf(text, sizeof text, "%lu",background);
+    change_text(backgroundtext,text);
+  }
+}
+
+void
+GC_change_linewidth(int linewidth, Boolean feedback)
+{
+  char text[40];
+
+  X.gcv.line_width = linewidth;
+  XChangeGC(X.dpy,X.gc,GCLineWidth,&X.gcv);
+  if (feedback) {
+    snprintf(text, sizeof text, "%d",linewidth);
+    change_text(linewidthtext,text);
+  }
+}
+
+void
+GC_change_linestyle(int linestyle, Boolean feedback)
+{
+  X.gcv.line_style = linestyle;
+  XChangeGC(X.dpy,X.gc,GCLineStyle,&X.gcv);
+  if (feedback) select_correct_button(CLinestyle,linestyle);
+}
+
+void
+GC_change_capstyle(int capstyle, Boolean feedback)
+{
+  X.gcv.cap_style = capstyle;
+  XChangeGC(X.dpy,X.gc,GCCapStyle,&X.gcv);
+  if (feedback) select_correct_button(CCapstyle,capstyle);
+}
+
+void
+GC_change_joinstyle(int joinstyle, Boolean feedback)
+{
+  X.gcv.join_style = joinstyle;
+  XChangeGC(X.dpy,X.gc,GCJoinStyle,&X.gcv);
+  if (feedback) select_correct_button(CJoinstyle,joinstyle);
+}
+
+void
+GC_change_fillstyle(int fillstyle, Boolean feedback)
+{
+  XSetFillStyle(X.dpy,X.gc,fillstyle);
+  X.gcv.fill_style = fillstyle;
+  if (feedback) select_correct_button(CFillstyle,fillstyle);
+}
+
+void
+GC_change_fillrule(int fillrule, Boolean feedback)
+{
+  XSetFillRule(X.dpy,X.gc,fillrule);
+  X.gcv.fill_rule = fillrule;
+  if (feedback) select_correct_button(CFillrule,fillrule);
+}
+
+void
+GC_change_arcmode(int arcmode, Boolean feedback)
+{
+  XSetArcMode(X.dpy,X.gc,arcmode);
+  X.gcv.arc_mode = arcmode;
+  if (feedback) select_correct_button(CArcmode,arcmode);
+}
+
+/* GC_change_dashlist(dashlist)
+** ----------------------------
+** Now this one's a bit tricky.  dashlist gets passed in as an int, but we
+** want to change it to an array of chars, like the GC likes it.
+** For example:
+**     119 => XXX_XXX_ => [3,1,3,1]
+*/
+
+void
+GC_change_dashlist(int dashlist, Boolean feedback) 
+{
+  char dasharray[DASHLENGTH];  /* what we're gonna pass to XSetDashes */
+  int dashnumber = 0;          /* which element of dasharray we're currently
+                                  modifying */
+  int i;                       /* which bit of the dashlist we're on */
+  int state = 1;               /* whether the list bit we checked was
+                                  on (1) or off (0) */
+                                 
+  /* Initialize the dasharray */
+
+  for (i = 0; i < DASHLENGTH; ++i) dasharray[i] = 0;
+
+  if (dashlist == 0) return;   /* having no dashes at all is bogus */
+
+  /* XSetDashes expects the dashlist to start with an on bit, so if it
+  ** doesn't, we keep on rotating it until it does */
+
+  while (!(dashlist&1)) dashlist /= 2;
+
+  /* Go through all the bits in dashlist, and update the dasharray
+  ** accordingly */
+
+  for (i = 0; i < DASHLENGTH; ++i) {
+    /* the following if statements checks to see if the bit we're looking
+    ** at as the same on or offness as the one before it (state).  If
+    ** so, we increment the length of the current dash. */
+
+    if (((dashlist&1<<i) && state) || (!(dashlist&1<<i) && !state))
+      ++dasharray[dashnumber];
+    else {                     
+      state = state^1;         /* reverse the state */
+      ++dasharray[++dashnumber]; /* start a new dash */
+    }
+  } 
+
+  XSetDashes(X.dpy,X.gc,0,dasharray,dashnumber+1);
+  X.gcv.dashes = dashlist;
+
+  if (feedback) update_dashlist(dashlist);
+}
+
+void
+GC_change_planemask(unsigned long planemask, Boolean feedback)
+{
+  XSetPlaneMask(X.dpy,X.gc,planemask);
+  X.gcv.plane_mask = planemask;
+  if (feedback) update_planemask((long)planemask);
+}
+
+void
+change_test(int test, Boolean feedback) 
+{
+  X.test = test;
+  if (feedback) select_button(testchoicedesc,test);
+}
+
+void
+GC_change_font(char *str, Boolean feedback)
+{
+  int num_fonts;               /* number of fonts that match the string */
+
+  XListFonts(X.dpy,str,1,&num_fonts); /* see if the font exists */
+
+  if (num_fonts) {
+    XSetFont(X.dpy,X.gc,XLoadFont(X.dpy,str));
+    if (feedback) change_text(fonttext,str);
+  }
+}
+
+void
+change_percent(int percent, Boolean feedback)
+{
+  /* Make sure that percent is valid */
+
+  if (percent < 1 || percent > 100) return;
+
+  X.percent = (float) percent / 100.0;
+
+  if (feedback) update_slider(percent);
+}
diff --git a/xgc/lex.c b/xgc/lex.c
new file mode 100644 (file)
index 0000000..2668109
--- /dev/null
+++ b/xgc/lex.c
@@ -0,0 +1,2412 @@
+
+#line 3 "lex.c"
+
+#define  YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 35
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with  platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types. 
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t; 
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN               (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN              (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN              (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX               (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX              (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX              (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX              (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX             (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX             (4294967295U)
+#endif
+
+#endif /* ! FLEXINT_H */
+
+#ifdef __cplusplus
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else  /* ! __cplusplus */
+
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
+
+#define YY_USE_CONST
+
+#endif /* defined (__STDC__) */
+#endif /* ! __cplusplus */
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#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. */
+#ifndef YY_BUF_SIZE
+#define YY_BUF_SIZE 16384
+#endif
+
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+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
+
+    #define YY_LESS_LINENO(n)
+    
+/* Return all but the first "n" matched characters back to the input stream. */
+#define yyless(n) \
+       do \
+               { \
+               /* Undo effects of setting up yytext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+               *yy_cp = (yy_hold_char); \
+               YY_RESTORE_YY_MORE_OFFSET \
+               (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+               YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+               } \
+       while ( 0 )
+
+#define unput(c) yyunput( c, (yytext_ptr)  )
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+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;
+
+    int yy_bs_lineno; /**< The line count. */
+    int yy_bs_column; /**< The column count. */
+    
+       /* 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
+
+       };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* Stack of input buffers. */
+static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
+
+/* 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".
+ *
+ * Returns the top of the stack, or NULL.
+ */
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+                          : NULL)
+
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
+
+/* 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 = 0;                /* 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 (FILE *input_file  );
+void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
+YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
+void yy_delete_buffer (YY_BUFFER_STATE b  );
+void yy_flush_buffer (YY_BUFFER_STATE b  );
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
+void yypop_buffer_state (void );
+
+static void yyensure_buffer_stack (void );
+static void yy_load_buffer_state (void );
+static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
+
+#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
+
+YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
+YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
+
+void *yyalloc (yy_size_t  );
+void *yyrealloc (void *,yy_size_t  );
+void yyfree (void *  );
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+       { \
+       if ( ! YY_CURRENT_BUFFER ){ \
+        yyensure_buffer_stack (); \
+               YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer(yyin,YY_BUF_SIZE ); \
+       } \
+       YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+       }
+
+#define yy_set_bol(at_bol) \
+       { \
+       if ( ! YY_CURRENT_BUFFER ){\
+        yyensure_buffer_stack (); \
+               YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer(yyin,YY_BUF_SIZE ); \
+       } \
+       YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+       }
+
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+/* Begin user sect3 */
+
+typedef unsigned char YY_CHAR;
+
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+
+typedef int yy_state_type;
+
+extern int yylineno;
+
+int yylineno = 1;
+
+extern char *yytext;
+#define yytext_ptr yytext
+
+static yy_state_type yy_get_previous_state (void );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
+static int yy_get_next_buffer (void );
+static void yy_fatal_error (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 = (size_t) (yy_cp - yy_bp); \
+       (yy_hold_char) = *yy_cp; \
+       *yy_cp = '\0'; \
+       (yy_c_buf_p) = yy_cp;
+
+#define YY_NUM_RULES 72
+#define YY_END_OF_BUFFER 73
+/* This struct is not used in this scanner,
+   but its presence is necessary. */
+struct yy_trans_info
+       {
+       flex_int32_t yy_verify;
+       flex_int32_t yy_nxt;
+       };
+static yyconst flex_int16_t yy_accept[420] =
+    {   0,
+        0,    0,   73,   70,   68,   69,   70,   70,   65,   70,
+       70,   70,   70,   70,   70,   70,   70,   70,   70,   70,
+       70,   70,   70,   70,   70,   70,   70,   70,   70,   70,
+       70,   70,   70,   70,   70,   70,   70,   70,   70,   70,
+       70,   70,    0,   66,   70,   70,    0,   67,   65,   70,
+       70,   70,   70,   70,   70,   70,   70,   70,   70,   70,
+       70,   70,   70,   70,   70,   70,   70,   70,   70,   70,
+       70,   70,   70,   70,   70,   10,   70,   70,   70,   70,
+       70,   70,   70,   70,   70,   70,   70,   70,   70,   70,
+       70,   70,   70,   70,   66,    0,   70,    0,   66,   70,
+
+        4,   70,   70,   70,   70,   70,   70,   70,   70,   70,
+       70,   70,   70,   70,   70,   70,   70,   70,   70,   70,
+       70,   70,   70,   70,   70,   11,   70,   70,   70,   70,
+       70,   70,   70,   70,   70,   70,   70,   70,    1,   18,
+       70,   70,   70,   70,   70,    9,   70,   70,   66,    0,
+       70,   70,   70,   70,   70,   41,   70,   70,   70,    6,
+       70,   70,   70,   70,   70,   63,   70,   70,   70,   70,
+       70,   70,   70,   70,   17,    8,   70,   70,   70,   70,
+       70,   70,   70,   70,   70,   70,   70,   70,   70,   70,
+       19,   70,   70,    6,   70,   70,   70,   70,   70,   45,
+
+       70,   56,    3,   70,   70,   70,   70,   70,   12,   70,
+       70,   70,   70,   70,   70,   70,   70,   70,   70,   70,
+       70,   44,   70,   70,   70,   70,   70,   70,   70,   70,
+       70,   70,   70,   70,   70,   70,   70,   70,   70,   46,
+       51,   70,   48,   70,   70,   70,   70,   70,   70,   70,
+       70,   70,   70,   70,   70,   70,   70,   70,   70,   70,
+       70,   70,   13,   70,   70,   70,   70,   70,   70,   70,
+       70,   70,   70,   70,   70,   70,   70,   70,   70,   70,
+       70,   70,   70,   70,   70,   70,   70,   55,   70,   70,
+       70,   70,   70,   70,   70,   53,   70,   70,   70,   70,
+
+       70,   70,   70,   70,   70,   70,   40,   70,   70,   70,
+       70,   64,   70,   70,   26,   70,   70,   70,   70,   70,
+       70,   70,   70,   70,   54,   70,   70,   70,   39,   20,
+       70,   70,   62,   70,   70,   52,   70,   70,    2,   31,
+       70,   70,   70,   70,   70,   70,   70,   70,   57,   70,
+       70,   23,   70,   70,   70,   70,   70,   30,   49,   70,
+       70,   70,   70,   21,   70,   70,   47,   70,   70,   43,
+       36,   60,   37,   70,   70,   14,   61,   70,   70,   22,
+       70,   70,   70,   32,   70,   70,    5,   59,   70,   38,
+       70,   58,   70,   33,   70,   16,   70,   70,   70,   70,
+
+       34,   42,    7,   70,   27,   35,   70,   29,   70,   70,
+       24,   15,   70,   28,   70,   70,   25,   50,    0
+    } ;
+
+static yyconst flex_int32_t yy_ec[256] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    2,    1,    4,    5,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    6,    7,    6,
+        6,    6,    6,    8,    6,    9,    6,    1,    1,    1,
+        1,    1,    1,    1,   10,   11,   12,   13,   14,   15,
+       16,    1,   17,   18,    1,   19,   20,   21,   22,   23,
+        1,   24,   25,   26,    1,    1,   27,   28,    1,    1,
+        1,   29,    1,    1,    1,    1,   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,    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,    1,    1,    1,    1
+    } ;
+
+static yyconst flex_int32_t yy_meta[55] =
+    {   0,
+        1,    2,    2,    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 flex_int16_t yy_base[427] =
+    {   0,
+        0,    0,  498,    0,  499,  499,   53,   56,   54,   21,
+       35,   36,   37,   24,   34,  463,   44,  452,  457,  456,
+       44,   46,   56,   48,   61,   45,  455,  448,  461,   71,
+      460,  443,   58,  445,   69,  440,   70,  436,  451,  450,
+        0,  114,  103,    0,  117,  120,  480,  499,  118,  449,
+      449,  448,  428,  429,  432,  432,  441,  429,  425,  422,
+      421,  436,  428,   86,  425,  418,  436,  414,  426,  420,
+      413,  418,   87,  438,  429,  111,  411,  423,  426,  414,
+      410,  404,  402,  408,  401,  408,  410,  399,  405,  402,
+      397,  398,  401,   93,  499,  135,  145,  126,  148,  154,
+
+      136,  399,  400,  405,  389,  389,  389,  405,  380,  396,
+      401,  393,  387,  388,  379,  393,  394,  408,  388,  389,
+      379,  387,  386,  386,  373,    0,  398,  381,  369,  371,
+      379,  380,  386,  367,  355,  369,  390,  363,    0,    0,
+      367,  359,  354,  368,  368,    0,  346,  358,  137,  141,
+      355,  363,  352,  359,  353,    0,  344,  359,  344,  144,
+      349,  348,  337,  365,  139,    0,  350,  336,  342,  349,
+      335,  333,  111,  333,    0,    0,  349,  343,  327,  325,
+      324,  340,  332,  338,  165,  337,  328,  336,  335,  322,
+        0,  333,  327,  347,  121,  312,  311,  328,  313,    0,
+
+      305,    0,    0,  311,  314,  315,  317,  320,    0,  320,
+      308,  301,  301,  302,  310,  317,  320,  296,  295,  294,
+      304,    0,  293,  327,  305,  304,  303,  293,  297,  292,
+      286,  294,  293,  286,  295,  294,  293,  294,  295,    0,
+        0,  283,    0,  280,  288,  287,  286,  275,  277,  283,
+      265,  285,  266,  300,  279,  270,  269,  255,  264,  263,
+      270,  271,    0,  250,  249,  269,  252,  270,  274,  251,
+      250,  247,  263,  264,  261,  251,  248,  252,  257,  252,
+      234,  237,  249,  250,  247,  235,  234,    0,  230,  245,
+      248,  243,  233,  226,  244,    0,  219,  238,  230,  220,
+
+      226,  234,  214,  225,  224,  215,    0,  215,  213,  212,
+      212,    0,  225,  210,    0,  216,  222,  212,  205,  211,
+      203,  213,  216,  216,    0,  199,  199,  203,    0,    0,
+      198,  210,    0,  195,  206,    0,  207,  197,    0,    0,
+      190,  204,  203,  199,  198,  196,  199,  198,    0,  191,
+      155,    0,  181,  199,  194,  164,  184,    0,    0,  192,
+      191,  191,  174,    0,  185,  177,    0,  187,  169,    0,
+        0,    0,    0,  174,  185,    0,    0,  170,  182,    0,
+      172,  171,  205,    0,  176,  178,    0,    0,  176,    0,
+      166,    0,  200,    0,  162,    0,  174,  173,  168,  136,
+
+        0,    0,    0,  149,    0,    0,  140,    0,  123,  101,
+        0,    0,   80,    0,   75,   43,    0,    0,  499,   70,
+      191,  193,  195,  197,  199,  201
+    } ;
+
+static yyconst flex_int16_t yy_def[427] =
+    {   0,
+      419,    1,  419,  420,  419,  419,  421,  422,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  421,  423,  420,  424,  422,  425,  419,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  419,  426,  421,  423,  421,  424,
+
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  423,  426,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+
+      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
+      420,  420,  420,  420,  420,  420,  420,  420,    0,  419,
+      419,  419,  419,  419,  419,  419
+    } ;
+
+static yyconst flex_int16_t yy_nxt[554] =
+    {   0,
+        4,    5,    6,    7,    8,    9,    9,    9,    9,   10,
+       11,   12,   13,   14,   15,   16,   17,   18,   19,   20,
+       21,   22,   23,   24,   25,   26,   27,   28,    4,   10,
+       29,   30,   31,   32,   33,    4,    4,   34,   18,    4,
+       19,    4,   35,   36,   37,    4,   38,   39,   40,    4,
+        4,    4,   28,    4,   43,   43,   44,   47,   48,   49,
+       49,   49,   49,   50,   52,   55,   59,   51,   53,   61,
+       41,   63,   56,   72,   62,  418,   57,   64,   88,   58,
+       60,   45,   89,   65,   54,   67,   68,   73,   74,   77,
+       75,   83,   76,   78,   85,   93,   79,   84,   72,   80,
+
+       55,   64,   81,   77,   86,   82,   95,   65,  417,   87,
+       79,   57,   94,  416,   92,   43,   43,   44,   98,   43,
+       99,   47,   48,   49,   49,   49,   49,  130,  115,   95,
+      125,   96,  116,  126,  131,  127,  125,   43,  149,  126,
+       95,  415,   45,   43,  149,  100,   43,   43,   44,   43,
+       43,   44,  151,  204,   96,   98,   43,   99,  220,  152,
+      205,  211,  221,  150,  378,   96,  206,  212,  213,  150,
+      383,  414,  384,   45,  231,  393,   45,  394,  379,  232,
+      413,  412,  100,  233,  411,  212,  213,  234,  235,  236,
+      237,   42,   42,   46,   46,   43,   43,   97,   97,   47,
+
+       47,   98,   98,  410,  409,  408,  407,  406,  405,  404,
+      403,  402,  401,  400,  399,  398,  397,  396,  395,  392,
+      391,  390,  389,  388,  387,  386,  385,  382,  381,  380,
+      377,  376,  375,  374,  373,  372,  371,  370,  369,  368,
+      367,  366,  365,  364,  363,  362,  361,  360,  359,  358,
+      357,  356,  355,  354,  353,  352,  351,  350,  349,  348,
+      347,  346,  345,  344,  343,  342,  341,  340,  339,  338,
+      337,  336,  335,  334,  333,  332,  331,  330,  329,  328,
+      327,  326,  325,  324,  323,  322,  321,  320,  319,  318,
+      317,  316,  315,  314,  313,  312,  311,  310,  309,  308,
+
+      307,  306,  305,  304,  303,  302,  301,  300,  299,  298,
+      297,  296,  295,  294,  293,  292,  291,  290,  289,  288,
+      287,  286,  285,  284,  283,  282,  281,  280,  279,  278,
+      277,  276,  275,  274,  273,  272,  271,  270,  269,  268,
+      267,  266,  265,  264,  263,  262,  261,  260,  259,  258,
+      257,  256,  255,  254,  253,  252,  251,  250,  249,  248,
+      247,  246,  245,  205,  244,  243,  242,  241,  240,  239,
+      238,  230,  229,  228,  227,  226,  225,  224,  223,  222,
+      219,  218,  217,  216,  215,  214,  210,  209,  208,  207,
+      203,  202,  201,  200,  199,  198,  197,  196,  195,  194,
+
+      193,  192,  191,  190,  189,  188,  187,  186,  185,  184,
+      183,  182,  181,  180,  179,  178,  177,  176,  175,  174,
+      173,  172,  171,  170,  169,  168,  167,  166,  165,  164,
+      163,  162,  161,  160,  159,  158,  157,  156,  155,  154,
+      153,  148,  147,  146,  145,  144,  143,  142,  141,  140,
+      139,  138,  137,  136,  135,  134,  133,  132,  129,  128,
+      124,  123,  122,  121,  120,  119,  118,  117,  114,  113,
+      112,  111,  110,  109,  108,  107,  106,  105,  104,  103,
+      102,  101,   48,   88,   85,   84,   76,   68,   61,   59,
+       52,   91,   90,   71,   70,   69,   66,  419,    3,  419,
+
+      419,  419,  419,  419,  419,  419,  419,  419,  419,  419,
+      419,  419,  419,  419,  419,  419,  419,  419,  419,  419,
+      419,  419,  419,  419,  419,  419,  419,  419,  419,  419,
+      419,  419,  419,  419,  419,  419,  419,  419,  419,  419,
+      419,  419,  419,  419,  419,  419,  419,  419,  419,  419,
+      419,  419,  419
+    } ;
+
+static yyconst flex_int16_t yy_chk[554] =
+    {   0,
+        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,    7,    7,    7,    8,    8,    9,
+        9,    9,    9,   10,   11,   12,   13,   10,   11,   14,
+      420,   15,   12,   21,   14,  416,   12,   15,   26,   12,
+       13,    7,   26,   15,   11,   17,   17,   21,   22,   23,
+       22,   24,   22,   23,   25,   33,   23,   24,   35,   23,
+
+       30,   33,   23,   37,   25,   23,   43,   33,  415,   25,
+       37,   30,   35,  413,   30,   42,   42,   42,   45,   45,
+       45,   46,   46,   49,   49,   49,   49,   76,   64,   98,
+       73,   43,   64,   73,   76,   73,   94,   96,   96,   94,
+      149,  410,   42,  150,  150,   45,   97,   97,   97,   99,
+       99,   99,  101,  160,   98,  100,  100,  100,  173,  101,
+      160,  165,  173,   96,  351,  149,  160,  195,  195,  150,
+      356,  409,  356,   97,  185,  369,   99,  369,  351,  185,
+      407,  404,  100,  185,  400,  165,  165,  185,  185,  185,
+      185,  421,  421,  422,  422,  423,  423,  424,  424,  425,
+
+      425,  426,  426,  399,  398,  397,  395,  393,  391,  389,
+      386,  385,  383,  382,  381,  379,  378,  375,  374,  368,
+      366,  365,  363,  362,  361,  360,  357,  355,  354,  353,
+      350,  348,  347,  346,  345,  344,  343,  342,  341,  338,
+      337,  335,  334,  332,  331,  328,  327,  326,  324,  323,
+      322,  321,  320,  319,  318,  317,  316,  314,  313,  311,
+      310,  309,  308,  306,  305,  304,  303,  302,  301,  300,
+      299,  298,  297,  295,  294,  293,  292,  291,  290,  289,
+      287,  286,  285,  284,  283,  282,  281,  280,  279,  278,
+      277,  276,  275,  274,  273,  272,  271,  270,  269,  268,
+
+      267,  266,  265,  264,  262,  261,  260,  259,  258,  257,
+      256,  255,  254,  253,  252,  251,  250,  249,  248,  247,
+      246,  245,  244,  242,  239,  238,  237,  236,  235,  234,
+      233,  232,  231,  230,  229,  228,  227,  226,  225,  224,
+      223,  221,  220,  219,  218,  217,  216,  215,  214,  213,
+      212,  211,  210,  208,  207,  206,  205,  204,  201,  199,
+      198,  197,  196,  194,  193,  192,  190,  189,  188,  187,
+      186,  184,  183,  182,  181,  180,  179,  178,  177,  174,
+      172,  171,  170,  169,  168,  167,  164,  163,  162,  161,
+      159,  158,  157,  155,  154,  153,  152,  151,  148,  147,
+
+      145,  144,  143,  142,  141,  138,  137,  136,  135,  134,
+      133,  132,  131,  130,  129,  128,  127,  125,  124,  123,
+      122,  121,  120,  119,  118,  117,  116,  115,  114,  113,
+      112,  111,  110,  109,  108,  107,  106,  105,  104,  103,
+      102,   93,   92,   91,   90,   89,   88,   87,   86,   85,
+       84,   83,   82,   81,   80,   79,   78,   77,   75,   74,
+       72,   71,   70,   69,   68,   67,   66,   65,   63,   62,
+       61,   60,   59,   58,   57,   56,   55,   54,   53,   52,
+       51,   50,   47,   40,   39,   38,   36,   34,   32,   31,
+       29,   28,   27,   20,   19,   18,   16,    3,  419,  419,
+
+      419,  419,  419,  419,  419,  419,  419,  419,  419,  419,
+      419,  419,  419,  419,  419,  419,  419,  419,  419,  419,
+      419,  419,  419,  419,  419,  419,  419,  419,  419,  419,
+      419,  419,  419,  419,  419,  419,  419,  419,  419,  419,
+      419,  419,  419,  419,  419,  419,  419,  419,  419,  419,
+      419,  419,  419
+    } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
+extern int yy_flex_debug;
+int yy_flex_debug = 0;
+
+/* 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"
+/* $XConsortium: lex.l,v 1.8 94/03/31 20:40:44 rws Exp $ */
+/* $XFree86: xc/programs/xgc/lex.l,v 1.3 2000/04/05 18:14:07 dawes Exp $ */
+/*
+** lex file for xgc syntax
+*/
+/* Lots of stuff stolen from gwm's wool.lex */
+#line 10 "lex.l"
+
+#include <X11/X.h>
+#include <stdlib.h>
+#include "gram.h"
+#include "constants.h"
+#if defined(FLEX_SCANNER) && !defined(YY_FLEX_LEX_COMPAT) && !defined(__UNIXOS2__)
+int yylineno;
+#endif
+#line 726 "lex.c"
+
+#define INITIAL 0
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+static int yy_init_globals (void );
+
+/* Accessor methods to globals.
+   These are made visible to non-reentrant scanners for convenience. */
+
+int yylex_destroy (void );
+
+int yyget_debug (void );
+
+void yyset_debug (int debug_flag  );
+
+YY_EXTRA_TYPE yyget_extra (void );
+
+void yyset_extra (YY_EXTRA_TYPE user_defined  );
+
+FILE *yyget_in (void );
+
+void yyset_in  (FILE * in_str  );
+
+FILE *yyget_out (void );
+
+void yyset_out  (FILE * out_str  );
+
+int yyget_leng (void );
+
+char *yyget_text (void );
+
+int yyget_lineno (void );
+
+void yyset_lineno (int line_number  );
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap (void );
+#else
+extern int yywrap (void );
+#endif
+#endif
+
+    static void yyunput (int c,char *buf_ptr  );
+    
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char *,yyconst char *,int );
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * );
+#endif
+
+#ifndef YY_NO_INPUT
+
+#ifdef __cplusplus
+static int yyinput (void );
+#else
+static int input (void );
+#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 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_LVALUE->yy_is_interactive ) \
+               { \
+               int c = '*'; \
+               int 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 \
+               { \
+               errno=0; \
+               while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+                       { \
+                       if( errno != EINTR) \
+                               { \
+                               YY_FATAL_ERROR( "input in flex scanner failed" ); \
+                               break; \
+                               } \
+                       errno=0; \
+                       clearerr(yyin); \
+                       } \
+               }\
+\
+
+#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
+
+/* end tables serialization structures and prototypes */
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+extern int yylex (void);
+
+#define YY_DECL int yylex (void)
+#endif /* !YY_DECL */
+
+/* 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
+
+/** The main scanner function which does all the work.
+ */
+YY_DECL
+{
+       register yy_state_type yy_current_state;
+       register char *yy_cp, *yy_bp;
+       register int yy_act;
+    
+#line 27 "lex.l"
+
+
+#line 911 "lex.c"
+
+       if ( !(yy_init) )
+               {
+               (yy_init) = 1;
+
+#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 ) {
+                       yyensure_buffer_stack ();
+                       YY_CURRENT_BUFFER_LVALUE =
+                               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 >= 420 )
+                                       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] != 499 );
+
+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 29 "lex.l"
+{ return (RUN); }
+       YY_BREAK
+case 2:
+YY_RULE_SETUP
+#line 31 "lex.l"
+{ return (FUNCTION); }
+       YY_BREAK
+case 3:
+YY_RULE_SETUP
+#line 32 "lex.l"
+{ yylval.num = GXclear;
+                                 return (FUNCTIONTYPE); }
+       YY_BREAK
+case 4:
+YY_RULE_SETUP
+#line 34 "lex.l"
+{ yylval.num = GXand;
+                                 return (FUNCTIONTYPE); }
+       YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 36 "lex.l"
+{ yylval.num = GXandReverse;
+                                 return (FUNCTIONTYPE); }
+       YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 38 "lex.l"
+{ yylval.num = GXcopy;
+                                 return (FUNCTIONTYPE); }
+       YY_BREAK
+case 7:
+YY_RULE_SETUP
+#line 40 "lex.l"
+{ yylval.num = GXandInverted;
+                                 return (FUNCTIONTYPE); }
+       YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 42 "lex.l"
+{ yylval.num = GXnoop;
+                                 return (FUNCTIONTYPE); }
+       YY_BREAK
+case 9:
+YY_RULE_SETUP
+#line 44 "lex.l"
+{ yylval.num = GXxor;
+                                 return (FUNCTIONTYPE); }
+       YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 46 "lex.l"
+{ yylval.num = GXor;
+                                 return (FUNCTIONTYPE); }
+       YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 48 "lex.l"
+{ yylval.num = GXnor;
+                                 return (FUNCTIONTYPE); }
+       YY_BREAK
+case 12:
+YY_RULE_SETUP
+#line 50 "lex.l"
+{ yylval.num = GXequiv;
+                                 return (FUNCTIONTYPE); }
+       YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 52 "lex.l"
+{ yylval.num = GXinvert;
+                                 return (FUNCTIONTYPE); }
+       YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 54 "lex.l"
+{ yylval.num = GXorReverse;
+                                 return (FUNCTIONTYPE); }
+       YY_BREAK
+case 15:
+YY_RULE_SETUP
+#line 56 "lex.l"
+{ yylval.num = GXcopyInverted;
+                                 return (FUNCTIONTYPE); }
+       YY_BREAK
+case 16:
+YY_RULE_SETUP
+#line 58 "lex.l"
+{ yylval.num = GXorInverted;
+                                 return (FUNCTIONTYPE); }
+       YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 60 "lex.l"
+{ yylval.num = GXnand;
+                                 return (FUNCTIONTYPE); }
+       YY_BREAK
+case 18:
+YY_RULE_SETUP
+#line 62 "lex.l"
+{ yylval.num = GXset;
+                                 return (FUNCTIONTYPE); }
+       YY_BREAK
+case 19:
+YY_RULE_SETUP
+#line 65 "lex.l"
+{ return (TEST); }
+       YY_BREAK
+case 20:
+YY_RULE_SETUP
+#line 66 "lex.l"
+{ yylval.num = CopyArea;
+                                 return (TESTTYPE); }
+       YY_BREAK
+case 21:
+YY_RULE_SETUP
+#line 68 "lex.l"
+{ yylval.num = CopyPlane;
+                                 return (TESTTYPE); }
+       YY_BREAK
+case 22:
+YY_RULE_SETUP
+#line 70 "lex.l"
+{ yylval.num = PolyPoint;
+                                 return (TESTTYPE); }
+       YY_BREAK
+case 23:
+YY_RULE_SETUP
+#line 72 "lex.l"
+{ yylval.num = PolyLine;
+                                 return (TESTTYPE); }
+       YY_BREAK
+case 24:
+YY_RULE_SETUP
+#line 74 "lex.l"
+{ yylval.num = PolySegment;
+                                 return (TESTTYPE); }
+       YY_BREAK
+case 25:
+YY_RULE_SETUP
+#line 76 "lex.l"
+{ yylval.num = PolyRectangle;
+                                 return (TESTTYPE); }
+       YY_BREAK
+case 26:
+YY_RULE_SETUP
+#line 78 "lex.l"
+{ yylval.num = PolyArc;
+                                 return (TESTTYPE); }
+       YY_BREAK
+case 27:
+YY_RULE_SETUP
+#line 80 "lex.l"
+{ yylval.num = FillPolygon;
+                                 return (TESTTYPE); }
+       YY_BREAK
+case 28:
+YY_RULE_SETUP
+#line 82 "lex.l"
+{ yylval.num = PolyFillRect;
+                                 return (TESTTYPE); }
+       YY_BREAK
+case 29:
+YY_RULE_SETUP
+#line 84 "lex.l"
+{ yylval.num = PolyFillArc;
+                                 return (TESTTYPE); }
+       YY_BREAK
+case 30:
+YY_RULE_SETUP
+#line 86 "lex.l"
+{ yylval.num = PutImage;
+                                 return (TESTTYPE); }
+       YY_BREAK
+case 31:
+YY_RULE_SETUP
+#line 88 "lex.l"
+{ yylval.num = GetImage;
+                                 return (TESTTYPE); }
+       YY_BREAK
+case 32:
+YY_RULE_SETUP
+#line 90 "lex.l"
+{ yylval.num = PolyText8;
+                                 return (TESTTYPE); }
+       YY_BREAK
+case 33:
+YY_RULE_SETUP
+#line 92 "lex.l"
+{ yylval.num = ImageText8;
+                                 return (TESTTYPE); }
+       YY_BREAK
+case 34:
+YY_RULE_SETUP
+#line 94 "lex.l"
+{ yylval.num = PolyText16;
+                                 return (TESTTYPE); }
+       YY_BREAK
+case 35:
+YY_RULE_SETUP
+#line 96 "lex.l"
+{ yylval.num = ImageText16;
+                                 return (TESTTYPE); }
+       YY_BREAK
+case 36:
+YY_RULE_SETUP
+#line 99 "lex.l"
+{ return (LINESTYLE); }
+       YY_BREAK
+case 37:
+YY_RULE_SETUP
+#line 100 "lex.l"
+{ yylval.num = LineOnOffDash;
+                                 return (LINESTYLETYPE); }
+       YY_BREAK
+case 38:
+YY_RULE_SETUP
+#line 102 "lex.l"
+{ yylval.num = LineDoubleDash;
+                                 return (LINESTYLETYPE); }
+       YY_BREAK
+case 39:
+YY_RULE_SETUP
+#line 105 "lex.l"
+{ return (CAPSTYLE); }
+       YY_BREAK
+case 40:
+YY_RULE_SETUP
+#line 106 "lex.l"
+{ yylval.num = CapNotLast;
+                                 return (CAPSTYLETYPE); }
+       YY_BREAK
+case 41:
+YY_RULE_SETUP
+#line 108 "lex.l"
+{ yylval.num = CapButt;
+                                 return (CAPSTYLETYPE); }
+       YY_BREAK
+case 42:
+YY_RULE_SETUP
+#line 110 "lex.l"
+{ yylval.num = CapProjecting;
+                                 return (CAPSTYLETYPE); }
+       YY_BREAK
+case 43:
+YY_RULE_SETUP
+#line 113 "lex.l"
+{ return (JOINSTYLE); }
+       YY_BREAK
+case 44:
+YY_RULE_SETUP
+#line 114 "lex.l"
+{ yylval.num = JoinMiter;
+                                 return (JOINSTYLETYPE); }
+       YY_BREAK
+case 45:
+YY_RULE_SETUP
+#line 116 "lex.l"
+{ yylval.num = JoinBevel;
+                                 return (JOINSTYLETYPE); }
+       YY_BREAK
+case 46:
+YY_RULE_SETUP
+#line 119 "lex.l"
+{ return (ROUND); }
+       YY_BREAK
+case 47:
+YY_RULE_SETUP
+#line 121 "lex.l"
+{ return (FILLSTYLE); }
+       YY_BREAK
+case 48:
+YY_RULE_SETUP
+#line 122 "lex.l"
+{ yylval.num = FillTiled;
+                                 return (FILLSTYLETYPE); }
+       YY_BREAK
+case 49:
+YY_RULE_SETUP
+#line 124 "lex.l"
+{ yylval.num = FillStippled;
+                                 return (FILLSTYLETYPE); }
+       YY_BREAK
+case 50:
+YY_RULE_SETUP
+#line 126 "lex.l"
+{ yylval.num = FillOpaqueStippled;
+                                 return (FILLSTYLETYPE); }
+       YY_BREAK
+case 51:
+YY_RULE_SETUP
+#line 129 "lex.l"
+{ return (SOLID); }
+       YY_BREAK
+case 52:
+YY_RULE_SETUP
+#line 131 "lex.l"
+{ return (FILLRULE); }
+       YY_BREAK
+case 53:
+YY_RULE_SETUP
+#line 132 "lex.l"
+{ yylval.num = EvenOddRule;
+                                 return (FILLRULETYPE); }
+       YY_BREAK
+case 54:
+YY_RULE_SETUP
+#line 134 "lex.l"
+{ yylval.num = WindingRule;
+                                 return (FILLRULETYPE); }
+       YY_BREAK
+case 55:
+YY_RULE_SETUP
+#line 137 "lex.l"
+{ return (ARCMODE); }
+       YY_BREAK
+case 56:
+YY_RULE_SETUP
+#line 138 "lex.l"
+{ yylval.num = ArcChord;
+                                 return (ARCMODETYPE); }
+       YY_BREAK
+case 57:
+YY_RULE_SETUP
+#line 140 "lex.l"
+{ yylval.num = ArcPieSlice;
+                                 return (ARCMODETYPE); }
+       YY_BREAK
+case 58:
+YY_RULE_SETUP
+#line 143 "lex.l"
+{ return (FOREGROUND); }
+       YY_BREAK
+case 59:
+YY_RULE_SETUP
+#line 144 "lex.l"
+{ return (BACKGROUND); }
+       YY_BREAK
+case 60:
+YY_RULE_SETUP
+#line 145 "lex.l"
+{ return (LINEWIDTH); }
+       YY_BREAK
+case 61:
+YY_RULE_SETUP
+#line 146 "lex.l"
+{ return (PLANEMASK); }
+       YY_BREAK
+case 62:
+YY_RULE_SETUP
+#line 147 "lex.l"
+{ return (DASHLIST); }
+       YY_BREAK
+case 63:
+YY_RULE_SETUP
+#line 148 "lex.l"
+{ return (FONT); }
+       YY_BREAK
+case 64:
+YY_RULE_SETUP
+#line 149 "lex.l"
+{ return (PERCENT); }
+       YY_BREAK
+case 65:
+YY_RULE_SETUP
+#line 151 "lex.l"
+{ (void) sscanf ((char *)yytext, "%d", &yylval.num);
+                                 return (NUMBER); }
+       YY_BREAK
+case 66:
+/* rule 66 can match eol */
+YY_RULE_SETUP
+#line 153 "lex.l"
+{ yylval.ptr = (char *) yytext;
+                                 return (STRING); }
+       YY_BREAK
+case 67:
+/* rule 67 can match eol */
+YY_RULE_SETUP
+#line 155 "lex.l"
+{ ; }
+       YY_BREAK
+case 68:
+YY_RULE_SETUP
+#line 156 "lex.l"
+{ ; }
+       YY_BREAK
+case 69:
+/* rule 69 can match eol */
+YY_RULE_SETUP
+#line 157 "lex.l"
+{ return ('\n'); }
+       YY_BREAK
+case 70:
+YY_RULE_SETUP
+#line 159 "lex.l"
+{ yylval.ptr = (char *) yytext;
+                                 return (STRING); }
+       YY_BREAK
+case 71:
+YY_RULE_SETUP
+#line 162 "lex.l"
+{ fprintf(stderr,
+                                       "xgc: bad character `%s', line %d\n",
+                                       yytext, yylineno); }
+       YY_BREAK
+case 72:
+YY_RULE_SETUP
+#line 166 "lex.l"
+ECHO;
+       YY_BREAK
+#line 1408 "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_LVALUE->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_LVALUE->yy_n_chars;
+                       YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+                       YY_CURRENT_BUFFER_LVALUE->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_LVALUE->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_LVALUE->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 (void)
+{
+       register char *dest = YY_CURRENT_BUFFER_LVALUE->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_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+               YY_FATAL_ERROR(
+               "fatal flex scanner internal error--end of buffer missed" );
+
+       if ( YY_CURRENT_BUFFER_LVALUE->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_LVALUE->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_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+
+       else
+               {
+                       int num_to_read =
+                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+               while ( num_to_read <= 0 )
+                       { /* Not enough room in the buffer - grow it. */
+
+                       /* 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. */
+                                       yyrealloc((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_LVALUE->yy_buf_size -
+                                               number_to_move - 1;
+
+                       }
+
+               if ( num_to_read > YY_READ_BUF_SIZE )
+                       num_to_read = YY_READ_BUF_SIZE;
+
+               /* Read in more data. */
+               YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+                       (yy_n_chars), (size_t) num_to_read );
+
+               YY_CURRENT_BUFFER_LVALUE->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_LVALUE->yy_buffer_status =
+                               YY_BUFFER_EOF_PENDING;
+                       }
+               }
+
+       else
+               ret_val = EOB_ACT_CONTINUE_SCAN;
+
+       if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+               /* Extend the array by 50%, plus the number we really need. */
+               yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+               YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
+               if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+                       YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+       }
+
+       (yy_n_chars) += number_to_move;
+       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+       (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->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 (void)
+{
+       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 >= 420 )
+                               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 );
+ */
+    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
+{
+       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 >= 420 )
+                       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 == 419);
+
+       return yy_is_jam ? 0 : yy_current_state;
+}
+
+    static void yyunput (int c, register char * yy_bp )
+{
+       register char *yy_cp;
+    
+    yy_cp = (yy_c_buf_p);
+
+       /* undo effects of setting up yytext */
+       *yy_cp = (yy_hold_char);
+
+       if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->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_LVALUE->yy_ch_buf[
+                                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
+               register char *source =
+                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
+
+               while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+                       *--dest = *--source;
+
+               yy_cp += (int) (dest - source);
+               yy_bp += (int) (dest - source);
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+
+               if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->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;
+}
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+    static int yyinput (void)
+#else
+    static int input  (void)
+#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_LVALUE->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 );
+
+                                       /*FALLTHROUGH*/
+
+                               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 /* ifndef YY_NO_INPUT */
+
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ * 
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+    void yyrestart  (FILE * input_file )
+{
+    
+       if ( ! YY_CURRENT_BUFFER ){
+        yyensure_buffer_stack ();
+               YY_CURRENT_BUFFER_LVALUE =
+            yy_create_buffer(yyin,YY_BUF_SIZE );
+       }
+
+       yy_init_buffer(YY_CURRENT_BUFFER,input_file );
+       yy_load_buffer_state( );
+}
+
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ * 
+ */
+    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
+{
+    
+       /* TODO. We should be able to replace this entire function body
+        * with
+        *              yypop_buffer_state();
+        *              yypush_buffer_state(new_buffer);
+     */
+       yyensure_buffer_stack ();
+       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_LVALUE->yy_buf_pos = (yy_c_buf_p);
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+               }
+
+       YY_CURRENT_BUFFER_LVALUE = 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;
+}
+
+static void yy_load_buffer_state  (void)
+{
+       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+       (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+       yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+       (yy_hold_char) = *(yy_c_buf_p);
+}
+
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ * 
+ * @return the allocated buffer state.
+ */
+    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
+{
+       YY_BUFFER_STATE b;
+    
+       b = (YY_BUFFER_STATE) yyalloc(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 *) yyalloc(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;
+}
+
+/** Destroy the buffer.
+ * @param b a buffer created with yy_create_buffer()
+ * 
+ */
+    void yy_delete_buffer (YY_BUFFER_STATE  b )
+{
+    
+       if ( ! b )
+               return;
+
+       if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+               YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+
+       if ( b->yy_is_our_buffer )
+               yyfree((void *) b->yy_ch_buf  );
+
+       yyfree((void *) b  );
+}
+
+#ifndef __cplusplus
+extern int isatty (int );
+#endif /* __cplusplus */
+    
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a yyrestart() or at EOF.
+ */
+    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
+
+{
+       int oerrno = errno;
+    
+       yy_flush_buffer(b );
+
+       b->yy_input_file = file;
+       b->yy_fill_buffer = 1;
+
+    /* If b is the current buffer, then yy_init_buffer was _probably_
+     * called from yyrestart() or through yy_get_next_buffer.
+     * In that case, we don't want to reset the lineno or column.
+     */
+    if (b != YY_CURRENT_BUFFER){
+        b->yy_bs_lineno = 1;
+        b->yy_bs_column = 0;
+    }
+
+        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+    
+       errno = oerrno;
+}
+
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ * 
+ */
+    void yy_flush_buffer (YY_BUFFER_STATE  b )
+{
+       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( );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ *  the current state. This function will allocate the stack
+ *  if necessary.
+ *  @param new_buffer The new state.
+ *  
+ */
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
+{
+       if (new_buffer == NULL)
+               return;
+
+       yyensure_buffer_stack();
+
+       /* This block is copied from yy_switch_to_buffer. */
+       if ( YY_CURRENT_BUFFER )
+               {
+               /* Flush out information for old buffer. */
+               *(yy_c_buf_p) = (yy_hold_char);
+               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+               }
+
+       /* Only push if top exists. Otherwise, replace top. */
+       if (YY_CURRENT_BUFFER)
+               (yy_buffer_stack_top)++;
+       YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+       /* copied from yy_switch_to_buffer. */
+       yy_load_buffer_state( );
+       (yy_did_buffer_switch_on_eof) = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ *  The next element becomes the new top.
+ *  
+ */
+void yypop_buffer_state (void)
+{
+       if (!YY_CURRENT_BUFFER)
+               return;
+
+       yy_delete_buffer(YY_CURRENT_BUFFER );
+       YY_CURRENT_BUFFER_LVALUE = NULL;
+       if ((yy_buffer_stack_top) > 0)
+               --(yy_buffer_stack_top);
+
+       if (YY_CURRENT_BUFFER) {
+               yy_load_buffer_state( );
+               (yy_did_buffer_switch_on_eof) = 1;
+       }
+}
+
+/* Allocates the stack if it does not exist.
+ *  Guarantees space for at least one push.
+ */
+static void yyensure_buffer_stack (void)
+{
+       int num_to_alloc;
+    
+       if (!(yy_buffer_stack)) {
+
+               /* First allocation is just for 2 elements, since we don't know if this
+                * scanner will even need a stack. We use 2 instead of 1 to avoid an
+                * immediate realloc on the next call.
+         */
+               num_to_alloc = 1;
+               (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+                                                               (num_to_alloc * sizeof(struct yy_buffer_state*)
+                                                               );
+               if ( ! (yy_buffer_stack) )
+                       YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+                                                                 
+               memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+                               
+               (yy_buffer_stack_max) = num_to_alloc;
+               (yy_buffer_stack_top) = 0;
+               return;
+       }
+
+       if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+               /* Increase the buffer to prepare for a possible push. */
+               int grow_size = 8 /* arbitrary grow size */;
+
+               num_to_alloc = (yy_buffer_stack_max) + grow_size;
+               (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
+                                                               ((yy_buffer_stack),
+                                                               num_to_alloc * sizeof(struct yy_buffer_state*)
+                                                               );
+               if ( ! (yy_buffer_stack) )
+                       YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+
+               /* zero only the new slots.*/
+               memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+               (yy_buffer_stack_max) = num_to_alloc;
+       }
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ * 
+ * @return the newly allocated buffer state object. 
+ */
+YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
+{
+       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) yyalloc(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;
+}
+
+/** Setup the input buffer state to scan a string. The next call to yylex() will
+ * scan from a @e copy of @a str.
+ * @param yystr a NUL-terminated string to scan
+ * 
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ *       yy_scan_bytes() instead.
+ */
+YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
+{
+    
+       return yy_scan_bytes(yystr,strlen(yystr) );
+}
+
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
+ * scan from a @e copy of @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * 
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
+{
+       YY_BUFFER_STATE b;
+       char *buf;
+       yy_size_t n;
+       int i;
+    
+       /* Get memory for full buffer, including space for trailing EOB's. */
+       n = _yybytes_len + 2;
+       buf = (char *) yyalloc(n  );
+       if ( ! buf )
+               YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+       for ( i = 0; i < _yybytes_len; ++i )
+               buf[i] = yybytes[i];
+
+       buf[_yybytes_len] = buf[_yybytes_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;
+}
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+static void yy_fatal_error (yyconst char* msg )
+{
+       (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. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+               yytext[yyleng] = (yy_hold_char); \
+               (yy_c_buf_p) = yytext + yyless_macro_arg; \
+               (yy_hold_char) = *(yy_c_buf_p); \
+               *(yy_c_buf_p) = '\0'; \
+               yyleng = yyless_macro_arg; \
+               } \
+       while ( 0 )
+
+/* Accessor  methods (get/set functions) to struct members. */
+
+/** Get the current line number.
+ * 
+ */
+int yyget_lineno  (void)
+{
+        
+    return yylineno;
+}
+
+/** Get the input stream.
+ * 
+ */
+FILE *yyget_in  (void)
+{
+        return yyin;
+}
+
+/** Get the output stream.
+ * 
+ */
+FILE *yyget_out  (void)
+{
+        return yyout;
+}
+
+/** Get the length of the current token.
+ * 
+ */
+int yyget_leng  (void)
+{
+        return yyleng;
+}
+
+/** Get the current token.
+ * 
+ */
+
+char *yyget_text  (void)
+{
+        return yytext;
+}
+
+/** Set the current line number.
+ * @param line_number
+ * 
+ */
+void yyset_lineno (int  line_number )
+{
+    
+    yylineno = line_number;
+}
+
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ * 
+ * @see yy_switch_to_buffer
+ */
+void yyset_in (FILE *  in_str )
+{
+        yyin = in_str ;
+}
+
+void yyset_out (FILE *  out_str )
+{
+        yyout = out_str ;
+}
+
+int yyget_debug  (void)
+{
+        return yy_flex_debug;
+}
+
+void yyset_debug (int  bdebug )
+{
+        yy_flex_debug = bdebug ;
+}
+
+static int yy_init_globals (void)
+{
+        /* Initialization is the same as for the non-reentrant scanner.
+     * This function is called from yylex_destroy(), so don't allocate here.
+     */
+
+    (yy_buffer_stack) = 0;
+    (yy_buffer_stack_top) = 0;
+    (yy_buffer_stack_max) = 0;
+    (yy_c_buf_p) = (char *) 0;
+    (yy_init) = 0;
+    (yy_start) = 0;
+
+/* Defined in main.c */
+#ifdef YY_STDINIT
+    yyin = stdin;
+    yyout = stdout;
+#else
+    yyin = (FILE *) 0;
+    yyout = (FILE *) 0;
+#endif
+
+    /* For future reference: Set errno on error, since we are called by
+     * yylex_init()
+     */
+    return 0;
+}
+
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy  (void)
+{
+    
+    /* Pop the buffer stack, destroying each element. */
+       while(YY_CURRENT_BUFFER){
+               yy_delete_buffer(YY_CURRENT_BUFFER  );
+               YY_CURRENT_BUFFER_LVALUE = NULL;
+               yypop_buffer_state();
+       }
+
+       /* Destroy the stack itself. */
+       yyfree((yy_buffer_stack) );
+       (yy_buffer_stack) = NULL;
+
+    /* Reset the globals. This is important in a non-reentrant scanner so the next time
+     * yylex() is called, initialization will occur. */
+    yy_init_globals( );
+
+    return 0;
+}
+
+/*
+ * Internal utility routines.
+ */
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+{
+       register int i;
+       for ( i = 0; i < n; ++i )
+               s1[i] = s2[i];
+}
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * s )
+{
+       register int n;
+       for ( n = 0; s[n]; ++n )
+               ;
+
+       return n;
+}
+#endif
+
+void *yyalloc (yy_size_t  size )
+{
+       return (void *) malloc( size );
+}
+
+void *yyrealloc  (void * ptr, yy_size_t  size )
+{
+       /* 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 );
+}
+
+void yyfree (void * ptr )
+{
+       free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
+
+#line 166 "lex.l"
+
+
+
+#ifndef yywrap
+int yywrap(void) { return (1); }
+#endif
+
diff --git a/xgc/lex.l b/xgc/lex.l
new file mode 100644 (file)
index 0000000..6a7f6e0
--- /dev/null
+++ b/xgc/lex.l
@@ -0,0 +1,170 @@
+/* $XConsortium: lex.l,v 1.8 94/03/31 20:40:44 rws Exp $ */
+/* $XFree86: xc/programs/xgc/lex.l,v 1.3 2000/04/05 18:14:07 dawes Exp $ */
+/*
+** lex file for xgc syntax
+*/
+
+/* Lots of stuff stolen from gwm's wool.lex */
+
+%{
+
+#include <X11/X.h>
+#include <stdlib.h>
+#include "gram.h"
+#include "constants.h"
+#if defined(FLEX_SCANNER) && !defined(YY_FLEX_LEX_COMPAT) && !defined(__UNIXOS2__)
+int yylineno;
+#endif
+%}
+
+%p                             4000
+%a                             3000
+
+number                         [0-9]+
+word                           [^\n\t ]+
+string                         \"([^"]|\\.)*\"
+
+%%
+
+[Rr]un                         { return (RUN); }
+
+[Ff]unction                    { return (FUNCTION); }
+[Cc]lear                       { yylval.num = GXclear;
+                                 return (FUNCTIONTYPE); }
+[Aa]nd                         { yylval.num = GXand;
+                                 return (FUNCTIONTYPE); }
+[Aa]ndReverse                  { yylval.num = GXandReverse;
+                                 return (FUNCTIONTYPE); }
+[Cc]opy                                { yylval.num = GXcopy;
+                                 return (FUNCTIONTYPE); }
+[Aa]ndInverted                 { yylval.num = GXandInverted;
+                                 return (FUNCTIONTYPE); }
+[Nn]oop                                { yylval.num = GXnoop;
+                                 return (FUNCTIONTYPE); }
+[Xx]or                         { yylval.num = GXxor;
+                                 return (FUNCTIONTYPE); }
+[Oo]r                          { yylval.num = GXor;
+                                 return (FUNCTIONTYPE); }
+[Nn]or                         { yylval.num = GXnor;
+                                 return (FUNCTIONTYPE); }
+[Ee]quiv                       { yylval.num = GXequiv;
+                                 return (FUNCTIONTYPE); }
+[Ii]nvert                      { yylval.num = GXinvert;
+                                 return (FUNCTIONTYPE); }
+[Oo]rReverse                   { yylval.num = GXorReverse;
+                                 return (FUNCTIONTYPE); }
+[Cc]opyInverted                        { yylval.num = GXcopyInverted;
+                                 return (FUNCTIONTYPE); }
+[Oo]rInverted                  { yylval.num = GXorInverted;
+                                 return (FUNCTIONTYPE); }
+[Nn]and                                { yylval.num = GXnand;
+                                 return (FUNCTIONTYPE); }
+[Ss]et                         { yylval.num = GXset;
+                                 return (FUNCTIONTYPE); }
+
+[Tt]est                                { return (TEST); }
+CopyArea                       { yylval.num = CopyArea;
+                                 return (TESTTYPE); }
+CopyPlane                      { yylval.num = CopyPlane;
+                                 return (TESTTYPE); }
+PolyPoint                      { yylval.num = PolyPoint;
+                                 return (TESTTYPE); }
+PolyLine                       { yylval.num = PolyLine;
+                                 return (TESTTYPE); }
+PolySegment                    { yylval.num = PolySegment;
+                                 return (TESTTYPE); }
+PolyRectangle                  { yylval.num = PolyRectangle;
+                                 return (TESTTYPE); }
+PolyArc                                { yylval.num = PolyArc;
+                                 return (TESTTYPE); }
+FillPolygon                    { yylval.num = FillPolygon;
+                                 return (TESTTYPE); }
+PolyFillRect                   { yylval.num = PolyFillRect;
+                                 return (TESTTYPE); }
+PolyFillArc                    { yylval.num = PolyFillArc;
+                                 return (TESTTYPE); }
+PutImage                       { yylval.num = PutImage;
+                                 return (TESTTYPE); }
+GetImage                       { yylval.num = GetImage;
+                                 return (TESTTYPE); }
+PolyText8                      { yylval.num = PolyText8;
+                                 return (TESTTYPE); }
+ImageText8                     { yylval.num = ImageText8;
+                                 return (TESTTYPE); }
+PolyText16                     { yylval.num = PolyText16;
+                                 return (TESTTYPE); }
+ImageText16                    { yylval.num = ImageText16;
+                                 return (TESTTYPE); }
+
+[Ll]inestyle                   { return (LINESTYLE); }
+OnOffDash                      { yylval.num = LineOnOffDash;
+                                 return (LINESTYLETYPE); }
+DoubleDash                     { yylval.num = LineDoubleDash;
+                                 return (LINESTYLETYPE); }
+
+[Cc]apstyle                    { return (CAPSTYLE); }
+NotLast                                { yylval.num = CapNotLast;
+                                 return (CAPSTYLETYPE); }
+Butt                           { yylval.num = CapButt;
+                                 return (CAPSTYLETYPE); }
+Projecting                     { yylval.num = CapProjecting;
+                                 return (CAPSTYLETYPE); }
+
+[Jj]oinstyle                   { return (JOINSTYLE); }
+Miter                          { yylval.num = JoinMiter;
+                                 return (JOINSTYLETYPE); }
+Bevel                          { yylval.num = JoinBevel;
+                                 return (JOINSTYLETYPE); }
+
+Round                          { return (ROUND); }
+
+[Ff]illstyle                   { return (FILLSTYLE); }
+Tiled                          { yylval.num = FillTiled;
+                                 return (FILLSTYLETYPE); }
+Stippled                       { yylval.num = FillStippled;
+                                 return (FILLSTYLETYPE); }
+OpaqueStippled                 { yylval.num = FillOpaqueStippled;
+                                 return (FILLSTYLETYPE); }
+
+Solid                          { return (SOLID); }
+
+[Ff]illrule                    { return (FILLRULE); }
+EvenOdd                                { yylval.num = EvenOddRule;
+                                 return (FILLRULETYPE); }
+Winding                                { yylval.num = WindingRule;
+                                 return (FILLRULETYPE); }
+
+[Aa]rcmode                     { return (ARCMODE); }
+Chord                          { yylval.num = ArcChord;
+                                 return (ARCMODETYPE); }
+PieSlice                       { yylval.num = ArcPieSlice;
+                                 return (ARCMODETYPE); }
+
+[Ff]oreground                  { return (FOREGROUND); }
+[Bb]ackground                  { return (BACKGROUND); }
+[Ll]inewidth                   { return (LINEWIDTH); }
+[Pp]lanemask                   { return (PLANEMASK); }
+[Dd]ashlist                    { return (DASHLIST); }
+[Ff]ont                                { return (FONT); }
+[Pp]ercent                     { return (PERCENT); }
+
+{number}                       { (void) sscanf ((char *)yytext, "%d", &yylval.num);
+                                 return (NUMBER); }
+{string}                       { yylval.ptr = (char *) yytext;
+                                 return (STRING); }
+\#[^\n]*\n                     { ; }
+[\t ]                          { ; }
+\n                             { return ('\n'); }
+
+{word}                         { yylval.ptr = (char *) yytext;
+                                 return (STRING); }
+
+.                              { fprintf(stderr,
+                                       "xgc: bad character `%s', line %d\n",
+                                       yytext, yylineno); }
+
+%%
+
+#ifndef yywrap
+int yywrap(void) { return (1); }
+#endif
diff --git a/xgc/main.c b/xgc/main.c
new file mode 100644 (file)
index 0000000..08f88fa
--- /dev/null
@@ -0,0 +1,617 @@
+/* $XConsortium: main.c,v 1.22 94/04/17 20:45:30 rws Exp $ */
+/*
+
+Copyright (c) 1991  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86: xc/programs/xgc/main.c,v 1.6tsi Exp $ */
+
+/* xgc
+**
+** main.c
+**
+** Contains the bare minimum necessary to oversee the whole operation.
+*/
+
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Shell.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "xgc.h"
+#define DEFINE_TILE
+#include "tile"
+
+static void fill_up_commandform(Widget);
+static void quit(void);
+static void quitAction(Widget, XEvent *, String *, Cardinal *);
+static void clear_test_window(void);
+static void clear_result_window(void);
+static void set_foreground_and_background(void);
+
+/* The three columns in the XgcData arrays are:
+**   name: the name of the toggle button
+**   text: the corresponding text in the xgc syntax
+**   code: the integer that the text corresponds to, for sending stuff
+**         to X calls, etc.
+*/
+
+static XgcData FunctionData[NUM_FUNCTIONS] = {
+  {"clear",        "clear",        GXclear},
+  {"and",          "and",          GXand},
+  {"andReverse",   "andReverse",   GXandReverse},
+  {"copy",         "copy",         GXcopy},
+  {"andInverted",  "andInverted",  GXandInverted},
+  {"noop",         "noop",         GXnoop},
+  {"xor",          "xor",          GXxor},
+  {"or",           "or",           GXor},
+  {"nor",          "nor",          GXnor},
+  {"equiv",        "equiv",        GXequiv},
+  {"invert",       "invert",       GXinvert},
+  {"orReverse",    "orReverse",    GXorReverse},
+  {"copyInverted", "copyInverted", GXcopyInverted},
+  {"orInverted",   "orInverted",   GXorInverted},
+  {"nand",         "nand",         GXnand},
+  {"set",          "set",          GXset}
+}; 
+
+/* The two rows in the XgcStuff structure are:
+**   name of label, xgc syntax text, # of toggles, # of columns of toggles
+**     (0 columns means 1 row, as many columns as necessary)
+**   appropriate XgcData
+*/
+
+XgcStuff FunctionStuff = {
+  {"Function","function",NUM_FUNCTIONS,4},
+  FunctionData
+};
+
+static XgcData TestData[NUM_TESTS] = {
+  {"Copy Area",          "CopyArea",      CopyArea},
+  {"Copy Plane",         "CopyPlane",     CopyPlane},
+  {"Points",             "PolyPoint",     PolyPoint},
+  {"Lines",              "PolyLine",      PolyLine},
+  {"Segments",           "PolySegment",   PolySegment},
+  {"Rectangles",         "PolyRectangle", PolyRectangle},
+  {"Arcs",               "PolyArc",       PolyArc},
+  {"(Filled Polygons)",  "FillPolygon",   FillPolygon},
+  {"Filled Rectangles",  "PolyFillRect",  PolyFillRect},
+  {"Filled Arcs",        "PolyFillArc",   PolyFillArc},
+  {"Put Image",          "PutImage",      PutImage},
+  {"(Get Image)",        "GetImage",      GetImage},
+  {"Text 8",             "PolyText8",     PolyText8},
+  {"Image Text 8",       "ImageText8",    ImageText8},
+  {"Text 16",            "PolyText16",    PolyText16},
+  {"Image Text 16",      "ImageText16",   ImageText16}
+};
+
+XgcStuff TestStuff = {
+  {"Test","test",NUM_TESTS,2},
+  TestData
+};
+
+static XgcData LinestyleData[NUM_LINESTYLES] = {
+  {"Solid",      "Solid",       LineSolid},
+  {"OnOffDash",  "OnOffDash",   LineOnOffDash},
+  {"DoubleDash", "DoubleDash",  LineDoubleDash}
+};
+
+XgcStuff LinestyleStuff = {
+  {"LineStyle","linestyle",NUM_LINESTYLES,0},
+  LinestyleData
+};
+
+static XgcData CapstyleData[NUM_CAPSTYLES] = {
+  {"NotLast",    "NotLast",     CapNotLast},
+  {"Butt",       "Butt",        CapButt},
+  {"Round",      "Round",       CapRound},
+  {"Projecting", "Projecting",  CapProjecting}
+};
+
+XgcStuff CapstyleStuff = {
+  {"CapStyle","capstyle",NUM_CAPSTYLES,2},
+  CapstyleData
+};
+
+static XgcData JoinstyleData[NUM_JOINSTYLES] = {
+  {"Miter",   "Miter",   JoinMiter},
+  {"Round",   "Round",   JoinRound},
+  {"Bevel",   "Bevel",   JoinBevel}
+};
+
+XgcStuff JoinstyleStuff = {
+  {"JoinStyle","joinstyle",NUM_JOINSTYLES,0},
+  JoinstyleData
+};
+
+static XgcData FillstyleData[NUM_FILLSTYLES] = {
+  {"Solid",          "Solid",          FillSolid},
+  {"Tiled",          "Tiled",          FillTiled},
+  {"Stippled",       "Stippled",       FillStippled},
+  {"OpaqueStippled", "OpaqueStippled", FillOpaqueStippled}
+};
+
+XgcStuff FillstyleStuff = {
+  {"FillStyle","fillstyle",NUM_FILLSTYLES,2},
+  FillstyleData
+};
+
+static XgcData FillruleData[NUM_FILLRULES] = {
+  {"EvenOdd",  "EvenOdd",  EvenOddRule},
+  {"Winding",  "Winding",  WindingRule}
+};
+
+XgcStuff FillruleStuff = {
+  {"FillRule","fillrule",NUM_FILLRULES,0},
+  FillruleData
+};
+
+static XgcData ArcmodeData[NUM_ARCMODES] = {
+  {"Chord",    "Chord",    ArcChord},
+ {"PieSlice", "PieSlice", ArcPieSlice}
+};
+
+XgcStuff ArcmodeStuff = {
+  {"ArcMode","arcmode",NUM_ARCMODES,0},
+  ArcmodeData
+};
+
+/* Pointers to all the Xgcstuffs so we can run them through a loop */
+
+static XgcStuff *Everything[8] = {
+  &FunctionStuff,
+  &LinestyleStuff,
+  &CapstyleStuff,
+  &JoinstyleStuff,
+  &FillstyleStuff,
+  &FillruleStuff,
+  &ArcmodeStuff,
+  &TestStuff
+};
+
+#ifdef notdef
+int fildes[2];                 /* for pipe */
+FILE *outend;
+#endif
+
+XStuff X;                      /* GC stuff plus some global variables */
+Boolean recording = FALSE;     /* Whether we're recording into a file */
+XtAppContext appcontext;       /* To make Xt happy */
+static Atom wm_delete_window;
+static XtActionsRec actions[] = {
+    {"quit",   quitAction}
+};
+
+static Widget bigdaddy;                /* the top level widget */
+       Widget topform;         /* form surrounding the whole thing */
+       Widget GCform;          /* form in which you choose the GC */
+static Widget Testform;                /* form in which you choose the test */
+       Widget testchoiceform;   /* form inside that */
+  ChoiceDesc *testchoicedesc;  /* record of what widgets are in the
+                                  test choice form */
+static Widget commandform;     /* form with run, quit, clear, etc. */
+       Widget test;            /* where the test is run */
+       Widget result;           /* where the results are displayed */
+static Widget runbutton;       /* command for running */
+static Widget clearbutton;     /* command for clearing the test window */
+       Widget recordbutton;    /* start/stop recording */
+static Widget playbackbutton;  /* playback from file */
+static Widget keyinputbutton;  /* start reading from keyboard */
+static Widget GCchoices[NUMCHOICES]; /* all the forms that contain stuff
+                                       for changing GC's*/
+  ChoiceDesc *GCdescs[NUMCHOICES]; /* record of the widgets inside
+                                     the choice widgets */
+       Widget planemaskchoice; /* form for choosing the plane mask */
+       Widget dashlistchoice;  /* form for choosing the dash list */
+static Widget linewidthchoice; /* form for choosing line width */
+       Widget linewidthtext;   /* text widget within that */
+static Widget fontchoice;      /* form for choosing the font */
+       Widget fonttext;                /* text widget within that */
+static Widget foregroundchoice;        /* form for choosing foreground */
+       Widget foregroundtext;  /* text widget within that */
+static Widget backgroundchoice;        /* form for choosing background */
+       Widget backgroundtext;  /* text widget within that */
+static Widget percentchoice;   /* form for choosing percentage of test */
+
+/* main(argc.argv)
+** ---------------
+** Initializes the toolkit, initializes data, puts up the widgets,
+** starts the event loop.
+*/
+
+int
+main(int argc, char *argv[])
+{
+  static Arg shellargs[] = {
+    {XtNinput,               (XtArgVal) True}
+  };
+
+  static Arg testformargs[] = {        
+    {XtNfromVert,     (XtArgVal) NULL} /* put it under GCform */
+  };
+
+  static Arg commandformargs[] = {
+    {XtNfromVert,    (XtArgVal) NULL}, /* put it under GCform */
+    {XtNfromHoriz,   (XtArgVal) NULL}  /* and to the right of Testform */
+  };
+
+  static Arg testargs[] = {
+    {XtNheight,     (XtArgVal) 400},
+    {XtNwidth,      (XtArgVal) 400},
+    {XtNfromHoriz,  (XtArgVal) NULL} /* put it to the right of GCform */
+  };
+
+  static Arg resultargs[] = {
+    {XtNheight,     (XtArgVal) 50},
+    {XtNwidth,      (XtArgVal) 400},
+    {XtNfromHoriz,  (XtArgVal) NULL}, /* put it to the right of GCform */
+    {XtNfromVert,   (XtArgVal) NULL} /* and under test */
+  };
+
+  static Arg gcchoiceargs[] = {
+    {XtNfromVert,    (XtArgVal) NULL}, /* put it under the one above it */
+    {XtNfromHoriz,   (XtArgVal) NULL}, /* and next to that one */
+    {XtNborderWidth, (XtArgVal) 0}     /* no ugly borders */
+  };
+
+  static Arg testchoiceargs[] = {
+    {XtNborderWidth, (XtArgVal) 0}
+  };
+
+  int i;                       /* counter */
+
+  /* Open the pipe */
+
+#ifdef notdef
+  pipe(fildes);
+  outend = fdopen(fildes[0],"r");
+#endif
+
+  /* Initialize toolkit stuff */
+
+  XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
+
+  bigdaddy = XtAppInitialize(&appcontext, "Xgc", (XrmOptionDescList) NULL,
+                            (Cardinal) 0, &argc, argv, (String *) NULL,
+                            shellargs, XtNumber(shellargs));
+  X.dpy = XtDisplay(bigdaddy);
+  XtAppAddActions(appcontext, actions, XtNumber(actions));
+  XtOverrideTranslations
+      (bigdaddy, XtParseTranslationTable("<Message>WM_PROTOCOLS: quit()"));
+
+  /* Initialize GC stuff */
+
+  X.scr = DefaultScreenOfDisplay(X.dpy);
+  X.gc = XCreateGC(X.dpy,RootWindowOfScreen(X.scr),0,(XGCValues *) NULL);
+  X.miscgc = XCreateGC(X.dpy,RootWindowOfScreen(X.scr),0,(XGCValues *) NULL);
+
+  /* Find out what the foreground & background are, and update the GC
+  ** accordingly */
+
+  set_foreground_and_background();
+
+  topform = XtCreateManagedWidget("topform",formWidgetClass,bigdaddy,
+                                 NULL,0);
+
+  GCform = XtCreateManagedWidget("GCform",formWidgetClass,topform,
+                               NULL,0);
+
+  /* create all the GCchoices forms */
+
+  for (i=0;i<NUMCHOICES;++i) {
+    if (i==0)                  /* on top */
+      gcchoiceargs[0].value = (XtArgVal) NULL;
+    else                       /* under the last one */
+      gcchoiceargs[0].value = (XtArgVal) GCchoices[i-1];
+
+    GCchoices[i] = XtCreateManagedWidget(Everything[i]->choice.text,
+                                        formWidgetClass,GCform,
+                                        gcchoiceargs,XtNumber(gcchoiceargs));
+
+    /* now fill up that form */
+    GCdescs[i] = create_choice(GCchoices[i],Everything[i]);
+  }
+
+  /* put the planemask choice under the bottom GC choice */
+  gcchoiceargs[0].value = (XtArgVal) GCchoices[NUMCHOICES-1];
+  planemaskchoice = XtCreateManagedWidget("planemask",formWidgetClass,GCform,
+                                 gcchoiceargs,XtNumber(gcchoiceargs));
+  /* fill it up */
+  create_planemask_choice(planemaskchoice);
+
+  /* put the dashlist choice under the planemask choice */
+  gcchoiceargs[0].value = (XtArgVal) planemaskchoice;
+  dashlistchoice = XtCreateManagedWidget("dashlist",formWidgetClass,GCform,
+                                 gcchoiceargs,XtNumber(gcchoiceargs));
+  /* fill it up */
+  create_dashlist_choice(dashlistchoice);
+
+  /* put the linewidth choice under the dashlist choice */
+  gcchoiceargs[0].value = (XtArgVal) dashlistchoice;
+  linewidthchoice = XtCreateManagedWidget("linewidth",formWidgetClass,GCform,
+                                 gcchoiceargs,XtNumber(gcchoiceargs));
+  /* fill it up */
+  linewidthtext = create_text_choice(linewidthchoice,TLineWidth,2,30);
+
+  /* put the font choice under the linewidth choice */
+  gcchoiceargs[0].value = (XtArgVal) linewidthchoice;
+  fontchoice = XtCreateManagedWidget("font",formWidgetClass,GCform,
+                                    gcchoiceargs,XtNumber(gcchoiceargs));
+  /* fill it up */
+  fonttext = create_text_choice(fontchoice,TFont,80,300);
+
+  gcchoiceargs[0].value = (XtArgVal) fontchoice;
+  foregroundchoice = XtCreateManagedWidget("foreground",formWidgetClass,GCform,
+                                  gcchoiceargs,XtNumber(gcchoiceargs));
+  foregroundtext = create_text_choice(foregroundchoice,TForeground,9,50);
+  /* FIXME 9 characters may not be the proper choice; really it
+   * should understand a more proper pixel specification... */
+
+  gcchoiceargs[1].value = (XtArgVal) foregroundchoice;
+  backgroundchoice = XtCreateManagedWidget("background",formWidgetClass,GCform,
+                                  gcchoiceargs,XtNumber(gcchoiceargs));
+  backgroundtext = create_text_choice(backgroundchoice,TBackground,9,50);
+  
+  gcchoiceargs[1].value = (XtArgVal) NULL;
+  gcchoiceargs[0].value = (XtArgVal) foregroundchoice;
+  percentchoice = XtCreateManagedWidget("testpercent",formWidgetClass,GCform,
+                                gcchoiceargs,XtNumber(gcchoiceargs));
+  X.percent = 1.0;
+  create_testfrac_choice(percentchoice);
+
+  /* make all the labels inside the choices line up nicely */
+  line_up_labels(GCdescs,(int) XtNumber(GCdescs));
+
+  /* put the test form under the GC form */
+  testformargs[0].value = (XtArgVal) GCform;
+  Testform = XtCreateManagedWidget("Testform",formWidgetClass,topform,
+                                  testformargs,XtNumber(testformargs));
+  
+  testchoiceform = XtCreateManagedWidget("testchoiceform",formWidgetClass,
+                            Testform,testchoiceargs,XtNumber(testchoiceargs));
+  testchoicedesc = create_choice(testchoiceform,Everything[CTest]);
+
+  commandformargs[0].value = (XtArgVal) GCform;
+  commandformargs[1].value = (XtArgVal) Testform;
+  commandform = XtCreateManagedWidget("commandform",formWidgetClass,topform,
+                             commandformargs,XtNumber(commandformargs));
+
+  /* Put the appropriate command buttons in the command form */
+
+  fill_up_commandform(commandform);
+
+  testargs[2].value = (XtArgVal) GCform;    /* to the right of */
+  test = XtCreateManagedWidget("test",widgetClass,topform,
+                              testargs,XtNumber(testargs));
+
+  resultargs[2].value = (XtArgVal) GCform; /* to the right of */
+  resultargs[3].value = (XtArgVal) test; /* under */
+  result = XtCreateManagedWidget("result",asciiTextWidgetClass,topform,
+                                resultargs,XtNumber(resultargs));
+
+  /* Now realize all the widgets */
+
+  XtRealizeWidget(bigdaddy);
+
+  /* Now do things we couldn't do until we had a window available */
+
+  X.win = XtWindow(test);
+  X.tile = XCreatePixmap(X.dpy,X.win,tile_width,tile_height,
+                        DefaultDepthOfScreen(X.scr));
+
+  X.tile = XCreatePixmapFromBitmapData(X.dpy,X.win,
+                                      (char *)tile_bits,tile_width,
+                                      tile_height,Black,White,
+                                      DefaultDepthOfScreen(X.scr));
+  X.stipple = XCreateBitmapFromData(X.dpy,X.win,(char *)tile_bits,tile_width,
+                                   tile_height);
+
+  XSetStipple(X.dpy,X.gc,X.stipple);
+  XSetStipple(X.dpy,X.miscgc,X.stipple);
+
+  GC_change_foreground(X.foreground,TRUE);
+  GC_change_background(X.background,TRUE);
+
+  wm_delete_window = XInternAtom(X.dpy, "WM_DELETE_WINDOW", False);
+  (void) XSetWMProtocols(X.dpy, XtWindow(bigdaddy), &wm_delete_window, 1);
+
+  /* Act like the user picked the first choice in each group */
+
+  choose_defaults(GCdescs,(int)XtNumber(GCdescs));
+  choose_defaults(&testchoicedesc,1);
+  
+  /* Loop forever, dealing with events */
+
+  XtAppMainLoop(appcontext);
+
+  return 0;
+}
+
+/* fill_up_commandform(w)
+** ----------------------
+** Put the appropriate command buttons in the command form (w).
+*/
+
+static void
+fill_up_commandform(Widget w)
+{
+  static XtCallbackRec runcallbacklist[] = {
+    {(XtCallbackProc) run_test,  NULL},
+    {NULL,                       NULL}
+  };
+
+  static XtCallbackRec quitcallbacklist[] = {
+    {(XtCallbackProc) quit,      NULL},
+    {NULL,                       NULL}
+  };
+
+  static XtCallbackRec clearcallbacklist[] = {
+    {(XtCallbackProc) clear_test_window,    NULL},
+    {(XtCallbackProc) clear_result_window,  NULL},
+    {NULL,                                  NULL}
+  };
+
+  static XtCallbackRec playbackcallbacklist[] = {
+    {(XtCallbackProc) start_playback,       NULL},
+    {NULL,                                  NULL}
+  };
+
+  static XtCallbackRec keyinputcallbacklist[] = {
+    {(XtCallbackProc) read_from_keyboard,   NULL},
+    {NULL,                                  NULL}
+  };
+
+  static XtCallbackRec recordcallbacklist[] = {
+    {(XtCallbackProc) toggle_recordbutton,  NULL},
+    {NULL,                                  NULL}
+  };
+
+  static Arg runargs[] = {
+    {XtNcallback,    (XtArgVal) NULL}
+  };
+
+  static Arg clearargs[] = {
+    {XtNcallback,    (XtArgVal) NULL},
+    {XtNfromVert,    (XtArgVal) NULL}, /* put it under runbutton */
+    {XtNvertDistance,(XtArgVal) 10}
+  };
+
+  static Arg recordargs[] = {
+    {XtNcallback,    (XtArgVal) NULL},
+    {XtNfromVert,    (XtArgVal) NULL}, /* put it under clearbutton */
+    {XtNvertDistance,(XtArgVal) 10},
+    {XtNresizable,   (XtArgVal) True} /* so we can change the name */
+  };
+
+  static Arg playbackargs[] = {
+    {XtNcallback,    (XtArgVal) NULL},
+    {XtNfromVert,    (XtArgVal) NULL} /* put it under recordbutton */
+  };
+
+  static Arg keyinputargs[] = {
+    {XtNcallback,     (XtArgVal) NULL},
+    {XtNfromVert,    (XtArgVal) NULL} /* put it under playbackbutton */
+  };
+
+  static Arg quitargs[] = {
+    {XtNcallback,    (XtArgVal) NULL},
+    {XtNfromVert,    (XtArgVal) NULL}, /* put it under keyinputbutton */
+    {XtNvertDistance,(XtArgVal) 10}
+  };
+
+  runargs[0].value = (XtArgVal) runcallbacklist;
+  runbutton = XtCreateManagedWidget("Run",commandWidgetClass,
+                             w,runargs,XtNumber(runargs));
+
+  clearargs[0].value = (XtArgVal) clearcallbacklist;
+  clearargs[1].value = (XtArgVal) runbutton; /* under */
+  clearbutton = XtCreateManagedWidget("Clear window",commandWidgetClass,
+                             w,clearargs,XtNumber(clearargs));
+
+  recordargs[0].value = (XtArgVal) recordcallbacklist;
+  recordargs[1].value = (XtArgVal) clearbutton;        /* under */
+  recordbutton = XtCreateManagedWidget("Record",commandWidgetClass,
+                             w,recordargs,XtNumber(recordargs));
+
+  playbackargs[0].value = (XtArgVal) playbackcallbacklist;
+  playbackargs[1].value = (XtArgVal) recordbutton; /* under */
+  playbackbutton = XtCreateManagedWidget("Playback",commandWidgetClass,
+                             w,playbackargs,XtNumber(playbackargs));
+
+  keyinputargs[0].value = (XtArgVal) keyinputcallbacklist;
+  keyinputargs[1].value = (XtArgVal) playbackbutton;
+  keyinputbutton = XtCreateManagedWidget("Read Input",commandWidgetClass,
+                             w,keyinputargs,XtNumber(keyinputargs));
+
+  quitargs[0].value = (XtArgVal) quitcallbacklist;
+  quitargs[1].value = (XtArgVal) keyinputbutton; /* under */
+  (void) XtCreateManagedWidget("Quit",commandWidgetClass,
+                              w,quitargs,XtNumber(quitargs));
+    
+}    
+/* quit()
+** ------
+** Leave the program nicely.
+*/
+
+static void
+quit(void)
+{
+  close_file_if_recording();
+  exit(0);
+}
+
+static void quitAction(Widget w, XEvent *e, String *p, Cardinal *n)
+{
+    if (e->type == ClientMessage && e->xclient.data.l[0] != wm_delete_window)
+       XBell(XtDisplay(w), 0);
+    else 
+       quit();
+}
+
+/* clear_test_window()
+** -------------------
+** Clear the test window.
+*/
+
+static void
+clear_test_window(void)
+{
+  XClearWindow(X.dpy,XtWindow(test));
+}
+
+/* clear_result_window()
+** ---------------------
+** Clear the result window.
+*/
+
+static void
+clear_result_window(void)
+{
+  set_text(result, "");
+}
+
+/* set_foreground_and_background()
+** -------------------------------
+** Finds the user-specified foreground and background by querying
+** the resource manager, and sets state accordingly.  Also specifies
+** the initial font for text tests.
+*/
+
+static void
+set_foreground_and_background(void)
+{
+  X.gcv.foreground = X.foreground = 0;
+  X.gcv.background = X.background = 0xffffffff;
+
+  X.fontname = "6x10";
+  GC_change_font(X.fontname,FALSE);
+}
diff --git a/xgc/missing b/xgc/missing
new file mode 100755 (executable)
index 0000000..28055d2
--- /dev/null
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# 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=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+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'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  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]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
+# 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).  This is about non-GNU programs, so use $1 not
+# $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 $program 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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if test ! -f y.tab.h; then
+       echo >y.tab.h
+    fi
+    if test ! -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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if test ! -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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit $?
+    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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+       /^@setfilename/{
+         s/.* \([^ ]*\) *$/\1/
+         p
+         q
+       }' $infile`
+      # ... 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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xgc/planemask.c b/xgc/planemask.c
new file mode 100644 (file)
index 0000000..c710562
--- /dev/null
@@ -0,0 +1,186 @@
+/*
+** planemask.c
+**
+** How to make a widget to choose a planemask.
+**
+** NOTE: This file uses static variables.  Therefore, trying to use these
+**       functions to create more than one of these planemask choice things
+**       will fail in a big way.
+*/
+/* $XFree86: xc/programs/xgc/planemask.c,v 1.3 2000/02/17 14:00:37 dawes Exp $ */
+
+#include <X11/Xos.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/Toggle.h>
+#include "xgc.h"
+
+static void choose_plane(Widget, caddr_t, caddr_t);
+
+static unsigned long planemask;        
+static Widget *pm;
+
+/* create_planemask_choice(w)
+** -------------------------
+** Inside w (a form widget), creates a bunch of little toggle buttons
+** in a row, representing the planemask.  There's also a label so
+** the user knows what it is.
+*/
+
+void
+create_planemask_choice(Widget w)
+{
+  /* callback list for the toggle widgets */
+  static XtCallbackRec callbacklist[] = {
+    {(XtCallbackProc) choose_plane, NULL},
+    {NULL,                          NULL}
+  };
+
+  /* ArgList for the label */
+  static Arg labelargs[] = {
+    {XtNborderWidth,     (XtArgVal) 0},
+    {XtNjustify,         (XtArgVal) XtJustifyRight},
+    {XtNvertDistance,    (XtArgVal) 4}
+  };
+
+  /* ArgList for the toggles */
+  static Arg pmargs[] = {
+    {XtNcallback,          (XtArgVal) NULL},
+    {XtNhorizDistance,     (XtArgVal) NULL},
+    {XtNfromHoriz,         (XtArgVal) NULL},
+    {XtNwidth,             (XtArgVal) 10},
+    {XtNheight,            (XtArgVal) 10},
+    {XtNhighlightThickness,(XtArgVal) 1},
+    {XtNstate,             (XtArgVal) True},
+    {XtNlabel,             (XtArgVal) ""}
+  };
+
+  static Widget label;         /* the label, of course */
+  static int *pminfo;          /* contains integers saying which bit
+                                  a particular button is; sent to
+                                  choose_plane to tell it which
+                                  bit got changed */
+
+  int i, num_planes;
+
+  char buf[40];
+  char name[12];
+
+  num_planes = PlanesOfScreen(X.scr);
+
+  planemask = (1<<num_planes)-1;
+  snprintf(buf, sizeof buf, "planemask %lu",planemask);
+  interpret(buf);
+
+  /* Allocate space for stuff that we don't know the size of yet */
+
+  pm = (Widget *) malloc(num_planes * sizeof(Widget));
+  pminfo = (int *) malloc(num_planes * sizeof(int));
+
+  /* Make the label widget */
+
+  label = XtCreateManagedWidget("planemask",labelWidgetClass,w,
+                               labelargs,XtNumber(labelargs));
+
+  pmargs[0].value = (XtArgVal) callbacklist;
+
+  for (i=0;i<num_planes;++i) { /* go through all the buttons */
+    if (i==0) {                        /* offset the first one from the label */
+      pmargs[1].value = (XtArgVal) 10;
+      pmargs[2].value = (XtArgVal) label;
+    }
+    else {                     /* put it directly to the right of the
+                                  last one, no space in between */
+      pmargs[1].value = (XtArgVal) -1;
+      pmargs[2].value = (XtArgVal) pm[i-1];
+    }
+
+    /* set its original state depending on the state of that bit
+    ** of the planemask */
+
+    if (planemask & 1<<i)
+      pmargs[6].value = (XtArgVal) True;
+    else
+      pmargs[6].value = (XtArgVal) False;
+
+    snprintf(name, sizeof name, "planemask%d",i);
+
+    pminfo[i] = i;             /* which bit we're on; this is needed in
+                                  choose_plane (the callback) */
+    callbacklist[0].closure = (caddr_t) &pminfo[i];
+
+    pm[i] = XtCreateManagedWidget(name,toggleWidgetClass,w,
+                                 pmargs,XtNumber(pmargs));
+  }
+}
+
+/* choose_plane(w,closure,call_data)
+** ------------------------------------
+** This function is called when the user toggles a toggle widget.  It
+** makes the appropriate change to the planemask and sends it off
+** to interpret().
+** Funny args are because it's a callback.
+*/
+
+/*ARGSUSED*/
+static void
+choose_plane(Widget w, caddr_t closure, caddr_t call_data)
+{
+  int num;                     /* what number button it is */
+  Boolean on;                  /* is it currently on or off? */
+
+  char buf[80];                        /* string to send to interpret() */
+
+  static Arg args[] = {
+    {XtNstate,    (XtArgVal) NULL}
+  };
+
+  /* set up ArgList so that 'on' will contain the state */
+  args[0].value = (XtArgVal) &on;
+
+  num = * (int *) closure;     /* we put it here back in the last function */
+  XtGetValues(w,args,XtNumber(args));
+
+  /* Modify the planemask appropriately */
+
+  if (on)
+    planemask |= 1<<num;
+  else
+    planemask &= ~(1<<num);
+
+  (void) snprintf(buf, sizeof buf, "planemask %lu\n",planemask);
+  interpret(buf);
+}
+
+/* update_planemask(mask)
+** ----------------------
+** Updates the display of the planemask so that it corresponds to mask.
+*/
+
+void
+update_planemask(long mask)
+{
+  int i;                       /* counter */
+  static Arg maskargs[] = {    /* ArgList for setting toggle state */
+    {XtNstate,     (XtArgVal) NULL}
+  };
+
+  /* First set the internal representation */
+
+  planemask = mask;
+
+  for (i = 0; i < PlanesOfScreen(X.scr); ++i) {
+    if (planemask & 1<<i) {        /* if it's set, make it look that way */
+      maskargs[0].value = (XtArgVal) True;
+    }
+    else {
+      maskargs[0].value = (XtArgVal) False;
+    }
+
+    XtSetValues(pm[i],maskargs,XtNumber(maskargs));
+  }
+}
diff --git a/xgc/record.c b/xgc/record.c
new file mode 100644 (file)
index 0000000..db5ec65
--- /dev/null
@@ -0,0 +1,278 @@
+/*
+** xgc
+**
+** record.c
+*/
+/* $XFree86: xc/programs/xgc/record.c,v 1.3 2000/02/17 14:00:37 dawes Exp $ */
+
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Shell.h>
+#include <X11/Xaw/AsciiText.h>
+#include <stdio.h>
+
+#include "xgc.h"
+
+static void start_recording(void);
+static void stop_recording(void);
+static void print_out_gc_values(void);
+static void chose_playback_filename(void);
+static void cancel_playback(void);
+static void done_choosing_filename(void) ;
+static void cancel_record(void);
+
+FILE *recordfile;              /* the file we're recording to */
+FILE *playbackfile;            /* the file we're playing back from */
+
+/* toggle_recordbutton(w,closure,call_data)
+** ----------------------------------------
+** This function is called when the user presses the "Record"
+** command button.  If we're not recording, we start; if we are,
+** we stop.  Also change the label to reflect the change in the
+** function of the button.
+*/
+
+/*ARGSUSED*/
+void
+toggle_recordbutton(Widget w, caddr_t closure, caddr_t call_data)
+{
+  /* ArgList for changing the label */
+  static Arg recordargs[] = {
+    {XtNlabel,        (XtArgVal) NULL}
+  };
+  
+  char tmp[20];                        /* new label */
+  
+  if (!recording) {
+    start_recording();
+  }
+  else {
+    recording = FALSE;
+    stop_recording();
+    snprintf(tmp, sizeof tmp, "Record");
+    recordargs[0].value = (XtArgVal) tmp;
+  }
+
+  XtSetValues(recordbutton,recordargs,XtNumber(recordargs));
+}
+
+/* start_recording()
+** -----------------
+** Get the name of the file the user wants to record into, and
+** start recording into it if he doesn't cancel.
+*/
+
+static void
+start_recording(void) 
+{
+  get_filename(done_choosing_filename,cancel_record);
+}
+
+/* stop_recording()
+** ----------------
+** Close the output file.
+*/
+
+static void
+stop_recording(void) 
+{
+  fclose(recordfile);
+}
+
+/* cancel_record()
+** ---------------
+** What to do if the if the user canceled recording, i.e. nothing.
+*/
+
+static void
+cancel_record(void) 
+{
+}
+
+/* done_choosing_filename()
+** ------------------------
+** What to do after the user's chosen a file.  Change the label on the
+** command button, open the file, and dump the current contents of the
+** GC into it.
+*/
+
+static void
+done_choosing_filename(void) 
+{
+  static Arg recordargs[] = {
+    {XtNlabel,        (XtArgVal) NULL},
+    {XtNresize,       (XtArgVal) True}
+  };
+  Arg args[1];
+  char tmp[20], *filename;
+
+  XtSetArg(args[0], XtNstring, &filename);
+  XtGetValues(filename_text_widget, args, (Cardinal) 1);
+
+  if ((recordfile = fopen(filename,"w")) != NULL) {
+    recording = TRUE;
+    snprintf(tmp, sizeof tmp, "End Record");
+    recordargs[0].value = (XtArgVal) tmp;
+    XtSetValues(recordbutton,recordargs,XtNumber(recordargs));
+
+    print_out_gc_values();
+  }
+}
+
+/* print_if_recording(str)
+** -----------------------
+** If we're recording to a file, put str in it.
+*/
+
+void
+print_if_recording(const char *str)
+{
+  if (recording)
+    fprintf(recordfile,"%s",str);
+}
+
+/* close_file_if_recording()
+** -------------------------
+** If we're recording, stop.
+*/
+
+void 
+close_file_if_recording(void)
+{
+  if (recording)
+    fclose(recordfile);
+}
+
+/* print_out_gc_values()
+** ---------------------
+** Dump the contents of the GC to the file, so that when the file gets
+** played back, it will be correctly initialized.
+*/
+
+static void
+print_out_gc_values(void)
+{
+  int i;
+  for (i=0;i<NUM_TESTS;++i) {
+    if ((TestStuff.data)[i].code == X.test) {
+      fprintf(recordfile,"%s %s\n",
+             TestStuff.choice.text,(TestStuff.data)[i].text);
+      break;
+    }
+  }
+  for (i=0;i<NUM_FUNCTIONS;++i) {
+    if ((FunctionStuff.data)[i].code == X.gcv.function) {
+      fprintf(recordfile,"%s %s\n",
+             FunctionStuff.choice.text,(FunctionStuff.data)[i].text);
+      break;
+    }
+  }
+  for (i=0;i<NUM_LINESTYLES;++i) {
+    if ((LinestyleStuff.data)[i].code == X.gcv.line_style) {
+      fprintf(recordfile,"%s %s\n",
+             LinestyleStuff.choice.text,(LinestyleStuff.data)[i].text);
+      break;
+    }
+  }
+  for (i=0;i<NUM_CAPSTYLES;++i) {
+    if ((CapstyleStuff.data)[i].code == X.gcv.cap_style) {
+      fprintf(recordfile,"%s %s\n",
+             CapstyleStuff.choice.text,(CapstyleStuff.data)[i].text);
+      break;
+    }
+  }
+  for (i=0;i<NUM_JOINSTYLES;++i) {
+    if ((JoinstyleStuff.data)[i].code == X.gcv.join_style) {
+      fprintf(recordfile,"%s %s\n",
+             JoinstyleStuff.choice.text,(JoinstyleStuff.data)[i].text);
+      break;
+    }
+  }
+  for (i=0;i<NUM_FILLSTYLES;++i) {
+    if ((FillstyleStuff.data)[i].code == X.gcv.fill_style) {
+      fprintf(recordfile,"%s %s\n",
+             FillstyleStuff.choice.text,(FillstyleStuff.data)[i].text);
+      break;
+    }
+  }
+  for (i=0;i<NUM_FILLRULES;++i) {
+    if ((FillruleStuff.data)[i].code == X.gcv.fill_rule) {
+      fprintf(recordfile,"%s %s\n",
+             FillruleStuff.choice.text,(FillruleStuff.data)[i].text);
+      break;
+    }
+  }
+  for (i=0;i<NUM_ARCMODES;++i) {
+    if ((ArcmodeStuff.data)[i].code == X.gcv.arc_mode) {
+      fprintf(recordfile,"%s %s\n",
+             ArcmodeStuff.choice.text,(ArcmodeStuff.data)[i].text);
+      break;
+    }
+  }
+  fprintf(recordfile,"linewidth %d\n",X.gcv.line_width);
+  fprintf(recordfile,"foreground %ld\n",X.gcv.foreground);
+  fprintf(recordfile,"background %ld\n",X.gcv.background);
+  fprintf(recordfile,"planemask %ld\n",X.gcv.plane_mask);
+  fprintf(recordfile,"dashlist %d\n",X.gcv.dashes);
+  fprintf(recordfile,"font %s\n",X.fontname);
+}  
+
+/********************************************/
+
+/* start_playback()
+** ----------------
+** This gets called if the user wants to playback from a file.
+** Get the file name and do the appropriate thing.
+*/
+
+void
+start_playback(void)
+{
+  get_filename(chose_playback_filename,cancel_playback);
+}
+
+/* cancel_playback()
+** -----------------
+** What to do if the user canceled the playback request.
+*/
+
+static void
+cancel_playback(void)
+{
+}
+
+/* chose_playback_filename()
+** -------------------------
+** What to do once the user's selected a filename to playback.
+** Play it back.
+*/
+
+static void
+chose_playback_filename(void)
+{
+  Arg args[1];
+  char *filename;
+
+  XtSetArg(args[0], XtNstring, &filename);
+  XtGetValues(filename_text_widget, args, (Cardinal) 1);
+
+  if ((playbackfile = fopen(filename,"r")) != NULL) {
+    yyin = playbackfile;
+    yyparse();
+  }
+}
+
+/* read_from_keyboard()
+** --------------------
+** Do a playback from the keyboard.
+*/
+
+void
+read_from_keyboard(void)
+{
+  yyin = stdin;
+  yyparse();
+}
diff --git a/xgc/testfrac.c b/xgc/testfrac.c
new file mode 100644 (file)
index 0000000..c5afd75
--- /dev/null
@@ -0,0 +1,189 @@
+/*
+** testfrac.c
+**
+** How to make a widget to choose the fraction of tests to be run.
+**
+*/
+/* $XFree86: xc/programs/xgc/testfrac.c,v 1.4 2003/05/07 21:02:07 herrb Exp $ */
+
+#include <stdio.h>
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/Scrollbar.h>
+#include "xgc.h"
+
+#define SCROLLBAR_LENGTH 125
+#define SLIDER_LENGTH 0.2      /* proportion of scrollbar taken up
+                                  by the slider */
+
+static Widget label;           /* the label */
+static Widget slider;          /* the scrollbar */
+static Widget percent; /* label with chosen percentage */
+
+static float fraction;         /* what percent has been chosen */
+static int   oldpercent = -1;  /* so we only update when the slider has
+                                  been moved */
+
+/* slider_jump(w,data,position)
+** ----------------------------
+** This function is called if the user moves the scrollbar to a new
+** position (generally, by using the middle button).  It updates
+** information about where the scrollbar is.
+*/
+
+/*ARGSUSED*/
+static void
+slider_jump(Widget w, caddr_t data, caddr_t position)
+{
+  static Arg percentargs[] = {
+    {XtNlabel,   (XtArgVal) NULL}
+  };
+
+  float oldpercent;            /* where the scrollbar is */
+  float newpercent;            /* normalized scrollbar */
+  char snewpercent[4];         /* string representation of scrollbar */
+
+  oldpercent = *(float *) position;
+
+  /* We want the scrollbar to be at 100% when the right edge of the slider
+  ** hits the end of the scrollbar, not the left edge.  When the right edge
+  ** is at 1.0, the left edge is at 1.0 - SLIDER_LENGTH.  Normalize
+  ** accordingly.  */
+   
+  newpercent = oldpercent / (1.0 - SLIDER_LENGTH);
+
+  /* If the slider's partially out of the scrollbar, move it back in. */
+
+  if (newpercent > 1.0) {
+    newpercent = 1.0;
+    XawScrollbarSetThumb( slider, 1.0 - SLIDER_LENGTH, SLIDER_LENGTH);
+  }
+
+  /* Store the position of the silder where it can be found */
+
+  *(float *)data = newpercent;
+
+  /* Update the label widget */
+
+  snprintf(snewpercent, sizeof snewpercent, "%d",(int)(newpercent*100));
+  percentargs[0].value = (XtArgVal) snewpercent;
+  XtSetValues(percent, percentargs, XtNumber(percentargs));
+}
+
+/* slider_scroll(w,data,position)
+** ------------------------------
+** This function is called when the user does incremental scrolling, 
+** generally with the left or right button.  Right now it just ignores it.
+*/
+
+/*ARGSUSED*/
+static void
+slider_scroll(Widget w, caddr_t data, caddr_t position)
+{
+}
+
+/*ARGSUSED*/
+static void
+update(Widget w, XEvent *event, String *params, int *num_params)
+{
+  char buf[80];
+  int newpercent;
+
+  newpercent = (int)(fraction * 100.0);
+  if (newpercent != oldpercent) {
+    snprintf(buf, sizeof buf, "percent %d\n", (int)(fraction * 100.0));
+    interpret(buf);
+    oldpercent = newpercent;
+  }
+}
+
+/* create_testfrac_choice(w)
+** -------------------------
+** Inside w (a form widget), creates:
+**   1. A label "Percentage of Test"
+**   2. A scrollbar for the user to choose the percentage (from 0 to 100)
+**   3. A label with the current percentage displayed on it.
+** The percentage starts at 100.
+**
+** When the pointer leaves the scrollbar, a string is sent to interpret()
+** so that it knows the position of the scrollbar.
+*/
+
+void
+create_testfrac_choice(Widget w)
+{
+  static XtCallbackRec jumpcallbacks[] = {
+    {(XtCallbackProc) slider_jump, NULL},
+    {NULL,                         NULL}
+  };
+
+  static XtCallbackRec scrollcallbacks[] = {
+    {(XtCallbackProc) slider_scroll, NULL},
+    {NULL,                           NULL}
+  };
+
+  static Arg labelargs[] = {
+    {XtNborderWidth,  (XtArgVal) 0},
+    {XtNjustify,      (XtArgVal) XtJustifyRight},
+    {XtNvertDistance, (XtArgVal) 4}
+  };
+
+  static Arg percentargs[] = {
+    {XtNhorizDistance,  (XtArgVal) 10},
+    {XtNfromHoriz,      (XtArgVal) NULL}
+  };
+
+  static Arg scrollargs[] = {
+    {XtNorientation,     (XtArgVal) XtorientHorizontal},
+    {XtNlength,          (XtArgVal) SCROLLBAR_LENGTH},
+    {XtNthickness,       (XtArgVal) 10},
+    {XtNshown,           (XtArgVal) 10},
+    {XtNhorizDistance,   (XtArgVal) 10},
+    {XtNfromHoriz,       (XtArgVal) NULL},
+    {XtNjumpProc,        (XtArgVal) NULL},
+    {XtNscrollProc,      (XtArgVal) NULL}
+  };
+    
+  static const char *translationtable = "<Leave>: Update()";
+
+  static XtActionsRec actiontable[] = {
+    {"Update",  (XtActionProc) update},
+    {NULL,      NULL}
+  };
+
+  /* Let the scrollbar know where to store information where we
+  ** can see it */
+
+  jumpcallbacks[0].closure = (caddr_t) &fraction;
+
+  label = XtCreateManagedWidget("Percentage of Test",labelWidgetClass,w,
+                               labelargs,XtNumber(labelargs));
+
+  percentargs[1].value = (XtArgVal) label;
+
+  percent = XtCreateManagedWidget("100",labelWidgetClass,w,
+                                 percentargs,XtNumber(percentargs));
+
+  scrollargs[5].value = (XtArgVal) percent;
+  scrollargs[6].value = (XtArgVal) jumpcallbacks;
+  scrollargs[7].value = (XtArgVal) scrollcallbacks;
+
+  slider = XtCreateManagedWidget("Slider",scrollbarWidgetClass,w,
+                                scrollargs,XtNumber(scrollargs));
+
+  XtAppAddActions(appcontext,actiontable,XtNumber(actiontable));
+  XtOverrideTranslations(slider,XtParseTranslationTable(translationtable));
+
+  /* Start the thumb out at 100% */
+
+  XawScrollbarSetThumb(slider, 1.0 - SLIDER_LENGTH, SLIDER_LENGTH);
+}
+
+void
+update_slider(int newpercent)
+{
+  fraction = (float) newpercent / 100.0;
+  XawScrollbarSetThumb(slider, fraction / (1.0-SLIDER_LENGTH), SLIDER_LENGTH);
+}
diff --git a/xgc/tests.c b/xgc/tests.c
new file mode 100644 (file)
index 0000000..dcd32d2
--- /dev/null
@@ -0,0 +1,642 @@
+/*
+** $XConsortium: tests.c,v 1.20 91/06/08 18:57:07 rws Exp $
+** $XFree86: xc/programs/xgc/tests.c,v 1.11tsi Exp $
+**
+*/
+
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xos.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "xgc.h"
+#ifdef SVR4
+#define SYSV
+#endif
+#if !defined(SYSV) && !defined(QNX4)
+#include <sys/timeb.h>
+#include <sys/resource.h>
+#endif
+
+#ifndef PI
+#define PI 3.14159265
+#endif
+
+#ifdef SYSV
+#define random lrand48
+#endif
+
+
+/* timer(flag)
+** -----------
+** When called with StartTimer, starts the stopwatch and returns nothing.
+** When called with EndTimer, stops the stopwatch and returns the time
+** in microseconds since it started.
+**
+** Uses rusage() so we can subtract the time used by the system and user
+** from our timer, and just concentrate on the time used in the X calls.
+*/
+
+static long
+timer(int flag)
+{
+#if !defined(SYSV)
+  static struct timeval starttime;  /* starting time for gettimeofday() */
+  struct timeval endtime;           /* ending time for gettimeofday() */
+#if !defined(__UNIXOS2__) && !defined(QNX4)
+  static struct rusage startusage;  /* starting time for getrusage() */
+  struct rusage endusage;           /* ending time for getrusage() */
+#endif
+  struct timezone tz;               /* to make gettimeofday() happy */
+
+  long elapsedtime;                 /* how long since we started the timer */
+
+  switch (flag) {
+    case StartTimer:                       /* store initial values */
+      gettimeofday(&starttime,&tz);       
+#if !defined(__UNIXOS2__) && !defined(QNX4)
+      getrusage(RUSAGE_SELF,&startusage);
+#endif
+      return((long) NULL);
+    case EndTimer:
+      gettimeofday(&endtime,&tz);          /* store final values */
+#if !defined(__UNIXOS2__) && !defined(QNX4)
+      getrusage(RUSAGE_SELF,&endusage);
+#endif
+
+  /* all the following line does is use the formula 
+     elapsed time = ending time - starting time, but there are three 
+     different timers and two different units of time, ack... */
+
+#if !defined(__UNIXOS2__) && !defined(QNX4)
+      elapsedtime = (long) ((long)
+       ((endtime.tv_sec - endusage.ru_utime.tv_sec - endusage.ru_stime.tv_sec
+        - starttime.tv_sec + startusage.ru_utime.tv_sec
+        + startusage.ru_stime.tv_sec)) * 1000000) + (long)
+      ((endtime.tv_usec - endusage.ru_utime.tv_usec - endusage.ru_stime.tv_usec
+        - starttime.tv_usec + startusage.ru_utime.tv_usec
+        + startusage.ru_stime.tv_usec));
+#else
+      elapsedtime = (long)( ((long)endtime.tv_sec-(long)starttime.tv_sec)*1000000
+                          +((long)endtime.tv_usec-(long)starttime.tv_usec));
+#endif
+      return(elapsedtime);                
+
+    default:                              
+      fprintf(stderr,"Invalid flag in timer()\n");
+      return((long) NULL);
+    }
+#else
+  static time_t starttime;
+  
+  switch (flag) {
+    case StartTimer:
+      time(&starttime);
+      return((long) NULL);
+    case EndTimer:
+      return( (time(NULL) - starttime) * 1000000);
+    default:
+      fprintf(stderr,"Invalid flag in timer()\n");
+      return((long) NULL);
+    }
+#endif
+}
+
+
+void
+copyarea_test(void)
+{
+  int num_copies = 200;
+  int i;
+  long totaltime;
+  char buf[80];
+
+  num_copies *= X.percent;
+
+  XSetFillStyle(X.dpy,X.miscgc,FillTiled);
+  XFillRectangle(X.dpy,X.win,X.miscgc,0,0,400,400);
+
+  XSync(X.dpy,0);
+  timer(StartTimer);
+  for (i=0;i<num_copies;++i)
+    XCopyArea(X.dpy,X.win,X.win,X.gc,i,200-i,
+             200,200,200-i,i);
+  XSync(X.dpy,0);
+  totaltime = timer(EndTimer);
+
+  snprintf(buf,sizeof buf,"%.2f seconds.",(double)totaltime/1000000.);
+  show_result(buf);
+}
+
+void
+copyplane_test(void)
+{
+  int num_copies = 200;
+  int i;
+  long totaltime;
+  char buf[80];
+
+  if(!X.gcv.plane_mask || (X.gcv.plane_mask & (X.gcv.plane_mask - 1))) {
+    show_result("exactly one bit in plane mask must be set for this test");
+    return;
+  }
+
+
+  num_copies *= X.percent;
+
+  XSetPlaneMask(X.dpy, X.gc, ~0L);
+  XSetFillStyle(X.dpy,X.miscgc,FillTiled);
+  XFillRectangle(X.dpy,X.win,X.miscgc,0,0,400,400);
+
+  XSync(X.dpy,0);
+  timer(StartTimer);
+  for (i=0;i<num_copies;++i)
+    XCopyPlane(X.dpy,X.win,X.win,X.gc,i,200-i,
+             200,200,200-i,i,X.gcv.plane_mask);
+  XSync(X.dpy,0);
+  totaltime = timer(EndTimer);
+  XSetPlaneMask(X.dpy, X.gc, X.gcv.plane_mask);
+
+  snprintf(buf,sizeof buf,"%.2f seconds.",(double)totaltime/1000000.);
+  show_result(buf);
+}
+
+void
+circle_line_test(int num_vertices, int radius)
+{
+  double theta, delta;
+  int length, centerx, centery, i;
+  int relative_angle;
+  long totaltime;
+  char buf[80];
+  XPoint *coord;
+
+  relative_angle = num_vertices*5/12+1;
+  delta = (double) relative_angle / (double) num_vertices * 2 * PI;
+  centerx = centery = 200;
+
+  coord = (XPoint *) malloc (sizeof(XPoint)*(num_vertices+1));
+
+  length = (int) (2 * radius * (float) atan(delta/2.));
+
+  for (i=0;i<=num_vertices;++i) {
+    theta = (double) i * delta;
+    coord[i].x = centerx + (int) (radius * cos(theta));
+    coord[i].y = centery + (int) (radius * sin(theta));
+  }
+
+  XSync(X.dpy,0);
+  timer(StartTimer);
+  XDrawLines(X.dpy,X.win,X.gc,coord,num_vertices+1,CoordModeOrigin);
+  XSync(X.dpy,0);
+  totaltime = timer(EndTimer);
+
+  snprintf(buf,sizeof buf,"%d lines of length %d in %.3f seconds.",num_vertices,
+         length,(double)totaltime/1000000.);
+  show_result(buf);
+
+  free(coord);
+}
+
+
+
+void
+polyline_test(void)
+{
+  circle_line_test((int)(601*X.percent),190);
+}
+
+void
+polysegment_test(void)
+{
+  XSegment *segments;
+  int num_segments = 600;
+  long totaltime;
+  char buf[80];
+  int i;
+
+  num_segments *= X.percent;
+
+  segments = (XSegment *) malloc(sizeof(XSegment) * num_segments);
+
+  segments[0].x1 = random()%400; segments[0].y1 = random()%400;
+  segments[0].x2 = random()%400; segments[0].y2 = random()%400;
+
+  for(i=1;i<num_segments;++i) {
+    segments[i].x1 = (segments[i-1].x1-segments[i-1].y2+400+i)%400;
+    segments[i].y1 = (segments[i-1].y1+segments[i-1].x2+i)%400;
+    segments[i].x2 = (segments[i-1].x1-segments[i-1].y1+400+i)%400;
+    segments[i].y2 = (segments[i-1].x2+segments[i-1].y2+i)%400;
+  }
+
+  XSync(X.dpy,0);
+  start_timer();
+  XDrawSegments(X.dpy,X.win,X.gc,segments,num_segments);
+  XSync(X.dpy,0);
+  totaltime = end_timer();
+  
+  snprintf(buf,sizeof buf,"%d segments in %.3f seconds.",num_segments,
+         (double)totaltime/1000000.);
+  show_result(buf);
+
+  free(segments);
+}
+
+void
+polypoint_test(void)
+{
+  XPoint *points;
+  int num_points = 100000;
+  long totaltime;
+  char buf[80];
+  int i;
+  
+  num_points *= X.percent;
+
+  points = (XPoint *) malloc(sizeof(XPoint) * num_points);
+
+  points[0].x = random()%400; points[0].y = random()%400;
+  points[1].x = random()%400; points[1].y = random()%400;
+
+  for (i=2;i<num_points;++i) {
+    points[i].x = (points[i-1].x+points[i-2].y+i*3/200)%400;
+    points[i].y = (points[i-1].y+points[i-2].x+i*5/200)%400;
+  }
+
+  XSync(X.dpy,0);
+  start_timer();
+  XDrawPoints(X.dpy,X.win,X.gc,points,num_points,CoordModeOrigin);
+  XSync(X.dpy,0);
+  totaltime = end_timer();
+
+  snprintf(buf,sizeof buf,"%d points in %.3f seconds.",num_points,
+         (double)totaltime/1000000.);
+  show_result(buf);
+
+  free(points);
+}
+
+void
+genericrectangle_test(Boolean fill)
+{
+  XRectangle *rects;
+  int num_rects = 200;
+  int perimeter = 0, area = 0;
+  int i;
+  long totaltime;
+  char buf[80];
+
+  num_rects *= X.percent;
+
+  rects = (XRectangle *) malloc(sizeof(XRectangle) * num_rects);
+
+  for (i=0;i<num_rects;++i) {
+    rects[i].x = rects[i].y = 200 - i;
+    rects[i].width = rects[i].height = 2 * i;
+    perimeter += rects[i].width * 2 + rects[i].height * 2;
+    area += rects[i].width * rects[i].height;
+  }
+
+  XSync(X.dpy,0);
+  start_timer();
+  if (fill) XFillRectangles(X.dpy,X.win,X.gc,rects,num_rects);
+  else XDrawRectangles(X.dpy,X.win,X.gc,rects,num_rects);
+  XSync(X.dpy,0);
+  totaltime = end_timer();
+
+  if (fill)
+    snprintf(buf,sizeof buf,"%d pixels in %.2f seconds.",area,(double)totaltime/1000000.);
+  else
+    snprintf(buf,sizeof buf,"Total line length %d in %.3f seconds.",perimeter,
+           (double)totaltime/1000000.);
+  show_result(buf);
+
+  free(rects);
+}
+
+void
+polyrectangle_test(void)
+{
+  genericrectangle_test(FALSE);
+}
+
+void
+polyfillrectangle_test(void)
+{
+  genericrectangle_test(TRUE);
+}
+
+/*****************************/
+
+void
+fillpolygon_test(void)
+{
+  int i;
+  int points_per_side = 40;
+  int spacing;
+  XPoint *points;
+  XPoint polypoints[3];
+
+  points = (XPoint *) malloc (sizeof(XPoint) * points_per_side * 4);
+  spacing = 400 / points_per_side;
+
+  for (i = 0; i < points_per_side; ++i) {
+    points[i].x = i * spacing;
+    points[i].y = 0;
+
+    points[i + points_per_side].x = 400;
+    points[i + points_per_side].y = i * spacing;
+
+    points[i + 2 * points_per_side].x = 400 - i * spacing;
+    points[i + 2 * points_per_side].y = 400;
+
+    points[i + 3 * points_per_side].x = 0;
+    points[i + 3 * points_per_side].y = 400 - i * spacing;
+  }
+
+  for (i = 0; i < 2 * points_per_side; i += 2) {
+    polypoints[0].x = points[i].x;
+    polypoints[0].y = points[i].y;
+
+    polypoints[1].x = points[i + 2 * points_per_side].x;
+    polypoints[1].y = points[i + 2 * points_per_side].y;
+
+    polypoints[2].x = points[i + 2 * points_per_side + 1].x;
+    polypoints[2].y = points[i + 2 * points_per_side + 1].y;
+
+    XFillPolygon (X.dpy, X.win, X.gc, polypoints, 3, Convex, CoordModeOrigin);
+  }
+  free(points);
+}
+
+/*****************************/
+
+void
+genericarc_test(Boolean fill)
+{
+  XArc *arcs;
+  int num_arcs = 180;
+  int i;
+  long totaltime;
+  char buf[80];
+
+  num_arcs *= X.percent;
+
+  arcs = (XArc *) malloc(sizeof(XArc) * num_arcs);
+
+  for (i=0;i<num_arcs;++i) {
+    arcs[i].x = i;
+    arcs[i].y = i;
+    arcs[i].width = i;
+    arcs[i].height = i;
+    arcs[i].angle1 = i * 128;
+    arcs[i].angle2 = i * 128;
+  }
+
+  XSync(X.dpy,0);
+  start_timer();
+  if (fill) XFillArcs(X.dpy,X.win,X.gc,arcs,num_arcs);
+  else XDrawArcs(X.dpy,X.win,X.gc,arcs,num_arcs);
+  XSync(X.dpy,0);
+  totaltime = end_timer();
+
+  snprintf(buf,sizeof buf,"An uncounted number of pixels in %.3f seconds.",
+         (double)totaltime/1000000.);
+  show_result(buf);
+
+  free(arcs);
+}
+
+void
+polyarc_test(void)
+{
+  genericarc_test(FALSE);
+}
+
+void
+polyfillarc_test(void)
+{
+  genericarc_test(TRUE);
+}
+
+static const char string8[] = "pack my box with five dozen liquor jugs";
+
+void
+polytext8_test(void)
+{
+  int num_strings = 200;
+  int i;
+  long totaltime;
+  char buf[80];
+
+  num_strings *= X.percent;
+
+  XSync(X.dpy,0);
+  start_timer();
+  for (i=0;i<num_strings;++i) {
+    XDrawString(X.dpy,X.win,X.gc,(i%2 ? i : num_strings - i),i,
+               string8,sizeof(string8)-1);
+  }
+  XSync(X.dpy,0);
+  totaltime = end_timer();
+
+  snprintf(buf,sizeof buf,"%d strings in %.2f seconds.",num_strings,
+         (double) totaltime/1000000.);
+  show_result(buf);
+}
+
+void
+imagetext8_test(void)
+{
+  int num_strings = 200;
+  int i;
+  long totaltime;
+  char buf[80];
+
+  num_strings *= X.percent;
+
+  XSync(X.dpy,0);
+  start_timer();
+  for (i=0;i<num_strings;++i) {
+    XDrawImageString(X.dpy,X.win,X.gc,(i%2 ? i : num_strings - i),i,
+                    string8,sizeof(string8)-1);
+  }
+  XSync(X.dpy,0);
+  totaltime = end_timer();
+
+  snprintf(buf,sizeof buf,"%d strings in %.2f seconds.",num_strings,
+         (double) totaltime/1000000.);
+  show_result(buf);
+}
+
+static char unicode_font[] =
+  "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1";
+
+static const XChar2b string16[] = {
+  { 0x00, 0x20 }, { 0x00, 0x20 }, { 0x22, 0x2E }, { 0x00, 0x20 },
+  { 0x00, 0x45 }, { 0x22, 0xC5 }, { 0x00, 0x64 }, { 0x00, 0x61 },
+  { 0x00, 0x20 }, { 0x00, 0x3D }, { 0x00, 0x20 }, { 0x00, 0x51 },
+  { 0x00, 0x2C }, { 0x00, 0x20 }, { 0x00, 0x20 }, { 0x00, 0x6E },
+  { 0x00, 0x20 }, { 0x21, 0x92 }, { 0x00, 0x20 }, { 0x22, 0x1E },
+  { 0x00, 0x2C }, { 0x00, 0x20 }, { 0x22, 0x11 }, { 0x00, 0x20 },
+  { 0x00, 0x66 }, { 0x00, 0x28 }, { 0x00, 0x69 }, { 0x00, 0x29 },
+  { 0x00, 0x20 }, { 0x00, 0x3D }, { 0x00, 0x20 }, { 0x22, 0x0F },
+  { 0x00, 0x20 }, { 0x00, 0x67 }, { 0x00, 0x28 }, { 0x00, 0x69 },
+  { 0x00, 0x29 }, { 0x00, 0x2C }, { 0x00, 0x20 }, { 0x22, 0x00 },
+  { 0x00, 0x78 }, { 0x22, 0x08 }, { 0x21, 0x1D }, { 0x00, 0x3A },
+  { 0x00, 0x20 }, { 0x23, 0x08 }, { 0x00, 0x78 }, { 0x23, 0x09 },
+  { 0x00, 0x20 }, { 0x00, 0x3D }, { 0x00, 0x20 }, { 0x22, 0x12 },
+  { 0x23, 0x0A }, { 0x22, 0x12 }, { 0x00, 0x78 }, { 0x23, 0x0B },
+  { 0x00, 0x2C }, { 0x00, 0x20 }, { 0x03, 0xB1 }, { 0x00, 0x20 },
+  { 0x22, 0x27 }, { 0x00, 0x20 }, { 0x00, 0xAC }, { 0x03, 0xB2 },
+  { 0x00, 0x20 }, { 0x00, 0x3D }, { 0x00, 0x20 }, { 0x00, 0xAC },
+  { 0x00, 0x28 }, { 0x00, 0xAC }, { 0x03, 0xB1 }, { 0x00, 0x20 },
+  { 0x22, 0x28 }, { 0x00, 0x20 }, { 0x03, 0xB2 }, { 0x00, 0x29 },
+  { 0x00, 0x2C }
+};
+
+void
+polytext16_test(void)
+{
+  int num_strings = 50;
+  int i;
+  long totaltime;
+  char buf[80];
+
+  num_strings *= X.percent;
+
+  GC_change_font(unicode_font,FALSE);
+
+  XSync(X.dpy,0);
+  start_timer();
+  for (i=0;i<num_strings;++i) {
+    XDrawString16(X.dpy,X.win,X.gc,(i%2 ? i : num_strings - i),10*i,
+                 string16,sizeof(string16)/sizeof(XChar2b));
+  }
+  XSync(X.dpy,0);
+  totaltime = end_timer();
+
+  GC_change_font(X.fontname,FALSE);
+
+  snprintf(buf,sizeof buf,"%d strings in %.2f seconds.",num_strings,
+         (double) totaltime/1000000.);
+  show_result(buf);
+}
+
+void
+imagetext16_test(void)
+{
+  int num_strings = 50;
+  int i;
+  long totaltime;
+  char buf[80];
+
+  num_strings *= X.percent;
+
+  GC_change_font(unicode_font,FALSE);
+
+  XSync(X.dpy,0);
+  start_timer();
+  for (i=0;i<num_strings;++i) {
+    XDrawImageString16(X.dpy,X.win,X.gc,(i%2 ? i : num_strings - i),10*i,
+                      string16,sizeof(string16)/sizeof(XChar2b));
+  }
+  XSync(X.dpy,0);
+  totaltime = end_timer();
+
+  GC_change_font(X.fontname,FALSE);
+
+  snprintf(buf,sizeof buf,"%d strings in %.2f seconds.",num_strings,
+         (double) totaltime/1000000.);
+  show_result(buf);
+}
+
+void
+putimage_test(void)
+{
+  int num_copies = 200;
+  int i;
+  long totaltime;
+  char buf[80];
+
+  num_copies *= X.percent;
+
+  XSetFillStyle(X.dpy,X.miscgc,FillTiled);
+  XFillRectangle(X.dpy,X.win,X.miscgc,0,0,400,400);
+
+  X.image = XGetImage(X.dpy,X.win,0,0,200,200,~0,XYPixmap);
+
+  XSync(X.dpy,0);
+  timer(StartTimer);
+  for (i=0;i<num_copies;++i)
+    XPutImage(X.dpy,X.win,X.gc,X.image,0,0,i,i,200,200);
+  XSync(X.dpy,0);
+  totaltime = timer(EndTimer);
+
+  snprintf(buf,sizeof buf,"%.2f seconds.",(double)totaltime/1000000.);
+  show_result(buf);
+}
+
+
+/*****************************/
+/*****************************/
+
+void
+run_test(void)
+{
+  XClearWindow(X.dpy,X.win);
+
+  print_if_recording("run\n");
+  
+  switch (X.test) {
+    case CopyArea:      copyarea_test();           break;
+    case CopyPlane:     copyplane_test();          break;
+    case PolyPoint:     polypoint_test();          break;
+    case PolyLine:      polyline_test();           break;
+    case PolySegment:   polysegment_test();        break;
+    case PolyRectangle: polyrectangle_test();      break;
+    case PolyArc:       polyarc_test();            break;
+    case FillPolygon:   fillpolygon_test();        break;
+    case PolyFillRect:  polyfillrectangle_test();  break;
+    case PolyFillArc:   polyfillarc_test();        break;
+    case PolyText8:     polytext8_test();          break;
+    case ImageText8:    imagetext8_test();         break;
+    case PolyText16:    polytext16_test();         break;
+    case ImageText16:   imagetext16_test();        break;
+    case PutImage:      putimage_test();           break;
+    default: fprintf(stderr,"That test doesn't exist yet.\n");
+    }
+}
+
+/*****************************/
+
+/* set_text(w,string)
+** ------------------
+** Sets the text in a read-only text widget to the specified string.
+*/
+
+void
+set_text(Widget w, char *string)
+{
+  static Arg args[2];
+
+  XtSetArg(args[0], XtNstring, string);
+  XtSetArg(args[1], XtNlength, strlen(string));
+  XtSetValues(w, args, (Cardinal) 2 );
+}
+
+void
+show_result(char *string)
+{
+  char buf[80];
+
+  set_text(result,string);
+
+  strcpy(buf,"# ");
+  strncat(buf,string,sizeof(buf) - 3);
+  buf[sizeof(buf) - 3] = '\0';
+  strcat(buf,"\n");
+  print_if_recording(buf);
+}
diff --git a/xgc/text.c b/xgc/text.c
new file mode 100644 (file)
index 0000000..fd5e389
--- /dev/null
@@ -0,0 +1,199 @@
+/*
+** xgc
+**
+** text.c
+**
+** How to make a text widget that returns a string when the cursor
+** leaves its window.
+*/
+/* $XFree86: xc/programs/xgc/text.c,v 1.3 2000/02/17 14:00:37 dawes Exp $ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/AsciiText.h>
+#include "xgc.h"
+
+static void WriteText(Widget, XEvent *, String *, Cardinal *);
+
+/* the strings which are displayed on the screen, edited, and sent
+   to interpret() */
+static char textstrings[NUMTEXTWIDGETS][80];
+
+static char oldtextstrings[NUMTEXTWIDGETS][80];
+
+static const char *defaultstrings[NUMTEXTWIDGETS] = {"0","6x10","0","1"};
+
+/* The labels displayed next to them */
+static const char *labels[NUMTEXTWIDGETS] = {"Line Width","Font","Foreground",
+                                            "Background"};
+
+/* the first half of what gets sent to interpret() */
+static const char *names[NUMTEXTWIDGETS] = {"linewidth ","font ","foreground ",
+                                           "background "};
+
+/* create_text_choice(w,type,length,width)
+** ---------------------------------------
+** Inside w (a form), creates an editable text widget of width width.  The
+** user can enter a string of up to length characters.  type is one of
+** the constants defined in xgc.h; it decides things like the label,
+** what string will be displayed and edited, etc.  When the pointer leaves
+** the widget, the widget does the appropriate thing with the text
+** inside it; the user doesn't have to press an "enter" button or anything.
+** Returns the text widget which the user will edit.
+*/
+
+Widget
+create_text_choice(Widget w, int type, int length, int width)
+{
+  char translationtable[600];  /* for adding the new action (calling
+                                  WriteText() when the pointer leaves) */
+
+  static XtActionsRec actionTable[] = {        /* likewise */
+    {"WriteText",  WriteText},
+    {"Nothing",    NULL}
+  };
+
+  static Arg labelargs[] = {
+    {XtNborderWidth,   (XtArgVal) 0},
+    {XtNjustify,       (XtArgVal) XtJustifyRight}
+  };
+
+  static Arg textargs[] = {
+    {XtNeditType,   (XtArgVal) XawtextEdit},
+    {XtNstring,     (XtArgVal) NULL},
+    {XtNlength,     (XtArgVal) NULL},
+    {XtNhorizDistance, (XtArgVal) 10},
+    {XtNfromHoriz,  (XtArgVal) NULL},
+    {XtNinsertPosition, (XtArgVal) NULL},
+    {XtNuseStringInPlace, (XtArgVal) True}
+  };
+
+  static Widget text;          /* the text widget */
+  static Widget label;         /* the label widget */
+
+  /* Disable keys which would cause the cursor to go off the single
+  ** line that we want to display.  If the pointer leaves the window,
+  ** update the GC accordingly.  The integer passed to WriteText is
+  ** so it knows what type of widget was just updated. */
+
+  snprintf(translationtable,sizeof translationtable,
+     "<Leave>:      WriteText(%d)\n\
+     <Btn1Down>:    set-keyboard-focus() select-start()\n\
+     Ctrl<Key>J:    Nothing()\n\
+     Ctrl<Key>M:    Nothing()\n\
+     <Key>Linefeed: Nothing()\n\
+     <Key>Return:   Nothing()\n\
+     Ctrl<Key>O:    Nothing()\n\
+     Meta<Key>I:    Nothing()\n\
+     Ctrl<Key>N:    Nothing()\n\
+     Ctrl<Key>P:    Nothing()\n\
+     Ctrl<Key>Z:    Nothing()\n\
+     Meta<Key>Z:    Nothing()\n\
+     Ctrl<Key>V:    Nothing()\n\
+     Meta<Key>V:    Nothing()",type);
+
+  /* label uses type to find out what its title is */
+  label = XtCreateManagedWidget(labels[type],labelWidgetClass,w,
+                               labelargs,XtNumber(labelargs));
+  
+  /* text uses type to find out what its string is */
+  switch (type) {
+  case TForeground:
+    snprintf(textstrings[type],sizeof textstrings[type], 
+       "%d",(int) X.gcv.foreground);
+    snprintf(oldtextstrings[type],sizeof oldtextstrings[type],
+       "%d",(int) X.gcv.foreground);
+    break;
+  case TBackground:
+    snprintf(textstrings[type],sizeof textstrings[type],
+       "%d",(int) X.gcv.background);
+    snprintf(oldtextstrings[type],sizeof oldtextstrings[type],
+       "%d",(int) X.gcv.background);
+    break;
+  default:
+    strcpy(textstrings[type],defaultstrings[type]);
+    strcpy(oldtextstrings[type],defaultstrings[type]);
+  }
+  textargs[1].value = (XtArgVal) textstrings[type];
+  textargs[2].value = (XtArgVal) length;
+  textargs[4].value = (XtArgVal) label;
+  textargs[5].value = (XtArgVal) strlen(textstrings[type]);
+
+  text = XtCreateManagedWidget("text", asciiTextWidgetClass,w,
+                              textargs,XtNumber(textargs));
+
+  /* Register the actions and translations */
+
+  XtAppAddActions(appcontext,actionTable,XtNumber(actionTable));
+  XtOverrideTranslations(text,XtParseTranslationTable(translationtable));
+
+  return(text);
+}
+
+/* WriteText(w,event,params,num_params)
+** ------------------------------------
+** Makes an appropriate string and sends it off to interpret().
+** It's an ActionProc, thus the funny arguments.
+*/
+
+/*ARGSUSED*/
+static void
+WriteText(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+  char mbuf[80];
+  int type;                    /* which string # to send */
+
+  type = atoi(params[0]);
+  if (strcmp(textstrings[type],oldtextstrings[type])) {
+    strcpy(oldtextstrings[type],textstrings[type]);
+    snprintf(mbuf,sizeof mbuf,"%s%s\n", 
+       names[type],            /* the right first half */
+       textstrings[type]);     /* the right second half */
+    interpret(mbuf);           /* send it off */
+  }
+}
+
+/* change_text(w,type,newtext)
+** ------------------------
+** Changes the text in the text widget w of type type to newtext.
+*/
+
+void
+change_text(Widget w, String newtext)
+{
+  XawTextBlock text;           /* the new text */
+  XawTextPosition first, last; /* boundaries of the old text */
+  String oldtext;              /* the old text */
+
+  static Arg textargs[] = {
+    {XtNstring, (XtArgVal) 0}
+  };
+
+  /* Initialize the XawTextBlock. */
+
+  if (!newtext)
+      newtext = "";
+  text.firstPos = 0;
+  text.length = strlen(newtext);
+  text.ptr = newtext;
+  text.format = FMT8BIT;
+
+  /* Find the old text, so we can get its length, so we know how
+  ** much of it to update. */
+
+  textargs[0].value = (XtArgVal) &oldtext;
+  XtGetValues(w,textargs,XtNumber(textargs));
+  first = XawTextTopPosition(w);
+  if (!oldtext)
+      oldtext = "";
+  last = (XawTextPosition) strlen(oldtext)+1;
+
+  /* Replace it with the new text. */
+
+  XawTextReplace(w, first, last, &text);
+}
+
diff --git a/xgc/tile b/xgc/tile
new file mode 100644 (file)
index 0000000..46ab826
--- /dev/null
+++ b/xgc/tile
@@ -0,0 +1,17 @@
+/* $XFree86$ */
+
+#if !defined(tile_width) && !defined(tile_height)
+
+#define tile_width 16
+#define tile_height 16
+
+#ifdef DEFINE_TILE
+
+static unsigned char tile_bits[] = {
+   0xff, 0x80, 0xfc, 0x80, 0x70, 0xc0, 0xc0, 0xc0, 0xe0, 0xe3, 0xe0, 0xef,
+   0xf0, 0xff, 0xf0, 0xdf, 0xfb, 0x0f, 0xff, 0x0f, 0xf7, 0x07, 0xc7, 0x07,
+   0x03, 0x03, 0x03, 0x0e, 0x01, 0x3f, 0x01, 0xff};
+
+#endif
+
+#endif
diff --git a/xgc/xgc.h b/xgc/xgc.h
new file mode 100644 (file)
index 0000000..c3a7021
--- /dev/null
+++ b/xgc/xgc.h
@@ -0,0 +1,168 @@
+/*
+** xgc
+**
+** xgc.h
+*/
+/* $XFree86: xc/programs/xgc/xgc.h,v 1.5 2003/05/07 21:17:06 herrb Exp $ */
+
+#include "constants.h"
+
+typedef struct {
+  Display  *dpy;               /* the display! */
+  Screen   *scr;               /* the screen! */
+  Window    win;               /* the window the test runs in */
+  GC        gc;                        /* the GC! */
+  GC        miscgc;            /* used for doing stuff when we don't want
+                                  to change the normal GC */
+  XGCValues gcv;               /* a separate copy of what's in the GC,
+                                  since we're not allowed to look in it */
+  Pixmap    tile;              /* what we tile with */
+  Pixmap    stipple;           /* what we stipple with */
+  XImage   *image;             /* image for GetImage & PutImage */
+  int       test;              /* which test is being run */
+  float     percent;           /* percentage of test to run */
+  Pixel     foreground;
+  Pixel     background;
+  char      *fontname;
+} XStuff;                       /* All the stuff that only X needs to
+                                   know about */
+
+typedef struct {
+  char name[40];               /* name as it will appear on the screen */
+  char text[40];               /* Xgc command it translates to */
+  int num_commands;            /* number of command buttons inside it */
+  int columns;                 /* how many columns of command buttons; if
+                                  0, then there's only one row */
+  struct {
+    char name[40];             /* name as it will appear on the screen */
+    char text[40];             /* Xgc command it translates to */
+  } command_data[MAXCHOICES];
+} ChoiceStuff;                 /* All the info needed to deal with a 
+                                  choice widget */
+typedef struct {
+  const char *name;
+  const char *text;
+  int code;
+} XgcData;
+
+typedef struct {
+  struct {
+    const char *name;
+    const char *text;
+    int   num_toggles;
+    int   columns;
+  } choice;
+  XgcData *data;
+} XgcStuff;
+
+typedef struct {
+  Widget label;
+  int size;
+  WidgetList widgets;
+} ChoiceDesc;
+
+#ifndef HAS_SNPRINTF
+#include <X11/Xmu/SysUtil.h>
+#define snprintf XmuSnprintf
+#endif
+
+/************/
+
+extern XStuff X;
+extern Widget topform;
+extern XtAppContext appcontext;
+
+extern XgcStuff TestStuff;
+extern XgcStuff FunctionStuff;
+extern XgcStuff LinestyleStuff;
+extern XgcStuff CapstyleStuff;
+extern XgcStuff JoinstyleStuff;
+extern XgcStuff FillstyleStuff;
+extern XgcStuff FillruleStuff;
+extern XgcStuff ArcmodeStuff;
+
+extern ChoiceDesc *GCdescs[];
+extern ChoiceDesc *testchoicedesc;
+extern Widget test;
+extern Widget GCform;
+extern Widget foregroundtext;
+extern Widget backgroundtext;
+extern Widget linewidthtext;
+extern Widget fonttext;
+extern Widget dashlistchoice;
+extern Widget planemaskchoice;
+extern Widget testchoiceform;
+
+extern Widget result;
+
+extern Boolean recording;
+extern Widget filename_text_widget, recordbutton;
+
+extern int fildes[2];
+extern FILE *outend;
+extern FILE *yyin;
+
+/************/
+
+extern void change_percent(int, Boolean);
+extern void change_test(int, Boolean);
+extern void change_text(Widget, String);
+extern void choose_defaults(ChoiceDesc *[], int);
+extern void circle_line_test(int, int);
+extern void close_file_if_recording(void);
+extern void copyarea_test(void);
+extern void copyplane_test(void);
+extern ChoiceDesc * create_choice(Widget, XgcStuff *);
+extern void create_dashlist_choice(Widget);
+extern void create_planemask_choice(Widget);
+extern void create_testfrac_choice(Widget);
+extern Widget create_text_choice(Widget, int, int, int);
+extern void fillpolygon_test(void);
+extern void GC_change_arcmode(int, Boolean);
+extern void GC_change_background(unsigned long, Boolean);
+extern void GC_change_capstyle(int, Boolean);
+extern void GC_change_dashlist(int, Boolean);
+extern void GC_change_fillrule(int, Boolean);
+extern void GC_change_fillstyle(int, Boolean);
+extern void GC_change_font(char *, Boolean);
+extern void GC_change_foreground(unsigned long, Boolean);
+extern void GC_change_function(int, Boolean);
+extern void GC_change_joinstyle(int, Boolean);
+extern void GC_change_linestyle(int, Boolean);
+extern void GC_change_linewidth(int, Boolean);
+extern void GC_change_planemask(unsigned long, Boolean);
+extern void genericarc_test(Boolean);
+extern void genericrectangle_test(Boolean);
+extern void get_filename(void (*)(void), void (*)(void));
+extern void imagetext16_test(void);
+extern void imagetext8_test(void);
+extern void interpret(const char *);
+extern void line_up_labels(ChoiceDesc *[], int);
+extern void polyarc_test(void);
+extern void polyfillarc_test(void);
+extern void polyfillrectangle_test(void);
+extern void polyline_test(void);
+extern void polypoint_test(void);
+extern void polyrectangle_test(void);
+extern void polysegment_test(void);
+extern void polytext16_test(void);
+extern void polytext8_test(void);
+extern void print_if_recording(const char *);
+extern void putimage_test(void);
+extern void read_from_keyboard(void);
+extern void run_test(void);
+extern void select_button(ChoiceDesc *, int);
+extern void set_text(Widget, char *);
+extern void show_result(char *);
+extern void start_playback(void);
+extern void toggle_recordbutton(Widget, caddr_t, caddr_t);
+extern void update_dashlist(int);
+extern void update_planemask(long);
+extern void update_slider(int);
+extern void yyerror(const char *);
+extern int yylex(void);
+extern int yyparse(void);
+extern void yyrestart(FILE *);
+extern int yywrap(void);
+
+
diff --git a/xgc/xgc.man b/xgc/xgc.man
new file mode 100644 (file)
index 0000000..7a3b4f3
--- /dev/null
@@ -0,0 +1,164 @@
+.\" Copyright (c) 1991  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 CONNECTION 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 dealings in this Software without prior written authorization
+.\" from the X Consortium.
+.\"
+.\" Copyright 2009 Sun Microsystems, 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, and/or sell copies of the Software, and to permit persons
+.\" to whom the Software is furnished to do so, provided that the above
+.\" copyright notice(s) and this permission notice appear in all copies of
+.\" the Software and that both the above copyright notice(s) and this
+.\" permission notice appear in supporting documentation.
+.\"
+.\" 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
+.\" OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+.\" HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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.
+.\"
+.\" Except as contained in this notice, the name of a copyright holder
+.\" shall not be used in advertising or otherwise to promote the sale, use
+.\" or other dealings in this Software without prior written authorization
+.\" of the copyright holder.
+.\"
+.TH XGC 1 __xorgversion__
+.SH NAME
+xgc - X graphics demo
+.SH SYNOPSIS
+.ta 8n
+\fBxgc\fP [-\fItoolkitoption\fP ...]
+.SH DESCRIPTION
+The
+.I xgc
+program demonstrates various features of the X graphics primitives.
+In X, most of the details about the graphics to be generated are
+stored in a resource called a graphics context (GC).  The
+.B xgc
+program provides a user interface for setting various GC components.
+Pressing the "Run" button causes these results to be displayed in
+the large drawing window on the right.  Timing information is
+displayed in the window immediately below.
+.PP
+The items in the upper left hand window work as follows:
+.PP
+.I Function
+\- specify the logical function with which primitives
+will drawn.  The most usual setting is "set", i.e. simply to render
+pixels without regard to what has been drawn before.
+.PP
+.I LineStyle
+\- specify whether lines should be drawn solid in foreground,
+dashed in foreground or alternating foreground and background.
+.PP
+.I CapStyle
+\- specify the appearance of the ends of a line.
+.PP
+.I JoinStyle
+\- specify the appearance of joints between consecutive
+lines drawn within a single graphics primitive.
+.PP
+.I FillStyle
+\- specify whether lines, text and fill requests are
+solid, tiled with a pixmap or stippled.
+.PP
+.I FillRule
+\- specifies the rule used to fill polygons.  The EvenOdd
+rule means that if areas overlap an odd number of times, they are not
+drawn.  Winding rule means that overlapping areas are always filled,
+regardless of how many times they overlap.
+.PP
+.I ArcMode
+\- specifies the rule for filling of arcs.  The boundary
+of the arc is either a Chord or two radii.
+.PP
+.I planemask
+\- specifies which planes of the drawing window are
+modified.  By default, all planes are modified.
+.PP
+.I dashlist
+\- specifies a pattern to be used when drawing dashed lines.
+.PP
+.I Line Width
+\- specifies the width in pixels of lines to be drawn.
+Zero means to draw using the server's fastest algorithm with a line width of
+one pixel.
+.PP
+.I Font
+\- specifies the font to be used for text primitives.
+.PP
+.I Foreground
+and
+.I Background
+\- specify the pixel values to be
+applied when drawing primitives.
+The Foreground value is used as the
+pixel value for set bits in the source in all primitives.
+The Background value is used as the
+pixel value for unset bits in the source when using Copy Plane, drawing
+lines with LineStyle of DoubleDash and filling with FillStyle of
+OpaqueStippled.
+.PP
+.I Percentage of Test
+\- scrollbar permits specifying only
+a percentage of the test to be run.  The number at the left indicates
+the current setting, which defaults to 100%.
+.sp
+The window labeled "Test" permits choice of one a number of graphics
+primitive tests, including Points, Segments, Lines, Arcs and Filled Arcs,
+8-bit Text and Image Text, Rectangles and Filled Rectangles, Image draws,
+as well as Copy Plane and Copy Area.
+.PP
+The window to the right of this has buttons which permit record/playback
+of the primitives rendered.
+.SH OPTIONS
+.I Xgc
+accepts all of the standard X Toolkit command line options.
+.SH X DEFAULTS
+This program accepts the usual defaults for toolkit applications.
+.SH ENVIRONMENT
+.PP
+.TP 8
+.B DISPLAY
+to get the default host and display number.
+.TP 8
+.B XENVIRONMENT
+to get the name of a resource file that overrides the global resources
+stored in the RESOURCE_MANAGER property.
+.SH "SEE ALSO"
+X(__miscmansuffix__)
+.SH BUGS
+This program isn't really finished yet, but it probably never will be,
+since it only demonstrates the original X11 core protocol rendering
+operations, which few modern programs use anymore.
+.SH AUTHORS
+Dan Schmidt, MIT
diff --git a/xgc/ylwrap b/xgc/ylwrap
new file mode 100755 (executable)
index 0000000..84d5634
--- /dev/null
@@ -0,0 +1,222 @@
+#! /bin/sh
+# ylwrap - wrapper for lex/yacc invocations.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005,
+# 2007, 2009 Free Software Foundation, Inc.
+#
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# 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, see <http://www.gnu.org/licenses/>.
+
+# 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 <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+case "$1" in
+  '')
+    echo "$0: No files given.  Try \`$0 --help' for more information." 1>&2
+    exit 1
+    ;;
+  --basedir)
+    basedir=$2
+    shift 2
+    ;;
+  -h|--h*)
+    cat <<\EOF
+Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
+
+Wrapper for lex/yacc invocations, renaming files as desired.
+
+  INPUT is the input file
+  OUTPUT is one file PROG generates
+  DESIRED is the file we actually want instead of OUTPUT
+  PROGRAM is program to run
+  ARGS are passed to PROG
+
+Any number of OUTPUT,DESIRED pairs may be used.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v|--v*)
+    echo "ylwrap $scriptversion"
+    exit $?
+    ;;
+esac
+
+
+# The input.
+input="$1"
+shift
+case "$input" in
+  [\\/]* | ?:[\\/]*)
+    # Absolute path; do nothing.
+    ;;
+  *)
+    # Relative path.  Make it absolute.
+    input="`pwd`/$input"
+    ;;
+esac
+
+pairlist=
+while test "$#" -ne 0; do
+  if test "$1" = "--"; then
+    shift
+    break
+  fi
+  pairlist="$pairlist $1"
+  shift
+done
+
+# The program to run.
+prog="$1"
+shift
+# Make any relative path in $prog absolute.
+case "$prog" in
+  [\\/]* | ?:[\\/]*) ;;
+  *[\\/]*) prog="`pwd`/$prog" ;;
+esac
+
+# FIXME: add hostname here for parallel makes that run commands on
+# other machines.  But that might take us over the 14-char limit.
+dirname=ylwrap$$
+trap "cd '`pwd`'; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
+mkdir $dirname || exit 1
+
+cd $dirname
+
+case $# in
+  0) "$prog" "$input" ;;
+  *) "$prog" "$@" "$input" ;;
+esac
+ret=$?
+
+if test $ret -eq 0; then
+  set X $pairlist
+  shift
+  first=yes
+  # Since DOS filename conventions don't allow two dots,
+  # the DOS version of Bison writes out y_tab.c instead of y.tab.c
+  # and y_tab.h instead of y.tab.h. Test to see if this is the case.
+  y_tab_nodot="no"
+  if test -f y_tab.c || test -f y_tab.h; then
+    y_tab_nodot="yes"
+  fi
+
+  # The directory holding the input.
+  input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
+  # Quote $INPUT_DIR so we can use it in a regexp.
+  # FIXME: really we should care about more than `.' and `\'.
+  input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
+
+  while test "$#" -ne 0; do
+    from="$1"
+    # Handle y_tab.c and y_tab.h output by DOS
+    if test $y_tab_nodot = "yes"; then
+      if test $from = "y.tab.c"; then
+       from="y_tab.c"
+      else
+       if test $from = "y.tab.h"; then
+         from="y_tab.h"
+       fi
+      fi
+    fi
+    if test -f "$from"; then
+      # If $2 is an absolute path name, then just use that,
+      # otherwise prepend `../'.
+      case "$2" in
+       [\\/]* | ?:[\\/]*) target="$2";;
+       *) target="../$2";;
+      esac
+
+      # We do not want to overwrite a header file if it hasn't
+      # changed.  This avoid useless recompilations.  However the
+      # parser itself (the first file) should always be updated,
+      # because it is the destination of the .y.c rule in the
+      # Makefile.  Divert the output of all other files to a temporary
+      # file so we can compare them to existing versions.
+      if test $first = no; then
+       realtarget="$target"
+       target="tmp-`echo $target | sed s/.*[\\/]//g`"
+      fi
+      # Edit out `#line' or `#' directives.
+      #
+      # We don't want the resulting debug information to point at
+      # an absolute srcdir; it is better for it to just mention the
+      # .y file with no path.
+      #
+      # We want to use the real output file name, not yy.lex.c for
+      # instance.
+      #
+      # We want the include guards to be adjusted too.
+      FROM=`echo "$from" | sed \
+            -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
+            -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
+      TARGET=`echo "$2" | sed \
+            -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
+            -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
+
+      sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \
+          -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$?
+
+      # Check whether header files must be updated.
+      if test $first = no; then
+       if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
+         echo "$2" is unchanged
+         rm -f "$target"
+       else
+          echo updating "$2"
+          mv -f "$target" "$realtarget"
+        fi
+      fi
+    else
+      # A missing file is only an error for the first file.  This
+      # is a blatant hack to let us support using "yacc -d".  If -d
+      # is not specified, we don't want an error when the header
+      # file is "missing".
+      if test $first = yes; then
+        ret=1
+      fi
+    fi
+    shift
+    shift
+    first=no
+  done
+else
+  ret=$?
+fi
+
+# Remove the directory.
+cd ..
+rm -rf $dirname
+
+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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xload/AUTHORS b/xload/AUTHORS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xload/COPYING b/xload/COPYING
new file mode 100644 (file)
index 0000000..7f33cbf
--- /dev/null
@@ -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/xload/ChangeLog b/xload/ChangeLog
new file mode 100644 (file)
index 0000000..b3ea2a7
--- /dev/null
@@ -0,0 +1,41 @@
+2007-03-21  Jeremy C. Reed  <reed@reedmedia.net>
+
+       * configure.ac
+       Update version for another release.
+
+2006-06-20  Matthieu Herrb <matthieu.herrb@laas.fr>
+
+       * xload.c:
+       Check setuid() return value. Bugzilla #7116.
+
+2005-12-20  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * configure.ac:
+       Update package version for X11R7 release.
+
+2005-12-14  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * configure.ac:
+       Update package version number for final X11R7 release candidate.
+
+2005-12-07  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * Makefile.am:
+       * configure.ac:
+       Change to use the app-defaults default dir configured in libXt.
+
+2005-12-06  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * Makefile.am:
+       Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+2005-12-03  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * configure.ac:
+       Update package version number for X11R7 RC3 release.
+
+2005-10-18  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * configure.ac:
+       Update package version number for RC1 release.
+
diff --git a/xload/INSTALL b/xload/INSTALL
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xload/Makefile.am b/xload/Makefile.am
new file mode 100644 (file)
index 0000000..cc7b451
--- /dev/null
@@ -0,0 +1,85 @@
+# 
+#  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 = xload
+
+xload_CFLAGS = $(XLOAD_CFLAGS)
+xload_LDADD = $(XLOAD_LIBS)
+
+xload_SOURCES =        \
+        get_load.c \
+        get_rload.c \
+        xload.c \
+        xload.h
+
+appman_PRE = \
+        xload.man
+
+# App default files  (*.ad)
+
+appdefaultdir = @appdefaultdir@
+
+
+APPDEFAULTFILES = \
+        XLoad
+
+SUFFIXES = .ad 
+
+.ad:
+       cp $< $@
+
+appdefault_DATA = $(APPDEFAULTFILES)
+
+EXTRA_DIST = $(APPDEFAULTFILES:%=%.ad) xload.bit
+
+CLEANFILES = $(APPDEFAULTFILES)
+
+
+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/xload/Makefile.in b/xload/Makefile.in
new file mode 100644 (file)
index 0000000..7fce171
--- /dev/null
@@ -0,0 +1,724 @@
+# 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 = xload$(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)$(appdefaultdir)" \
+       "$(DESTDIR)$(appmandir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_xload_OBJECTS = xload-get_load.$(OBJEXT) xload-get_rload.$(OBJEXT) \
+       xload-xload.$(OBJEXT)
+xload_OBJECTS = $(am_xload_OBJECTS)
+am__DEPENDENCIES_1 =
+xload_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 = $(xload_SOURCES)
+DIST_SOURCES = $(xload_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|^.*/||'`;
+appdefaultDATA_INSTALL = $(INSTALL_DATA)
+appmanDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(appdefault_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@
+APPDEFS_CFLAGS = @APPDEFS_CFLAGS@
+APPDEFS_LIBS = @APPDEFS_LIBS@
+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@
+TMP_XAW_CFLAGS = @TMP_XAW_CFLAGS@
+TMP_XAW_LIBS = @TMP_XAW_LIBS@
+VERSION = @VERSION@
+XAW_USE_XPRINT_FALSE = @XAW_USE_XPRINT_FALSE@
+XAW_USE_XPRINT_TRUE = @XAW_USE_XPRINT_TRUE@
+XLOAD_CFLAGS = @XLOAD_CFLAGS@
+XLOAD_LIBS = @XLOAD_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@
+
+# App default files  (*.ad)
+appdefaultdir = @appdefaultdir@
+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@
+xload_CFLAGS = $(XLOAD_CFLAGS)
+xload_LDADD = $(XLOAD_LIBS)
+xload_SOURCES = \
+        get_load.c \
+        get_rload.c \
+        xload.c \
+        xload.h
+
+appman_PRE = \
+        xload.man
+
+APPDEFAULTFILES = \
+        XLoad
+
+SUFFIXES = .ad .$(APP_MAN_SUFFIX) .man
+appdefault_DATA = $(APPDEFAULTFILES)
+EXTRA_DIST = $(APPDEFAULTFILES:%=%.ad) xload.bit $(appman_PRE)
+CLEANFILES = $(APPDEFAULTFILES) $(appman_DATA)
+appmandir = $(APP_MAN_DIR)
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+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'
+
+all: config.h
+       $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .ad .$(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)
+xload$(EXEEXT): $(xload_OBJECTS) $(xload_DEPENDENCIES) 
+       @rm -f xload$(EXEEXT)
+       $(LINK) $(xload_LDFLAGS) $(xload_OBJECTS) $(xload_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xload-get_load.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xload-get_rload.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xload-xload.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) '$<'`
+
+xload-get_load.o: get_load.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xload_CFLAGS) $(CFLAGS) -MT xload-get_load.o -MD -MP -MF "$(DEPDIR)/xload-get_load.Tpo" -c -o xload-get_load.o `test -f 'get_load.c' || echo '$(srcdir)/'`get_load.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xload-get_load.Tpo" "$(DEPDIR)/xload-get_load.Po"; else rm -f "$(DEPDIR)/xload-get_load.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='get_load.c' object='xload-get_load.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) $(xload_CFLAGS) $(CFLAGS) -c -o xload-get_load.o `test -f 'get_load.c' || echo '$(srcdir)/'`get_load.c
+
+xload-get_load.obj: get_load.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xload_CFLAGS) $(CFLAGS) -MT xload-get_load.obj -MD -MP -MF "$(DEPDIR)/xload-get_load.Tpo" -c -o xload-get_load.obj `if test -f 'get_load.c'; then $(CYGPATH_W) 'get_load.c'; else $(CYGPATH_W) '$(srcdir)/get_load.c'; fi`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xload-get_load.Tpo" "$(DEPDIR)/xload-get_load.Po"; else rm -f "$(DEPDIR)/xload-get_load.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='get_load.c' object='xload-get_load.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) $(xload_CFLAGS) $(CFLAGS) -c -o xload-get_load.obj `if test -f 'get_load.c'; then $(CYGPATH_W) 'get_load.c'; else $(CYGPATH_W) '$(srcdir)/get_load.c'; fi`
+
+xload-get_rload.o: get_rload.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xload_CFLAGS) $(CFLAGS) -MT xload-get_rload.o -MD -MP -MF "$(DEPDIR)/xload-get_rload.Tpo" -c -o xload-get_rload.o `test -f 'get_rload.c' || echo '$(srcdir)/'`get_rload.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xload-get_rload.Tpo" "$(DEPDIR)/xload-get_rload.Po"; else rm -f "$(DEPDIR)/xload-get_rload.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='get_rload.c' object='xload-get_rload.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) $(xload_CFLAGS) $(CFLAGS) -c -o xload-get_rload.o `test -f 'get_rload.c' || echo '$(srcdir)/'`get_rload.c
+
+xload-get_rload.obj: get_rload.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xload_CFLAGS) $(CFLAGS) -MT xload-get_rload.obj -MD -MP -MF "$(DEPDIR)/xload-get_rload.Tpo" -c -o xload-get_rload.obj `if test -f 'get_rload.c'; then $(CYGPATH_W) 'get_rload.c'; else $(CYGPATH_W) '$(srcdir)/get_rload.c'; fi`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xload-get_rload.Tpo" "$(DEPDIR)/xload-get_rload.Po"; else rm -f "$(DEPDIR)/xload-get_rload.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='get_rload.c' object='xload-get_rload.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) $(xload_CFLAGS) $(CFLAGS) -c -o xload-get_rload.obj `if test -f 'get_rload.c'; then $(CYGPATH_W) 'get_rload.c'; else $(CYGPATH_W) '$(srcdir)/get_rload.c'; fi`
+
+xload-xload.o: xload.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xload_CFLAGS) $(CFLAGS) -MT xload-xload.o -MD -MP -MF "$(DEPDIR)/xload-xload.Tpo" -c -o xload-xload.o `test -f 'xload.c' || echo '$(srcdir)/'`xload.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xload-xload.Tpo" "$(DEPDIR)/xload-xload.Po"; else rm -f "$(DEPDIR)/xload-xload.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='xload.c' object='xload-xload.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) $(xload_CFLAGS) $(CFLAGS) -c -o xload-xload.o `test -f 'xload.c' || echo '$(srcdir)/'`xload.c
+
+xload-xload.obj: xload.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xload_CFLAGS) $(CFLAGS) -MT xload-xload.obj -MD -MP -MF "$(DEPDIR)/xload-xload.Tpo" -c -o xload-xload.obj `if test -f 'xload.c'; then $(CYGPATH_W) 'xload.c'; else $(CYGPATH_W) '$(srcdir)/xload.c'; fi`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xload-xload.Tpo" "$(DEPDIR)/xload-xload.Po"; else rm -f "$(DEPDIR)/xload-xload.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='xload.c' object='xload-xload.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) $(xload_CFLAGS) $(CFLAGS) -c -o xload-xload.obj `if test -f 'xload.c'; then $(CYGPATH_W) 'xload.c'; else $(CYGPATH_W) '$(srcdir)/xload.c'; fi`
+uninstall-info-am:
+install-appdefaultDATA: $(appdefault_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appdefaultdir)" || $(mkdir_p) "$(DESTDIR)$(appdefaultdir)"
+       @list='$(appdefault_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(appdefaultDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(appdefaultdir)/$$f'"; \
+         $(appdefaultDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(appdefaultdir)/$$f"; \
+       done
+
+uninstall-appdefaultDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appdefault_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(appdefaultdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(appdefaultdir)/$$f"; \
+       done
+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)$(appdefaultdir)" "$(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-appdefaultDATA 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-appdefaultDATA 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-appdefaultDATA 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-appdefaultDATA uninstall-appmanDATA \
+       uninstall-binPROGRAMS uninstall-info-am
+
+
+.ad:
+       cp $< $@
+
+.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/xload/NEWS b/xload/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xload/README b/xload/README
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xload/XLoad.ad b/xload/XLoad.ad
new file mode 100644 (file)
index 0000000..3d4c978
--- /dev/null
@@ -0,0 +1,6 @@
+XLoad.input:                   false
+*Label*Justify:                        left
+*JumpScroll:                   1
+*internalBorderWidth:          0
+*showGrip:                     FALSE
+
diff --git a/xload/aclocal.m4 b/xload/aclocal.m4
new file mode 100644 (file)
index 0000000..56f3af0
--- /dev/null
@@ -0,0 +1,1573 @@
+# 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.
+
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# 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_ifval([$1], [$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
+        PKG_CHECK_EXISTS([$3],
+                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                        [pkg_failed=yes])
+else
+       pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# 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])
+
+if test $pkg_failed = yes; then
+       $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
+
+       ifelse([$4], , [AC_MSG_ERROR(dnl
+[Package requirements ($2) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.])],
+               [$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.
+
+Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
+               [$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 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 
+
+# XAW_CHECK_XPRINT_SUPPORT()
+# --------------------------
+# Adds --enable/disable-xprint and selects the appropriate version of the Xaw 
+# library. If neither --enable-xprint nor --disable-xprint are given, 
+# the presence of an Xaw with Xprint support will be auto detected
+
+AC_DEFUN([XAW_CHECK_XPRINT_SUPPORT],[
+       AC_ARG_ENABLE(xprint, AC_HELP_STRING([--enable-xprint], [Enable XPrint support]),
+                       [use_xprint=$enableval],[use_xprint=auto])
+       if test "x$use_xprint" = "xyes"; then
+               TMP_CHECK1=xaw8
+               TMP_CHECK2=
+               xaw_use_xprint=yes
+       elif test "x$use_xprint" = "xno"; then
+               TMP_CHECK1=xaw7
+               TMP_CHECK2=
+               xaw_use_xprint=no
+       else
+               TMP_CHECK1=xaw8
+               TMP_CHECK2=xaw7
+               xaw_use_xprint=yes
+       fi
+
+       PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK1, success=yes, success=no)
+       if [[ ! -z $TMP_CHECK2 ]] ; then
+               if test $success = no ; then
+                       PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK2, success=yes, success=no)
+                       xaw_use_xprint=no
+               fi
+       fi
+
+       if test "x$success" = "xyes"; then
+               $1_CFLAGS=$TMP_XAW_CFLAGS
+               $1_LIBS=$TMP_XAW_LIBS
+
+               AM_CONDITIONAL([XAW_USE_XPRINT], [test "x$xaw_use_xprint" = "xyes"])
+       else
+               AC_MSG_ERROR([No suitable version of Xaw found])
+       fi
+])
+
+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.5
+       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],[
+XORG_SGML_PATH=$prefix/share/sgml
+HAVE_DEFS_ENT=
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+AC_PATH_PROG(PS2PDF, ps2pdf)
+
+AC_MSG_CHECKING([Whether to build documentation])
+
+if test x$HAVE_DEFS_ENT != 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 && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+XORG_SGML_PATH=$prefix/share/sgml
+HAVE_DEFS_ENT=
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([Whether to build text documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([Whether to build PDF documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([Whether to build PostScript documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([Whether to build HTML documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# 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.  Also
+# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+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
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+               [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+               [Major version of this package])
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+               [$PVM],
+               [Minor version of this package])
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+               [$PVP],
+               [Patch version of this package])
+])
+
diff --git a/xload/compile b/xload/compile
new file mode 100755 (executable)
index 0000000..1b1d232
--- /dev/null
@@ -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 <tromey@cygnus.com>.
+#
+# 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 <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+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 <bug-automake@gnu.org>.
+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/xload/config.guess b/xload/config.guess
new file mode 100755 (executable)
index 0000000..da83314
--- /dev/null
@@ -0,0 +1,1561 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
+
+timestamp='2009-04-27'
+
+# 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 <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+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, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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 "$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 ;;
+           sh5el) machine=sh5le-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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    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.*:* | i86xen:SunOS:5.*:*)
+       eval $set_cc_for_build
+       SUN_ARCH="i386"
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       echo ${SUN_ARCH}-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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:*:[456])
+       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+               IBM_ARCH=rs6000
+       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 <stdlib.h>
+              #include <unistd.h>
+
+              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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       exit ;;
+    i*:CYGWIN*:*)
+       echo ${UNAME_MACHINE}-pc-cygwin
+       exit ;;
+    *: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 ;;
+    *:Interix*:[3456]*)
+       case ${UNAME_MACHINE} in
+           x86)
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           EM64T | authenticamd | genuineintel)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+           IA64)
+               echo ia64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+       esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       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*:*:* | x86_64: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:*:*)
+       eval $set_cc_for_build
+       if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_EABI__
+       then
+           echo ${UNAME_MACHINE}-unknown-linux-gnu
+       else
+           echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+       fi
+       exit ;;
+    avr32*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-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 ;;
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-gnu
+       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 ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-gnu
+       exit ;;
+    x86_64:Linux:*:*)
+       echo x86_64-unknown-linux-gnu
+       exit ;;
+    xtensa*:Linux:*:*)
+       echo ${UNAME_MACHINE}-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 ;;
+         "")
+               # 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 <features.h>
+       #ifdef __ELF__
+       # ifdef __GLIBC__
+       #  if __GLIBC__ >= 2
+       LIBC=gnu
+       #  else
+       LIBC=gnulibc1
+       #  endif
+       # else
+       LIBC=gnulibc1
+       # endif
+       #else
+       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+       LIBC=gnu
+       #else
+       LIBC=gnuaout
+       #endif
+       #endif
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^LIBC/{
+               s: ::g
+               p
+           }'`"
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-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; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       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; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; 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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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 ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       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 ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-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
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/xload/config.h.in b/xload/config.h.in
new file mode 100644 (file)
index 0000000..d742d3a
--- /dev/null
@@ -0,0 +1,34 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the `kstat' library (-lkstat). */
+#undef HAVE_LIBKSTAT
+
+/* 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
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Version number of package */
+#undef VERSION
diff --git a/xload/config.sub b/xload/config.sub
new file mode 100755 (executable)
index 0000000..a39437d
--- /dev/null
@@ -0,0 +1,1686 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
+
+timestamp='2009-04-17'
+
+# 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 <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | bfin \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fido | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | lm32 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore | mep | metag \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64octeon | mips64octeonel \
+       | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | moxie \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | z8k | z80)
+               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)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64octeon-* | mips64octeonel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | 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[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+       | tron-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa*-* \
+       | ymp-* \
+       | z8k-* | z80-*)
+               ;;
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               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
+               ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+        cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
+       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
+               ;;
+       cr16)
+               basic_machine=cr16-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
+               ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
+       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
+               ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       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
+               ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
+       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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       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
+               ;;
+       tile*)
+               basic_machine=tile-unknown
+               os=-linux-gnu
+               ;;
+       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
+               ;;
+       z80-*-coff)
+               basic_machine=z80-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[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+               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* \
+             | -kopensolaris* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* | -aros* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
+             | -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* | -cegcc* \
+             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -linux-newlib* | -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* | -rdos* | -toppers* | -drops*)
+       # 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
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+       -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
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
+       *-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
+               ;;
+        mep-*)
+               os=-elf
+               ;;
+       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/xload/configure b/xload/configure
new file mode 100755 (executable)
index 0000000..91fc63e
--- /dev/null
@@ -0,0 +1,4987 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.59 for xload 1.0.2.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+# 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='xload'
+PACKAGE_TARNAME='xload'
+PACKAGE_VERSION='1.0.2'
+PACKAGE_STRING='xload 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 TMP_XAW_CFLAGS TMP_XAW_LIBS XAW_USE_XPRINT_TRUE XAW_USE_XPRINT_FALSE XLOAD_CFLAGS XLOAD_LIBS APPDEFS_CFLAGS APPDEFS_LIBS appdefaultdir 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_TMP_XAW_CFLAGS_set=${TMP_XAW_CFLAGS+set}
+ac_env_TMP_XAW_CFLAGS_value=$TMP_XAW_CFLAGS
+ac_cv_env_TMP_XAW_CFLAGS_set=${TMP_XAW_CFLAGS+set}
+ac_cv_env_TMP_XAW_CFLAGS_value=$TMP_XAW_CFLAGS
+ac_env_TMP_XAW_LIBS_set=${TMP_XAW_LIBS+set}
+ac_env_TMP_XAW_LIBS_value=$TMP_XAW_LIBS
+ac_cv_env_TMP_XAW_LIBS_set=${TMP_XAW_LIBS+set}
+ac_cv_env_TMP_XAW_LIBS_value=$TMP_XAW_LIBS
+ac_env_APPDEFS_CFLAGS_set=${APPDEFS_CFLAGS+set}
+ac_env_APPDEFS_CFLAGS_value=$APPDEFS_CFLAGS
+ac_cv_env_APPDEFS_CFLAGS_set=${APPDEFS_CFLAGS+set}
+ac_cv_env_APPDEFS_CFLAGS_value=$APPDEFS_CFLAGS
+ac_env_APPDEFS_LIBS_set=${APPDEFS_LIBS+set}
+ac_env_APPDEFS_LIBS_value=$APPDEFS_LIBS
+ac_cv_env_APPDEFS_LIBS_set=${APPDEFS_LIBS+set}
+ac_cv_env_APPDEFS_LIBS_value=$APPDEFS_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 xload 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 xload 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
+  --enable-xprint         Enable XPrint 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<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
+              headers in a nonstandard directory <include dir>
+  PKG_CONFIG  path to pkg-config utility
+  TMP_XAW_CFLAGS
+              C compiler flags for TMP_XAW, overriding pkg-config
+  TMP_XAW_LIBS
+              linker flags for TMP_XAW, overriding pkg-config
+  APPDEFS_CFLAGS
+              C compiler flags for APPDEFS, overriding pkg-config
+  APPDEFS_LIBS
+              linker flags for APPDEFS, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_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
+xload 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 xload $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='xload'
+ 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 </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&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 <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 <stdlib.h>
+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'
+
+
+### How to check load average on various OS'es:
+
+# Solaris: libkstat
+
+
+echo "$as_me:$LINENO: checking for kstat_open in -lkstat" >&5
+echo $ECHO_N "checking for kstat_open in -lkstat... $ECHO_C" >&6
+if test "${ac_cv_lib_kstat_kstat_open+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lkstat  $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 kstat_open ();
+int
+main ()
+{
+kstat_open ();
+  ;
+  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_kstat_kstat_open=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_kstat_kstat_open=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_kstat_kstat_open" >&5
+echo "${ECHO_T}$ac_cv_lib_kstat_kstat_open" >&6
+if test $ac_cv_lib_kstat_kstat_open = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBKSTAT 1
+_ACEOF
+
+  LIBS="-lkstat $LIBS"
+
+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
+
+       # Check whether --enable-xprint or --disable-xprint was given.
+if test "${enable_xprint+set}" = set; then
+  enableval="$enable_xprint"
+  use_xprint=$enableval
+else
+  use_xprint=auto
+fi;
+       if test "x$use_xprint" = "xyes"; then
+               TMP_CHECK1=xaw8
+               TMP_CHECK2=
+               xaw_use_xprint=yes
+       elif test "x$use_xprint" = "xno"; then
+               TMP_CHECK1=xaw7
+               TMP_CHECK2=
+               xaw_use_xprint=no
+       else
+               TMP_CHECK1=xaw8
+               TMP_CHECK2=xaw7
+               xaw_use_xprint=yes
+       fi
+
+
+pkg_failed=no
+echo "$as_me:$LINENO: checking for TMP_XAW" >&5
+echo $ECHO_N "checking for TMP_XAW... $ECHO_C" >&6
+
+if test -n "$PKG_CONFIG"; then
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK1\"") >&5
+  ($PKG_CONFIG --exists --print-errors "$TMP_CHECK1") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_TMP_XAW_CFLAGS=`$PKG_CONFIG --cflags "$TMP_CHECK1" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK1\"") >&5
+  ($PKG_CONFIG --exists --print-errors "$TMP_CHECK1") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_TMP_XAW_LIBS=`$PKG_CONFIG --libs "$TMP_CHECK1" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+else
+       pkg_failed=untried
+fi
+
+if test $pkg_failed = yes; then
+       TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$TMP_CHECK1"`
+       # Put the nasty error message in config.log where it belongs
+       echo "$TMP_XAW_PKG_ERRORS" 1>&5
+
+       success=no
+elif test $pkg_failed = untried; then
+       success=no
+else
+       TMP_XAW_CFLAGS=$pkg_cv_TMP_XAW_CFLAGS
+       TMP_XAW_LIBS=$pkg_cv_TMP_XAW_LIBS
+        echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       success=yes
+fi
+       if [ ! -z $TMP_CHECK2 ] ; then
+               if test $success = no ; then
+
+pkg_failed=no
+echo "$as_me:$LINENO: checking for TMP_XAW" >&5
+echo $ECHO_N "checking for TMP_XAW... $ECHO_C" >&6
+
+if test -n "$PKG_CONFIG"; then
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK2\"") >&5
+  ($PKG_CONFIG --exists --print-errors "$TMP_CHECK2") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_TMP_XAW_CFLAGS=`$PKG_CONFIG --cflags "$TMP_CHECK2" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK2\"") >&5
+  ($PKG_CONFIG --exists --print-errors "$TMP_CHECK2") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_TMP_XAW_LIBS=`$PKG_CONFIG --libs "$TMP_CHECK2" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+else
+       pkg_failed=untried
+fi
+
+if test $pkg_failed = yes; then
+       TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$TMP_CHECK2"`
+       # Put the nasty error message in config.log where it belongs
+       echo "$TMP_XAW_PKG_ERRORS" 1>&5
+
+       success=no
+elif test $pkg_failed = untried; then
+       success=no
+else
+       TMP_XAW_CFLAGS=$pkg_cv_TMP_XAW_CFLAGS
+       TMP_XAW_LIBS=$pkg_cv_TMP_XAW_LIBS
+        echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       success=yes
+fi
+                       xaw_use_xprint=no
+               fi
+       fi
+
+       if test "x$success" = "xyes"; then
+               XLOAD_CFLAGS=$TMP_XAW_CFLAGS
+               XLOAD_LIBS=$TMP_XAW_LIBS
+
+
+
+if test "x$xaw_use_xprint" = "xyes"; then
+  XAW_USE_XPRINT_TRUE=
+  XAW_USE_XPRINT_FALSE='#'
+else
+  XAW_USE_XPRINT_TRUE='#'
+  XAW_USE_XPRINT_FALSE=
+fi
+
+       else
+               { { echo "$as_me:$LINENO: error: No suitable version of Xaw found" >&5
+echo "$as_me: error: No suitable version of Xaw found" >&2;}
+   { (exit 1); exit 1; }; }
+       fi
+
+
+
+
+
+
+pkg_failed=no
+echo "$as_me:$LINENO: checking for APPDEFS" >&5
+echo $ECHO_N "checking for APPDEFS... $ECHO_C" >&6
+
+if test -n "$PKG_CONFIG"; then
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_APPDEFS_CFLAGS=`$PKG_CONFIG --cflags "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_APPDEFS_LIBS=`$PKG_CONFIG --libs "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+else
+       pkg_failed=untried
+fi
+
+if test $pkg_failed = yes; then
+       APPDEFS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xt"`
+       # Put the nasty error message in config.log where it belongs
+       echo "$APPDEFS_PKG_ERRORS" 1>&5
+
+       { { echo "$as_me:$LINENO: error: Package requirements (xt) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the APPDEFS_CFLAGS and APPDEFS_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details." >&5
+echo "$as_me: error: Package requirements (xt) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the APPDEFS_CFLAGS and APPDEFS_LIBS environment variables
+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 APPDEFS_CFLAGS and APPDEFS_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+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 APPDEFS_CFLAGS and APPDEFS_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+       APPDEFS_CFLAGS=$pkg_cv_APPDEFS_CFLAGS
+       APPDEFS_LIBS=$pkg_cv_APPDEFS_LIBS
+        echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       :
+fi
+appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+
+
+# 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
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+          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 "${XAW_USE_XPRINT_TRUE}" && test -z "${XAW_USE_XPRINT_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"XAW_USE_XPRINT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"XAW_USE_XPRINT\" 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 xload $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 <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+xload 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,@TMP_XAW_CFLAGS@,$TMP_XAW_CFLAGS,;t t
+s,@TMP_XAW_LIBS@,$TMP_XAW_LIBS,;t t
+s,@XAW_USE_XPRINT_TRUE@,$XAW_USE_XPRINT_TRUE,;t t
+s,@XAW_USE_XPRINT_FALSE@,$XAW_USE_XPRINT_FALSE,;t t
+s,@XLOAD_CFLAGS@,$XLOAD_CFLAGS,;t t
+s,@XLOAD_LIBS@,$XLOAD_LIBS,;t t
+s,@APPDEFS_CFLAGS@,$APPDEFS_CFLAGS,;t t
+s,@APPDEFS_LIBS@,$APPDEFS_LIBS,;t t
+s,@appdefaultdir@,$appdefaultdir,;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 <<CEOF' >>$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 <<CEOF' >>$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/xload/configure.ac b/xload/configure.ac
new file mode 100644 (file)
index 0000000..d310de8
--- /dev/null
@@ -0,0 +1,52 @@
+
+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(xload,[1.0.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xload)
+AM_INIT_AUTOMAKE([dist-bzip2])
+AM_MAINTAINER_MODE
+
+AM_CONFIG_HEADER(config.h)
+
+AC_PROG_CC
+AC_PROG_INSTALL
+
+### How to check load average on various OS'es:
+
+# Solaris: libkstat
+AC_CHECK_LIB([kstat], [kstat_open])
+
+# Checks for pkg-config packages
+XAW_CHECK_XPRINT_SUPPORT(XLOAD)
+
+AC_SUBST(XLOAD_CFLAGS)
+AC_SUBST(XLOAD_LIBS)
+
+PKG_CHECK_MODULES(APPDEFS, xt)
+appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+AC_SUBST(appdefaultdir)
+
+XORG_MANPAGE_SECTIONS
+XORG_RELEASE_VERSION
+
+AC_OUTPUT([Makefile])
diff --git a/xload/depcomp b/xload/depcomp
new file mode 100755 (executable)
index 0000000..04701da
--- /dev/null
@@ -0,0 +1,530 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2005-07-09.11
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+gcc)
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+  sed -e 's/^[^:]*: / /' \
+      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+  tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'.  On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like `#:fec' to the end of the
+    # dependency line.
+    tr ' ' '
+' < "$tmpdepfile" \
+    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+    tr '
+' ' ' >> $depfile
+    echo >> $depfile
+
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' '
+' < "$tmpdepfile" \
+   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+   >> $depfile
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+aix)
+  # The C for AIX Compiler uses -M and outputs the dependencies
+  # in a .u file.  In older versions, this file always lives in the
+  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # start of each line; $object doesn't have directory information.
+  # Version 6 uses the directory in both cases.
+  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+  tmpdepfile="$stripped.u"
+  if test "$libtool" = yes; then
+    "$@" -Wc,-M
+  else
+    "$@" -M
+  fi
+  stat=$?
+
+  if test -f "$tmpdepfile"; then :
+  else
+    stripped=`echo "$stripped" | sed 's,^.*/,,'`
+    tmpdepfile="$stripped.u"
+  fi
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+
+  if test -f "$tmpdepfile"; then
+    outname="$stripped.o"
+    # Each line is of the form `foo.o: dependent.h'.
+    # Do two passes, one to just change these to
+    # `$object: dependent.h' and one to simply `dependent.h:'.
+    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+icc)
+  # Intel's C compiler understands `-MD -MF file'.  However on
+  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+  # ICC 7.0 will fill foo.d with something like
+  #    foo.o: sub/foo.c
+  #    foo.o: sub/foo.h
+  # which is wrong.  We want:
+  #    sub/foo.o: sub/foo.c
+  #    sub/foo.o: sub/foo.h
+  #    sub/foo.c:
+  #    sub/foo.h:
+  # ICC 7.1 will output
+  #    foo.o: sub/foo.c sub/foo.h
+  # and will wrap long lines using \ :
+  #    foo.o: sub/foo.c ... \
+  #     sub/foo.h ... \
+  #     ...
+
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Do two passes, one to just change these to
+  # `$object: dependent.h' and one to simply `dependent.h:'.
+  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+    sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+   # dependencies in `foo.d' instead, so we check for that too.
+   # Subdirectories are respected.
+   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+   test "x$dir" = "x$object" && dir=
+   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+   if test "$libtool" = yes; then
+      # With Tru64 cc, shared objects can also be used to make a
+      # static library.  This mecanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in in $dir.libs/$base.o.d and
+      # in $dir$base.o.d.  We have to check for both files, because
+      # one of the two compilations can be disabled.  We should prefer
+      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+      # automatically cleaned when .libs/ is deleted, while ignoring
+      # the former would cause a distcleancheck panic.
+      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
+      tmpdepfile2=$dir$base.o.d          # libtool 1.5
+      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
+      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
+      "$@" -Wc,-MD
+   else
+      tmpdepfile1=$dir$base.o.d
+      tmpdepfile2=$dir$base.d
+      tmpdepfile3=$dir$base.d
+      tmpdepfile4=$dir$base.d
+      "$@" -MD
+   fi
+
+   stat=$?
+   if test $stat -eq 0; then :
+   else
+      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+      exit $stat
+   fi
+
+   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+   do
+     test -f "$tmpdepfile" && break
+   done
+   if test -f "$tmpdepfile"; then
+      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+      # That's a tab and a space in the [].
+      sed -e 's,^.*\.[a-z]*:[   ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+   else
+      echo "#dummy" > "$depfile"
+   fi
+   rm -f "$tmpdepfile"
+   ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  # Require at least two characters before searching for `:'
+  # in the target name.  This is to cope with DOS-style filenames:
+  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  "$@" $dashmflag |
+    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # Remove any Libtool call
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no
+  for arg in "$@"; do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    # Strip any option that makedepend may not understand.  Remove
+    # the object too, otherwise makedepend will parse it as a source file.
+    -*|$object)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix="`echo $object | sed 's/^.*\././'`"
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  "$@" -E |
+    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+    sed '$ s: \\$::' > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o,
+  # because we must use -o when running libtool.
+  "$@" || exit $?
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::   \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/xload/get_load.c b/xload/get_load.c
new file mode 100644 (file)
index 0000000..1a6a365
--- /dev/null
@@ -0,0 +1,1240 @@
+/* $XdotOrg: xc/programs/xload/get_load.c,v 1.2 2004/04/23 19:54:57 eich Exp $ */
+/* $XConsortium: get_load.c /main/37 1996/03/09 09:38:04 kaleb $ */
+/* $XFree86: xc/programs/xload/get_load.c,v 1.21tsi Exp $ */
+/*
+
+Copyright (c) 1989  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+
+/*
+ * get_load - get system load
+ *
+ * Authors:  Many and varied...
+ *
+ * Call InitLoadPoint() to initialize.
+ * GetLoadPoint() is a callback for the StripChart widget.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <X11/Xos.h>
+#include <X11/Intrinsic.h>
+#include <X11/Xlocale.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "xload.h"
+
+#if defined(__CYGWIN__)
+#include <windows.h>
+typedef struct {
+  DWORD stat;
+  union {
+    LONG vLong;
+    double vDouble;
+    LONGLONG vLongLong;
+    void *string;
+  } u;
+} COUNTER;
+static HANDLE query;
+static HANDLE counter;
+static HINSTANCE hdll;
+static long (__stdcall *pdhopen)(LPCSTR, DWORD, HANDLE);
+static long (__stdcall *pdhaddcounter)(HANDLE, LPCSTR, DWORD, HANDLE*);
+static long (__stdcall *pdhcollectquerydata)(HANDLE);
+static long (__stdcall *pdhgetformattedcountervalue)(HANDLE, DWORD, LPDWORD, COUNTER*);
+#define CYGWIN_PERF 
+void InitLoadPoint()
+{
+  long ret;
+  hdll=LoadLibrary("pdh.dll");
+  if (!hdll) exit(-1);
+  pdhopen=(void*)GetProcAddress(hdll, "PdhOpenQueryA");
+  if (!pdhopen) exit(-1);
+  pdhaddcounter=(void*)GetProcAddress(hdll, "PdhAddCounterA");
+  if (!pdhaddcounter) exit(-1);
+  pdhcollectquerydata=(void*)GetProcAddress(hdll, "PdhCollectQueryData");
+  if (!pdhcollectquerydata) exit(-1);
+  pdhgetformattedcountervalue=(void*)GetProcAddress(hdll, "PdhGetFormattedCounterValue");
+  if (!pdhgetformattedcountervalue) exit(-1);
+  ret = pdhopen( NULL , 0, &query );
+  if (ret!=0) exit(-1);
+  ret = pdhaddcounter(query, "\\Processor(_Total)\\% Processor Time", 0, &counter);
+  if (ret!=0) exit(-1);  
+}
+void GetLoadPoint( w, closure, call_data )      /* SYSV386 version */
+     Widget  w;              /* unused */
+     XtPointer       closure;        /* unused */
+     XtPointer       call_data;      /* pointer to (double) return value */
+{
+  double *loadavg = (double *)call_data;
+  COUNTER fmtvalue;
+  long ret;
+  *loadavg = 0.0;
+  ret = pdhcollectquerydata(query);
+  if (ret!=0) return;
+  ret = pdhgetformattedcountervalue(counter, 0x200, NULL, &fmtvalue);
+  if (ret!=0) return;
+  *loadavg = (fmtvalue.u.vDouble-0.01)/100.0;
+}
+#else
+
+
+#if !defined(DGUX)
+#if defined(att) || defined(QNX4)
+#define LOADSTUB
+#endif
+
+#ifndef macII
+#ifndef apollo
+#ifndef LOADSTUB
+#if !defined(linux) && !defined(__UNIXOS2__) && !defined(__GLIBC__)
+#include <nlist.h>
+#endif /* !linux && ... */
+#endif /* LOADSTUB */
+#endif /* apollo */
+#endif /* macII */
+
+#if defined(MOTOROLA) && defined(SYSV)
+#include <sys/sysinfo.h>
+#endif
+
+#ifdef sun
+#    include <sys/param.h>
+#    if !defined(HAVE_CONFIG_H) && defined(SVR4) 
+#      define HAVE_LIBKSTAT 1
+#    endif
+#    ifdef HAVE_LIBKSTAT
+#      include <kstat.h>
+#      include <errno.h>
+#    elif defined(i386) && !defined(SVR4)
+#        include <kvm.h>
+#        define        KVM_ROUTINES
+#    endif /* i386 */
+#endif
+
+#ifdef CSRG_BASED
+#include <sys/param.h>
+#endif
+
+#if defined(umips) || (defined(ultrix) && defined(mips))
+#include <sys/fixpoint.h>
+#endif
+
+#if  defined(CRAY) || defined(AIXV3)
+#include <sys/param.h>
+#define word word_t
+#include <sys/sysinfo.h>
+#undef word
+#undef n_type
+#define n_type n_value
+#endif /* CRAY */
+
+#ifdef sequent
+#include <sys/vm.h>
+#endif /* sequent */
+
+#ifdef macII
+#include <a.out.h>
+#include <sys/var.h>
+#define X_AVENRUN 0
+#define fxtod(i) (vec[i].high+(vec[i].low/65536.0))
+struct lavnum {
+    unsigned short high;
+    unsigned short low;
+};
+#endif /* macII */
+
+#ifdef hcx
+#include <sys/param.h>
+#endif /* hcx */
+
+#if defined(UTEK) || defined(alliant) || (defined(MOTOROLA) && defined(SVR4))
+#define FSCALE 100.0
+#endif
+
+#ifdef sequent
+#define FSCALE 1000.0
+#endif
+
+#ifdef sgi
+#define FSCALE 1024.0
+#endif
+
+#if defined(sony) && OSMAJORVERSION == 4
+#ifdef mips
+#include <sys/fixpoint.h>
+#else
+#include <sys/param.h>
+#endif
+#endif
+
+#ifdef __osf__
+/*
+ * Use the table(2) interface; it doesn't require setuid root.
+ *
+ * Select 0, 1, or 2 for 5, 30, or 60 second load averages.
+ */
+#ifndef WHICH_AVG
+#define WHICH_AVG 1
+#endif
+#include <sys/table.h>
+#endif
+
+#ifdef SVR4
+#ifndef FSCALE
+#define FSCALE (1 << 8)
+#endif
+#endif
+
+#ifdef X_NOT_POSIX
+extern long lseek();
+#endif
+
+void xload_error(char *, char *);
+
+
+#ifdef apollo
+#include <apollo/base.h>
+#include <apollo/time.h>
+typedef struct {
+       short           state;          /* ready, waiting, etc. */
+       pinteger        usr;            /* user sr */
+       linteger        upc;            /* user pc */
+       linteger        usp;            /* user stack pointer */
+       linteger        usb;            /* user sb ptr (A6) */
+       time_$clock_t   cpu_total;      /* cumulative cpu used by process */
+       unsigned short  priority;       /* process priority */
+    } proc1_$info_t;
+
+void proc1_$get_cput(
+       time_$clock_t   *cput
+);
+
+void proc1_$get_info(
+       short           &pid,
+       proc1_$info_t   *info,
+       status_$t       *sts
+);
+
+static int     lastNullCpu;
+static int     lastClock;
+
+void InitLoadPoint()                           /* Apollo version */
+{
+     time_$clock_t  timeNow;
+     proc1_$info_t  info;
+     status_$t      st;
+
+     proc1_$get_info( (short) 2, &info, &st );
+     time_$clock( &timeNow );
+
+     lastClock = timeNow.low32;
+     lastNullCpu = info.cpu_total.low32;
+}
+
+/* ARGSUSED */
+void GetLoadPoint( w, closure, call_data )     /* Apollo version */
+     Widget    w;              /* unused */
+     XtPointer closure;        /* unused */
+     XtPointer call_data;      /* pointer to (double) return value */
+{
+     time_$clock_t  timeNow;
+     double         temp;
+     proc1_$info_t  info;
+     status_$t      st;
+
+     proc1_$get_info( (short) 2, &info, &st );
+     time_$clock( &timeNow );
+
+     temp = info.cpu_total.low32 - lastNullCpu;
+     *(double *)call_data = 1.0 - temp / (timeNow.low32 - lastClock);
+
+     lastClock = timeNow.low32;
+     lastNullCpu = info.cpu_total.low32;
+}
+#else /* not apollo */
+#if defined(SYSV) && defined(i386)
+/*
+ * inspired by 'avgload' by John F. Haugh II
+ */
+#include <sys/param.h>
+#include <sys/buf.h>
+#include <sys/immu.h>
+#include <sys/region.h>
+#include <sys/var.h>
+#include <sys/proc.h>
+#define KERNEL_FILE "/unix"
+#define KMEM_FILE "/dev/kmem"
+#define VAR_NAME "v"
+#define PROC_NAME "proc"
+#define BUF_NAME "buf"
+#define DECAY 0.8
+struct nlist namelist[] = {
+  {VAR_NAME},
+  {PROC_NAME},
+  {BUF_NAME},
+  {0},
+};
+
+static int kmem;
+static struct var v;
+static struct proc *p;
+static XtPointer first_buf, last_buf;
+
+void InitLoadPoint()                           /* SYSV386 version */
+{
+    int i;
+
+    nlist( KERNEL_FILE, namelist);
+
+    for (i=0; namelist[i].n_name; i++) 
+       if (namelist[i].n_value == 0)
+           xload_error("cannot get name list from", KERNEL_FILE);
+
+    if ((kmem = open(KMEM_FILE, O_RDONLY)) < 0)
+       xload_error("cannot open", KMEM_FILE);
+
+    if (lseek(kmem, namelist[0].n_value, 0) == -1)
+       xload_error("cannot seek", VAR_NAME);
+
+    if (read(kmem, &v, sizeof(v)) != sizeof(v))
+       xload_error("cannot read", VAR_NAME);
+
+    if ((p=(struct proc *)malloc(v.v_proc*sizeof(*p))) == NULL)
+       xload_error("cannot allocat space for", PROC_NAME);
+         
+    first_buf = (XtPointer) namelist[2].n_value;
+    last_buf  = (char *)first_buf + v.v_buf * sizeof(struct buf);
+}
+       
+/* ARGSUSED */
+void GetLoadPoint( w, closure, call_data )     /* SYSV386 version */
+Widget w;              /* unused */
+XtPointer      closure;        /* unused */
+XtPointer      call_data;      /* pointer to (double) return value */
+{
+    double *loadavg = (double *)call_data;
+    static double avenrun = 0.0;
+    int i, nproc, size;
+       
+    (void) lseek(kmem, namelist[0].n_value, 0);
+    (void) read(kmem, &v, sizeof(v));
+
+    size = (struct proc *)v.ve_proc - (struct proc *)namelist[1].n_value;
+
+    (void) lseek(kmem, namelist[1].n_value, 0);
+    (void) read(kmem, p, size * sizeof(struct proc));
+
+    for (nproc = 0, i=0; i<size; i++) 
+         if ((p[i].p_stat == SRUN) ||
+             (p[i].p_stat == SIDL) ||
+             (p[i].p_stat == SXBRK) ||
+             (p[i].p_stat == SSLEEP && (p[i].p_pri < PZERO) &&
+              (p[i].p_wchan >= (char *)first_buf) && (p[i].p_wchan < (char *)last_buf)))
+           nproc++;
+
+    /* update the load average using a decay filter */
+    avenrun = DECAY * avenrun + nproc * (1.0 - DECAY);
+    *loadavg = avenrun;
+
+    return;
+}
+#else /* not (SYSV && i386) */
+#ifdef KVM_ROUTINES
+/*
+ *     Sun 386i Code - abstracted to see the wood for the trees
+ */
+
+static struct nlist nl[2];
+static kvm_t *kd;
+
+void
+InitLoadPoint()                                        /* Sun 386i version */
+{
+    kd = kvm_open("/vmunix", NULL, NULL, O_RDONLY, "Load Widget");
+    if (kd == (kvm_t *)0) {
+       xload_error("cannot get access to kernel address space", "");
+    }
+       
+    nl[0].n_name = "avenrun";
+    nl[1].n_name = NULL;
+       
+    if (kvm_nlist(kd, nl) != 0) {
+       xload_error("cannot get name list", "");
+    }
+    
+    if (nl[0].n_value == 0) {
+       xload_error("Cannot find address for avenrun in the kernel\n", "");
+    }
+}
+
+/* ARGSUSED */
+void 
+GetLoadPoint( w, closure, call_data )          /* Sun 386i version */
+Widget w;              /* unused */
+XtPointer closure;     /* unused */
+XtPointer call_data;   /* pointer to (double) return value */
+{
+    double *loadavg = (double *)call_data;
+    long       temp;
+
+    if (kvm_read(kd, nl[0].n_value, (char *)&temp, sizeof (temp)) != 
+       sizeof (temp)) {
+       xload_error("Kernel read error", "");
+    }
+    *loadavg = (double)temp/FSCALE;
+}
+#else /* not KVM_ROUTINES */
+
+#if defined(linux) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
+
+void InitLoadPoint()
+{
+      return;
+}
+
+void GetLoadPoint( w, closure, call_data )
+     Widget   w;              /* unused */
+     XtPointer  closure;        /* unused */
+     XtPointer  call_data;      /* pointer to (double) return value */
+{
+      static int fd = -1;
+      int n;
+      char buf[10] = {0, };
+#ifndef X_LOCALE
+      char *dp;
+      static char ldp = 0;
+#endif
+
+
+      if (fd < 0)
+      {
+              if (fd == -2 ||
+                  (fd = open("/proc/loadavg", O_RDONLY)) < 0)
+              {
+                      fd = -2;
+                      *(double *)call_data = 0.0;
+                      return;
+              }
+#ifndef X_LOCALE
+             ldp = *localeconv()->decimal_point;
+#endif
+      }
+      else
+              lseek(fd, 0, 0);
+
+      if ((n = read(fd, buf, sizeof(buf)-1)) > 0) {
+#ifndef X_LOCALE
+         if (ldp != '.')
+             while ((dp = memchr(buf,'.',sizeof(buf)-1)) != NULL) {
+                 *(char *)dp = ldp;
+             }
+         
+#endif
+         if (sscanf(buf, "%lf", (double *)call_data) == 1)
+             return;
+      }
+      
+
+      *(double *)call_data = 0.0;     /* temporary hiccup */
+
+      return;
+}
+
+#else /* linux */
+
+#ifdef __GNU__
+
+#include <mach.h>
+
+static processor_set_t default_set;
+
+void InitLoadPoint()
+{
+  if (processor_set_default (mach_host_self (), &default_set) != KERN_SUCCESS)
+    xload_error("cannot get processor_set_default", "");
+}
+
+/* ARGSUSED */
+void GetLoadPoint( w, closure, call_data )
+     Widget    w;              /* unused */
+     XtPointer closure;        /* unused */
+     XtPointer call_data;      /* pointer to (double) return value */
+{
+  host_t host;
+  struct processor_set_basic_info info;
+  unsigned info_count;
+
+  info_count = PROCESSOR_SET_BASIC_INFO_COUNT;
+  if (processor_set_info (default_set, PROCESSOR_SET_BASIC_INFO, &host,
+                         (processor_set_info_t) &info, &info_count)
+      != KERN_SUCCESS)
+    {
+      InitLoadPoint();
+      info.load_average = 0;
+    }
+
+  *(double *)call_data = info.load_average * 1000 / LOAD_SCALE;
+
+  return;
+}
+
+#else /* __GNU__ */
+
+#ifdef __DARWIN__
+
+#include <mach/mach.h>
+
+static mach_port_t host_priv_port;
+
+void InitLoadPoint()
+{
+    host_priv_port = mach_host_self();
+}
+
+/* ARGSUSED */
+void GetLoadPoint( w, closure, call_data )
+    Widget     w;              /* unused */
+    XtPointer  closure;        /* unused */
+    XtPointer  call_data;      /* pointer to (double) return value */
+{
+    double *loadavg = (double *)call_data;
+
+    struct host_load_info load_data;
+    int host_count;
+    kern_return_t kr;
+
+    host_count = sizeof(load_data)/sizeof(integer_t);
+    kr = host_statistics(host_priv_port, HOST_LOAD_INFO,
+                        (host_info_t)&load_data, &host_count);
+    if (kr != KERN_SUCCESS)
+        xload_error("cannot get host statistics", "");
+    *loadavg = (double)load_data.avenrun[0]/LOAD_SCALE;
+    return;
+}
+
+#else /* __DARWIN__ */
+
+#ifdef LOADSTUB
+
+void InitLoadPoint()
+{
+}
+
+/* ARGSUSED */
+void GetLoadPoint( w, closure, call_data )
+     Widget    w;              /* unused */
+     XtPointer closure;        /* unused */
+     XtPointer call_data;      /* pointer to (double) return value */
+{
+       *(double *)call_data = 1.0;
+}
+
+#else /* not LOADSTUB */
+
+#ifdef __osf__
+
+void InitLoadPoint()
+{
+}
+
+/*ARGSUSED*/
+void GetLoadPoint( w, closure, call_data )
+     Widget   w;              /* unused */
+     XtPointer  closure;        /* unused */
+     XtPointer  call_data;      /* pointer to (double) return value */
+{
+    double *loadavg = (double *)call_data;
+    struct tbl_loadavg load_data;
+
+    if (table(TBL_LOADAVG, 0, (char *)&load_data, 1, sizeof(load_data)) < 0)
+       xload_error("error reading load average", "");
+    *loadavg = (load_data.tl_lscale == 0) ?
+       load_data.tl_avenrun.d[WHICH_AVG] :
+       load_data.tl_avenrun.l[WHICH_AVG] / (double)load_data.tl_lscale;
+}
+
+#else /* not __osf__ */
+
+#ifdef __QNXNTO__
+#include <time.h>
+#include <sys/neutrino.h>
+static _Uint64t          nto_idle = 0, nto_idle_last = 0;
+static  int       nto_idle_id;
+static  struct timespec nto_now, nto_last;
+
+void
+InitLoadPoint()
+{
+  nto_idle_id = ClockId(1, 1); /* Idle thread */
+  ClockTime(nto_idle_id, NULL, &nto_idle_last);
+  clock_gettime( CLOCK_REALTIME, &nto_last);
+}
+
+/* ARGSUSED */
+void
+GetLoadPoint( w, closure, call_data )           /* QNX NTO version */
+Widget  w;              /* unused */
+XtPointer closure;      /* unused */
+XtPointer call_data;    /* pointer to (double) return value */
+{
+    double *loadavg = (double *)call_data;
+    double timediff;
+    double temp = 0.0;
+
+    ClockTime(nto_idle_id, NULL, &nto_idle);
+    clock_gettime( CLOCK_REALTIME, &nto_now);
+    timediff = 1000000000.0 * (nto_now.tv_sec - nto_last.tv_sec)
+               + (nto_now.tv_nsec - nto_last.tv_nsec);
+    temp = 1.0 - (nto_idle-nto_idle_last)/timediff;
+    *loadavg = temp >= 0 ? temp : 0;
+    nto_idle_last = nto_idle;
+    nto_last = nto_now;
+}
+#else /* not __QNXNTO__ */
+
+#ifdef __bsdi__
+#include <kvm.h>
+
+static struct nlist nl[] = {
+  { "_averunnable" },
+#define X_AVERUNNABLE 0
+  { "_fscale" },
+#define X_FSCALE      1
+  { "" },
+};
+static kvm_t *kd;
+static int fscale;
+
+void InitLoadPoint()
+{
+  fixpt_t averunnable[3];  /* unused really */
+
+  if ((kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, NULL)) == NULL)
+    xload_error("can't open kvm files", "");
+
+  if (kvm_nlist(kd, nl) != 0)
+    xload_error("can't read name list", "");
+
+  if (kvm_read(kd, (off_t)nl[X_AVERUNNABLE].n_value, (char *)averunnable,
+              sizeof(averunnable)) != sizeof(averunnable))
+    xload_error("couldn't obtain _averunnable variable", "");
+
+  if (kvm_read(kd, (off_t)nl[X_FSCALE].n_value, (char *)&fscale,
+              sizeof(fscale)) != sizeof(fscale))
+    xload_error("couldn't obtain _fscale variable", "");
+
+  return;
+}
+
+void GetLoadPoint(w, closure, call_data)
+     Widget w;          /* unused */
+     XtPointer closure;   /* unused */
+     XtPointer call_data; /* ptr to (double) return value */
+{
+  double *loadavg = (double *)call_data;
+  fixpt_t t;
+
+  if (kvm_read(kd, (off_t)nl[X_AVERUNNABLE].n_value, (char *)&t,
+              sizeof(t)) != sizeof(t))
+    xload_error("couldn't obtain load average", "");
+
+  *loadavg = (double)t/fscale;
+
+  return;
+}
+
+#else /* not __bsdi__ */
+#if defined(BSD) && (BSD >= 199306)
+#include <stdlib.h>
+
+void InitLoadPoint()
+{
+}
+
+void GetLoadPoint(w, closure, call_data)
+     Widget w;          /* unused */
+     XtPointer closure;   /* unused */
+     XtPointer call_data; /* ptr to (double) return value */
+{
+  double *loadavg = (double *)call_data;
+
+  if (getloadavg(loadavg, 1) < 0) 
+    xload_error("couldn't obtain load average", "");
+}
+
+#else /* not BSD >= 199306 */
+#if defined(sun) && defined(HAVE_LIBKSTAT)
+
+static kstat_t         *ksp;
+static kstat_ctl_t     *kc;
+
+void
+InitLoadPoint(void)
+{
+       if ((kc = kstat_open()) == NULL)
+               xload_error("kstat_open failed:", strerror(errno));
+
+       if ((ksp = kstat_lookup(kc, "unix", 0, "system_misc")) == NULL)
+               xload_error("kstat_lookup failed:", strerror(errno));
+}
+
+void
+GetLoadPoint(Widget w, XtPointer closure, XtPointer call_data)
+{
+       kstat_named_t *vp;
+       double *loadavg = (double *)call_data;
+
+       if (kstat_read(kc, ksp, NULL) == -1)
+               xload_error("kstat_read failed:", strerror(errno));
+
+       if ((vp = kstat_data_lookup(ksp, "avenrun_1min")) == NULL)
+               xload_error("kstat_data_lookup failed:", strerror(errno));
+
+       *loadavg = (double)vp->value.l / FSCALE;
+}
+#else /* not Solaris */
+
+#ifndef KMEM_FILE
+#define KMEM_FILE "/dev/kmem"
+#endif
+
+#ifndef KERNEL_FILE
+
+#ifdef alliant
+#define KERNEL_FILE "/vmunix"
+#endif /* alliant */
+
+#ifdef CRAY
+#define KERNEL_FILE "/unicos"
+#endif /* CRAY */
+
+#ifdef hpux
+#define KERNEL_FILE "/hp-ux"
+#endif /* hpux */
+
+#ifdef macII
+#define KERNEL_FILE "/unix"
+#endif /* macII */
+
+#ifdef umips
+# ifdef SYSTYPE_SYSV
+# define KERNEL_FILE "/unix"
+# else
+# define KERNEL_FILE "/vmunix"
+# endif /* SYSTYPE_SYSV */
+#endif /* umips */
+
+#ifdef sequent
+#define KERNEL_FILE "/dynix"
+#endif /* sequent */
+
+#ifdef hcx
+#define KERNEL_FILE "/unix"
+#endif /* hcx */
+
+#ifdef MOTOROLA
+#if defined(SYSV) && defined(m68k)
+#define KERNEL_FILE "/sysV68"
+#endif
+#if defined(SYSV) && defined(m88k)
+#define KERNEL_FILE "/unix"
+#endif
+#ifdef SVR4
+#define KERNEL_FILE "/unix"
+#endif
+#endif /* MOTOROLA */
+
+#if defined(sun) && defined(SVR4)
+#define KERNEL_FILE "/kernel/unix"
+#endif
+
+#ifdef sgi
+#if (OSMAJORVERSION > 4)
+#define KERNEL_FILE "/unix"
+#endif
+#endif
+
+/*
+ * provide default for everyone else
+ */
+#ifndef KERNEL_FILE
+#ifdef SVR4
+#define KERNEL_FILE "/stand/unix"
+#else
+#ifdef SYSV
+#define KERNEL_FILE "/unix"
+#else
+/* If a BSD system, check in <paths.h> */
+#   ifdef BSD
+#    include <paths.h>
+#    ifdef _PATH_UNIX
+#     define KERNEL_FILE _PATH_UNIX
+#    else
+#     ifdef _PATH_KERNEL
+#      define KERNEL_FILE _PATH_KERNEL
+#     else
+#      define KERNEL_FILE "/vmunix"
+#     endif
+#    endif
+#   else /* BSD */
+#    define KERNEL_FILE "/vmunix"
+#   endif /* BSD */
+#endif /* SYSV */
+#endif /* SVR4 */
+#endif /* KERNEL_FILE */
+#endif /* KERNEL_FILE */
+
+
+#ifndef KERNEL_LOAD_VARIABLE
+#    if defined(BSD) && (BSD >= 199103)
+#        define KERNEL_LOAD_VARIABLE "_averunnable"
+#    endif /* BSD >= 199103 */
+
+#    ifdef alliant
+#        define KERNEL_LOAD_VARIABLE "_Loadavg"
+#    endif /* alliant */
+
+#    ifdef CRAY
+#        if defined(CRAY2) && OSMAJORVERSION == 4
+#            define KERNEL_LOAD_VARIABLE "avenrun"
+#        else
+#            define KERNEL_LOAD_VARIABLE "sysinfo"
+#            define SYSINFO
+#        endif /* defined(CRAY2) && OSMAJORVERSION == 4 */
+#    endif /* CRAY */
+
+#    ifdef hpux
+#        ifdef __hp9000s800
+#            define KERNEL_LOAD_VARIABLE "avenrun"
+#        endif /* hp9000s800 */
+#    endif /* hpux */
+
+#    ifdef umips
+#        ifdef SYSTYPE_SYSV
+#            define KERNEL_LOAD_VARIABLE "avenrun"
+#        else
+#            define KERNEL_LOAD_VARIABLE "_avenrun"
+#        endif /* SYSTYPE_SYSV */
+#    endif /* umips */
+
+#    ifdef sgi
+#       define KERNEL_LOAD_VARIABLE "avenrun"
+#    endif /* sgi */
+
+#    ifdef AIXV3
+#        define KERNEL_LOAD_VARIABLE "sysinfo"
+#    endif /* AIXV3 */
+
+#    ifdef MOTOROLA
+#        if defined(SYSV) && defined(m68k)
+#            define KERNEL_LOAD_VARIABLE "sysinfo"
+#        endif
+#        if defined(SYSV) && defined(m88k)
+#            define KERNEL_LOAD_VARIABLE "_sysinfo"
+#        endif
+#        ifdef SVR4
+#            define KERNEL_LOAD_VARIABLE "avenrun"
+#        endif
+#    endif /* MOTOROLA */
+
+#endif /* KERNEL_LOAD_VARIABLE */
+
+/*
+ * provide default for everyone else
+ */
+
+#ifndef KERNEL_LOAD_VARIABLE
+#    ifdef USG
+#        define KERNEL_LOAD_VARIABLE "sysinfo"
+#        define SYSINFO
+#    else
+#    ifdef SVR4
+#        define KERNEL_LOAD_VARIABLE "avenrun"
+#    else
+#        define KERNEL_LOAD_VARIABLE "_avenrun"
+#    endif
+#    endif
+#endif /* KERNEL_LOAD_VARIABLE */
+
+#ifdef macII
+static struct var v;
+static int pad[2];     /* This padding is needed if xload compiled on */
+                       /* a/ux 1.1 is executed on a/ux 1.0, because */
+                       /* the var structure had too much padding in 1.0, */
+                       /* so the 1.0 kernel writes past the end of the 1.1 */
+                       /* var structure in the uvar() call. */
+static struct nlist nl[2];
+static struct lavnum vec[3];
+#else /* not macII */
+static struct nlist namelist[] = {         /* namelist for vmunix grubbing */
+#define LOADAV 0
+    {KERNEL_LOAD_VARIABLE},
+    {0}
+};
+#endif /* macII */
+
+static int kmem;
+static long loadavg_seek;
+
+void InitLoadPoint()
+{
+#ifdef macII
+    extern nlist();
+
+    int i;
+
+    strcpy(nl[0].n_name, "avenrun");
+    nl[1].n_name[0] = '\0';
+
+    kmem = open(KMEM_FILE, O_RDONLY);
+    if (kmem < 0) {
+       xload_error("cannot open", KMEM_FILE);
+    }
+
+    uvar(&v);
+
+    if (nlist( KERNEL_FILE, nl) != 0) {
+       xload_error("cannot get name list from", KERNEL_FILE);
+    }
+    for (i = 0; i < 2; i++) {
+       nl[i].n_value = (int)nl[i].n_value - v.v_kvoffset;
+    }
+#else /* not macII */
+#if !defined(SVR4) && !defined(sgi) && !defined(MOTOROLA) && !defined(AIXV5) && !(BSD >= 199103)
+    extern void nlist();
+#endif
+
+#ifdef AIXV3
+    knlist( namelist, 1, sizeof(struct nlist));
+#else  
+    nlist( KERNEL_FILE, namelist);
+#endif
+    /*
+     * Some systems appear to set only one of these to Zero if the entry could
+     * not be found, I hope no_one returns Zero as a good value, or bad things
+     * will happen to you.  (I have a hard time believing the value will
+     * ever really be zero anyway).   CDP 5/17/89.
+     */
+#ifdef hcx
+    if (namelist[LOADAV].n_type == 0 &&
+#else
+    if (namelist[LOADAV].n_type == 0 ||
+#endif /* hcx */
+       namelist[LOADAV].n_value == 0) {
+       xload_error("cannot get name list from", KERNEL_FILE);
+       exit(-1);
+    }
+    loadavg_seek = namelist[LOADAV].n_value;
+#if defined(umips) && defined(SYSTYPE_SYSV)
+    loadavg_seek &= 0x7fffffff;
+#endif /* umips && SYSTYPE_SYSV */
+#if (defined(CRAY) && defined(SYSINFO))
+    loadavg_seek += ((char *) (((struct sysinfo *)NULL)->avenrun)) -
+       ((char *) NULL);
+#endif /* CRAY && SYSINFO */
+    kmem = open(KMEM_FILE, O_RDONLY);
+    if (kmem < 0) xload_error("cannot open", KMEM_FILE);
+#endif /* macII else */
+}
+
+/* ARGSUSED */
+void GetLoadPoint( w, closure, call_data )
+     Widget    w;              /* unused */
+     XtPointer closure;        /* unused */
+     XtPointer call_data;      /* pointer to (double) return value */
+{
+       double *loadavg = (double *)call_data;
+
+#ifdef macII
+       lseek(kmem, (long)nl[X_AVENRUN].n_value, 0);
+#else
+       (void) lseek(kmem, loadavg_seek, 0);
+#endif
+
+#if defined(sun) || defined (UTEK) || defined(sequent) || defined(alliant) || defined(SVR4) || defined(sgi) || defined(hcx) || (BSD >= 199103)
+       {
+               long temp;
+               (void) read(kmem, (char *)&temp, sizeof(long));
+               *loadavg = (double)temp/FSCALE;
+       }
+#else /* else not sun or UTEK or sequent or alliant or SVR4 or sgi or hcx */
+# ifdef macII
+        {
+                read(kmem, vec, 3*sizeof(struct lavnum));
+                *loadavg = fxtod(0);
+        }
+# else /* else not macII */
+#  if defined(umips) || (defined(ultrix) && defined(mips))
+       {
+               fix temp;
+               (void) read(kmem, (char *)&temp, sizeof(fix));
+               *loadavg = FIX_TO_DBL(temp);
+       }
+#  else /* not umips or ultrix risc */
+#    ifdef AIXV3
+        {
+          struct sysinfo sysinfo_now;
+          struct sysinfo sysinfo_last;
+          static firsttime = TRUE;
+          static double runavg = 0.0, swpavg = 0.0;
+
+          (void) lseek(kmem, loadavg_seek, 0);
+          (void) read(kmem, (char *)&sysinfo_last, sizeof(struct sysinfo));
+          if (firsttime)
+            {
+              *loadavg = 0.0;
+              firsttime = FALSE;
+            }
+          else
+            {
+              sleep(1);
+              (void) lseek(kmem, loadavg_seek, 0);
+              (void) read(kmem, (char *)&sysinfo_now, sizeof(struct sysinfo));
+              runavg *= 0.8; swpavg *= 0.8;
+              if (sysinfo_now.runocc != sysinfo_last.runocc)
+                runavg += 0.2*((sysinfo_now.runque - sysinfo_last.runque - 1)
+                          /(double)(sysinfo_now.runocc - sysinfo_last.runocc));
+              if (sysinfo_now.swpocc != sysinfo_last.swpocc)
+                swpavg += 0.2*((sysinfo_now.swpque - sysinfo_last.swpque)
+                          /(double)(sysinfo_now.swpocc - sysinfo_last.swpocc));
+              *loadavg = runavg + swpavg;
+              sysinfo_last = sysinfo_now;
+            }
+          /* otherwise we leave load alone. */
+        }
+#    else /* not AIXV3 */
+#      if defined(MOTOROLA) && defined(SYSV)
+       {
+        static int init = 0;
+        static kmem;
+        static long loadavg_seek;
+
+#define CEXP    0.25            /* Constant used for load averaging */
+
+        struct sysinfo sysinfod;
+        static double oldloadavg;
+        static double cexp = CEXP;
+        static long sv_rq, sv_oc;   /* save old values */
+        double rq, oc;              /* amount values have changed */
+
+        if (!init)
+        {
+            if (nlist(KERNEL_FILE,namelist) == -1)
+            {
+                perror("xload: nlist()");
+                xload_error("cannot get name list from", KERNEL_FILE);
+            }
+            loadavg_seek = namelist[0].n_value;
+
+            kmem = open(KMEM_FILE, O_RDONLY);
+            if (kmem < 0)
+            {
+                perror("xload: open()");
+                xload_error("cannot open", KMEM_FILE);
+            }
+        }
+
+        lseek(kmem, loadavg_seek, 0);
+        if (read(kmem, &sysinfod, (int) sizeof (struct sysinfo)) == -1)
+        {
+             perror("xload: read() SYSINFONL");
+             xload_error("read failed from", KMEM_FILE);
+        }
+
+        if (!init)
+        {
+            init = 1;
+            sv_rq = sysinfod.runque;
+            sv_oc = sysinfod.runocc;
+            oldloadavg = *loadavg = 0.0;
+            return;
+        }
+        /*
+         * calculate the amount the values have
+         * changed since last update
+         */
+        rq = (double) sysinfod.runque - sv_rq;
+        oc = (double) sysinfod.runocc - sv_oc;
+
+        /*
+         * save old values for next time
+         */
+        sv_rq = sysinfod.runque;
+        sv_oc = sysinfod.runocc;
+
+        if (oc == 0.0)          /* avoid divide by zero  */
+        {
+                *loadavg = (1.0 - cexp) * oldloadavg;
+
+        }
+        else
+        {
+                *loadavg = ((1.0 - cexp) * oldloadavg) + ((rq / oc) * cexp);
+        }
+        oldloadavg = *loadavg;
+       }
+#      else /* not MOTOROLA */
+#     if defined(sony) && OSMAJORVERSION == 4
+#      ifdef mips
+       {
+               fix temp;
+               (void) read(kmem, (char *)&temp, sizeof(fix));
+               *loadavg = FIX_TO_DBL(temp);
+       }
+#      else /* not mips */
+       {
+               long temp;
+               (void) read(kmem, (char *)&temp, sizeof(long));
+               *loadavg = (double)temp/FSCALE;
+       }
+#      endif /* mips */
+#     else /* not sony NEWSOS4 */
+       (void) read(kmem, (char *)loadavg, sizeof(double));
+#      endif /* sony NEWOS4 */
+#     endif /* MOTOROLA else */
+#    endif /* AIXV3 else */
+#  endif /* umips else */
+# endif /* macII else */
+#endif /* sun or SVR4 or ... else */   
+       return;
+}
+#endif /* sun else */
+#endif /* BSD >= 199306 else */
+#endif /* __bsdi__ else */
+#endif /* __QNXNTO__ else */
+#endif /* __osf__ else */
+#endif /* LOADSTUB else */
+#endif /* __DARWIN__ else */
+#endif /* __GNU__ else */
+#endif /* linux else */
+#endif /* KVM_ROUTINES else */
+#endif /* SYSV && i386 else */
+
+void xload_error(str1, str2)
+char *str1, *str2;
+{
+    (void) fprintf(stderr,"xload: %s %s\n", str1, str2);
+#ifdef __bsdi__
+    if (kd)
+       kvm_close(kd);
+#endif
+    exit(-1);
+}
+
+#endif /* apollo else */
+
+#else /* !DGUX */
+
+/* INTEL DGUX Release 4.20MU04
+ * Copyright 1999 Takis Psarogiannakopoulos
+ * Cambridge, UK
+ * <takis@dpmms.cam.ac.uk>
+ */
+
+#include <errno.h>
+#include <nlist.h>
+#include <sys/dg_sys_info.h>
+
+static struct dg_sys_info_load_info load_info;  /* DG/ux */
+
+#define KERNEL_FILE "/dgux"
+#define LDAV_SYMBOL "_avenrun"
+
+void InitLoadPoint()
+{
+
+}
+
+void GetLoadPoint(w, closure, call_data)
+     Widget w;          /* unused */
+     XtPointer closure;   /* unused */
+     XtPointer call_data; /* ptr to (double) return value */
+{
+  double *loadavg = (double *)call_data;
+
+  if (getloadavg(loadavg, 1) < 0)
+    xload_error("couldn't obtain load average", "");
+}
+
+xload_error(str1, str2)
+char *str1, *str2;
+{
+    (void) fprintf(stderr,"xload: %s %s\n", str1, str2);
+    exit(-1);
+}
+
+#if !defined (LDAV_CVT) && defined (FSCALE)
+#define LDAV_CVT(n) (((double) (n)) / FSCALE)
+#endif
+#if !defined(LDAV_CVT) && defined(LOAD_AVE_CVT)
+#define LDAV_CVT(n) (LOAD_AVE_CVT (n) / 100.0)
+#endif
+#define LOAD_AVE_TYPE double
+#ifndef LDAV_CVT
+#define LDAV_CVT(n) ((double) (n))
+#endif /* !LDAV_CVT */
+static int channel;
+static int getloadavg_initialized;
+static long offset;
+static struct nlist nl[2];
+
+
+/* GETLOADAVG FUNCTION FOR DG/ux R4.20MU04 */
+
+int
+getloadavg (double loadavg[], int nelem)
+{
+  int elem = 0;                 /* Return value.  */
+  int result =0 ;
+
+  /* This call can return -1 for an error, but with good args
+     it's not supposed to fail.  The first argument is for no
+     apparent reason of type `long int *'.  */
+  result = dg_sys_info ((long int *) &load_info,
+               DG_SYS_INFO_LOAD_INFO_TYPE, DG_SYS_INFO_LOAD_VERSION_0);
+  if ( result == -1)
+  {
+     return(-1);
+  }
+  if (nelem > 0)
+    loadavg[elem++] = load_info.one_minute;
+  if (nelem > 1)
+    loadavg[elem++] = load_info.five_minute;
+  if (nelem > 2)
+    loadavg[elem++] = load_info.fifteen_minute;
+
+  return elem;
+}
+
+#endif /* END OF DG/ux */
+
+
+#endif /* END of __CYGWIN__ */
diff --git a/xload/get_rload.c b/xload/get_rload.c
new file mode 100644 (file)
index 0000000..9629d01
--- /dev/null
@@ -0,0 +1,76 @@
+/* $XFree86: xc/programs/xload/get_rload.c,v 1.4 2002/01/07 20:38:31 dawes Exp $ */
+
+#include <stdio.h>
+#include <X11/Intrinsic.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "xload.h"
+
+/* Not all OS supports get_rload
+   steal the STUB idea from get_load
+ */
+#if defined(QNX4) || defined(__CYGWIN__)
+#define RLOADSTUB
+#endif
+
+#ifdef RLOADSTUB
+void GetRLoadPoint( w, closure, call_data )
+     Widget   w;              /* unused */
+     XtPointer  closure;        /* unused */
+     XtPointer  call_data;      /* pointer to (double) return value */
+
+{
+  *(double *)call_data = 1.0;
+}
+#else  /* RLOADSTUB */
+
+#include <protocols/rwhod.h>
+#ifndef _PATH_RWHODIR
+#define _PATH_RWHODIR "/var/spool/rwho"
+#endif
+
+typedef struct _XLoadResources {
+  Boolean show_label;
+  Boolean use_lights;
+  String remote;
+} XLoadResources;
+
+extern XLoadResources resources ;
+
+#define WHDRSIZE        ((int)(sizeof (buf) - sizeof (buf.wd_we)))
+
+void GetRLoadPoint( w, closure, call_data )
+     Widget   w;              /* unused */
+     XtPointer  closure;        /* unused */
+     XtPointer  call_data;      /* pointer to (double) return value */
+
+{
+  int f;
+  static char *fname = NULL;
+  static struct whod buf;
+  int cc;
+
+  *(double *)call_data = 0.0; /* to be on the safe side */
+
+  if (fname == NULL) {
+    if ((fname = malloc(strlen(_PATH_RWHODIR)+strlen("/whod.")+strlen(resources.remote)+1)) == NULL) {
+      fprintf(stderr,"GetRLoadPoint: malloc() failed\n");
+      exit(1);
+    }
+    strcpy(fname,_PATH_RWHODIR);
+    strcat(fname,"/whod.");
+    strcat(fname,resources.remote);
+  }
+  if ((f = open(fname, O_RDONLY, 0)) < 0)
+    return;
+
+  cc = read(f, &buf, sizeof(buf));
+  close(f);
+  if (cc < WHDRSIZE)
+    return;
+
+  *(double *)call_data = buf.wd_loadav[0] / 100.0;
+}
+
+#endif  /* RLOADSTUB */
diff --git a/xload/install-sh b/xload/install-sh
new file mode 100755 (executable)
index 0000000..4d4a951
--- /dev/null
@@ -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/xload/missing b/xload/missing
new file mode 100755 (executable)
index 0000000..894e786
--- /dev/null
@@ -0,0 +1,360 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2005-06-08.21
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
+#   Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try \`$0 --help' for more information"
+  exit 1
+fi
+
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+  configure_ac=configure.ac
+else
+  configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case "$1" in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  # Exit code 63 means version mismatch.  This often happens
+  # when the user try to use an ancient version of a tool on
+  # a file that requires a minimum version.  In this case we
+  # we should proceed has if the program had been absent, or
+  # if --run hadn't been passed.
+  if test $? = 63; then
+    run=:
+    msg="probably too old"
+  fi
+  ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+  aclocal      touch file \`aclocal.m4'
+  autoconf     touch file \`configure'
+  autoheader   touch file \`config.h.in'
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Now exit if we have it, but it failed.  Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case "$1" in
+  lex|yacc)
+    # Not GNU programs, they don't have --version.
+    ;;
+
+  tar)
+    if test -n "$run"; then
+       echo 1>&2 "ERROR: \`tar' requires --run"
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       exit 1
+    fi
+    ;;
+
+  *)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       # Could not run --version or --help.  This is probably someone
+       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # $TOOL exists and not knowing $TOOL uses missing.
+       exit 1
+    fi
+    ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+  aclocal*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
+         to install the \`Automake' and \`Perl' packages.  Grab them from
+         any GNU archive site."
+    touch aclocal.m4
+    ;;
+
+  autoconf)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`${configure_ac}'.  You might want to install the
+         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+         archive site."
+    touch configure
+    ;;
+
+  autoheader)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site."
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z "$files" && files="config.h"
+    touch_files=
+    for f in $files; do
+      case "$f" in
+      *:*) touch_files="$touch_files "`echo "$f" |
+                                      sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files="$touch_files $f.in";;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site."
+    find . -type f -name Makefile.am -print |
+          sed 's/\.am$/.in/' |
+          while read f; do touch "$f"; done
+    ;;
+
+  autom4te)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1' as part of \`Autoconf' from any GNU
+         archive site."
+
+    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo "#! /bin/sh"
+       echo "# Created by GNU Automake missing as a replacement of"
+       echo "#  $ $@"
+       echo "exit 0"
+       chmod +x $file
+       exit 1
+    fi
+    ;;
+
+  bison|yacc)
+    echo 1>&2 "\
+WARNING: \`$1' $msg.  You should only need it if
+         you modified a \`.y' file.  You may need the \`Bison' package
+         in order for those modifications to take effect.  You can get
+         \`Bison' from any GNU archive site."
+    rm -f y.tab.c y.tab.h
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+       case "$LASTARG" in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if [ -f "$SRCFILE" ]; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if [ -f "$SRCFILE" ]; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if [ ! -f y.tab.h ]; then
+       echo >y.tab.h
+    fi
+    if [ ! -f y.tab.c ]; then
+       echo 'main() { return 0; }' >y.tab.c
+    fi
+    ;;
+
+  lex|flex)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.l' file.  You may need the \`Flex' package
+         in order for those modifications to take effect.  You can get
+         \`Flex' from any GNU archive site."
+    rm -f lex.yy.c
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+       case "$LASTARG" in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if [ -f "$SRCFILE" ]; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if [ ! -f lex.yy.c ]; then
+       echo 'main() { return 0; }' >lex.yy.c
+    fi
+    ;;
+
+  help2man)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+        you modified a dependency of a manual page.  You may need the
+        \`Help2man' package in order for those modifications to take
+        effect.  You can get \`Help2man' from any GNU archive site."
+
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+       file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+    fi
+    if [ -f "$file" ]; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit 1
+    fi
+    ;;
+
+  makeinfo)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.texi' or \`.texinfo' file, or any other file
+         indirectly affecting the aspect of the manual.  The spurious
+         call might also be the consequence of using a buggy \`make' (AIX,
+         DU, IRIX).  You might want to install the \`Texinfo' package or
+         the \`GNU make' package.  Grab either from any GNU archive site."
+    # The file to touch is that specified with -o ...
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+      # ... or it is derived from the source name (dir/f.texi becomes f.info)
+      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+    fi
+    # If the file does not exist, the user really needs makeinfo;
+    # let's fail without touching anything.
+    test -f $file || exit 1
+    touch $file
+    ;;
+
+  tar)
+    shift
+
+    # We have already tried tar in the generic part.
+    # Look for gnutar/gtar before invocation to avoid ugly error
+    # messages.
+    if (gnutar --version > /dev/null 2>&1); then
+       gnutar "$@" && exit 0
+    fi
+    if (gtar --version > /dev/null 2>&1); then
+       gtar "$@" && exit 0
+    fi
+    firstarg="$1"
+    if shift; then
+       case "$firstarg" in
+       *o*)
+           firstarg=`echo "$firstarg" | sed s/o//`
+           tar "$firstarg" "$@" && exit 0
+           ;;
+       esac
+       case "$firstarg" in
+       *h*)
+           firstarg=`echo "$firstarg" | sed s/h//`
+           tar "$firstarg" "$@" && exit 0
+           ;;
+       esac
+    fi
+
+    echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         You may want to install GNU tar or Free paxutils, or check the
+         command line arguments."
+    exit 1
+    ;;
+
+  *)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.  Check the \`README' file,
+         it often tells you about the needed prerequisites for installing
+         this package.  You may also peek at any GNU archive site, in case
+         some other package would contain this missing \`$1' program."
+    exit 1
+    ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/xload/xload.bit b/xload/xload.bit
new file mode 100644 (file)
index 0000000..b4b038a
--- /dev/null
@@ -0,0 +1,16 @@
+#define xload_width 32
+#define xload_height 32
+#define xload_x_hot 15
+#define xload_y_hot 16
+static unsigned char xload_bits[] = {
+   0x00, 0x00, 0xc0, 0x03, 0x1e, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xf8, 0x03,
+   0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0xfe, 0x03,
+   0xff, 0xff, 0xff, 0xff, 0x00, 0x80, 0xff, 0x03, 0x00, 0xc0, 0xff, 0x03,
+   0xff, 0xff, 0xff, 0xff, 0x00, 0xe0, 0xff, 0x03, 0x00, 0xf0, 0xff, 0x03,
+   0xff, 0xff, 0xff, 0xff, 0x00, 0xf8, 0xff, 0x03, 0x00, 0xf8, 0xff, 0x03,
+   0xff, 0xff, 0xff, 0xff, 0x00, 0xfc, 0xff, 0x03, 0x00, 0xfc, 0xff, 0x03,
+   0xff, 0xff, 0xff, 0xff, 0x00, 0xfe, 0xff, 0x03, 0x00, 0xfe, 0xff, 0x03,
+   0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0x03, 0x00, 0xff, 0xff, 0x03,
+   0xff, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0x03, 0xc0, 0xff, 0xff, 0x03,
+   0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0x03,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03};
diff --git a/xload/xload.c b/xload/xload.c
new file mode 100644 (file)
index 0000000..2dc1cb3
--- /dev/null
@@ -0,0 +1,342 @@
+/* $XConsortium: xload.c,v 1.37 94/04/17 20:43:44 converse Exp $ */
+/* $XFree86: xc/programs/xload/xload.c,v 1.6tsi Exp $ */
+/*
+
+Copyright (c) 1989  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+
+/*
+ * xload - display system load average in a window
+ */
+
+#include <errno.h>
+#include <stdio.h> 
+#include <stdlib.h>
+#include <unistd.h>
+#include <X11/Intrinsic.h>
+#include <X11/Xatom.h>
+#include <X11/StringDefs.h>
+#include <X11/Shell.h>
+
+#include <X11/Xaw/Cardinals.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/Paned.h>
+#include <X11/Xaw/StripChart.h>
+#include <X11/Xmu/SysUtil.h>
+#include "xload.h"
+
+#include "xload.bit"
+
+char *ProgramName;
+
+static void quit(Widget w, XEvent *event, String *params, Cardinal *num_params);
+static void ClearLights(Display *dpy);
+static void SetLights(XtPointer data, XtIntervalId *timer);
+
+/*
+ * Definition of the Application resources structure.
+ */
+
+typedef struct _XLoadResources {
+  Boolean show_label;
+  Boolean use_lights;
+  String remote;
+} XLoadResources;
+
+/*
+ * Command line options table.  Only resources are entered here...there is a
+ * pass over the remaining options after XtParseCommand is let loose. 
+ */
+
+static XrmOptionDescRec options[] = {
+ {"-scale",            "*load.minScale",       XrmoptionSepArg,        NULL},
+ {"-update",           "*load.update",         XrmoptionSepArg,        NULL},
+ {"-hl",               "*load.highlight",      XrmoptionSepArg,        NULL},
+ {"-highlight",                "*load.highlight",      XrmoptionSepArg,        NULL},
+ {"-label",            "*label.label",         XrmoptionSepArg,        NULL},
+ {"-nolabel",          "*showLabel",           XrmoptionNoArg,       "False"},
+ {"-lights",           "*useLights",           XrmoptionNoArg,       "True"},
+ {"-jumpscroll",       "*load.jumpScroll",     XrmoptionSepArg,        NULL},
+ {"-remote",            "*remote",              XrmoptionSepArg,        NULL},
+};
+
+/*
+ * The structure containing the resource information for the
+ * Xload application resources.
+ */
+
+#define Offset(field) (XtOffsetOf(XLoadResources, field))
+
+static XtResource my_resources[] = {
+  {"showLabel", XtCBoolean, XtRBoolean, sizeof(Boolean),
+     Offset(show_label), XtRImmediate, (XtPointer) TRUE},
+  {"useLights", XtCBoolean, XtRBoolean, sizeof(Boolean),
+    Offset(use_lights), XtRImmediate, (XtPointer) FALSE},
+  {"remote", XtCString, XtRString, sizeof(XtRString),
+    Offset(remote), XtRImmediate, (XtPointer) FALSE},
+
+};
+
+#undef Offset
+
+XLoadResources resources;
+
+static XtActionsRec xload_actions[] = {
+    { "quit",  quit },
+};
+static Atom wm_delete_window;
+static int light_update = 10 * 1000;
+
+/*
+ * Exit with message describing command line format.
+ */
+
+static void usage(void)
+{
+    fprintf (stderr, "usage:  %s [-options ...]\n\n", ProgramName);
+    fprintf (stderr, "where options include:\n");
+    fprintf (stderr,
+      "    -display dpy            X server on which to display\n");
+    fprintf (stderr,
+      "    -geometry geom          size and location of window\n");
+    fprintf (stderr, 
+      "    -fn font                font to use in label\n");
+    fprintf (stderr, 
+      "    -scale number           minimum number of scale lines\n");
+    fprintf (stderr, 
+      "    -update seconds         interval between updates\n");
+    fprintf (stderr,
+      "    -label string           annotation text\n");
+    fprintf (stderr, 
+      "    -bg color               background color\n");
+    fprintf (stderr, 
+      "    -fg color               graph color\n");
+    fprintf (stderr, 
+      "    -hl color               scale and text color\n");
+    fprintf (stderr, 
+      "    -nolabel                removes the label from above the chart.\n");
+    fprintf (stderr, 
+      "    -jumpscroll value       number of pixels to scroll on overflow\n");
+    fprintf (stderr,
+      "    -remote host            remote host to monitor\n");
+    fprintf (stderr, "\n");
+    exit(1);
+}
+
+int
+main(int argc, char **argv)
+{
+    XtAppContext app_con;
+    Widget toplevel, load, pane, label_wid, load_parent;
+    Arg args[1];
+    Pixmap icon_pixmap = None;
+    char *label, host[256];
+
+    ProgramName = argv[0];
+
+    /* For security reasons, we reset our uid/gid after doing the necessary
+       system initialization and before calling any X routines. */
+    InitLoadPoint();
+    /* reset gid first while still (maybe) root */
+    if (setgid(getgid()) == -1) {
+           fprintf(stderr, "%s: setgid failed: %s\n", 
+               ProgramName, strerror(errno));
+           exit(1);
+    }
+    if (setuid(getuid()) == -1) {
+           fprintf(stderr, "%s: setuid failed: %s\n", 
+               ProgramName, strerror(errno));
+           exit(1);
+    }
+
+    XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
+
+    toplevel = XtAppInitialize(&app_con, "XLoad", options, XtNumber(options),
+                              &argc, argv, NULL, NULL, (Cardinal) 0);
+    if (argc != 1) usage();
+
+    XtGetApplicationResources( toplevel, (XtPointer) &resources, 
+                             my_resources, XtNumber(my_resources),
+                             NULL, (Cardinal) 0);
+    
+    if (resources.use_lights)
+    {
+       char        name[1024];
+       XrmString   type;
+       XrmValue    db_value;
+       XrmValue    int_value;
+       Bool        found = False;
+
+       (void) sprintf (name, "%s.paned.load.update", XtName(toplevel));
+       found = XrmGetResource (XtScreenDatabase(XtScreen(toplevel)),
+                               name, "XLoad.Paned.StripChart.Interval",
+                               &type, &db_value);
+       if (found) {
+           int_value.size = sizeof(int);
+           int_value.addr = (XPointer) &light_update;
+           found = XtConvertAndStore(toplevel, type, &db_value, XtRInt,
+                                     &int_value);
+           if (found) light_update *= 1000;
+       }
+       ClearLights (XtDisplay (toplevel));
+       SetLights ((XtPointer) toplevel, (XtIntervalId *) 0);
+    }
+    else
+    {
+       /*
+        * This is a hack so that f.delete will do something useful in this
+        * single-window application.
+        */
+       XtAppAddActions (app_con, xload_actions, XtNumber(xload_actions));
+       XtOverrideTranslations(toplevel,
+                       XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()"));
+    
+       XtSetArg (args[0], XtNiconPixmap, &icon_pixmap);
+       XtGetValues(toplevel, args, ONE);
+       if (icon_pixmap == None) {
+           XtSetArg(args[0], XtNiconPixmap, 
+                    XCreateBitmapFromData(XtDisplay(toplevel),
+                                          XtScreen(toplevel)->root,
+                                          (char *)xload_bits,
+                                          xload_width, xload_height));
+           XtSetValues (toplevel, args, ONE);
+       }
+    
+       if (resources.show_label) {
+         pane = XtCreateManagedWidget ("paned", panedWidgetClass,
+                                       toplevel, NULL, ZERO);
+    
+         label_wid = XtCreateManagedWidget ("label", labelWidgetClass,
+                                            pane, NULL, ZERO);
+         
+         XtSetArg (args[0], XtNlabel, &label);
+         XtGetValues(label_wid, args, ONE);
+         
+         if ( strcmp("label", label) == 0 ) {
+           (void) XmuGetHostname (host, 255);
+           XtSetArg (args[0], XtNlabel, host);
+           XtSetValues (label_wid, args, ONE);
+         }
+    
+         load_parent = pane;
+       }
+       else
+         load_parent = toplevel;
+    
+       load = XtCreateManagedWidget ("load", stripChartWidgetClass,
+                                     load_parent, NULL, ZERO);    
+    
+       if (resources.remote)
+         XtAddCallback(load, XtNgetValue, GetRLoadPoint, NULL);
+       else 
+         XtAddCallback(load, XtNgetValue, GetLoadPoint, NULL);
+       
+       XtRealizeWidget (toplevel);
+       wm_delete_window = XInternAtom (XtDisplay(toplevel), "WM_DELETE_WINDOW",
+                                       False);
+       (void) XSetWMProtocols (XtDisplay(toplevel), XtWindow(toplevel),
+                               &wm_delete_window, 1);
+    }
+    XtAppMainLoop(app_con);
+
+    return 0;
+}
+
+static unsigned long   current_leds;
+
+static void
+ClearLights (dpy)
+    Display *dpy;
+{
+    XKeyboardControl   cntrl;
+
+    cntrl.led_mode = LedModeOff;
+    XChangeKeyboardControl (dpy, KBLedMode, &cntrl);
+    current_leds = 0;
+}
+
+static void
+SetLights (data, timer)
+    XtPointer      data;
+    XtIntervalId    *timer;
+{
+    Widget             toplevel;
+    Display            *dpy;
+    double             value;
+    unsigned long      new_leds, change, bit;
+    int                        i;
+    XKeyboardControl   cntrl;
+
+    toplevel = (Widget) data;
+    dpy = XtDisplay (toplevel);
+    if (resources.remote) 
+      GetRLoadPoint (toplevel, (XtPointer) 0, (XtPointer) &value);
+    else
+      GetLoadPoint (toplevel, (XtPointer) 0, (XtPointer) &value);
+    new_leds = (1 << (int) (value + 0.1)) - 1;
+    change = new_leds ^ current_leds;
+    i = 1;
+    bit = 1;
+    while (current_leds != new_leds)
+    {
+       if (change & bit)
+       {
+           cntrl.led = i;
+           cntrl.led_mode = new_leds & bit ? LedModeOn : LedModeOff;
+           XChangeKeyboardControl (dpy, KBLed|KBLedMode, &cntrl);
+           current_leds ^= bit;
+       }
+       i++;
+       bit <<= 1;
+    }
+    XtAppAddTimeOut(XtWidgetToApplicationContext(toplevel), light_update,
+                   SetLights, data);
+}
+
+static void quit (w, event, params, num_params)
+    Widget w;
+    XEvent *event;
+    String *params;
+    Cardinal *num_params;
+{
+    if (event->type == ClientMessage &&
+        event->xclient.data.l[0] != wm_delete_window) {
+        XBell (XtDisplay(w), 0);
+        return;
+    }
+    if (resources.use_lights)
+       ClearLights (XtDisplay (w));
+    XtDestroyApplicationContext(XtWidgetToApplicationContext(w));
+    exit (0);
+}
+
+
+
+
+
+
diff --git a/xload/xload.h b/xload/xload.h
new file mode 100644 (file)
index 0000000..d32383c
--- /dev/null
@@ -0,0 +1,12 @@
+/* $XFree86: xc/programs/xload/xload.h,v 1.1 2001/08/27 23:35:14 dawes Exp $ */
+
+#ifndef _XLOAD_H_
+#define _XLOAD_H_
+
+#include <X11/Intrinsic.h>
+
+extern void InitLoadPoint(void);
+extern void GetLoadPoint(Widget w, XtPointer closure, XtPointer call_data);
+extern void GetRLoadPoint(Widget w, XtPointer closure, XtPointer call_data);
+
+#endif
diff --git a/xload/xload.man b/xload/xload.man
new file mode 100644 (file)
index 0000000..4da1e77
--- /dev/null
@@ -0,0 +1,113 @@
+.\" $XConsortium: xload.man,v 1.29 94/04/17 20:43:44 matt Exp $
+.\"
+.\" $XFree86: xc/programs/xload/xload.man,v 1.4 2001/08/13 19:35:01 dawes Exp $
+.\"
+.TH XLOAD 1 __xorgversion__
+.SH NAME
+xload \- system load average display for X
+.SH SYNOPSIS
+.ta 6n
+\fBxload\fP    [-\fItoolkitoption\fP ...] [-scale \fIinteger\fP] [-update \fIseconds\fP] [-hl \fIcolor\fP] [-highlight \fIcolor\fP]  [-remote \fIhost\fP]
+.br
+       [-jumpscroll \fIpixels\fP] [-label \fIstring\fP] [-nolabel] [-lights]
+.SH DESCRIPTION
+The 
+.I xload 
+program displays a periodically updating histogram of the system load average.
+.SH OPTIONS
+.PP
+.I Xload
+accepts all of the standard X Toolkit command line options (see \fIX(__miscmansuffix__)\fP).
+The order of the options in unimportant.  \fIxload also accepts the
+following additional options:
+.PP
+.TP 8
+.B \-hl \fIcolor\fP or \-highlight \fIcolor\fP
+This option specifies the color of the scale lines.  
+.TP 8
+.B \-jumpscroll \fPnumber of pixels\fP
+The number of pixels to shift the graph to the left when the graph
+reaches the right edge of the window.  The default value is 1/2 the width
+of the current window.  Smooth scrolling can be achieved by setting it to 1.
+.TP 8
+.B \-label \fIstring\fP
+The string to put into the label above the load average.
+.TP 8
+.B \-nolabel
+If this command line option is specified then no label will be
+displayed above the load graph.
+.TP 8
+.B \-lights
+When specified, this option causes
+.I xload
+to display the current load average by using the keyboard leds; for
+a load average of \fIn\fP, xload lights the first \fIn\fP keyboard leds.
+This option turns off the usual screen display.
+.TP 8
+.B \-scale \fIinteger\fP
+This option specifies the minimum number of tick marks in the histogram,
+where one division represents one load average point.  If the load goes
+above this number, \fIxload\fP will create more divisions, but it will never
+use fewer than this number.  The default is 1.
+.PP
+.TP 8
+.B \-update \fIseconds\fP
+This option specifies the interval in seconds at which \fIxload\fP
+updates its display.  The minimum amount of time allowed between updates
+is 1 second.  The default is 10.
+.TP 8
+.B \-remote \fIhost\fP
+This option tells \fIxload\fP to display the load of \fIhost\fP instead of \fIlocalhost\fP. \fIXload\fP gets the information from the \fIrwhod\fP database and consequently requires \fIrwhod\fP to be executing both on \fIlocalhost\fP and \fIhost\fP.
+.SH RESOURCES
+In addition to the resources available to each of the widgets used by 
+\fIxload\fP there is one resource defined by the application itself.
+.TP 8
+.B showLabel (\fPclass\fB Boolean)
+If False then no label will be displayed.
+.SH WIDGETS
+In order to specify resources, it is useful to know the hierarchy of
+the widgets which compose \fIxload\fR.  In the notation below,
+indentation indicates hierarchical structure.  The widget class name
+is given first, followed by the widget instance name.
+.sp
+.nf
+.ta .5i 1.0i 1.5i 2.0i
+XLoad  xload
+       Paned  paned
+               Label  label
+               StripChart  load
+.fi
+.sp
+.SH ENVIRONMENT
+.PP
+.TP 8
+.B DISPLAY
+to get the default host and display number.
+.TP 8
+.B XENVIRONMENT
+to get the name of a resource file that overrides the global resources
+stored in the RESOURCE_MANAGER property.
+.SH FILES
+.TP
+.I __apploaddir__/XLoad
+specifies required resources
+.SH SEE ALSO
+X(__miscmansuffix__), xrdb(1), mem(4), Athena StripChart Widget.
+.SH BUGS
+This program requires the ability to open and read the special system
+file \fI/dev/kmem\fP.  Sites that do not allow general access to this file
+should make \fIxload\fP belong to the same group as \fI/dev/kmem\fP and
+turn on the \fIset group id\fP permission flag.
+.PP
+Reading /dev/kmem is inherently non-portable.  Therefore, the routine
+used to read it (get_load.c) must be ported to each new operating system. 
+.SH COPYRIGHT
+Copyright \(co X Consortium
+.br
+See \fIX(__miscmansuffix__)\fP for a full statement of rights and permissions.
+.SH AUTHORS
+K. Shane Hartman (MIT-LCS) and Stuart A. Malone (MIT-LCS);
+.br
+with features added by Jim Gettys (MIT-Athena), Bob Scheifler (MIT-LCS),
+Tony Della Fera (MIT-Athena), and Chris Peterson (MIT-LCS).
+DG/UX support by Takis Psarogiannakopoulos (XFree86 Project).
diff --git a/xlogo/COPYING b/xlogo/COPYING
new file mode 100644 (file)
index 0000000..7f33cbf
--- /dev/null
@@ -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/xlogo/ChangeLog b/xlogo/ChangeLog
new file mode 100644 (file)
index 0000000..240f198
--- /dev/null
@@ -0,0 +1,550 @@
+commit f826c5af5514da12ee146c61698d4545af391434
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Dec 10 22:33:05 2009 -0800
+
+    xlogo 1.0.2
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 3166b7e2e3013ca0d0c5b1679cdcb88f21384398
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Dec 10 22:32:35 2009 -0800
+
+    Add direct dependency on libXt, since xlogo calls Xt functions
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 02220d224d457aa070daf7603461b5d359780de4
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Dec 10 22:25:24 2009 -0800
+
+    Remove more leftover Xprint bits
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit fed17089fc586b6e762d121a34f2dbf95dd6433b
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Dec 10 22:23:18 2009 -0800
+
+    Strip old CVS id tags and trailing whitespaces
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit a3223e295cf840b7854a91c7e5577812edb11e62
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Dec 10 22:10:27 2009 -0800
+
+    Use AM_V_GEN to silence man page generation output
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 39313841d56ebe935d55190cc239ac66d072bb32
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Nov 26 09:19:54 2009 -0500
+
+    Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES
+    
+    Now that the INSTALL file is generated.
+    Allows running make maintainer-clean.
+
+commit 0f388329378b5e5fb4cbce3e76e0f7661ac326eb
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Wed Oct 28 14:09:08 2009 -0400
+
+    INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206
+    
+    Add missing INSTALL file. Use standard GNU file on building tarball
+    README may have been updated
+    Remove AUTHORS file as it is empty and no content available yet.
+    Remove NEWS file as it is empty and no content available yet.
+
+commit cc1220ace1ce5ff89e089603d912d9dd456066bf
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Tue Oct 27 15:07:25 2009 -0400
+
+    Deploy the new XORG_DEFAULT_OPTIONS #24242
+    
+    This macro aggregate a number of existing macros that sets commmon
+    X.Org components configuration options. It shields the configuration file from
+    future changes.
+
+commit 7e3e8c7f74d9ca2286001d53510668b02e75e25f
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Mon Oct 26 22:08:39 2009 -0400
+
+    Makefile.am: ChangeLog not required: EXTRA_DIST or *CLEANFILES #24432
+    
+    ChangeLog filename is known to Automake and requires no further
+    coding in the makefile.
+
+commit e5230ea7372b2d9672579f65752a1d2c7e65dab5
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Oct 22 12:34:15 2009 -0400
+
+    .gitignore: use common defaults with custom section # 24239
+    
+    Using common defaults will reduce errors and maintenance.
+    Only the very small or inexistent custom section need periodic maintenance
+    when the structure of the component changes. Do not edit defaults.
+
+commit 8e40f73c2a36680aec587b4be5971cea5141e13a
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Wed Oct 21 12:47:21 2009 -0700
+
+    This is not a GNU project, so declare it foreign.
+    
+    On Wed, 2009-10-21 at 13:36 +1000, Peter Hutterer wrote:
+    > On Tue, Oct 20, 2009 at 08:23:55PM -0700, Jeremy Huddleston wrote:
+    > > I noticed an INSTALL file in xlsclients and libXvMC today, and it
+    > > was quite annoying to work around since 'autoreconf -fvi' replaces
+    > > it and git wants to commit it.  Should these files even be in git?
+    > > Can I nuke them for the betterment of humanity and since they get
+    > > created by autoreconf anyways?
+    >
+    > See https://bugs.freedesktop.org/show_bug.cgi?id=24206
+    
+    As an interim measure, replace AM_INIT_AUTOMAKE([dist-bzip2]) with
+    AM_INIT_AUTOMAKE([foreign dist-bzip2]). This will prevent the generation
+    of the INSTALL file. It is also part of the 24206 solution.
+    
+    Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
+
+commit 8510be4defc2a6d291ac87439abfffcdd4214f7b
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Oct 1 14:54:26 2009 -0700
+
+    Add README with pointers to mailing lists, bugzilla, & git
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 982d3b53606238b4602bbdbc4f0f1f9c1bd0563b
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Thu Oct 1 14:10:15 2009 -0700
+
+    Require macros 1.3 for XORG_DEFAULT_OPTIONS
+    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>>
+
+commit 12f6dde9f5cd64773ccd907deb8600533e7b958f
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Thu Oct 1 14:06:44 2009 -0700
+
+    Fixed compiler warning
+    
+       xlogo.c:153: warning: format not a string literal and no format arguments
+
+commit 9bb8ad30520e9e9d688e844e18590b371a2ac1a9
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Thu Jan 22 15:40:27 2009 -0200
+
+    Correct make distcheck and sparse warnings.
+
+commit 15a8c8d5c3db1945a3ba6876241d04f0027e9dcd
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Thu Aug 21 00:30:29 2008 +0200
+
+    Build fix, XAW_USE_XPRINT is no more
+
+commit 44ca3b95b355af966044132fab8b5e1616aa7303
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Wed Aug 20 10:32:52 2008 -0400
+
+    xaw8 is gone, use xaw7
+
+commit f426787beaad60cee9c116613ddde540c310038a
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Fri May 16 14:25:24 2008 +0200
+
+    $(builddir) is the current directory
+    
+    Apparently automake doesn't always export the builddir variable.
+    This fixes my previous commit.
+
+commit 7c427dcbce96d6cb445ed73e08805524b593e1ea
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Sun Apr 20 19:51:43 2008 +0200
+
+    Use AM_CFLAGS instead of xlogo_CFLAGS and remove AM_PROG_CC_C_O
+
+commit 79c7a3d87978c253105603b8ac6b5d48a0b2b476
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Sun Apr 20 19:49:24 2008 +0200
+
+    Fix build with builddir != srcdir
+
+commit 1b7e7cf9ec4723afa3e9bed0825fbc8adca6408f
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Thu Mar 27 20:30:08 2008 -0700
+
+    Added missing AM_PROG_CC_C_O
+
+commit 2ddbb1bf87af90f0fcf1d78992b3783374831614
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Thu Mar 27 20:07:50 2008 -0700
+
+    Build fix for file systems that are not case sensitive
+
+commit 7c07c38b263902fef9e2962c1946ad493718c2e6
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Dec 6 16:37:21 2007 -0500
+
+    Replace static ChangeLog with dist-hook to generate from git log
+
+commit 2875b41b3e619315821b603ef56b1d29657469c2
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Mon Sep 3 05:51:31 2007 -0400
+
+    Add *~ to .gitignore to skip patch/emacs droppings
+
+commit dc7d96bec5665c64da74da75e0710a7b57b9173a
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Aug 23 19:24:58 2007 -0400
+
+    Rename .cvsignore to .gitignore
+
+commit a88e031e6c81857edc404f7b5d52c0c39cdd3146
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 21 02:29:51 2005 +0000
+
+    Update package version for X11R7 release.
+
+commit d8f94db09d68dc59dfe8d183cd0c1f3b9eff3004
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Dec 19 16:22:45 2005 +0000
+
+    Stub COPYING files
+
+commit ae1b1194d57cb1a1089cffe61137e67c9e8b6b20
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:24:08 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+commit be590c64bc8df224154347ab5f6c32fe60bf0e67
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 7 16:18:00 2005 +0000
+
+    Change to use the app-defaults default dir configured in libXt.
+
+commit 2ad19d20118c07d369ef67dd9ff8bd094d8e5864
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 6 22:48:23 2005 +0000
+
+    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit 6ea22dc485341e30ac906e3559b104326ab90178
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Dec 3 05:49:25 2005 +0000
+
+    Update package version number for X11R7 RC3 release.
+
+commit 7f3821c5e6815bbb59a9298d2671b150cf89615f
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Nov 28 22:01:44 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 601ec0670c548caed335352295bbcb058968aa50
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Mon Nov 21 10:35:02 2005 +0000
+
+    Another pass at .cvsignores for apps.
+
+commit 09d3bc9867032ee89503914bc7e731c48a470dfb
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Sun Nov 20 22:08:53 2005 +0000
+
+    Add/improve .cvsignore files for apps.
+
+commit a5ed76fbde1c8195951b41a0372a0b5caeeaebfa
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sun Nov 20 04:13:45 2005 +0000
+
+    Add dependency on xp module when building with Xprint support.
+
+commit ddcaa857470b13840b8a3c3e1748c0154f76b9c2
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Nov 19 07:15:37 2005 +0000
+
+    Update pkgconfig files to separate library build-time dependencies from
+        application build-time dependencies, and update package deps to work
+        with separate build roots.
+
+commit f3e7ab0f031b9ff8968596667616e79ec05f9b62
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:47:55 2005 +0000
+
+    Update package version number for RC1 release.
+
+commit 1b4c1658fc24b851a7f83e9190ecc6aacbc9f23b
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Oct 18 00:32:54 2005 +0000
+
+    Change default install dir for app-default files from
+        $(sysconfdir)/X11/app-defaults to $(libdir)/X11/app-defaults to match
+        the monolith & allow localization
+
+commit 0b90073689ab1745bb2277485687521f564a1939
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Oct 17 23:56:23 2005 +0000
+
+    Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to
+        work better with BSD make
+
+commit 0813f5229d48b9a0ed3dec5438db338dae71dfd9
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sat Oct 15 01:04:15 2005 +0000
+
+    Add #include <config.h> for modularization.
+
+commit fd78790af2a87e999b0f01d1c8f8ecce849a2384
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Fri Oct 14 00:25:46 2005 +0000
+
+    Use sed to fill in variables in man page
+
+commit 70298627f76aaf18ab4e63e297a0f42a8809d9bb
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Thu Oct 13 20:11:00 2005 +0000
+
+    Fix app-default files to install under the same names as in the monolith
+        instead of their short names used only for 14-character filename length
+        limited ancient filesystems
+
+commit 42f1737418b0c1d7e2ceaaaf3ddbcb2db7ab614b
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Aug 16 15:52:25 2005 +0000
+
+    Fix render checks to check for both Xrender & Xft2, and to define XRENDER
+
+commit 2eae29c6f837bd6f8ab383f0d4e61742c063291a
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Aug 1 20:25:30 2005 +0000
+
+    Install man pages to section 1 instead of section m (Patch from Donnie
+        Berkholz)
+
+commit 345a950cebdb8717e08fb878de0307a2611ba846
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Jul 29 21:22:35 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 28cbacfd0b809ce1614d177b10dd11ff1ab4b9d0
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Jul 26 15:44:02 2005 +0000
+
+    Replace more GNU make-ism's with more portable macros
+
+commit e3721beb3d51bd53527639afb4185f8fda24101e
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Sat Jul 23 16:41:40 2005 +0000
+
+    Fix remaining DEP_{CFLAGS,LIB} references
+
+commit 19cf02998290cc99fcbc94feb03647386ef595f9
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Sat Jul 23 16:40:58 2005 +0000
+
+    fix GNU-make only app-default rule
+
+commit b7533f8eb9cea84603a80e5207b4a589d3dfd444
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed Jul 20 19:31:58 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 6fc943cfccd96e6ad0fec6a2e1b836fa0d0d7d3a
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Tue Jul 5 22:51:09 2005 +0000
+
+    Add build systems for xlogo, xlsatoms, xlsclients, xmag, xman, xmessage,
+        xmh, xmore. lib/Xaw/xaw.m4: Add an AM_CONDITIONAL and a shell variable
+        xaw_use_xprint symlink.sh: add some extra files for xgc, xinit,
+        xkbcomp, xlogo, xmb, and xmodmap xc/programs/xmore/xmore.c:
+        Conditionalize use of xprint
+
+commit 4d8b36adf2024e6c28ecd266fb3585fdbc2c66f2
+Author: Roland Mainz <roland.mainz@nrubsig.org>
+Date:   Mon Apr 11 01:06:15 2005 +0000
+
+    xc/programs/Xserver/Xprint/attributes.c
+    xc/programs/glxgears/glxgears.c
+    xc/programs/xdbedizzy/xdbedizzy.c
+    xc/programs/xedit/Imakefile
+    xc/programs/xedit/Xedit-xprint.ad
+    xc/programs/xedit/util.c
+    xc/programs/xedit/xedit.h
+    xc/programs/xlogo/print.c
+    xc/programs/xlogo/xlogo.c
+    xc/programs/xlogo/xlogo.h
+    xc/programs/xman/Imakefile
+    xc/programs/xman/print.h
+    xc/programs/xmore/Imakefile
+    xc/programs/xmore/print.c
+    xc/programs/xmore/print.h
+    xc/programs/xmore/printdialog.c
+    xc/programs/xphelloworld/xpawhelloworld/xpawhelloworld.c
+    xc/programs/xphelloworld/xphelloworld/xphelloworld.c
+    xc/programs/xphelloworld/xpsimplehelloworld/xpsimplehelloworld.c
+    xc/programs/xphelloworld/xpxmhelloworld/xpxmhelloworld.c
+    //bugs.freedesktop.org/show_bug.cgi?id=790) attachment #2379
+        (https://bugs.freedesktop.org/attachment.cgi?id=2379) Implement support
+        client+Xserver support for passing output (stdout+stderr) of the
+        spooler command started by the Xprint server back to the application
+        using the "xp-spooler-command-results" XPJobAttr attribute
+        (applications can fetch the attribute value after the XPEndJobNotify
+        event was received; more details can be found in
+        http://xprint.mozdev.org/docs/dtprint_fspec.ps).
+
+commit c4d739517989871ad786fd0f5e0ae6a683f7e92f
+Author: Roland Mainz <roland.mainz@nrubsig.org>
+Date:   Mon Jan 3 01:06:35 2005 +0000
+
+    xc/lib/XprintAppUtil/xpapputil.c
+    xc/lib/XprintAppUtil/xpapputil.h
+    xc/lib/XprintUtil/xprintutil.c
+    xc/lib/XprintUtil/xprintutil.h
+    xc/programs/glxgears/glxgears.c
+    xc/programs/xdbedizzy/xdbedizzy.c
+    xc/programs/xedit/Xedit-xprint.ad
+    xc/programs/xedit/commands.c
+    xc/programs/xlogo/print.c
+    xc/programs/xlsfonts/xlsfonts.c
+    xc/programs/xlsfonts/xlsfonts.man
+    xc/programs/xlsfonts/xlsfonts.sgml
+    xc/programs/xman/Xman-xprint.ad
+    xc/programs/xman/handler.c
+    xc/programs/xman/print.c
+    xc/programs/xman/print.h
+    xc/programs/xmore/XMore.ad
+    xc/programs/xmore/print.c
+    xc/programs/xmore/print.h
+    xc/programs/xmore/printdialog.c
+    xc/programs/xmore/printdialog.h
+    xc/programs/xmore/printdialogprivates.h
+    xc/programs/xmore/xmore.c
+    xc/programs/xphelloworld/xpawhelloworld/xpawhelloworld.c
+    xc/programs/xphelloworld/xphelloworld/xphelloworld.c
+    xc/programs/xphelloworld/xpsimplehelloworld/xpsimplehelloworld.c
+    xc/programs/xphelloworld/xpxmhelloworld/xpxmhelloworld.c
+    xc/programs/xphelloworld/xpxthelloworld/xpxthelloworld.c
+    xc/programs/xplsprinters/xplsprinters.c
+    //bugs.freedesktop.org/show_bug.cgi?id=1706) attachment #1615
+        (https://bugs.freedesktop.org/attachment.cgi?id=1615): XprintUtils
+        2004/Q3 update. This adds various new features to the XprintUtils
+        library including support for page resolutions where
+        X_resolution!=Y_resolution, listfonts-mode control and initial
+        framework for the COLORSPACE extension. Patch by Roland Mainz
+        <roland.mainz@nrubsig.org> and Julien Lafon <julien.lafon@gmail.com>.
+
+commit f4149e9970ced64f8eb2e92a115ea87174de2747
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Sep 2 05:50:38 2004 +0000
+
+    Clean up defines for Xprint support and fix BuildServersOnly build for
+        libXaw.
+
+commit ac167b94611ccb2b990ff70db5957fae0bde0969
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Sep 2 01:10:30 2004 +0000
+
+    Bump major version number of libXaw (Bug #1273).
+
+commit 18ae14262f9859a2e1f2dd769a0c4dcf4e1bb344
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Mon Aug 16 16:36:16 2004 +0000
+
+    As discussed and agreed on on the release-wranglers meeting of August 16,
+        I'm committing the patch from bug #1060 to back out unconditional
+        Xprint functionality.
+    Back out Xprint changes.
+    Revert xman to CVS of June 5, revert xlogo to CVS of May 8, revert xedit to
+        CVS of April 25, to back out unconditional Xprint support.
+    Fix up Xprint config logic to be like the rest of the extensions:
+        BuildXprint is a one-stop option for disabling everything Xprint
+        related. XprtServer controls building Xprt, BuildXprintLib controls
+        building Xprint libs and BuildXprintClients controls building clients
+        related to Xprint. BuiltXprint defaults to YES and the other options
+        respects relevant settings, i.e. BuildServer and BuildServersOnly.
+    Build Xaw regardless of BuildXprintLib setting.
+    Only build xphelloworld, xplsprinters and xprehashprinterlist when
+        BuildXprintClients it YES. Disable building xmore, it has always
+        supported XawPrintShell.
+    Make Xprint support depend on BuildXprintLib.
+
+commit 28ffd14fbae70a5e01cdcbe2cb9342d3c8816b76
+Author: Roland Mainz <roland.mainz@nrubsig.org>
+Date:   Sun May 9 00:36:41 2004 +0000
+
+    Fix for http://pdx.freedesktop.org/cgi-bin/bugzilla/show_bug.cgi?id=581 -
+        Print support for XLogo.
+
+commit 8eb746981d01e0db330e8e6139300ede823037f3
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 19:54:57 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+commit 2a3e8d4963b3a8ed53e226965ec80f749ad8d5a4
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:35:37 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit effebf964672168e99b59fdf89be48dab2f88ecd
+Author: Egbert Eich <eich@suse.de>
+Date:   Wed Mar 3 12:13:14 2004 +0000
+
+    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit 8cc0b397fa0c771a60f58e362a69bc04e8f1510f
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:36:26 2004 +0000
+
+    readding XFree86's cvs IDs
+
+commit 142da2b715826c9fe7dad89ee344ead2f798cf82
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 09:24:14 2004 +0000
+
+    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit 59a2fa66d61369dd415f1cb7c8c5d6e7640e4870
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Dec 19 20:56:01 2003 +0000
+
+    XFree86 4.3.99.902 (RC 2)
+
+commit 54d675d206d1dbb9901e33ccc14988daf98f97b8
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:29:15 2003 +0000
+
+    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit 05b7c570b155f167e5a7f1b804e10b870bbc762c
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:49:23 2003 +0000
+
+    XFree86 4.3.0.1
+
+commit cc25207f02f9b4d630f5d6646a1815431e532ea0
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:49:23 2003 +0000
+
+    Initial revision
+
+commit 6fc51a3195bf01d2f69b33524d27ec3bb5e17181
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 15:54:54 2003 +0000
+
+    R6.6 is the Xorg base-line
diff --git a/xlogo/INSTALL b/xlogo/INSTALL
new file mode 100644 (file)
index 0000000..8b82ade
--- /dev/null
@@ -0,0 +1,291 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008 Free Software Foundation, Inc.
+
+   This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+   Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package.  The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.
+
+     Running `configure' might take a while.  While running, it prints
+     some messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+  6. Often, you can also type `make uninstall' to remove the installed
+     files again.
+
+Compilers and Options
+=====================
+
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+   You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you can use GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory.  After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+   On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor.  Like
+this:
+
+     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CPP="gcc -E" CXXCPP="g++ -E"
+
+   This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+   By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+   Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Particular systems
+==================
+
+   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+     ./configure CC="cc -Ae"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
+a workaround.  If GNU CC is not installed, it is therefore recommended
+to try
+
+     ./configure CC="cc"
+
+and if that doesn't work, try
+
+     ./configure CC="cc -nodtk"
+
+Specifying the System Type
+==========================
+
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+   Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug.  Until the bug is fixed you can use this workaround:
+
+     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+   `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+     Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+     Print a summary of the options unique to this package's
+     `configure', and exit.  The `short' variant lists options used
+     only in the top level, while the `recursive' variant lists options
+     also present in any nested packages.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+     Use DIR as the installation prefix.  *Note Installation Names::
+     for more details, including other options available for fine-tuning
+     the installation locations.
+
+`--no-create'
+`-n'
+     Run the configure checks, but stop before creating any output
+     files.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/xlogo/Logo.c b/xlogo/Logo.c
new file mode 100644 (file)
index 0000000..da5d7ae
--- /dev/null
@@ -0,0 +1,487 @@
+/*
+
+Copyright 1988, 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.
+
+*/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <X11/StringDefs.h>
+#include <X11/IntrinsicP.h>
+#include <X11/Xmu/Drawing.h>
+#include "LogoP.h"
+#include <X11/extensions/shape.h>
+#include <X11/Xos.h>
+
+#ifdef XRENDER
+#include "RenderLogo.h"
+#endif
+
+static XtResource resources[] = {
+    {XtNshapeWindow, XtCShapeWindow, XtRBoolean, sizeof (Boolean),
+       XtOffsetOf(LogoRec,logo.shape_window), XtRImmediate,
+       (XtPointer) FALSE},
+#ifdef XRENDER
+    {XtNrender, XtCBoolean, XtRBoolean, sizeof(Boolean),
+       XtOffsetOf(LogoRec,logo.render), XtRImmediate,
+       (XtPointer) FALSE },
+    {XtNsharp, XtCBoolean, XtRBoolean, sizeof(Boolean),
+       XtOffsetOf(LogoRec,logo.sharp), XtRImmediate,
+       (XtPointer) FALSE },
+    {XtNforeground, XtCForeground, XtRXftColor, sizeof(XftColor),
+       XtOffsetOf(LogoRec, logo.fg), XtRString,
+       (XtPointer) XtDefaultForeground},
+    {XtNbackground, XtCForeground, XtRXftColor, sizeof(XftColor),
+       XtOffsetOf(LogoRec, logo.bg), XtRString,
+       (XtPointer) XtDefaultBackground},
+#else
+    {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
+        XtOffsetOf(LogoRec,logo.fgpixel), XtRString,
+       (XtPointer) XtDefaultForeground},
+#endif
+};
+
+static void ClassInitialize ( void );
+static void Initialize ( Widget request, Widget new, ArgList args,
+                        Cardinal *num_args );
+static void Destroy ( Widget gw );
+static void Realize ( Widget gw, XtValueMask *valuemaskp,
+                     XSetWindowAttributes *attr );
+static void Resize ( Widget gw );
+static void Redisplay ( Widget gw, XEvent *event, Region region );
+static Boolean SetValues ( Widget gcurrent, Widget grequest, Widget gnew,
+                          ArgList args, Cardinal *num_args );
+
+LogoClassRec logoClassRec = {
+    { /* core fields */
+    /* superclass              */      (WidgetClass) &simpleClassRec,
+    /* class_name              */      "Logo",
+    /* widget_size             */      sizeof(LogoRec),
+    /* class_initialize                */      ClassInitialize,
+    /* class_part_initialize   */      NULL,
+    /* class_inited            */      FALSE,
+    /* initialize              */      Initialize,
+    /* initialize_hook         */      NULL,
+    /* realize                 */      Realize,
+    /* actions                 */      NULL,
+    /* num_actions             */      0,
+    /* resources               */      resources,
+    /* resource_count          */      XtNumber(resources),
+    /* xrm_class               */      NULLQUARK,
+    /* compress_motion         */      TRUE,
+    /* compress_exposure       */      TRUE,
+    /* compress_enterleave     */      TRUE,
+    /* visible_interest                */      FALSE,
+    /* destroy                 */      Destroy,
+    /* resize                  */      Resize,
+    /* expose                  */      Redisplay,
+    /* set_values              */      SetValues,
+    /* set_values_hook         */      NULL,
+    /* set_values_almost       */      XtInheritSetValuesAlmost,
+    /* get_values_hook         */      NULL,
+    /* accept_focus            */      NULL,
+    /* version                 */      XtVersion,
+    /* callback_private                */      NULL,
+    /* tm_table                        */      NULL,
+    /* query_geometry          */      XtInheritQueryGeometry,
+    /* display_accelerator     */      XtInheritDisplayAccelerator,
+    /* extension               */      NULL
+    },
+    { /* simple fields */
+    /* change_sensitive         */      XtInheritChangeSensitive
+    },
+    { /* logo fields */
+    /* ignore                   */      0
+    }
+};
+
+WidgetClass logoWidgetClass = (WidgetClass) &logoClassRec;
+
+
+/*****************************************************************************
+ *                                                                          *
+ *                        private utility routines                          *
+ *                                                                          *
+ *****************************************************************************/
+
+static void
+create_gcs(LogoWidget w)
+{
+    XGCValues v;
+
+#ifdef XRENDER
+    w->logo.fgpixel = w->logo.fg.pixel;
+#endif
+
+    v.foreground = w->logo.fgpixel;
+    w->logo.foreGC = XtGetGC ((Widget) w, GCForeground, &v);
+    v.foreground = w->core.background_pixel;
+    w->logo.backGC = XtGetGC ((Widget) w, GCForeground, &v);
+}
+
+static void
+check_shape(LogoWidget w)
+{
+    if (w->logo.shape_window) {
+       int event_base, error_base;
+
+       if (!XShapeQueryExtension (XtDisplay (w), &event_base, &error_base))
+         w->logo.shape_window = FALSE;
+    }
+}
+
+/* ARGSUSED */
+static void
+unset_shape(LogoWidget w)
+{
+    XSetWindowAttributes attr;
+    unsigned long mask;
+    Display *dpy = XtDisplay ((Widget) w);
+    Window win = XtWindow ((Widget) w);
+
+    if (w->core.background_pixmap != None &&
+       w->core.background_pixmap != XtUnspecifiedPixmap) {
+       attr.background_pixmap = w->core.background_pixmap;
+       mask = CWBackPixmap;
+    } else {
+       attr.background_pixel = w->core.background_pixel;
+       mask = CWBackPixel;
+    }
+    XChangeWindowAttributes (dpy, win, mask, &attr);
+    XShapeCombineMask (dpy, win, ShapeBounding, 0, 0, None, ShapeSet);
+    if (!w->logo.foreGC) create_gcs (w);
+    w->logo.need_shaping = w->logo.shape_window;
+}
+
+static void
+set_shape(LogoWidget w)
+{
+    GC ones, zeros;
+    Display *dpy = XtDisplay ((Widget) w);
+    Window win = XtWindow ((Widget) w);
+    unsigned int width = (unsigned int) w->core.width;
+    unsigned int height = (unsigned int) w->core.height;
+    Pixmap pm = XCreatePixmap (dpy, win, width, height, (unsigned int) 1);
+    XGCValues v;
+
+    v.foreground = (Pixel) 1;
+    v.background = (Pixel) 0;
+    ones = XCreateGC (dpy, pm, (GCForeground | GCBackground), &v);
+    v.foreground = (Pixel) 0;
+    v.background = (Pixel) 1;
+    zeros = XCreateGC (dpy, pm, (GCForeground | GCBackground), &v);
+
+    if (pm && ones && zeros) {
+       int x = 0, y = 0;
+       Widget parent;
+
+       XmuDrawLogo (dpy, pm, ones, zeros, 0, 0, width, height);
+       for (parent = (Widget) w; XtParent(parent);
+            parent = XtParent(parent)) {
+           x += parent->core.x + parent->core.border_width;
+           y += parent->core.y + parent->core.border_width;
+       }
+       XShapeCombineMask (dpy, XtWindow (parent), ShapeBounding,
+                          x, y, pm, ShapeSet);
+       w->logo.need_shaping = FALSE;
+    } else {
+       unset_shape (w);
+    }
+    if (ones) XFreeGC (dpy, ones);
+    if (zeros) XFreeGC (dpy, zeros);
+    if (pm) XFreePixmap (dpy, pm);
+}
+
+
+/*****************************************************************************
+ *                                                                          *
+ *                              class methods                               *
+ *                                                                          *
+ *****************************************************************************/
+
+#ifdef XRENDER
+
+static void
+RenderPrepare (LogoWidget w)
+{
+    if (!w->logo.draw)
+    {
+       w->logo.draw = XftDrawCreate (XtDisplay (w), XtWindow (w),
+                                      DefaultVisual (XtDisplay (w),
+                                                     DefaultScreen(XtDisplay (w))),
+                                      w->core.colormap);
+    }
+}
+
+static XtConvertArgRec xftColorConvertArgs[] = {
+    {XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.screen),
+     sizeof(Screen *)},
+    {XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.colormap),
+     sizeof(Colormap)}
+};
+
+#define        donestr(type, value, tstr) \
+       {                                                       \
+           if (toVal->addr != NULL) {                          \
+               if (toVal->size < sizeof(type)) {               \
+                   toVal->size = sizeof(type);                 \
+                   XtDisplayStringConversionWarning(dpy,       \
+                       (char*) fromVal->addr, tstr);           \
+                   return False;                               \
+               }                                               \
+               *(type*)(toVal->addr) = (value);                \
+           }                                                   \
+           else {                                              \
+               static type static_val;                         \
+               static_val = (value);                           \
+               toVal->addr = (XPointer)&static_val;            \
+           }                                                   \
+           toVal->size = sizeof(type);                         \
+           return True;                                        \
+       }
+
+static void
+XmuFreeXftColor (XtAppContext app, XrmValuePtr toVal, XtPointer closure,
+                XrmValuePtr args, Cardinal *num_args)
+{
+    Screen     *screen;
+    Colormap   colormap;
+    XftColor   *color;
+
+    if (*num_args != 2)
+    {
+       XtAppErrorMsg (app,
+                      "freeXftColor", "wrongParameters",
+                      "XtToolkitError",
+                      "Freeing an XftColor requires screen and colormap arguments",
+                      (String *) NULL, (Cardinal *)NULL);
+       return;
+    }
+
+    screen = *((Screen **) args[0].addr);
+    colormap = *((Colormap *) args[1].addr);
+    color = (XftColor *) toVal->addr;
+    XftColorFree (DisplayOfScreen (screen),
+                 DefaultVisual (DisplayOfScreen (screen),
+                                XScreenNumberOfScreen (screen)),
+                 colormap, color);
+}
+
+static Boolean
+XmuCvtStringToXftColor(Display *dpy,
+                      XrmValue *args, Cardinal *num_args,
+                      XrmValue *fromVal, XrmValue *toVal,
+                      XtPointer *converter_data)
+{
+    char           *spec;
+    XRenderColor    renderColor;
+    XftColor       xftColor;
+    Screen         *screen;
+    Colormap       colormap;
+
+    if (*num_args != 2)
+    {
+       XtAppErrorMsg (XtDisplayToApplicationContext (dpy),
+                      "cvtStringToXftColor", "wrongParameters",
+                      "XtToolkitError",
+                      "String to render color conversion needs screen and colormap arguments",
+                      (String *) NULL, (Cardinal *)NULL);
+       return False;
+    }
+
+    screen = *((Screen **) args[0].addr);
+    colormap = *((Colormap *) args[1].addr);
+
+    spec = (char *) fromVal->addr;
+    if (strcasecmp (spec, XtDefaultForeground) == 0)
+    {
+       renderColor.red = 0;
+       renderColor.green = 0;
+       renderColor.blue = 0;
+       renderColor.alpha = 0xffff;
+    }
+    else if (strcasecmp (spec, XtDefaultBackground) == 0)
+    {
+       renderColor.red = 0xffff;
+       renderColor.green = 0xffff;
+       renderColor.blue = 0xffff;
+       renderColor.alpha = 0xffff;
+    }
+    else if (!XRenderParseColor (dpy, spec, &renderColor))
+       return False;
+    if (!XftColorAllocValue (dpy,
+                            DefaultVisual (dpy,
+                                           XScreenNumberOfScreen (screen)),
+                            colormap,
+                            &renderColor,
+                            &xftColor))
+       return False;
+
+    donestr (XftColor, xftColor, XtRXftColor);
+}
+
+
+#endif
+
+static void
+ClassInitialize(void)
+{
+#ifdef XRENDER
+    XtSetTypeConverter (XtRString, XtRXftColor,
+                       XmuCvtStringToXftColor,
+                       xftColorConvertArgs, XtNumber(xftColorConvertArgs),
+                       XtCacheByDisplay, XmuFreeXftColor);
+#endif
+}
+
+/* ARGSUSED */
+static void
+Initialize(Widget request, Widget new, ArgList args, Cardinal *num_args)
+{
+    LogoWidget w = (LogoWidget)new;
+
+#ifdef XRENDER
+    w->logo.draw = NULL;
+    w->logo.fgpixel = w->logo.fg.pixel;
+#endif
+    if (w->core.width < 1) w->core.width = 100;
+    if (w->core.height < 1) w->core.height = 100;
+
+    w->logo.foreGC = (GC) NULL;
+    w->logo.backGC = (GC) NULL;
+    check_shape (w);
+    w->logo.need_shaping = w->logo.shape_window;
+}
+
+static void
+Destroy(Widget gw)
+{
+    LogoWidget w = (LogoWidget) gw;
+    if (w->logo.foreGC) {
+       XtReleaseGC (gw, w->logo.foreGC);
+       w->logo.foreGC = (GC) NULL;
+    }
+    if (w->logo.backGC) {
+       XtReleaseGC (gw, w->logo.backGC);
+       w->logo.backGC = (GC) NULL;
+    }
+}
+
+static void
+Realize(Widget gw, XtValueMask *valuemaskp, XSetWindowAttributes *attr)
+{
+    LogoWidget w = (LogoWidget) gw;
+
+    if (w->logo.shape_window) {
+       attr->background_pixel = w->logo.fgpixel;  /* going to shape */
+       *valuemaskp |= CWBackPixel;
+    } else
+      create_gcs (w);
+    (*logoWidgetClass->core_class.superclass->core_class.realize)
+       (gw, valuemaskp, attr);
+}
+
+static void
+Resize(Widget gw)
+{
+    LogoWidget w = (LogoWidget) gw;
+
+    if (w->logo.shape_window && XtIsRealized(gw)) set_shape (w);
+}
+
+/* ARGSUSED */
+static void
+Redisplay(Widget gw, XEvent *event, Region region)
+{
+    LogoWidget w = (LogoWidget) gw;
+
+    if (w->logo.shape_window) {
+       if (w->logo.need_shaping) set_shape (w);  /* may change shape flag */
+    }
+    if (!w->logo.shape_window) {
+#ifdef XRENDER
+       if (w->logo.render)
+       {
+           RenderPrepare (w);
+
+           XClearWindow (XtDisplay(w), XtWindow(w));
+           RenderLogo (XtDisplay(w), PictOpOver,
+                       XftDrawSrcPicture (w->logo.draw, &w->logo.fg),
+                       XftDrawPicture (w->logo.draw),
+                       XRenderFindStandardFormat (XtDisplay (w),
+                                                  w->logo.sharp ?
+                                                  PictStandardA1:
+                                                  PictStandardA8),
+                       0, 0, (unsigned int) w->core.width,
+                       (unsigned int) w->core.height);
+       }
+       else
+#endif
+       {
+           XmuDrawLogo (XtDisplay(w), XtWindow(w), w->logo.foreGC, w->logo.backGC,
+                        0, 0, (unsigned int) w->core.width,
+                        (unsigned int) w->core.height);
+       }
+    }
+}
+
+/* ARGSUSED */
+static Boolean
+SetValues (Widget gcurrent, Widget grequest, Widget gnew,
+          ArgList args, Cardinal *num_args)
+{
+    LogoWidget current = (LogoWidget) gcurrent;
+    LogoWidget new = (LogoWidget) gnew;
+    Boolean redisplay = FALSE;
+
+    if (new->logo.shape_window &&
+       new->logo.shape_window != current->logo.shape_window)
+       check_shape (new);                      /* validate shape_window */
+
+    if ((new->logo.fgpixel != current->logo.fgpixel) ||
+       (new->core.background_pixel != current->core.background_pixel)) {
+       Destroy (gnew);
+       if (!new->logo.shape_window) create_gcs (new);
+       redisplay = TRUE;
+    }
+
+   if (new->logo.shape_window != current->logo.shape_window) {
+       if (new->logo.shape_window) {
+          Destroy (gnew);
+          if (XtIsRealized(gnew))
+              set_shape (new);
+          else
+              new->logo.need_shaping = True;
+          redisplay = FALSE;
+       } else {
+          if (XtIsRealized(gnew))
+              unset_shape (new);               /* creates new GCs */
+          redisplay = TRUE;
+       }
+   }
+
+   return (redisplay);
+}
diff --git a/xlogo/Logo.h b/xlogo/Logo.h
new file mode 100644 (file)
index 0000000..89cdf59
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+
+Copyright 1988, 1990, 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.
+
+*/
+
+#ifndef _XawLogo_h
+#define _XawLogo_h
+
+/* Parameters:
+
+ Name               Class              RepType         Default Value
+ ----               -----              -------         -------------
+ background         Background         Pixel           XtDefaultBackground
+ border                     BorderColor        Pixel           XtDefaultForeground
+ borderWidth        BorderWidth        Dimension       1
+ destroyCallback     Callback          Pointer         NULL
+ foreground         Foreground         Pixel           XtDefaultForeground
+ height                     Height             Dimension       100
+ mappedWhenManaged   MappedWhenManaged Boolean         True
+ shapeWindow        ShapeWindow        Boolean         False
+ width              Width              Dimension       100
+ x                  Position           Position        0
+ y                  Position           Position        0
+
+*/
+
+#define XtNshapeWindow "shapeWindow"
+#define XtCShapeWindow "ShapeWindow"
+
+#define XtNrender "render"
+#define XtCRender "Render"
+
+#define XtRXftColor "XftColor"
+
+#define XtNsharp "sharp"
+#define XtCSharp "Sharp"
+
+typedef struct _LogoRec *LogoWidget;
+typedef struct _LogoClassRec *LogoWidgetClass;
+
+extern WidgetClass logoWidgetClass;
+
+#endif /* _XawLogo_h */
diff --git a/xlogo/LogoP.h b/xlogo/LogoP.h
new file mode 100644 (file)
index 0000000..6502b66
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+
+Copyright 1988, 1993, 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.
+
+*/
+
+#ifndef _XawLogoP_h
+#define _XawLogoP_h
+
+#include "Logo.h"
+#include <X11/Xaw/SimpleP.h>
+
+#ifdef XRENDER
+#include <X11/extensions/Xrender.h>
+#include <X11/Xft/Xft.h>
+#endif
+
+typedef struct {
+         Pixel fgpixel;
+        GC      foreGC;
+        GC      backGC;
+        Boolean shape_window;
+        Boolean need_shaping;
+#ifdef XRENDER
+         Boolean render;
+         Boolean sharp;
+        XftDraw    *draw;
+         XRenderPictFormat *mask_format;
+        XftColor   fg;
+        XftColor   bg;
+#endif
+   } LogoPart;
+
+typedef struct _LogoRec {
+   CorePart core;
+   SimplePart simple;
+   LogoPart logo;
+   } LogoRec;
+
+typedef struct {int dummy;} LogoClassPart;
+
+typedef struct _LogoClassRec {
+   CoreClassPart core_class;
+   SimpleClassPart simple_class;
+   LogoClassPart logo_class;
+   } LogoClassRec;
+
+extern LogoClassRec logoClassRec;
+
+#endif /* _XawLogoP_h */
diff --git a/xlogo/Makefile.am b/xlogo/Makefile.am
new file mode 100644 (file)
index 0000000..78f68b0
--- /dev/null
@@ -0,0 +1,89 @@
+#  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 = xlogo
+
+AM_CFLAGS = $(XLOGO_CFLAGS)
+xlogo_LDADD = $(XLOGO_LIBS)
+
+xlogo_SOURCES =        \
+        Logo.c \
+        Logo.h \
+        LogoP.h \
+        RenderLogo.c \
+        RenderLogo.h \
+        xlogo.c \
+        xlogo.h
+
+appman_PRE = \
+        xlogo.man
+
+# App default files
+DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
+
+appdefaultdir = @appdefaultdir@
+
+dist_appdefault_DATA = \
+        app-defaults/XLogo \
+        app-defaults/XLogo-color
+
+
+appmandir = $(APP_MAN_DIR)
+
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+
+EXTRA_DIST = $(appman_PRE)
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+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):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/xlogo/Makefile.in b/xlogo/Makefile.in
new file mode 100644 (file)
index 0000000..ac25ee3
--- /dev/null
@@ -0,0 +1,815 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = xlogo$(EXEEXT)
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(dist_appdefault_DATA) \
+       $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+       $(srcdir)/config.h.in $(top_srcdir)/configure COPYING \
+       ChangeLog INSTALL config.guess config.sub depcomp install-sh \
+       missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" \
+       "$(DESTDIR)$(appdefaultdir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_xlogo_OBJECTS = Logo.$(OBJEXT) RenderLogo.$(OBJEXT) xlogo.$(OBJEXT)
+xlogo_OBJECTS = $(am_xlogo_OBJECTS)
+am__DEPENDENCIES_1 =
+xlogo_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(xlogo_SOURCES)
+DIST_SOURCES = $(xlogo_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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+DATA = $(appman_DATA) $(dist_appdefault_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@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPDEFS_CFLAGS = @APPDEFS_CFLAGS@
+APPDEFS_LIBS = @APPDEFS_LIBS@
+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@
+CHANGELOG_CMD = @CHANGELOG_CMD@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
+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@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_CMD = @INSTALL_CMD@
+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@
+MAKEINFO = @MAKEINFO@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XEXT_CFLAGS = @XEXT_CFLAGS@
+XEXT_LIBS = @XEXT_LIBS@
+XFT_CFLAGS = @XFT_CFLAGS@
+XFT_LIBS = @XFT_LIBS@
+XLOGO_CFLAGS = @XLOGO_CFLAGS@
+XLOGO_LIBS = @XLOGO_LIBS@
+XRENDER_CFLAGS = @XRENDER_CFLAGS@
+XRENDER_LIBS = @XRENDER_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+appdefaultdir = @appdefaultdir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CFLAGS = $(XLOGO_CFLAGS)
+xlogo_LDADD = $(XLOGO_LIBS)
+xlogo_SOURCES = \
+        Logo.c \
+        Logo.h \
+        LogoP.h \
+        RenderLogo.c \
+        RenderLogo.h \
+        xlogo.c \
+        xlogo.h
+
+appman_PRE = \
+        xlogo.man
+
+
+# App default files
+DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
+dist_appdefault_DATA = \
+        app-defaults/XLogo \
+        app-defaults/XLogo-color
+
+appmandir = $(APP_MAN_DIR)
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+EXTRA_DIST = $(appman_PRE)
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+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) --foreign'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign 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)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+       @if test ! -f $@; then \
+         rm -f stamp-h1; \
+         $(MAKE) $(AM_MAKEFLAGS) 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) 
+       ($(am__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)'; test -n "$(bindir)" || list=; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p; \
+         then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+xlogo$(EXEEXT): $(xlogo_OBJECTS) $(xlogo_DEPENDENCIES) 
+       @rm -f xlogo$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(xlogo_OBJECTS) $(xlogo_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Logo.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RenderLogo.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xlogo.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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) '$<'`
+install-appmanDATA: $(appman_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)"
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \
+       done
+
+uninstall-appmanDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appmandir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appmandir)" && rm -f $$files
+install-dist_appdefaultDATA: $(dist_appdefault_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appdefaultdir)" || $(MKDIR_P) "$(DESTDIR)$(appdefaultdir)"
+       @list='$(dist_appdefault_DATA)'; test -n "$(appdefaultdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appdefaultdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appdefaultdir)" || exit $$?; \
+       done
+
+uninstall-dist_appdefaultDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_appdefault_DATA)'; test -n "$(appdefaultdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appdefaultdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appdefaultdir)" && rm -f $$files
+
+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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       set x; \
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       $(am__remove_distdir)
+       test -d "$(distdir)" || mkdir "$(distdir)"
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$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
+       -test -n "$(am__skip_mode_fix)" \
+       || find "$(distdir)" -type d ! -perm -755 \
+               -exec chmod u+rwx,go+rx {} \; -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 $(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-lzma: distdir
+       tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+       $(am__remove_distdir)
+
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+       $(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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+       *.tar.bz2*) \
+         bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.lzma*) \
+         lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+       *.tar.Z*) \
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+       *.shar.gz*) \
+         GZIP=$(GZIP_ENV) gzip -dc $(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)
+       test -d $(distdir)/_build || exit 0; \
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && am__cwd=`pwd` \
+         && $(am__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 \
+         && cd "$$am__cwd" \
+         || exit 1
+       $(am__remove_distdir)
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+       @$(am__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)" "$(DESTDIR)$(appdefaultdir)"; 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)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-appmanDATA install-dist_appdefaultDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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_appdefaultDATA
+
+.MAKE: all install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+       clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
+       dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \
+       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-dist_appdefaultDATA install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+       uninstall-am uninstall-appmanDATA uninstall-binPROGRAMS \
+       uninstall-dist_appdefaultDATA
+
+
+.man.$(APP_MAN_SUFFIX):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
+
+# 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/xlogo/README b/xlogo/README
new file mode 100644 (file)
index 0000000..babb8e7
--- /dev/null
@@ -0,0 +1,25 @@
+The xlogo program simply displays the X Window System logo.
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+        http://lists.freedesktop.org/mailman/listinfo/xorg
+
+Please submit bug reports to the Xorg bugzilla:
+
+        https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+The master development code repository can be found at:
+
+        git://anongit.freedesktop.org/git/xorg/app/xlogo
+
+        http://cgit.freedesktop.org/xorg/app/xlogo
+
+For patch submission instructions, see:
+
+       http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
+For more information on the git code manager, see:
+
+        http://wiki.x.org/wiki/GitPage
+
diff --git a/xlogo/RenderLogo.c b/xlogo/RenderLogo.c
new file mode 100644 (file)
index 0000000..a7963fb
--- /dev/null
@@ -0,0 +1,162 @@
+/*
+
+Copyright 1988, 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.
+
+*/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <stdio.h>
+
+#include <X11/Xlib.h>
+#include <X11/extensions/Xrender.h>
+
+#include "RenderLogo.h"
+
+typedef struct _XLineDouble {
+    XPointDouble  p1, p2;
+} XLineDouble;
+
+static void
+intersect(XLineDouble *l1, XLineDouble *l2, XPointDouble *intersection);
+
+/*
+ *  Draw the "official" X Window System Logo, designed by Danny Chong
+ *
+ *  Written by Ollie Jones, Apollo Computer
+ *
+ *  Does some fancy stuff to make the logo look acceptable even
+ *  if it is tiny.  Also makes the various linear elements of
+ *  the logo line up as well as possible considering rasterization.
+ *
+ *  Munged to draw anti-aliased logo using Render extension.
+ *  Carl Worth, 2002-05-16
+ */
+void
+RenderLogo(Display *dpy, int op, Picture src, Picture dst, XRenderPictFormat *maskFormat,
+          int x, int y, unsigned int width, unsigned int height)
+{
+    unsigned int size;
+    double thin, thick, gap, d31;
+    XPointDouble poly[6];
+    XLineDouble thick_left, thick_right, thin_left, thin_right, gap_left, gap_right;
+
+    /* for now, do a centered even-sized square, at least for now */
+    size = width;
+    if (height < width)
+        size = height;
+    size &= ~1;
+    x += (width - size) >> 1;
+    y += (height - size) >> 1;
+
+    thin = (size / 11.0);
+    thick = (size / 4.0);
+    gap = thin / 4.0;
+    d31 = thin + thin + gap;
+
+    thick_left.p1.x = x;               thick_left.p1.y = y;
+    thick_left.p2.x = x + size - thick;        thick_left.p2.y = y + size;
+
+    thick_right.p1.x = x + thick;      thick_right.p1.y = y;
+    thick_right.p2.x = x + size;       thick_right.p2.y = y + size;
+
+    thin_left.p1.x = x + size-d31;     thin_left.p1.y = y;
+    thin_left.p2.x = x + 0;            thin_left.p2.y = y + size;
+
+    thin_right.p1.x = x + size;                thin_right.p1.y = y;
+    thin_right.p2.x = x + d31;         thin_right.p2.y = y + size;
+
+    gap_left.p1.x = x + size-( thin+gap);      gap_left.p1.y = y;
+    gap_left.p2.x = x + thin;                  gap_left.p2.y = y + size;
+
+    gap_right.p1.x = x + size- thin;   gap_right.p1.y = y;
+    gap_right.p2.x = x + thin + gap;   gap_right.p2.y = y + size;
+
+    poly[0] = thick_left.p1;
+    poly[1] = thick_right.p1;
+    intersect(&thick_right, &gap_left, &poly[2]);
+    poly[3] = gap_left.p2;
+    poly[4] = thin_left.p2;
+    intersect(&thick_left, &thin_left, &poly[5]);
+
+    XRenderCompositeDoublePoly(dpy, op,
+                              src, dst, maskFormat,
+                              0, 0, 0, 0,
+                              poly, 6, 0);
+
+    poly[0] = thin_right.p1;
+    poly[1] = gap_right.p1;
+    intersect(&thick_left, &gap_right, &poly[2]);
+    poly[3] = thick_left.p2;
+    poly[4] = thick_right.p2;
+    intersect(&thick_right, &thin_right, &poly[5]);
+
+    XRenderCompositeDoublePoly(dpy, op,
+                              src, dst, maskFormat,
+                              0, 0, 0, 0,
+                              poly, 6, 0);
+}
+
+static double
+compute_inverse_slope (XLineDouble *l)
+{
+    return ((l->p2.x - l->p1.x) /
+           (l->p2.y - l->p1.y));
+}
+
+static double
+compute_x_intercept(XLineDouble *l, double inverse_slope)
+{
+    return (l->p1.x) - inverse_slope * l->p1.y;
+}
+
+static void
+intersect(XLineDouble *l1, XLineDouble *l2, XPointDouble *intersection)
+{
+    double check;
+    /*
+     * x = m1y + b1
+     * x = m2y + b2
+     * m1y + b1 = m2y + b2
+     * y * (m1 - m2) = b2 - b1
+     * y = (b2 - b1) / (m1 - m2)
+     */
+    double  m1 = compute_inverse_slope (l1);
+    double  b1 = compute_x_intercept (l1, m1);
+    double  m2 = compute_inverse_slope (l2);
+    double  b2 = compute_x_intercept (l2, m2);
+
+    intersection->y = (b2 - b1) / (m1 - m2);
+    intersection->x = m1 * intersection->y + b1;
+
+    check = m2 * intersection->y + b2;
+    if (check >= intersection->x)
+       check -= intersection->x;
+    else
+       check = intersection->x - check;
+    if (check > (1/(double)(1<<16))) {
+       fprintf(stderr, "intersect: intersection is off by %f\n", check);
+    }
+}
+
diff --git a/xlogo/RenderLogo.h b/xlogo/RenderLogo.h
new file mode 100644 (file)
index 0000000..386f830
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+
+Copyright 1988, 1990, 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.
+
+*/
+
+#ifndef _RenderLogo_h
+#define _RenderLogo_h
+
+void
+RenderLogo(Display *dpy, int op, Picture src, Picture dst, XRenderPictFormat *maskFormat,
+          int x, int y, unsigned int width, unsigned int height);
+
+#endif /* _RenderLogo_h */
diff --git a/xlogo/aclocal.m4 b/xlogo/aclocal.m4
new file mode 100644 (file)
index 0000000..c672817
--- /dev/null
@@ -0,0 +1,1783 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009  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.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
+[m4_warning([this file was generated for autoconf 2.65.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11.1], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# 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, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# 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])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+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, 2006, 2009
+# 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 10
+
+# 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], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$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
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    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, 2006, 2008, 2009 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 16
+
+# 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.62])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
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+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
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_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)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+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
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_AM_DEPENDENCIES(OBJC)],
+                 [define([AC_PROG_OBJC],
+                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# 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_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
+                         (and sometimes confusing) to the casual installer],
+      [USE_MAINTAINER_MODE=$enableval],
+      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  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, 2009  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_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.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
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+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, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# 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
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# 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, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _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],
+[m4_foreach_w([_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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# 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
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# 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) 2009  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 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# 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="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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
+
+dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
+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 ensure that this macro is defined, also add:
+# m4_ifndef([XORG_MACROS_VERSION],
+#     [m4_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.
+m4_defun([XORG_MACROS_VERSION],[
+m4_define([vers_have], [1.3.0])
+m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
+m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
+m4_if(m4_cmp(maj_have, maj_needed), 0,,
+    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
+m4_if(m4_version_compare(vers_have, [$1]), -1,
+    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
+m4_undefine([vers_have])
+m4_undefine([maj_have])
+m4_undefine([maj_needed])
+]) # 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])
+       # under Cygwin unix is still defined even with -undef
+       elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+               RAWCPPFLAGS="-undef -ansi"
+               AC_MSG_RESULT([yes, with -ansi])
+       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],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+
+if test x"$cross_compiling" = x"yes" ; then
+  HAVE_DEFS_ENT=no
+else
+  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+fi
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+AC_PATH_PROG(PS2PDF, ps2pdf)
+
+AC_MSG_CHECKING([Whether to build documentation])
+
+if test x$HAVE_DEFS_ENT != 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 && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([Whether to build text documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([Whether to build PDF documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([Whether to build PostScript documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([Whether to build HTML documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# 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,
+       AS_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, [AS_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, [AS_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
+
+# XORG_CWARNFLAGS
+# ---------------
+# Minimum version: 1.2.0
+#
+# Defines CWARNFLAGS to enable C compiler warnings.
+#
+AC_DEFUN([XORG_CWARNFLAGS], [
+AC_REQUIRE([AC_PROG_CC])
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+AC_SUBST(CWARNFLAGS)
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+]) # XORG_CWARNFLAGS
+
+# XORG_STRICT_OPTION
+# -----------------------
+# Minimum version: 1.3.0
+#
+# Add configure option to enable strict compilation
+AC_DEFUN([XORG_STRICT_OPTION], [
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CC_C99])
+AC_REQUIRE([XORG_CWARNFLAGS])
+
+AC_ARG_ENABLE(strict-compilation,
+                         AS_HELP_STRING([--enable-strict-compilation],
+                         [Enable all warnings from compiler and make them errors (default: disabled)]),
+                         [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
+if test "x$STRICT_COMPILE" = "xyes"; then
+       AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+       AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+AC_SUBST([CWARNFLAGS])
+]) # XORG_STRICT_OPTION
+
+# XORG_DEFAULT_OPTIONS
+# --------------------
+# Minimum version: 1.3.0
+#
+# Defines default options for X.Org modules.
+#
+AC_DEFUN([XORG_DEFAULT_OPTIONS], [
+XORG_CWARNFLAGS
+XORG_STRICT_OPTION
+XORG_RELEASE_VERSION
+XORG_CHANGELOG
+XORG_INSTALL
+XORG_MANPAGE_SECTIONS
+]) # XORG_DEFAULT_OPTIONS
+
+# XORG_INSTALL()
+# ----------------
+# Minimum version: 1.4.0
+#
+# Defines the variable INSTALL_CMD as the command to copy
+# INSTALL from $prefix/share/doc/util-macros.
+#
+AC_DEFUN([XORG_INSTALL], [
+AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+macros_docdir=$($PKG_CONFIG --print-errors --variable=docdir xorg-macros)
+INSTALL_CMD="(cp -f "$macros_docdir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"docdir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+AC_SUBST([INSTALL_CMD])
+]) # XORG_INSTALL
+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.  Also
+# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+AC_DEFUN([XORG_RELEASE_VERSION],[
+       AC_ARG_WITH(release-version,
+                       AS_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
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+               [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+               [Major version of this package])
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+               [$PVM],
+               [Minor version of this package])
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+               [$PVP],
+               [Patch version of this package])
+])
+
+# XORG_CHANGELOG()
+# ----------------
+# Minimum version: 1.2.0
+#
+# Defines the variable CHANGELOG_CMD as the command to generate
+# ChangeLog from git.
+#
+#
+AC_DEFUN([XORG_CHANGELOG], [
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+AC_SUBST([CHANGELOG_CMD])
+]) # XORG_CHANGELOG
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# 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 "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _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 --print-errors "$2" 2>&1`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       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 <http://pkg-config.freedesktop.org/>.])],
+               [$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
+
diff --git a/xlogo/app-defaults/XLogo b/xlogo/app-defaults/XLogo
new file mode 100644 (file)
index 0000000..a70ff3c
--- /dev/null
@@ -0,0 +1,4 @@
+XLogo*iconPixmap:    xlogo32
+XLogo*iconMask:      xlogo32
+XLogo*baseTranslations: #override \
+<Key>q,<Key>Escape: quit()
diff --git a/xlogo/app-defaults/XLogo-color b/xlogo/app-defaults/XLogo-color
new file mode 100644 (file)
index 0000000..add98cc
--- /dev/null
@@ -0,0 +1,5 @@
+! $Xorg: XLogo-co.ad,v 1.3 2000/08/17 19:54:52 cpqbld Exp $
+#include "XLogo"
+! MIT colors are Cardinal Red (Pantone 201c) and Silver Grey (Pantone 421c)
+XLogo*background: rgb:d2/22/32
+XLogo*foreground: rgb:d7/d7/d7
diff --git a/xlogo/config.guess b/xlogo/config.guess
new file mode 100755 (executable)
index 0000000..dc84c68
--- /dev/null
@@ -0,0 +1,1501 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+#   Free Software Foundation, Inc.
+
+timestamp='2009-11-20'
+
+# 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 (context
+# diff format) to <config-patches@gnu.org> and include a 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.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+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 <config-patches@gnu.org>."
+
+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, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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 "$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 ;;
+           sh5el) machine=sh5le-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 -q __ELF__
+               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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+       echo i386-pc-auroraux${UNAME_RELEASE}
+       exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+       eval $set_cc_for_build
+       SUN_ARCH="i386"
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       echo ${SUN_ARCH}-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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:*:[456])
+       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+               IBM_ARCH=rs6000
+       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 <stdlib.h>
+              #include <unistd.h>
+
+              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 -q __LP64__
+           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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       exit ;;
+    i*:CYGWIN*:*)
+       echo ${UNAME_MACHINE}-pc-cygwin
+       exit ;;
+    *: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 ;;
+    *:Interix*:*)
+       case ${UNAME_MACHINE} in
+           x86)
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           authenticamd | genuineintel | EM64T)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+           IA64)
+               echo ia64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+       esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       exit ;;
+    8664:Windows_NT:*)
+       echo x86_64-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*:*:* | x86_64: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 ;;
+    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 -q ld.so.1
+       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+       exit ;;
+    arm*:Linux:*:*)
+       eval $set_cc_for_build
+       if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_EABI__
+       then
+           echo ${UNAME_MACHINE}-unknown-linux-gnu
+       else
+           echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+       fi
+       exit ;;
+    avr32*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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 ;;
+    i*86:Linux:*:*)
+       LIBC=gnu
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+       echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+       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:*:* | mips64:Linux:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #undef CPU
+       #undef ${UNAME_MACHINE}
+       #undef ${UNAME_MACHINE}el
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=${UNAME_MACHINE}el
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       CPU=${UNAME_MACHINE}
+       #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; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-unknown-linux-gnu
+       exit ;;
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-gnu
+       exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+       echo hppa64-unknown-linux-gnu
+       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 ;;
+    ppc64:Linux:*:*)
+       echo powerpc64-unknown-linux-gnu
+       exit ;;
+    ppc:Linux:*:*)
+       echo powerpc-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 ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-gnu
+       exit ;;
+    x86_64:Linux:*:*)
+       echo x86_64-unknown-linux-gnu
+       exit ;;
+    xtensa*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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.[02]*:*)
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-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; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       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; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; 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.[02]*:*)
+       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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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 ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       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 ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-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
+           i386)
+               eval $set_cc_for_build
+               if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+                 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+                     (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+                     grep IS_64BIT_ARCH >/dev/null
+                 then
+                     UNAME_PROCESSOR="x86_64"
+                 fi
+               fi ;;
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/xlogo/config.h.in b/xlogo/config.h.in
new file mode 100644 (file)
index 0000000..69bc43a
--- /dev/null
@@ -0,0 +1,67 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* 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 home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 to use Xrender & Xft2 to draw logo */
+#undef XRENDER
diff --git a/xlogo/config.sub b/xlogo/config.sub
new file mode 100755 (executable)
index 0000000..2a55a50
--- /dev/null
@@ -0,0 +1,1705 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+#   Free Software Foundation, Inc.
+
+timestamp='2009-11-20'
+
+# 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 <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted GNU 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.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# 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 <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-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 | -microblaze)
+               os=
+               basic_machine=$1
+               ;;
+        -bluegene*)
+               os=-cnk
+               ;;
+       -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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | bfin \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fido | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | lm32 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore | mep | metag \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64octeon | mips64octeonel \
+       | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | moxie \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | rx \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | ubicom32 \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | z8k | z80)
+               basic_machine=$basic_machine-unknown
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12 | picochip)
+               # Motorola 68HC11/12.
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64octeon-* | mips64octeonel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | none-* | np1-* | ns16k-* | ns32k-* \
+       | orion-* \
+       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+       | pyramid-* \
+       | romp-* | rs6000-* | rx-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+       | tron-* \
+       | ubicom32-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa*-* \
+       | ymp-* \
+       | z8k-* | z80-*)
+               ;;
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               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
+               ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       bluegene*)
+               basic_machine=powerpc-ibm
+               os=-cnk
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+        cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
+       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
+               ;;
+       cr16)
+               basic_machine=cr16-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
+               ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
+       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
+               ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       m88k-omron*)
+               basic_machine=m88k-omron
+               ;;
+       magnum | m3230)
+               basic_machine=mips-mips
+               os=-sysv
+               ;;
+       merlin)
+               basic_machine=ns32k-utek
+               os=-sysv
+               ;;
+        microblaze)
+               basic_machine=microblaze-xilinx
+               ;;
+       mingw32)
+               basic_machine=i386-pc
+               os=-mingw32
+               ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
+       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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       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
+               ;;
+       tile*)
+               basic_machine=tile-unknown
+               os=-linux-gnu
+               ;;
+       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
+               ;;
+       z80-*-coff)
+               basic_machine=z80-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[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+               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.
+        -auroraux)
+               os=-auroraux
+               ;;
+       -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* | -cnk* | -sunos | -sunos[34]*\
+             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+             | -sym* | -kopensolaris* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* | -aros* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
+             | -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* | -cegcc* \
+             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -linux-newlib* | -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* | -rdos* | -toppers* | -drops* | -es*)
+       # 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
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+       -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
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
+       *-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
+               ;;
+        mep-*)
+               os=-elf
+               ;;
+       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
+                               ;;
+                       -cnk*|-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/xlogo/configure b/xlogo/configure
new file mode 100755 (executable)
index 0000000..babcb15
--- /dev/null
@@ -0,0 +1,7114 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.65 for xlogo 1.0.2.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+        /*)
+          for as_base in sh bash ksh sh5; do
+            # Try only shells that exist, to save several forks.
+            as_shell=$as_dir/$as_base
+            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+          done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+       # neutralization value for shells without unset; and this also
+       # works around shells that cannot unset nonexistent variables.
+       BASH_ENV=/dev/null
+       ENV=/dev/null
+       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+       export CONFIG_SHELL
+       exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$?; test $as_status -eq 0 && as_status=1
+  if test "$3"; then
+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  fi
+  $as_echo "$as_me: error: $1" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# 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`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='xlogo'
+PACKAGE_TARNAME='xlogo'
+PACKAGE_VERSION='1.0.2'
+PACKAGE_STRING='xlogo 1.0.2'
+PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+appdefaultdir
+APPDEFS_LIBS
+APPDEFS_CFLAGS
+XEXT_LIBS
+XEXT_CFLAGS
+XFT_LIBS
+XFT_CFLAGS
+XRENDER_LIBS
+XRENDER_CFLAGS
+XLOGO_LIBS
+XLOGO_CFLAGS
+ADMIN_MAN_DIR
+DRIVER_MAN_DIR
+MISC_MAN_DIR
+FILE_MAN_DIR
+LIB_MAN_DIR
+APP_MAN_DIR
+ADMIN_MAN_SUFFIX
+DRIVER_MAN_SUFFIX
+MISC_MAN_SUFFIX
+FILE_MAN_SUFFIX
+LIB_MAN_SUFFIX
+APP_MAN_SUFFIX
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+INSTALL_CMD
+PKG_CONFIG
+CHANGELOG_CMD
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+CWARNFLAGS
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_silent_rules
+enable_strict_compilation
+with_release_version
+with_render
+with_appdefaultdir
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+PKG_CONFIG
+XLOGO_CFLAGS
+XLOGO_LIBS
+XRENDER_CFLAGS
+XRENDER_LIBS
+XFT_CFLAGS
+XFT_LIBS
+XEXT_CFLAGS
+XEXT_LIBS
+APPDEFS_CFLAGS
+APPDEFS_LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)   ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=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 ;;
+
+  -*) as_fn_error "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information."
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_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'`
+  as_fn_error "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
+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
+    $as_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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error "pwd does not report name of working directory"
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 xlogo 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/xlogo]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_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 xlogo 1.0.2:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --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
+  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')
+  --enable-strict-compilation
+                          Enable all warnings from compiler and make them
+                          errors (default: disabled)
+
+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
+  --with-xrender          Use Xrender & Xft2 to draw logo
+  --with-appdefaultdir=<pathname>
+                          specify directory for app-defaults files (default is
+                          autodetected)
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  PKG_CONFIG  path to pkg-config utility
+  XLOGO_CFLAGS
+              C compiler flags for XLOGO, overriding pkg-config
+  XLOGO_LIBS  linker flags for XLOGO, overriding pkg-config
+  XRENDER_CFLAGS
+              C compiler flags for XRENDER, overriding pkg-config
+  XRENDER_LIBS
+              linker flags for XRENDER, overriding pkg-config
+  XFT_CFLAGS  C compiler flags for XFT, overriding pkg-config
+  XFT_LIBS    linker flags for XFT, overriding pkg-config
+  XEXT_CFLAGS C compiler flags for XEXT, overriding pkg-config
+  XEXT_LIBS   linker flags for XEXT, overriding pkg-config
+  APPDEFS_CFLAGS
+              C compiler flags for APPDEFS, overriding pkg-config
+  APPDEFS_LIBS
+              linker flags for APPDEFS, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+xlogo configure 1.0.2
+generated by GNU Autoconf 2.65
+
+Copyright (C) 2009 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
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR
+# ------------------------------------
+# Tests whether SYMBOL is declared, setting cache variable VAR accordingly.
+ac_fn_c_check_decl ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5
+$as_echo_n "checking whether $2 is declared... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+#ifndef $2
+  (void) $2;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_decl
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_compile
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by xlogo $as_me 1.0.2, which was
+generated by GNU Autoconf 2.65.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append 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
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+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,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > 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
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_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.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_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 $ac_precious_vars; 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,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_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
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_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.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+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.11'
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  for ac_t in install-sh install.sh shtool; do
+    if test -f "$ac_dir/$ac_t"; then
+      ac_aux_dir=$ac_dir
+      ac_install_sh="$ac_aux_dir/$ac_t -c"
+      break 2
+    fi
+  done
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$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'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# 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".
+      as_fn_error "ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "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 $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+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='xlogo'
+ 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"}
+
+# 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 -'
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-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
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$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
+
+
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+
+
+
+
+
+
+
+
+
+
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-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
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+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
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "no acceptable C compiler found in \$PATH
+See \`config.log' for more details." "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM 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.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "C compiler cannot create executables
+See \`config.log' for more details." "$LINENO" 5; }; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+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
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+  $as_echo_n "(cached) " >&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
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$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
+
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." "$LINENO" 5; }
+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
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+eval as_val=\$$as_ac_Header
+   if test "x$as_val" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if test "${ac_cv_prog_cc_c99+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+       {
+       case 's': // string
+         str = va_arg (args_copy, const char *);
+         break;
+       case 'd': // int
+         number = va_arg (args_copy, int);
+         break;
+       case 'f': // float
+         fnumber = va_arg (args_copy, double);
+         break;
+       default:
+         break;
+       }
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+         || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+fi
+
+
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default"
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then :
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=0;;
+esac
+AM_BACKSLASH='\'
+
+
+
+
+
+
+
+# Check whether --enable-strict-compilation was given.
+if test "${enable_strict_compilation+set}" = set; then :
+  enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval
+else
+  STRICT_COMPILE=no
+fi
+
+if test "x$STRICT_COMPILE" = "xyes"; then
+       ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default"
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then :
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+       ac_fn_c_check_decl "$LINENO" "__INTEL_COMPILER" "ac_cv_have_decl___INTEL_COMPILER" "$ac_includes_default"
+if test "x$ac_cv_have_decl___INTEL_COMPILER" = x""yes; then :
+  INTELCC="yes"
+else
+  INTELCC="no"
+fi
+
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+
+
+
+
+# Check whether --with-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"
+               { $as_echo "$as_me:${as_lineno-$LINENO}: Building with package name set to $PACKAGE" >&5
+$as_echo "$as_me: Building with package name set to $PACKAGE" >&6;}
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+
+
+
+
+macros_docdir=$($PKG_CONFIG --print-errors --variable=docdir xorg-macros)
+INSTALL_CMD="(cp -f "$macros_docdir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"docdir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+
+
+
+
+
+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_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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+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
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "no acceptable C compiler found in \$PATH
+See \`config.log' for more details." "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+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
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+  $as_echo_n "(cached) " >&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
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$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
+
+
+
+
+# Checks for pkg-config packages
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XLOGO" >&5
+$as_echo_n "checking for XLOGO... " >&6; }
+
+if test -n "$XLOGO_CFLAGS"; then
+    pkg_cv_XLOGO_CFLAGS="$XLOGO_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xaw7 xt\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xaw7 xt") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XLOGO_CFLAGS=`$PKG_CONFIG --cflags "xaw7 xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XLOGO_LIBS"; then
+    pkg_cv_XLOGO_LIBS="$XLOGO_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xaw7 xt\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xaw7 xt") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XLOGO_LIBS=`$PKG_CONFIG --libs "xaw7 xt" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               XLOGO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xaw7 xt" 2>&1`
+        else
+               XLOGO_PKG_ERRORS=`$PKG_CONFIG --print-errors "xaw7 xt" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XLOGO_PKG_ERRORS" >&5
+
+       as_fn_error "Package requirements (xaw7 xt) were not met:
+
+$XLOGO_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 XLOGO_CFLAGS
+and XLOGO_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 XLOGO_CFLAGS
+and XLOGO_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." "$LINENO" 5; }
+else
+       XLOGO_CFLAGS=$pkg_cv_XLOGO_CFLAGS
+       XLOGO_LIBS=$pkg_cv_XLOGO_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       :
+fi
+
+# Use render & xft2 to draw logo?
+
+
+# Check whether --with-render was given.
+if test "${with_render+set}" = set; then :
+  withval=$with_render; USE_RENDER="$withval"
+else
+  USE_RENDER="try"
+fi
+
+
+if test "x$USE_RENDER" = "xtry" ; then
+       if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xrender xft\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xrender xft") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  USE_RENDER="yes"
+else
+  USE_RENDER="no"
+fi
+fi
+
+if test "x$USE_RENDER" = "xyes" ; then
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRENDER" >&5
+$as_echo_n "checking for XRENDER... " >&6; }
+
+if test -n "$XRENDER_CFLAGS"; then
+    pkg_cv_XRENDER_CFLAGS="$XRENDER_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xrender\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xrender") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XRENDER_CFLAGS=`$PKG_CONFIG --cflags "xrender" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XRENDER_LIBS"; then
+    pkg_cv_XRENDER_LIBS="$XRENDER_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xrender\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xrender") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XRENDER_LIBS=`$PKG_CONFIG --libs "xrender" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               XRENDER_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xrender" 2>&1`
+        else
+               XRENDER_PKG_ERRORS=`$PKG_CONFIG --print-errors "xrender" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XRENDER_PKG_ERRORS" >&5
+
+       as_fn_error "Package requirements (xrender) were not met:
+
+$XRENDER_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 XRENDER_CFLAGS
+and XRENDER_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 XRENDER_CFLAGS
+and XRENDER_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." "$LINENO" 5; }
+else
+       XRENDER_CFLAGS=$pkg_cv_XRENDER_CFLAGS
+       XRENDER_LIBS=$pkg_cv_XRENDER_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       :
+fi
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XFT" >&5
+$as_echo_n "checking for XFT... " >&6; }
+
+if test -n "$XFT_CFLAGS"; then
+    pkg_cv_XFT_CFLAGS="$XFT_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xft\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xft") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XFT_CFLAGS=`$PKG_CONFIG --cflags "xft" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XFT_LIBS"; then
+    pkg_cv_XFT_LIBS="$XFT_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xft\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xft") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XFT_LIBS=`$PKG_CONFIG --libs "xft" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               XFT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xft" 2>&1`
+        else
+               XFT_PKG_ERRORS=`$PKG_CONFIG --print-errors "xft" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XFT_PKG_ERRORS" >&5
+
+       as_fn_error "Package requirements (xft) were not met:
+
+$XFT_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 XFT_CFLAGS
+and XFT_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 XFT_CFLAGS
+and XFT_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." "$LINENO" 5; }
+else
+       XFT_CFLAGS=$pkg_cv_XFT_CFLAGS
+       XFT_LIBS=$pkg_cv_XFT_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       :
+fi
+
+
+$as_echo "#define XRENDER 1" >>confdefs.h
+
+
+       XLOGO_CFLAGS="$XLOGO_CFLAGS $XRENDER_CFLAGS $XFT_CFLAGS"
+       XLOGO_LIBS="$XLOGO_LIBS $XRENDER_LIBS $XFT_LIBS"
+fi
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XEXT" >&5
+$as_echo_n "checking for XEXT... " >&6; }
+
+if test -n "$XEXT_CFLAGS"; then
+    pkg_cv_XEXT_CFLAGS="$XEXT_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xext\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xext") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XEXT_CFLAGS=`$PKG_CONFIG --cflags "xext" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XEXT_LIBS"; then
+    pkg_cv_XEXT_LIBS="$XEXT_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xext\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xext") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XEXT_LIBS=`$PKG_CONFIG --libs "xext" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               XEXT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xext" 2>&1`
+        else
+               XEXT_PKG_ERRORS=`$PKG_CONFIG --print-errors "xext" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XEXT_PKG_ERRORS" >&5
+
+       as_fn_error "Package requirements (xext) were not met:
+
+$XEXT_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 XEXT_CFLAGS
+and XEXT_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 XEXT_CFLAGS
+and XEXT_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." "$LINENO" 5; }
+else
+       XEXT_CFLAGS=$pkg_cv_XEXT_CFLAGS
+       XEXT_LIBS=$pkg_cv_XEXT_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       :
+fi
+XLOGO_CFLAGS="$XLOGO_CFLAGS $XEXT_CFLAGS"
+XLOGO_LIBS="$XLOGO_LIBS $XEXT_LIBS"
+
+XLOGO_CFLAGS="$CWARNFLAGS $XLOGO_CFLAGS"
+
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for APPDEFS" >&5
+$as_echo_n "checking for APPDEFS... " >&6; }
+
+if test -n "$APPDEFS_CFLAGS"; then
+    pkg_cv_APPDEFS_CFLAGS="$APPDEFS_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xt\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_APPDEFS_CFLAGS=`$PKG_CONFIG --cflags "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$APPDEFS_LIBS"; then
+    pkg_cv_APPDEFS_LIBS="$APPDEFS_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xt\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_APPDEFS_LIBS=`$PKG_CONFIG --libs "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xt" 2>&1`
+        else
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --print-errors "xt" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$APPDEFS_PKG_ERRORS" >&5
+
+       as_fn_error "Package requirements (xt) were not met:
+
+$APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." "$LINENO" 5; }
+else
+       APPDEFS_CFLAGS=$pkg_cv_APPDEFS_CFLAGS
+       APPDEFS_LIBS=$pkg_cv_APPDEFS_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       :
+fi
+xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+
+# Check whether --with-appdefaultdir was given.
+if test "${with_appdefaultdir+set}" = set; then :
+  withval=$with_appdefaultdir; appdefaultdir="$withval"
+else
+  appdefaultdir="${xt_appdefaultdir}"
+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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     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" &&
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+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_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $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}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$?; test $as_status -eq 0 && as_status=1
+  if test "$3"; then
+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  fi
+  $as_echo "$as_me: error: $1" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by xlogo $as_me 1.0.2, which was
+generated by GNU Autoconf 2.65.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+xlogo config.status 1.0.2
+configured by $0, generated by GNU Autoconf 2.65,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2009 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+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
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  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 || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || as_fn_error "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# 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
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #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.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # 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.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || as_fn_error "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || as_fn_error "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+       || as_fn_error "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$_am_arg" : 'X\(//\)[^/]' \| \
+        X"$_am_arg" : 'X\(//\)$' \| \
+        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_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=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# 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 || as_fn_exit $?
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/xlogo/configure.ac b/xlogo/configure.ac
new file mode 100644 (file)
index 0000000..b213a50
--- /dev/null
@@ -0,0 +1,79 @@
+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(xlogo, [1.0.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xlogo)
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+          [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+XORG_DEFAULT_OPTIONS
+
+
+AM_CONFIG_HEADER(config.h)
+
+AC_PROG_CC
+AC_PROG_INSTALL
+
+# Checks for pkg-config packages
+PKG_CHECK_MODULES(XLOGO, xaw7 xt)
+
+# Use render & xft2 to draw logo?
+
+AC_ARG_WITH(render, 
+       AC_HELP_STRING([--with-xrender], [Use Xrender & Xft2 to draw logo]), 
+       USE_RENDER="$withval", USE_RENDER="try")
+
+if test "x$USE_RENDER" = "xtry" ; then
+       PKG_CHECK_EXISTS([xrender xft], USE_RENDER="yes", USE_RENDER="no")
+fi
+
+if test "x$USE_RENDER" = "xyes" ; then
+       PKG_CHECK_MODULES(XRENDER, xrender)
+       PKG_CHECK_MODULES(XFT, xft)
+
+       AC_DEFINE(XRENDER, 1, [Define to 1 to use Xrender & Xft2 to draw logo])
+
+       XLOGO_CFLAGS="$XLOGO_CFLAGS $XRENDER_CFLAGS $XFT_CFLAGS"
+       XLOGO_LIBS="$XLOGO_LIBS $XRENDER_LIBS $XFT_LIBS"
+fi
+
+PKG_CHECK_MODULES(XEXT, xext)
+XLOGO_CFLAGS="$XLOGO_CFLAGS $XEXT_CFLAGS"
+XLOGO_LIBS="$XLOGO_LIBS $XEXT_LIBS"
+
+XLOGO_CFLAGS="$CWARNFLAGS $XLOGO_CFLAGS"
+AC_SUBST(XLOGO_CFLAGS)
+AC_SUBST(XLOGO_LIBS)
+
+PKG_CHECK_MODULES(APPDEFS, xt)
+xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+AC_ARG_WITH(appdefaultdir,
+       AC_HELP_STRING([--with-appdefaultdir=<pathname>],
+         [specify directory for app-defaults files (default is autodetected)]),
+       [appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"])
+AC_SUBST(appdefaultdir)
+
+AC_OUTPUT([Makefile])
diff --git a/xlogo/depcomp b/xlogo/depcomp
new file mode 100755 (executable)
index 0000000..df8eea7
--- /dev/null
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s,\\\\\\\\,/,g"
+   depmode=msvisualcpp
+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.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    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.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[     ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "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"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${
+              s/^ *//
+              s/ \\*$//
+              s/$/:/
+              p
+            }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # 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 mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $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 "X$1" != 'X--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 "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    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.
+    -arch)
+      eat=yes ;;
+    -*|$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 "X$1" != 'X--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.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::     \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # 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
+  ;;
+
+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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xlogo/install-sh b/xlogo/install-sh
new file mode 100755 (executable)
index 0000000..6781b98
--- /dev/null
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# 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.
+
+nl='
+'
+IFS=" ""       $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+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:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+       shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+       case $mode in
+         *' '* | *'    '* | *'
+'*       | *'*'* | *'?'* | *'['*)
+           echo "$0: invalid mode: $mode" >&2
+           exit 1;;
+       esac
+       shift;;
+
+    -o) chowncmd="$chownprog $2"
+       shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+       shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)        shift
+       break;;
+
+    -*)        echo "$0: invalid option: $1" >&2
+       exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # 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: $dst_arg: Is a directory" >&2
+       exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+       (dirname "$dst") 2>/dev/null ||
+       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+            X"$dst" : 'X\(//\)[^/]' \| \
+            X"$dst" : 'X\(//\)$' \| \
+            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+       echo X"$dst" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+       # Create intermediate dirs using mode 755 as modified by the umask.
+       # This is like FreeBSD 'install' as of 1997-10-28.
+       umask=`umask`
+       case $stripcmd.$umask in
+         # Optimize common cases.
+         *[2367][2367]) mkdir_umask=$umask;;
+         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+         *[0-7])
+           mkdir_umask=`expr $umask + 22 \
+             - $umask % 100 % 40 + $umask % 20 \
+             - $umask % 10 % 4 + $umask % 2
+           `;;
+         *) mkdir_umask=$umask,go-w;;
+       esac
+
+       # With -d, create the new directory with the user-specified mode.
+       # Otherwise, rely on $mkdir_umask.
+       if test -n "$dir_arg"; then
+         mkdir_mode=-m$mode
+       else
+         mkdir_mode=
+       fi
+
+       posix_mkdir=false
+       case $umask in
+         *[123567][0-7][0-7])
+           # POSIX mkdir -p sets u+wx bits regardless of umask, which
+           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+           ;;
+         *)
+           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+           if (umask $mkdir_umask &&
+               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+           then
+             if test -z "$dir_arg" || {
+                  # Check for POSIX incompatibilities with -m.
+                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                  # other-writeable bit of parent directory when it shouldn't.
+                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                  case $ls_ld_tmpdir in
+                    d????-?r-*) different_mode=700;;
+                    d????-?--*) different_mode=755;;
+                    *) false;;
+                  esac &&
+                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                  }
+                }
+             then posix_mkdir=:
+             fi
+             rmdir "$tmpdir/d" "$tmpdir"
+           else
+             # Remove any dirs left behind by ancient mkdir implementations.
+             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+           fi
+           trap '' 0;;
+       esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+       umask $mkdir_umask &&
+       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+       /*) prefix='/';;
+       -*) prefix='./';;
+       *)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+       test -z "$d" && continue
+
+       prefix=$prefix$d
+       if test -d "$prefix"; then
+         prefixes=
+       else
+         if $posix_mkdir; then
+           (umask=$mkdir_umask &&
+            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+           # Don't fail if two instances are running concurrently.
+           test -d "$prefix" || exit 1
+         else
+           case $prefix in
+             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+             *) qprefix=$prefix;;
+           esac
+           prefixes="$prefixes '$qprefix'"
+         fi
+       fi
+       prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+       # Don't fail if two instances are running concurrently.
+       (umask $mkdir_umask &&
+        eval "\$doit_exec \$mkdirprog $prefixes") ||
+         test -d "$dstdir" || exit 1
+       obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # 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
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"    2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+       # Now remove or move aside any old file at destination location.
+       # We try this two ways since rm can't unlink itself on some
+       # systems and the destination file might be busy for other
+       # reasons.  In this case, the final cleanup might fail but the new
+       # file should still install successfully.
+       {
+         test ! -f "$dst" ||
+         $doit $rmcmd -f "$dst" 2>/dev/null ||
+         { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+           { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+         } ||
+         { echo "$0: cannot unlink or rename $dst" >&2
+           (exit 1); exit 1
+         }
+       } &&
+
+       # Now rename the file to the real destination.
+       $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xlogo/missing b/xlogo/missing
new file mode 100755 (executable)
index 0000000..28055d2
--- /dev/null
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# 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=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+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'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  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]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
+# 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).  This is about non-GNU programs, so use $1 not
+# $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 $program 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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if test ! -f y.tab.h; then
+       echo >y.tab.h
+    fi
+    if test ! -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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if test ! -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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit $?
+    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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+       /^@setfilename/{
+         s/.* \([^ ]*\) *$/\1/
+         p
+         q
+       }' $infile`
+      # ... 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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xlogo/xlogo.c b/xlogo/xlogo.c
new file mode 100644 (file)
index 0000000..10b4d5c
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+
+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.
+
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Shell.h>
+#include "xlogo.h"
+#include "Logo.h"
+#include <X11/Xaw/Cardinals.h>
+#ifdef XKB
+#include <X11/extensions/XKBbells.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+
+/* Global vars*/
+const char *ProgramName;    /* program name (from argv[0]) */
+
+static void quit(Widget w,  XEvent *event, String *params, Cardinal *num_params);
+
+static XrmOptionDescRec options[] = {
+{ "-shape", "*shapeWindow", XrmoptionNoArg, (XPointer) "on" },
+#ifdef XRENDER
+{"-render", "*render",XrmoptionNoArg, "TRUE"},
+{"-sharp", "*sharp", XrmoptionNoArg, "TRUE"},
+#endif
+{"-v",         "Verbose",     XrmoptionNoArg,  "TRUE"},
+{"-q",         "Quiet",       XrmoptionNoArg,  "TRUE"},
+};
+
+static XtActionsRec actions[] = {
+    {"quit",   quit },
+};
+
+static Atom wm_delete_window;
+
+/* See xlogo.h */
+XLogoResourceData userOptions;
+
+#define Offset(field) XtOffsetOf(XLogoResourceData, field)
+
+static XtResource resources[] = {
+  {"verbose",   "Verbose",   XtRBoolean, sizeof(Boolean), Offset(verbose),      XtRImmediate, (XtPointer)False},
+  {"quiet",     "Quiet",     XtRBoolean, sizeof(Boolean), Offset(quiet),        XtRImmediate, (XtPointer)False},
+};
+
+
+static String fallback_resources[] = {
+    "*iconPixmap:    xlogo32",
+    "*iconMask:      xlogo32",
+    "*baseTranslations: #override \\"
+                        "\t<Key>q: quit()",
+    NULL,
+};
+
+static void
+die(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    XtAppSetExitFlag(XtWidgetToApplicationContext(w));
+}
+
+static void
+save(Widget w, XtPointer client_data, XtPointer call_data)
+{
+    return;
+}
+
+/*
+ * Report the syntax for calling xlogo.
+ */
+
+static void
+Syntax(Widget toplevel)
+{
+    Arg arg;
+    SmcConn connection;
+    String reasons[10];
+    int i, n = 0;
+
+    reasons[n++] = "Usage: ";
+    reasons[n++] = (String)ProgramName;
+    reasons[n++] = " [-fg <color>] [-bg <color>] [-rv] [-bw <pixels>] [-bd <color>]\n";
+    reasons[n++] = "             [-v] [-q]\n";
+    reasons[n++] = "             [-d [<host>]:[<vs>]]\n";
+    reasons[n++] = "             [-g [<width>][x<height>][<+-><xoff>[<+-><yoff>]]]\n";
+#ifdef XRENDER
+    reasons[n++] = "             [-render] [-sharp]\n";
+#endif /* XRENDER */
+    reasons[n++] = "             [-shape]\n\n";
+
+    XtSetArg(arg, XtNconnection, &connection);
+    XtGetValues(toplevel, &arg, (Cardinal)1);
+    if (connection)
+       SmcCloseConnection(connection, n, reasons);
+    else {
+       for (i=0; i < n; i++)
+           printf("%s", reasons[i]);
+    }
+    exit(EXIT_FAILURE);
+}
+
+int
+main(int argc, char *argv[])
+{
+    Widget toplevel;
+    XtAppContext app_con;
+
+    ProgramName = argv[0];
+
+    toplevel = XtOpenApplication(&app_con, "XLogo",
+                                options, XtNumber(options),
+                                &argc, argv, fallback_resources,
+                                sessionShellWidgetClass, NULL, ZERO);
+    if (argc != 1)
+       Syntax(toplevel);
+
+    XtGetApplicationResources(toplevel, (XtPointer)&userOptions, resources,
+                              XtNumber(resources), NULL, 0);
+
+    XtAppAddActions(app_con, actions, XtNumber(actions));
+
+    XtAddCallback(toplevel, XtNsaveCallback, save, NULL);
+    XtAddCallback(toplevel, XtNdieCallback,  die,  NULL);
+    XtOverrideTranslations
+       (toplevel, XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()"));
+    XtCreateManagedWidget("xlogo", logoWidgetClass, toplevel, NULL, ZERO);
+    XtRealizeWidget(toplevel);
+    wm_delete_window = XInternAtom(XtDisplay(toplevel), "WM_DELETE_WINDOW",
+                                  False);
+    (void) XSetWMProtocols (XtDisplay(toplevel), XtWindow(toplevel),
+                           &wm_delete_window, 1);
+
+    XtAppMainLoop(app_con);
+
+    return EXIT_SUCCESS;
+}
+
+/*ARGSUSED*/
+static void
+quit(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    Arg arg;
+
+    if (event->type == ClientMessage &&
+       (Atom)event->xclient.data.l[0] != wm_delete_window) {
+#ifdef XKB
+       XkbStdBell(XtDisplay(w), XtWindow(w), 0, XkbBI_BadValue);
+#else
+       XBell(XtDisplay(w), 0);
+#endif
+    } else {
+       /* resign from the session */
+       XtSetArg(arg, XtNjoinSession, False);
+       XtSetValues(w, &arg, ONE);
+       die(w, NULL, NULL);
+    }
+}
+
diff --git a/xlogo/xlogo.h b/xlogo/xlogo.h
new file mode 100644 (file)
index 0000000..24b5f9f
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+
+Copyright 2004 Roland Mainz <roland.mainz@nrubsig.org>
+
+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.
+
+ */
+
+#ifndef XLOGO_XLOGO_H
+#define XLOGO_XLOGO_H 1
+
+#include <X11/Intrinsic.h>
+
+/* Turn a NULL pointer string into an empty string */
+#define NULLSTR(x) (((x)!=NULL)?(x):(""))
+
+#define Error(x) { printf x ; exit(EXIT_FAILURE); }
+#define Log(x)   { if(userOptions.verbose) printf x; }
+#define Msg(x)   { if((!userOptions.quiet) || userOptions.verbose) printf x; }
+
+typedef struct {
+  Boolean verbose;
+  Boolean quiet;
+  Boolean printAndExit;
+  String  printername;
+  String  printfile;
+} XLogoResourceData, *XLogoResourceDataPtr;
+
+/* Global vars */
+extern const char        *ProgramName; /* program name (from argv[0]) */
+extern XLogoResourceData  userOptions;
+
+#endif /* !XLOGO_XLOGO_H */
+
diff --git a/xlogo/xlogo.man b/xlogo/xlogo.man
new file mode 100644 (file)
index 0000000..82b809f
--- /dev/null
@@ -0,0 +1,90 @@
+.\" Copyright 1988, 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.
+.\"
+.TH XLOGO 1 __xorgversion__
+.SH NAME
+xlogo - X Window System logo
+.SH SYNOPSIS
+.B xlogo
+[-\fItoolkitoption\fP ...]
+.SH DESCRIPTION
+The \fIxlogo\fP program displays the X Window System logo.
+.SH OPTIONS
+.I Xlogo
+accepts all of the standard X Toolkit command line options, as well as the
+following:
+.TP 8
+.B \-render
+This option indicates that the logo should be drawn with anti-aliased edges using the RENDER extension.
+.TP 8
+.B \-sharp
+If -render is also specified, this forces the edges to be rendered in sharp mode, (ie. 1-bit alpha channel).
+.TP 8
+.B \-shape
+This option indicates that the logo window should be shaped rather than
+rectangular.
+.SH RESOURCES
+The default width and the default height are each 100 pixels.
+This program uses the \fILogo\fP widget in the Athena widget set.  It
+understands all of the Simple widget resource names and classes as well as:
+.TP 8
+.B foreground (\fPclass\fB Foreground)
+Specifies the color for the logo.  The default is depends on whether
+\fIreverseVideo\fP is specified.  If \fIreverseVideo\fP is specified
+the default is \fIXtDefaultForeground\fP, otherwise the default is
+\fIXtDefaultBackground\fP.
+.TP 8
+.B shapeWindow (\fPclass\fB ShapeWindow)
+Specifies that the window is shaped to the X logo.  The default is False.
+.SH WIDGETS
+In order to specify resources, it is useful to know the hierarchy of
+the widgets which compose \fIxlogo\fR.  In the notation below,
+indentation indicates hierarchical structure.  The widget class name
+is given first, followed by the widget instance name.
+.sp
+.nf
+.TA .5i
+.ta .5i
+XLogo  xlogo
+       Logo  xlogo
+.fi
+.sp
+.SH ENVIRONMENT
+.TP 8
+.B DISPLAY
+to get the default host and display number.
+.TP 8
+.B XENVIRONMENT
+to get the name of a resource file that overrides the global resources
+stored in the RESOURCE_MANAGER property.
+.SH FILES
+.TP
+.I __apploaddir__/XLogo
+specifies required resources
+.SH SEE ALSO
+X(__miscmansuffix__), xrdb(1)
+.SH AUTHORS
+Ollie Jones of Apollo Computer and Jim Fulton of the MIT X Consortium
+wrote the logo graphics routine, based on a graphic design by Danny
+Chong and Ross Chapman of Apollo Computer.
diff --git a/xmag/AUTHORS b/xmag/AUTHORS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xmag/COPYING b/xmag/COPYING
new file mode 100644 (file)
index 0000000..7f33cbf
--- /dev/null
@@ -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/xmag/ChangeLog b/xmag/ChangeLog
new file mode 100644 (file)
index 0000000..aeb1411
--- /dev/null
@@ -0,0 +1,318 @@
+commit f1f2af7a65d6531814a06b292a28bdc46580e590
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Aug 3 11:19:07 2009 -0700
+
+    Version bump: 1.0.3
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 90ccae7efc5fca9c0f4e45b84806df01332dd869
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Mon Jan 12 20:41:14 2009 -0200
+
+    Correct problems in make distcheck.
+
+commit ae94046d8654b9f65df871502de0f08a36aa5d38
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Tue Aug 19 01:04:40 2008 +0200
+
+    xaw8 is gone, use xaw7
+
+commit 7ac72ce2e262bf78cb2e8ff50ef932d29e4b65f7
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Tue Aug 19 01:04:27 2008 +0200
+
+    allow build outside of source tree
+
+commit a3e1a9b4cb732b86b84375013e3fa531395b45cf
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Jul 29 14:18:10 2008 -0300
+
+    Properly handle multiple depth windows.
+    
+    This patch will not cause X Errors when magnifying windows with portions
+    offscreen, or windows with a dimension smaller than the default 64x64.
+    
+    A common case where this patch is required is when Composite is enabled,
+    the default depth has a value other than 24, and some application is
+    using the Composite argb visual; example is WindowMaker, that will choose
+    the "best" available visual, unless the visual-id option is used.
+
+commit cb21acd94353c82c4b49a7ddef99309b31b07500
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Thu Mar 27 20:08:04 2008 -0700
+
+    Build fix for file systems that are not case sensitive
+
+commit a6b0036a082a947b89bdbb27128e20079799857c
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Wed Aug 15 18:04:12 2007 -0700
+
+    Version bump: 1.0.2
+
+commit e4cd84139d155bf0ce7b42de65e2a5bfcc471a46
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Wed Aug 15 17:59:30 2007 -0700
+
+    Change xmag_CFLAGS to AM_CFLAGS to make automake-1.10 happier
+    
+    Makefile.am:27: compiling `CutPaste.c' with per-target flags requires `AM_PROG_CC_C_O' in `configure.ac'
+
+commit d990122dafcde5d22c8f1aa40e8f9dc213f79e17
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Wed Aug 1 13:22:35 2007 -0700
+
+    Make fix for Sun bug 6359959 more portable - use nanosleep, poll or select
+
+commit eb12c1f539cebbd7481711d1dc97e3e29b594389
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Tue Dec 13 00:00:00 2005 -0800
+
+    Sun bug 6359959: xmag overconsumes CPU due to its selection box
+    
+    <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6359959>
+    
+    The fix for Sun bug 1166559 changed the HLINTERVAL from 10 to 0.5 to fix
+    a problem that the selection box wasn't being seen. The problem is that
+    this parameter is used in an XtAppAddTimeOut(), and is supposed to be an
+    unsigned long. Thus, the 0.5 presumably turns into a 0 ms timeout. Whatever
+    effect that is being seen is due to seeing a rectangle drawn as fast as
+    the poor little X server can do it.
+
+commit a04689bccae3bd2df3812a8ed7fc0d675fdb05e9
+Author: Derek Wang <derek.wang@sun.com>
+Date:   Mon May 8 00:00:00 2000 -0700
+
+    Sun bug 1166559: highlight of selection box not discernable on some configs
+    
+    <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=1166559>
+    
+    1) On devices whose default visual is 24-bit TrueColor the selection area
+       bounding box has no contrast with the background.  This is because a
+       value of 1 is being xor'd in.  This won't provide enough contrast.  A
+       value of 0xffffff would be better.
+    
+    2) On my machine (which is a dual 50-Mhz SS10) you can sort of see the
+       bounding box on my GX if you look really, really close, but it's a faint
+       flicker.  I believe what is happening is that the bounding box is being
+       drawn and undrawn so fast you can hardly see it.
+
+commit 80faa0025128c10662694e818747fd0a592bc108
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Jun 1 16:40:07 2007 -0700
+
+    Replace static ChangeLog with dist-hook to generate from git log
+
+commit bff2deea15bd0b676458b88acb46d63fd72b86af
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Sat May 19 00:06:28 2007 -0700
+
+    X.Org Bug #10616: xmag man page says "Cut" button instead of "Select"
+    
+    X.Org Bugzilla #10616: <https://bugs.freedesktop.org/show_bug.cgi?id=10616>
+    Reported upstream from
+    Debian bug #180712 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=180712>
+
+commit f137f0414022575553bd65c3179b694be391c428
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Sat May 19 00:01:58 2007 -0700
+
+    renamed: .cvsignore -> .gitignore
+
+commit 5ef80b96a9d8676f79c5e27c727789d63a61e45b
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 21 02:29:52 2005 +0000
+
+    Update package version for X11R7 release.
+
+commit 0a9729f6c8a8e644e4048ee5135a35d9f0603e56
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Dec 19 16:22:45 2005 +0000
+
+    Stub COPYING files
+
+commit 094ca9cfcd3c6910a3e6981afdea8c461b636271
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:24:09 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+commit 61019bb2e2eea3f970540dc24d1bd52d508e5f60
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 7 16:18:00 2005 +0000
+
+    Change to use the app-defaults default dir configured in libXt.
+
+commit 95ba475220dafec7777d5e3802d817fb068a70ed
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 6 22:48:24 2005 +0000
+
+    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit 9223bc8f2d024f4dd378454ec3ecf5da6d51874e
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Dec 3 05:49:26 2005 +0000
+
+    Update package version number for X11R7 RC3 release.
+
+commit 7ebdd01ac939fdbe290d14a6c80a7d4aaf555347
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Nov 28 22:01:44 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 0fdfec2cbbd3ac47a2c67e5a6bf5594a300c92be
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Mon Nov 21 10:35:02 2005 +0000
+
+    Another pass at .cvsignores for apps.
+
+commit 5dad105bfb499209c18e8716a38f1c4eb5e93d6d
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Sun Nov 20 22:08:54 2005 +0000
+
+    Add/improve .cvsignore files for apps.
+
+commit 75f0fc733252f111d0fc7de07622a46e4adc675a
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:47:55 2005 +0000
+
+    Update package version number for RC1 release.
+
+commit 0d383b0eb8c7177fa12f8138c7ad9e527a98ba59
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Oct 18 00:32:54 2005 +0000
+
+    Change default install dir for app-default files from
+        $(sysconfdir)/X11/app-defaults to $(libdir)/X11/app-defaults to match
+        the monolith & allow localization
+
+commit c15d91b39f14e916d17581b1b653e3057571399f
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Oct 17 23:56:24 2005 +0000
+
+    Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to
+        work better with BSD make
+
+commit 3beed227e1ea75c57e38deba4a325303136947f4
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Fri Oct 14 00:25:46 2005 +0000
+
+    Use sed to fill in variables in man page
+
+commit 3a983a36e2a566b96dc92ba061c7795207ff6e0c
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Oct 4 23:59:50 2005 +0000
+
+    Add xmag.icon to EXTRA_DIST
+
+commit bb2d194053c71d49aefbcce7cbc371924163d7ce
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sun Oct 2 20:20:12 2005 +0000
+
+    Add developer documentation of xmag's Scale widget class to app/xmag
+
+commit 400ba6d65004e8c5ccc2fe45195374e46be21fe4
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Aug 1 20:25:30 2005 +0000
+
+    Install man pages to section 1 instead of section m (Patch from Donnie
+        Berkholz)
+
+commit 312910577edf6841f797317a8fe521abb1987a1b
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Jul 29 21:22:36 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 175a29fb026e628b815a443beb305514bf90f74e
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Jul 26 15:44:02 2005 +0000
+
+    Replace more GNU make-ism's with more portable macros
+
+commit 2453fa155493771d1ce948de0122c3e53e0cd5d1
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Sat Jul 23 16:43:02 2005 +0000
+
+    fix GNU-make only app-defaults rule
+
+commit 45e2eed46b415283bd56f2830d67117c7861cb3c
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed Jul 20 19:32:02 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 38ca5441b199b16b3d2dee2c2b8eaa133aec99a9
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Tue Jul 5 22:51:11 2005 +0000
+
+    Add build systems for xlogo, xlsatoms, xlsclients, xmag, xman, xmessage,
+        xmh, xmore. lib/Xaw/xaw.m4: Add an AM_CONDITIONAL and a shell variable
+        xaw_use_xprint symlink.sh: add some extra files for xgc, xinit,
+        xkbcomp, xlogo, xmb, and xmodmap xc/programs/xmore/xmore.c:
+        Conditionalize use of xprint
+
+commit 0cac7e38453d2c9c670fb9f9100c244bf9f7b98e
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 19:54:58 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+commit 6571a03e0f78ea6f45a4c67c60ba54b8980c3f76
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:35:39 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit 4344e337c42eb72bcc24257ba5345a4d102c1849
+Author: Egbert Eich <eich@suse.de>
+Date:   Wed Mar 3 12:13:14 2004 +0000
+
+    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit ce152a72a5422ba9c6c7a4c0298f8da6cf0f0a50
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:36:26 2004 +0000
+
+    readding XFree86's cvs IDs
+
+commit 8f63e90e414e756e3aeeb57014c75b2b0882f799
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 09:24:14 2004 +0000
+
+    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit 07819d0d328460410b940d05ee36235c255cf698
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:29:15 2003 +0000
+
+    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit c6d1f60f8f68135337e8d0c5a9d564d1b4932104
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:49:23 2003 +0000
+
+    XFree86 4.3.0.1
+
+commit 4c688ea7bec8b76e643d610577104e5519722be9
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:49:23 2003 +0000
+
+    Initial revision
+
+commit 31f434e2df14612e3cf18fe45a6c161eb3c225ff
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 15:54:54 2003 +0000
+
+    R6.6 is the Xorg base-line
diff --git a/xmag/CutPaste.c b/xmag/CutPaste.c
new file mode 100644 (file)
index 0000000..30cd7dd
--- /dev/null
@@ -0,0 +1,124 @@
+/* $Xorg: CutPaste.c,v 1.4 2001/02/09 02:05:55 xorgcvs 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.
+
+*/
+/* $XFree86: xc/programs/xmag/CutPaste.c,v 1.5 2001/01/17 23:46:19 dawes Exp $ */
+/*
+ * Author:  Davor Matic, MIT X Consortium
+ */
+
+#include <X11/IntrinsicP.h>
+#include <X11/Xmu/StdSel.h>
+#include <X11/Xmu/Atoms.h>
+#include <X11/Xatom.h>
+#include "ScaleP.h"    /* This file should be part of the Scale widget */
+#include "Scale.h"
+#include "CutPaste.h"
+#include <stdio.h>
+
+
+/*ARGSUSED*/
+static Boolean
+ConvertSelection(Widget w, Atom *selection, Atom *target, Atom *type, 
+                XtPointer *value, unsigned long *length, int *format)
+{
+    Boolean success;
+
+    if (*target == XA_PIXMAP || *target == XA_BITMAP) {
+       ScaleWidget sw = (ScaleWidget) w;
+       Pixmap *pixmap = (Pixmap *) XtMalloc(sizeof(Pixmap));
+       *pixmap = XCreatePixmap(XtDisplay(w), XtWindow(w),
+                               sw->scale.image->width, 
+                               sw->scale.image->height, 
+                               sw->scale.image->depth);
+       XPutImage(XtDisplay(w), *pixmap, sw->scale.gc, sw->scale.image,
+                 0, 0, 0, 0, sw->scale.image->width, sw->scale.image->height);
+       *type = XA_PIXMAP;
+       *value = (XtPointer) pixmap;
+       *length = 1;
+       *format = 32;
+       success = True;
+    } else {
+       /* Xt will always respond to selection requests for the TIMESTAMP
+          target, so we can pass a bogus time to XmuConvertStandardSelection.
+          In addition to the targets provided by XmuConvertStandardSelection,
+          Xt converts MULTIPLE, and we convert PIXMAP and BITMAP.
+        */
+       success = XmuConvertStandardSelection(w, (Time)0, selection, target,
+                                             type, (XPointer *)value, length,
+                                             format);
+       if (success && *target == XA_TARGETS(XtDisplay(w))) {
+           Atom* tmp;
+           tmp = (Atom *) XtRealloc(*value, (*length + 3) * sizeof(Atom));
+           tmp[(*length)++] = XInternAtom(XtDisplay(w), "MULTIPLE", False);
+           tmp[(*length)++] = XA_PIXMAP;
+           tmp[(*length)++] = XA_BITMAP;
+           *value = (XtPointer) tmp;
+       }
+    }
+    return success;
+}
+
+void 
+SWGrabSelection(Widget w, Time time)
+{
+    (void) XtOwnSelection(w, XA_PRIMARY, time, ConvertSelection, NULL, NULL);
+}
+
+
+/*ARGSUSED*/
+static void
+SelectionCallback(Widget w, XtPointer client_data, Atom *selection, 
+                 Atom *type, XtPointer value, unsigned long *length, 
+                 int *format)
+{
+
+    if  (*type == XA_PIXMAP) {
+       Pixmap *pixmap;
+       XImage *image;
+       Window root;
+       int x, y;
+       unsigned int width, height, border_width, depth;
+
+       pixmap = (Pixmap *) value;
+       XGetGeometry(XtDisplay(w), *pixmap, &root, &x, &y,
+                    &width, &height, &border_width, &depth);
+       image = XGetImage(XtDisplay(w), *pixmap, 0, 0, width, height, 
+                         AllPlanes, ZPixmap);
+       SWAutoscale(w, NULL, NULL, NULL);
+       SWSetImage(w, image);
+       XtFree(value);
+       XDestroyImage(image);
+    }
+}
+
+void 
+SWRequestSelection(Widget w, Time time)
+{
+    XtGetSelectionValue(w, XA_PRIMARY, XA_PIXMAP, SelectionCallback, NULL,
+                       time);
+}
diff --git a/xmag/CutPaste.h b/xmag/CutPaste.h
new file mode 100644 (file)
index 0000000..d1a61bc
--- /dev/null
@@ -0,0 +1,34 @@
+/* $XFree86: xc/programs/xmag/CutPaste.h,v 1.1 1999/03/07 11:41:12 dawes Exp $ */
+/*
+ * Copyright (C) 1999 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 _CUTPASTE_H
+#define _CUTPASTE_H
+
+extern void SWGrabSelection ( Widget w, Time time );
+extern void SWRequestSelection ( Widget w, Time time );
+
+
+#endif
diff --git a/xmag/INSTALL b/xmag/INSTALL
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xmag/Makefile.am b/xmag/Makefile.am
new file mode 100644 (file)
index 0000000..39de39e
--- /dev/null
@@ -0,0 +1,94 @@
+# 
+#  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 = xmag
+
+AM_CFLAGS = $(XMAG_CFLAGS)
+xmag_LDADD = $(XMAG_LIBS) -lm
+
+xmag_SOURCES = \
+        CutPaste.c \
+        CutPaste.h \
+        RootWin.c \
+        RootWin.h \
+        RootWinP.h \
+        Scale.c \
+        Scale.h \
+        ScaleP.h \
+        xmag.c
+
+appman_PRE = \
+        xmag.man
+
+# App default files  (*.ad)
+
+DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
+
+appdefaultdir = @appdefaultdir@
+
+dist_appdefault_DATA = \
+        app-defaults/Xmag
+
+# Developer documentation for Scale widget in Scale.c
+EXTRA_DIST = Scale.txt
+
+EXTRA_DIST += xmag.icon
+
+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) < $< > $@
+
+EXTRA_DIST += ChangeLog
+MAINTAINERCLEANFILES = ChangeLog
+
+.PHONY: ChangeLog
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog
diff --git a/xmag/Makefile.in b/xmag/Makefile.in
new file mode 100644 (file)
index 0000000..8fa0953
--- /dev/null
@@ -0,0 +1,716 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006  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.
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = xmag$(EXEEXT)
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(dist_appdefault_DATA) \
+       $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+       $(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \
+       ChangeLog INSTALL NEWS config.guess config.sub depcomp \
+       install-sh missing
+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 config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" \
+       "$(DESTDIR)$(appdefaultdir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_xmag_OBJECTS = CutPaste.$(OBJEXT) RootWin.$(OBJEXT) Scale.$(OBJEXT) \
+       xmag.$(OBJEXT)
+xmag_OBJECTS = $(am_xmag_OBJECTS)
+am__DEPENDENCIES_1 =
+xmag_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I.@am__isrc@
+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 = $(xmag_SOURCES)
+DIST_SOURCES = $(xmag_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)
+dist_appdefaultDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(appman_DATA) $(dist_appdefault_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
+ACLOCAL = @ACLOCAL@
+ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
+ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
+AMTAR = @AMTAR@
+APPDEFS_CFLAGS = @APPDEFS_CFLAGS@
+APPDEFS_LIBS = @APPDEFS_LIBS@
+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@
+CHANGELOG_CMD = @CHANGELOG_CMD@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
+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@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+GREP = @GREP@
+INSTALL = @INSTALL@
+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@
+MAKEINFO = @MAKEINFO@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+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@
+XMAG_CFLAGS = @XMAG_CFLAGS@
+XMAG_LIBS = @XMAG_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+appdefaultdir = @appdefaultdir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+distcleancheck_listfiles = @distcleancheck_listfiles@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CFLAGS = $(XMAG_CFLAGS)
+xmag_LDADD = $(XMAG_LIBS) -lm
+xmag_SOURCES = \
+        CutPaste.c \
+        CutPaste.h \
+        RootWin.c \
+        RootWin.h \
+        RootWinP.h \
+        Scale.c \
+        Scale.h \
+        ScaleP.h \
+        xmag.c
+
+appman_PRE = \
+        xmag.man
+
+
+# App default files  (*.ad)
+DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
+dist_appdefault_DATA = \
+        app-defaults/Xmag
+
+
+# Developer documentation for Scale widget in Scale.c
+EXTRA_DIST = Scale.txt xmag.icon $(appman_PRE) ChangeLog
+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
+MAINTAINERCLEANFILES = ChangeLog
+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) $(AM_MAKEFLAGS) 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)
+xmag$(EXEEXT): $(xmag_OBJECTS) $(xmag_DEPENDENCIES) 
+       @rm -f xmag$(EXEEXT)
+       $(LINK) $(xmag_OBJECTS) $(xmag_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CutPaste.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RootWin.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Scale.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmag.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+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
+install-dist_appdefaultDATA: $(dist_appdefault_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appdefaultdir)" || $(MKDIR_P) "$(DESTDIR)$(appdefaultdir)"
+       @list='$(dist_appdefault_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(dist_appdefaultDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(appdefaultdir)/$$f'"; \
+         $(dist_appdefaultDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(appdefaultdir)/$$f"; \
+       done
+
+uninstall-dist_appdefaultDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_appdefault_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(appdefaultdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(appdefaultdir)/$$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)
+       test -d $(distdir) || mkdir $(distdir)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           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 $(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 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$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)" "$(DESTDIR)$(appdefaultdir)"; 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."
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-appmanDATA install-dist_appdefaultDATA
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -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_appdefaultDATA
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+       clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
+       dist-gzip dist-hook dist-shar dist-tarZ dist-zip distcheck \
+       distclean distclean-compile distclean-generic distclean-hdr \
+       distclean-tags distcleancheck distdir distuninstallcheck dvi \
+       dvi-am html html-am info info-am install install-am \
+       install-appmanDATA install-binPROGRAMS install-data \
+       install-data-am install-dist_appdefaultDATA install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+       tags uninstall uninstall-am uninstall-appmanDATA \
+       uninstall-binPROGRAMS uninstall-dist_appdefaultDATA
+
+
+.man.$(APP_MAN_SUFFIX):
+       sed $(MAN_SUBSTS) < $< > $@
+
+.PHONY: ChangeLog
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+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/xmag/NEWS b/xmag/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xmag/README b/xmag/README
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xmag/RootWin.c b/xmag/RootWin.c
new file mode 100644 (file)
index 0000000..2cd5f38
--- /dev/null
@@ -0,0 +1,85 @@
+/* $Xorg: RootWin.c,v 1.4 2001/02/09 02:05:55 xorgcvs Exp $ */
+/*
+
+Copyright 1990, 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/xmag/RootWin.c,v 1.4 2001/01/17 23:46:20 dawes Exp $ */
+
+
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include "RootWinP.h"
+
+static void Realize ( Widget w, XtValueMask *value_mask, XSetWindowAttributes *attributes );
+
+RootWindowClassRec rootWindowClassRec = {
+  { /* core fields */
+    /* superclass              */      (WidgetClass) &widgetClassRec,
+    /* class_name              */      "RootWindow",
+    /* widget_size             */      sizeof(RootWindowRec),
+    /* class_initialize                */      NULL,
+    /* class_part_initialize   */      NULL,
+    /* class_inited            */      FALSE,
+    /* initialize              */      NULL,
+    /* initialize_hook         */      NULL,
+    /* realize                 */      Realize,
+    /* actions                 */      NULL,
+    /* num_actions             */      0,
+    /* resources               */      NULL,
+    /* num_resources           */      0,
+    /* xrm_class               */      NULLQUARK,
+    /* compress_motion         */      TRUE,
+    /* compress_exposure       */      TRUE,
+    /* compress_enterleave     */      TRUE,
+    /* visible_interest                */      FALSE,
+    /* destroy                 */      NULL,
+    /* resize                  */      NULL,
+    /* expose                  */      NULL,
+    /* set_values              */      NULL,
+    /* set_values_hook         */      NULL,
+    /* set_values_almost       */      XtInheritSetValuesAlmost,
+    /* get_values_hook         */      NULL,
+    /* accept_focus            */      NULL,
+    /* version                 */      XtVersion,
+    /* callback_private                */      NULL,
+    /* tm_table                        */      NULL,
+    /* query_geometry          */      XtInheritQueryGeometry,
+    /* display_accelerator     */      XtInheritDisplayAccelerator,
+    /* extension               */      NULL
+  },
+  { /* rootWindow fields */
+    /* empty                   */      0
+  }
+};
+
+WidgetClass rootWindowWidgetClass = (WidgetClass)&rootWindowClassRec;
+
+/*ARGSUSED*/
+static void 
+Realize(Widget w, XtValueMask *value_mask, XSetWindowAttributes *attributes)
+{
+    w->core.window = RootWindowOfScreen(w->core.screen);
+}
diff --git a/xmag/RootWin.h b/xmag/RootWin.h
new file mode 100644 (file)
index 0000000..ae61794
--- /dev/null
@@ -0,0 +1,67 @@
+/* $Xorg: RootWin.h,v 1.4 2001/02/09 02:05:55 xorgcvs Exp $ */
+/*
+
+Copyright 1990, 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.
+
+*/
+
+
+#ifndef _RootWindow_h
+#define _RootWindow_h
+
+/****************************************************************
+ *
+ * RootWindow widget
+ *
+ ****************************************************************/
+
+/* Resources:
+
+ Name               Class              RepType         Default Value
+ ----               -----              -------         -------------
+ background         Background         Pixel           XtDefaultBackground
+ border                     BorderColor        Pixel           XtDefaultForeground
+ borderWidth        BorderWidth        Dimension       1
+ destroyCallback     Callback          Pointer         NULL
+ height                     Height             Dimension       0
+ mappedWhenManaged   MappedWhenManaged Boolean         True
+ sensitive          Sensitive          Boolean         True
+ width              Width              Dimension       0
+ x                  Position           Position        0
+ y                  Position           Position        0
+
+*/
+
+
+/* declare specific RootWindowWidget class and instance datatypes */
+
+typedef struct _RootWindowClassRec*    RootWindowWidgetClass;
+typedef struct _RootWindowRec* RootWindowWidget;
+
+/* declare the class constant */
+
+extern WidgetClass rootWindowWidgetClass;
+
+#endif /* _RootWindow_h */
diff --git a/xmag/RootWinP.h b/xmag/RootWinP.h
new file mode 100644 (file)
index 0000000..363cdd9
--- /dev/null
@@ -0,0 +1,60 @@
+/* $Xorg: RootWinP.h,v 1.4 2001/02/09 02:05:55 xorgcvs Exp $ */
+/*
+
+Copyright 1990, 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.
+
+*/
+
+
+#ifndef _RootWindoP_h
+#define _RootWindoP_h
+
+#include "RootWin.h"
+/* include superclass private header file */
+#include <X11/CoreP.h>
+
+typedef struct {
+    int empty;
+} RootWindowClassPart;
+
+typedef struct _RootWindowClassRec {
+    CoreClassPart      core_class;
+    RootWindowClassPart        root_class;
+} RootWindowClassRec;
+
+extern RootWindowClassRec rootClassRec;
+
+typedef struct {
+    /* resources */
+    char* resource;
+    /* private state */
+} RootWindowPart;
+
+typedef struct _RootWindowRec {
+    CorePart   core;
+    RootWindowPart     root;
+} RootWindowRec;
+
+#endif /* _RootWindoP_h */
diff --git a/xmag/Scale.c b/xmag/Scale.c
new file mode 100644 (file)
index 0000000..203d2fd
--- /dev/null
@@ -0,0 +1,1032 @@
+/* $Xorg: Scale.c,v 1.4 2001/02/09 02:05:55 xorgcvs 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.
+
+*/
+/* $XFree86: xc/programs/xmag/Scale.c,v 3.8 2001/07/25 15:05:26 dawes Exp $ */
+
+/*
+ * Author:  Davor Matic, MIT X Consortium
+ */
+
+#include <stdio.h>
+#include <ctype.h>
+#include <math.h>
+#include <stdlib.h>
+#if defined(ISC) && __STDC__ && !defined(ISC30)
+extern double atof(char *);
+#endif
+
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <X11/Xos.h>
+#include <X11/Xaw/XawInit.h>
+
+#include "CutPaste.h"
+#include "ScaleP.h"
+
+#define myrint(x) floor(x + 0.5)
+
+#define streq(a,b) (strcmp( (a), (b) ) == 0)
+#ifndef min
+#define min(x, y) ((x) > (y) ? (y) : (x))
+#endif
+#ifndef max
+#define max(x, y) ((x) < (y) ? (y) : (x))
+#endif
+#if defined(ISC) && __STDC__ && !defined(ISC30)
+extern double atof(char *);
+#endif
+
+#define DefaultBufferSize 1024
+#define DefaultScaleFactor NULL
+
+#define Offset(field) XtOffsetOf(ScaleRec, scale.field)
+
+static XtResource resources[] = {
+{XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
+     Offset(foreground_pixel), XtRString, (XtPointer) XtDefaultForeground},
+{XtNgravity, XtCGravity, XtRGravity, sizeof(XtGravity),
+     Offset(gravity), XtRImmediate, (XtPointer) "ForgetGravity"},
+{XtNinternalWidth, XtCWidth, XtRDimension,  sizeof(Dimension),
+     Offset(internal_width), XtRImmediate, (XtPointer) 2},
+{XtNinternalHeight, XtCHeight, XtRDimension, sizeof(Dimension),
+     Offset(internal_height), XtRImmediate, (XtPointer) 2},
+{XtNresize, XtCResize, XtRBoolean, sizeof(Boolean),
+     Offset(resize), XtRImmediate, (XtPointer) True},
+{XtNautoscale, XtCAutoscale, XtRBoolean, sizeof(Boolean),
+     Offset(autoscale), XtRImmediate, (XtPointer) True},
+{XtNproportional, XtCProportional, XtRBoolean, sizeof(Boolean),
+     Offset(proportional), XtRImmediate, (XtPointer) True},
+{XtNscaleX, XtCScaleFactor, XtRString, sizeof(String),
+     Offset(scale_x_str), XtRImmediate, (XtPointer) DefaultScaleFactor},
+{XtNscaleY, XtCScaleFactor, XtRString, sizeof(String),
+     Offset(scale_y_str), XtRImmediate, (XtPointer) DefaultScaleFactor},
+{XtNaspectRatio, XtCAspectRatio, XtRString, sizeof(String),
+     Offset(aspect_ratio_str), XtRImmediate, (XtPointer) "1.0"},
+{XtNprecision, XtCPrecision, XtRString, sizeof(String),
+     Offset(precision_str), XtRImmediate, (XtPointer) "0.001"},
+{XtNimage, XtCImage, XtRImage, sizeof(XImage*),
+     Offset(image), XtRImmediate, (XtPointer) NULL},
+{XtNpasteBuffer, XtCPasteBuffer, XtRBoolean, sizeof(Boolean),
+     Offset(paste_buffer), XtRImmediate, (XtPointer) False},
+{XtNbufferSize, XtCBufferSize, XtRCardinal, sizeof(Cardinal),
+     Offset(buffer_size), XtRImmediate, (XtPointer) DefaultBufferSize},
+{XtNuserData, XtCuserData, XtRuserData, sizeof(XtPointer),
+     Offset(userData), XtRImmediate, (XtPointer) NULL},
+{ XtNvisual, XtCvisual, XtRVisual, sizeof(Visual*),
+     Offset(visual), XtRImmediate, CopyFromParent}
+};
+
+#undef Offset
+
+static void ClassInitialize ( void );
+static void GetGC ( ScaleWidget sw );
+static void GetInitialScaleValues ( ScaleWidget sw );
+static void GetRectangleBuffer ( ScaleWidget sw, Cardinal buffer_size );
+static void Initialize ( Widget request, Widget new, ArgList args, 
+                        Cardinal *num_args );
+static void BuildTable ( ScaleWidget sw );
+static void FlushRectangles ( ScaleWidget sw, Drawable drawable, GC gc );
+static void FillRectangle ( ScaleWidget sw, Drawable drawable, GC gc, 
+                           Position x, Position y, 
+                           Dimension width, Dimension height );
+static void ScaleImage ( ScaleWidget sw, Drawable drawable, 
+                        Position img_x, Position img_y, 
+                        Position dst_x, Position dst_y, 
+                        Dimension img_width, Dimension img_height );
+static int FindPixel ( ScaleWidget sw, Position x, Position y, 
+                      Position *img_x, Position *img_y, Pixel *img_pixel );
+static void Redisplay ( Widget w, XEvent *event, Region region );
+static void TryResize ( ScaleWidget sw );
+static void Precision ( ScaleWidget sw );
+static void Proportional ( ScaleWidget sw );
+static void GetScaledSize ( ScaleWidget sw );
+static void GetScaleValues ( ScaleWidget sw );
+static void Unscale ( ScaleWidget sw );
+static void Autoscale ( ScaleWidget sw );
+static void PositionImage ( ScaleWidget sw );
+static void Resize ( Widget w );
+static void Realize ( Widget wid, Mask *vmask, XSetWindowAttributes *attr );
+static void Destroy ( Widget w );
+static Boolean SetValues ( Widget current, Widget request, Widget new, 
+                          ArgList args, Cardinal *num_args );
+
+
+static XtActionsRec actions[] =
+{
+{"unscale", SWUnscale},
+{"autoscale", SWAutoscale},
+{"initial-size", SWInitialSize},
+{"paste", RequestSelection},
+{"cut", GrabSelection}
+};
+
+static char translations[] =
+"\
+ <Key>u:           unscale()\n\
+ <Key>a:           autoscale()\n\
+ <Key>i:           initial-size()\n\
+";
+
+ScaleClassRec scaleClassRec = {
+{   /* core fields */
+    /* superclass              */      (WidgetClass) &simpleClassRec,
+    /* class_name              */      "Scale",
+    /* widget_size             */      sizeof(ScaleRec),
+    /* class_initialize                */      ClassInitialize,
+    /* class_part_initialize   */      NULL,
+    /* class_inited            */      FALSE,
+    /* initialize              */      Initialize,
+    /* initialize_hook         */      NULL,
+    /* realize                 */      Realize,
+    /* actions                 */      actions,
+    /* num_actions             */      XtNumber(actions),
+    /* resources               */      resources,
+    /* num_resources           */      XtNumber(resources),
+    /* xrm_class               */      NULLQUARK,
+    /* compress_motion         */      TRUE,
+    /* compress_exposure       */      XtExposeCompressMaximal|
+                                        XtExposeGraphicsExposeMerged,
+    /* compress_enterleave     */      TRUE,
+    /* visible_interest                */      TRUE,
+    /* destroy                 */      Destroy,
+    /* resize                  */      Resize,
+    /* expose                  */      Redisplay,
+    /* set_values              */      SetValues,
+    /* set_values_hook         */      NULL,
+    /* set_values_almost       */      XtInheritSetValuesAlmost,
+    /* get_values_hook         */      NULL,
+    /* accept_focus            */      NULL,
+    /* version                 */      XtVersion,
+    /* callback_private                */      NULL,
+    /* tm_table                        */      translations,
+    /* query_geometry          */      XtInheritQueryGeometry,
+    /* display_accelerator     */      XtInheritDisplayAccelerator,
+    /* extension               */      NULL
+  },
+  { 
+    /* change_sensitive                */      XtInheritChangeSensitive,
+  }
+};
+WidgetClass scaleWidgetClass = (WidgetClass) &scaleClassRec;
+    
+\f
+
+/*
+ * Private Procedures
+ */
+
+
+static void 
+ClassInitialize(void)
+{
+} 
+
+\f
+
+static void 
+GetGC(ScaleWidget sw)
+{
+    XGCValues values;
+    
+    values.foreground = sw->scale.foreground_pixel;
+    values.background = sw->core.background_pixel;
+    values.function = GXcopy;
+    
+    sw->scale.gc = XtGetGC((Widget) sw,
+                          GCForeground | 
+                          GCBackground | 
+                          GCFunction,
+                          &values);
+}
+
+\f
+
+
+static void 
+GetInitialScaleValues(ScaleWidget sw)
+{
+    if (sw->scale.proportional) {
+       sw->scale.scale_x = sw->scale.scale_y =
+           ((sw->scale.aspect_ratio > 1.0) ?
+            sw->scale.aspect_ratio : 1.0 / sw->scale.aspect_ratio) *
+                (sw->scale.precision > 1.0 ?
+                 sw->scale.precision : 1.0);
+       Proportional(sw); /* need to cut them down to proper values */
+    }
+    else
+       sw->scale.scale_x = sw->scale.scale_y = 1.0;
+}
+
+\f
+
+static void 
+GetRectangleBuffer(ScaleWidget sw, Cardinal buffer_size)
+    /*
+     * This procedure will realloc a new rectangles buffer.
+     * If the new buffer size is less than nrectangles, some
+     * information will be lost.
+     */
+{
+    if (buffer_size == 0) {
+       buffer_size = DefaultBufferSize;
+       XtWarning("buffer size has to be a positive number greater than zero");
+    }
+    sw->scale.rectangles = (XRectangle *)
+       XtRealloc((char *) sw->scale.rectangles, 
+                 buffer_size * sizeof(XRectangle));
+    sw->scale.buffer_size = buffer_size;
+}
+
+\f
+
+/* ARGSUSED */
+static void 
+Initialize(Widget request, Widget new, ArgList args, Cardinal *num_args)
+{
+    ScaleWidget new_sw = (ScaleWidget) new;
+    
+    new_sw->scale.table.x = (Position *) NULL;
+    new_sw->scale.table.y = (Position *) NULL;
+    new_sw->scale.table.width = (Dimension *) NULL;
+    new_sw->scale.table.height = (Dimension *) NULL;
+    
+    new_sw->scale.nrectangles = 0;
+    new_sw->scale.rectangles = (XRectangle *) NULL;
+    
+    GetRectangleBuffer(new_sw, new_sw->scale.buffer_size);
+    
+    GetGC(new_sw);
+    
+    if (new_sw->scale.image != NULL) {
+       if (new_sw->core.width == 0)
+           new_sw->core.width = 
+               new_sw->scale.image->width + 2 * new_sw->scale.internal_width;
+       if (new_sw->core.height == 0)
+           new_sw->core.height = 
+               new_sw->scale.image->height + 2 *new_sw->scale.internal_height;
+    }
+    else {
+       if (new_sw->core.width == 0)
+           new_sw->core.width = 1 + 2 * new_sw->scale.internal_width;
+       if (new_sw->core.height == 0)
+           new_sw->core.height = 1 + 2 * new_sw->scale.internal_height;
+       new_sw->scale.image = XCreateImage(XtDisplay(new),
+                                      DefaultVisual(XtDisplay(new), 
+                                               DefaultScreen(XtDisplay(new))),
+                                      1, XYBitmap, 0, 
+                                      XtCalloc(1, sizeof(char)),
+                                      1, 1, 8, 0);
+    }
+
+    if ((new_sw->scale.aspect_ratio = 
+        atof(new_sw->scale.aspect_ratio_str)) < 0.0) {
+       new_sw->scale.aspect_ratio = 1.0;
+       XtWarning("AspectRatio has to be a positive number. (forced to 1.0)");
+    }
+
+    if ((new_sw->scale.precision =
+         atof(new_sw->scale.precision_str)) < 0.0) {
+       new_sw->scale.precision = 0.001;
+       XtWarning("Precision has to be a positive number. (forced to 0.001)");
+    }
+    
+    if (new_sw->scale.scale_x_str == DefaultScaleFactor
+       || 
+       new_sw->scale.scale_y_str == DefaultScaleFactor)
+       GetInitialScaleValues(new_sw);
+    else {
+       if ((new_sw->scale.scale_x = 
+            atof(new_sw->scale.scale_x_str)) < 0.0) {
+           new_sw->scale.scale_x = 1.0;
+           XtWarning("ScaleValue has to be a positive number. (forced to 1.0)");
+       }
+       if ((new_sw->scale.scale_y = 
+            atof(new_sw->scale.scale_y_str)) < 0.0) {
+           new_sw->scale.scale_y = 1.0;
+           XtWarning("ScaleValue has to be a positive number. (forced to 1.0)");
+       }
+    }
+}
+
+\f
+
+static void 
+BuildTable(ScaleWidget sw)
+    /* 
+     * This procedure builds scaling table for image in the scale struct
+     * Requires image, scale_x and scale_y to be set properly
+     */
+{
+    Position x, y;
+    
+    XtFree((char *) sw->scale.table.x);
+    XtFree((char *) sw->scale.table.y);
+    XtFree((char *) sw->scale.table.width);
+    XtFree((char *) sw->scale.table.height);
+    sw->scale.table.x = 
+       (Position *) XtMalloc(sizeof(Position) * sw->scale.image->width);
+    sw->scale.table.y = 
+       (Position *) XtMalloc(sizeof(Position) * sw->scale.image->height);
+    sw->scale.table.width = 
+       (Dimension *) XtMalloc(sizeof(Dimension) * sw->scale.image->width);
+    sw->scale.table.height = 
+       (Dimension *) XtMalloc(sizeof(Dimension) * sw->scale.image->height);
+    
+    /* Build the scaling table */      
+    for (x = 0; x < sw->scale.image->width; x++) {
+       sw->scale.table.x[(int) x] = (Position) myrint(sw->scale.scale_x * x);
+       sw->scale.table.width[(int) x] = (Dimension)
+           myrint(sw->scale.scale_x *(x + 1)) - myrint(sw->scale.scale_x * x);
+    }
+    for (y = 0; y < sw->scale.image->height; y++) {
+       sw->scale.table.y[(int) y] = (Position) myrint(sw->scale.scale_y * y);
+       sw->scale.table.height[(int) y] = (Dimension)
+           myrint(sw->scale.scale_y *(y + 1)) - myrint(sw->scale.scale_y * y);
+    }
+}
+
+\f
+
+static void 
+FlushRectangles(ScaleWidget sw, Drawable drawable, GC gc)
+{
+    XFillRectangles(XtDisplay(sw), drawable, gc, 
+                   sw->scale.rectangles, sw->scale.nrectangles);
+    
+    sw->scale.nrectangles = 0;
+}
+
+\f
+
+static void 
+FillRectangle(ScaleWidget sw, Drawable drawable, GC gc, 
+             Position x, Position y, Dimension width, Dimension height)
+{
+    
+    if (sw->scale.nrectangles == sw->scale.buffer_size)
+       FlushRectangles(sw, drawable, gc);
+
+    sw->scale.rectangles[(int) sw->scale.nrectangles].x = x;
+    sw->scale.rectangles[(int) sw->scale.nrectangles].y = y;
+    sw->scale.rectangles[(int) sw->scale.nrectangles].width = width;
+    sw->scale.rectangles[(int) sw->scale.nrectangles].height = height;
+
+    ++sw->scale.nrectangles;
+}
+
+\f
+
+static void 
+ScaleImage(ScaleWidget sw, Drawable drawable, Position img_x, Position img_y, 
+          Position dst_x, Position dst_y, 
+          Dimension img_width, Dimension img_height)
+    /* 
+     * This procedure scales image into the specified drawable
+     * It assumes scaling table was already built
+     */
+{
+    GC gc;
+    XGCValues gcv;
+    Position x, y;
+    Pixel pixel;
+    
+    /* Clip the img coordinates */
+    img_x = min(max(img_x, 0), (Position) sw->scale.image->width - 1);
+    img_y = min(max(img_y, 0), (Position) sw->scale.image->height - 1);
+    img_width = 
+      min(img_width, (Dimension)(sw->scale.image->width - (Dimension)img_x));
+    img_height = 
+      min(img_height, (Dimension)(sw->scale.image->height - (Dimension)img_y));
+
+    if (sw->scale.scale_x == 1.0 && sw->scale.scale_y == 1.0) 
+       XPutImage(XtDisplay(sw), drawable, sw->scale.gc, sw->scale.image, 
+                 img_x, img_y, dst_x, dst_y, 
+                 img_width, img_height);
+    else {
+       dst_x = dst_x - sw->scale.table.x[(int) img_x];
+       dst_y = dst_y - sw->scale.table.y[(int) img_y];
+
+       gc = XCreateGC(XtDisplay(sw), drawable, 0, NULL);
+
+       gcv.function = GXcopy;
+       XChangeGC(XtDisplay(sw), gc, GCFunction, &gcv);
+
+       /* make sure gc knows the right background */
+       gcv.background = sw->core.background_pixel;
+       XChangeGC(XtDisplay(sw), gc, GCBackground, &gcv);       
+
+       /* Set the background of drawable.  If the most frequent color
+          is the background color it can speed up scaling process. */
+       gcv.foreground = gcv.background;
+       XChangeGC(XtDisplay(sw), gc, GCForeground, &gcv);
+       XFillRectangle(XtDisplay(sw), drawable, gc, 
+                      sw->scale.table.x[(int) img_x] + dst_x, 
+                      sw->scale.table.y[(int) img_y] + dst_y, 
+                      sw->scale.table.x[(int) img_x + img_width - 1] - 
+                      sw->scale.table.x[(int) img_x], 
+                      sw->scale.table.y[(int) img_y + img_height - 1] - 
+                      sw->scale.table.y[(int) img_y]);
+       
+       if (sw->scale.image->format == XYBitmap) {
+           for (x = img_x; x < img_x + (Position)img_width; x++)
+               for (y = img_y; y < img_y + (Position)img_height; y++) {
+                   pixel = XGetPixel(sw->scale.image, x, y);
+                   if (pixel) /* Do not draw background */
+                       FillRectangle(sw, drawable, sw->scale.gc, 
+                                     sw->scale.table.x[(int) x] + dst_x, 
+                                     sw->scale.table.y[(int) y] + dst_y, 
+                                     sw->scale.table.width[(int) x], 
+                                     sw->scale.table.height[(int) y]);
+               }
+           FlushRectangles(sw, drawable, sw->scale.gc);
+       }
+       else {
+           for (x = img_x; x < img_x + (Position)img_width; x++)
+               for (y = img_y; y < img_y + (Position)img_height; y++) {
+                   pixel = XGetPixel(sw->scale.image, x, y);
+                   if (pixel != gcv.background) { /* Do not draw background */
+                       if (gcv.foreground != pixel) { /* Change fg to pixel */
+                           gcv.foreground = pixel;
+                           XChangeGC(XtDisplay(sw), gc, GCForeground, &gcv);
+                       }
+                       XFillRectangle(XtDisplay(sw), drawable, gc,
+                                      sw->scale.table.x[(int) x] + dst_x, 
+                                      sw->scale.table.y[(int) y] + dst_y, 
+                                      sw->scale.table.width[(int) x], 
+                                      sw->scale.table.height[(int) y]);
+                   }
+               }
+       }
+       XFreeGC(XtDisplay(sw), gc);
+    }
+}
+
+\f
+
+static int 
+FindPixel(ScaleWidget sw, Position x, Position y, 
+         Position *img_x, Position *img_y, Pixel *img_pixel)
+          /* (x,y) == (0,0) where image starts in sw window*/
+{
+    if (*img_x < 0 || *img_x >= sw->scale.image->width 
+       ||
+       *img_y < 0 || *img_y >= sw->scale.image->height)
+       return (-1);
+    
+    if (sw->scale.table.x[(int) *img_x] >= x) {
+       --*img_x;
+       return FindPixel(sw, x, y, img_x, img_y, img_pixel);
+    }
+    if (sw->scale.table.x[(int) *img_x] + 
+       (Position)sw->scale.table.width[(int) *img_x] < x) {
+       ++*img_x;
+       return FindPixel(sw, x, y, img_x, img_y, img_pixel);
+    }
+    if (sw->scale.table.y[(int) *img_y] >= y) {
+       --*img_y;
+       return FindPixel(sw, x, y, img_x, img_y, img_pixel);
+    }
+    if (sw->scale.table.y[(int) *img_y] + 
+       (Position)sw->scale.table.height[(int) *img_y] < y) {
+       ++*img_y;
+       return FindPixel(sw, x, y, img_x, img_y, img_pixel);
+    }
+    
+    *img_pixel = XGetPixel(sw->scale.image, *img_x, *img_y);
+    
+    return (0);
+}
+
+\f
+
+int 
+SWGetImagePixel(Widget w, Position x, Position y, 
+               Position *img_x, Position *img_y, Pixel *img_pixel)
+{
+    ScaleWidget sw = (ScaleWidget) w;
+    
+    x -= sw->scale.x;
+    y -= sw->scale.y;
+    
+    *img_x = (Position) floor(x / sw->scale.scale_x);
+    *img_y = (Position) floor(y / sw->scale.scale_y);
+    
+    return FindPixel(sw, x, y, img_x, img_y, img_pixel);
+}
+
+\f
+
+/* ARGSUSED */
+static void 
+Redisplay(Widget w, XEvent *event, Region region)
+{
+    ScaleWidget sw = (ScaleWidget) w;
+    Position  x, y, img_x, img_y;
+    Dimension width, height;
+
+    if (event->type == Expose) {
+
+       if (event->xexpose.x < sw->scale.x) {
+           x = 0;
+           width = event->xexpose.width -
+               (sw->scale.x - event->xexpose.x);
+       }
+       else {
+           x = event->xexpose.x - sw->scale.x;
+           width = event->xexpose.width;
+       }
+       
+       if (event->xexpose.y < sw->scale.y) {
+           y = 0;
+           height = event->xexpose.height -
+               (sw->scale.y - event->xexpose.y);
+       }
+       else {
+           y = event->xexpose.y - sw->scale.y;
+           height = event->xexpose.height;
+       }
+       
+       img_x = min(max((Position) floor((float) x 
+                                        / (float) sw->scale.scale_x), 0),
+                   (Position) sw->scale.image->width - 1);
+
+       img_y = min(max((Position) floor((float) y
+                                        / (float) sw->scale.scale_y), 0),
+                   (Position) sw->scale.image->height - 1);
+       
+       if (sw->core.visible) {  
+           ScaleImage(sw, XtWindow(w),
+                      img_x, img_y,
+                      sw->scale.x + sw->scale.table.x[(int) img_x],
+                      sw->scale.y + sw->scale.table.y[(int) img_y],
+                      (Dimension) ceil((float) width
+                                       / sw->scale.scale_x) + 1, 
+                      (Dimension) ceil((float) height
+                                       / sw->scale.scale_y) + 1);
+       }
+    }
+}
+
+\f
+
+static void 
+TryResize(ScaleWidget sw)
+{
+    Dimension width, height;
+    XtGeometryResult result;
+
+    width = (Dimension) 
+       floor(sw->scale.image->width * sw->scale.scale_x)
+           + 2 * sw->scale.internal_width;
+    height = (Dimension) 
+       floor(sw->scale.image->height * sw->scale.scale_y)
+           + 2 * sw->scale.internal_height;
+    
+    while ((result =   
+/* SUPPRESS 530 */XtMakeResizeRequest((Widget)sw,width,height,&width,&height))
+          == XtGeometryAlmost);  
+    
+    if (result != XtGeometryNo) {
+       sw->core.width = width;
+       sw->core.height = height;
+    }
+}
+
+\f
+
+static void 
+Precision(ScaleWidget sw)
+{
+    if (sw->scale.scale_x != 1.0)
+       sw->scale.scale_x = floor(sw->scale.scale_x / sw->scale.precision)
+                           * sw->scale.precision;
+
+    if (sw->scale.scale_y != 1.0)
+       sw->scale.scale_y = floor(sw->scale.scale_y / sw->scale.precision)
+                           * sw->scale.precision;
+}
+
+\f
+
+static void 
+Proportional(ScaleWidget sw)
+{
+    float scale_x, scale_y;
+
+    scale_x = sw->scale.scale_y / sw->scale.aspect_ratio;
+    scale_y = sw->scale.scale_x * sw->scale.aspect_ratio;
+    
+    if (scale_x <= sw->scale.scale_x && scale_y <= sw->scale.scale_y) {
+       if (scale_x > scale_y)
+           sw->scale.scale_x = scale_x;
+       else
+           sw->scale.scale_y = scale_y;
+    }
+    else if (scale_x <= sw->scale.scale_x)
+       sw->scale.scale_x = scale_x;
+    else if (scale_y <= sw->scale.scale_y)
+       sw->scale.scale_y = scale_y;
+    else {
+       float x_ratio, y_ratio;
+       
+       x_ratio = scale_x / sw->scale.scale_x;
+       y_ratio = scale_y / sw->scale.scale_y;
+       
+       if (x_ratio < y_ratio)
+           sw->scale.scale_y /= x_ratio;
+       else
+           sw->scale.scale_x /= y_ratio;
+    }
+
+    if (fabs(sw->scale.scale_x / sw->scale.scale_y * sw->scale.aspect_ratio 
+           - 1.0) > sw->scale.precision)
+       XtWarning("can not preserve aspect ratio");
+}
+
+\f
+
+static void 
+GetScaledSize(ScaleWidget sw)
+{
+    sw->scale.width = (Dimension)
+       max(myrint(sw->scale.scale_x * sw->scale.image->width), 1);
+    sw->scale.height = (Dimension)
+       max(myrint(sw->scale.scale_y * sw->scale.image->height), 1);
+}
+
+\f
+
+static void 
+GetScaleValues(ScaleWidget sw)
+{
+    /*
+     * Make sure to subtract internal width and height.
+     */
+    
+    sw->scale.scale_x = 
+       (float) max((int)(sw->core.width - 2 * sw->scale.internal_width), 1)
+           / (float) sw->scale.image->width;
+
+    sw->scale.scale_y =
+       (float) max((int)(sw->core.height - 2 * sw->scale.internal_height), 1)
+           / (float) sw->scale.image->height;
+}
+
+\f
+
+static void 
+Unscale(ScaleWidget sw)
+{
+    sw->scale.scale_x = sw->scale.scale_y = 1.0;
+    GetScaledSize(sw);         
+    
+    BuildTable(sw);
+}
+
+\f
+
+static void 
+Autoscale(ScaleWidget sw)
+{
+    GetScaleValues(sw);
+
+    if (sw->scale.proportional) Proportional(sw);
+
+    Precision(sw);
+
+    GetScaledSize(sw);
+    
+    BuildTable(sw);
+}
+
+\f
+
+static void 
+PositionImage(ScaleWidget sw)
+{
+    /*
+     * Set as if for ForgegGravity (that is center the image)
+     */
+    sw->scale.x = (Position) 
+       (sw->core.width - sw->scale.width) / 2;
+    sw->scale.y = (Position)
+       (sw->core.height - sw->scale.height) / 2;
+    
+/*****
+    if (sw->scale.gravity & WestGravity) { 
+    }
+    if (sw->scale.gravity & EastGravity) { 
+    }
+    if (sw->scale.gravity & NorthGravity) {
+    }
+    if (sw->scale.gravity & SouthGravity) {
+    }
+*****/
+}
+
+\f
+
+static void 
+Resize(Widget w)
+{
+    ScaleWidget sw = (ScaleWidget) w;
+    
+    if (sw->scale.autoscale) Autoscale(sw);
+    
+    PositionImage(sw);
+}
+
+\f
+
+static void 
+Realize(Widget wid, Mask *vmask, XSetWindowAttributes *attr)
+{
+  ScaleWidget sw = (ScaleWidget) wid;
+  XtCreateWindow(wid, (unsigned int) InputOutput,
+                (Visual *) sw->scale.visual, *vmask, attr);
+}
+\f
+
+static void 
+Destroy(Widget w)
+{
+    ScaleWidget sw = (ScaleWidget) w; 
+
+    XtFree((char *) sw->scale.table.x);
+    XtFree((char *) sw->scale.table.y);
+    XtFree((char *) sw->scale.table.width);
+    XtFree((char *) sw->scale.table.height);
+    
+    XtFree((char *) sw->scale.rectangles);
+
+    XtReleaseGC(w, sw->scale.gc);
+
+    XDestroyImage(sw->scale.image);
+}
+
+\f
+
+/* ARGSUSED */
+static Boolean 
+SetValues(Widget current, Widget request, Widget new, 
+         ArgList args, Cardinal *num_args)
+{
+    ScaleWidget cur_sw = (ScaleWidget) current;
+    /* ScaleWidget req_sw = (ScaleWidget) request; */
+    ScaleWidget new_sw = (ScaleWidget) new;
+    Boolean redisplay = False;
+    Cardinal i;
+    
+    for (i = 0; i < *num_args; i++) {
+       if (streq(XtNbackground, args[i].name)) {
+           XSetBackground(XtDisplay(new), new_sw->scale.gc, 
+                          new_sw->core.background_pixel);
+       }
+       if (streq(XtNforeground, args[i].name)) {
+           XSetForeground(XtDisplay(new), new_sw->scale.gc, 
+                          new_sw->scale.foreground_pixel);
+       }
+       if (streq(XtNimage, args[i].name)) {
+           XDestroyImage(cur_sw->scale.image);
+           if (new_sw->scale.image == NULL)
+               new_sw->scale.image = XCreateImage(XtDisplay(new),
+                                               DefaultVisual(XtDisplay(new), 
+                                               DefaultScreen(XtDisplay(new))),
+                                                  1, XYBitmap, 0, 
+                                                  XtCalloc(1, sizeof(char)),
+                                                  1, 1, 8, 0);
+           else
+               new_sw->scale.image = 
+                   XSubImage(new_sw->scale.image, 
+                             0, 0, 
+                             new_sw->scale.image->width, 
+                             new_sw->scale.image->height);
+
+           if (new_sw->scale.resize)
+               TryResize(new_sw);
+           if (new_sw->scale.autoscale)
+               Autoscale(new_sw);
+           else {
+               GetScaledSize(new_sw);
+               BuildTable(new_sw);
+           }
+           PositionImage(new_sw);
+           redisplay = True;
+       }
+
+       if (streq(XtNuserData, args[i].name)) 
+         new_sw->scale.userData = (XtPointer)args[i].value;
+
+       if (streq(XtNbufferSize, args[i].name)) {
+           if (new_sw->scale.buffer_size != cur_sw->scale.buffer_size) {
+               GetRectangleBuffer(new_sw, new_sw->scale.buffer_size);
+           }
+       }
+
+       if (streq(XtNaspectRatio, args[i].name)) {
+           if ((new_sw->scale.aspect_ratio = 
+                atof(new_sw->scale.aspect_ratio_str)) < 0.0) {
+               new_sw->scale.aspect_ratio = cur_sw->scale.aspect_ratio;
+               XtWarning("AspectRatio has to be a positive number.");
+           }
+           else if (new_sw->scale.aspect_ratio != cur_sw->scale.aspect_ratio){
+               if (new_sw->scale.proportional) {
+                   Proportional(new_sw);
+                   Precision(new_sw);
+                   GetScaledSize(new_sw);
+                   BuildTable(new_sw);
+                   PositionImage(new_sw);
+                   redisplay = True;
+               }
+           }
+       }
+       
+       if (streq(XtNproportional, args[i].name)) {
+           if (new_sw->scale.proportional != cur_sw->scale.proportional) {
+               if (new_sw->scale.proportional) Proportional(new_sw);
+               Precision(new_sw);
+               GetScaledSize(new_sw);
+               BuildTable(new_sw);
+               PositionImage(new_sw);
+               redisplay = True;
+           }
+       }
+       
+       if (streq(XtNscaleX, args[i].name)
+           || 
+           streq(XtNscaleY, args[i].name)) {
+           if (new_sw->scale.scale_x_str == DefaultScaleFactor
+               || 
+               new_sw->scale.scale_y_str == DefaultScaleFactor)
+               GetInitialScaleValues(new_sw);
+           else {
+               if ((new_sw->scale.scale_x = 
+                    atof(new_sw->scale.scale_x_str)) < 0.0) {
+                   new_sw->scale.scale_x = cur_sw->scale.scale_x;
+                   XtWarning("ScaleValue has to be a positive number.");
+               }
+               if ((new_sw->scale.scale_y = 
+                    atof(new_sw->scale.scale_y_str)) < 0.0) {
+                   new_sw->scale.scale_y = cur_sw->scale.scale_y;
+                   XtWarning("ScaleValue has to be a positive number.");
+               }
+           }
+           if (new_sw->scale.scale_x != cur_sw->scale.scale_x
+               ||
+               new_sw->scale.scale_y != cur_sw->scale.scale_y) {
+               
+               /*?*?*?*?*?*?*?*?*?*?*?*?*?*?**?*?*?*?*?*?*?*?*?***?*/
+               fprintf(stderr, "================>>%f %f\n",
+                       new_sw->scale.scale_x, new_sw->scale.scale_y);
+               
+               if (new_sw->scale.proportional) Proportional(new_sw);
+               Precision(new_sw);
+               if (new_sw->scale.resize)
+                   TryResize(new_sw);
+               GetScaledSize(new_sw);          
+               BuildTable(new_sw);
+               PositionImage(new_sw);
+               redisplay = True;
+           }
+       }
+       
+       if (streq(XtNprecision, args[i].name)) {
+           if ((new_sw->scale.precision = 
+                atof(new_sw->scale.precision_str)) < 0.0) {
+               new_sw->scale.precision = cur_sw->scale.precision;
+               XtWarning("Precision has to be a positive number.");
+           }
+           if (new_sw->scale.precision != cur_sw->scale.precision) {
+               if (new_sw->scale.proportional) Proportional(new_sw);
+               Precision(new_sw);
+               GetScaledSize(new_sw);          
+               BuildTable(new_sw);
+               PositionImage(new_sw);
+               redisplay = True;
+           }
+       }
+    }              
+    return(redisplay);
+}
+
+\f
+
+void 
+SWUnscale(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    ScaleWidget sw = (ScaleWidget) w;
+
+    Unscale(sw);
+    PositionImage(sw);
+    XClearArea(XtDisplay(w), XtWindow(w), 0, 0, 0, 0, True);
+}
+
+\f
+
+void 
+SWAutoscale(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    ScaleWidget sw = (ScaleWidget) w;
+
+    Autoscale(sw);
+    PositionImage(sw);
+    XClearArea(XtDisplay(w), XtWindow(w), 0, 0, 0, 0, True);
+}
+
+\f
+
+void 
+SWInitialSize(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    ScaleWidget sw = (ScaleWidget) w;
+    
+    GetInitialScaleValues(sw);
+
+    if (sw->scale.proportional) Proportional(sw);
+    Precision(sw);
+    if (sw->scale.resize)
+       TryResize(sw);
+    GetScaledSize(sw);         
+    BuildTable(sw);
+    PositionImage(sw);
+    XClearArea(XtDisplay(w), XtWindow(w), 0, 0, 0, 0, True);
+}
+
+\f
+
+void 
+SWSetImage(Widget w, XImage *image)
+{
+    int n;
+    Arg wargs[2];
+    
+    n = 0;
+    XtSetArg(wargs[n], XtNimage, (XtArgVal) image); n++;
+    XtSetValues(w, wargs, n);
+}
+
+\f
+
+
+void 
+RequestSelection(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    SWRequestSelection(w, event->xbutton.time);
+}
+
+\f
+
+void 
+GrabSelection(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    SWGrabSelection(w, event->xbutton.time);
+}
+
+\f
+
+Pixmap 
+SWGetPixmap(Widget w)
+{
+    ScaleWidget sw = (ScaleWidget) w;
+    Pixmap pixmap;
+
+    pixmap = XCreatePixmap(XtDisplay(w), XtWindow(w), 
+                          sw->scale.width, 
+                          sw->scale.height, 
+                          sw->scale.image->depth);
+    ScaleImage(sw, pixmap, 
+              0, 0, 0, 0, 
+              (Dimension) sw->scale.image->width, 
+              (Dimension) sw->scale.image->height);
+    
+    return(pixmap);
+}
diff --git a/xmag/Scale.h b/xmag/Scale.h
new file mode 100644 (file)
index 0000000..2542886
--- /dev/null
@@ -0,0 +1,130 @@
+/* $Xorg: Scale.h,v 1.4 2001/02/09 02:05:55 xorgcvs Exp $ */
+/*
+
+Copyright 1993, 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/xmag/Scale.h,v 1.4 2001/01/17 23:46:20 dawes Exp $ */
+
+#ifndef _XawScale_h
+#define _XawScale_h
+
+/***********************************************************************
+ *
+ * Scale Widget
+ *
+ ***********************************************************************/
+
+#include <X11/Xaw/Simple.h>
+#include <X11/Xmu/Converters.h>
+
+/* Resources:
+
+ All the SimpleWidget resources plus...
+ Name                Class              RepType         Default Value
+ ----                -----              -------         -------------
+ aspectRatio         AspectRatio        Float           1.0
+ autoscale           Autoscale          Boolean         True
+ bufferSize          BufferSize         Cardinal        1024
+ foreground          Foreground         Pixel           XtDefaultForeground
+ gravity             Gravity            XtGravity       ForgetGravity
+ image               Image              XImage*         NULL
+ internalHeight      Height             Dimension       2
+ internalWidth       Width              Dimension       2
+ pasteBuffer         PasteBuffer        Boolean         False
+ precision           Precision          Float           0.001
+ proportional        Proportional       Boolean         False
+ resize              Resize             Boolean         True
+ scaleX              ScaleValue         Float           1.0
+ scaleY              ScaleValue         Float           1.0
+ userData            UserData           XtPointer       NULL
+ visual              Visual             Visual*         CopyFromParent
+*/
+
+#ifndef _XtStringDefs_h_
+#define XtNforeground "foreground"
+#define XtNinternalWidth "internalWidth"
+#define XtNinternalHeight "internalHeight"
+#define XtNresize "resize"
+#define XtCResize "Resize"
+#endif
+
+#define XtNaspectRatio "aspectRatio"
+#define XtCAspectRatio "AspectRatio"
+#define XtNbufferSize "bufferSize"
+#define XtCBufferSize "BufferSize"
+#define XtNscaleX "scaleX"
+#define XtNscaleY "scaleY"
+#define XtCScaleFactor "ScaleFactor"
+#define XtNautoscale "autoscale"
+#define XtCAutoscale "Autoscale"
+#define XtNproportional "proportional"
+#define XtCProportional "Proportional"
+#define XtNprecision "precision"
+#define XtCPrecision "Precision"
+#define XtNgravity "gravity"
+#define XtCGravity "Gravity"
+#define XtNpasteBuffer "pasteBuffer"
+#define XtCPasteBuffer "PasteBuffer"
+#define XtNimage "image"
+#define XtCImage "image"
+#define XtNexponent "exponent"
+#define XtCExponent "Exponent"
+#define XtNuserData "userData"
+#define XtCuserData "UserData"
+#define XtRuserData "UserData"
+#define XtRImage "Image"
+#ifndef XtNvisual
+#define XtNvisual "visual"
+#endif
+#define XtCvisual "Visual"
+#define XtRvisual "Visual"
+
+
+/* Class record constants */
+
+extern WidgetClass scaleWidgetClass;
+
+typedef struct _ScaleClassRec *ScaleWidgetClass;
+typedef struct _ScaleRec      *ScaleWidget;
+
+extern int SWGetImagePixel ( Widget w, Position x, Position y, 
+                            Position *img_x, Position *img_y, 
+                            Pixel *img_pixel );
+extern void SWUnscale ( Widget w, XEvent *event, String *params, 
+                       Cardinal *num_params );
+extern void SWAutoscale ( Widget w, XEvent *event, String *params, 
+                         Cardinal *num_params );
+extern void SWInitialSize ( Widget w, XEvent *event, String *params, 
+                           Cardinal *num_params );
+extern void SWSetImage ( Widget w, XImage *image );
+extern void RequestSelection ( Widget w, XEvent *event, String *params, 
+                              Cardinal *num_params );
+extern void GrabSelection ( Widget w, XEvent *event, String *params, 
+                           Cardinal *num_params );
+extern Pixmap SWGetPixmap ( Widget w );
+
+#endif /* _XawScale_h */
+
diff --git a/xmag/Scale.txt b/xmag/Scale.txt
new file mode 100644 (file)
index 0000000..1db99e8
--- /dev/null
@@ -0,0 +1,107 @@
+
+Scale Widget
+
+Header file            Scale.h
+Class                  scaleWidgetClass
+Class Name             Scale
+Superclass             Simple
+
+The Scale widget is an immutable image displayed within a rectangular
+region of the screen.  When the widget is selected, it is highlighted, 
+and an application callback routine is invoked.  When the
+widget is resized the image can be autoscaled to fit new size of the 
+widget window.  The widget can also cut and paste its contents.
+
+When creating a Scale widget instance, the following resources are
+retreived from the argument list or from the resource database:
+
+All the Simple Widget resources plus...
+-------------------------------------------------------------------------------
+ Name                Cass               Type            Default Value
+-------------------------------------------------------------------------------
+ aspectRatio         AspectRatio        Float           1.0
+ autoscale           Autoscale          Boolean         True
+ bufferSize          BufferSize         Cardinal        1024
+ foreground          Foreground         Pixel           XtDefaultForeground
+ gravity             Gravity            XtGravity       ForgetGravity
+ image               Image              XImage*         NULL
+ internalHeight      Height             Dimension       2
+ internalWidth       Width              Dimension       2
+ pasteBuffer         PasteBuffer        Boolean         False
+ precision           Precision          Float           0.001
+ proportional        Proportional       Boolean         True
+ resize              Resize             Boolean         True
+ scaleX              ScaleFactor        Float           DefaultScaleValue
+ scaleY              ScaleFactor        Float           DefaultScaleValue
+ exponent            Exponent           integer         -3
+-------------------------------------------------------------------------------
+
+ aspectRatio   This resource specifies the aspect ratio of the scaled image
+               in the x / y * aspectRatio = 1 form.  It is effective within
+               the precision resource only if proportional resource is set 
+               to true.  AspectRatio resource can be any positive number 
+               greater than zero.
+
+ autoscale     If this resource is set to True then the image will be
+               autoscaled to fit the window size within internal width
+               and internal height resource values.  If the resource is
+               False, the widget will only reposition the image
+               according to the gravity resource value.
+
+ bufferSize    This resource specifies the buffer size in XRectangle's for
+               buffering the XFillRectangle calls.  It is effective only 
+               for XYBitmap image type.
+
+ background    This resource has the same meaning as for the Simple widget.
+               However, it is worth mentioning that if the most frequent
+               pixel value in the XYPixmap or ZPixmap image is specified
+               as backgroud, the scaling process can be speeded up noticably.
+
+ foreground    The color used to paint the image if in XYBitmap format.
+               If the image is XYPixmap or ZPixmap format, the foreground
+               resource has no effect.
+
+ gravity       This resource will determine where to put the image if it does 
+               not fit the window size minus internal width and height.
+               The widget will try to preserve gravity rather than internal
+               width and height resources.
+
+ image         This is the image to be displayed in the widget window.
+               If no image is desired, the NULL value can be passed.  
+               The passed image is copied and set to the resource value.
+               Applications should destroy the passed image argument
+               if they do not intend to use it at some later time.
+
+ internalHeight        
+ internalWidth These resources specify the minimum distance from the boarder 
+               of the widget window to be maintanied when manipulating the 
+               image.  If image is too big or small to satisfy given 
+               conditions, the widget will position the image to preserve 
+               gravity rather than internalWidth or internalHeight.
+
+ pasteBuffer   If this resource is true then the widget owns the paste
+               selection buffer.  This resource can only be queried.
+
+ precision     This resource specifies the precision of the scale factors
+               when scaling the image.  The precision resource can be any 
+               positive number greater than zero. (For example, if precision
+               is 1.0 then the image will be scaled only by integer values.)
+
+ proportional  If this resource is set to true it will make sure that the 
+                image proportions, as specified by aspectRatio resource,
+                are being kept whenever it is scaled.  
+               
+ resize                If this resource is true the widget will try to resize when
+               addopting a new image thus preserveing the scale values.
+               If it is false the scale values will not be preserved unless
+               the image can fit in the current window size with the same
+               scale values.
+
+ scaleX
+ scaleY                These resources specify the scaling values for the widget
+               image.  They will be floored to satisfy precision resource
+               values.  If uniform resource is true the scale values will
+               be only integers.  These resources can be any positive number
+               greater than zero.
+
+ shiftFactor   ...
diff --git a/xmag/ScaleP.h b/xmag/ScaleP.h
new file mode 100644 (file)
index 0000000..181ae46
--- /dev/null
@@ -0,0 +1,104 @@
+/* $Xorg: ScaleP.h,v 1.4 2001/02/09 02:05:55 xorgcvs 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.
+
+*/
+
+/*
+ * Author:  Davor Matic, MIT X Consortium
+ */
+
+#ifndef _ScaleP_h
+#define _ScaleP_h
+
+#include "Scale.h"
+#include <X11/Xaw/SimpleP.h>
+
+typedef struct {
+    int foo;
+} ScaleClassPart;
+
+/* Full class record declaration */
+typedef struct _ScaleClassRec {
+  CoreClassPart          core_class;
+  SimpleClassPart        simple_class;
+  ScaleClassPart         scale_class;
+} ScaleClassRec;
+
+extern ScaleClassRec scaleClassRec;
+
+typedef struct {
+    Position *x, *y;
+    Dimension *width, *height;
+} Table;
+
+/* New fields for the Scale widget record */
+
+#ifndef XtGravity
+#define  XtGravity int
+#endif
+
+typedef struct {
+  /* resources */
+    Pixel       foreground_pixel;
+    Dimension   internal_width;
+    Dimension   internal_height;
+    XtGravity   gravity;
+    String      scale_x_str, scale_y_str;
+    String      aspect_ratio_str;
+    String      precision_str;
+    XImage      *image;
+    Boolean     resize;
+    Boolean     autoscale;
+    Boolean     proportional;
+    Boolean     paste_buffer;
+    Cardinal    buffer_size;
+    XtPointer   userData;
+    Visual      *visual;
+  /* private */
+    float       scale_x, scale_y;
+    float       aspect_ratio;
+    float       precision;
+    GC          gc;
+    Position    x, y;
+    Dimension   width, height;
+    Table       table;
+    XRectangle  *rectangles;
+    Cardinal    nrectangles;
+} ScalePart;
+
+/* Full instance record declaration */
+typedef struct _ScaleRec {
+  CorePart      core;
+  SimplePart    simple;
+  ScalePart scale;
+} ScaleRec;
+
+#endif /* _ScaleP_h */
+
+
+
+
diff --git a/xmag/aclocal.m4 b/xmag/aclocal.m4
new file mode 100644 (file)
index 0000000..c852fa3
--- /dev/null
@@ -0,0 +1,2110 @@
+# generated automatically by aclocal 1.10 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006  Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+
+m4_if(m4_PACKAGE_VERSION, [2.61],,
+[m4_fatal([this file was generated for autoconf 2.61.
+You have another version of autoconf.  If you want to use that,
+you should regenerate the build system entirely.], [63])])
+
+dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
+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.2.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])
+       # under Cygwin unix is still defined even with -undef
+       elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+               RAWCPPFLAGS="-undef -ansi"
+               AC_MSG_RESULT([yes, with -ansi])
+       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],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+
+if test x"$cross_compiling" = x"yes" ; then
+  HAVE_DEFS_ENT=no
+else
+  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+fi
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+AC_PATH_PROG(PS2PDF, ps2pdf)
+
+AC_MSG_CHECKING([Whether to build documentation])
+
+if test x$HAVE_DEFS_ENT != 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 && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([Whether to build text documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([Whether to build PDF documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([Whether to build PostScript documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([Whether to build HTML documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# 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
+
+# XORG_CWARNFLAGS
+# ---------------
+# Minimum version: 1.2.0
+#
+# Defines CWARNFLAGS to enable C compiler warnings.
+#
+AC_DEFUN([XORG_CWARNFLAGS], [
+AC_REQUIRE([AC_PROG_CC])
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast"
+    case `gcc -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS+=" -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+AC_SUBST(CWARNFLAGS)
+]) # XORG_CWARNFLAGS
+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.  Also
+# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+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
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+               [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+               [Major version of this package])
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+               [$PVM],
+               [Minor version of this package])
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+               [$PVP],
+               [Patch version of this package])
+])
+
+# XORG_CHANGELOG()
+# ----------------
+# Minimum version: 1.2.0
+#
+# Defines the variable CHANGELOG_CMD as the command to generate
+# ChangeLog from git.
+#
+# Arrange that distcleancheck ignores ChangeLog left over by distclean.
+#
+AC_DEFUN([XORG_CHANGELOG], [
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
+mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+AC_SUBST([CHANGELOG_CMD])
+AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
+]) # XORG_CHANGELOG
+
+# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.10'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.10], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.10])dnl
+_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
+
+# 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, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# 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])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+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, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# 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], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$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/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # 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])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# 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.
+  # Grep'ing the whole file is not good either: AIX grep has a line
+  # limit of 2048, but all sed's we know have understand at least 4000.
+  if sed 10q "$mf" | grep '^#.*generated by automake' > /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, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 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.60])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+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
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_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
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                  [_AM_DEPENDENCIES(OBJC)],
+                  [define([AC_PROG_OBJC],
+                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])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-"\$(SHELL) $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, 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 5
+
+# 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
+AC_REQUIRE_AUX_FILE([missing])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  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, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# 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="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+#
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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
+
+dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
+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 ensure that this macro is defined, also add:
+# m4_ifndef([XORG_MACROS_VERSION],
+#     [m4_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.
+m4_defun([XORG_MACROS_VERSION],[
+m4_define([vers_have], [1.2.2])
+m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
+m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
+m4_if(m4_cmp(maj_have, maj_needed), 0,,
+    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
+m4_if(m4_version_compare(vers_have, [$1]), -1,
+    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
+m4_undefine([vers_have])
+m4_undefine([maj_have])
+m4_undefine([maj_needed])
+]) # 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])
+       # under Cygwin unix is still defined even with -undef
+       elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+               RAWCPPFLAGS="-undef -ansi"
+               AC_MSG_RESULT([yes, with -ansi])
+       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],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+
+if test x"$cross_compiling" = x"yes" ; then
+  HAVE_DEFS_ENT=no
+else
+  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+fi
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+AC_PATH_PROG(PS2PDF, ps2pdf)
+
+AC_MSG_CHECKING([Whether to build documentation])
+
+if test x$HAVE_DEFS_ENT != 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 && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([Whether to build text documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([Whether to build PDF documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([Whether to build PostScript documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([Whether to build HTML documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# 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
+
+# XORG_CWARNFLAGS
+# ---------------
+# Minimum version: 1.2.0
+#
+# Defines CWARNFLAGS to enable C compiler warnings.
+#
+AC_DEFUN([XORG_CWARNFLAGS], [
+AC_REQUIRE([AC_PROG_CC])
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+AC_SUBST(CWARNFLAGS)
+]) # XORG_CWARNFLAGS
+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.  Also
+# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+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
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+               [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+               [Major version of this package])
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+               [$PVM],
+               [Minor version of this package])
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+               [$PVP],
+               [Patch version of this package])
+])
+
+# XORG_CHANGELOG()
+# ----------------
+# Minimum version: 1.2.0
+#
+# Defines the variable CHANGELOG_CMD as the command to generate
+# ChangeLog from git.
+#
+# Arrange that distcleancheck ignores ChangeLog left over by distclean.
+#
+AC_DEFUN([XORG_CHANGELOG], [
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
+mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+AC_SUBST([CHANGELOG_CMD])
+AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
+]) # XORG_CHANGELOG
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# 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_ifval([$1], [$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
+        PKG_CHECK_EXISTS([$3],
+                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                        [pkg_failed=yes])
+else
+       pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# 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])
+
+if test $pkg_failed = yes; then
+       $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
+
+       ifelse([$4], , [AC_MSG_ERROR(dnl
+[Package requirements ($2) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.])],
+               [$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.
+
+Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
+               [$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
+
diff --git a/xmag/app-defaults/Xmag b/xmag/app-defaults/Xmag
new file mode 100644 (file)
index 0000000..1bc4961
--- /dev/null
@@ -0,0 +1,27 @@
+! $Xorg: Xmag.ad,v 1.3 2000/08/17 19:54:54 cpqbld Exp $
+! $XFree86$
+*Font: fixed
+*pane2*orientation: horizontal
+*pane2*showGrip: False
+*allowShellResize: on
+*Scale.baseTranslations:#augment\
+                       <EnterWindow>: set-colors()\n\
+                       <LeaveWindow>: unset-colors()\n\
+                       <Btn1Down>:popup-pixel()\n\
+                       Button1<Enter>:popup-pixel()\n\
+                       <Btn1Motion>:update-pixel()\n\
+                       <Btn1Up>:popdown-pixel()\n\
+                       <Leave>:popdown-pixel()\n\
+                       <Key>n:new()\n\
+                       <Key>q:close()\n\
+                       Ctrl<Key>c:close()\n\
+                       <Key>space:replace()
+*close.accelerators:#augment\
+                       <Key>q:set()notify()unset()\n\
+                       Ctrl<Key>c:set()notify()unset()
+*replace.accelerators:#augment\
+                       <Key>space:set()notify()unset()\n\
+                       <Btn2Up>:set()notify()unset()\n\
+                       <Btn3Up>:set()notify()unset()
+*helpLabel.font:       8x13bold
+*helpLabel.label:      xmag
diff --git a/xmag/config.guess b/xmag/config.guess
new file mode 100755 (executable)
index 0000000..396482d
--- /dev/null
@@ -0,0 +1,1500 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
+
+timestamp='2006-07-02'
+
+# 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 <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+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 "$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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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 <stdlib.h>
+              #include <unistd.h>
+
+              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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       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*:[3456]*)
+       echo i586-pc-interix${UNAME_RELEASE}
+       exit ;;
+    EM64T:Interix*:[3456]*)
+       echo x86_64-unknown-interix${UNAME_RELEASE}
+       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*:*:* | x86_64: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 ;;
+    avr32*: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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-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 ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-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 <features.h>
+       #ifdef __ELF__
+       # ifdef __GLIBC__
+       #  if __GLIBC__ >= 2
+       LIBC=gnu
+       #  else
+       LIBC=gnulibc1
+       #  endif
+       # else
+       LIBC=gnulibc1
+       # endif
+       #else
+       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+       LIBC=gnu
+       #else
+       LIBC=gnuaout
+       #endif
+       #endif
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^LIBC/{
+               s: ::g
+               p
+           }'`"
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/xmag/config.h.in b/xmag/config.h.in
new file mode 100644 (file)
index 0000000..319be99
--- /dev/null
@@ -0,0 +1,70 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `nanosleep' function. */
+#undef HAVE_NANOSLEEP
+
+/* Define to 1 if you have the `poll' function. */
+#undef HAVE_POLL
+
+/* Define to 1 if you have the `select' function. */
+#undef HAVE_SELECT
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* 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
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
diff --git a/xmag/config.sub b/xmag/config.sub
new file mode 100755 (executable)
index 0000000..fab0aa3
--- /dev/null
@@ -0,0 +1,1616 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
+
+timestamp='2006-09-20'
+
+# 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 <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+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-newlib* | 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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | 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 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | 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 \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xc16x | xscale | xscalee[bl] | 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)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | 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-* \
+       | m32c-* | 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-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | 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-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tron-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | 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
+               ;;
+       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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       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 | sparcv9v)
+               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* | -solidbsd* \
+             | -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-newlib* | -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* | -rdos* | -toppers*)
+       # 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
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
+       *-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/xmag/configure b/xmag/configure
new file mode 100755 (executable)
index 0000000..61609b5
--- /dev/null
@@ -0,0 +1,6195 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.61 for xmag 1.0.3.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+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) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&    (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    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=.
+  case $as_dir in
+        /*)
+          for as_base in sh bash ksh sh5; do
+            as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+          done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+        # Try only shells that exist, to save several forks.
+        if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+               { ("$as_shell") 2> /dev/null <<\_ASEOF
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+              as_have_required=yes
+              if { "$as_shell" 2> /dev/null <<\_ASEOF
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf@gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+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$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+       case $1 in
+        -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# 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`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='xmag'
+PACKAGE_TARNAME='xmag'
+PACKAGE_VERSION='1.0.3'
+PACKAGE_STRING='xmag 1.0.3'
+PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+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
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+am__isrc
+CYGPATH_W
+PACKAGE
+VERSION
+ACLOCAL
+AUTOCONF
+AUTOMAKE
+AUTOHEADER
+MAKEINFO
+install_sh
+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
+CPP
+GREP
+EGREP
+CWARNFLAGS
+PKG_CONFIG
+XMAG_CFLAGS
+XMAG_LIBS
+APPDEFS_CFLAGS
+APPDEFS_LIBS
+appdefaultdir
+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
+CHANGELOG_CMD
+distcleancheck_listfiles
+LIBOBJS
+LTLIBOBJS'
+ac_subst_files=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+PKG_CONFIG
+XMAG_CFLAGS
+XMAG_LIBS
+APPDEFS_CFLAGS
+APPDEFS_LIBS'
+
+
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)   ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$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 ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -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'`
+    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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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'`
+    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; }; }
+    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 directory names.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { echo "$as_me: error: Working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$0" ||
+$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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 xmag 1.0.3 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR          info documentation [DATAROOTDIR/info]
+  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR           man documentation [DATAROOTDIR/man]
+  --docdir=DIR           documentation root [DATAROOTDIR/doc/xmag]
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
+_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 xmag 1.0.3:";;
+   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-appdefaultdir=<pathname>
+                          specify directory for app-defaults files (default is
+                          autodetected)
+  --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<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  PKG_CONFIG  path to pkg-config utility
+  XMAG_CFLAGS C compiler flags for XMAG, overriding pkg-config
+  XMAG_LIBS   linker flags for XMAG, overriding pkg-config
+  APPDEFS_CFLAGS
+              C compiler flags for APPDEFS, overriding pkg-config
+  APPDEFS_LIBS
+              linker flags for APPDEFS, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" || continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+xmag configure 1.0.3
+generated by GNU Autoconf 2.61
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 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
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by xmag $as_me 1.0.3, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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
+IFS=$as_save_IFS
+
+} >&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_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_arg'"
+      ;;
+    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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+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,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r 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 -f -r conftest* 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 -n "$CONFIG_SITE"; then
+  set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+  set x "$ac_default_prefix/share/config.site" \
+       "$ac_default_prefix/etc/config.site"
+fi
+shift
+for ac_site_file
+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 $ac_precious_vars; 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.10'
+
+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
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    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 -f 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
+
+{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+done
+IFS=$as_save_IFS
+
+fi
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+echo "${ECHO_T}$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$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
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+# test whether we have cygpath
+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='xmag'
+ VERSION='1.0.3'
+
+
+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-"\$(SHELL) $am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(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 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
+
+
+
+# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG
+
+
+
+
+
+
+
+
+
+
+
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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.exe
+  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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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.exe
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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[^ ]*//'`
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
+  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
+
+# Check that 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'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 that 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 { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 | *.map | *.inf | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+    *) 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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; 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 core 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
+{ 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
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       CFLAGS=""
+      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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+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 ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_c89=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 <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+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 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/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    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'
+
+
+
+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
+{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 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); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 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); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 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); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 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); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&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
+
+
+{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_GREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+    # Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_GREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_EGREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+    # Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_EGREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+
+   fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
+if test "${ac_cv_header_stdc+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 <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+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.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    { echo "$as_me:$LINENO: checking whether __SUNPRO_C is declared" >&5
+echo $ECHO_N "checking whether __SUNPRO_C is declared... $ECHO_C" >&6; }
+if test "${ac_cv_have_decl___SUNPRO_C+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.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __SUNPRO_C
+  (void) __SUNPRO_C;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl___SUNPRO_C=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl___SUNPRO_C=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl___SUNPRO_C" >&5
+echo "${ECHO_T}$ac_cv_have_decl___SUNPRO_C" >&6; }
+if test $ac_cv_have_decl___SUNPRO_C = yes; then
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+
+
+
+
+
+
+for ac_func in nanosleep poll select
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+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 $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* 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_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+# 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+  ;;
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+  ;;
+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
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+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 XMAG" >&5
+echo $ECHO_N "checking for XMAG... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xaw7\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xaw7") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_XMAG_CFLAGS=`$PKG_CONFIG --cflags "xaw7" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xaw7\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xaw7") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_XMAG_LIBS=`$PKG_CONFIG --libs "xaw7" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+else
+       pkg_failed=untried
+fi
+
+if test $pkg_failed = yes; then
+       XMAG_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xaw7"`
+       # Put the nasty error message in config.log where it belongs
+       echo "$XMAG_PKG_ERRORS" 1>&5
+
+       { { echo "$as_me:$LINENO: error: Package requirements (xaw7) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the XMAG_CFLAGS and XMAG_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details." >&5
+echo "$as_me: error: Package requirements (xaw7) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the XMAG_CFLAGS and XMAG_LIBS environment variables
+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 XMAG_CFLAGS and XMAG_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+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 XMAG_CFLAGS and XMAG_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+       XMAG_CFLAGS=$pkg_cv_XMAG_CFLAGS
+       XMAG_LIBS=$pkg_cv_XMAG_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       :
+fi
+XMAG_CFLAGS="$CWARNFLAGS $XMAG_CFLAGS"
+
+
+
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for APPDEFS" >&5
+echo $ECHO_N "checking for APPDEFS... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_APPDEFS_CFLAGS=`$PKG_CONFIG --cflags "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_APPDEFS_LIBS=`$PKG_CONFIG --libs "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+else
+       pkg_failed=untried
+fi
+
+if test $pkg_failed = yes; then
+       APPDEFS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xt"`
+       # Put the nasty error message in config.log where it belongs
+       echo "$APPDEFS_PKG_ERRORS" 1>&5
+
+       { { echo "$as_me:$LINENO: error: Package requirements (xt) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the APPDEFS_CFLAGS and APPDEFS_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details." >&5
+echo "$as_me: error: Package requirements (xt) were not met.
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively you may set the APPDEFS_CFLAGS and APPDEFS_LIBS environment variables
+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 APPDEFS_CFLAGS and APPDEFS_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+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 APPDEFS_CFLAGS and APPDEFS_LIBS environment variables
+to avoid the need to call pkg-config.  See the pkg-config man page for
+more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+       APPDEFS_CFLAGS=$pkg_cv_APPDEFS_CFLAGS
+       APPDEFS_LIBS=$pkg_cv_APPDEFS_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       :
+fi
+xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+
+# Check whether --with-appdefaultdir was given.
+if test "${with_appdefaultdir+set}" = set; then
+  withval=$with_appdefaultdir; appdefaultdir="$withval"
+else
+  appdefaultdir="${xt_appdefaultdir}"
+fi
+
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/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_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { 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=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_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; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ 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
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+
+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 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
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
+mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+
+distcleancheck_listfiles='find . -type f ! -name ChangeLog -print'
+
+
+
+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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     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 "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+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_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+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) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+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$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+       case $1 in
+        -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by xmag $as_me 1.0.3, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+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 and configuration settings, 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 <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+xmag config.status 1.0.3
+configured by $0, generated by GNU Autoconf 2.61,
+  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2006 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# 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
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --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;;
+  --he | --h)
+    # Conflict between --help and --header
+    { 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 ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { 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"
+     ac_need_defaults=false ;;
+
+  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 CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  CONFIG_SHELL=$SHELL
+  export CONFIG_SHELL
+  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) { { 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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+#
+# Set up the sed scripts for 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
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+am__isrc!$am__isrc$ac_delim
+CYGPATH_W!$CYGPATH_W$ac_delim
+PACKAGE!$PACKAGE$ac_delim
+VERSION!$VERSION$ac_delim
+ACLOCAL!$ACLOCAL$ac_delim
+AUTOCONF!$AUTOCONF$ac_delim
+AUTOMAKE!$AUTOMAKE$ac_delim
+AUTOHEADER!$AUTOHEADER$ac_delim
+MAKEINFO!$MAKEINFO$ac_delim
+install_sh!$install_sh$ac_delim
+STRIP!$STRIP$ac_delim
+INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
+mkdir_p!$mkdir_p$ac_delim
+AWK!$AWK$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+am__leading_dot!$am__leading_dot$ac_delim
+AMTAR!$AMTAR$ac_delim
+am__tar!$am__tar$ac_delim
+am__untar!$am__untar$ac_delim
+MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
+MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
+MAINT!$MAINT$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+DEPDIR!$DEPDIR$ac_delim
+am__include!$am__include$ac_delim
+am__quote!$am__quote$ac_delim
+AMDEP_TRUE!$AMDEP_TRUE$ac_delim
+AMDEP_FALSE!$AMDEP_FALSE$ac_delim
+AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
+CCDEPMODE!$CCDEPMODE$ac_delim
+am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
+am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
+CPP!$CPP$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+CWARNFLAGS!$CWARNFLAGS$ac_delim
+PKG_CONFIG!$PKG_CONFIG$ac_delim
+XMAG_CFLAGS!$XMAG_CFLAGS$ac_delim
+XMAG_LIBS!$XMAG_LIBS$ac_delim
+APPDEFS_CFLAGS!$APPDEFS_CFLAGS$ac_delim
+APPDEFS_LIBS!$APPDEFS_LIBS$ac_delim
+appdefaultdir!$appdefaultdir$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+host_os!$host_os$ac_delim
+APP_MAN_SUFFIX!$APP_MAN_SUFFIX$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+LIB_MAN_SUFFIX!$LIB_MAN_SUFFIX$ac_delim
+FILE_MAN_SUFFIX!$FILE_MAN_SUFFIX$ac_delim
+MISC_MAN_SUFFIX!$MISC_MAN_SUFFIX$ac_delim
+DRIVER_MAN_SUFFIX!$DRIVER_MAN_SUFFIX$ac_delim
+ADMIN_MAN_SUFFIX!$ADMIN_MAN_SUFFIX$ac_delim
+APP_MAN_DIR!$APP_MAN_DIR$ac_delim
+LIB_MAN_DIR!$LIB_MAN_DIR$ac_delim
+FILE_MAN_DIR!$FILE_MAN_DIR$ac_delim
+MISC_MAN_DIR!$MISC_MAN_DIR$ac_delim
+DRIVER_MAN_DIR!$DRIVER_MAN_DIR$ac_delim
+ADMIN_MAN_DIR!$ADMIN_MAN_DIR$ac_delim
+CHANGELOG_CMD!$CHANGELOG_CMD$ac_delim
+distcleancheck_listfiles!$distcleancheck_listfiles$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 15; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_ACEOF
+
+
+# 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
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      ac_file_inputs="$ac_file_inputs $ac_f"
+    done
+
+    # 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.  */
+    configure_input="Generated from "`IFS=:
+         echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    fi
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin";;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$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'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+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&@top_builddir@&$ac_top_builddir_sub&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out"; rm -f "$tmp/out";;
+  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
+  esac
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+_ACEOF
+
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status.  If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless.  But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([  #]*\\)[^        ]*\\([  ]*'
+ac_dB='\\)[     (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
+
+uniq confdefs.h |
+  sed -n '
+       t rset
+       :rset
+       s/^[     ]*#[    ]*define[       ][      ]*//
+       t ok
+       d
+       :ok
+       s/[\\&,]/\\&/g
+       s/^\('"$ac_word_re"'\)\(([^()]*)\)[      ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+       s/^\('"$ac_word_re"'\)[  ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+  ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then replace #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.
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[    #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is:         sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is:        sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be:    sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
+do
+  # Write a here document:
+    cat >>$CONFIG_STATUS <<_ACEOF
+    # First, check the format of the line:
+    cat >"\$tmp/defines.sed" <<\\CEOF
+/^[     ]*#[    ]*undef[        ][      ]*$ac_word_re[  ]*\$/b def
+/^[     ]*#[    ]*define[       ][      ]*$ac_word_re[(         ]/b def
+b
+:def
+_ACEOF
+  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+  grep . conftest.tail >/dev/null || break
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines conftest.tail
+
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
+cat >>$CONFIG_STATUS <<\_ACEOF
+  if test x"$ac_file" != x-; then
+    echo "/* $configure_input  */" >"$tmp/config.h"
+    cat "$ac_result" >>"$tmp/config.h"
+    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
+      rm -f $ac_file
+      mv "$tmp/config.h" $ac_file
+    fi
+  else
+    echo "/* $configure_input  */"
+    cat "$ac_result"
+  fi
+  rm -f "$tmp/out12"
+# 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" >`$as_dirname -- $ac_file ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X$ac_file : 'X\(//\)[^/]' \| \
+        X$ac_file : 'X\(//\)$' \| \
+        X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
+echo X$ac_file |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) 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.
+  # Grep'ing the whole file is not good either: AIX grep has a line
+  # limit of 2048, but all sed's we know have understand at least 4000.
+  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
+    dirpart=`$as_dirname -- "$mf" ||
+$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=`$as_dirname -- "$file" ||
+$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'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$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'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (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/xmag/configure.ac b/xmag/configure.ac
new file mode 100644 (file)
index 0000000..41730b9
--- /dev/null
@@ -0,0 +1,60 @@
+
+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(xmag, [1.0.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xmag)
+AM_INIT_AUTOMAKE([dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG
+m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.2)
+
+AM_CONFIG_HEADER(config.h)
+
+AC_PROG_CC
+AC_PROG_INSTALL
+
+XORG_CWARNFLAGS
+
+AC_CHECK_FUNCS([nanosleep poll select])
+
+# Checks for pkg-config packages
+PKG_CHECK_MODULES(XMAG, xaw7)
+XMAG_CFLAGS="$CWARNFLAGS $XMAG_CFLAGS"
+AC_SUBST(XMAG_CFLAGS)
+AC_SUBST(XMAG_LIBS)
+
+PKG_CHECK_MODULES(APPDEFS, xt)
+xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+AC_ARG_WITH(appdefaultdir,
+       AC_HELP_STRING([--with-appdefaultdir=<pathname>],
+         [specify directory for app-defaults files (default is autodetected)]),
+       [appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"])
+AC_SUBST(appdefaultdir)
+
+XORG_MANPAGE_SECTIONS
+XORG_RELEASE_VERSION
+XORG_CHANGELOG
+
+AC_OUTPUT([Makefile])
diff --git a/xmag/depcomp b/xmag/depcomp
new file mode 100755 (executable)
index 0000000..ca5ea4e
--- /dev/null
@@ -0,0 +1,584 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2006-10-15.18
+
+# Copyright (C) 1999, 2000, 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 to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    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"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # 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 mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $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/xmag/install-sh b/xmag/install-sh
new file mode 100755 (executable)
index 0000000..4fbbae7
--- /dev/null
@@ -0,0 +1,507 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2006-10-14.15
+
+# 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.
+
+nl='
+'
+IFS=" ""       $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+posix_glob=
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chmodcmd=$chmodprog
+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 $# -ne 0; 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) mode=$2
+        shift
+        shift
+       case $mode in
+         *' '* | *'    '* | *'
+'*       | *'*'* | *'?'* | *'['*)
+           echo "$0: invalid mode: $mode" >&2
+           exit 1;;
+       esac
+        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 $?;;
+
+    --)        shift
+       break;;
+
+    -*)        echo "$0: invalid option: $1" >&2
+       exit 1;;
+
+    *)  break;;
+  esac
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dstarg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dstarg"
+      shift # fnord
+    fi
+    shift # arg
+    dstarg=$arg
+  done
+fi
+
+if test $# -eq 0; 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
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src ;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    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
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+       (dirname "$dst") 2>/dev/null ||
+       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+            X"$dst" : 'X\(//\)[^/]' \| \
+            X"$dst" : 'X\(//\)$' \| \
+            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+       echo X"$dst" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+       # Create intermediate dirs using mode 755 as modified by the umask.
+       # This is like FreeBSD 'install' as of 1997-10-28.
+       umask=`umask`
+       case $stripcmd.$umask in
+         # Optimize common cases.
+         *[2367][2367]) mkdir_umask=$umask;;
+         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+         *[0-7])
+           mkdir_umask=`expr $umask + 22 \
+             - $umask % 100 % 40 + $umask % 20 \
+             - $umask % 10 % 4 + $umask % 2
+           `;;
+         *) mkdir_umask=$umask,go-w;;
+       esac
+
+       # With -d, create the new directory with the user-specified mode.
+       # Otherwise, rely on $mkdir_umask.
+       if test -n "$dir_arg"; then
+         mkdir_mode=-m$mode
+       else
+         mkdir_mode=
+       fi
+
+       posix_mkdir=false
+       case $umask in
+         *[123567][0-7][0-7])
+           # POSIX mkdir -p sets u+wx bits regardless of umask, which
+           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+           ;;
+         *)
+           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+           if (umask $mkdir_umask &&
+               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+           then
+             if test -z "$dir_arg" || {
+                  # Check for POSIX incompatibilities with -m.
+                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                  # other-writeable bit of parent directory when it shouldn't.
+                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                  case $ls_ld_tmpdir in
+                    d????-?r-*) different_mode=700;;
+                    d????-?--*) different_mode=755;;
+                    *) false;;
+                  esac &&
+                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                  }
+                }
+             then posix_mkdir=:
+             fi
+             rmdir "$tmpdir/d" "$tmpdir"
+           else
+             # Remove any dirs left behind by ancient mkdir implementations.
+             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+           fi
+           trap '' 0;;
+       esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+       umask $mkdir_umask &&
+       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+       /*) prefix=/ ;;
+       -*) prefix=./ ;;
+       *)  prefix= ;;
+      esac
+
+      case $posix_glob in
+        '')
+         if (set -f) 2>/dev/null; then
+           posix_glob=true
+         else
+           posix_glob=false
+         fi ;;
+      esac
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob && set -f
+      set fnord $dstdir
+      shift
+      $posix_glob && set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+       test -z "$d" && continue
+
+       prefix=$prefix$d
+       if test -d "$prefix"; then
+         prefixes=
+       else
+         if $posix_mkdir; then
+           (umask=$mkdir_umask &&
+            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+           # Don't fail if two instances are running concurrently.
+           test -d "$prefix" || exit 1
+         else
+           case $prefix in
+             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+             *) qprefix=$prefix;;
+           esac
+           prefixes="$prefixes '$qprefix'"
+         fi
+       fi
+       prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+       # Don't fail if two instances are running concurrently.
+       (umask $mkdir_umask &&
+        eval "\$doit_exec \$mkdirprog $prefixes") ||
+         test -d "$dstdir" || exit 1
+       obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # 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
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } &&
+
+    # Now rename the file to the real destination.
+    { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
+      || {
+          # The rename failed, perhaps because mv can't rename something else
+          # to itself, or perhaps because mv is so ancient that it does not
+          # support -f.
+
+          # Now remove or move aside any old file at destination location.
+          # We try this two ways since rm can't unlink itself on some
+          # systems and the destination file might be busy for other
+          # reasons.  In this case, the final cleanup might fail but the new
+          # file should still install successfully.
+          {
+            if test -f "$dst"; then
+              $doit $rmcmd -f "$dst" 2>/dev/null \
+              || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
+                    && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
+              || {
+                echo "$0: cannot unlink or rename $dst" >&2
+                (exit 1); exit 1
+              }
+            else
+              :
+            fi
+          } &&
+
+          # Now rename the file to the real destination.
+          $doit $mvcmd "$dsttmp" "$dst"
+        }
+    } || exit 1
+
+    trap '' 0
+  fi
+done
+
+# 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/xmag/missing b/xmag/missing
new file mode 100755 (executable)
index 0000000..1c8ff70
--- /dev/null
@@ -0,0 +1,367 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2006-05-10.23
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
+#   Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try \`$0 --help' for more information"
+  exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+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'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Now exit if we have it, but it failed.  Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case $1 in
+  lex|yacc)
+    # Not GNU programs, they don't have --version.
+    ;;
+
+  tar)
+    if test -n "$run"; then
+       echo 1>&2 "ERROR: \`tar' requires --run"
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       exit 1
+    fi
+    ;;
+
+  *)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       # Could not run --version or --help.  This is probably someone
+       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # $TOOL exists and not knowing $TOOL uses missing.
+       exit 1
+    fi
+    ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $1 in
+  aclocal*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
+         to install the \`Automake' and \`Perl' packages.  Grab them from
+         any GNU archive site."
+    touch aclocal.m4
+    ;;
+
+  autoconf)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`${configure_ac}'.  You might want to install the
+         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+         archive site."
+    touch configure
+    ;;
+
+  autoheader)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site."
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z "$files" && files="config.h"
+    touch_files=
+    for f in $files; do
+      case $f in
+      *:*) touch_files="$touch_files "`echo "$f" |
+                                      sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files="$touch_files $f.in";;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site."
+    find . -type f -name Makefile.am -print |
+          sed 's/\.am$/.in/' |
+          while read f; do touch "$f"; done
+    ;;
+
+  autom4te)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1' as part of \`Autoconf' from any GNU
+         archive site."
+
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if test ! -f y.tab.h; then
+       echo >y.tab.h
+    fi
+    if test ! -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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if test ! -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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+       /^@setfilename/{
+         s/.* \([^ ]*\) *$/\1/
+         p
+         q
+       }' $infile`
+      # ... 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/xmag/xmag.c b/xmag/xmag.c
new file mode 100644 (file)
index 0000000..cbcf399
--- /dev/null
@@ -0,0 +1,1141 @@
+/* $Xorg: xmag.c,v 1.4 2001/02/09 02:05:55 xorgcvs Exp $ */
+/*
+
+Copyright 1991, 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: xmag.c,v 1.13 2003/05/27 22:27:07 tsi Exp $ */
+
+#include "config.h"
+
+#include <stdlib.h>            /* for exit() and abs() */
+#include <stdio.h>
+
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Xaw/Paned.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Shell.h>
+#include <X11/cursorfont.h>
+#include <X11/Xmu/Error.h>
+#include "RootWin.h"
+#include "Scale.h"
+#include "CutPaste.h"
+
+#define SRCWIDTH  64
+#define SRCHEIGHT 64
+
+#ifndef min
+#define min(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
+#ifndef max
+#define max(a, b) ((a) > (b) ? (a) : (b))
+#endif
+
+\f
+
+/* highlight interval (in milliseconds) */
+#define HLINTERVAL  100
+
+/* sleep between draw & erase of highlight
+ * 20 milliseconds - enough for screen refresh - not too long to annoy users
+ *  since we hold a server grab during this time
+ */
+#define HLSLEEPINTERVAL 20 /* milliseconds */
+
+#ifdef HAVE_NANOSLEEP
+#include <time.h>
+#define HLSLEEP            do { \
+       struct timespec sleeptime = { 0 , HLSLEEPINTERVAL * 1000000 } ; \
+       nanosleep(&sleeptime, NULL); \
+    } while(0)
+#elif defined(HAVE_POLL)
+#include <poll.h>
+#define HLSLEEP            poll(NULL, 0, HLSLEEPINTERVAL)
+#elif defined(HAVE_SELECT)
+#include <X11/Xpoll.h>
+#define HLSLEEP            do { \
+       struct timeval sleeptime = { 0 , HLSLEEPINTERVAL * 1000 } ;     \
+       select(0, NULL, NULL, NULL, &sleeptime); \
+    } while(0)
+#else
+#define HLSLEEP        XSync(dpy, False)
+#endif
+
+/* highlight mode */
+typedef enum { drag, resize, done } hlMode; 
+
+/* highlight data structure */
+typedef struct { 
+  Boolean   newScale;
+  hlMode    selectMode;
+  GC        gc;
+  XWindowAttributes win_info;   
+  XImage     *image;
+  Position  homeX, homeY, x, y;
+  Dimension width, height;
+  Widget    scaleShell, scaleInstance, pixShell, pixLabel, cmapWinList [2];
+  } hlStruct, *hlPtr;
+
+\f
+
+/* global variables */
+static XtAppContext app;
+static Cursor ulAngle, urAngle, lrAngle, llAngle;
+static Display *dpy;
+static int scr;
+static GC selectGC; 
+static XGCValues selectGCV;
+static Widget toplevel, root;
+static Atom wm_delete_window;
+static int numXmags = 0;
+static int srcStat, srcX, srcY;
+static unsigned int srcWidth, srcHeight;
+
+/* forward declarations */
+
+static int Error(Display *, XErrorEvent *);
+static void CloseAP(Widget, XEvent *, String *, Cardinal *);
+static void SetCmapPropsAP(Widget, XEvent *, String *, Cardinal *);
+static void UnsetCmapPropsAP(Widget, XEvent *, String *, Cardinal *);
+static void NewAP(Widget, XEvent *, String *, Cardinal *);
+static void ReplaceAP(Widget, XEvent *, String *, Cardinal *);
+static void PopupPixelAP(Widget, XEvent *, String *, Cardinal *);
+static void UpdatePixelAP(Widget, XEvent *, String *, Cardinal *);
+static void PopdownPixelAP(Widget, XEvent *, String *, Cardinal *);
+static void SelectRegionAP(Widget, XEvent *, String *, Cardinal *);
+static void CheckPoints(Position *, Position *, Position *, Position *);
+static void HighlightTO(XtPointer, XtIntervalId *);
+static void CloseCB(Widget, XtPointer, XtPointer);
+static void ReplaceCB(Widget, XtPointer, XtPointer);
+static void NewCB(Widget, XtPointer, XtPointer);
+static void SelectCB(Widget, XtPointer, XtPointer);
+static void PasteCB(Widget, XtPointer, XtPointer);
+static void SetupGC(void);
+static Window FindWindow(int, int);
+static void ResizeEH(Widget, XtPointer, XEvent *, Boolean *);
+static void DragEH(Widget, XtPointer, XEvent *, Boolean *);
+static void StartRootPtrGrab(int, hlPtr);
+static void CreateRoot(void);
+static void GetImageAndAttributes(Window, int, int, int, int, hlPtr);
+static int Get_XColors(XWindowAttributes *, XColor **);
+static Pixel GetMaxIntensity(hlPtr);
+static Pixel GetMinIntensity(hlPtr);
+static void PopupNewScale(hlPtr);
+static void RedoOldScale(hlPtr);
+static void InitCursors(void);
+static void ParseSourceGeom(void);
+
+/* application resources */
+
+typedef struct { String geometry, source, mag, title; } OptionsRec;
+static OptionsRec options;
+
+#define Offset(field) XtOffsetOf(OptionsRec, field)
+static XtResource resources[] = {
+  {"geometry", "Geometry", XtRString, sizeof(String),
+     Offset(geometry), XtRString, (XtPointer)NULL},
+  {"mag", "Mag", XtRString, sizeof(String),
+     Offset(mag), XtRString, (XtPointer)"5.0"},
+  {"source", "Source", XtRString, sizeof(String),
+     Offset(source), XtRString, (XtPointer)"SRCWIDTHxSRCHEIGHT"},
+  {"title", XtCString, XtRString, sizeof(char *),
+     Offset(title), XtRString, "xmag"},
+};
+#undef Offset
+
+static XrmOptionDescRec optionDesc[] = {
+  {"-bd",         "*borderColor", XrmoptionSepArg, (XtPointer)NULL},
+  {"-bg",         "*background",   XrmoptionSepArg, (XtPointer)NULL},
+  {"-bw",         "*borderWidth", XrmoptionSepArg, (XtPointer)NULL},
+  
+  {"-geometry", "*geometry", XrmoptionSepArg, (XtPointer)NULL},
+  {"-mag",      "*mag",                XrmoptionSepArg, (XtPointer)NULL},
+  {"-source",   "*source",             XrmoptionSepArg, (XtPointer)NULL},
+  {"-title",    "*title",              XrmoptionSepArg, (XtPointer)NULL},
+};
+
+\f
+
+/* action table */
+
+static XtActionsRec actions_table[] = {
+  {"close", CloseAP},
+  {"set-colors", SetCmapPropsAP},
+  {"unset-colors", UnsetCmapPropsAP},
+  {"new", NewAP},
+  {"replace", ReplaceAP},
+  {"popup-pixel", PopupPixelAP},
+  {"update-pixel", UpdatePixelAP},
+  {"popdown-pixel", PopdownPixelAP},
+  {"select-region", SelectRegionAP}
+};
+
+\f
+
+/*
+ * Error() -- Error handler:  Catch a bad match in magnifing an
+ *            area that contains bits of different depths.
+ */
+static int 
+Error(Display *dpy, XErrorEvent *err)
+{
+  (void) XmuPrintDefaultErrorMessage (dpy, err, stderr);
+  return 0;
+}
+
+
+/*
+ * CloseAP() -- Close this dialog.  If its the last one exit the program.
+ *          
+ */
+static void                    /* ARGSUSED */
+CloseAP(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+  Arg wargs[2]; int n; hlPtr data;
+  if (!--numXmags) exit(0);
+  if (event->type != ClientMessage) {
+    n = 0;                     /* get user data */
+    XtSetArg(wargs[0], XtNuserData, &data); n++;
+    XtGetValues(w, wargs, n); 
+    w = data->scaleShell;
+  }
+  XtPopdown(w);
+  XtDestroyWidget(w);
+}
+
+\f
+
+/*
+ * SetCmapPropsAP() -- Put the scale widget first in WM_COLORMAP_WINDOWS
+ *                     
+ */
+static void                    /* ARGSUSED */
+SetCmapPropsAP(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+  Arg wargs[2]; int n; hlPtr data;
+  n = 0;                       /* get user data */
+  XtSetArg(wargs[0], XtNuserData, &data); n++;
+  XtGetValues(w, wargs, n);
+  if (data->win_info.colormap != DefaultColormap(dpy, scr)) {
+    data->cmapWinList[0] = data->scaleInstance;
+    data->cmapWinList[1] = data->scaleShell;
+    XtSetWMColormapWindows(data->scaleShell, data->cmapWinList, 2);
+  }
+}
+
+\f
+
+/*
+ * UnsetCmapPropsAP() -- Put the shell first in WM_COLORMAP_WINDOWS
+ *                     
+ */
+static void                    /* ARGSUSED */
+UnsetCmapPropsAP(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+  Arg wargs[2]; int n; hlPtr data;
+  n = 0;                       /* get user data */
+  XtSetArg(wargs[0], XtNuserData, &data); n++;
+  XtGetValues(w, wargs, n);
+  if (data->win_info.colormap != DefaultColormap(dpy, scr)) {
+    data->cmapWinList[0] = data->scaleShell;
+    data->cmapWinList[1] = data->scaleInstance;
+    XtSetWMColormapWindows(data->scaleShell, data->cmapWinList, 2);
+  }
+}
+
+\f
+
+/*
+ * NewAP() -- Create an additional xmag dialog. THIS IS A COPY OF NewEH
+ *                                              FIND A BETTER WAY....
+ */
+static void                    /* ARGSUSED */
+NewAP(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+  StartRootPtrGrab(True, NULL);
+}
+
+\f
+
+/*
+ * ReplaceAP() -- Replace this particular xmag dialog.
+ */
+static void                     /* ARGSUSED */
+ReplaceAP(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+  Arg wargs[2]; int n; hlPtr data;
+  n = 0;                       /* get user data */
+  XtSetArg(wargs[0], XtNuserData, &data); n++;
+  XtGetValues(w, wargs, n); 
+  StartRootPtrGrab(False, data);
+}
+
+\f
+
+/*
+ * PopupPixelAP() -- Show pixel information.
+ */
+static void                    /* ARGSUSED */
+PopupPixelAP(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    Position scale_x, scale_y;
+    Dimension scale_height;
+    Position label_x, label_y;
+    Dimension label_height;
+    int n;
+    Arg wargs[3];
+    hlPtr data;
+
+    n = 0;                     /* get user data */
+    XtSetArg(wargs[0], XtNuserData, &data); n++;
+    XtGetValues(w, wargs, n);
+
+    n = 0;
+    XtSetArg(wargs[n], XtNheight, &scale_height); n++;
+    XtGetValues(w, wargs, n);
+    XtTranslateCoords(w, -1, -1, &scale_x, &scale_y);
+    
+    XtRealizeWidget(data->pixShell); /* to get the right height  */
+
+    n = 0;
+    XtSetArg(wargs[n], XtNheight, &label_height); n++;
+    XtGetValues(data->pixShell, wargs, n);
+    
+    if ((double) event->xbutton.y / (double) scale_height > 0.5) {
+       label_x = scale_x;
+       label_y = scale_y;
+    }
+    else {
+       label_x = scale_x;
+       label_y = scale_y + scale_height - label_height;
+    }
+
+    n = 0;
+    XtSetArg(wargs[n], XtNx, label_x); n++;
+    XtSetArg(wargs[n], XtNy, label_y); n++;
+    XtSetValues(data->pixShell, wargs, n);
+
+    UpdatePixelAP(w, event, NULL, NULL);
+}
+
+\f
+
+/*
+ * UpdatePixelAP() -- Update pixel information.
+ */
+static void                    /* ARGSUSED */
+UpdatePixelAP(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+    Position x, y;
+    Pixel pixel;
+    XColor color;
+    int n;
+    Arg wargs[3];
+    char string[80];
+    hlPtr data;
+
+    n = 0;
+    XtSetArg(wargs[0], XtNuserData, &data); n++;
+    XtGetValues(w, wargs, n);
+
+    if (SWGetImagePixel(w, event->xbutton.x, event->xbutton.y, &x, &y, &pixel))
+       XtPopdown(data->pixShell);
+    else {
+       color.pixel = pixel;
+       XQueryColor(dpy, data->win_info.colormap, &color);
+       sprintf(string, "Pixel %ld at (%d,%d) colored (%x,%x,%x).", 
+               pixel, x + data->x, y + data->y,
+               color.red, color.green, color.blue);
+       n = 0;
+       XtSetArg(wargs[n], XtNlabel, string); n++;    
+       XtSetValues(data->pixLabel, wargs, n);
+       XtPopup(data->pixShell, XtGrabNone);
+    }
+}
+
+\f
+
+/*
+ * PopdownPixelAP() -- Remove pixel info.
+ */
+static void                    /* ARGSUSED */
+PopdownPixelAP(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+  int n;
+  Arg wargs[3];
+  hlPtr data = NULL;
+  
+  n = 0;
+  XtSetArg(wargs[0], XtNuserData, &data); n++;
+  XtGetValues(w, wargs, n);
+
+  if (data)
+    XtPopdown(data->pixShell);
+}
+
+\f
+
+static void                    /* ARGSUSED */
+SelectRegionAP(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{    
+/***** NOT SURE WHAT TO DO WITH THIS 
+    if (app_resources.unmap)
+       XtUnmapWidget(toplevel);
+    Redisplay(XtDisplay(w), RootWindow(XtDisplay(w),
+                                      DefaultScreen(XtDisplay(w))),
+             source.width, source.height, 
+             app_resources.freq, app_resources.puls, 
+             ul_angle, lr_angle,
+             app_resources.grab);
+
+    if (app_resources.unmap)
+       XtMapWidget(toplevel);
+******/
+}
+
+\f
+
+/* 
+ * CheckPoints() -- Change the cursor for the correct quadrant.
+ *                  Make sure the first point is less than the second 
+ *                  for drawing the selection rectangle.
+ *
+ */
+static void 
+CheckPoints(Position *x1, Position *x2, Position *y1, Position *y2)
+{
+  Position tmp; 
+  Boolean above, left;
+  Cursor newC;
+  above = (*y2 < *y1); left = (*x2 < *x1); 
+  if (above&&left) newC = ulAngle;
+  else if (above&&!left) newC = urAngle;
+  else if (!above&&!left) newC = lrAngle;
+  else newC = llAngle;
+  XChangeActivePointerGrab
+    (dpy, PointerMotionMask|ButtonPressMask|ButtonReleaseMask,
+     newC, CurrentTime);
+  if (*x2 < *x1) { tmp = *x1; *x1 = *x2; *x2 = tmp; }
+  if (*y2 < *y1) { tmp = *y1; *y1 = *y2; *y2 = tmp; }
+}
+
+\f
+
+/*
+ * HighlightTO() -- Timer to highlight the selection box
+ */
+static void
+HighlightTO(XtPointer closure, XtIntervalId *id)       /* ARGSUSED */
+{
+  hlPtr data = (hlPtr)closure;
+  XGrabServer(dpy);
+  if (data->selectMode == drag) {
+    XDrawRectangle(dpy, DefaultRootWindow(dpy), data->gc, 
+                  data->x, data->y, data->width, data->height);
+    XFlush(dpy);
+    HLSLEEP;
+    XDrawRectangle(dpy, DefaultRootWindow(dpy), data->gc, 
+                  data->x, data->y, data->width, data->height);
+  }
+  else if (data->selectMode == resize) {       
+    Position x1 = data->homeX,
+             x2 = data->x,
+             y1 = data->homeY,
+             y2 = data->y;
+    CheckPoints(&x1, &x2, &y1, &y2);
+    XDrawRectangle(dpy, DefaultRootWindow(dpy), data->gc, 
+                  x1, y1, x2 - x1, y2 - y1);
+    XFlush(dpy);
+    HLSLEEP;
+    XDrawRectangle(dpy, DefaultRootWindow(dpy), data->gc, 
+                  x1, y1, x2 - x1, y2 - y1);
+  }
+  XUngrabServer(dpy);
+  if (data->selectMode != done)
+    XtAppAddTimeOut(app, HLINTERVAL, HighlightTO, (XtPointer)data);
+}
+
+\f
+
+/*
+ * CloseCB() -- Delete this xmag dialog.  If its the only one on the screen
+ *             then exit.
+ */
+static void                    /* ARGSUSED */
+CloseCB(Widget w, XtPointer clientData, XtPointer callData)
+{
+  Widget shell = (Widget)clientData;
+  if (!--numXmags) exit(0);
+  XtPopdown(shell);
+  XtDestroyWidget(shell);
+}
+
+\f
+
+/*
+ * ReplaceCB() -- Replace this particular xmag dialog.
+ */
+static void                     /* ARGSUSED */
+ReplaceCB(Widget w, XtPointer clientData, XtPointer callData)
+{
+  hlPtr data = (hlPtr)clientData;
+  StartRootPtrGrab(False, data);
+}
+
+\f
+
+/*
+ * NewCB() -- Create an additional xmag dialog.
+ */
+static void                    /* ARGSUSED */
+NewCB(Widget w, XtPointer clientData, XtPointer callData)
+{
+  StartRootPtrGrab(True, NULL);
+}
+
+\f
+
+/*
+ * SelectCB() -- Own the primary selection.
+ */
+static void                    /* ARGSUSED */
+SelectCB(Widget w, XtPointer clientData, XtPointer callData)
+{
+  hlPtr data = (hlPtr)clientData;
+  SWGrabSelection(data->scaleInstance, XtLastTimestampProcessed(dpy));
+}
+
+\f
+
+/*
+ * PasteCB() -- Paste from the primary selectin into xmag.
+ */
+static void                    /* ARGSUSED */
+PasteCB(Widget w, XtPointer clientData, XtPointer callData)
+{
+  hlPtr data = (hlPtr)clientData;
+  SWRequestSelection(data->scaleInstance, XtLastTimestampProcessed(dpy));
+}
+
+\f
+
+/*
+ * SetupGC() -- Graphics context for magnification selection.
+ */
+static void 
+SetupGC(void)
+{
+    selectGCV.function = GXxor;
+    selectGCV.foreground = 0xffffffff;
+    selectGCV.subwindow_mode = IncludeInferiors;
+    selectGC = XtGetGC(toplevel, GCFunction|GCForeground|GCSubwindowMode,
+                      &selectGCV);
+}  
+
+\f
+
+/*
+ * FindWindow() -- Determin window the pointer is over.
+ *
+ */
+static Window 
+FindWindow(int x, int y)       /* Locatation of cursor */
+{
+  XWindowAttributes wa;
+  Window findW = DefaultRootWindow(dpy), stopW, childW;
+
+  /* Setup for first window find */
+  stopW = findW;
+
+  while (stopW) {
+    XTranslateCoordinates(dpy, findW, stopW, 
+                         x, y, &x, &y, &childW);
+    findW = stopW;
+    /* If child is not InputOutput (for example, InputOnly) */
+    /* then don't continue, return the present findW which */
+    /* can be the root, or a root child of class InputOutput */
+    if (childW &&
+       XGetWindowAttributes(dpy, childW, &wa) &&
+       wa.class != InputOutput)
+       break;
+    stopW = childW;
+  }
+  return findW;
+}
+
+\f
+
+/*
+ * ResizeEH() -- Event Handler for resize of selection box.
+ */
+static void 
+ResizeEH(Widget w, XtPointer closure, XEvent *event, 
+        Boolean *continue_to_dispatch) /* ARGSUSED */
+{
+  hlPtr data = (hlPtr)closure;
+  switch (event->type) {
+  case MotionNotify:
+    data->x = event->xmotion.x_root;
+    data->y = event->xmotion.y_root; 
+    break;
+  case ButtonRelease:
+    GetImageAndAttributes(FindWindow(event->xmotion.x_root,
+                       event->xmotion.y_root),
+            min(data->homeX,event->xbutton.x_root),
+            min(data->homeY,event->xbutton.y_root),
+            abs(data->homeX - event->xbutton.x_root),
+            abs(data->homeY - event->xbutton.y_root),
+            data);
+    if (data->newScale)
+      PopupNewScale(data);
+    else 
+      SWSetImage(data->scaleInstance, data->image);
+    XtUngrabPointer(w, CurrentTime);
+/*****
+    XtRemoveRawEventHandler(w, PointerMotionMask|ButtonReleaseMask,
+                        True, ResizeEH, (XtPointer)data);
+*****/
+    XtRemoveEventHandler(w, PointerMotionMask|ButtonReleaseMask,
+                        True, ResizeEH, (XtPointer)data);
+    data->selectMode = done;
+    break;
+  }
+}
+
+\f
+
+/*
+ * DragEH() -- Event Handler for draging selection box.
+ */
+static void 
+DragEH(Widget w, XtPointer closure, XEvent *event, 
+       Boolean *continue_to_dispatch) /* ARGSUSED */
+{
+  hlPtr data = (hlPtr)closure;
+  switch (event->type) {
+  case MotionNotify:           /* drag mode */
+    data->x = event->xmotion.x_root;
+    data->y = event->xmotion.y_root;
+    break;
+  case ButtonRelease:          /* end drag mode */
+    if (event->xbutton.button == Button1) { /* get image */
+      /* Problem: You can't get bits with XGetImage outside of its window.
+       *          xmag will only do a GetImage on the actual window in the case
+       *          where the depth of the window does not match the depth of
+       *          the root window.
+       */
+      GetImageAndAttributes(FindWindow(event->xmotion.x_root, 
+                         event->xmotion.y_root),
+              event->xbutton.x_root, 
+              event->xbutton.y_root,
+              srcWidth, srcHeight, data);
+      if (data->newScale)
+       PopupNewScale(data);
+      else
+       RedoOldScale(data);
+      XtUngrabPointer(w, CurrentTime);
+      XtRemoveRawEventHandler(w, PointerMotionMask|ButtonPressMask|
+                             ButtonReleaseMask, True, DragEH,
+                             (XtPointer)data);
+      data->selectMode = done;
+    }
+
+    break;
+  case ButtonPress:    
+    if (event->xbutton.button == Button2) {    /* turn on resize mode */
+      data->homeX = event->xbutton.x_root; 
+      data->homeY = event->xbutton.y_root;
+      data->x = event->xbutton.x_root + srcWidth;
+      data->y = event->xbutton.y_root + srcHeight;      
+      data->selectMode = resize;
+      XtRemoveRawEventHandler(w, PointerMotionMask|ButtonPressMask|
+                          ButtonReleaseMask, True, DragEH, (XtPointer)data);
+      XChangeActivePointerGrab
+       (dpy, PointerMotionMask|ButtonPressMask|ButtonReleaseMask,
+        lrAngle, CurrentTime);
+      XWarpPointer(dpy, None, None, 0, 0, 0, 0, 
+                  srcWidth, srcHeight);
+      XtAddEventHandler(w, PointerMotionMask|ButtonReleaseMask, 
+                       True, ResizeEH, (XtPointer)data);
+    }
+    break;
+  }
+}
+
+
+\f
+
+/*
+ * StartRootPtrGrab() -- Bring up the selection box.
+ *              
+ */
+static void
+StartRootPtrGrab(int new,      /* do we cretate a new scale instance? */
+                hlPtr data)    /* highligh data */
+{
+  Window    rootR, childR;
+  int       rootX, rootY, winX, winY;
+  unsigned  int mask;
+  hlPtr hlData;
+  XtGrabPointer
+    (root, False,
+     PointerMotionMask|ButtonPressMask|ButtonReleaseMask,
+     GrabModeAsync, GrabModeAsync, None, ulAngle, CurrentTime);
+  XQueryPointer(dpy, DefaultRootWindow(dpy), &rootR, &childR, 
+               &rootX, &rootY, &winX, &winY, &mask);
+  if (new) {
+    numXmags++;
+    hlData = (hlPtr)XtMalloc(sizeof(hlStruct));
+  }
+  else hlData = data;
+  hlData->newScale   = new;
+  hlData->selectMode = drag;
+  hlData->x          = rootX;
+  hlData->y          = rootY;
+  hlData->gc         = selectGC;
+  hlData->width      = srcWidth;
+  hlData->height     = srcHeight;
+  XtAddRawEventHandler
+    (root, PointerMotionMask|ButtonPressMask|ButtonReleaseMask, 
+     True, DragEH, (XtPointer)hlData);
+  (void) XtAppAddTimeOut(app, HLINTERVAL, HighlightTO, (XtPointer)hlData);
+}
+
+\f
+
+/*
+ * CreateRoot() -- Create a root window widget. If the user specified x and y
+ *                 in his source geometry then use this to directly get the
+ *                 image.
+ */
+static void
+CreateRoot(void)
+{
+  hlPtr data;
+  root = XtCreateWidget("root", rootWindowWidgetClass, toplevel, NULL, 0);
+  XtRealizeWidget(root);
+  if (XValue & srcStat && YValue &srcStat) { 
+    numXmags = 1;
+    data = (hlPtr)XtMalloc(sizeof(hlStruct));
+    data = data;
+    data->newScale   = True;
+    data->selectMode = drag;
+    data->x          = srcX;
+    data->y          = srcY;
+    data->gc         = selectGC;
+    data->width      = srcWidth;
+    data->height     = srcHeight;
+    GetImageAndAttributes(RootWindow(dpy, scr), srcX, srcY, srcWidth, 
+                         srcHeight, data);
+    PopupNewScale(data);
+    return;
+  }
+}
+
+
+/* 
+ * GetImageAndAttributes() -- Get the image bits from the screen.
+ *               We will also determin here the colormap, depth, and
+ *               visual to be used for the magnification image.  
+ */
+static void 
+GetImageAndAttributes(Window w, int x, int y, int width, int height, 
+                     hlPtr data)
+{
+    /* get parameters of window being magnified */
+    XGetWindowAttributes(dpy, w, &data->win_info);
+
+    if (data->win_info.depth == DefaultDepth(dpy, scr)) {
+       /* avoid off screen pixels */
+       if (x < 0)
+           x = 0;
+       if (y < 0)
+           y = 0;
+       if (x + width > DisplayWidth(dpy,scr))
+           x = DisplayWidth(dpy,scr) - width;
+       if (y + height > DisplayHeight(dpy,scr))
+           y = DisplayHeight(dpy,scr) - height;
+       data->x = x; data->y = y;
+       /* get image pixels */
+       data->image = XGetImage (dpy,
+                                RootWindow(dpy, scr),
+                                x, y,
+                                width, height,
+                                AllPlanes, ZPixmap);
+    }
+    else {
+       int     t0, t1;
+       int     x0, x1, y0, y1;
+       int     xInWin, yInWin;
+       Window  childWin;
+
+       XTranslateCoordinates(dpy, DefaultRootWindow(dpy), w, x, y,
+                             &xInWin, &yInWin, &childWin);
+
+       /* Avoid off screen pixels. Assume this routine is not
+        * called for totally offscreen windows. */
+       x0 = max(x, 0);
+       y0 = max(y, 0);
+       x1 = min(DisplayWidth(dpy, scr),
+                min(x0 + width, x0 + (data->win_info.width - xInWin)));
+       y1 = min(DisplayHeight(dpy, scr),
+                min(y0 + height, y0 + (data->win_info.height - yInWin)));
+
+       /* Try to use up to width x height pixels */
+       if (x1 - x0 < width) {
+           t0 = x0;
+           t1 = max(0, x - xInWin + data->win_info.width -
+                    DisplayWidth(dpy, scr));
+           x0 = max(0, x1 - min(width, data->win_info.width - t1));
+           xInWin -= t0 - x0;
+       }
+       if (y1 - y0 < height) {
+           t0 = y0;
+           t1 = max(0, y - yInWin + data->win_info.height -
+                    DisplayHeight(dpy, scr));
+           y0 = max(0, y1 - min(height, data->win_info.height - t1));
+           yInWin -= t0 - y0;
+       }
+
+       data->x = x0;
+       data->y = y0;
+       data->width = x1 - x0;
+       data->height = y1 - y0;
+
+       data->image = XGetImage (dpy,
+                                w,
+                                xInWin, yInWin,
+                                data->width, data->height,
+                                AllPlanes, ZPixmap);
+
+    }
+}
+
+\f
+
+/*
+ * Get_XColors() Get the XColors of all pixels in image - returns # of colors
+ *               This function was taken from xwd (thanks Bob...)
+ */
+#define lowbit(x) ((x) & (~(x) + 1))
+static int 
+Get_XColors(XWindowAttributes *win_info, XColor **colors)
+{
+    int i, ncolors;
+    if (!win_info->colormap)
+        return(0);
+    ncolors = win_info->visual->map_entries;
+    if (!(*colors = (XColor *) XtMalloc (sizeof(XColor) * ncolors)))
+      XtError("Out of memory!");
+    if (win_info->visual->class == DirectColor ||
+        win_info->visual->class == TrueColor) {
+        Pixel red, green, blue, red1, green1, blue1;
+        red = green = blue = 0;
+        red1 = lowbit(win_info->visual->red_mask);
+        green1 = lowbit(win_info->visual->green_mask);
+        blue1 = lowbit(win_info->visual->blue_mask);
+        for (i=0; i<ncolors; i++) {
+          (*colors)[i].pixel = red|green|blue;
+          (*colors)[i].pad = 0;
+          red += red1;
+          if (red > win_info->visual->red_mask)
+            red = 0;
+          green += green1;
+          if (green > win_info->visual->green_mask)
+            green = 0;
+          blue += blue1;
+          if (blue > win_info->visual->blue_mask)
+            blue = 0;
+        }
+    } else {
+        for (i=0; i<ncolors; i++) {
+          (*colors)[i].pixel = i;
+          (*colors)[i].pad = 0;
+        }
+    }
+    XQueryColors(dpy, win_info->colormap, *colors, ncolors);
+    return(ncolors);
+}
+
+\f
+
+#define Intensity(cptr) (3.0*cptr->red+0.59*cptr->green+0.11*cptr->blue)
+
+/*
+ * GetMaxIntensity() -- Find the maximum intensity pixel value for a colormap.
+ */
+static Pixel
+GetMaxIntensity(hlPtr data)
+{
+  XColor *colors = NULL, *mptr, *tptr;
+  int i, ncolors;
+
+  if (data->win_info.colormap == DefaultColormap(dpy, scr)) 
+    return WhitePixel(dpy, scr);
+  ncolors = Get_XColors(&data->win_info, &colors); 
+  mptr = tptr = colors; tptr++;
+  for (i=1; i<ncolors; i++) {
+    if ((int)Intensity(mptr) < (int)Intensity(tptr)) 
+      mptr = tptr;
+    tptr++;
+  }
+  /* Null pointer protection */
+  if(mptr)
+    return mptr->pixel;
+  else
+    return WhitePixel(dpy, scr);
+}
+
+/*
+ * GetMinIntensity() -- Find the minimum intensity pixel value for a colormap.
+ */
+static Pixel
+GetMinIntensity(hlPtr data)
+{
+  XColor *colors = NULL, *mptr, *tptr;
+  int i, ncolors;
+
+  if (data->win_info.colormap == DefaultColormap(dpy, scr)) 
+    return BlackPixel(dpy, scr);
+  ncolors = Get_XColors(&data->win_info, &colors); 
+  mptr = tptr = colors; tptr++;
+  for (i=1; i<ncolors; i++)  {
+    if ((int)Intensity(mptr) > (int)Intensity(tptr))
+      mptr = tptr; 
+    tptr++;
+  }
+  /* Null pointer protection */
+  if(mptr)
+    return mptr->pixel;
+  else
+    return BlackPixel(dpy, scr);
+}
+
+\f
+
+
+static Widget pane1, pane2, pane3, cclose, replace, new, select_w, paste;
+
+/*
+ * PopupNewScale() -- Create and popup a new scale composite.
+ */
+static void            
+PopupNewScale(hlPtr data)
+{
+  Arg warg;
+
+  data->scaleShell = 
+    XtVaCreatePopupShell("xmag", topLevelShellWidgetClass, toplevel, 
+                        XtNgeometry, (XtArgVal)options.geometry,
+                        XtNtitle, (XtArgVal)options.title,
+                        NULL);
+  pane1 = XtCreateManagedWidget("pane1", panedWidgetClass, data->scaleShell,
+                               (Arg *) NULL, 0);
+  pane2 = XtCreateManagedWidget("pane2", panedWidgetClass, pane1,
+                               (Arg *) NULL, 0);
+  cclose = XtCreateManagedWidget("close", commandWidgetClass, pane2,
+                                (Arg *) NULL, 0);
+  XtAddCallback(cclose, XtNcallback, CloseCB, (XtPointer)data->scaleShell);
+  replace = XtCreateManagedWidget("replace", commandWidgetClass, pane2,
+                                 (Arg *) NULL, 0);
+  XtAddCallback(replace, XtNcallback, ReplaceCB, (XtPointer)data);
+  new = XtCreateManagedWidget("new", commandWidgetClass, pane2,
+                             (Arg *) NULL, 0);
+  XtAddCallback(new, XtNcallback, NewCB, (XtPointer)NULL);
+  select_w = XtCreateManagedWidget("select", commandWidgetClass, pane2,
+                             (Arg *) NULL, 0);
+  XtAddCallback(select_w, XtNcallback, SelectCB, (XtPointer)data);
+  paste = XtCreateManagedWidget("paste", commandWidgetClass, pane2,
+                             (Arg *) NULL, 0);
+  XtAddCallback(paste, XtNcallback, PasteCB, (XtPointer)data);
+  (void) XtCreateManagedWidget("helpLabel", labelWidgetClass, pane2,
+                              (Arg *) NULL, 0);
+  pane3 = XtCreateManagedWidget("pane2", panedWidgetClass, pane1,
+                               (Arg *) NULL, 0);
+  data->scaleInstance = 
+    XtVaCreateManagedWidget("scale", scaleWidgetClass, 
+                           pane3,
+                           XtNvisual, (XtArgVal)data->win_info.visual,
+                           XtNcolormap, (XtArgVal)data->win_info.colormap,
+                           XtNdepth, (XtArgVal)data->win_info.depth,
+                           XtNscaleX, (XtArgVal)options.mag,
+                           XtNscaleY, (XtArgVal)options.mag,
+                           NULL);
+  SWSetImage(data->scaleInstance, data->image);
+  XtOverrideTranslations
+    (data->scaleShell,
+     XtParseTranslationTable ("<Message>WM_PROTOCOLS: close()"));
+  XtSetArg(warg, XtNuserData, data);
+  XtSetValues(data->scaleInstance, &warg, 1);
+  data->pixShell = 
+    XtVaCreatePopupShell("pixShell", overrideShellWidgetClass, 
+                        toplevel,
+                        XtNvisual, (XtArgVal)data->win_info.visual,
+                        XtNcolormap, (XtArgVal)data->win_info.colormap,
+                        XtNdepth, (XtArgVal)data->win_info.depth,
+                        XtNborderWidth, (XtPointer)0,
+                        NULL);
+  data->pixLabel = 
+    XtVaCreateManagedWidget("pixLabel", labelWidgetClass, 
+                           data->pixShell, 
+                           XtNforeground, (XtPointer)GetMaxIntensity(data),
+                           XtNbackground, (XtPointer)GetMinIntensity(data),
+                           XtNborderWidth, (XtPointer)0,
+                           NULL);
+  XtInstallAllAccelerators(pane1, pane1);      /* install accelerators */
+  if (data->newScale) {
+    XtPopup(data->scaleShell, XtGrabNone);
+    (void) XSetWMProtocols     /* ICCCM delete window */
+      (dpy, XtWindow(data->scaleShell), &wm_delete_window, 1);
+  }
+  if (data->win_info.colormap != DefaultColormap(dpy, scr)) {
+    data->cmapWinList[0] = data->scaleShell; 
+    data->cmapWinList[1] = data->scaleInstance;
+    XtSetWMColormapWindows(data->scaleShell, data->cmapWinList, 2);
+  }
+}
+
+\f
+
+/*
+ * RedoOldScale() -- If the visual, depth, or colormap has changed, unrealize
+ *                   the scale widget and change its colormap/depth/visual.
+ *                   Then re-realize it.  Also do this for the pixel display
+ *                   widget.
+ */
+static void
+RedoOldScale(hlPtr data)
+{
+  Arg wargs[3];
+  int n;
+  Visual *oldVis;
+  int oldDepth;
+  Colormap oldCmap;
+
+  n=0;
+  XtSetArg(wargs[n], XtNvisual, &oldVis); n++;
+  XtSetArg(wargs[n], XtNdepth, &oldDepth); n++;
+  XtSetArg(wargs[n], XtNcolormap, &oldCmap); n++;
+  XtGetValues(data->scaleInstance, wargs, n);  
+  if (oldVis == data->win_info.visual && oldDepth == data->win_info.depth
+      && oldCmap == data->win_info.colormap) {
+    SWSetImage(data->scaleInstance, data->image);    
+    return;
+  }
+  /* get width and height, save and reuse them */
+  XtUnmanageChild(data->scaleInstance);
+  XtUnrealizeWidget(data->scaleInstance);
+  n=0;
+  XtSetArg(wargs[n], XtNcolormap, data->win_info.colormap); n++;
+  XtSetArg(wargs[n], XtNdepth, data->win_info.depth); n++;
+  XtSetArg(wargs[n], XtNvisual, data->win_info.visual); n++;
+  XtSetValues(data->scaleInstance, wargs, n);
+  n=0;
+  XtSetArg(wargs[n], XtNforeground, GetMaxIntensity(data)); n++;
+  XtSetArg(wargs[n], XtNbackground, GetMinIntensity(data)); n++;
+  XtSetValues(data->pixLabel, wargs, n);
+  SWSetImage(data->scaleInstance, data->image); 
+  XtRealizeWidget(data->scaleInstance);
+  XtManageChild(data->scaleInstance);
+}
+
+\f
+
+/*
+ * InitCursors() -- Create our cursors for area selection.
+ */
+static void
+InitCursors(void)
+{
+  ulAngle = XCreateFontCursor(dpy, XC_ul_angle);
+  urAngle = XCreateFontCursor(dpy, XC_ur_angle);
+  lrAngle = XCreateFontCursor(dpy, XC_lr_angle);
+  llAngle = XCreateFontCursor(dpy, XC_ll_angle);
+}
+
+\f
+
+/*
+ * ParseSourceGeom() -- Determin dimensions of area to magnify from resources.
+ */
+static void 
+ParseSourceGeom(void)
+{
+                               /* source */
+  srcStat = 
+    XParseGeometry(options.source, &srcX, &srcY, &srcWidth, &srcHeight);
+  if (!srcWidth) srcWidth = SRCWIDTH;
+  if (!srcHeight) srcHeight = SRCHEIGHT;
+  if (XNegative & srcStat) srcX = DisplayWidth(dpy, scr) + srcX - srcWidth;
+  if (YNegative & srcStat) srcY = DisplayHeight(dpy, scr) + srcY - srcHeight;
+                               /* mag */
+}
+
+\f
+
+/*
+ * Main program.
+ */
+int 
+main(int argc, char *argv[])
+{
+  XSetErrorHandler(Error);
+    
+                               /* SUPPRESS 594 */
+  toplevel = XtAppInitialize(&app, "Xmag", optionDesc, XtNumber(optionDesc),
+                            &argc, argv, NULL,
+                            NULL, 0);
+
+  dpy = XtDisplay(toplevel);
+  scr = DefaultScreen(dpy);
+  XtGetApplicationResources(toplevel, (XtPointer) &options, resources,
+                           XtNumber(resources), NULL, 0);
+  if (argc != 1) {
+    fprintf (stderr,
+           "usage:  xmag [-source geom] [-mag magfactor] [-toolkitoption]\n");
+    exit(1);
+  }
+  
+
+  ParseSourceGeom();
+  XtAppAddActions(app, actions_table, XtNumber(actions_table));
+  InitCursors();
+  SetupGC();
+  CreateRoot();
+  if (!(XValue & srcStat && YValue & srcStat))
+    StartRootPtrGrab(True, (hlPtr)NULL);
+  wm_delete_window = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
+  XtAppMainLoop(app);
+  exit(0);
+}
diff --git a/xmag/xmag.icon b/xmag/xmag.icon
new file mode 100644 (file)
index 0000000..94f9fdf
--- /dev/null
@@ -0,0 +1,14 @@
+#define xmag_width 32
+#define xmag_height 32
+static char xmag_bits[] = {
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xff, 0x7f, 0x00, 0xff, 0xff,
+   0x1f, 0x00, 0xfc, 0xff, 0x0f, 0x00, 0xf8, 0xff, 0x07, 0x00, 0xf0, 0xff,
+   0x07, 0x00, 0xf0, 0xff, 0x03, 0x00, 0xe0, 0xff, 0x03, 0x00, 0xe0, 0xff,
+   0x03, 0x00, 0xe0, 0xff, 0x01, 0x00, 0xc0, 0xff, 0x01, 0x00, 0xc0, 0xff,
+   0x01, 0x00, 0xc0, 0xff, 0x03, 0x00, 0xe0, 0xff, 0x03, 0x00, 0xe0, 0xff,
+   0x03, 0x00, 0xe0, 0xff, 0x07, 0x00, 0xf0, 0xff, 0x07, 0x00, 0xf0, 0xff,
+   0x0f, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0xc7, 0xff,
+   0xff, 0xe3, 0x8f, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0x3f, 0xfe,
+   0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xf1,
+   0xff, 0xff, 0xff, 0xc3, 0xff, 0xff, 0xff, 0xc7, 0xff, 0xff, 0xff, 0xc7,
+   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
diff --git a/xmag/xmag.man b/xmag/xmag.man
new file mode 100644 (file)
index 0000000..0f96f77
--- /dev/null
@@ -0,0 +1,101 @@
+.\" $Xorg: xmag.man,v 1.4 2001/02/09 02:05:55 xorgcvs Exp $
+.\" Copyright 1991, 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.
+.\"
+.\" $XFree86: xc/programs/xmag/xmag.man,v 1.6 2001/01/27 18:21:18 dawes Exp $
+.\"
+.TH XMAG 1 __xorgversion__
+.SH NAME
+xmag \- magnify parts of the screen
+.SH SYNOPSIS
+.B xmag
+[
+.B \-mag
+.I magfactor
+] [
+.B \-source
+.I geom
+] [
+.I \-toolkitoption
+\&.\|.\|. ]
+.SH DESCRIPTION
+The \fIxmag\fP program allows you to magnify portions of an X screen.  If no 
+explicit region is specified, a square with the pointer in the upper left 
+corner is displayed indicating the area to be enlarged.  The area can be 
+dragged out to the desired size by pressing Button 2.  Once a region has 
+been selected, a window is popped up showing a blown up version of the region 
+in which each pixel in the source image is represented by a small square of 
+the same color.  Pressing Button1 in the enlargement window 
+shows the position and RGB value
+of the pixel under the pointer until the button is released.  Typing ``Q'' 
+or ``^C'' in the enlargement window exits the program.  The application has
+5 buttons across its top.
+\fIClose\fP deletes this particular magnification instance.
+\fIReplace\fP brings up the rubber band selector again to select another
+region for this magnification instance.
+\fINew\fP brings up the rubber band
+selector to create a new magnification instance.
+\fISelect\fP puts the magnification image into the primary selection.
+\fIPaste\fP copies the primary selection buffer into \fIxmag\fP.
+Note that you can cut and paste between \fIxmag\fP and the \fIbitmap\fP
+program.  Resizing \fIxmag\fP resizes the magnification area.
+\fIxmag\fP preserves
+the colormap, visual, and window depth of the source.
+.SH WIDGETS
+\fIxmag\fP uses the X Toolkit and the Athena Widget Set.
+The magnified image is displayed in the Scale widget.  
+For more information, see the Athena Widget Set documentation.
+Below is the widget structure of the \fIxmag\fP application.
+Indentation indicates hierarchical  structure.  The widget class
+name is given first, followed by the widget instance name.
+.sp
+.nf
+       Xmag xmag
+               RootWindow root
+               TopLevelShell xmag
+                       Paned pane1
+                               Paned pane2
+                                       Command close
+                                       Command replace
+                                       Command new
+                                       Command select
+                                       Command paste
+                                       Label xmag label
+                               Paned pane2
+                                       Scale scale
+               OverrideShell pixShell 
+                       Label pixLabel
+               
+.fi
+.SH OPTIONS
+.TP 15
+.B \-source\fI geom\fP
+This option specifies the size and/or location of the source region 
+on the screen.  By default, a 64x64 square is provided for the user to select 
+an area of the screen.
+.TP 15
+.B \-mag\fI integer\fP
+This option indicates the magnification to be used.  5 is the default.
+.SH AUTHORS
+Dave Sternlicht and Davor Matic, MIT X Consortium.
diff --git a/xman/AUTHORS b/xman/AUTHORS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xman/COPYING b/xman/COPYING
new file mode 100644 (file)
index 0000000..7f33cbf
--- /dev/null
@@ -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/xman/ChangeLog b/xman/ChangeLog
new file mode 100644 (file)
index 0000000..7d45bc1
--- /dev/null
@@ -0,0 +1,578 @@
+commit b82eb1279acc60f9ebb93730ac002dfde2118a4b
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Oct 16 14:10:04 2009 -0700
+
+    xman 1.1.0
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 2983ab485ff3fd68ff33d81f9fa46977ec724ac6
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Oct 15 18:20:41 2009 -0700
+
+    Migrate to xorg macros 1.3 & XORG_DEFAULT_OPTIONS
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 6c4d017430014699b5e108f10765e89bcc3f41cf
+Author: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+Date:   Thu Oct 15 16:09:44 2009 -0500
+
+    Cygwin uses Linux-style man
+    
+    Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
+
+commit 44334f70b6623395bbef78513f712dbbf5cbfba0
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Oct 1 14:54:27 2009 -0700
+
+    Add README with pointers to mailing lists, bugzilla, & git
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 86e63ab1821387f6fcf3fce506357f76ad8dd194
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Thu Jan 17 17:42:12 2008 -0200
+
+    Add lzma manpage extension support.
+    
+    This should really be handled by the existing code to handle multiple
+    extension formats...
+
+commit e4b0097161ec84b288ca480149ed0185e742d7a3
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Tue Jan 13 18:16:03 2009 -0200
+
+    Ansification and compile warning fixes.
+    
+      This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, and corrects
+    make distcheck.
+
+commit 3afab6ff3cd896514d3bb733244e3bb9640d1e7c
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Sat Nov 8 15:03:18 2008 -0800
+
+    Apple: Added Tiger's man.conf location to the search path
+
+commit 5722ca728763e7ec57088593e76ba84db61a726c
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Thu Aug 21 00:38:27 2008 +0200
+
+    Remove xprint remnants
+
+commit f3579250f8aa332f2015cb1352ed8b7373eb10db
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Wed Aug 20 10:32:52 2008 -0400
+
+    xaw8 is gone, use xaw7
+
+commit 74dbdc66607017cd9ba3c2c3dba4a5536332fabb
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Fri Mar 28 11:53:13 2008 +0100
+
+    Use AM_CFLAGS instead of xman_CFLAGS and remove AM_PROG_CC_C_O
+
+commit 6c9f3307ba95604654d0f0227b7e0457ef4bc47f
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Thu Mar 27 20:15:54 2008 -0700
+
+    Build fix for case insensitive file systems
+    Also added AM_PROG_CC_C_O
+
+commit dbfa16889ae66d5880e23c9a63f8385896512020
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Sat Feb 9 21:53:14 2008 -0500
+
+    Allow xman to use bzip2 to decompress man pages
+    
+    Patch is from Mandriva as posted to bugzilla bug 14400.
+    
+    Use bunzip2(1) to decompress man pages, akin to the current
+    support for gzip(1)ed pages.
+
+commit 2d03acacffae87865201991fc9ef44a7208ccb8f
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Dec 6 16:37:24 2007 -0500
+
+    Replace static ChangeLog with dist-hook to generate from git log
+
+commit 137a0fd2e258d9337049263895b1d6142af3a464
+Author: Jeremy C. Reed <reed@glacier.reedmedia.net>
+Date:   Thu Aug 16 11:45:37 2007 -0500
+
+    Allow xman to be cross build by adding a ./configure
+    --with-manconfig=<filename> option.
+    (Based on discussion on xorg list at end of July.)
+
+commit 8077ab96dbb30ec5b5b4bbc67124fc6f2681cdb5
+Author: Matthieu Herrb <matthieu@localhost.localdomain>
+Date:   Fri Aug 10 16:19:58 2007 +0200
+
+    Bump version for release
+
+commit 112a1b17708c8213cb19f31934458c19dd31f360
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Wed Jan 3 20:26:26 2007 -0800
+
+    renamed: .cvsignore -> .gitignore
+
+commit bede0f3651f51ce5bc99a2d6543664e3817d14f4
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Wed Jan 3 20:25:54 2007 -0800
+
+    Sun Bug 6504978: xman on Solaris x86 does not render correctly, nroff visible
+    
+    <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6504978>
+
+commit 7e0441a748aa62459bc74b08196e48e89860123e
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Sun Apr 2 01:13:58 2006 +0000
+
+    Bump to 1.0.2.
+
+commit d76e42586ff3032b1427b9c130ed65c09078f4e4
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Fri Jan 6 22:39:24 2006 +0000
+
+    <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6240826> Sun
+        bug 6240826: xman typo: 'geometery' in usage message (Sam Lau)
+
+commit d0b90cd56262986a6b8a57d91f1f833d3039bc9e
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 21 02:29:52 2005 +0000
+
+    Update package version for X11R7 release.
+
+commit e8eb7902e02e7ccad9ddd32eb517d989f90b3fa3
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 20 21:54:20 2005 +0000
+
+    Bump hardcoded version number.
+
+commit cf34c7ba82f1aa7d25d1d7e9ad70aea39c05d780
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Dec 19 16:22:46 2005 +0000
+
+    Stub COPYING files
+
+commit 4676f39901599df979f6a5da84234e76a713b583
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:24:09 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+commit 28b5296571c67d70d8808e2f80d2c3f51fba15b6
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 8 17:55:17 2005 +0000
+
+    Add configure options to allow hard-coded paths to be changed.
+
+commit 898dc25befe1d90e36e3735b011039745176e861
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 7 16:18:01 2005 +0000
+
+    Change to use the app-defaults default dir configured in libXt.
+
+commit 60093efc850bea280c2931f81b90ee8d83a21df6
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 6 22:48:24 2005 +0000
+
+    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit 3863a37b310d213e58732d6a5c9c7c878cdf1a8d
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Dec 3 05:49:26 2005 +0000
+
+    Update package version number for X11R7 RC3 release.
+
+commit e0dfbe139da41143cdfc3c222110db790f160f3e
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Nov 28 22:01:44 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 e4156c926662a13bea5c59ecfc128dfd5b5f988c
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Mon Nov 21 10:35:02 2005 +0000
+
+    Another pass at .cvsignores for apps.
+
+commit 1a530f943936c8fe145e00567406a6c321dd9176
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Sun Nov 20 22:08:54 2005 +0000
+
+    Add/improve .cvsignore files for apps.
+
+commit d373967af861fb2c97dde15e56f13f575acc48da
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sun Nov 20 04:13:45 2005 +0000
+
+    Add dependency on xp module when building with Xprint support.
+
+commit 4b7d00e52f22d0c98152bc47f47a317619175ae9
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Nov 9 21:09:22 2005 +0000
+
+    Update package version number for X11R7 RC2 release.
+
+commit aaca206527e4fe4e3a825daae4261554681cec58
+Author: Kean Johnson <kean@armory.com>
+Date:   Tue Nov 8 06:33:33 2005 +0000
+
+    See ChangeLog entry 2005-11-07 for details.
+
+commit 61785b3b0421ab82f88671dd5d515579cd5d8243
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:47:56 2005 +0000
+
+    Update package version number for RC1 release.
+
+commit 4c5fda0874b94edf9189eb84839e9ae46df99df6
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Oct 18 00:32:54 2005 +0000
+
+    Change default install dir for app-default files from
+        $(sysconfdir)/X11/app-defaults to $(libdir)/X11/app-defaults to match
+        the monolith & allow localization
+
+commit 009cf19ab0940f771eb5967a8f6528f20333b597
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Oct 17 23:56:24 2005 +0000
+
+    Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to
+        work better with BSD make
+
+commit 58076d1a51b69c6ef84258b2e3c4361fd6ac30e8
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Fri Oct 14 00:25:47 2005 +0000
+
+    Use sed to fill in variables in man page
+
+commit 41f684bf50fea4b96ebea38e728bb771b83dc736
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Aug 1 20:25:30 2005 +0000
+
+    Install man pages to section 1 instead of section m (Patch from Donnie
+        Berkholz)
+
+commit f1b20d6d1578c6c57eed9fb81fd8d28282fc8bcc
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Jul 29 21:22:36 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 c42be410ac62efc0252fae37b4ed1fb9d30bd457
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Thu Jul 28 23:16:55 2005 +0000
+
+    Set default man path for Solaris.
+
+commit f4f185f8700de48dcb5b888cd113dcb9aff91829
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Thu Jul 28 22:47:57 2005 +0000
+
+    Install xman.help Attempt to determine man page configuration file location
+        and format (based on Imake MANCONFIGSTYLE and MANCONF settings - needs
+        testing on various Linux & BSD flavors to see if I translated
+        correctly)
+
+commit 7a3bd9a41a227ad0590d4104fd8ecc21e2099cd0
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Sat Jul 23 16:48:10 2005 +0000
+
+    fix remainig DEP_{CFLAGS,LIBS} references
+
+commit caa0a44964149cdbe1e3585b7799540e0827b4fc
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed Jul 20 19:32:02 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 0423e9c256b9fd808e09f306e9b7b668c799ed45
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sat Jul 16 22:07:13 2005 +0000
+
+    Add #ifdef HAVE_CONFIG_H/#include "config.h" to files that need it to get
+        HAS_MKSTEMP defined in modular builds.
+
+commit eb70952e2e8c3d103f8fcb3012328e542337c87a
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sat Jul 16 21:59:14 2005 +0000
+
+    Define HAS_MKSTEMP if mkstemp() is present (needed for improved protection
+        against tempfile race conditions in many places)
+
+commit 622dfb510ce2896a79418a6227a8af634827b796
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Thu Jul 14 22:40:16 2005 +0000
+
+    Add _BSD_SOURCE to lots of applications - patch from Stefan Dirsch
+
+commit 6698505ac69196e38e1187c54204fb84ff6effe2
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Wed Jul 6 14:14:10 2005 +0000
+
+    Make Xman build again.
+    - Use $xaw_use_xprint instead of $XAW_USE_XPRINT
+    - Generate Xman by linking from either Xman-xprint.ad or Xman-noxprint.ad
+        Both pointed out by Stefan Dirsch.
+
+commit fb0ffe45044025c82e1597b9cff7f8e1b2f216e6
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Tue Jul 5 22:51:11 2005 +0000
+
+    Add build systems for xlogo, xlsatoms, xlsclients, xmag, xman, xmessage,
+        xmh, xmore. lib/Xaw/xaw.m4: Add an AM_CONDITIONAL and a shell variable
+        xaw_use_xprint symlink.sh: add some extra files for xgc, xinit,
+        xkbcomp, xlogo, xmb, and xmodmap xc/programs/xmore/xmore.c:
+        Conditionalize use of xprint
+
+commit feaa900afe02312131f4f6f503fe6efa85a41eba
+Author: Roland Mainz <roland.mainz@nrubsig.org>
+Date:   Mon Apr 11 01:06:15 2005 +0000
+
+    xc/programs/Xserver/Xprint/attributes.c
+    xc/programs/glxgears/glxgears.c
+    xc/programs/xdbedizzy/xdbedizzy.c
+    xc/programs/xedit/Imakefile
+    xc/programs/xedit/Xedit-xprint.ad
+    xc/programs/xedit/util.c
+    xc/programs/xedit/xedit.h
+    xc/programs/xlogo/print.c
+    xc/programs/xlogo/xlogo.c
+    xc/programs/xlogo/xlogo.h
+    xc/programs/xman/Imakefile
+    xc/programs/xman/print.h
+    xc/programs/xmore/Imakefile
+    xc/programs/xmore/print.c
+    xc/programs/xmore/print.h
+    xc/programs/xmore/printdialog.c
+    xc/programs/xphelloworld/xpawhelloworld/xpawhelloworld.c
+    xc/programs/xphelloworld/xphelloworld/xphelloworld.c
+    xc/programs/xphelloworld/xpsimplehelloworld/xpsimplehelloworld.c
+    xc/programs/xphelloworld/xpxmhelloworld/xpxmhelloworld.c
+    //bugs.freedesktop.org/show_bug.cgi?id=790) attachment #2379
+        (https://bugs.freedesktop.org/attachment.cgi?id=2379) Implement support
+        client+Xserver support for passing output (stdout+stderr) of the
+        spooler command started by the Xprint server back to the application
+        using the "xp-spooler-command-results" XPJobAttr attribute
+        (applications can fetch the attribute value after the XPEndJobNotify
+        event was received; more details can be found in
+        http://xprint.mozdev.org/docs/dtprint_fspec.ps).
+
+commit 821677f646bcaee8b5e4759d97909d05120de4d2
+Author: Roland Mainz <roland.mainz@nrubsig.org>
+Date:   Sat Apr 9 06:42:15 2005 +0000
+
+    //bugs.freedesktop.org/show_bug.cgi?id=2942) attachment #2360
+        (https://bugs.freedesktop.org/attachment.cgi?id=2360) Fix possible
+        crash due uninitalised structure when "xman" opens the print dialog.
+
+commit a42a211aba369513bf31d6d34c966c36c1ccc714
+Author: Roland Mainz <roland.mainz@nrubsig.org>
+Date:   Mon Jan 3 01:06:35 2005 +0000
+
+    xc/lib/XprintAppUtil/xpapputil.c
+    xc/lib/XprintAppUtil/xpapputil.h
+    xc/lib/XprintUtil/xprintutil.c
+    xc/lib/XprintUtil/xprintutil.h
+    xc/programs/glxgears/glxgears.c
+    xc/programs/xdbedizzy/xdbedizzy.c
+    xc/programs/xedit/Xedit-xprint.ad
+    xc/programs/xedit/commands.c
+    xc/programs/xlogo/print.c
+    xc/programs/xlsfonts/xlsfonts.c
+    xc/programs/xlsfonts/xlsfonts.man
+    xc/programs/xlsfonts/xlsfonts.sgml
+    xc/programs/xman/Xman-xprint.ad
+    xc/programs/xman/handler.c
+    xc/programs/xman/print.c
+    xc/programs/xman/print.h
+    xc/programs/xmore/XMore.ad
+    xc/programs/xmore/print.c
+    xc/programs/xmore/print.h
+    xc/programs/xmore/printdialog.c
+    xc/programs/xmore/printdialog.h
+    xc/programs/xmore/printdialogprivates.h
+    xc/programs/xmore/xmore.c
+    xc/programs/xphelloworld/xpawhelloworld/xpawhelloworld.c
+    xc/programs/xphelloworld/xphelloworld/xphelloworld.c
+    xc/programs/xphelloworld/xpsimplehelloworld/xpsimplehelloworld.c
+    xc/programs/xphelloworld/xpxmhelloworld/xpxmhelloworld.c
+    xc/programs/xphelloworld/xpxthelloworld/xpxthelloworld.c
+    xc/programs/xplsprinters/xplsprinters.c
+    //bugs.freedesktop.org/show_bug.cgi?id=1706) attachment #1615
+        (https://bugs.freedesktop.org/attachment.cgi?id=1615): XprintUtils
+        2004/Q3 update. This adds various new features to the XprintUtils
+        library including support for page resolutions where
+        X_resolution!=Y_resolution, listfonts-mode control and initial
+        framework for the COLORSPACE extension. Patch by Roland Mainz
+        <roland.mainz@nrubsig.org> and Julien Lafon <julien.lafon@gmail.com>.
+
+commit 6abedd2bce33d244546a3efed44beb95c6571157
+Author: Egbert Eich <eich@suse.de>
+Date:   Mon Oct 18 14:21:47 2004 +0000
+
+    Made handling of DevelDrivers for x86-64 more conformant to other
+        platforms.
+    Compress all font encodings (Stefan Dirsch).
+    Fixed warnings.
+    Turn on forwarding XNSpotLocation event to XIM server in OffTheSpot and
+        Root mode (bugzilla #1580, James Su).
+    Added another compose key combination for the Euro symbol (Stefan Dirsch).
+    Added support for UTF-8 in ja_JP, ko_KR and zh_TW locales (Mike Fabian).
+    Changed default encoding for ru from KOI8-R to ISO8859-5 (Mike Fabian).
+        This is the encoding that is also used by glibc. We may break other
+        libcs - lets see who complains.
+    Added explanation for DESTDIR to install to a different directory than /.
+    Added some early bailouts to atiprobe if PCI structure pointer is NULL to
+        prevent sig11.
+    XV support doesn't depend on 2D acceleration any more. This patch removes
+        this limitation from the NSC driver. This is a patch that I have
+        committed to XFree86 a while ago but never ported over to X.Org.
+        Matthieu Herrb contributed some build fixes.
+    Fixing SetDPMSTimers() so that DPMS*Time == 0 disables the appropriate
+        timer. This takes advantage of the fact that TimerSet() with a timeout
+        argument 0 behaves like TimerCanel().
+    Use /dev/xconsole (named pipe) or devpts for system logger (Werner Fink).
+    Create missing links for backward compatibility to XFree86 (Stefan Dirsch).
+    Changed comment to mention xorg.
+    Changed cursor for the 'kill' action from XC_draped_box to XC_Pirate. If
+        you don't like it we can change it back (original author unkown).
+    Added 'pic' to the man page rendering command pipeline (Werner Fink).
+    Added missing return value (Stefan Dirsch, Roland Mainz)
+
+commit 4cf1c874d8ea1eb2222e10ca92c2c5afa30e1326
+Author: Roland Mainz <roland.mainz@nrubsig.org>
+Date:   Tue Oct 12 22:46:40 2004 +0000
+
+    Fix for https://freedesktop.org/bugzilla/show_bug.cgi?id=1601 - Fix
+        problems with wrong page counts in xedit&co. when a global "*geometry"
+        resource was overriding the internal geometry management used by
+        XawPrintShell(=usually adjust to current page size, the resource was
+        turning this into a static value). (Original patch by Felix Schulte
+        <felix.schulte@gmail.com>)
+
+commit b9b8f24095964cdfe21b52a5f2667a42fdc6220d
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Wed Sep 29 20:04:57 2004 +0000
+
+    Avoid several buffer overflows if search string is too long. Bugzilla
+        #1481.
+
+commit 545064318591f8c27701da0af0ebc5d9fd1b2ec5
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Sep 2 08:40:33 2004 +0000
+
+    Restore xman and xedit changes that were previously reverted, and make
+        Xprint support optional (Bug #1273, Roland Mainz).
+
+commit 50a3e1e4269fe2ef6c97ff40a6dc02d074e7ba95
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Mon Aug 16 16:36:26 2004 +0000
+
+    As discussed and agreed on on the release-wranglers meeting of August 16,
+        I'm committing the patch from bug #1060 to back out unconditional
+        Xprint functionality.
+    Back out Xprint changes.
+    Revert xman to CVS of June 5, revert xlogo to CVS of May 8, revert xedit to
+        CVS of April 25, to back out unconditional Xprint support.
+    Fix up Xprint config logic to be like the rest of the extensions:
+        BuildXprint is a one-stop option for disabling everything Xprint
+        related. XprtServer controls building Xprt, BuildXprintLib controls
+        building Xprint libs and BuildXprintClients controls building clients
+        related to Xprint. BuiltXprint defaults to YES and the other options
+        respects relevant settings, i.e. BuildServer and BuildServersOnly.
+    Build Xaw regardless of BuildXprintLib setting.
+    Only build xphelloworld, xplsprinters and xprehashprinterlist when
+        BuildXprintClients it YES. Disable building xmore, it has always
+        supported XawPrintShell.
+    Make Xprint support depend on BuildXprintLib.
+
+commit 6b0d9917116797e38b554397b815c555bf55a721
+Author: Roland Mainz <roland.mainz@nrubsig.org>
+Date:   Thu Jul 29 00:40:35 2004 +0000
+
+    Fix for https://freedesktop.org/bugzilla/show_bug.cgi?id=938 - Update
+        XawPrintShell per feedback and review comments.
+
+commit 24ffc96e3347125c213090d9c9550fbf48756459
+Author: Alan Hourihane <alanh@fairlite.demon.co.uk>
+Date:   Thu Jul 1 13:54:46 2004 +0000
+
+    DoSearch is defined in search.c
+
+commit 7cf0973ed5076c513b3a970a8250066a05b0473e
+Author: Roland Mainz <roland.mainz@nrubsig.org>
+Date:   Tue Jun 8 02:44:35 2004 +0000
+
+    Fix for http://freedesktop.org/bugzilla/show_bug.cgi?id=668 - Add print
+        support to xman
+
+commit 113139a1b202d0b94dcd24facc7b2c584faf294e
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Sat May 22 19:20:06 2004 +0000
+
+    Set HasMkstemp to YES on Solaris
+    xc/programs/xman/man.c
+    xc/programs/xman/man.h
+    xc/programs/xman/misc.c
+    xman cannot display SGML man pages on Solaris
+
+commit 313f95249e4621b9002bdd054106b8b743ff64ae
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 19:54:58 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+commit 0b24854cbc017733d4e782db65912a473ec053be
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:35:40 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit 7093a5ad5e15f7c2a7bb8feb6f3255f9a4f8983a
+Author: Egbert Eich <eich@suse.de>
+Date:   Wed Mar 3 12:13:15 2004 +0000
+
+    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit 471b69d7053fb225fee8a2ff987c789d421aedfa
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:36:26 2004 +0000
+
+    readding XFree86's cvs IDs
+
+commit 31f5f6a32ae09278b3bb6f8aecc18793d66b3437
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 09:24:14 2004 +0000
+
+    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit 06d8bbebd1daa587dc5509d9d464646a9ae07c45
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:29:15 2003 +0000
+
+    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit 1504e01d61c573156fe82c2395362f0567102d8a
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:49:23 2003 +0000
+
+    XFree86 4.3.0.1
+
+commit 36fca7804971e1b209138fcf82aee2d74cb2583e
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:49:23 2003 +0000
+
+    Initial revision
diff --git a/xman/INSTALL b/xman/INSTALL
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xman/Makefile.am b/xman/Makefile.am
new file mode 100644 (file)
index 0000000..91ffb81
--- /dev/null
@@ -0,0 +1,104 @@
+# 
+#  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 = xman
+
+helpdir=@HELPDIR@
+dist_help_DATA = xman.help
+
+AM_CFLAGS = $(CWARNFLAGS) $(XMAN_CFLAGS) \
+       -D_BSD_SOURCE -DHELPFILE=\"$(helpdir)/xman.help\"
+xman_LDADD = $(XMAN_LIBS)
+
+xman_SOURCES = \
+        buttons.c \
+        defs.h \
+        globals.c \
+        globals.h \
+        handler.c \
+        help.c \
+        iconclosed.h \
+        icon_help.h \
+        icon_open.h \
+        main.c \
+        man.c \
+        man.h \
+        misc.c \
+        ScrollByL.c \
+        ScrollByL.h \
+        ScrollByLP.h \
+        search.c \
+        tkfuncs.c \
+        vendor.c \
+        vendor.h \
+        version.h
+
+appman_PRE = \
+        xman.man
+
+# App default files
+
+DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
+
+appdefaultdir = @appdefaultdir@
+
+dist_appdefault_DATA = app-defaults/Xman
+
+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):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+EXTRA_DIST += ChangeLog
+MAINTAINERCLEANFILES = ChangeLog
+
+.PHONY: ChangeLog
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog
diff --git a/xman/Makefile.in b/xman/Makefile.in
new file mode 100644 (file)
index 0000000..591ff21
--- /dev/null
@@ -0,0 +1,853 @@
+# Makefile.in generated by automake 1.11 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = xman$(EXEEXT)
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(dist_appdefault_DATA) \
+       $(dist_help_DATA) $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+       $(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \
+       ChangeLog INSTALL NEWS config.guess config.sub depcomp \
+       install-sh missing
+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 config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" \
+       "$(DESTDIR)$(appdefaultdir)" "$(DESTDIR)$(helpdir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_xman_OBJECTS = buttons.$(OBJEXT) globals.$(OBJEXT) \
+       handler.$(OBJEXT) help.$(OBJEXT) main.$(OBJEXT) man.$(OBJEXT) \
+       misc.$(OBJEXT) ScrollByL.$(OBJEXT) search.$(OBJEXT) \
+       tkfuncs.$(OBJEXT) vendor.$(OBJEXT)
+xman_OBJECTS = $(am_xman_OBJECTS)
+am__DEPENDENCIES_1 =
+xman_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(xman_SOURCES)
+DIST_SOURCES = $(xman_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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+DATA = $(appman_DATA) $(dist_appdefault_DATA) $(dist_help_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
+ACLOCAL = @ACLOCAL@
+ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
+ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPDEFS_CFLAGS = @APPDEFS_CFLAGS@
+APPDEFS_LIBS = @APPDEFS_LIBS@
+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@
+CHANGELOG_CMD = @CHANGELOG_CMD@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
+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@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+GREP = @GREP@
+HELPDIR = @HELPDIR@
+INSTALL = @INSTALL@
+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@
+MAKEINFO = @MAKEINFO@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+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@
+XMAN_CFLAGS = @XMAN_CFLAGS@
+XMAN_LIBS = @XMAN_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+appdefaultdir = @appdefaultdir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+distcleancheck_listfiles = @distcleancheck_listfiles@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+helpdir = @HELPDIR@
+dist_help_DATA = xman.help
+AM_CFLAGS = $(CWARNFLAGS) $(XMAN_CFLAGS) \
+       -D_BSD_SOURCE -DHELPFILE=\"$(helpdir)/xman.help\"
+
+xman_LDADD = $(XMAN_LIBS)
+xman_SOURCES = \
+        buttons.c \
+        defs.h \
+        globals.c \
+        globals.h \
+        handler.c \
+        help.c \
+        iconclosed.h \
+        icon_help.h \
+        icon_open.h \
+        main.c \
+        man.c \
+        man.h \
+        misc.c \
+        ScrollByL.c \
+        ScrollByL.h \
+        ScrollByLP.h \
+        search.c \
+        tkfuncs.c \
+        vendor.c \
+        vendor.h \
+        version.h
+
+appman_PRE = \
+        xman.man
+
+
+# App default files
+DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
+dist_appdefault_DATA = app-defaults/Xman
+appmandir = $(APP_MAN_DIR)
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+EXTRA_DIST = $(appman_PRE) ChangeLog
+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
+MAINTAINERCLEANFILES = ChangeLog
+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'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+       $(am__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)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+       @if test ! -f $@; then \
+         rm -f stamp-h1; \
+         $(MAKE) $(AM_MAKEFLAGS) 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) 
+       ($(am__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)'; test -n "$(bindir)" || list=; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p; \
+         then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+xman$(EXEEXT): $(xman_OBJECTS) $(xman_DEPENDENCIES) 
+       @rm -f xman$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(xman_OBJECTS) $(xman_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ScrollByL.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buttons.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globals.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/handler.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/help.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/man.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tkfuncs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vendor.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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) '$<'`
+install-appmanDATA: $(appman_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)"
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \
+       done
+
+uninstall-appmanDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appmandir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appmandir)" && rm -f $$files
+install-dist_appdefaultDATA: $(dist_appdefault_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appdefaultdir)" || $(MKDIR_P) "$(DESTDIR)$(appdefaultdir)"
+       @list='$(dist_appdefault_DATA)'; test -n "$(appdefaultdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appdefaultdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appdefaultdir)" || exit $$?; \
+       done
+
+uninstall-dist_appdefaultDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_appdefault_DATA)'; test -n "$(appdefaultdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appdefaultdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appdefaultdir)" && rm -f $$files
+install-dist_helpDATA: $(dist_help_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(helpdir)" || $(MKDIR_P) "$(DESTDIR)$(helpdir)"
+       @list='$(dist_help_DATA)'; test -n "$(helpdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(helpdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(helpdir)" || exit $$?; \
+       done
+
+uninstall-dist_helpDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_help_DATA)'; test -n "$(helpdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(helpdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(helpdir)" && rm -f $$files
+
+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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       set x; \
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       $(am__remove_distdir)
+       test -d "$(distdir)" || mkdir "$(distdir)"
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$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
+       -test -n "$(am__skip_mode_fix)" \
+       || 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 $(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-lzma: distdir
+       tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+       $(am__remove_distdir)
+
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+       $(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.lzma*) \
+         unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(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)
+       test -d $(distdir)/_build || exit 0; \
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && am__cwd=`pwd` \
+         && $(am__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 \
+         && cd "$$am__cwd" \
+         || exit 1
+       $(am__remove_distdir)
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+       @$(am__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)" "$(DESTDIR)$(appdefaultdir)" "$(DESTDIR)$(helpdir)"; 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)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-appmanDATA install-dist_appdefaultDATA \
+       install-dist_helpDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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_appdefaultDATA uninstall-dist_helpDATA
+
+.MAKE: all install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+       clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
+       dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \
+       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-dist_appdefaultDATA install-dist_helpDATA install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+       tags uninstall uninstall-am uninstall-appmanDATA \
+       uninstall-binPROGRAMS uninstall-dist_appdefaultDATA \
+       uninstall-dist_helpDATA
+
+
+.man.$(APP_MAN_SUFFIX):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+.PHONY: ChangeLog
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+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/xman/NEWS b/xman/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xman/README b/xman/README
new file mode 100644 (file)
index 0000000..3134690
--- /dev/null
@@ -0,0 +1,25 @@
+xman is a graphical manual page browser using the Athena Widgets (Xaw) toolkit.
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+        http://lists.freedesktop.org/mailman/listinfo/xorg
+
+Please submit bug reports to the Xorg bugzilla:
+
+        https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+The master development code repository can be found at:
+
+        git://anongit.freedesktop.org/git/xorg/app/xman
+
+        http://cgit.freedesktop.org/xorg/app/xman
+
+For patch submission instructions, see:
+
+       http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
+For more information on the git code manager, see:
+
+        http://wiki.x.org/wiki/GitPage
+
diff --git a/xman/ScrollByL.c b/xman/ScrollByL.c
new file mode 100644 (file)
index 0000000..911f494
--- /dev/null
@@ -0,0 +1,1211 @@
+/* $XConsortium: ScrollByL.c,v 1.30 94/04/17 20:43:46 rws Exp $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86: xc/programs/xman/ScrollByL.c,v 1.6tsi Exp $ */
+
+#include <stdio.h>
+#include <ctype.h>
+#include <X11/Xos.h>
+#include <stdlib.h>
+
+#include <X11/IntrinsicP.h>
+#include <sys/stat.h>          /* depends on IntrinsicP.h */
+#include <X11/StringDefs.h>
+
+#include <X11/Xaw/Scrollbar.h>
+#include <X11/Xmu/Misc.h>
+
+#include "ScrollByLP.h"
+
+/* Default Translation Table */
+
+static char defaultTranslations[] = 
+  "<Key>f:      Page(Forward) \n\
+   <Key>b:      Page(Back) \n\
+   <Key>1:      Page(Line, 1) \n\
+   <Key>2:      Page(Line, 2) \n\
+   <Key>3:      Page(Line, 3) \n\
+   <Key>4:      Page(Line, 4) \n\
+   <Key>\\ :    Page(Forward)";
+
+      
+/****************************************************************
+ *
+ * ScrollByLine Resources
+ *
+ ****************************************************************/
+
+#define Offset(field) XtOffset(ScrollByLineWidget, scroll.field)
+#define CoreOffset(field) XtOffset(ScrollByLineWidget, core.field)
+
+static XtResource resources[] = {
+    {XtNwidth, XtCWidth, XtRDimension, sizeof(Dimension),
+       CoreOffset(width), XtRImmediate, (caddr_t) 500},
+    {XtNheight, XtCHeight, XtRDimension, sizeof(Dimension),
+       CoreOffset(height), XtRImmediate, (caddr_t) 700},
+
+    {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
+       Offset(foreground), XtRString, "XtDefaultForeground"},
+    {XtNforceVert, XtCBoolean, XtRBoolean, sizeof(Boolean),
+       Offset(force_vert), XtRImmediate, (caddr_t) FALSE},
+    {XtNindent, XtCIndent, XtRDimension, sizeof(Dimension),
+       Offset(indent), XtRImmediate, (caddr_t) 15},
+    {XtNuseRight, XtCBoolean, XtRBoolean, sizeof(Boolean),
+       Offset(use_right), XtRImmediate, (caddr_t) FALSE},
+    {XtNmanualFontNormal, XtCFont, XtRFontStruct, sizeof(XFontStruct *),
+       Offset(normal_font), XtRString, MANPAGE_NORMAL},
+    {XtNmanualFontBold, XtCFont, XtRFontStruct, sizeof(XFontStruct *),
+       Offset(bold_font), XtRString, MANPAGE_BOLD},
+    {XtNmanualFontItalic, XtCFont, XtRFontStruct, sizeof(XFontStruct *),
+       Offset(italic_font), XtRString, MANPAGE_ITALIC},
+    {XtNmanualFontSymbol, XtCFont, XtRFontStruct, sizeof(XFontStruct *),
+       Offset(symbol_font), XtRString, MANPAGE_SYMBOL},
+    {XtNfile, XtCFile, XtRFile, sizeof(FILE *),
+       Offset(file), XtRImmediate, (caddr_t) NULL},
+    {XtNNumTotalLines, XtCNumTotalLines, XtRInt, sizeof(int),
+       Offset(lines), XtRImmediate, (caddr_t) 0},
+    {XtNNumVisibleLines, XtCNumVisibleLines, XtRInt, sizeof(int),
+       Offset(num_visible_lines), XtRImmediate, (caddr_t) 0},
+};
+
+#undef Offset
+#undef CoreOffset
+
+/****************************************************************
+ *
+ * Full class record constant
+ *
+ ****************************************************************/
+
+static void CreateScrollbar(Widget w);
+static Boolean ScrollVerticalText(Widget w, int new_line, Boolean force_redisp);
+static void Layout(Widget w);
+static void LoadFile(Widget w);
+static void MoveAndClearText(Widget w, int old_y, int height, int new_y);
+static void PaintText(Widget w, int y_loc, int height);
+static void PrintText(Widget w, int start_line, int num_lines, int location);
+static void SetThumbHeight(Widget w);
+static void VerticalJump(Widget w, XtPointer junk, XtPointer percent_ptr);
+static void VerticalScroll(Widget w, XtPointer client_data, XtPointer call_data);
+
+/* semi - public functions. */
+
+static void Realize(Widget w, Mask *valueMask, XSetWindowAttributes *attributes);
+static void Initialize(Widget req, Widget new, ArgList args, Cardinal *num_args);
+static void Destroy(Widget w);
+static void Redisplay(Widget w, XEvent *event, Region region);
+static void Page(Widget w, XEvent * event, String * params, Cardinal *num_params);
+static Boolean SetValuesHook(Widget w, ArgList args, Cardinal *num_args);
+
+static XtActionsRec actions[] = {
+  { "Page",   Page},
+};
+
+#define superclass             (&simpleClassRec)
+#define SuperClass             simpleWidgetClass
+
+ScrollByLineClassRec scrollByLineClassRec = {
+  {
+/* core_class fields      */
+    /* superclass         */    (WidgetClass) superclass,
+    /* class_name         */    "ScrollByLine",
+    /* widget_size        */    sizeof(ScrollByLineRec),
+    /* class_initialize   */    NULL,
+    /* class_part_init    */    NULL,
+    /* class_inited       */   FALSE,
+    /* initialize         */    Initialize,
+    /* initialize_hook    */    NULL,
+    /* realize            */    Realize,
+    /* actions            */    actions,
+    /* num_actions       */    XtNumber(actions),
+    /* resources          */    resources,
+    /* num_resources      */    XtNumber(resources),
+    /* xrm_class          */    NULLQUARK,
+    /* compress_motion   */    TRUE,
+    /* compress_exposure  */   FALSE,
+    /* compress_enterleave*/    TRUE,
+    /* visible_interest   */    FALSE,
+    /* destroy            */    Destroy,
+    /* resize             */    Layout,
+    /* expose             */    Redisplay,
+    /* set_values         */    NULL,
+    /* set_values_hook    */    SetValuesHook,
+    /* set_values_almost  */    XtInheritSetValuesAlmost,
+    /* get_values_hook    */    NULL,
+    /* accept_focus       */    NULL,
+    /* version            */    XtVersion,
+    /* callback_private   */    NULL,
+    /* tm_table           */    defaultTranslations,
+    /* query_geometry    */    XtInheritQueryGeometry,
+    /* display_accelerator*/   XtInheritDisplayAccelerator,
+    /* extension         */    NULL,
+  },
+  { /* simple fields */
+    /* change_sensitive                */      XtInheritChangeSensitive
+  }
+};
+
+WidgetClass scrollByLineWidgetClass = 
+            (WidgetClass) &scrollByLineClassRec;
+
+
+/****************************************************************
+ *
+ * Private Routines
+ *
+ ****************************************************************/
+
+/*     Function Name: Layout
+ *     Description: This function lays out the scroll widget.
+ *     Arguments: w - the scroll widget.
+ *                 key - a boolean: if true then resize the widget to the child
+ *                                  if false the resize children to fit widget.
+ *     Returns: TRUE if successful.
+ */
+
+static void
+Layout(Widget w)
+{    
+  ScrollByLineWidget sblw = (ScrollByLineWidget) w;
+  Dimension width, height;
+  Widget bar;
+  Position bar_bw;
+
+  CreateScrollbar(w);
+
+/* 
+ * For now always show the bar.
+ */
+
+  bar = sblw->scroll.bar;
+  height = sblw->core.height;
+  width = sblw->core.width;
+  bar_bw = bar->core.border_width;
+
+  /* Move child and v_bar to correct location. */
+
+  if (sblw->scroll.use_right) {
+    XtMoveWidget(bar, width - (bar->core.width + bar_bw), - bar_bw);
+    sblw->scroll.offset = 0;
+  }
+  else {
+    XtMoveWidget(bar, - bar_bw, - bar_bw);
+    sblw->scroll.offset = bar->core.width + bar_bw;
+  }
+
+  /* resize the scrollbar to be the correct height or width. */
+
+  XtResizeWidget(bar, bar->core.width, height, bar->core.border_width);
+
+  SetThumbHeight(w);
+  
+  sblw->scroll.num_visible_lines = height / sblw->scroll.font_height + 1;
+}
+
+/* ARGSUSED */
+static void 
+GExpose(Widget w, XtPointer junk, XEvent *event, Boolean *cont)
+{
+
+/*
+ * Graphics exposure events are not currently sent to exposure proc.
+ */
+
+  if (event->type == GraphicsExpose)
+    Redisplay(w, event, NULL);
+
+} /* ChildExpose */
+
+/*
+ * Repaint the widget's child Window Widget.
+ */
+
+/* ARGSUSED */
+static void
+Redisplay(Widget w, XEvent *event, Region region)
+{
+  int top, height;             /* the locations of the top and height
+                                  of the region that needs to be repainted. */
+  
+/*
+ * This routine tells the client which sections of the window to 
+ * repaint in his callback function which does the actual repainting.
+ */
+
+  if (event->type == Expose) {
+    top = event->xexpose.y;
+    height = event->xexpose.height;
+  }
+  else {
+    top = event->xgraphicsexpose.y;
+    height  = event->xgraphicsexpose.height;
+  }
+  
+  PaintText(w, top, height);
+} /* redisplay (expose) */
+
+/*     Function Name: PaintText
+ *     Description: paints the text at the give location for a given height.
+ *     Arguments: w - the sbl widget.
+ *                 y_loc, height - location and size of area to paint.
+ *     Returns: none
+ */
+
+static void
+PaintText(Widget w, int y_loc, int height)
+{
+  ScrollByLineWidget sblw = (ScrollByLineWidget) w;
+  int start_line, location;
+
+  start_line = y_loc / sblw->scroll.font_height + sblw->scroll.line_pointer;
+
+  if (start_line >= sblw->scroll.lines)
+    return;
+  
+/*
+ * Only integer arithmetic makes this possible. 
+ */
+
+  location =  y_loc / sblw->scroll.font_height * sblw->scroll.font_height;
+
+  PrintText(w, start_line, sblw->scroll.num_visible_lines, location);
+} 
+
+/*     Function Name: Page
+ *     Description: This function pages the widget, by the amount it recieves
+ *                   from the translation Manager.
+ *     Arguments: w - the ScrollByLineWidget.
+ *                 event - the event that caused this return.
+ *                 params - the parameters passed to it.
+ *                 num_params - the number of parameters.
+ *     Returns: none.
+ */
+
+/* ARGSUSED */
+static void 
+Page(Widget w, XEvent * event, String * params, Cardinal *num_params)
+{
+   ScrollByLineWidget sblw = (ScrollByLineWidget) w;
+   Widget bar = sblw->scroll.bar;
+
+   if (*num_params < 1)
+     return;
+/*
+ * If no scroll bar is visible then do not page, as the entire window is shown,
+ * of scrolling has been turned off. 
+ */
+
+   if (bar == (Widget) NULL)
+     return;
+
+   switch ( params[0][0] ) {
+   case 'f':
+   case 'F':
+     /* move one page forward */
+     VerticalScroll(bar, NULL, (XtPointer)((long) bar->core.height));
+     break;
+   case 'b':
+   case 'B':
+     /* move one page backward */
+     VerticalScroll(bar, NULL,  (XtPointer)(- (long) bar->core.height));
+     break;
+   case 'L':
+   case 'l':
+     /* move one line forward */
+     VerticalScroll(bar, NULL, 
+               (XtPointer)((long) atoi(params[1]) * sblw->scroll.font_height));
+     break;
+   default:
+     return;
+   }
+}
+
+/*     Function Name: CreateScrollbar
+ *     Description: createst the scrollbar for us.
+ *     Arguments: w - sblw widget.
+ *     Returns: none.
+ */
+
+static void
+CreateScrollbar(Widget w)
+{
+  ScrollByLineWidget sblw = (ScrollByLineWidget) w;
+  Arg args[5];
+  Cardinal num_args = 0;
+
+  if (sblw->scroll.bar != NULL) 
+    return;
+
+  XtSetArg(args[num_args], XtNorientation, XtorientVertical); num_args++;
+  
+  sblw->scroll.bar = XtCreateWidget("scrollbar", scrollbarWidgetClass, w, 
+                                   args, num_args);
+  XtAddCallback(sblw->scroll.bar, XtNscrollProc, VerticalScroll, NULL);
+  XtAddCallback(sblw->scroll.bar, XtNjumpProc, VerticalJump, NULL); 
+}
+
+/*     Function Name: ScrollVerticalText
+ *     Description: This accomplished the actual movement of the text.
+ *     Arguments: w - the ScrollByLine Widget.
+ *                 new_line - the new location for the line pointer
+ *                 force_redisplay - should we force this window to get 
+ *                                   redisplayed?
+ *     Returns: True if the thumb needs to be moved.
+ */
+
+static Boolean
+ScrollVerticalText(
+Widget w,
+int new_line,
+Boolean force_redisp)
+{
+  ScrollByLineWidget sblw = (ScrollByLineWidget) w;
+  int num_lines = sblw->scroll.num_visible_lines;
+  int max_lines, old_line;
+  Boolean move_thumb = FALSE;
+
+/*
+ * Do not let the window extend out of bounds.
+ */
+
+  if ( new_line < 0) {
+    new_line = 0;
+    move_thumb = TRUE;
+  }
+  else {
+    max_lines = sblw->scroll.lines - (int)w->core.height / sblw->scroll.font_height;
+    AssignMax(max_lines, 0);
+
+    if ( new_line > max_lines ) {
+      new_line = max_lines;
+      move_thumb = TRUE;
+    }
+  }
+
+/* 
+ * If forced to redisplay then do a full redisplay and return.
+ */
+
+  old_line = sblw->scroll.line_pointer;        
+  sblw->scroll.line_pointer = new_line;        /* Set current top of page. */
+
+  if (force_redisp) 
+    MoveAndClearText(w, 0, /* cause a full redisplay */ 0, 0);
+
+  if (new_line == old_line)
+    return(move_thumb);
+
+/*
+ * Scroll forward.
+ */
+
+  else if (new_line < old_line) {
+    int lines_to_scroll = old_line - new_line;
+    MoveAndClearText(w, 0, num_lines - lines_to_scroll, lines_to_scroll);
+  }
+
+/* 
+ * Scroll back.
+ */
+
+  else {
+    int lines_to_scroll = new_line - old_line;
+    MoveAndClearText(w, lines_to_scroll, num_lines - lines_to_scroll, 0);
+  }
+
+  return(move_thumb);
+}
+
+/*     Function Name: MoveAndClearText
+ *     Description: Blits as much text as it can and clear the
+ *                   remaining area with generate exposures TRUE.
+ *     Arguments: w - the sbl widget.
+ *                 old_y - the old y position.
+ *                 height - height of area to move.
+ *                 new_y - new y position.
+ *     Returns: none
+ */
+          
+static void
+MoveAndClearText(Widget w, int old_y, int height, int new_y)
+{
+  ScrollByLineWidget sblw = (ScrollByLineWidget) w;
+  int from_left = sblw->scroll.indent + sblw->scroll.offset - 1;
+  int y_clear;
+
+  old_y *= sblw->scroll.font_height;
+  new_y *= sblw->scroll.font_height;
+  height *= sblw->scroll.font_height;
+
+/*
+ * If we are already at the right location then do nothing.
+ * (height == 0).
+ *
+ * If we have scrolled more than a screen height then just clear
+ * the window.
+ */
+
+  if (height <= sblw->scroll.font_height) { /* avoid rounding errors. */
+    XClearArea( XtDisplay(w), XtWindow(w), from_left, 0, 
+              (unsigned int) 0, (unsigned int) 0, FALSE);    
+    PaintText(w, 0, (int) sblw->core.height);
+    return;
+  }
+
+  if ((int)height + (int)old_y > (int)w->core.height)
+    height = w->core.height - old_y;
+
+  XCopyArea(XtDisplay(w), XtWindow(w), XtWindow(w), sblw->scroll.move_gc,
+           from_left, old_y, 
+           (unsigned int) w->core.width - from_left, (unsigned int) height,
+           from_left, new_y);
+
+  if (old_y > new_y)
+    height -= sblw->scroll.font_height/2;  /* clear 1/2 font of extra space,
+                                             to make sure we don't lose or
+                                             gain decenders. */
+  else
+    height -= sblw->scroll.font_height;  /* clear 1 font of extra space,
+                                           to make sure we don't overwrite
+                                           with a last line in buffer. */
+
+  if (old_y > new_y)
+    y_clear = height;
+  else
+    y_clear = 0;
+  
+/*
+ * We cannot use generate exposures, since that may allow another move and
+ * clear before the area get repainted, this would be bad.
+ */
+
+  XClearArea( XtDisplay(w), XtWindow(w), from_left, y_clear,
+            (unsigned int) 0, (unsigned int) (w->core.height - height),
+            FALSE);
+  PaintText(w, (int) y_clear, (int) (w->core.height - height));
+}
+
+/*     Function Name: SetThumbHeight
+ *     Description: Set the height of the thumb.
+ *     Arguments: w - the sblw widget.
+ *     Returns: none
+ */
+
+static void
+SetThumbHeight(Widget w)
+{
+  ScrollByLineWidget sblw = (ScrollByLineWidget) w;
+  float shown;
+
+  if (sblw->scroll.bar == NULL)
+    return;
+
+  if (sblw->scroll.lines == 0) 
+    shown = 1.0;
+  else
+    shown = (float) w->core.height / (float) (sblw->scroll.lines *
+                                             sblw->scroll.font_height);
+  if (shown > 1.0)
+    shown = 1.0;
+
+  XawScrollbarSetThumb( sblw->scroll.bar, (float) -1, shown );
+}
+
+/*     Function Name: SetThumb
+ *     Description: Set the thumb location.
+ *     Arguments: w - the sblw.
+ *     Returns: none
+ */
+
+static void
+SetThumb(Widget w)
+{
+  float location;
+  ScrollByLineWidget sblw = (ScrollByLineWidget) w;
+
+  if ( (sblw->scroll.lines == 0) || (sblw->scroll.bar == NULL) )
+    return;
+
+  location = (float) sblw->scroll.line_pointer / (float) sblw->scroll.lines; 
+  XawScrollbarSetThumb( sblw->scroll.bar, location , (float) -1 );
+}
+
+/*     Function Name: VerticalJump.
+ *     Description: This function moves the test
+ *                   as the vertical scroll bar is moved.
+ *     Arguments: w - the scrollbar widget.
+ *                 junk - not used.
+ *                 percent - the position of the scrollbar.
+ *     Returns: none.
+ */
+
+/* ARGSUSED */
+static void
+VerticalJump(Widget w, XtPointer junk, XtPointer percent_ptr)
+{
+  float percent = *((float *) percent_ptr);
+  int new_line;                        /* The new location for the line pointer. */
+  ScrollByLineWidget sblw = (ScrollByLineWidget) XtParent(w);
+
+  new_line = (int) ((float) sblw->scroll.lines * percent);
+  if (ScrollVerticalText( (Widget) sblw, new_line, FALSE))
+    SetThumb((Widget) sblw);
+}
+
+/*     Function Name: VerticalScroll
+ *     Description: This function moves the postition of the interior window
+ *                   as the vertical scroll bar is moved.
+ *     Arguments: w - the scrollbar widget.
+ *                 junk - not used.
+ *                 pos - the position of the cursor.
+ *     Returns: none.
+ */
+
+/* ARGSUSED */
+static void
+VerticalScroll(Widget w, XtPointer client_data, XtPointer call_data)
+{
+  int pos = (int)(long) call_data;
+  int new_line;                        /* The new location for the line pointer. */
+  ScrollByLineWidget sblw = (ScrollByLineWidget) XtParent(w);
+
+  new_line = sblw->scroll.line_pointer + (pos / sblw->scroll.font_height);
+  (void) ScrollVerticalText( (Widget) sblw, new_line, FALSE);
+  SetThumb( (Widget) sblw);
+}
+
+/* ARGSUSED */
+static void 
+Initialize(Widget req, Widget new, ArgList args, Cardinal *num_args)
+{
+  ScrollByLineWidget sblw = (ScrollByLineWidget) new;
+  unsigned long figWidth;
+  Atom atomNum;
+
+  sblw->scroll.top_line = NULL;
+  sblw->scroll.line_pointer = 0;
+  LoadFile(new);
+  sblw->scroll.bar = (Widget) NULL;
+
+  sblw->scroll.font_height = (sblw->scroll.normal_font->max_bounds.ascent + 
+                             sblw->scroll.normal_font->max_bounds.descent); 
+
+  atomNum = XInternAtom(XtDisplay(req), "FIGURE_WIDTH", False);
+
+  if (XGetFontProperty(sblw->scroll.normal_font, atomNum, &figWidth))
+    sblw->scroll.h_width = figWidth;
+  else
+    sblw->scroll.h_width = XTextWidth(sblw->scroll.normal_font, "$", 1);
+} /* Initialize. */
+
+/*     Function Name: CreateGCs
+ *     Description: Creates the graphics contexts that we need. 
+ *     Arguments: w - the sblw.
+ *     Returns: none
+ */
+
+static void
+CreateGCs(Widget w)
+{
+  ScrollByLineWidget sblw = (ScrollByLineWidget) w;
+
+  XtGCMask mask;
+  XGCValues values;
+
+  values.graphics_exposures = TRUE;
+  sblw->scroll.move_gc = XtGetGC(w, GCGraphicsExposures, &values);
+
+  mask = GCForeground | GCFont;
+  values.foreground = sblw->scroll.foreground;
+  
+  values.font = sblw->scroll.normal_font->fid;
+  sblw->scroll.normal_gc = XtGetGC(w, mask, &values);
+
+  values.font = sblw->scroll.italic_font->fid;
+  sblw->scroll.italic_gc = XtGetGC(w, mask, &values);
+
+  values.font = sblw->scroll.bold_font->fid;
+  sblw->scroll.bold_gc = XtGetGC(w, mask, &values);
+
+  values.font = sblw->scroll.symbol_font->fid;
+  sblw->scroll.symbol_gc = XtGetGC(w, mask, &values);
+}
+
+/*     Function Name: DestroyGCs
+ *     Description: removes all gcs for this widget.
+ *     Arguments: w - the widget.
+ *     Returns: none
+ */
+
+static void
+DestroyGCs(Widget w)
+{
+  ScrollByLineWidget sblw = (ScrollByLineWidget) w;
+
+  XtReleaseGC(w, sblw->scroll.normal_gc);
+  XtReleaseGC(w, sblw->scroll.bold_gc);
+  XtReleaseGC(w, sblw->scroll.italic_gc);
+  XtReleaseGC(w, sblw->scroll.move_gc);
+}
+
+static void
+Realize(Widget w, Mask *valueMask, XSetWindowAttributes *attributes)
+{
+  ScrollByLineWidget sblw = (ScrollByLineWidget) w;
+
+  CreateScrollbar(w);
+  CreateGCs(w);
+  Layout(w);
+  (*SuperClass->core_class.realize) (w, valueMask, attributes);
+  XtRealizeWidget(sblw->scroll.bar); /* realize scrollbar. */
+  XtMapWidget(sblw->scroll.bar); /* map scrollbar. */
+
+  XtAddEventHandler(w, 0, TRUE, GExpose, NULL); /* Get Graphics Exposures */
+} /* Realize */
+
+/*     Function Name: Destroy
+ *     Description: Cleans up when we are killed.
+ *     Arguments: w - the widget.
+ *     Returns: none
+ */
+
+static void
+Destroy(Widget w)
+{
+  ScrollByLineWidget sblw = (ScrollByLineWidget) w;
+
+  if (sblw->scroll.bar != NULL)
+    XtDestroyWidget(sblw->scroll.bar); /* Destroy scrollbar. */
+  if (sblw->scroll.file != NULL)
+    fclose(sblw->scroll.file);
+  DestroyGCs(w);
+}
+
+/*
+ *
+ * Set Values
+ *
+ */
+
+/* ARGSUSED */
+static Boolean 
+SetValuesHook(Widget w, ArgList args, Cardinal *num_args)
+{
+  Boolean ret = TRUE;
+  Cardinal i;
+
+  for (i = 0; i < *num_args; i++) {
+    if (strcmp(XtNfile, args[i].name) == 0) {
+      LoadFile(w);
+      ret = TRUE;
+    }
+  }
+
+/*
+ * Changing anthing else will have strange effects, I don't need it so
+ * I didn't code it.
+ */
+
+  return(ret);
+
+} /* Set Values */
+
+/* 
+ * A little design philosophy is probabally wise to include at this point.
+ *
+ * One of the things that I has hoped to achieve with xman is to make the
+ * viewing of manpage not only easy for the nieve user, but also fast for
+ * the experienced user, I wanted to be able to use it too.  To achieve this
+ * I end up sacrificing a bit of start up time for the manual data structure.
+ * As well as, the overhead of reading the entire file before putting it up 
+ * on the display.  This is actually hardly even noticeable since most manual
+ * pages are shots, one to two pages - the notable exception is of course csh,
+ * but then that should be broken up anyway. 
+ *
+ * METHOD:
+ *
+ * I allocate a chunk of space that is the size of the file, plus a null for
+ * debugging.  Then copiesthe file into this chunk of memory.  I then allocate
+ * an array of char*'s that are assigned to the beginning of each line.  Yes,
+ * this means that I have to read the file twice, and could probabally be more
+ * clever about it, but once it is in memory the second read is damn fast.
+ * There are a few obsucrities here about guessing the number of lines and
+ * reallocing if I guess wrong, but other than that it is pretty straight 
+ * forward.
+ *
+ *                                         Chris Peterson
+ *                                         1/27/88
+ */
+
+#define ADD_MORE_MEM 100       /* first guesses for allocations. */
+#define CHAR_PER_LINE 40
+
+/*     Function Name: LoadFile
+ *     Description: Loads the current file into the internal memory.
+ *     Arguments: w - the sblw.
+ *     Returns: none
+ */
+
+static void
+LoadFile(Widget w)
+{
+  ScrollByLineWidget sblw = (ScrollByLineWidget) w;
+  FILE * file = sblw->scroll.file;
+
+  char *page;
+  char **line_pointer,**top_line; /* pointers to beginnings of the 
+                                    lines of the file. */
+  int nlines;                  /* the current number of allocated lines. */
+  struct stat fileinfo;                /* file information from fstat. */
+
+  if ( sblw->scroll.top_line != NULL) {
+    XtFree(*(sblw->scroll.top_line)); /* free characters. */
+    XtFree((char *)(sblw->scroll.top_line)); /* free lines. */
+  }
+  sblw->scroll.top_line = NULL;
+
+  if (file == NULL)
+    return;
+
+/*
+ * Get file size and allocate a chunk of memory for the file to be 
+ * copied into.
+ */
+
+  if (fstat(fileno(file), &fileinfo))
+    XtAppError(XtWidgetToApplicationContext(w), 
+              "SBLW LoadFile: Failure in fstat.");
+
+/* 
+ * Allocate a space for a list of pointer to the beginning of each line.
+ */
+
+  if ( (nlines = fileinfo.st_size/CHAR_PER_LINE) == 0)
+    return;
+
+  page = XtMalloc(fileinfo.st_size + 1); /* leave space for the NULL */
+  top_line = line_pointer = (char**) XtMalloc( nlines * sizeof(char *) );
+
+/*
+ * Copy the file into memory. 
+ */
+
+  fseek(file, 0L, SEEK_SET);
+  if (fread(page, sizeof(char), fileinfo.st_size, file) == 0)
+    XtAppError(XtWidgetToApplicationContext(w), 
+              "SBLW LoadFile: Failure in fread.");
+
+
+/* put NULL at end of buffer. */
+
+  *(page + fileinfo.st_size) = '\0';
+
+/*
+ * Go through the file setting a line pointer to the character after each 
+ * new line.  If we run out of line pointer space then realloc that space
+ * with space for more lines.
+ */
+
+  *line_pointer++ = page;      /* first line points to first char in buffer.*/
+  while (*page != '\0') {
+
+    if ( *page == '\n' ) {
+      *line_pointer++ = page + 1;
+
+      if (line_pointer >= top_line + nlines) {
+       top_line = (char **) XtRealloc( (char *)top_line, (nlines +
+                                         ADD_MORE_MEM) * sizeof(char *) );
+       line_pointer = top_line + nlines;
+       nlines += ADD_MORE_MEM;
+      }
+    }
+    page++;
+  }
+   
+/*
+ *  Realloc the line pointer space to take only the minimum amount of memory
+ */
+
+  sblw->scroll.lines = nlines = line_pointer - top_line - 1;
+  top_line = (char **) XtRealloc((char *)top_line, nlines * sizeof(char *));
+
+/*
+ * Store the memory pointers
+ */
+
+  sblw->scroll.top_line = top_line;
+  sblw->scroll.line_pointer = 0;
+  SetThumbHeight(w);
+  SetThumb(w);
+}
+
+#define NLINES  66             /* This is the number of lines to wait until
+                                  we boldify the line again, this allows 
+                                  me to bold the first line of each page.*/
+#define BACKSPACE 010          /* I doubt you would want to change this. */
+
+#define NORMAL 0
+#define BOLD   1
+#define ITALIC 2
+#define SYMBOL 3
+#define WHICH(italic, bold)    ((bold) ? BOLD : ((italic) ? ITALIC : NORMAL))
+                               /* Choose BOLD over ITALICS.  If neither */
+                               /* is chosen, use NORMAL. */
+
+static int DumpText(Widget w, int x_loc, int y_loc, char * buf, int len, int format);
+static Boolean Boldify(char *);
+
+/*     Function Name: PrintText
+ *     Description: This function actually prints the text.
+ *     Arguments: w - the ScrollByLine widget.
+ *                 start_line - line to start printing,
+ *                 num_lines - the number of lines to print.
+ *                 location - the location to print the text.
+ *     Returns: none.
+ */
+
+/* ARGSUSED */
+
+static void
+PrintText(Widget w, int start_line, int num_lines, int location)
+{
+  ScrollByLineWidget sblw = (ScrollByLineWidget) w;
+
+  register char *bufp, *c;     /* Generic char pointers */
+  int current_line;            /* the number of the currrent line */
+  char buf[BUFSIZ];            /* Misc. characters */
+  Boolean italicflag = FALSE;  /* Print text in italics?? */
+  Boolean first = TRUE;                /* First line of a manual page??? */
+  int x_loc, y_loc;            /* x and y location of text. */
+
+/*
+ * For table hack
+ * To get columns to line up reasonably in most cases, make the
+ * assumption that they were lined up using lots of spaces, where
+ * lots is greater than two. Use a space width of 70% of the
+ * widest character in the font.
+ */
+  int h_col, h_fix;
+  char * h_c;
+
+/*
+ * Nothing loaded, take no action.
+ */
+
+  if (sblw->scroll.top_line == NULL || num_lines == 0)
+    return;
+
+  current_line = start_line;
+
+/* Set the first character to print at the first line. */
+
+  c = *(sblw->scroll.top_line + start_line);
+
+/*
+ * Because XDrawString uses the bottom of the text as a position
+ * reference, add the height from the top of the font to the baseline
+ * to the ScollByLine position reference.
+ */
+
+  y_loc = location + sblw->scroll.normal_font->max_bounds.ascent;
+
+/*
+ * Ok, here's the more than mildly heuristic man page formatter.
+ * We put chars into buf until either a font change or newline
+ * occurs (at which time we flush it to the screen.)
+ */
+
+
+  bufp = buf;
+  x_loc = sblw->scroll.offset + sblw->scroll.indent;
+  h_col = 0;
+  
+/*
+ * A fix:
+ * Assume that we are always starting to print on or before the
+ * first line of a page, and then prove it if we aren't.
+ */
+  for (h_fix = 1; h_fix <= (start_line % NLINES); h_fix++)
+    if (**(sblw->scroll.top_line + start_line - h_fix) != '\n')
+      {
+       first = FALSE;
+       break;
+      }
+
+  while(TRUE) {
+    if (current_line % NLINES == 0)
+      first = TRUE;
+
+/* 
+ * Lets make sure that we do not run out of space in our buffer, making full
+ * use of it is not critical since no window will be wide enough to display
+ * nearly BUFSIZ characters.
+ */
+
+    if ( (bufp - buf) > (BUFSIZ - 10) )
+      /* Toss everything until we find a <CR> or the end of the buffer. */
+      while ( (*c != '\n') && (*c != '\0') ) c++;
+
+    switch(*c) {
+
+    case '\0':               /* If we reach the end of the file then return */
+      DumpText(w, x_loc, y_loc, buf, bufp - buf, WHICH(italicflag, first));
+      return;
+
+    case '\n':
+      if (bufp != buf) {
+       Boolean bold;
+       *bufp = '\0';           /* for Boldify. */
+       bold = ( (first) || ((x_loc == (sblw->scroll.offset +
+                             sblw->scroll.indent)) && Boldify(buf)) );
+
+       (void) DumpText(w, x_loc, y_loc, buf, bufp - buf,
+                       WHICH(italicflag, bold));
+
+       if (bold)
+         first = FALSE;
+      }
+
+/* 
+ * If we have painted the required number of lines then we should now return.
+ */
+      if (++current_line == start_line + num_lines ) 
+       return;
+
+      bufp = buf;
+      italicflag = FALSE;
+      x_loc = sblw->scroll.offset + sblw->scroll.indent;
+      h_col = 0;
+      y_loc += sblw->scroll.font_height;
+      break;
+
+/*
+ * This tab handling code is not very clever it moves the cursor over
+ * to the next boundry of eight (8) spaces, as calculated in width just
+ * before the printing loop started.
+ */
+
+    case '\t':                 /* TAB */
+      x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf,
+                      WHICH(italicflag, first));
+      h_col += bufp - buf;
+      bufp = buf; 
+      italicflag = FALSE;
+      x_loc = sblw->scroll.offset + sblw->scroll.indent;
+      h_col = h_col + 8 - (h_col%8);
+      x_loc += sblw->scroll.h_width * h_col;
+      break;
+
+    case ' ':
+      h_c = c + 1;
+      while (*h_c == ' ') h_c++;
+
+      if (h_c - c < 4)
+       {
+         *bufp++ = *c;
+         break;
+       }
+
+      x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf,
+                      WHICH(italicflag, first));
+      h_col += bufp - buf;
+      bufp = buf; 
+      italicflag = FALSE;
+
+      x_loc = sblw->scroll.offset + sblw->scroll.indent; 
+      h_col += (h_c - c);
+      x_loc += sblw->scroll.h_width * h_col; 
+      c = h_c - 1;
+      break;
+
+    case '\033':               /* ignore esc sequences for now */
+      c++;                     /* should always be esc-x */
+      break;
+
+/* 
+ * Overstrike code supplied by: cs.utexas.edu!ut-emx!clyde@rutgers.edu 
+ * Since my manual pages do not have overstrike I couldn't test this.
+ */
+
+    case BACKSPACE:            /* Backspacing for nroff bolding */
+      if (c[-1] == c[1] && c[1] != BACKSPACE) {        /* overstriking one char */
+        if (bufp > buf) {
+         bufp--;               /* Zap 1st instance of char to bolden */
+         x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf,
+                          WHICH(italicflag, FALSE));
+         h_col += bufp - buf;
+       }
+       bufp = buf;
+       *bufp++ = c[1];
+       x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf, BOLD);
+       h_col += bufp - buf;
+       bufp = buf;
+       first = FALSE;
+
+       /*
+        *     Nroff bolding looks like:
+        *               C\bC\bC\bCN...
+        * c points to ----^      ^
+        * it needs to point to --^
+        */
+       while (*c == BACKSPACE && c[-1] == c[1])
+         c += 2;
+       c--;            /* Back up to previous char */
+      }
+      else {
+       if ((c[-1] == 'o' && c[1] == '+')          /* Nroff bullet */
+           || (c[-1] == '+' && c[1] == 'o')) {    /* Nroff bullet */
+                               /* If we run into a bullet, print out */
+                               /* everything that's accumulated to this */
+                               /* point, then the bullet, then resume. */
+         if (bufp>buf) {
+           bufp--;
+           x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf,
+                            WHICH(italicflag, FALSE));
+           h_col += bufp - buf;
+         }
+         bufp = buf;
+         *bufp = (char)183;
+         x_loc = DumpText(w, x_loc, y_loc, buf, 1, SYMBOL);
+         h_col++;
+         c++;
+       }
+       else {          /* 'real' backspace - back up output ptr */
+         if (bufp>buf)
+           bufp--;
+       }
+      }
+      break;
+
+/* End of contributed overstrike code. */
+  
+   case '_':                   /* look for underlining [italicize] */
+      if(*(c + 1) == BACKSPACE) {
+       if(!italicflag) {       /* font change? */
+         if (bufp != buf) {
+           x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf, NORMAL);
+           h_col += bufp - buf;
+           bufp = buf;
+         }
+         italicflag = TRUE;
+       }
+       c += 2;
+       *bufp++ = *c;
+       break;
+      }
+      /* else fall through to default, because this was a real underscore. */
+
+    default:
+      if(italicflag) {                         /* font change? */
+       if (bufp != buf) {
+         x_loc = DumpText(w, x_loc, y_loc, buf, bufp - buf,
+                          WHICH(italicflag, FALSE));
+         h_col += bufp - buf;
+         bufp = buf;
+       }
+       italicflag = FALSE;
+      }
+      *bufp++ = *c;
+      break;
+    }
+    c++;
+  }
+}
+
+/*     Function Name: DumpText
+ *     Description: Dumps text to the screen.
+ *     Arguments: w - the widget.
+ *                 x_loc - to dump text at.
+ *                 y_loc - the y_location to draw_text.
+ *                 buf - buffer to dump.
+ *                 italic, bold, boolean that tells us which gc to use.
+ *     Returns: x_location of the end of the text.
+ */
+
+static int
+DumpText(Widget w, int x_loc, int y_loc, char * buf, int len, int format)
+{
+  ScrollByLineWidget sblw = (ScrollByLineWidget) w;
+  GC gc;
+  XFontStruct * font;
+
+  switch(format) {
+
+  case ITALIC:
+    gc = sblw->scroll.italic_gc;
+    font = sblw->scroll.italic_font;
+    break;
+
+  case BOLD:
+      gc = sblw->scroll.bold_gc;
+      font = sblw->scroll.bold_font;
+    break;
+
+  case SYMBOL:
+    gc = sblw->scroll.symbol_gc;
+    font = sblw->scroll.symbol_font;
+    break;
+
+  default:
+      gc = sblw->scroll.normal_gc;
+      font = sblw->scroll.normal_font;
+    break;
+    }
+
+  XDrawString(XtDisplay(w), XtWindow(w), gc, x_loc, y_loc, buf, len);
+  return(x_loc + XTextWidth(font, buf, len));
+}
+
+/*     Function Name: Boldify
+ *     Description: look for keyword.
+ *     Arguments: sp - string pointer.
+ *     Returns: 1 if keyword else 0.
+ */
+
+static Boolean
+Boldify(register char *sp)
+{
+  register char *sp_pointer;
+  int length,count;
+
+/* 
+ * If there are not lower case letters in the line the assume it is a
+ * keyword and boldify it in PrintManpage.
+ */
+
+  length = strlen(sp);
+  for (sp_pointer = sp, count = 0; count < length; sp_pointer++,count++) 
+    if ( !isupper(*sp_pointer) && !isspace(*sp_pointer) )
+      return(0);
+  return(1);
+}
+
+#undef superclass
+#undef SuperClass
diff --git a/xman/ScrollByL.h b/xman/ScrollByL.h
new file mode 100644 (file)
index 0000000..0283893
--- /dev/null
@@ -0,0 +1,77 @@
+/* $XConsortium: ScrollByL.h,v 1.7 94/04/17 20:43:48 dave Exp $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+
+#ifndef _XtScrollByLine_h
+#define _XtScrollByLine_h
+
+/***********************************************************************
+ *
+ * ScrollByLine Widget (subclass of Simple)
+ *
+ ***********************************************************************/
+
+/*
+ * The default fonts.
+ */
+
+#ifdef ATHENA
+#define MANPAGE_NORMAL   "fixed"
+#define MANPAGE_BOLD     "helvetica-bold12"
+#define MANPAGE_ITALIC   "helvetica-boldoblique12"
+#define MANPAGE_SYMBOL   "symbol-medium12"
+#else
+#define MANPAGE_NORMAL   "*-new century schoolbook-medium-r-normal--*-120-*"
+#define MANPAGE_BOLD     "*-new century schoolbook-bold-r-normal--*-120-*"
+#define MANPAGE_ITALIC   "*-new century schoolbook-bold-i-normal--*-120-*"
+#define MANPAGE_SYMBOL   "*-symbol-medium-r-normal--*-120-*"
+#endif /* ATHENA */
+
+#define XtNindent           "indent"
+#define XtNforceVert        "forceVert"
+#define XtNmanualFontNormal "manualFontNormal"
+#define XtNmanualFontBold   "manualFontBold"
+#define XtNmanualFontItalic "manualFontItalic"
+#define XtNmanualFontSymbol "manualFontSymbol"
+#define XtNNumTotalLines    "numTotalLines"
+#define XtNNumVisibleLines  "numVisibleLines"
+
+#define XtCIndent           "Indent"
+#define XtCNumTotalLines    "NumTotalLines"
+#define XtCNumVisibleLines  "NumVisibleLines"
+
+/* Class record constants */
+
+extern WidgetClass scrollByLineWidgetClass;
+
+typedef struct _ScrollByLineClassRec *ScrollByLineWidgetClass;
+typedef struct _ScrollByLineRec      *ScrollByLineWidget;
+
+#endif /* _XtScrollByLine_h --- DON'T ADD STUFF AFTER THIS LINE */
diff --git a/xman/ScrollByLP.h b/xman/ScrollByLP.h
new file mode 100644 (file)
index 0000000..25402d7
--- /dev/null
@@ -0,0 +1,100 @@
+/* $XConsortium: ScrollByLP.h,v 1.9 94/04/17 20:43:49 keith Exp $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+
+
+#ifndef _XtScrollByLinePrivate_h
+#define _XtScrollByLinePrivate_h
+
+#include <X11/Xaw/SimpleP.h>
+
+#include "ScrollByL.h"
+
+/***********************************************************************
+ *
+ * ScrollByLine Widget Private Data
+ *
+ ***********************************************************************/
+
+/* New fields for the ScrollByLine widget class record */
+typedef struct {
+     int mumble;   /* No new procedures */
+} ScrollByLineClassPart;
+
+/* Full class record declaration */
+typedef struct _ScrollByLineClassRec {
+    CoreClassPart        core_class;
+    SimpleClassPart       simple_class;
+    ScrollByLineClassPart scrolled_widget_class;
+} ScrollByLineClassRec;
+
+extern ScrollByLineClassRec scrollByLineClassRec;
+
+/* New fields for the ScrollByLine widget record */
+typedef struct _ScrollByLinePart {
+  Pixel foreground;            /* The color for the forground of the text. */
+  Boolean force_vert,          /* Must have scrollbar visable */
+    use_right;                 /* put scroll bar on right side of window. */
+  FILE * file;                 /* The file to display. */
+  Dimension indent;            /* amount to indent the file. */
+  XFontStruct * bold_font,     /* The four fonts. */
+    * normal_font,
+    * italic_font,
+    * symbol_font;
+  int h_width;                 /* Main font width */
+  
+/* variables not in resource list. */
+
+  Widget bar;                  /* The scrollbar. */
+  int font_height;             /* the height of the font. */
+  int line_pointer;            /* The line that currently is at the top 
+                                  of the window being displayed. */
+  Dimension offset;            /* Drawing offset because of scrollbar. */
+  GC move_gc;                  /* GC to use when moving the text. */
+  GC bold_gc, normal_gc, italic_gc, symbol_gc; /* gc for drawing. */
+
+  char ** top_line;            /* The top line of the file. */
+  int lines;           /* Total number of line in the file. */
+  int num_visible_lines;  /* Number of lines visible */
+} ScrollByLinePart;
+
+/****************************************************************
+ *
+ * Full instance record declaration
+ *
+ ****************************************************************/
+
+typedef struct _ScrollByLineRec {
+    CorePart         core;
+    SimplePart        simple;
+    ScrollByLinePart  scroll;
+} ScrollByLineRec;
+
+#endif /* _XtScrollByLinePrivate_h --- DON'T ADD STUFF AFTER THIS LINE */
diff --git a/xman/aclocal.m4 b/xman/aclocal.m4
new file mode 100644 (file)
index 0000000..684599f
--- /dev/null
@@ -0,0 +1,1766 @@
+# generated automatically by aclocal 1.11 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009  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.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
+[m4_warning([this file was generated for autoconf 2.63.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# 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, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# 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])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+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, 2006, 2009
+# 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 10
+
+# 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], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$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
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    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, 2006, 2008, 2009 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 16
+
+# 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.62])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
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+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
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_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)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+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
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_AM_DEPENDENCIES(OBJC)],
+                 [define([AC_PROG_OBJC],
+                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# 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_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
+                         (and sometimes confusing) to the casual installer],
+      [USE_MAINTAINER_MODE=$enableval],
+      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  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, 2009  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_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.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
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+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, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# 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
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# 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, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _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],
+[m4_foreach_w([_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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# 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
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# 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) 2009  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 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# 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="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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
+
+dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
+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 ensure that this macro is defined, also add:
+# m4_ifndef([XORG_MACROS_VERSION],
+#     [m4_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.
+m4_defun([XORG_MACROS_VERSION],[
+m4_define([vers_have], [1.3.0])
+m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
+m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
+m4_if(m4_cmp(maj_have, maj_needed), 0,,
+    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
+m4_if(m4_version_compare(vers_have, [$1]), -1,
+    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
+m4_undefine([vers_have])
+m4_undefine([maj_have])
+m4_undefine([maj_needed])
+]) # 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])
+       # under Cygwin unix is still defined even with -undef
+       elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+               RAWCPPFLAGS="-undef -ansi"
+               AC_MSG_RESULT([yes, with -ansi])
+       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],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+
+if test x"$cross_compiling" = x"yes" ; then
+  HAVE_DEFS_ENT=no
+else
+  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+fi
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+AC_PATH_PROG(PS2PDF, ps2pdf)
+
+AC_MSG_CHECKING([Whether to build documentation])
+
+if test x$HAVE_DEFS_ENT != 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 && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+if test x$XORG_SGML_PATH = x ; then
+    XORG_SGML_PATH=$prefix/share/sgml
+fi
+HAVE_DEFS_ENT=
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([Whether to build text documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([Whether to build PDF documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([Whether to build PostScript documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([Whether to build HTML documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# 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,
+       AS_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, [AS_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, [AS_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
+
+# XORG_CWARNFLAGS
+# ---------------
+# Minimum version: 1.2.0
+#
+# Defines CWARNFLAGS to enable C compiler warnings.
+#
+AC_DEFUN([XORG_CWARNFLAGS], [
+AC_REQUIRE([AC_PROG_CC])
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+AC_SUBST(CWARNFLAGS)
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+]) # XORG_CWARNFLAGS
+
+# XORG_STRICT_OPTION
+# -----------------------
+# Minimum version: 1.3.0
+#
+# Add configure option to enable strict compilation
+AC_DEFUN([XORG_STRICT_OPTION], [
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CC_C99])
+AC_REQUIRE([XORG_CWARNFLAGS])
+
+AC_ARG_ENABLE(strict-compilation,
+                         AS_HELP_STRING([--enable-strict-compilation],
+                         [Enable all warnings from compiler and make them errors (default: disabled)]),
+                         [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
+if test "x$STRICT_COMPILE" = "xyes"; then
+       AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+       AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+AC_SUBST([CWARNFLAGS])
+]) # XORG_STRICT_OPTION
+
+# XORG_DEFAULT_OPTIONS
+# --------------------
+# Minimum version: 1.3.0
+#
+# Defines default options for X.Org modules.
+#
+AC_DEFUN([XORG_DEFAULT_OPTIONS], [
+XORG_CWARNFLAGS
+XORG_STRICT_OPTION
+XORG_RELEASE_VERSION
+XORG_CHANGELOG
+XORG_MANPAGE_SECTIONS
+]) # XORG_DEFAULT_OPTIONS
+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.  Also
+# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+AC_DEFUN([XORG_RELEASE_VERSION],[
+       AC_ARG_WITH(release-version,
+                       AS_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
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+               [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+               [Major version of this package])
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+               [$PVM],
+               [Minor version of this package])
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+               [$PVP],
+               [Patch version of this package])
+])
+
+# XORG_CHANGELOG()
+# ----------------
+# Minimum version: 1.2.0
+#
+# Defines the variable CHANGELOG_CMD as the command to generate
+# ChangeLog from git.
+#
+# Arrange that distcleancheck ignores ChangeLog left over by distclean.
+#
+AC_DEFUN([XORG_CHANGELOG], [
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
+mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+AC_SUBST([CHANGELOG_CMD])
+AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
+]) # XORG_CHANGELOG
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# 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 "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _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 --print-errors "$2" 2>&1`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       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 <http://pkg-config.freedesktop.org/>.])],
+               [$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
+
diff --git a/xman/app-defaults/Xman b/xman/app-defaults/Xman
new file mode 100644 (file)
index 0000000..3f08b02
--- /dev/null
@@ -0,0 +1,195 @@
+*input:                                True
+
+*topBox:                       True
+*topBox.Title:                 Xman
+*topBox.IconName:              Xman
+
+*manualBrowser.Title:          Manual Page
+*manualBrowser.IconName:       Manual Page
+*manualBrowser.geometry:       600x600
+
+*manualFontBold:               -*-courier-bold-r-*-*-*-120-*-*-*-*-*-*
+*manualFontItalic:             -*-courier-medium-o-*-*-*-120-*-*-*-*-*-*
+*manualFontNormal:             -*-courier-medium-r-*-*-*-120-*-*-*-*-*-*
+*manualFontSymbol:             -*-symbol-*-*-*-*-*-120-*-*-*-*-*-*
+!*directoryFontNormal:         -*-courier-medium-r-*-*-*-120-*-*-*-*-*-*
+*directoryFontNormal:          -*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-*
+!*directoryFontNormal:         -*-lucida-bold-r-*-*-*-120-*-*-*-*-*-*
+
+!*SimpleMenu.BackingStore:     Always
+!*SimpleMenu.SaveUnder:                Off
+
+*horizPane.orientation:        horizontal
+*horizPane*showGrip:           False
+*horizPane.min:                        22
+*horizPane.max:                        22
+*topLabel.BorderWidth:         0
+*search*label.BorderWidth:     0
+
+*search*dialog*value:          Xman
+
+!*optionMenu.Label:            Options
+!*sectionMenu.Label:           Sections
+
+*horizPane*options.Label:      Options
+*horizPane*sections.Label:     Sections
+
+*helpButton.Label:             Help
+*helpButton.Tip:               Open help browser
+
+*quitButton.Label:             Quit
+*quitButton.Tip:               Quit Xman
+
+*manpageButton.Label:          Manual Page
+*manpageButton.Tip:            Open new manpage browser
+
+*topLabel.Label:               Manual Browser
+
+!*SimpleMenu*menuLabel*vertSpace: 100
+!*SimpleMenu*menuLabel*leftMargin: 20
+
+*displayDirectory.Label:       Display Directory 
+*displayManualPage.Label:      Display Manual Page
+*help.Label:                   Help
+*help.geometry:                        600x600
+*search.Label:                 Search
+*removeThisManpage.Label:      Remove This Manpage
+*help*removeThisManpage.Label: Remove Help
+*openNewManpage.Label:         Open New Manpage
+*showVersion.Label:            Show Version
+*quit.Label:                   Quit
+
+*pleaseStandBy*Label:          Formatting Manual Page, Please Stand By...
+
+*search*dialog.Label:          Type string to search for:
+*search*apropos.Label:         Apropos
+*search*manualPage.Label:      Manual Page
+*search*cancel.Label:          Cancel
+
+*likeToSave*dialog.Label:      Would you like to save this formatted Manual Page?
+*likeToSave*yes.Label:         Yes
+*likeToSave*no.Label:          No
+
+*translations:                 #override \
+               Ctrl<Key>q: Quit() \n\
+               Ctrl<Key>c: Quit() \n\
+               Ctrl<Key>n: CreateNewManpage() \n\
+               Ctrl<Key>h: PopupHelp() \n\
+               Ctrl<Key>s: PopupSearch()
+
+*help*Paned.manualPage.translations:#override \
+               Ctrl<Btn1Down>: \
+                       XawPositionSimpleMenu(optionMenu) \
+                       MenuPopup(optionMenu) \n\
+               Ctrl<Key>q: Quit() \n\
+               Ctrl<Key>c: Quit() \n\
+               Ctrl<Key>r: RemoveThisManpage() \n\
+               Ctrl<Key>n: CreateNewManpage() \n\
+               Ctrl<Key>h: PopupHelp() \n\
+               Ctrl<Key>d: GotoPage(Directory) \n\
+               Ctrl<Key>m: GotoPage(ManualPage) \n\
+               Ctrl<Key>v: ShowVersion() \n\
+               <Key>Prior: Page(Back) \n\
+               <Key>Next : Page(Forward) \n\
+               Shift<Btn4Down>,<Btn4Up>: Page(Line,-1) \n\
+               Shift<Btn5Down>,<Btn5Up>: Page(Line,1) \n\
+               Ctrl<Btn4Down>,<Btn4Up>: Page(Back) \n\
+               Ctrl<Btn5Down>,<Btn5Up>: Page(Forward) \n\
+               None<Btn4Down>,<Btn4Up>: Page(Line,-5) \n\
+               None<Btn5Down>,<Btn5Up>: Page(Line,5)
+
+*manualBrowser*manualPage.translations:  #override \
+               Ctrl<Btn1Down>: \
+                       XawPositionSimpleMenu(optionMenu) \
+                       MenuPopup(optionMenu) \n\
+               Ctrl<Btn2Down>: \
+                       XawPositionSimpleMenu(sectionMenu) \
+                       MenuPopup(sectionMenu) \n\
+               Shift<Btn2Down>,<Btn2Up>:GotoPage(Directory)\n\
+               Ctrl<Key>q: Quit() \n\
+               Ctrl<Key>c: Quit() \n\
+               Ctrl<Key>r: RemoveThisManpage() \n\
+               Ctrl<Key>n: CreateNewManpage() \n\
+               Ctrl<Key>h: PopupHelp() \n\
+               Ctrl<Key>d: GotoPage(Directory) \n\
+               Ctrl<Key>m: GotoPage(ManualPage) \n\
+               Ctrl<Key>v: ShowVersion() \n\
+               <Key>Prior: Page(Back) \n\
+               <Key>Next : Page(Forward) \n\
+               Shift<Btn4Down>,<Btn4Up>: Page(Line,-1) \n\
+               Shift<Btn5Down>,<Btn5Up>: Page(Line,1) \n\
+               Ctrl<Btn4Down>,<Btn4Up>: Page(Back) \n\
+               Ctrl<Btn5Down>,<Btn5Up>: Page(Forward) \n\
+               None<Btn4Down>,<Btn4Up>: Page(Line,-5) \n\
+               None<Btn5Down>,<Btn5Up>: Page(Line,5) \n\
+               Ctrl<Key>s: PopupSearch()
+
+!*manualBrowser*directory.background: Grey80
+*manualBrowser*directory.translations:   #override \
+               Ctrl<Btn1Down>: \
+                       XawPositionSimpleMenu(optionMenu) \
+                       MenuPopup(optionMenu) \n\
+               Ctrl<Btn2Down>: \
+                       XawPositionSimpleMenu(sectionMenu) \
+                       MenuPopup(sectionMenu) \n\
+               Shift<Btn2Down>,<Btn2Up>: GotoPage(Manpage) \n\
+               Ctrl<Key>q: Quit() \n\
+               Ctrl<Key>c: Quit() \n\
+               Ctrl<Key>r: RemoveThisManpage() \n\
+               Ctrl<Key>n: CreateNewManpage() \n\
+               Ctrl<Key>h: PopupHelp() \n\
+               Ctrl<Key>d: GotoPage(Directory) \n\
+               Ctrl<Key>m: GotoPage(ManualPage) \n\
+               Ctrl<Key>v: ShowVersion() \n\
+               Ctrl<Key>s: PopupSearch()
+
+*manualBrowser*search*manualPage.translations:         #augment \
+               <Btn1Down>,<Btn1Up>: Search(Manpage) reset()
+
+*manualBrowser*search*apropos.translations:            #augment \
+               <Btn1Down>,<Btn1Up>: Search(Apropos) reset()
+
+*manualBrowser*search*cancel*translations:     #augment \
+               <Btn1Down>,<Btn1Up>: Search(Cancel) reset()
+
+*manualBrowser*search*value*translations:              #override \
+               <Key>Return: Search(Manpage) \n\
+               Ctrl<Key>m:  Search(Manpage)
+
+*topBox*search*manualPage.translations:                #augment \
+               <Btn1Down>,<Btn1Up>: Search(Manpage, Open) reset()
+
+*topBox*search*apropos.translations:           #augment \
+               <Btn1Down>,<Btn1Up>: Search(Apropos, Open) reset()
+
+*topBox*search*cancel*translations:            #augment \
+               <Btn1Down>,<Btn1Up>: Search(Cancel, Open) reset()
+
+*topBox*search*value*translations:                     #override \
+               <Key>Return: Search(Manpage, Open) \n\
+               Ctrl<Key>m:  Search(Manpage, Open)
+
+*manualBrowser*likeToSave*yes.translations:    #override \
+               <Btn1Down>,<Btn1Up>: SaveFormattedPage(Save) reset() \n\
+               <Key>y:   SaveFormattedPage(Save) \n\
+               <Key>n:   SaveFormattedPage(Cancel) 
+
+*manualBrowser*likeToSave*no.translations:     #override \
+               <Btn1Down>,<Btn1Up>: SaveFormattedPage(Cancel) reset() \n\
+               <Key>y:   SaveFormattedPage(Save) \n\
+               <Key>n:   SaveFormattedPage(Cancel) 
+
+*manualBrowser*likeToSave*translations:        #override \
+               <Key>y:   SaveFormattedPage(Save) \n\
+               <Key>n:   SaveFormattedPage(Cancel) 
+
+*helpButton.translations:      #augment \
+               <Btn1Down>,<Btn1Up>: PopupHelp() reset()
+
+*quitButton.translations:      #augment \
+               <Btn1Down>,<Btn1Up>: Quit() reset()
+
+*manpageButton.translations: #augment \
+               <Btn1Down>,<Btn1Up>: CreateNewManpage() reset()
+
+! EOF.
diff --git a/xman/buttons.c b/xman/buttons.c
new file mode 100644 (file)
index 0000000..ee251d3
--- /dev/null
@@ -0,0 +1,757 @@
+/* $XConsortium: buttons.c,v 1.33 94/04/17 20:43:50 dave Exp $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86: xc/programs/xman/buttons.c,v 1.3 2000/03/03 23:16:26 dawes Exp $ */
+
+/*
+ * xman - X window system manual page display program.
+ * Author:    Chris D. Peterson, MIT Project Athena
+ * Created:   October 27, 1987
+ */
+
+#include "globals.h"
+#include "vendor.h"
+
+/* The files with the icon bits in them. */
+
+#include "icon_open.h"
+#include "icon_help.h"
+#include "iconclosed.h"
+
+static void CreateOptionMenu(ManpageGlobals * man_globals, Widget parent);
+static void CreateSectionMenu(ManpageGlobals * man_globals, Widget parent);
+static void StartManpage(ManpageGlobals * man_globals, Boolean help, Boolean page);
+static Widget * ConvertNamesToWidgets(Widget parent, char ** names);
+
+/*     Function Name: MakeTopBox
+ *     Description: This funtion creates the top menu, in a shell widget.
+ *     Arguments: none.
+ *     Returns: the top level widget
+ */
+
+#define TOPARGS 5
+
+Widget top;                    /* needed in PopupWarning, misc.c */
+
+void
+MakeTopBox(void)
+{
+  Widget form, command, label; /* widgets. */
+  Arg arglist[TOPARGS];                /* An argument list */
+  Cardinal num_args = 0;       /* The number of arguments. */
+  ManpageGlobals * man_globals;
+  static char * full_size[] = {
+    "topLabel", MANPAGE_BUTTON, NULL
+  };
+  static char * half_size[] = {
+    HELP_BUTTON, QUIT_BUTTON, NULL
+  };
+  
+/* create the top icon. */
+
+  num_args = 0;
+  XtSetArg(arglist[num_args], XtNiconPixmap,
+          XCreateBitmapFromData( XtDisplay(initial_widget), 
+                                XtScreen(initial_widget)->root,
+                                (char *)iconclosed_bits, iconclosed_width,
+                                iconclosed_height));
+  num_args++;
+  XtSetArg(arglist[num_args], XtNtitle, resources.title);
+  num_args++;
+  XtSetArg(arglist[num_args], XtNiconic, resources.iconic);
+  num_args++;
+  top = XtCreatePopupShell(TOPBOXNAME, topLevelShellWidgetClass, 
+                          initial_widget, arglist, num_args);
+
+  form = XtCreateManagedWidget("form", formWidgetClass, top, 
+                              NULL, (Cardinal) 0);
+
+  label = XtCreateManagedWidget("topLabel", labelWidgetClass, form, 
+                              NULL, (Cardinal) 0);
+
+  num_args = 0;
+  XtSetArg(arglist[num_args], XtNfromVert, label); num_args++;
+  command = XtCreateManagedWidget(HELP_BUTTON, commandWidgetClass, form, 
+                                 arglist, num_args);
+
+  /* use same vertical as help widget. */
+  XtSetArg(arglist[num_args], XtNfromHoriz, command); num_args++;
+  command = XtCreateManagedWidget(QUIT_BUTTON, commandWidgetClass, form, 
+                                 arglist, num_args);
+
+  num_args = 0;
+  XtSetArg(arglist[num_args], XtNfromVert, command); num_args++;
+  command = XtCreateManagedWidget(MANPAGE_BUTTON, commandWidgetClass, form, 
+                                 arglist, num_args);
+
+  help_widget = NULL;          /* We have not seen the help yet. */
+
+  FormUpWidgets(form, full_size, half_size);
+
+  XtRealizeWidget(top);
+                               /* add WM_COMMAND property */
+  XSetCommand(XtDisplay(top), XtWindow(top), saved_argv, saved_argc);
+
+  man_globals = (ManpageGlobals*) XtCalloc(ONE, (Cardinal) sizeof(ManpageGlobals));
+  MakeSearchWidget(man_globals, top);
+  MakeSaveWidgets(man_globals, top);
+
+  SaveGlobals( (man_globals->This_Manpage = top), man_globals);
+  XtMapWidget(top);
+  AddCursor(top, resources.cursors.top);
+
+/*
+ * Set up ICCCM delete window.
+ */
+  XtOverrideTranslations
+      (top, XtParseTranslationTable ("<Message>WM_PROTOCOLS: Quit()"));
+  (void) XSetWMProtocols (XtDisplay(top), XtWindow(top),
+                         &wm_delete_window, 1);
+  
+
+}
+
+/*     Function Name: CreateManpage
+ *     Description: Creates a new manpage.
+ *     Arguments: none.
+ *     Returns: none.
+ */
+
+Widget
+CreateManpage(FILE * file)
+{
+  ManpageGlobals * man_globals;        /* The psuedo global structure. */
+
+  man_globals = InitPsuedoGlobals();
+  CreateManpageWidget(man_globals, MANNAME, TRUE);
+  
+  if (file == NULL)
+    StartManpage( man_globals, OpenHelpfile(man_globals), FALSE );
+  else {
+    OpenFile(man_globals, file);
+    StartManpage( man_globals, FALSE, TRUE);
+  }
+  return(man_globals->This_Manpage);
+}
+
+/*     Function Name: InitPsuedoGlobals
+ *     Description: Initializes the psuedo global variables.
+ *     Arguments: none.
+ *     Returns: a pointer to a new pseudo globals structure.
+ */
+
+ManpageGlobals * 
+InitPsuedoGlobals(void)
+{
+  ManpageGlobals * man_globals;
+
+  /*
+   * Allocate necessary memory. 
+   */
+
+  man_globals = (ManpageGlobals *)XtCalloc(ONE, (Cardinal) sizeof(ManpageGlobals));
+  if(!man_globals)
+    return NULL;
+
+  man_globals->search_widget = NULL;
+  man_globals->section_name = (char **) XtMalloc( (Cardinal) (sections *
+                                                             sizeof(char *)));
+  man_globals->manpagewidgets.box = (Widget *) XtCalloc( (Cardinal) sections,
+                                                   (Cardinal) sizeof(Widget));
+  
+  /* Initialize the number of screens that will be shown */
+
+  man_globals->both_shown = resources.both_shown_initial;
+  
+  return(man_globals);
+}
+  
+/*     Function Name: CreateManpageWidget
+ *     Description: Creates a new manual page widget.
+ *     Arguments: man_globals - a new man_globals structure.
+ *                 name         - name of this shell widget instance.
+ *                 full_instance - if true then create a full manpage,
+ *                                 otherwise create stripped down version
+ *                                 used for help.
+ *     Returns: none
+ */
+
+#define MANPAGEARGS 10
+
+void
+CreateManpageWidget(
+ManpageGlobals * man_globals,
+char * name,
+Boolean full_instance)
+{
+  Arg arglist[MANPAGEARGS];    /* An argument list for widget creation */
+  Cardinal num_args;           /* The number of arguments in the list. */
+  Widget mytop, pane, hpane, mysections;       /* Widgets */
+  ManPageWidgets * mpw = &(man_globals->manpagewidgets);
+
+  num_args = (Cardinal) 0;
+  XtSetArg(arglist[num_args], XtNwidth, default_width);
+  num_args++; 
+  XtSetArg(arglist[num_args], XtNheight, default_height);
+  num_args++; 
+
+  mytop = XtCreatePopupShell(name, topLevelShellWidgetClass, initial_widget,
+                          arglist, num_args);
+
+  man_globals->This_Manpage = mytop; /* pointer to root widget of Manualpage. */
+  num_args = 0;
+  if (full_instance)
+    XtSetArg(arglist[num_args], XtNiconPixmap,
+            XCreateBitmapFromData( XtDisplay(mytop), XtScreen(mytop)->root,
+                                  (char *)icon_open_bits, icon_open_width,
+                                  icon_open_height));
+  else 
+    XtSetArg(arglist[num_args], XtNiconPixmap,
+            XCreateBitmapFromData( XtDisplay(mytop), XtScreen(mytop)->root,
+                                  (char *)icon_help_bits, icon_help_width,
+                                  icon_help_height));
+  num_args++;
+  XtSetValues(mytop, arglist, num_args);
+
+  pane = XtCreateManagedWidget("vertPane", panedWidgetClass, mytop, NULL, 
+                              (Cardinal) 0);
+
+/* Create menu bar. */
+
+  hpane = XtCreateManagedWidget("horizPane", panedWidgetClass,
+                                 pane, NULL, (Cardinal) 0);
+  num_args = 0;
+  XtSetArg(arglist[num_args], XtNmenuName, OPTION_MENU); num_args++;
+  (void) XtCreateManagedWidget("options", menuButtonWidgetClass,
+                                 hpane, arglist, num_args);
+
+  CreateOptionMenu(man_globals, mytop);
+
+  num_args = 0;
+  XtSetArg(arglist[num_args], XtNmenuName, SECTION_MENU); num_args++;
+  mysections = XtCreateManagedWidget("sections", menuButtonWidgetClass,
+                                  hpane, arglist, num_args);
+
+  XtSetArg(arglist[0], XtNlabel, SHOW_BOTH);
+  XtSetValues(man_globals->both_screens_entry, arglist, (Cardinal) 1);
+
+  if (full_instance) {
+    MakeSearchWidget(man_globals, mytop);
+    CreateSectionMenu(man_globals, mytop);
+    MakeSaveWidgets(man_globals, mytop);
+  } else {
+    XtSetSensitive(mysections, FALSE);       
+    XtSetArg(arglist[0], XtNsensitive, FALSE);
+    XtSetValues(man_globals->dir_entry, arglist, ONE);
+    XtSetValues(man_globals->manpage_entry, arglist, ONE);
+    XtSetValues(man_globals->help_entry, arglist, ONE);
+    XtSetValues(man_globals->search_entry, arglist, ONE);
+    XtSetValues(man_globals->both_screens_entry, arglist, ONE);
+  }
+
+#ifdef INCLUDE_XPRINT_SUPPORT
+  XtSetArg(arglist[0], XtNsensitive, True);
+  XtSetValues(man_globals->print_entry, arglist, ONE);
+#endif /* INCLUDE_XPRINT_SUPPORT */
+
+  man_globals->label = XtCreateManagedWidget("manualTitle", labelWidgetClass,
+                                            hpane, NULL, (Cardinal) 0);
+
+/* Create Directory */
+
+  if (full_instance) {
+    num_args = 0;
+    XtSetArg(arglist[num_args], XtNallowVert, TRUE);
+    num_args++;
+    
+    mpw->directory = XtCreateWidget(DIRECTORY_NAME, viewportWidgetClass,
+                                   pane, arglist, num_args);
+    
+    man_globals->current_directory = INITIAL_DIR;
+    MakeDirectoryBox(man_globals, mpw->directory,
+                    mpw->box + man_globals->current_directory, 
+                    man_globals->current_directory );
+    XtManageChild(mpw->box[man_globals->current_directory]);
+  }
+
+/* Create Manpage */
+
+  mpw->manpage = XtCreateWidget(MANUALPAGE, scrollByLineWidgetClass,
+                               pane, NULL, (Cardinal) 0);
+
+}
+
+/*     Function Name: StartManpage
+ *     Description: Starts up a new manpage.
+ *     Arguments: man_globals - the psuedo globals variable.
+ *                 help - is this a help file?
+ *                 page - Is there a page to display?
+ *     Returns: none.
+ */
+
+static void
+StartManpage(ManpageGlobals * man_globals, Boolean help, Boolean page)
+{
+  Widget dir = man_globals->manpagewidgets.directory;
+  Widget manpage = man_globals->manpagewidgets.manpage;
+  Widget label = man_globals->label;
+  Arg arglist[1];
+
+/* 
+ * If there is a helpfile then put up both screens if both_show is set.
+ */
+
+  if (page || help) {
+    if (help) 
+      strcpy(man_globals->manpage_title, "Xman Help");
+
+    if (man_globals->both_shown) {
+      XtManageChild(dir);
+      man_globals->dir_shown = TRUE;
+
+      XtSetArg(arglist[0], XtNpreferredPaneSize, resources.directory_height);
+      XtSetValues(dir, arglist, (Cardinal) 1);
+
+      XtSetArg(arglist[0], XtNsensitive, FALSE);
+      XtSetValues(man_globals->manpage_entry, arglist, ONE);
+      XtSetValues(man_globals->dir_entry, arglist, ONE);
+
+      XtSetArg(arglist[0], XtNlabel, SHOW_ONE);
+      XtSetValues(man_globals->both_screens_entry, arglist, ONE);
+      ChangeLabel(label,
+                 man_globals->section_name[man_globals->current_directory]);
+    }
+    else {
+      ChangeLabel(label,man_globals->manpage_title);
+    }
+    XtManageChild(manpage);
+    man_globals->dir_shown = FALSE;
+  }
+/*
+ * Since There is file to display, put up directory and do not allow change
+ * to manpage, show both, or help.
+ */
+  else {                       
+    XtManageChild(dir);
+    man_globals->dir_shown = TRUE;
+    XtSetArg(arglist[0], XtNsensitive, FALSE);
+    XtSetValues(man_globals->manpage_entry,        arglist, ONE);
+    XtSetValues(man_globals->help_entry,           arglist, ONE);
+    XtSetValues(man_globals->both_screens_entry,   arglist, ONE);
+    man_globals->both_shown = FALSE;
+    ChangeLabel(label,
+               man_globals->section_name[man_globals->current_directory]);
+  }
+
+/*
+ * Start 'er up, and change the cursor.
+ */
+
+  XtRealizeWidget( man_globals->This_Manpage );
+  SaveGlobals( man_globals->This_Manpage, man_globals);
+  XtMapWidget( man_globals->This_Manpage );
+  AddCursor( man_globals->This_Manpage, resources.cursors.manpage);
+  XtSetArg(arglist[0], XtNtransientFor, man_globals->This_Manpage);
+  XtSetValues(XtParent(man_globals->standby), arglist, (Cardinal)1);
+  XtSetValues(XtParent(man_globals->save), arglist, (Cardinal) 1);
+  XtRealizeWidget(XtParent(man_globals->standby));
+  XtRealizeWidget(XtParent(man_globals->save));
+  AddCursor( XtParent(man_globals->standby), resources.cursors.top);
+  AddCursor( XtParent(man_globals->save), resources.cursors.top);
+
+/*
+ * Set up ICCCM delete window.
+ */
+  XtOverrideTranslations
+      (man_globals->This_Manpage, 
+       XtParseTranslationTable ("<Message>WM_PROTOCOLS: RemoveThisManpage()"));
+  (void) XSetWMProtocols (XtDisplay(man_globals->This_Manpage),
+                         XtWindow(man_globals->This_Manpage),
+                         &wm_delete_window, 1);
+
+}
+
+/*      Function Name: MenuDestroy
+ *      Description: free's data associated with menu when it is destroyed.
+ *      Arguments: w - menu widget.
+ *                 free_me - data to free.
+ *                 junk - not used.
+ *      Returns: none.
+ */
+
+/* ARGSUSED */
+static void
+MenuDestroy(Widget w, XtPointer free_me, XtPointer junk)
+{
+  XtFree( (char *) free_me);
+}
+
+/*      Function Name:   CreateOptionMenu
+ *      Description: Create the option menu.
+ *      Arguments: man_globals - the manual page globals.
+ *                 parent - the button that activates the menu.
+ *      Returns: none.
+ */
+
+static void
+CreateOptionMenu(ManpageGlobals * man_globals, Widget parent)
+{
+  Widget menu, entry;
+  int i;
+  static char * option_names[] = {     /* Names of the buttons. */
+    DIRECTORY,
+    MANPAGE,
+    HELP,
+    SEARCH,
+    BOTH_SCREENS, 
+    REMOVE_MANPAGE,
+    OPEN_MANPAGE,
+#ifdef INCLUDE_XPRINT_SUPPORT
+    PRINT_MANPAGE,
+#endif /* INCLUDE_XPRINT_SUPPORT */
+    SHOW_VERSION,
+    QUIT
+  };
+
+  menu = XtCreatePopupShell(OPTION_MENU, simpleMenuWidgetClass, parent,
+                           NULL, (Cardinal) 0);
+  man_globals->option_menu = menu;
+  
+  for (i = 0 ; i < NUM_OPTIONS ; i++) {
+    entry = XtCreateManagedWidget(option_names[i], smeBSBObjectClass,
+                                 menu, NULL, ZERO);
+    XtAddCallback(entry, XtNcallback, OptionCallback, (caddr_t) man_globals);
+    switch (i) {
+    case 0:
+       man_globals->dir_entry = entry;
+       break;
+    case 1:
+       man_globals->manpage_entry = entry;
+       break;
+    case 2:
+       man_globals->help_entry = entry;
+       break;
+    case 3:
+       man_globals->search_entry = entry;
+       break;
+    case 4:
+       man_globals->both_screens_entry = entry;
+       break;
+    case 5:
+       man_globals->remove_entry = entry;
+       break;
+    case 6:
+       man_globals->open_entry = entry;
+       break;
+#ifdef INCLUDE_XPRINT_SUPPORT
+    case 7:
+       man_globals->print_entry = entry;
+       break;
+    case 8:
+       man_globals->version_entry = entry;
+       break;
+    case 9:
+       man_globals->quit_entry = entry;
+       break;
+#else /* !INCLUDE_XPRINT_SUPPORT */
+    case 7:
+       man_globals->version_entry = entry;
+       break;
+    case 8:
+       man_globals->quit_entry = entry;
+       break;
+#endif /* !INCLUDE_XPRINT_SUPPORT */
+    default:
+        Error(("CreateOptionMenu: Unknown id=%d\n", i));
+       break;
+    }
+  }
+
+#ifdef INCLUDE_XPRINT_SUPPORT
+  XtVaSetValues(man_globals->print_entry, XtNsensitive, FALSE, NULL);
+#endif /* INCLUDE_XPRINT_SUPPORT */
+}
+
+/*      Function Name: CreateSectionMenu
+ *      Description: Create the Section menu.
+ *      Arguments: man_globals - the manual page globals.
+ *                 parent - the button that activates the menu.
+ *      Returns: none.
+ */
+
+static void
+CreateSectionMenu(ManpageGlobals * man_globals, Widget parent)
+{
+  Widget menu, entry;
+  int i;
+  MenuStruct * menu_struct;
+  Arg args[1];
+  Cardinal num_args;
+  char entry_name[BUFSIZ];
+
+  menu = XtCreatePopupShell(SECTION_MENU, simpleMenuWidgetClass, parent,
+                           NULL, (Cardinal) 0);
+
+  for (i = 0 ; i < sections ; i ++) {
+    num_args = 0;
+    XtSetArg(args[num_args], XtNlabel, manual[i].blabel); num_args++;
+    sprintf(entry_name, "section%d", i);
+      
+    entry = XtCreateManagedWidget(entry_name, smeBSBObjectClass,
+                                 menu, args, num_args);
+    menu_struct = (MenuStruct *) XtMalloc(sizeof(MenuStruct));
+    menu_struct->data = (caddr_t) man_globals;
+    menu_struct->number = i;
+    XtAddCallback(entry, XtNcallback, DirPopupCallback, (caddr_t) menu_struct);
+    XtAddCallback(entry, XtNdestroyCallback,MenuDestroy, (caddr_t)menu_struct);
+
+  }
+}
+
+/*     Function Name: CreateList
+ *     Description: this function prints a label in the directory list
+ *     Arguments: section - the manual section.
+ *     Returns: none
+ */
+
+static char **
+CreateList(int section)
+{
+  char ** ret_list, **current;
+  int count;
+
+  ret_list = (char **) XtMalloc( (manual[section].nentries + 1) * 
+                                  sizeof (char *));
+
+  for (current = ret_list, count = 0 ; count < manual[section].nentries ;
+       count++, current++)
+    *current = CreateManpageName(manual[section].entries[count], section,
+                                manual[section].flags);
+  *current = NULL;             /* NULL terminate the list. */
+  return(ret_list);
+}
+
+/*     Function Name: MakeDirectoryBox
+ *     Description: make a directory box.
+ *     Arguments: man_globals - the psuedo global structure for each manpage.
+ *                 parent - this guys parent widget.
+ *                 dir_disp - the directory display widget.
+ *                 section - the section number.
+ *     Returns: none.
+ */
+
+void
+MakeDirectoryBox(ManpageGlobals *man_globals, Widget parent, Widget *dir_disp, int section)
+{
+  Arg arglist[10];
+  Cardinal num_args;
+  char * name, label_name[BUFSIZ];
+
+  if (*dir_disp != NULL)       /* If we have one, don't make another. */
+    return;
+
+  name = manual[section].blabel;   /* Set the section name */
+  sprintf(label_name,"Directory of: %s",name);
+  man_globals->section_name[section] = StrAlloc(label_name);
+
+  num_args = 0;
+  XtSetArg(arglist[num_args], XtNlist, CreateList(section));
+  num_args++;
+  XtSetArg(arglist[num_args], XtNfont, resources.fonts.directory);
+  num_args++;
+  
+  *dir_disp = XtCreateWidget(DIRECTORY_NAME, listWidgetClass, parent,
+                            arglist, num_args);
+  
+  XtAddCallback(*dir_disp, XtNcallback,
+               DirectoryHandler, (caddr_t) man_globals);
+}
+
+/*     Function Name: MakeSaveWidgets.
+ *     Description: This functions creates two popup widgets, the please 
+ *                   standby widget and the would you like to save widget.
+ *     Arguments: man_globals - the psuedo globals structure for each man page
+ *                 parent - the realized parent for both popups.
+ *     Returns: none.
+ */
+
+void
+MakeSaveWidgets(ManpageGlobals *man_globals, Widget parent)
+{
+  Widget shell, dialog; /* misc. widgets. */
+  Arg warg[1];
+  Cardinal n = 0;
+
+/* make the please stand by popup widget. */
+  if (XtIsRealized(parent)) {
+      XtSetArg(warg[0], XtNtransientFor, parent);      n++;
+  }
+  shell = XtCreatePopupShell( "pleaseStandBy", transientShellWidgetClass,
+                             parent, warg, (Cardinal) n);
+
+  man_globals->standby = XtCreateManagedWidget("label", labelWidgetClass, 
+                                              shell, NULL, (Cardinal) 0);
+
+  man_globals->save = XtCreatePopupShell("likeToSave",
+                                        transientShellWidgetClass,
+                                        parent, warg, n);
+
+  dialog = XtCreateManagedWidget("dialog", dialogWidgetClass, 
+                                man_globals->save, NULL, (Cardinal) 0);
+
+  XawDialogAddButton(dialog, FILE_SAVE, NULL, NULL);
+  XawDialogAddButton(dialog, CANCEL_FILE_SAVE, NULL, NULL);
+
+  if (XtIsRealized(parent)) {
+      XtRealizeWidget(shell);
+      AddCursor(shell,resources.cursors.top);
+      XtRealizeWidget(man_globals->save);
+      AddCursor(man_globals->save, resources.cursors.top);
+  }
+}
+
+/*      Function Name: FormUpWidgets
+ *      Description: Sizes widgets to look nice.
+ *      Arguments: parent - the common parent of all the widgets.
+ *                 full_size - array of widget names that will he full size.
+ *                 half_size - array of widget names that will he half size.
+ *      Returns: none
+ */
+
+void
+FormUpWidgets(Widget parent, char ** full_size, char ** half_size)
+{
+  Widget * full_widgets, * half_widgets, *temp, long_widget;
+  Dimension longest, length, b_width;
+  int interior_dist;
+  Arg arglist[2];
+    
+  full_widgets = ConvertNamesToWidgets(parent, full_size);
+  half_widgets = ConvertNamesToWidgets(parent, half_size);
+  
+  long_widget = NULL;
+  longest = 0;
+  XtSetArg(arglist[0], XtNwidth, &length);
+  XtSetArg(arglist[1], XtNborderWidth, &b_width);
+
+/*
+ * Find Longest widget.
+ */
+
+  for ( temp = full_widgets ; *temp != (Widget) NULL ; temp++) {
+    XtGetValues(*temp, arglist, (Cardinal) 2);
+    length += 2 * b_width;
+    if (length > longest) {
+      longest = length;
+      long_widget = *temp;
+    }
+  }
+
+  if (long_widget == (Widget) NULL) {          /* Make sure we found one. */
+    PopupWarning(GetGlobals(parent), 
+                "Could not find longest widget, aborting...");
+    XtFree((char *)full_widgets);
+    XtFree((char *)half_widgets);
+    return;
+  }
+
+/*
+ * Set all other full_widgets to this length.
+ */
+
+  for ( temp = full_widgets ; *temp != (Widget) NULL ; temp++ )
+    if ( long_widget != *temp) {
+      Dimension width, border_width;
+
+      XtSetArg(arglist[0], XtNborderWidth, &border_width);
+      XtGetValues(*temp, arglist, (Cardinal) 1);
+    
+      width = longest - 2 * border_width;
+      XtSetArg(arglist[0], XtNwidth, width);
+      XtSetValues(*temp, arglist, (Cardinal) 1);
+    }
+
+/*
+ * Set all the half widgets to the right length.
+ */
+
+  XtSetArg(arglist[0], XtNdefaultDistance, &interior_dist);
+  XtGetValues(parent, arglist, (Cardinal) 1);
+  
+  for ( temp = half_widgets ; *temp != (Widget) NULL ; temp++) {
+    Dimension width, border_width;
+
+    XtSetArg(arglist[0], XtNborderWidth, &border_width);
+    XtGetValues(*temp, arglist, (Cardinal) 1);
+    
+    width = (int)(longest - interior_dist)/2 - 2 * border_width;
+    XtSetArg(arglist[0], XtNwidth, width);
+    XtSetValues(*temp, arglist, (Cardinal) 1);
+  }
+
+  XtFree((char *)full_widgets);
+  XtFree((char *)half_widgets);
+}
+  
+/*      Function Name: ConvertNamesToWidgets
+ *      Description: Convers a list of names into a list of widgets.
+ *      Arguments: parent - the common parent of these widgets.
+ *                 names - an array of widget names.
+ *      Returns: an array of widget id's.
+ */
+
+static Widget *
+ConvertNamesToWidgets(Widget parent, char ** names)
+{
+  char ** temp;
+  Widget * ids, * temp_ids;
+  int count;
+
+  for (count = 0, temp = names; *temp != NULL ; count++, temp++);
+
+  ids = (Widget *) XtMalloc( (count + 1) * sizeof(Widget));
+
+  
+  for ( temp_ids = ids; *names != NULL ; names++, temp_ids++) {
+    *temp_ids = XtNameToWidget(parent, *names);
+    if (*temp_ids == NULL) {
+      char error_buf[BUFSIZ];
+    
+      sprintf(error_buf, "Could not find widget named '%s'", *names);
+      PrintError(error_buf);
+      XtFree((char *)ids);
+      return(NULL);
+    }
+  }
+  
+  *temp_ids = (Widget) NULL;
+  return(ids);
+}
diff --git a/xman/config.guess b/xman/config.guess
new file mode 100755 (executable)
index 0000000..da83314
--- /dev/null
@@ -0,0 +1,1561 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
+
+timestamp='2009-04-27'
+
+# 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 <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+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, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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 "$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 ;;
+           sh5el) machine=sh5le-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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    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.*:* | i86xen:SunOS:5.*:*)
+       eval $set_cc_for_build
+       SUN_ARCH="i386"
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       echo ${SUN_ARCH}-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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:*:[456])
+       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+               IBM_ARCH=rs6000
+       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 <stdlib.h>
+              #include <unistd.h>
+
+              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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       exit ;;
+    i*:CYGWIN*:*)
+       echo ${UNAME_MACHINE}-pc-cygwin
+       exit ;;
+    *: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 ;;
+    *:Interix*:[3456]*)
+       case ${UNAME_MACHINE} in
+           x86)
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           EM64T | authenticamd | genuineintel)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+           IA64)
+               echo ia64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+       esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       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*:*:* | x86_64: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:*:*)
+       eval $set_cc_for_build
+       if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_EABI__
+       then
+           echo ${UNAME_MACHINE}-unknown-linux-gnu
+       else
+           echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+       fi
+       exit ;;
+    avr32*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-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 ;;
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-gnu
+       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 ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-gnu
+       exit ;;
+    x86_64:Linux:*:*)
+       echo x86_64-unknown-linux-gnu
+       exit ;;
+    xtensa*:Linux:*:*)
+       echo ${UNAME_MACHINE}-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 ;;
+         "")
+               # 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 <features.h>
+       #ifdef __ELF__
+       # ifdef __GLIBC__
+       #  if __GLIBC__ >= 2
+       LIBC=gnu
+       #  else
+       LIBC=gnulibc1
+       #  endif
+       # else
+       LIBC=gnulibc1
+       # endif
+       #else
+       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+       LIBC=gnu
+       #else
+       LIBC=gnuaout
+       #endif
+       #endif
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^LIBC/{
+               s: ::g
+               p
+           }'`"
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-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; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       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; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; 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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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 ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       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 ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-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
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/xman/config.h.in b/xman/config.h.in
new file mode 100644 (file)
index 0000000..36bd8f8
--- /dev/null
@@ -0,0 +1,85 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the "mkstemp" function. */
+#undef HAS_MKSTEMP
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Default local man page search path (default: none) */
+#undef LOCALMANPATH
+
+/* Define to path to man config file if you have one */
+#undef MANCONF
+
+/* Define to 1 if you have BSD format manpath.config */
+#undef MANCONFIGSTYLE_BSD
+
+/* Define to 1 if you have FreeBSD format manpath.config */
+#undef MANCONFIGSTYLE_FreeBSD
+
+/* Define to 1 if you have Linux format man.conf or man.config */
+#undef MANCONFIGSTYLE_Linux
+
+/* Define to 1 if you have OpenBSD format manpath.config */
+#undef MANCONFIGSTYLE_OpenBSD
+
+/* 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
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Default system man page search path (default: none) */
+#undef SYSMANPATH
+
+/* Version number of package */
+#undef VERSION
diff --git a/xman/config.sub b/xman/config.sub
new file mode 100755 (executable)
index 0000000..a39437d
--- /dev/null
@@ -0,0 +1,1686 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
+
+timestamp='2009-04-17'
+
+# 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 <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+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-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | bfin \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fido | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | lm32 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore | mep | metag \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64octeon | mips64octeonel \
+       | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | moxie \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | z8k | z80)
+               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)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64octeon-* | mips64octeonel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | 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[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+       | tron-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa*-* \
+       | ymp-* \
+       | z8k-* | z80-*)
+               ;;
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               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
+               ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+        cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
+       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
+               ;;
+       cr16)
+               basic_machine=cr16-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
+               ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
+       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
+               ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       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
+               ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
+       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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       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
+               ;;
+       tile*)
+               basic_machine=tile-unknown
+               os=-linux-gnu
+               ;;
+       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
+               ;;
+       z80-*-coff)
+               basic_machine=z80-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[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+               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* \
+             | -kopensolaris* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* | -aros* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
+             | -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* | -cegcc* \
+             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -linux-newlib* | -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* | -rdos* | -toppers* | -drops*)
+       # 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
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+       -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
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
+       *-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
+               ;;
+        mep-*)
+               os=-elf
+               ;;
+       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/xman/configure b/xman/configure
new file mode 100755 (executable)
index 0000000..a764eed
--- /dev/null
@@ -0,0 +1,7058 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.63 for xman 1.1.0.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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 ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&    (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    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=.
+  case $as_dir in
+        /*)
+          for as_base in sh bash ksh sh5; do
+            as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+          done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+        # Try only shells that exist, to save several forks.
+        if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+               { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+              as_have_required=yes
+              if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+       do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+       done
+       export CONFIG_SHELL
+       exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell bug-autoconf@gnu.org about your system,
+  echo including any error possibly output before this message.
+  echo This can help us improve future autoconf versions.
+  echo Configuration will now proceed without shell functions.
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# 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`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='xman'
+PACKAGE_TARNAME='xman'
+PACKAGE_VERSION='1.1.0'
+PACKAGE_STRING='xman 1.1.0'
+PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+appdefaultdir
+APPDEFS_LIBS
+APPDEFS_CFLAGS
+XMAN_LIBS
+XMAN_CFLAGS
+PKG_CONFIG
+HELPDIR
+ADMIN_MAN_DIR
+DRIVER_MAN_DIR
+MISC_MAN_DIR
+FILE_MAN_DIR
+LIB_MAN_DIR
+APP_MAN_DIR
+ADMIN_MAN_SUFFIX
+DRIVER_MAN_SUFFIX
+MISC_MAN_SUFFIX
+FILE_MAN_SUFFIX
+LIB_MAN_SUFFIX
+APP_MAN_SUFFIX
+distcleancheck_listfiles
+CHANGELOG_CMD
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+CWARNFLAGS
+EGREP
+GREP
+CPP
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_silent_rules
+enable_strict_compilation
+with_release_version
+with_helpdir
+with_sysmanpath
+with_localmanpath
+with_manconfig
+with_appdefaultdir
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+PKG_CONFIG
+XMAN_CFLAGS
+XMAN_LIBS
+APPDEFS_CFLAGS
+APPDEFS_LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)   ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=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 ;;
+
+  -*) { $as_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 &&
+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_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'`
+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+   { (exit 1); exit 1; }; } ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+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
+    $as_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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 xman 1.1.0 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/xman]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_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 xman 1.1.0:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --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
+  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')
+  --enable-strict-compilation
+                          Enable all warnings from compiler and make them
+                          errors (default: disabled)
+
+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
+  --with-helpdir=<path>   Set default directory for xman.help (default:
+                          ${datadir}/X11)
+  --with-sysmanpath=<path>
+                          Set default system man page search path
+  --with-localmanpath=<path>
+                          Set default local man page search path
+  --with-manconfig=<filename>
+                          Set default system man configuration file
+  --with-appdefaultdir=<pathname>
+                          specify directory for app-defaults files (default is
+                          autodetected)
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  PKG_CONFIG  path to pkg-config utility
+  XMAN_CFLAGS C compiler flags for XMAN, overriding pkg-config
+  XMAN_LIBS   linker flags for XMAN, overriding pkg-config
+  APPDEFS_CFLAGS
+              C compiler flags for APPDEFS, overriding pkg-config
+  APPDEFS_LIBS
+              linker flags for APPDEFS, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+xman configure 1.1.0
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 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
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by xman $as_me 1.1.0, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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=.
+  $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&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_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=`$as_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_arg'"
+      ;;
+    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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+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,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r 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 -f -r conftest* 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 an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test -r "$ac_site_file"; then
+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_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
+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_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 $ac_precious_vars; 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,)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_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
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_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
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_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.11'
+
+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
+  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$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'
+
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5
+$as_echo "$as_me: error: unsafe absolute working directory name" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5
+$as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+
+# 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".
+      { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+$as_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
+   { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+$as_echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "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 $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# 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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+done
+IFS=$as_save_IFS
+
+fi
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+# test whether we have cygpath
+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='xman'
+ VERSION='1.1.0'
+
+
+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"}
+
+# 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 -'
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-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
+
+  { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$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
+
+
+
+# Require xorg-macros 1.3 or later: XORG_DEFAULT_OPTIONS
+
+
+
+
+
+
+
+
+
+
+
+
+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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+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
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_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.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_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.out.dSYM 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.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+$as_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
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&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'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_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
+       { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_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
+$as_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
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+$as_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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then
+  $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+$as_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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       CFLAGS=""
+      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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=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 <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+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 this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-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=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&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
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$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.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$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.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+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
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&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
+
+
+{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+  $as_echo_n "(cached) " >&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 <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+   { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if test "${ac_cv_prog_cc_c99+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=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 <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+       {
+       case 's': // string
+         str = va_arg (args_copy, const char *);
+         break;
+       case 'd': // int
+         number = va_arg (args_copy, int);
+         break;
+       case 'f': // float
+         fnumber = va_arg (args_copy, double);
+         break;
+       default:
+         break;
+       }
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+         || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c99=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+
+
+
+
+
+
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    { $as_echo "$as_me:$LINENO: checking whether __SUNPRO_C is declared" >&5
+$as_echo_n "checking whether __SUNPRO_C is declared... " >&6; }
+if test "${ac_cv_have_decl___SUNPRO_C+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __SUNPRO_C
+  (void) __SUNPRO_C;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl___SUNPRO_C=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl___SUNPRO_C=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___SUNPRO_C" >&5
+$as_echo "$ac_cv_have_decl___SUNPRO_C" >&6; }
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=0;;
+esac
+AM_BACKSLASH='\'
+
+
+
+
+
+
+
+# Check whether --enable-strict-compilation was given.
+if test "${enable_strict_compilation+set}" = set; then
+  enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval
+else
+  STRICT_COMPILE=no
+fi
+
+if test "x$STRICT_COMPILE" = "xyes"; then
+       { $as_echo "$as_me:$LINENO: checking whether __SUNPRO_C is declared" >&5
+$as_echo_n "checking whether __SUNPRO_C is declared... " >&6; }
+if test "${ac_cv_have_decl___SUNPRO_C+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __SUNPRO_C
+  (void) __SUNPRO_C;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl___SUNPRO_C=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl___SUNPRO_C=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___SUNPRO_C" >&5
+$as_echo "$ac_cv_have_decl___SUNPRO_C" >&6; }
+if test "x$ac_cv_have_decl___SUNPRO_C" = x""yes; then
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+       { $as_echo "$as_me:$LINENO: checking whether __INTEL_COMPILER is declared" >&5
+$as_echo_n "checking whether __INTEL_COMPILER is declared... " >&6; }
+if test "${ac_cv_have_decl___INTEL_COMPILER+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __INTEL_COMPILER
+  (void) __INTEL_COMPILER;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl___INTEL_COMPILER=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl___INTEL_COMPILER=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___INTEL_COMPILER" >&5
+$as_echo "$ac_cv_have_decl___INTEL_COMPILER" >&6; }
+if test "x$ac_cv_have_decl___INTEL_COMPILER" = x""yes; then
+  INTELCC="yes"
+else
+  INTELCC="no"
+fi
+
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+
+
+
+
+# Check whether --with-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"
+               { $as_echo "$as_me:$LINENO: Building with package name set to $PACKAGE" >&5
+$as_echo "$as_me: Building with package name set to $PACKAGE" >&6;}
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
+mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+
+distcleancheck_listfiles='find . -type f ! -name ChangeLog -print'
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for mkstemp" >&5
+$as_echo_n "checking for mkstemp... " >&6; }
+if test "${ac_cv_func_mkstemp+set}" = set; then
+  $as_echo_n "(cached) " >&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 <limits.h> declares mkstemp.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define mkstemp innocuous_mkstemp
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char mkstemp (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef mkstemp
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+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
+#endif
+
+int
+main ()
+{
+return mkstemp ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_mkstemp=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_func_mkstemp=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_mkstemp" >&5
+$as_echo "$ac_cv_func_mkstemp" >&6; }
+if test "x$ac_cv_func_mkstemp" = x""yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAS_MKSTEMP 1
+_ACEOF
+
+fi
+
+
+
+# Check whether --with-helpdir was given.
+if test "${with_helpdir+set}" = set; then
+  withval=$with_helpdir; HELPDIR="$withval"
+else
+  HELPDIR=${datadir}/X11
+fi
+
+
+
+
+# Check whether --with-sysmanpath was given.
+if test "${with_sysmanpath+set}" = set; then
+  withval=$with_sysmanpath; SYSMANPATH="$withval"
+fi
+
+if test x$SYSMANPATH != x; then
+
+cat >>confdefs.h <<_ACEOF
+#define SYSMANPATH "$SYSMANPATH"
+_ACEOF
+
+fi
+
+
+# Check whether --with-localmanpath was given.
+if test "${with_localmanpath+set}" = set; then
+  withval=$with_localmanpath; LOCALMANPATH="$withval"
+fi
+
+if test x$LOCALMANPATH != x; then
+
+cat >>confdefs.h <<_ACEOF
+#define LOCALMANPATH "$LOCALMANPATH"
+_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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+
+pkg_failed=no
+{ $as_echo "$as_me:$LINENO: checking for XMAN" >&5
+$as_echo_n "checking for XMAN... " >&6; }
+
+if test -n "$XMAN_CFLAGS"; then
+    pkg_cv_XMAN_CFLAGS="$XMAN_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xaw7\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xaw7") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_XMAN_CFLAGS=`$PKG_CONFIG --cflags "xaw7" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XMAN_LIBS"; then
+    pkg_cv_XMAN_LIBS="$XMAN_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xaw7\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xaw7") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_XMAN_LIBS=`$PKG_CONFIG --libs "xaw7" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               XMAN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xaw7" 2>&1`
+        else
+               XMAN_PKG_ERRORS=`$PKG_CONFIG --print-errors "xaw7" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XMAN_PKG_ERRORS" >&5
+
+       { { $as_echo "$as_me:$LINENO: error: Package requirements (xaw7) were not met:
+
+$XMAN_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 XMAN_CFLAGS
+and XMAN_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&5
+$as_echo "$as_me: error: Package requirements (xaw7) were not met:
+
+$XMAN_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 XMAN_CFLAGS
+and XMAN_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
+       { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_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 XMAN_CFLAGS
+and XMAN_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&5
+$as_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 XMAN_CFLAGS
+and XMAN_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+else
+       XMAN_CFLAGS=$pkg_cv_XMAN_CFLAGS
+       XMAN_LIBS=$pkg_cv_XMAN_LIBS
+        { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       :
+fi
+
+
+# Check whether --with-manconfig was given.
+if test "${with_manconfig+set}" = set; then
+  withval=$with_manconfig; MANCONF="$withval"
+fi
+
+if test x$MANCONF = x; then
+# Check for man page config files
+    { $as_echo "$as_me:$LINENO: checking for /etc/man.conf" >&5
+$as_echo_n "checking for /etc/man.conf... " >&6; }
+if test "${ac_cv_file__etc_man_conf+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  test "$cross_compiling" = yes &&
+  { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
+$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
+   { (exit 1); exit 1; }; }
+if test -r "/etc/man.conf"; then
+  ac_cv_file__etc_man_conf=yes
+else
+  ac_cv_file__etc_man_conf=no
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__etc_man_conf" >&5
+$as_echo "$ac_cv_file__etc_man_conf" >&6; }
+if test "x$ac_cv_file__etc_man_conf" = x""yes; then
+  MANCONF="/etc/man.conf"
+else
+  { $as_echo "$as_me:$LINENO: checking for /etc/man.config" >&5
+$as_echo_n "checking for /etc/man.config... " >&6; }
+if test "${ac_cv_file__etc_man_config+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  test "$cross_compiling" = yes &&
+  { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
+$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
+   { (exit 1); exit 1; }; }
+if test -r "/etc/man.config"; then
+  ac_cv_file__etc_man_config=yes
+else
+  ac_cv_file__etc_man_config=no
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__etc_man_config" >&5
+$as_echo "$ac_cv_file__etc_man_config" >&6; }
+if test "x$ac_cv_file__etc_man_config" = x""yes; then
+  MANCONF="/etc/man.config"
+else
+  { $as_echo "$as_me:$LINENO: checking for /etc/manpath.config" >&5
+$as_echo_n "checking for /etc/manpath.config... " >&6; }
+if test "${ac_cv_file__etc_manpath_config+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  test "$cross_compiling" = yes &&
+  { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
+$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
+   { (exit 1); exit 1; }; }
+if test -r "/etc/manpath.config"; then
+  ac_cv_file__etc_manpath_config=yes
+else
+  ac_cv_file__etc_manpath_config=no
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__etc_manpath_config" >&5
+$as_echo "$ac_cv_file__etc_manpath_config" >&6; }
+if test "x$ac_cv_file__etc_manpath_config" = x""yes; then
+  MANCONF="/etc/manpath.config"
+else
+  { $as_echo "$as_me:$LINENO: checking for /usr/share/misc/man.conf" >&5
+$as_echo_n "checking for /usr/share/misc/man.conf... " >&6; }
+if test "${ac_cv_file__usr_share_misc_man_conf+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  test "$cross_compiling" = yes &&
+  { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
+$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
+   { (exit 1); exit 1; }; }
+if test -r "/usr/share/misc/man.conf"; then
+  ac_cv_file__usr_share_misc_man_conf=yes
+else
+  ac_cv_file__usr_share_misc_man_conf=no
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_misc_man_conf" >&5
+$as_echo "$ac_cv_file__usr_share_misc_man_conf" >&6; }
+if test "x$ac_cv_file__usr_share_misc_man_conf" = x""yes; then
+  MANCONF="/usr/share/misc/man.conf"
+fi
+
+fi
+
+fi
+
+fi
+
+fi
+
+if test x$MANCONF != x ; then
+
+cat >>confdefs.h <<_ACEOF
+#define MANCONF "$MANCONF"
+_ACEOF
+
+
+    # Try to determine format of config file
+    # would be better to somehow determine from the files themselves, but
+    # we'll guess based on pathname and OS for now (mirrors old Imake tests)
+    { $as_echo "$as_me:$LINENO: checking man config file format" >&5
+$as_echo_n "checking man config file format... " >&6; }
+    if test x$MANCONF = x/etc/manpath.config ; then
+       MAN_CONFIG_STYLE="FreeBSD"
+    else
+       case $host_os in
+       *darwin* | *openbsd* | *netbsd* )
+           MAN_CONFIG_STYLE="OpenBSD"
+           ;;
+       *linux* | cygwin* )
+           MAN_CONFIG_STYLE="Linux"
+           ;;
+       *bsd* )
+           MAN_CONFIG_STYLE="BSD"
+           ;;
+       *)
+           ;;
+       esac
+    fi
+    { $as_echo "$as_me:$LINENO: result: $MAN_CONFIG_STYLE" >&5
+$as_echo "$MAN_CONFIG_STYLE" >&6; }
+
+    case $MAN_CONFIG_STYLE in
+       FreeBSD)
+
+cat >>confdefs.h <<\_ACEOF
+#define MANCONFIGSTYLE_FreeBSD 1
+_ACEOF
+
+           ;;
+       OpenBSD)
+
+cat >>confdefs.h <<\_ACEOF
+#define MANCONFIGSTYLE_OpenBSD 1
+_ACEOF
+
+           ;;
+       BSD)
+
+cat >>confdefs.h <<\_ACEOF
+#define MANCONFIGSTYLE_BSD 1
+_ACEOF
+
+           ;;
+       Linux)
+
+cat >>confdefs.h <<\_ACEOF
+#define MANCONFIGSTYLE_Linux 1
+_ACEOF
+
+           ;;
+       *)
+           { { $as_echo "$as_me:$LINENO: error: Could not determine man page file config format." >&5
+$as_echo "$as_me: error: Could not determine man page file config format." >&2;}
+   { (exit 1); exit 1; }; }
+    esac
+fi
+
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:$LINENO: checking for APPDEFS" >&5
+$as_echo_n "checking for APPDEFS... " >&6; }
+
+if test -n "$APPDEFS_CFLAGS"; then
+    pkg_cv_APPDEFS_CFLAGS="$APPDEFS_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_APPDEFS_CFLAGS=`$PKG_CONFIG --cflags "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$APPDEFS_LIBS"; then
+    pkg_cv_APPDEFS_LIBS="$APPDEFS_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_APPDEFS_LIBS=`$PKG_CONFIG --libs "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xt" 2>&1`
+        else
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --print-errors "xt" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$APPDEFS_PKG_ERRORS" >&5
+
+       { { $as_echo "$as_me:$LINENO: error: Package requirements (xt) were not met:
+
+$APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&5
+$as_echo "$as_me: error: Package requirements (xt) were not met:
+
+$APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_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
+       { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&5
+$as_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+else
+       APPDEFS_CFLAGS=$pkg_cv_APPDEFS_CFLAGS
+       APPDEFS_LIBS=$pkg_cv_APPDEFS_LIBS
+        { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       :
+fi
+xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+
+# Check whether --with-appdefaultdir was given.
+if test "${with_appdefaultdir+set}" = set; then
+  withval=$with_appdefaultdir; appdefaultdir="$withval"
+else
+  appdefaultdir="${xt_appdefaultdir}"
+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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     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" &&
+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+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_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_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
+  { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_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
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_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_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $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 || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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 ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by xman $as_me 1.1.0, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet, --silent
+                   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 <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+xman config.status 1.1.0
+configured by $0, generated by GNU Autoconf 2.63,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+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
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { $as_echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { $as_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"
+     ac_need_defaults=false ;;
+
+  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 || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr='\r'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+   { (exit 1); exit 1; }; }
+_ACEOF
+
+# 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
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #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.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
+$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
+   { (exit 1); exit 1; }; }
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      ac_file_inputs="$ac_file_inputs '$ac_f'"
+    done
+
+    # 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.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+       || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
+$as_echo "$as_me: error: could not create -" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$_am_arg" : 'X\(//\)[^/]' \| \
+        X"$_am_arg" : 'X\(//\)$' \| \
+        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_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=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+
+# 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
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/xman/configure.ac b/xman/configure.ac
new file mode 100644 (file)
index 0000000..619b033
--- /dev/null
@@ -0,0 +1,144 @@
+
+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(xman, [1.1.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xman)
+AM_INIT_AUTOMAKE([dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require xorg-macros 1.3 or later: XORG_DEFAULT_OPTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+         [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.3)
+
+AM_CONFIG_HEADER(config.h)
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_CANONICAL_HOST
+
+XORG_DEFAULT_OPTIONS
+
+AC_CHECK_FUNC([mkstemp], 
+   AC_DEFINE(HAS_MKSTEMP,1,[Define to 1 if you have the "mkstemp" function.]))
+
+AC_ARG_WITH(helpdir,
+        AC_HELP_STRING([--with-helpdir=<path>],
+                       [Set default directory for xman.help (default: ${datadir}/X11)]),
+        [HELPDIR="$withval"],
+        [HELPDIR=${datadir}/X11])
+AC_SUBST([HELPDIR])
+
+AC_ARG_WITH(sysmanpath,
+        AC_HELP_STRING([--with-sysmanpath=<path>],
+                       [Set default system man page search path]),
+        [SYSMANPATH="$withval"], [])
+if test x$SYSMANPATH != x; then
+    AC_DEFINE_UNQUOTED(SYSMANPATH, "$SYSMANPATH", 
+       [Default system man page search path (default: none)])
+fi
+
+AC_ARG_WITH(localmanpath,
+        AC_HELP_STRING([--with-localmanpath=<path>],
+                       [Set default local man page search path]),
+        [LOCALMANPATH="$withval"], [])
+if test x$LOCALMANPATH != x; then
+    AC_DEFINE_UNQUOTED(LOCALMANPATH, "$LOCALMANPATH", 
+       [Default local man page search path (default: none)])
+fi
+
+# Checks for pkg-config packages
+PKG_CHECK_MODULES(XMAN, xaw7)
+
+AC_ARG_WITH(manconfig,
+        AC_HELP_STRING([--with-manconfig=<filename>],
+                       [Set default system man configuration file]),
+        [MANCONF="$withval"], [])
+if test x$MANCONF = x; then
+# Check for man page config files
+    AC_CHECK_FILE([/etc/man.conf], [MANCONF="/etc/man.conf"], 
+                  AC_CHECK_FILE([/etc/man.config], [MANCONF="/etc/man.config"], 
+                                AC_CHECK_FILE([/etc/manpath.config], [MANCONF="/etc/manpath.config"],
+                                              AC_CHECK_FILE([/usr/share/misc/man.conf], [MANCONF="/usr/share/misc/man.conf"]))))
+fi
+
+if test x$MANCONF != x ; then
+    AC_DEFINE_UNQUOTED(MANCONF, "$MANCONF", 
+       [Define to path to man config file if you have one])
+
+    # Try to determine format of config file
+    # would be better to somehow determine from the files themselves, but
+    # we'll guess based on pathname and OS for now (mirrors old Imake tests)
+    AC_MSG_CHECKING([man config file format])
+    if test x$MANCONF = x/etc/manpath.config ; then
+       MAN_CONFIG_STYLE="FreeBSD"
+    else
+       case $host_os in
+       *darwin* | *openbsd* | *netbsd* )
+           MAN_CONFIG_STYLE="OpenBSD"
+           ;;
+       *linux* | cygwin* )
+           MAN_CONFIG_STYLE="Linux"
+           ;;
+       *bsd* )
+           MAN_CONFIG_STYLE="BSD"
+           ;;
+       *)
+           ;;
+       esac
+    fi
+    AC_MSG_RESULT($MAN_CONFIG_STYLE)
+
+    case $MAN_CONFIG_STYLE in
+       FreeBSD)
+           AC_DEFINE([MANCONFIGSTYLE_FreeBSD],1,
+               [Define to 1 if you have FreeBSD format manpath.config])
+           ;;
+       OpenBSD)
+           AC_DEFINE([MANCONFIGSTYLE_OpenBSD],1,
+               [Define to 1 if you have OpenBSD format manpath.config])
+           ;;
+       BSD)
+           AC_DEFINE([MANCONFIGSTYLE_BSD],1,
+               [Define to 1 if you have BSD format manpath.config])
+           ;;
+       Linux)
+           AC_DEFINE([MANCONFIGSTYLE_Linux],1,
+               [Define to 1 if you have Linux format man.conf or man.config])
+           ;;
+       *)
+           AC_MSG_ERROR([Could not determine man page file config format.])
+    esac
+fi
+AC_SUBST(XMAN_CFLAGS)
+AC_SUBST(XMAN_LIBS)
+
+PKG_CHECK_MODULES(APPDEFS, xt)
+xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+AC_ARG_WITH(appdefaultdir,
+       AC_HELP_STRING([--with-appdefaultdir=<pathname>],
+         [specify directory for app-defaults files (default is autodetected)]),
+       [appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"])
+AC_SUBST(appdefaultdir)
+
+AC_OUTPUT([Makefile])
diff --git a/xman/defs.h b/xman/defs.h
new file mode 100644 (file)
index 0000000..ec4d068
--- /dev/null
@@ -0,0 +1,146 @@
+/* $XConsortium: defs.h,v 1.25 94/04/17 20:43:50 converse Exp $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86: xc/programs/xman/defs.h,v 1.2 2000/03/03 23:16:26 dawes Exp $ */
+
+/*
+ * xman - X window system manual page display program.
+ * Author:    Chris D. Peterson, MIT Project Athena
+ * Created:   October 22, 1987
+ */
+
+#ifndef HELPFILE
+#define HELPFILE "/usr/lib/X11/xman.help" /* name of the default helpfile. */ 
+#endif
+
+/* The default cursors */
+
+#define XMAN_CURSOR "left_ptr"         /* Top level cursor. */
+#define HELP_CURSOR "left_ptr"         /* The help cursor. */
+#define MANPAGE_CURSOR "left_ptr"      /* The manpage cursor. */
+#define SEARCH_ENTRY_CURSOR "question_arrow"   /* The search text widget
+                                                  cursor. */
+#define DIRECTORY_NORMAL "fixed" /* The default dir font */
+
+#define OPTION_MENU "optionMenu" /* Name of the Option Menu. */
+#define SECTION_MENU "sectionMenu" /* Name of the Section Menu. */
+
+#define HELP_BUTTON "helpButton" /* Name of top help button */
+#define QUIT_BUTTON "quitButton" /* Name of top quit button */
+#define MANPAGE_BUTTON "manpageButton" /* Name of top manpage button */
+
+#define TOPBOXNAME  "topBox"   /* Name of the Top Box. */
+#define MANNAME "manualBrowser"        /* name for each manual page widget. */
+#define SEARCHNAME "search" /* The name for the search widget. */
+#define HELPNAME  "help"       /* The name of the help widget. */
+#define DIRECTORY_NAME "directory" /* name of the directory widget. */
+#define MANUALPAGE "manualPage"        /* name of the Scrollbyline widget that
+                                contains the man page. */
+#define DIALOG         "dialog"
+
+/* Names of the menu buttons */
+
+#ifdef INCLUDE_XPRINT_SUPPORT
+#define NUM_OPTIONS 10         /* Number of menu options. */
+#else /* !INCLUDE_XPRINT_SUPPORT */
+#define NUM_OPTIONS 9          /* Number of menu options. */
+#endif /* !INCLUDE_XPRINT_SUPPORT */
+
+#define DIRECTORY      "displayDirectory"
+#define MANPAGE        "displayManualPage"
+#define HELP           "help"
+#define SEARCH         "search"
+#define BOTH_SCREENS   "showBothScreens"
+#define REMOVE_MANPAGE "removeThisManpage"
+#define OPEN_MANPAGE   "openNewManpage"
+#ifdef INCLUDE_XPRINT_SUPPORT
+#define PRINT_MANPAGE  "printManualPage"
+#endif /* INCLUDE_XPRINT_SUPPORT */
+#define SHOW_VERSION   "showVersion"
+#define QUIT           "quit"
+
+/* definitions of string to use for show both and show one. */
+
+#define SHOW_BOTH "Show Both Screens"
+#define SHOW_ONE "Show One Screen"
+
+/* 
+ * Things will not look right if you change these names to make 
+ * MANUALSEARCH longer APROPOSSEARCH, see search.c for details.
+ */
+
+#define MANUALSEARCH "manualPage"
+#define APROPOSSEARCH "apropos"
+#define CANCEL "cancel"
+
+#define MANUAL 0
+#define APROPOS 1
+
+#define NO_SECTION_DEFAULTS ("no default sections")
+
+/*
+ * Define HANDLE_ROFFSEQ to enable parsing of '\" <string>
+ * sequences in source files to set the format pipeline.
+ * This is necessary because the default pipeline causes incorrect
+ * display of ascii(7) on Linux.
+ * This depends on GNU roff.
+ */
+#ifdef HAS_GROFF
+#define HANDLE_ROFFSEQ
+#endif
+
+#define DEFAULT_WIDTH 500      /* The default width of xman. */
+#define SECTALLOC  8           /* The number of entries allocated
+                                  at a time for the manual structures. */
+#define ENTRYALLOC 100         /* The number of entries allocated
+                                  at a time for a section. */
+
+#define INITIAL_DIR 0          /* The Initial Directory displayed. */
+
+#define COPY "cp"              /* copy command */
+#define CHMOD_MODE 00666       /* permissions set on saved formatted files */
+#define MANDESC "mandesc"      /* name of the mandesc files */
+
+#define INDENT 15
+#define TYP20STR "MMMMMMMMMMMMMMMMMMMM"
+
+#define FILE_SAVE "yes"
+#define CANCEL_FILE_SAVE "no"
+#define MANTEMP "/tmp/xmanXXXXXX"
+
+/*
+ * Macro Definitions.
+ */
+
+#define streq(a, b)        ( strcmp((a), (b)) == 0 )
+
+/* 
+ * Function definitions moved to man.h
+ */
diff --git a/xman/depcomp b/xman/depcomp
new file mode 100755 (executable)
index 0000000..df8eea7
--- /dev/null
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s,\\\\\\\\,/,g"
+   depmode=msvisualcpp
+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.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    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.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[     ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "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"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${
+              s/^ *//
+              s/ \\*$//
+              s/$/:/
+              p
+            }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # 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 mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $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 "X$1" != 'X--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 "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    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.
+    -arch)
+      eat=yes ;;
+    -*|$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 "X$1" != 'X--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.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::     \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # 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
+  ;;
+
+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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xman/globals.c b/xman/globals.c
new file mode 100644 (file)
index 0000000..e880953
--- /dev/null
@@ -0,0 +1,54 @@
+/* $XConsortium: globals.c,v 1.9 94/04/17 20:43:51 rws Exp $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+
+
+#include "man.h"
+
+Xman_Resources resources;      /* Resource manager sets these. */
+
+/* bookkeeping global variables. */
+
+Widget help_widget;            /* The help widget. */
+
+int default_height,default_width; /* Approximately the default with and
+                                           height, of the manpage when shown,
+                                           the the top level manual page 
+                                           window */
+
+Manual * manual;               /* The manual structure. */
+int sections;                  /* The number of manual sections. */
+
+int man_pages_shown;           /* The current number of manual
+                                  pages being shown, if 0 we exit. */
+
+Widget initial_widget;         /* The initial widget, never realized. */
+
+XContext manglobals_context;   /* The context for man_globals. */
diff --git a/xman/globals.h b/xman/globals.h
new file mode 100644 (file)
index 0000000..abbf66d
--- /dev/null
@@ -0,0 +1,65 @@
+/* $XConsortium: globals.h,v 1.9 94/04/17 20:43:51 dave Exp $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86$ */
+
+#ifndef _globals_h
+#define _globals_h
+
+#include "man.h"
+
+extern Xman_Resources resources;       /* Resource manager sets these. */
+
+/* bookkeeping global variables. */
+
+extern Widget help_widget;             /* The help widget. */
+
+extern int default_height,default_width; /* Approximately the default with and
+                                           height, of the manpage when shown,
+                                           the the top level manual page 
+                                           window */
+extern int man_pages_shown;            /* The current number of manual
+                                          pages being shown, if 0 we exit. */
+
+extern Manual * manual;                        /* The manual structure. */
+extern int sections;                   /* The number of manual sections. */
+
+extern XContext manglobals_context;    /* The context for man_globals. */
+
+extern Widget initial_widget;        /* The initial widget, never realized. */
+
+extern char **saved_argv;
+extern int saved_argc;
+
+extern Atom wm_delete_window;
+
+extern Widget top;
+
+#endif /* _globals_h */
diff --git a/xman/handler.c b/xman/handler.c
new file mode 100644 (file)
index 0000000..497a768
--- /dev/null
@@ -0,0 +1,724 @@
+/* $XConsortium: handler.c,v 1.22 94/12/16 21:36:53 gildea Exp $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86: xc/programs/xman/handler.c,v 1.6 2003/01/19 04:44:45 paulo Exp $ */
+
+/*
+ * xman - X window system manual page display program.
+ * Author:    Chris D. Peterson, MIT Project Athena
+ * Created:   October 29, 1987
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include "globals.h"
+#include "vendor.h"
+#ifdef INCLUDE_XPRINT_SUPPORT
+#include "printdialog.h"
+#include "print.h"
+#endif /* INCLUDE_XPRINT_SUPPORT */
+
+static void PutUpManpage(ManpageGlobals * man_globals, FILE * file);
+static void ToggleBothShownState(ManpageGlobals * man_globals);
+
+/*     Function Name: OptionCallback
+ *     Description: This is the callback function for the callback menu.
+ *     Arguments: w - the widget we are calling back from. 
+ *                 globals_pointer - a pointer to the psuedo globals structure
+ *                                  for this manpage.
+ *                 junk - (call data) not used.
+ *     Returns: none.
+ */
+
+/*ARGSUSED*/
+void
+OptionCallback(Widget w, XtPointer pointer, XtPointer junk)
+{
+  ManpageGlobals * man_globals = (ManpageGlobals *) pointer;
+  String params;
+  Cardinal num_params = 1;
+
+  if ( w == man_globals->search_entry )
+    PopupSearch(XtParent(w), NULL, NULL, NULL);
+  else if (w == man_globals->dir_entry) {       /* Put Up Directory */
+    params = "Directory";
+    GotoPage(XtParent(w), NULL, &params, &num_params);
+  }
+  else if (w == man_globals->manpage_entry ) {  /* Put Up Man Page */
+    params = "ManualPage";
+    GotoPage(XtParent(w), NULL, &params, &num_params);
+  }
+  else if ( w == man_globals->help_entry )      /* Help */
+    PopupHelp(XtParent(w), NULL, NULL, NULL);
+  else if ( w == man_globals->both_screens_entry ) /*Toggle Both_Shown State.*/
+    ToggleBothShownState(man_globals);
+  else if ( w == man_globals->remove_entry)     /* Kill the manpage */
+    RemoveThisManpage(XtParent(w), NULL, NULL, NULL);
+  else if ( w == man_globals->open_entry)       /* Open new manpage */
+    CreateNewManpage(XtParent(w), NULL, NULL, NULL);
+#ifdef INCLUDE_XPRINT_SUPPORT
+  else if ( w == man_globals->print_entry)    /* Print current manpage */
+    PrintThisManpage(XtParent(w), NULL, NULL, NULL);
+#endif /* INCLUDE_XPRINT_SUPPORT */
+  else if ( w == man_globals->version_entry)    /* Get version */
+    ShowVersion(XtParent(w), NULL, NULL, NULL);
+  else if ( w == man_globals->quit_entry)      /* Quit. */
+    Quit(XtParent(w), NULL, NULL, NULL);
+}
+
+/*      Function Name: ToggleBothShownState;
+ *      Description: toggles the state of the both shown feature.
+ *      Arguments: man_globals - the man globals structure.
+ *      Returns: none.
+ */
+
+/*
+ * I did not have a two state widget, which is the way this
+ * should really be done.  1/22/88 - CDP.
+ */
+
+static void
+ToggleBothShownState(ManpageGlobals * man_globals)
+{
+  char * label_str;
+  Arg arglist[1];
+
+  if (man_globals->both_shown == TRUE) {
+    label_str = SHOW_BOTH;
+    if (man_globals->dir_shown)
+      XtUnmanageChild(man_globals->manpagewidgets.manpage);
+    else
+      XtUnmanageChild(man_globals->manpagewidgets.directory);
+  }
+  else {
+    Widget manpage = man_globals->manpagewidgets.manpage;
+    Widget dir = man_globals->manpagewidgets.directory;
+    
+    label_str = SHOW_ONE;
+
+    XtSetArg(arglist[0], XtNpreferredPaneSize, resources.directory_height);
+    XtSetValues(dir, arglist, (Cardinal) 1);
+
+    if (!man_globals->dir_shown) {
+      XtUnmanageChild(manpage);
+      XtManageChild(dir);
+    }
+    XtManageChild(manpage);
+  }
+  man_globals->both_shown = !man_globals->both_shown;
+  
+  if (man_globals->dir_shown)
+    ChangeLabel(man_globals->label,
+               man_globals->section_name[man_globals->current_directory]);
+  else
+    ChangeLabel(man_globals->label, man_globals->manpage_title);
+  
+  XtSetArg(arglist[0], XtNlabel, label_str);
+  XtSetValues(man_globals->both_screens_entry, arglist, ONE);
+  
+  /* if both are shown there is no need to switch between the two. */
+
+  XtSetArg(arglist[0], XtNsensitive, !man_globals->both_shown);
+  XtSetValues(man_globals->manpage_entry, arglist, ONE);
+  XtSetValues(man_globals->dir_entry, arglist, ONE);
+}
+
+/*     Function Name: Popup
+ *     Description: This function pops up the given widget under the cursor.
+ *     Arguments: w - the widget to popup.
+ *                 grab_kind - the kind of grab to register.
+ *     Returns: none
+ */
+
+/* How far off the top of the widget to have the initial cursor postion. */
+
+#define OFF_OF_TOP 25
+
+void
+Popup(Widget w, XtGrabKind grab_kind)
+{
+  int x_root,y_root,y_pos,garbage;
+  unsigned int mask;
+  Window junk_window;
+
+  XQueryPointer(XtDisplay(w), XtWindow(w), &junk_window, &junk_window,
+               &x_root, &y_root, &garbage, &garbage, &mask);
+
+  y_pos = OFF_OF_TOP - Height(w)/2 - BorderWidth(w);
+  PositionCenter(w, x_root, y_root, y_pos, 0, 2, 2);
+  XtPopup(w, grab_kind);
+}
+
+/*     Function Name: PutUpManpage
+ *     Description: Puts the manpage on the display.
+ *     Arguments: man_globals - a pointer to the psuedo globals structure
+ *                                  for this manpage.
+ *                 file - the file to display.
+ *     Returns: none.
+ */
+
+static void
+PutUpManpage(ManpageGlobals * man_globals, FILE * file)
+{
+  String params = "ManualPage";
+  Cardinal num_params = 1;
+  
+  if (file == NULL)
+    return;
+
+  OpenFile(man_globals, file);
+
+  if (!man_globals->both_shown) {
+    Arg arglist[1];
+    XtSetArg(arglist[0], XtNsensitive, TRUE);
+    XtSetValues(man_globals->manpage_entry, arglist, ONE);
+    XtSetValues(man_globals->both_screens_entry, arglist, ONE);
+  }
+  GotoPage(man_globals->manpagewidgets.manpage, NULL, &params, &num_params);
+}
+
+/*     Function Name: DirectoryHandler
+ *     Description: This is the callback function for the directory listings.
+ *     Arguments: w - the widget we are calling back from. 
+ *                 global_pointer - the pointer to the psuedo global structure
+ *                                  associated with this manpage.
+ *                 ret_val - return value from the list widget.
+ *     Returns: none.
+ */
+
+void
+DirectoryHandler(Widget w, XtPointer global_pointer, XtPointer ret_val)
+{
+  FILE * file;                 /* The manpage file. */
+  ManpageGlobals * man_globals = (ManpageGlobals *) global_pointer;
+  XawListReturnStruct * ret_struct = (XawListReturnStruct *) ret_val;
+
+  file = FindManualFile(man_globals, man_globals->current_directory,
+                       ret_struct->list_index);
+  PutUpManpage(man_globals, file);
+  if ((file != NULL) && (file != man_globals->curr_file)) {
+    fclose(file);
+  }
+}
+
+/*     Function Name: DirPopupCallback
+ *     Description: This is the callback function for the callback menu.
+ *     Arguments: w - the widget we are calling back from. 
+ *                 pointer - a pointer to the psuedo globals structure
+ *                                  for this manpage.
+ *                 junk - (call data) not used.
+ *     Returns: none.
+ */
+
+/*ARGSUSED*/
+void
+DirPopupCallback(Widget w, XtPointer pointer, XtPointer junk)
+{
+  ManpageGlobals * man_globals; 
+  MenuStruct * menu_struct;
+  Widget parent;
+  int number;
+  int current_box;
+
+  menu_struct = (MenuStruct *) pointer;
+  man_globals = (ManpageGlobals *) menu_struct->data;
+
+  number = menu_struct->number;
+  current_box = man_globals->current_directory;
+
+  /* We have used this guy, pop down the menu. */
+  
+  if (number != current_box) {
+    /* This is the only one that we know has a parent. */
+    parent = XtParent(man_globals->manpagewidgets.box[INITIAL_DIR]);
+
+    MakeDirectoryBox(man_globals, parent,
+                    man_globals->manpagewidgets.box + number, number);
+    XtUnmanageChild(man_globals->manpagewidgets.box[current_box]);
+    XtManageChild(man_globals->manpagewidgets.box[number]);
+
+    XawListUnhighlight(man_globals->manpagewidgets.box[current_box]);
+    ChangeLabel(man_globals->label, man_globals->section_name[number]);
+    man_globals->current_directory = number;
+  }
+
+  /* put up directory. */
+  if (!man_globals->both_shown) {
+    XtUnmanageChild(man_globals->manpagewidgets.manpage);
+    XtManageChild(man_globals->manpagewidgets.directory);
+  }
+}
+    
+/************************************************************
+ *
+ * Action Routines.
+ *
+ ************************************************************/
+
+/*     Function Name: SaveFormattedPage
+ *     Description: This is the action routine may save the manpage.
+ *      Arguments: w - any widget in the widget tree.
+ *                 event - NOT USED.
+ *                 params, num_params - the parameters paseed to the action
+ *                                      routine, can be either Manpage or
+ *                                      Directory.
+ *      Returns: none.
+ */
+
+/*ARGSUSED*/
+void
+SaveFormattedPage(Widget w, XEvent * event, String * params, Cardinal * num_params)
+{
+  ManpageGlobals * man_globals;
+  char cmdbuf[BUFSIZ], error_buf[BUFSIZ];
+
+  if (*num_params != 1) {
+    XtAppWarning(XtWidgetToApplicationContext(w), 
+       "Xman - SaveFormattedPage: This action routine requires one argument.");
+    return;
+  }
+
+  man_globals = GetGlobals(w);
+
+/*
+ * If we are not active then take no action.
+ */
+
+  if (man_globals->tempfile == NULL) return;
+
+  switch (params[0][0]) {
+  case 'S':
+  case 's':
+
+#ifndef NO_COMPRESS
+    if (!man_globals->compress)
+#endif
+
+      sprintf(cmdbuf, "%s %s %s", COPY, man_globals->tempfile, 
+             man_globals->save_file);
+
+#ifndef NO_COMPRESS
+    else
+      if (man_globals->gzip)
+       sprintf(cmdbuf, "%s < %s > %s", GZIP_COMPRESS, man_globals->tempfile,
+               man_globals->save_file);
+      else
+       sprintf(cmdbuf, "%s < %s > %s", COMPRESS, man_globals->tempfile, 
+               man_globals->save_file);
+#endif
+
+    if(! system(cmdbuf)) {
+       /* make sure the formatted man page is fully accessible by the world */
+       if (chmod(man_globals->save_file, CHMOD_MODE) != 0) {
+           sprintf(error_buf,
+                   "Couldn't set permissions on formatted man page '%s'.\n",
+                   man_globals->save_file);
+           PopupWarning( man_globals, error_buf);
+       }
+    } else {
+       sprintf(error_buf, "Error while executing the command '%s'.\n",
+               cmdbuf);
+       PopupWarning( man_globals, error_buf);
+    }
+    break;
+  case 'C':
+  case 'c':
+    break;
+  default:
+    sprintf(error_buf,"%s %s", "Xman - SaveFormattedPagee:",
+           "Unknown argument must be either 'Save' or 'Cancel'.");
+    PopupWarning(man_globals, error_buf);
+    return;
+  }
+    
+/*
+ * We do not need the filename anymore, and have the fd open.
+ * We will unlink it.     
+ */
+
+  unlink(man_globals->tempfile);
+  XtPopdown( XtParent(XtParent(w)) );
+}
+
+/*      Function Name: GotoPage
+ *      Description: The Action routine that switches over to the manpage
+ *                   or directory.
+ *      Arguments: w - any widget in the widget tree.
+ *                 event - NOT USED.
+ *                 params, num_params - the parameters paseed to the action
+ *                                      routine, can be either Manpage or
+ *                                      Directory.
+ *      Returns: none.
+ */
+
+/*ARGSUSED*/
+void
+GotoPage(Widget w, XEvent * event, String * params, Cardinal * num_params)
+{
+  ManpageGlobals * man_globals;
+  char error_buf[BUFSIZ];
+  Arg arglist[1];
+  Boolean sensitive;
+
+  if (*num_params != 1) {
+    XtAppWarning(XtWidgetToApplicationContext(w), 
+               "Xman - GotoPage: This action routine requires one argument.");
+    return;
+  }
+
+  man_globals = GetGlobals(w);
+
+  if (man_globals->both_shown) {
+    ChangeLabel(man_globals->label, 
+               man_globals->section_name[man_globals->current_directory]);
+    return;
+  }
+
+  switch (params[0][0]) {
+  case 'M':
+  case 'm':
+    XtSetArg(arglist[0], XtNsensitive, &sensitive);
+    XtGetValues(man_globals->manpage_entry, arglist, ONE);
+    if (sensitive) {
+      ChangeLabel(man_globals->label,man_globals->manpage_title);
+      XtUnmanageChild(man_globals->manpagewidgets.directory);
+      XtManageChild(man_globals->manpagewidgets.manpage);
+      man_globals->dir_shown = FALSE;
+    }
+    break;
+  case 'D':
+  case 'd':
+    ChangeLabel(man_globals->label,
+               man_globals->section_name[man_globals->current_directory]);
+    XtUnmanageChild(man_globals->manpagewidgets.manpage);
+    XtManageChild(man_globals->manpagewidgets.directory);  
+    man_globals->dir_shown = TRUE;
+    break;
+  default:
+    sprintf(error_buf,"%s %s", "Xman - GotoPage: Unknown argument must be",
+           "either Manpage or Directory.");
+    XtAppWarning(XtWidgetToApplicationContext(w), error_buf);
+    return;
+  }
+}
+
+/*      Function Name: Quit.
+ *      Description: Quits Xman.
+ *      Arguments: w - any widget.
+ *                 event - NOT USED.
+ *                 params, num_params - NOT USED.
+ *      Returns: none.
+ */
+
+/*ARGSUSED*/
+void 
+Quit(Widget w, XEvent * event, String * params, Cardinal * num_params)
+{
+  XtAppSetExitFlag(XtWidgetToApplicationContext(w));
+}
+
+/*      Function Name: PopupHelp
+ *      Description: Pops up xman's help.
+ *      Arguments: w - NOT USED.
+ *                 event - NOT USED.
+ *                 params, num_params - NOT USED.
+ *      Returns: none.
+ */
+
+/*ARGSUSED*/
+void 
+PopupHelp(Widget w, XEvent * event, String * params, Cardinal * num_params)
+{
+  if (MakeHelpWidget())
+    XtPopup(help_widget,XtGrabNone);
+}
+
+/*      Function Name: PopupSearch
+ *      Description: Pops up this manual pages search widget.
+ *      Arguments: w - any widget in this manpage.
+ *                 event - NOT USED.
+ *                 params, num_params - NOT USED.
+ *      Returns: none.
+ */
+
+/*ARGSUSED*/
+void 
+PopupSearch(Widget w, XEvent * event, String * params, Cardinal * num_params)
+{
+  ManpageGlobals * man_globals = GetGlobals(w);
+
+  if (man_globals->search_widget) {
+    if (!XtIsRealized(man_globals->search_widget)) {
+      XtRealizeWidget(man_globals->search_widget);
+      AddCursor(man_globals->search_widget, resources.cursors.search_entry);
+    }
+    Popup(man_globals->search_widget, XtGrabNone);
+  }
+}
+
+/*      Function Name: CreateNewManpage
+ *      Description: Creates A New Manual Page.
+ *      Arguments: w - NOT USED.
+ *                 event - NOT USED.
+ *                 params, num_params - NOT USED.
+ *      Returns: none.
+ */
+
+/*ARGSUSED*/
+void 
+CreateNewManpage(Widget w, XEvent * event, String * params, Cardinal * num_params)
+{
+  (void) CreateManpage(NULL);
+  man_pages_shown++;
+}
+
+/*      Function Name: RemoveThisManpage
+ *      Description: Removes a manual page.
+ *      Arguments: w - any widget in the manpage.
+ *                 event - NOT USED.
+ *                 params, num_params - NOT USED.
+ *      Returns: none.
+ */
+
+/*ARGSUSED*/
+void 
+RemoveThisManpage(Widget w, XEvent * event, String * params, Cardinal * num_params)
+{
+  ManpageGlobals * man_globals = GetGlobals(w);
+  
+  if (man_globals->This_Manpage != help_widget) {
+    RemoveGlobals(man_globals->This_Manpage);
+    XtDestroyWidget(man_globals->This_Manpage);
+
+    XtFree( (char *) man_globals->section_name);
+    XtFree( (char *) man_globals->manpagewidgets.box);
+    XtFree( (char *) man_globals);
+
+    if ( (--man_pages_shown) == 0)
+      Quit(w, NULL, NULL, NULL);  
+  }
+  else
+    XtPopdown(help_widget);
+}
+
+/*      Function Name: Search
+ *      Description: Actually performs a search.
+ *      Arguments: w - any widget in the manpage.
+ *                 event - NOT USED.
+ *                 params, num_params - NOT USED.
+ *      Returns: none.
+ */
+
+/*ARGSUSED*/
+void 
+Search(Widget w, XEvent * event, String * params, Cardinal * num_params)
+{
+  ManpageGlobals * man_globals = GetGlobals(w);
+  FILE * file = NULL;
+
+  XtPopdown(  XtParent(XtParent(w)) );       /* popdown the search widget */
+
+  if ( (*num_params < 1) || (*num_params > 2) ) {
+    XtAppWarning(XtWidgetToApplicationContext(w), 
+      "Xman - Search: This action routine requires one or two arguments.");
+    return;
+  }
+
+  switch(params[0][0]) {
+  case 'a':
+  case 'A':
+    file = DoSearch(man_globals,APROPOS);
+    break;
+  case 'm':
+  case 'M':
+    file = DoSearch(man_globals,MANUAL);
+    break;
+  case 'c':
+  case 'C':
+    file = NULL;
+    break;
+  default:
+    XtAppWarning(XtWidgetToApplicationContext(w), 
+                "Xman - Search: First parameter unknown.");
+    file = NULL;
+    break;
+  }
+
+  if ( *num_params == 2 ) 
+    switch (params[1][0]) {
+    case 'O':
+    case 'o':
+      if (file != NULL) {
+       Widget w;
+       char * label;
+
+       w = CreateManpage(file);
+       man_pages_shown++;
+
+       /* Put title into new manual page. */
+
+       label = man_globals->manpage_title;
+       man_globals = GetGlobals(w);
+       strcpy(man_globals->manpage_title, label);
+       ChangeLabel(man_globals->label, label);
+      }
+      break;
+    default:
+      XtAppWarning(XtWidgetToApplicationContext(w), 
+                  "Xman - Search: Second parameter unknown.");
+      break;
+    }
+  else {
+    PutUpManpage(man_globals, file);
+  }
+  if ((file != NULL) && (file != man_globals->curr_file)) {
+    fclose(file);
+  }
+}
+
+#ifdef INCLUDE_XPRINT_SUPPORT
+static void
+printshellDestroyXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+  ManpageGlobals *mg = GetGlobals(w);
+  XawPrintDialogClosePrinterConnection(mg->printdialog, False);
+}
+
+static void
+printOKXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+  XawPrintDialogCallbackStruct *pdcs = (XawPrintDialogCallbackStruct *)callData;
+  Cardinal                      n;
+  Arg                           args[2];
+  ManpageGlobals               *mg = GetGlobals(w);
+  Widget                        topwindow = mg->This_Manpage;
+  FILE                         *file;
+
+  Log(("printOKXtProc: OK.\n"));
+  
+  /* Get file object */
+  n = 0;
+  XtSetArg(args[n], XtNfile, &file); n++;
+  XtGetValues(mg->manpagewidgets.manpage, args, n);
+  Assertion(file != NULL, (("printOKXtProc: file == NULL.\n")));
+  
+  DoPrintManpage("Xman",
+                 file, topwindow,
+                 pdcs->pdpy, pdcs->pcontext, pdcs->colorspace,
+                 printshellDestroyXtProc,
+                 mg->manpage_title,
+                 pdcs->printToFile?pdcs->printToFileName:NULL);
+
+  XtPopdown(mg->printdialog_shell);
+}
+
+static void
+printCancelXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    ManpageGlobals * mg = GetGlobals(w);
+
+    Log(("printCancelXtProc: cancel.\n"));
+    XtPopdown(mg->printdialog_shell);
+    
+    Log(("destroying print dialog shell...\n"));
+    XtDestroyWidget(mg->printdialog_shell);
+    mg->printdialog_shell = NULL;
+    mg->printdialog       = NULL;
+    Log(("... done\n"));
+}
+
+/*      Function Name: PrintThisManpage
+ *      Description: Print the current manual page.
+ *      Arguments: mg - manpage globals
+ *      Returns: none.
+ */
+
+/*ARGSUSED*/
+void 
+PrintThisManpage(Widget w, XEvent * event, String * params, Cardinal * num_params)
+{
+  ManpageGlobals *mg = GetGlobals(w);
+  Dimension       width, height;
+  Position        x, y;
+  Widget          parent    = mg->This_Manpage;
+  Widget          topwindow = mg->This_Manpage;
+  Log(("print!\n"));
+  
+  if (!mg->printdialog) {
+    int n;
+    Arg args[20];
+
+    n = 0;
+    XtSetArg(args[n], XtNallowShellResize, True); n++;
+    mg->printdialog_shell = XtCreatePopupShell("printdialogshell",
+                                               transientShellWidgetClass,
+                                               topwindow, args, n);
+    n = 0;
+    mg->printdialog = XtCreateManagedWidget("printdialog", printDialogWidgetClass,
+                                            mg->printdialog_shell, args, n);
+    XtAddCallback(mg->printdialog, XawNOkCallback,     printOKXtProc,     NULL);
+    XtAddCallback(mg->printdialog, XawNCancelCallback, printCancelXtProc, NULL);
+
+    XtRealizeWidget(mg->printdialog_shell);
+  }
+
+  /* Center dialog */
+  XtVaGetValues(mg->printdialog_shell,
+      XtNwidth,  &width,
+      XtNheight, &height,
+      NULL);
+
+  x = (Position)(XWidthOfScreen( XtScreen(parent)) - width)  / 2;
+  y = (Position)(XHeightOfScreen(XtScreen(parent)) - height) / 3;
+
+  XtVaSetValues(mg->printdialog_shell,
+      XtNx, x,
+      XtNy, y,
+      NULL);
+        
+  XtPopup(mg->printdialog_shell, XtGrabNonexclusive);
+}
+#endif /* INCLUDE_XPRINT_SUPPORT */
+
+/*      Function Name: ShowVersion
+ *      Description: Show current version.
+ *      Arguments: w - any widget in the manpage.
+ *                 event - NOT USED.
+ *                 params, num_params - NOT USED.
+ *      Returns: none.
+ */
+
+/*ARGSUSED*/
+void 
+ShowVersion(Widget w, XEvent * event, String * params, Cardinal * num_params)
+{
+  ManpageGlobals * man_globals = GetGlobals(w);
+  ChangeLabel(man_globals->label, XMAN_VERSION);
+}
diff --git a/xman/help.c b/xman/help.c
new file mode 100644 (file)
index 0000000..c9d9aa9
--- /dev/null
@@ -0,0 +1,108 @@
+/* $XConsortium: help.c,v 1.10 94/04/17 20:43:53 dave Exp $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86$ */
+
+/*
+ * xman - X window system manual page display program.
+ * Author:    Chris D. Peterson, MIT Project Athena
+ * Created:   January 19, 1988
+ */
+
+#include "globals.h"
+
+/*     Function Name: MakeHelpWidget.
+ *     Description: This function creates the help widget so that it will be
+ *                   ready to be displayed.
+ *     Arguments: none.
+ *     Returns: none.
+ */
+
+Boolean
+MakeHelpWidget(void)
+{
+
+  ManpageGlobals * man_globals;        /* The psuedo global structure. */
+  
+  if (help_widget != NULL)     /* If we already have a help widget. 
+                                  then do not create one. */
+    return(TRUE);
+
+  man_globals = InitPsuedoGlobals();
+
+  CreateManpageWidget(man_globals, HELPNAME, FALSE);
+  help_widget = man_globals->This_Manpage;
+
+  if (OpenHelpfile(man_globals) == FALSE) {
+    XtDestroyWidget(help_widget);
+    help_widget = NULL;
+    return(FALSE);
+  }
+
+  ChangeLabel(man_globals->label, "Xman Help");
+
+  XtManageChild( man_globals->manpagewidgets.manpage );
+  XtRealizeWidget(  help_widget );
+  SaveGlobals( man_globals->This_Manpage, man_globals );
+  AddCursor( help_widget, resources.cursors.manpage);
+
+/*
+ * Set up ICCCM delete window.
+ */
+  XtOverrideTranslations
+      (man_globals->This_Manpage, 
+       XtParseTranslationTable ("<Message>WM_PROTOCOLS: RemoveThisManpage()"));
+  (void) XSetWMProtocols (XtDisplay(man_globals->This_Manpage),
+                         XtWindow(man_globals->This_Manpage),
+                         &wm_delete_window, 1);
+
+  return(TRUE);
+}
+
+/*     Function Name: OpenHelpfile
+ *     Description: opens the helpfile.
+ *     Arguments: man_globals - the psuedo globals structure.
+ *     Returns: False if no helpfile was found.
+ */
+
+Boolean
+OpenHelpfile(ManpageGlobals * man_globals)
+{
+  FILE * help_file_ptr;
+
+  if( (help_file_ptr = fopen(resources.help_file, "r")) == NULL ) {
+    PopupWarning(man_globals,
+                "Could not open help file, NO HELP WILL BE AVALIABLE.");
+    return(FALSE);
+  }
+    
+  OpenFile(man_globals, help_file_ptr);
+  return(TRUE);
+}
diff --git a/xman/icon_help.h b/xman/icon_help.h
new file mode 100644 (file)
index 0000000..228c3c7
--- /dev/null
@@ -0,0 +1,50 @@
+/* $XConsortium: icon_help.h,v 1.5 94/04/17 20:43:54 rws Exp $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+
+/*
+ * xman - X window system manual page display program.
+ * Author:    Chris D. Peterson, MIT Project Athena
+ * Created:   August 15, 1988
+ */
+
+#define icon_help_width 30
+#define icon_help_height 30
+static unsigned char icon_help_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xf0, 0x00, 0xf8, 0xdf, 0xfe, 0x07,
+   0x3e, 0xfc, 0x0f, 0x1f, 0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18,
+   0x06, 0xe0, 0x03, 0x18, 0x06, 0xf0, 0x07, 0x18, 0x06, 0x18, 0x0c, 0x18,
+   0x06, 0x0c, 0x18, 0x18, 0x06, 0x0c, 0x18, 0x18, 0x06, 0x0c, 0x18, 0x18,
+   0x06, 0x00, 0x18, 0x18, 0x06, 0x00, 0x18, 0x18, 0x06, 0x00, 0x0c, 0x18,
+   0x06, 0x80, 0x07, 0x18, 0x06, 0xc0, 0x03, 0x18, 0x06, 0xc0, 0x00, 0x18,
+   0x06, 0xc0, 0x00, 0x18, 0x06, 0xc0, 0x00, 0x18, 0x06, 0xc0, 0x00, 0x18,
+   0x06, 0x00, 0x00, 0x18, 0x06, 0x00, 0x00, 0x18, 0x06, 0xc0, 0x00, 0x18,
+   0x06, 0xc0, 0x00, 0x18, 0xc6, 0x03, 0xf0, 0x18, 0xfe, 0x1f, 0xfe, 0x1f,
+   0x3e, 0xfc, 0x0f, 0x1f, 0x06, 0xc0, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00};
diff --git a/xman/icon_open.h b/xman/icon_open.h
new file mode 100644 (file)
index 0000000..b47b1d1
--- /dev/null
@@ -0,0 +1,50 @@
+/* $XConsortium: icon_open.h,v 1.5 94/04/17 20:43:54 rws Exp $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+
+/*
+ * xman - X window system manual page display program.
+ * Author:    Chris D. Peterson, MIT Project Athena
+ * Created:   January 29, 1988
+ */
+
+#define icon_open_width 30
+#define icon_open_height 30
+static unsigned char icon_open_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xf0, 0x00, 0xf8, 0xdf, 0xfe, 0x07,
+   0x3e, 0xfc, 0x0f, 0x1f, 0x06, 0x00, 0x00, 0x18, 0x06, 0x30, 0x03, 0x18,
+   0xc6, 0x31, 0xe3, 0x18, 0x36, 0x32, 0x13, 0x1b, 0x06, 0x30, 0x03, 0x18,
+   0xc6, 0xf1, 0xe3, 0x18, 0x36, 0xe2, 0x11, 0x1b, 0x06, 0x00, 0x00, 0x18,
+   0xc6, 0xf1, 0xe3, 0x18, 0x36, 0x32, 0x13, 0x1b, 0x06, 0x30, 0x03, 0x18,
+   0xc6, 0xf1, 0xe3, 0x18, 0x36, 0x32, 0x10, 0x1b, 0x06, 0x30, 0x00, 0x18,
+   0xc6, 0x01, 0xe0, 0x18, 0x36, 0x3a, 0x17, 0x1b, 0x06, 0xf8, 0x07, 0x18,
+   0xc6, 0xd9, 0xe6, 0x18, 0x36, 0xda, 0x16, 0x1b, 0x06, 0x18, 0x06, 0x18,
+   0x06, 0x18, 0x06, 0x18, 0xc6, 0x03, 0xf0, 0x18, 0xfe, 0x1f, 0xfe, 0x1f,
+   0x3e, 0xfc, 0x0f, 0x1f, 0x06, 0xc0, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00};
diff --git a/xman/iconclosed.h b/xman/iconclosed.h
new file mode 100644 (file)
index 0000000..106068c
--- /dev/null
@@ -0,0 +1,47 @@
+/* $XConsortium: iconclosed.h,v 1.5 94/04/17 20:43:55 rws Exp $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+
+/*
+ * Author:    Chris D. Peterson, MIT Project Athena
+ * Created:   January 29, 1988
+ */
+
+#define iconclosed_width 20
+#define iconclosed_height 30
+static unsigned char iconclosed_bits[] = {
+   0x00, 0x00, 0x00, 0xfc, 0xff, 0x07, 0x0e, 0xf8, 0x07, 0x06, 0x00, 0x05,
+   0xfe, 0xff, 0x04, 0xbe, 0xfb, 0x04, 0xbe, 0xfb, 0x04, 0xbe, 0xfb, 0x04,
+   0xbe, 0xfb, 0x04, 0xbe, 0xfb, 0x04, 0x3e, 0xf8, 0x04, 0xfe, 0xff, 0x04,
+   0xfe, 0xff, 0x04, 0x3e, 0xf8, 0x04, 0xbe, 0xfb, 0x04, 0xbe, 0xfb, 0x04,
+   0x3e, 0xf8, 0x04, 0xbe, 0xff, 0x04, 0xbe, 0xff, 0x04, 0xfe, 0xff, 0x04,
+   0xfe, 0xff, 0x04, 0x3e, 0xf9, 0x04, 0x3e, 0xf9, 0x04, 0xbe, 0xfa, 0x04,
+   0xbe, 0xfa, 0x04, 0xbe, 0xfb, 0x06, 0xbe, 0xfb, 0x05, 0xfe, 0xff, 0x00,
+   0xfe, 0xff, 0x00, 0x00, 0x00, 0x00};
diff --git a/xman/install-sh b/xman/install-sh
new file mode 100755 (executable)
index 0000000..6781b98
--- /dev/null
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# 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.
+
+nl='
+'
+IFS=" ""       $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+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:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+       shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+       case $mode in
+         *' '* | *'    '* | *'
+'*       | *'*'* | *'?'* | *'['*)
+           echo "$0: invalid mode: $mode" >&2
+           exit 1;;
+       esac
+       shift;;
+
+    -o) chowncmd="$chownprog $2"
+       shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+       shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)        shift
+       break;;
+
+    -*)        echo "$0: invalid option: $1" >&2
+       exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # 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: $dst_arg: Is a directory" >&2
+       exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+       (dirname "$dst") 2>/dev/null ||
+       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+            X"$dst" : 'X\(//\)[^/]' \| \
+            X"$dst" : 'X\(//\)$' \| \
+            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+       echo X"$dst" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+       # Create intermediate dirs using mode 755 as modified by the umask.
+       # This is like FreeBSD 'install' as of 1997-10-28.
+       umask=`umask`
+       case $stripcmd.$umask in
+         # Optimize common cases.
+         *[2367][2367]) mkdir_umask=$umask;;
+         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+         *[0-7])
+           mkdir_umask=`expr $umask + 22 \
+             - $umask % 100 % 40 + $umask % 20 \
+             - $umask % 10 % 4 + $umask % 2
+           `;;
+         *) mkdir_umask=$umask,go-w;;
+       esac
+
+       # With -d, create the new directory with the user-specified mode.
+       # Otherwise, rely on $mkdir_umask.
+       if test -n "$dir_arg"; then
+         mkdir_mode=-m$mode
+       else
+         mkdir_mode=
+       fi
+
+       posix_mkdir=false
+       case $umask in
+         *[123567][0-7][0-7])
+           # POSIX mkdir -p sets u+wx bits regardless of umask, which
+           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+           ;;
+         *)
+           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+           if (umask $mkdir_umask &&
+               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+           then
+             if test -z "$dir_arg" || {
+                  # Check for POSIX incompatibilities with -m.
+                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                  # other-writeable bit of parent directory when it shouldn't.
+                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                  case $ls_ld_tmpdir in
+                    d????-?r-*) different_mode=700;;
+                    d????-?--*) different_mode=755;;
+                    *) false;;
+                  esac &&
+                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                  }
+                }
+             then posix_mkdir=:
+             fi
+             rmdir "$tmpdir/d" "$tmpdir"
+           else
+             # Remove any dirs left behind by ancient mkdir implementations.
+             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+           fi
+           trap '' 0;;
+       esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+       umask $mkdir_umask &&
+       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+       /*) prefix='/';;
+       -*) prefix='./';;
+       *)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+       test -z "$d" && continue
+
+       prefix=$prefix$d
+       if test -d "$prefix"; then
+         prefixes=
+       else
+         if $posix_mkdir; then
+           (umask=$mkdir_umask &&
+            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+           # Don't fail if two instances are running concurrently.
+           test -d "$prefix" || exit 1
+         else
+           case $prefix in
+             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+             *) qprefix=$prefix;;
+           esac
+           prefixes="$prefixes '$qprefix'"
+         fi
+       fi
+       prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+       # Don't fail if two instances are running concurrently.
+       (umask $mkdir_umask &&
+        eval "\$doit_exec \$mkdirprog $prefixes") ||
+         test -d "$dstdir" || exit 1
+       obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # 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
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"    2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+       # Now remove or move aside any old file at destination location.
+       # We try this two ways since rm can't unlink itself on some
+       # systems and the destination file might be busy for other
+       # reasons.  In this case, the final cleanup might fail but the new
+       # file should still install successfully.
+       {
+         test ! -f "$dst" ||
+         $doit $rmcmd -f "$dst" 2>/dev/null ||
+         { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+           { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+         } ||
+         { echo "$0: cannot unlink or rename $dst" >&2
+           (exit 1); exit 1
+         }
+       } &&
+
+       # Now rename the file to the real destination.
+       $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xman/main.c b/xman/main.c
new file mode 100644 (file)
index 0000000..c709d5e
--- /dev/null
@@ -0,0 +1,296 @@
+/* $XConsortium: main.c,v 1.23 94/04/17 20:43:55 rws Exp $ */
+/* $XdotOrg: $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86: xc/programs/xman/main.c,v 1.3 2000/03/03 23:16:27 dawes Exp $ */
+
+/*
+ * xman - X window system manual page display program.
+ * Author:    Chris D. Peterson, MIT Project Athena
+ * Created:   October 22, 1987
+ */
+
+#include "globals.h"
+#ifndef ZERO
+#include <X11/Xaw/Cardinals.h>
+#endif /* ZERO */
+
+static void ArgError(int argc, char ** argv);
+static void AdjustDefResources(void);
+
+#define Offset(field) (XtOffsetOf(Xman_Resources , field))
+
+static XtResource my_resources[] = {
+  {"directoryFontNormal", XtCFont, XtRFontStruct, sizeof(XFontStruct *),
+     Offset(fonts.directory), XtRString, DIRECTORY_NORMAL},
+  {"bothShown", XtCBoolean, XtRBoolean, sizeof(Boolean),
+     Offset(both_shown_initial), XtRString, "False"},
+  {"directoryHeight", "DirectoryHeight", XtRInt, sizeof(int),
+     Offset(directory_height), XtRString, "150"},  
+  {"topCursor", XtCCursor, XtRCursor, sizeof(Cursor), 
+     Offset(cursors.top), XtRString, XMAN_CURSOR},
+  {"helpCursor", XtCCursor, XtRCursor, sizeof(Cursor),
+     Offset(cursors.help), XtRString, HELP_CURSOR},
+  {"manpageCursor", XtCCursor, XtRCursor, sizeof(Cursor),
+     Offset(cursors.manpage), XtRString, MANPAGE_CURSOR},
+  {"searchEntryCursor", XtCCursor, XtRCursor, sizeof(Cursor),
+     Offset(cursors.search_entry), XtRString, SEARCH_ENTRY_CURSOR},
+  {"pointerColor", XtCForeground, XtRPixel, sizeof(Pixel),
+     Offset(cursors.fg_color), XtRString, "XtDefaultForeground"},
+  {"pointerColorBackground", XtCBackground, XtRPixel, sizeof(Pixel),
+     Offset(cursors.bg_color), XtRString, "XtDefaultBackground"},
+  {"help", XtCBoolean, XtRBoolean, sizeof(Boolean),
+     Offset(show_help_syntax), XtRImmediate, NULL},
+  {"helpFile", XtCFile, XtRString, sizeof(char *),
+     Offset(help_file), XtRString, HELPFILE},
+  {"topBox", XtCBoolean, XtRBoolean, sizeof(Boolean),
+     Offset(top_box_active), XtRString, "True"},
+  {"clearSearchString", "ClearSearchString", XtRBoolean, sizeof(Boolean),
+     Offset(clear_search_string), XtRImmediate, (caddr_t) TRUE},
+  {"title", XtCString, XtRString, sizeof(char *),
+     Offset(title), XtRString, "xman"},
+  {"iconic", XtCBoolean, XtRBoolean, sizeof(Boolean),
+     Offset(iconic), XtRString, "False"},
+};
+
+#undef Offset
+
+/*
+ * The resource that we absolutely need.
+ */
+
+static char * fallback_resources[] = { "Xman*quitButton.translations:  #override \\n   <Btn1Up>: Quit() reset()",
+ "Xman*helpButton.sensitive:                    FALSE",
+ "Xman*manpageButton.sensitive:                 FALSE",
+ "Xman*helpButton.Label:                       Help",
+ "Xman*quitButton.Label:                       Quit",
+ "Xman*manpageButton.Label:                    Manual Page",
+ "Xman*topLabel.label:                                 No App-Defaults File",
+ NULL,
+};
+
+/*
+ * This is necessary to keep all TopLevel shells from becoming
+ * the size that is specified on the command line.
+ */
+
+static XrmOptionDescRec xman_options[] = {
+{"-geometry", "*topBox.geometry",        XrmoptionSepArg, (caddr_t) NULL},
+{"-help",     "help",                    XrmoptionNoArg,  (caddr_t) "True"},
+{"=",         "*topBox.geometry",        XrmoptionIsArg,  (caddr_t) NULL},
+{"-pagesize", "*manualBrowser.geometry", XrmoptionSepArg, (caddr_t) NULL},
+{"-notopbox", "topBox",                  XrmoptionNoArg,  (caddr_t) "False"},
+{"-helpfile", "helpFile",                XrmoptionSepArg, (caddr_t) NULL},
+{"-bothshown","bothShown",               XrmoptionNoArg,  (caddr_t) "True"},
+{"-title",    "title",                   XrmoptionSepArg, (caddr_t) "xman"}, 
+{"-iconic",   "iconic",                  XrmoptionNoArg,  (caddr_t) "True"},
+};
+
+static XtActionsRec xman_actions[] = {
+  {"GotoPage",          GotoPage},
+  {"Quit",              Quit},
+  {"Search",            Search},
+  {"PopupHelp",         PopupHelp},
+  {"PopupSearch",       PopupSearch},
+  {"CreateNewManpage",  CreateNewManpage},
+  {"RemoveThisManpage", RemoveThisManpage},
+  {"SaveFormattedPage", SaveFormattedPage},
+#ifdef INCLUDE_XPRINT_SUPPORT
+  {"PrintThisManpage",  PrintThisManpage},
+#endif /* INCLUDE_XPRINT_SUPPORT */
+  {"ShowVersion",       ShowVersion},
+};
+
+char **saved_argv;
+int saved_argc;
+
+/*
+ * This atom is used to make the application ICCCM compliant.
+ */
+Atom wm_delete_window;
+
+/*     Function Name: main
+ *     Description: This is the main driver for Xman.
+ *     Arguments: argc, argv - the command line arguments.
+ *     Returns: return, what return.
+ */
+
+int main(int argc, char ** argv)
+{
+  XtAppContext app_con;
+
+  saved_argc = argc;
+  saved_argv = (char **)XtMalloc(argc * sizeof(char *));
+  bcopy(argv, saved_argv, argc * sizeof(char *));
+
+  XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
+
+  initial_widget = XtAppInitialize(&app_con, "Xman", xman_options,
+                                  XtNumber(xman_options), &argc, argv,
+                                  fallback_resources, NULL, ZERO);
+  wm_delete_window = XInternAtom(XtDisplay(initial_widget), "WM_DELETE_WINDOW",
+                                False);
+
+  manglobals_context = XStringToContext(MANNAME);
+
+  AdjustDefResources();
+
+  XtGetApplicationResources( initial_widget, (caddr_t) &resources, 
+                           my_resources, XtNumber(my_resources),
+                           NULL, (Cardinal) 0);
+
+  if ( (argc != 1) || (resources.show_help_syntax) ) {
+    ArgError(argc, argv);
+    return EXIT_FAILURE;
+  }
+
+  XtAppAddActions(app_con, xman_actions, XtNumber(xman_actions));
+
+  if (!resources.fonts.directory)
+       PrintError("Failed to get the directory font.");
+
+#ifdef DEBUG
+  printf("debugging mode\n");
+#endif
+
+/*
+ * Set the default width and height.
+ * I am not real happy with this method, but it will usually do something
+ * reasonable, if not the "right" thing.  It is not a real big issue since
+ * it is easy to change the values with resources or command line options.
+ * NOTE: if you are in a 100 dpi display you will lose.
+ */
+
+  default_width = DEFAULT_WIDTH;
+  default_height=DisplayHeight(XtDisplay(initial_widget), 
+                              DefaultScreen(XtDisplay(initial_widget)));
+  default_height *= 3;
+  default_height /= 4;
+
+  if ( (sections = Man()) == 0 )
+    PrintError("There are no manual sections to display, check your MANPATH.");
+
+  if (resources.top_box_active) 
+    MakeTopBox();      
+  else
+    (void) CreateManpage(NULL);
+
+/*
+ * We need to keep track of the number of manual pages that are shown on
+ * the screen so that if this user does not have a top box then when he
+ * removes all his manual pages we can kill off the xman process.
+ * To make things easier we will consider the top box a shown manual page
+ * here, but since you cannot remove it, man_page_shown only goes to zero when
+ * no top box is present.
+ */
+
+  man_pages_shown = 1;         
+
+  XtAppMainLoop(app_con);
+
+  return EXIT_SUCCESS;
+}
+
+/*     Function Name: ArgError
+ *     Description:  Prints error message about unknow arguments.
+ *     Arguments: argc, argv - args not understood.
+ *     Returns: none.
+ */
+
+static void 
+ArgError(int argc, char ** argv)
+{
+  int i;
+
+  static char **syntax, *syntax_def[] = {
+  "-help",                   "Print this message",
+  "-helpfile <filename>",    "Specifies the helpfile to use.",
+  "-bothshown",              "Show both the directory and manpage at once.",
+  "-notopbox",               "Starts with manpage rather than topbox.",
+  "-geometry <geom>",        "Specifies the geometry of the top box.",
+  "=<geom>",                 "Specifies the geometry of the top box.",
+  "-pagesize <geom>",        "Specifies the geometry of the manual page.",
+  "-bw <pixels>",            "Width of all window borders.",
+  "-borderwidth <pixels>",   "Width of all window borders.",
+  "-bd <color>",             "Color of all window borders.",
+  "-bordercolor <color>",    "Color of all window borders.",
+  "-fg <color>",             "Foreground color for the application.",
+  "-foreground <color>",     "Foreground color for the application.",
+  "-bg <color>",             "Background color for the application.",
+  "-background <color>",     "Background color for the application.",
+  "-display <display name>", "Specify a display that is not the default",
+  "-fn <font>",              "Font to be used for button and label text.",
+  "-font <font>",            "Font to be used for button and label text.",
+  "-name <name>",            "Change the name used for retrieving resources.",
+  "-title <name>",           "Change the name without affecting resources.",
+  "-xrm <resource>",         "Specifies a resource on the command line.",
+  NULL, NULL,
+  };
+  
+  syntax = syntax_def;
+
+  for (i = 1; i < argc ; i++) 
+    (void) printf("This argument is unknown to Xman: %s\n", argv[i]);
+  
+  (void) printf("\nKnown arguments are:\n");
+
+  while ( *syntax != NULL ) {
+    printf("%-30s - %s\n", syntax[0], syntax[1]);
+    syntax += 2;
+  }
+}
+
+/*    Function Name: AdjustDefResources
+ *    Description: Changes default resources which contain paths when
+ *            XWINHOME is set
+ *    Arguments: none
+ *    Returns: nothing
+ */
+
+static void
+AdjustDefResources(void)
+{
+  char        *xwinhome = NULL;
+  int i;
+
+  if (!(xwinhome = getenv("XWINHOME")))
+    return;
+
+  for (i = 0; i < sizeof(my_resources)/sizeof(XtResource); i++) {
+    if (!strcmp(my_resources[i].resource_name, "helpFile")) {
+      if (!(my_resources[i].default_addr =
+              malloc(strlen(xwinhome) + sizeof("/lib/X11/xman.help")))) {
+        fprintf(stderr, "malloc failure\n");
+        exit(EXIT_FAILURE);
+      }
+      sprintf(my_resources[i].default_addr, "%s/lib/X11/xman.help", xwinhome);
+    }
+  }
+}
diff --git a/xman/man.c b/xman/man.c
new file mode 100644 (file)
index 0000000..ad2b3f0
--- /dev/null
@@ -0,0 +1,1184 @@
+/* $XConsortium: man.c,v 1.30 94/04/17 20:43:56 rws Exp $ */
+/* $XdotOrg: $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86: xc/programs/xman/man.c,v 1.8 2003/04/09 20:31:31 herrb Exp $ */
+
+
+#include "globals.h"
+#include "vendor.h"            /* vendor-specific defines and data */
+
+#ifndef X_NOT_POSIX
+#include <dirent.h>
+#else
+#ifdef SYSV
+#include <dirent.h>
+#else
+#ifdef USG
+#include <dirent.h>
+#else
+#include <sys/dir.h>
+#ifndef dirent
+#define dirent direct
+#endif
+#endif
+#endif
+#endif
+
+#ifdef DEBUG
+static char error_buf[BUFSIZ];         /* The buffer for error messages. */
+#endif /* DEBUG */
+
+static void AddToCurrentSection(Manual * local_manual, char * path);
+static void InitManual(Manual * l_manual, char * label);
+static void ReadCurrentSection(Manual * local_manual, char * path);
+static void ReadMandescFile(SectionList ** section_list, char * path);
+static void SortAndRemove(Manual *man, int number);
+static void SortList(SectionList ** list);
+
+#define SECT_ERROR -1
+
+#ifndef       Byte
+#define       Byte    unsigned char
+#endif
+#ifndef       reg
+#define       reg     register
+#endif
+static void sortstrs (Byte *data[], int size, Byte *otherdata[]);
+static void sortstrs_block (Byte **, Byte **, int, Byte, Byte **, Byte **);
+static void sortstrs_block_oo (Byte **, Byte **, int, Byte, int *, int *, Byte **, Byte **);
+/*     Function Name: Man
+ *     Description: Builds a list of all manual directories and files.
+ *     Arguments: none. 
+ *     Returns: the number of manual sections.
+ */
+
+int
+Man(void)
+{
+  SectionList *list = NULL;
+  char *ptr, *lang = NULL, manpath[BUFSIZ], buf[BUFSIZ], *path, *current_label;
+  int sect, num_alloced;
+
+/* 
+ * Get the environment variable MANPATH, and if it doesn't exist then use
+ * SYSMANPATH and LOCALMANPATH.
+ */
+
+  /* if MANPATH variable ends in ':'. So, should extend it's value to the
+   * default search path.
+   */
+
+  *manpath = '\0';
+  if ((ptr = getenv("MANPATH")) != NULL)
+    strcpy(manpath, ptr);
+  if (ptr == NULL || streq(ptr , "") || ptr[strlen(ptr) - 1] == ':') {
+    lang = getenv("LANG");
+#ifdef MANCONF
+    if (!ReadManConfig(manpath + strlen(manpath)))
+#endif
+    {
+#ifdef MANCONF
+      if (manpath[strlen(manpath) - 1] != ':')
+       strcat(manpath, ":");
+#endif
+      strcat(manpath, SYSMANPATH);
+#ifdef LOCALMANPATH
+      strcat(manpath, ":");
+      strcat(manpath, LOCALMANPATH);
+#endif
+    }
+  }
+
+/*
+ * Get the list of manual directories in the users MANPATH that we should
+ * open to look for manual pages.  The ``mandesc'' file is read here.
+ */
+
+  for ( path = manpath ; (ptr = index(path , ':')) != NULL ; path = ++ptr) { 
+    *ptr = '\0';
+    if (lang != NULL) {
+      strcpy(buf, path);
+      strcat(buf, "/");
+      strncat(buf, lang, sizeof(buf) - strlen(path) + 1);
+      buf[sizeof(buf) - strlen(path) + 1] = '\0';
+      ReadMandescFile(&list, buf);
+    }
+    ReadMandescFile(&list, path);
+  }
+  if (lang != NULL) {
+    strcpy(buf, path);
+    strcat(buf, "/");
+    strncat(buf, lang, sizeof(buf) - strlen(path) + 1);
+    buf[sizeof(buf) - strlen(path) + 1] = '\0';
+    ReadMandescFile(&list, buf);
+  }
+  ReadMandescFile(&list, path);
+
+  SortList(&list);
+  
+  sect = 0;
+  num_alloced = SECTALLOC;
+  manual = (Manual *) XtMalloc( sizeof(Manual) * num_alloced );
+  InitManual( manual, list->label );
+  manual[sect].flags = list->flags;
+  current_label = NULL;
+
+  while ( list != NULL ) {
+    SectionList * old_list;
+
+    if ( current_label == NULL || streq(list->label, current_label) )
+      AddToCurrentSection( manual + sect, list->directory);
+    else {
+      if (manual[sect].nentries == 0) {        /* empty section, re-use it. */
+       XtFree(manual[sect].blabel);
+       manual[sect].blabel = list->label;
+       manual[sect].flags = list->flags;
+      }
+      else {
+       if ( ++sect >= num_alloced ) {
+         num_alloced += SECTALLOC;
+         manual = (Manual *) XtRealloc ( (char *) manual,
+                                       (sizeof(Manual) * num_alloced));
+         if (manual == NULL) 
+           PrintError("Could not allocate memory for manual sections.");
+       }
+       InitManual( manual + sect, list->label );
+       manual[sect].flags = list->flags;
+      }
+      AddToCurrentSection( manual + sect, list->directory);
+    }
+    /* Save label to see if it matches next entry. */
+    current_label = list->label; 
+    old_list = list;
+    list = list->next;
+    XtFree((char *) old_list);         /* free what you allocate. */
+  }
+  if (manual[sect].nentries != 0)
+    sect++;                    /* don't forget that last section. */
+  
+  SortAndRemove(manual, sect);
+
+#ifdef notdef                  /* dump info. */
+  DumpManual(sect);
+#endif
+  
+/*
+ * realloc manual to be minimum space necessary.
+ */
+
+  if (sect == 0)
+    PrintError("No manual pages found.");
+  manual = (Manual *) XtRealloc( (char *) manual, (sizeof(Manual) * sect));
+  if (manual == NULL) 
+    PrintError("Could not allocate memory for manual sections.");
+
+  return(sect);                /* return the number of man sections. */
+}    
+
+/*     Function Name: SortList
+ *     Description: Sorts the list of sections to search.
+ *     Arguments: list - a pointer to the list to sort.
+ *     Returns: a sorted list.
+ *
+ * This is the most complicated part of the entire operation.
+ * all sections with the same label must by right next to each other,
+ * but the sections that are in the standard list have to come first.
+ */
+
+static void
+SortList(SectionList ** list)
+{
+  SectionList * local;
+  SectionList *head, *last, *inner, *old;
+  
+  if (*list == NULL)
+    PrintError("No manual sections to read, exiting.");
+
+/* 
+ * First step 
+ * 
+ * Look for standard list items, and more them to the top of the list.
+ */
+
+  last = NULL;                 /* keep Saber happy. */
+  for ( local = *list ; local->next != NULL ; local = local->next) {
+    if ( local->flags ) {
+      if ( local == *list )    /* top element is already standard. */
+       break;
+      head = local;
+
+      /* Find end of standard block */
+      for (old = NULL ; (local->next != NULL) && (local->flags) 
+          ; old = local, local = local->next); 
+
+      if (old != NULL) {
+          last->next = old->next; /* Move the block. */
+          old->next = *list;
+          *list = head;
+      }
+
+      break;                   /* First step accomplished. */
+    }
+    last = local;
+  }
+
+/*
+ *  Second step
+ *
+ *  Move items with duplicate labels right next to each other.
+ *
+ *  Changed to keep the order of the list entries unchanged.
+ */
+
+  for (local = *list; local->next != NULL; local = local->next) {
+    head = local;
+    old = inner = local->next;
+    while (inner != NULL) {
+      if (streq(inner->label, local->label)) {
+       if (old != inner) {
+         old->next = inner->next;
+         last = inner->next;
+         inner->next = head->next;
+         head->next = inner;
+         head = inner;
+         old = inner = last;
+         continue;
+       }
+       else
+         head = inner;
+      }
+      old = inner;
+      inner = inner->next;
+    }
+  }
+}      
+
+/*     Function Name: ReadMandescFile
+ *     Description: Reads the mandesc file, and adds more sections as 
+ *                   necessary.
+ *     Arguments: path - path name if the current search directory.
+ *                 section_list - pointer to the list of sections.
+ *     Returns: TRUE in we should use default sections
+ */
+  
+static void
+ReadMandescFile(SectionList ** section_list, char * path)
+{
+  char mandesc_file[BUFSIZ];   /* full path to the mandesc file. */
+  FILE * descfile;
+  char string[BUFSIZ], local_file[BUFSIZ];
+  Boolean use_defaults = TRUE;
+  char *cp;
+
+  snprintf(mandesc_file, sizeof(mandesc_file), "%s/%s", path, MANDESC);
+  if ( (descfile = fopen(mandesc_file, "r")) != NULL) {
+    while ( fgets(string, BUFSIZ, descfile) != NULL) {
+      string[strlen(string)-1] = '\0';        /* Strip off the CR. */
+
+      if ( streq(string, NO_SECTION_DEFAULTS) ) {
+       use_defaults = FALSE;
+       continue;
+      }
+
+      if ((cp = index(string,'\t')) != NULL) {
+       char *s;
+       *cp++ = '\0';
+       strcpy(local_file, MAN);
+       strcat(local_file, string);
+       if ((s = index(cp,'\t')) != NULL) {
+         *s++ = '\0';
+         if (streq(s, SUFFIX))
+           AddNewSection(section_list, path, local_file, cp, MSUFFIX);
+         else if (streq(s, FOLD))
+           AddNewSection(section_list, path, local_file, cp, MFOLD);
+         else if (streq(s, FOLDSUFFIX))
+           AddNewSection(section_list, path, local_file, cp, MFOLDSUFFIX);
+         else
+           AddNewSection(section_list, path, local_file, cp, MNULL);
+        } else
+           AddNewSection(section_list, path, local_file, cp, MNULL);
+      } else {
+       snprintf(local_file, sizeof(local_file), "%s%c", MAN, string[0]);
+       AddNewSection(section_list, path, local_file, (string + 1), FALSE );
+#ifdef SEARCHOTHER
+       snprintf(local_file, sizeof(local_file), "%s%c", SEARCHOTHER, string[0]);
+       AddNewSection(section_list, path, local_file, (string + 1), FALSE);
+#endif
+      }
+    }
+
+    fclose(descfile);
+  }
+  if (use_defaults)
+    AddStandardSections(section_list, path);
+}
+
+/*     Function Name: AddNewSection
+ *     Description: Adds the new section onto the current section list.
+ *     Arguments: list - pointer to the section list.
+ *                 path - the path to the current manual section.
+ *                 file - the file to save.
+ *                 label - the current section label.
+ *                 flags = 1 - add a suffix
+ *                      = 2 - fold to lower case
+ *     Returns: none.
+ */
+
+void
+AddNewSection(
+SectionList **list,
+char * path, char * file, char * label, 
+int flags)
+{
+  SectionList * local_list, * end;
+  char full_path[BUFSIZ];
+
+/* Allocate a new list element */
+
+  local_list = (SectionList *) XtMalloc(sizeof(SectionList));
+
+  if (*list != NULL) {
+    for ( end = *list ; end->next != NULL ; end = end->next );
+    end->next = local_list;
+  }
+  else 
+    *list = local_list;
+
+  local_list->next = NULL;
+  local_list->label = StrAlloc(label);
+  snprintf(full_path, sizeof(full_path), "%s/%s", path, file);
+  local_list->directory = StrAlloc(full_path);
+  local_list->flags = flags;
+}  
+
+/*     Function Name: AddToCurrentSection
+ *     Description: This function gets the names of the manual page
+ *                   directories, then closes the directory.
+ *     Arguments:  local_manual - a pointer to a manual pages structure.
+ *                  path - the path to this directory.
+ *     Returns: none.
+ */
+
+static void
+AddToCurrentSection(Manual * local_manual, char * path)
+{
+  char temp_path[BUFSIZ];
+
+#if defined(__OpenBSD__) || defined(__NetBSD__)
+  snprintf(temp_path, sizeof(temp_path), "%s/%s", path, MACHINE);
+  ReadCurrentSection(local_manual, temp_path);
+#endif
+  ReadCurrentSection(local_manual, path);
+  snprintf(temp_path, sizeof(temp_path), "%s.%s", path, COMPRESSION_EXTENSION);
+  ReadCurrentSection(local_manual, temp_path);
+}
+
+/*     Function Name: ReadCurrentSection
+ *     Description: Actually does the work of adding entries to the 
+ *                   new section
+ *     Arguments:  local_manual - a pointer to a manual pages structure.
+ *                  path - the path to this directory.
+ *                  compressed - Is this a compressed directory?
+ *     Returns: TRUE if any entries are found.
+ */
+
+static void
+ReadCurrentSection(Manual * local_manual, char * path)
+{
+  DIR * dir;
+
+  register struct dirent *dp;
+
+  register int nentries;
+  register int nalloc;
+  char full_name[BUFSIZ], *ptr;
+
+  if((dir = opendir(path)) == NULL) {
+#ifdef DEBUG
+    snprintf(error_buf, sizeof(error_buf), "Can't open directory %s", path);
+    PopupWarning(NULL, error_buf);
+#endif /* DEBUG */
+    return;
+  }
+
+/*
+ * Remove the compression extension from the path name.
+ */
+
+  if ( (ptr = rindex(path, '.')) != NULL) {
+#if !defined(__SCO__) && !defined(ISC)
+    if (streq(ptr + 1, COMPRESSION_EXTENSION)) 
+#else
+    if (strpbrk(ptr + 1, COMPRESSION_EXTENSIONS) != NULL)
+#endif
+      *ptr = '\0';
+#ifdef GZIP_EXTENSION
+    else if (streq(ptr + 1, GZIP_EXTENSION))
+      *ptr = '\0';
+#endif
+#ifdef BZIP2_EXTENSION
+    else if (streq(ptr + 1, BZIP2_EXTENSION))
+      *ptr = '\0';
+#endif
+#ifdef LZMA_EXTENSION
+    else if (streq(ptr + 1, LZMA_EXTENSION))
+      *ptr = '\0';
+#endif
+  }
+  
+  nentries = local_manual->nentries;
+  nalloc = local_manual->nalloc;
+
+  while( (dp = readdir(dir)) != NULL ) {
+    char * name = dp->d_name;
+    if (name[0] == '.')
+      continue;
+#ifndef CRAY
+    if (index(name, '.') == NULL)
+      continue;
+#endif
+    if( nentries >= nalloc ) {
+      nalloc += ENTRYALLOC;
+      local_manual->entries =(char **) XtRealloc((char *)local_manual->entries,
+                                                nalloc * sizeof(char *));
+      local_manual->entries_less_paths =
+       (char **) XtRealloc((char *)local_manual->entries_less_paths,
+                           nalloc * sizeof(char *));
+    }
+
+    snprintf(full_name, sizeof(full_name), "%s/%s", path, name);
+/*
+ * Remove the compression extension from the entry name.
+ */
+
+    if ( (ptr = rindex(full_name, '.')) != NULL) {
+#if !defined(__SCO__) && !defined(ISC)
+      if (streq(ptr + 1, COMPRESSION_EXTENSION)) 
+#else
+      if (strpbrk(ptr + 1, COMPRESSION_EXTENSIONS) != NULL)
+#endif
+       *ptr = '\0';
+#ifdef GZIP_EXTENSION
+      else if (streq(ptr + 1, GZIP_EXTENSION))
+       *ptr = '\0';
+#endif
+#ifdef BZIP2_EXTENSION
+      else if (streq(ptr + 1, BZIP2_EXTENSION))
+       *ptr = '\0';
+#endif
+#ifdef LZMA_EXTENSION
+      else if (streq(ptr + 1, LZMA_EXTENSION))
+       *ptr = '\0';
+#endif
+#ifdef IGNORE_EXTENSION
+      /* skip files with specified extension - they're not real man pages */
+      else if (streq(ptr + 1, IGNORE_EXTENSION)) {
+       continue;
+      }
+#endif /* IGNORE_EXTENSION */
+    }
+    local_manual->entries[nentries] = StrAlloc(full_name);
+    local_manual->entries_less_paths[nentries] = 
+      rindex(local_manual->entries[nentries], '/');
+    if ( local_manual->entries_less_paths[nentries] == NULL )
+      PrintError("Internal error while cataloging manual pages.");
+    ++ nentries;
+  }
+  
+  local_manual->nentries = nentries;
+  local_manual->nalloc = nalloc;
+
+  closedir(dir);
+}
+
+/*     Function Name: SortAndRemove
+ *     Description: This function sorts all the entry names and
+ *                   then removes all the duplicate entries.
+ *     Arguments: man - a pointer to the manual structure.
+ *                 number - the number of manual sections.
+ *     Returns: an improved manual stucure
+ */
+
+static void
+SortAndRemove(Manual *man, int number)
+{
+  int i;
+  char *l1, *l2, **s1;
+  
+  for ( i = 0; i < number; man++, i++) { /* sort each section */
+    register int i2 = 0;      
+    
+#ifdef DEBUG
+    printf("sorting section %d - %s\n", i, man->blabel);
+#endif /* DEBUG */
+
+    s1 = (char **)malloc(man->nentries * sizeof(char *));
+    
+    /* temporarily remove suffixes of entries, preventing them from */
+    /* being used in alpabetic comparison ie sccs-delta.1 vs sccs.1 */
+    for (i2=0; i2<man->nentries; i2++)
+      if ((s1[i2] = rindex(man->entries_less_paths[i2], '.')) != NULL)
+       *s1[i2] = '\0';  
+
+    sortstrs ( (Byte **)man->entries_less_paths, man->nentries, (Byte **)man->entries );
+
+    /* put back suffixes */
+    for (i2=0; i2<man->nentries; i2++) 
+      if (s1[i2] != NULL) *s1[i2] = '.';      
+
+    free(s1); 
+    
+#ifdef DEBUG
+    printf("removing from section %d.\n", i);
+#endif /* DEBUG */
+    
+    {
+      register int   j, k, nent, nentm1;
+      int     j2;
+      nent   = man -> nentries;
+      nentm1 = nent - 1;
+      j = 0;
+      l2 = man->entries_less_paths[j++];
+      if ( l2 == NULL )
+        PrintError("Internal error while removing duplicate manual pages.");
+      while ( j < nentm1 )
+       {
+         l1 = l2;
+         l2 = man->entries_less_paths[j++];
+         if ( l2 == NULL )
+           PrintError("Internal error while removing duplicate manual pages."
+                      );
+         if ( streq(l1,l2) )
+           {
+             j2 = j-1;
+             k  = j2;
+             while ( j < nent )
+                {
+                 man -> entries_less_paths[k] = man -> entries_less_paths[j];
+                man -> entries[k++] = man -> entries[j++];
+                }
+             j = j2;
+             -- man -> nentries;
+             -- nent;
+             -- nentm1;
+           }
+       }
+    }
+  }
+}
+
+ /*
+       *******  Replacement for qsort to keep
+       *******  identical entries in order
+       A somewhat ugly hack of something that was once simpler...
+ */
+ /*
+       Sort an array of pointers to strings, keeping it
+       in ascending order by (1) string comparison and
+       (2) original entry order in the pointer array.
+       This is a modified radix exchange algorithm.
+       In case there's insufficient memory for a temporary copy
+       of the pointer array, the original order of identical strings
+       isn't preserved.
+ */
+static void 
+sortstrs (Byte *data[], int size, Byte *otherdata[])
+{
+       Byte   **sp, **ep;
+       Byte   **othersp, **otherep;
+       int     *origorder;
+ origorder = (int *) calloc (size, sizeof(int));
+ if ( origorder )
+    {
+    reg int     i;
+    for ( i=0; i < size; ++i )
+       origorder[i] = i;
+    }
+ sp = data;
+ ep = &data[size-1];
+ othersp = otherdata;
+ otherep = &otherdata[size-1];
+ if ( origorder )
+    {
+    sortstrs_block_oo ( sp, ep, 0, 0x80, origorder, &origorder[size-1],
+       othersp, otherep );
+    free (origorder);
+    }
+ else
+    sortstrs_block ( sp, ep, 0, 0x80, othersp, otherep );
+}
+
+ /*---------------------------------*/
+ /*  Sort 1 block of data on 1 bit  */
+ /*---------------------------------*/
+static void
+sortstrs_block (  
+       Byte   **start,
+       Byte   **end,
+       int      offset,
+       Byte     mask,
+       Byte   **otherstart,
+       Byte   **otherend)
+{
+ reg   Byte   **sp, **ep;
+ reg   Byte     m;
+ reg   int      off;
+ reg   Byte    *t;
+ reg   int      curstrlen;
+       int      maxstrlen;
+       Byte   **othersp, **otherep;
+#define       newstring(ptr) \
+ { \
+ t = *ptr; \
+ curstrlen = 0; \
+ while ( *t++ ) ++ curstrlen; \
+ if ( curstrlen > maxstrlen ) maxstrlen = curstrlen; \
+ t = *ptr; \
+ }
+ maxstrlen = 0;
+ sp  = start;
+ ep  = end;
+ off = offset;
+ m   = mask;
+ othersp = otherstart;
+ otherep = otherend;
+ while (1)
+     {
+     newstring(sp)
+     while (((sp != ep) && ((curstrlen < off) || ((t[off] & m) == 0))))
+       {
+       ++ sp;
+       ++ othersp;
+       newstring(sp)
+       }
+     if ( sp == ep )
+       break;
+     newstring(ep);
+     while (((sp != ep) && (curstrlen >= off) && ((t[off] & m) != 0)))
+       {
+       -- ep;
+       -- otherep;
+       newstring(ep)
+       }
+     if ( sp == ep )
+       break;
+     t = *sp;
+     *sp = *ep;
+     *ep = t;
+     t      = *othersp;
+     *othersp = *otherep;
+     *otherep = t;
+     }
+ t = *sp;
+ if ((curstrlen < off) || ((t[off] & m) == 0))
+    {
+    if ( ep != end )
+       {
+       ++ ep;
+       ++ otherep;
+       }
+    }
+ else
+    {
+    if ( sp != start )
+       {
+       -- sp;
+       -- othersp;
+       }
+    }
+ m >>= 1;
+ if ( m == 0 )
+    {
+    m = 0x80;
+    if ( ++off >= maxstrlen )
+       return;
+    }
+ if ( sp != start )
+    sortstrs_block ( start, sp, off, m, otherstart, othersp );
+ if ( ep != end )
+    sortstrs_block ( ep, end, off, m, otherep, otherend );
+}
+
+ /*-----------------------------------------------------------------*/
+ /*  Sort 1 block of data on 1 bit; check for out-of-order entries  */
+ /*-----------------------------------------------------------------*/
+static void
+ sortstrs_block_oo (
+       Byte   **start,
+       Byte   **end,
+       int      offset,
+       Byte     mask,
+       int     *ostart,
+       int     *oend,
+       Byte   **otherstart,
+       Byte   **otherend)
+{
+ reg   Byte   **sp, **ep;
+ reg   int     *osp, *oep;
+ reg   Byte     m;
+ reg   int      off;
+ reg   Byte    *t;
+ reg   int      u;
+ reg   int      curstrlen;
+       int      maxstrlen;
+       Byte   **othersp, **otherep;
+#define       newstring(ptr) \
+ { \
+ t = *ptr; \
+ curstrlen = 0; \
+ while ( *t++ ) ++ curstrlen; \
+ if ( curstrlen > maxstrlen ) maxstrlen = curstrlen; \
+ t = *ptr; \
+ }
+ maxstrlen = 0;
+ sp  = start;
+ ep  = end;
+ osp = ostart;
+ oep = oend;
+ off = offset;
+ m   = mask;
+ othersp = otherstart;
+ otherep = otherend;
+ while (1)
+     {
+     newstring(sp)
+     while (((sp != ep) && ((curstrlen < off) || ((t[off] & m) == 0))))
+       {
+       ++ sp;
+       ++ osp;
+       ++ othersp;
+       newstring(sp)
+       }
+     if ( sp == ep )
+       break;
+     newstring(ep);
+     while (((sp != ep) && (curstrlen >= off) && ((t[off] & m) != 0)))
+       {
+       -- ep;
+       -- oep;
+       -- otherep;
+       newstring(ep)
+       }
+     if ( sp == ep )
+       break;
+     t   = *sp;
+     *sp = *ep;
+     *ep = t;
+     t      = *othersp;
+     *othersp = *otherep;
+     *otherep = t;
+     u    = *osp;
+     *osp = *oep;
+     *oep = u;
+     }
+ t = *sp;
+ if ((curstrlen < off) || ((t[off] & m) == 0))
+    {
+    if ( ep != end )
+       {
+       ++ ep;
+       ++ oep;
+       ++ otherep;
+       }
+    }
+ else
+    {
+    if ( sp != start )
+       {
+       -- sp;
+       -- osp;
+       -- othersp;
+       }
+    }
+ m >>= 1;
+ if ( m == 0 )
+    {
+    m = 0x80;
+    if ( ++off >= maxstrlen )  /*  Finished sorting block of strings:    */
+       {                               /*  Restore duplicates to
+riginal order  */
+       reg Byte **cp;
+       reg int *ocp;
+         Byte **othercp;
+       if ( sp != start )
+        {
+        cp  = start;
+        ocp = ostart;
+        othercp = otherstart;
+        while ( cp != sp )
+           {
+           if ( *ocp > *(ocp+1) )
+               {
+               t       = *(cp+1);
+               *(cp+1) = *cp;
+               *cp     = t;
+               t               = *(othercp+1);
+               *(othercp+1)    = *othercp;
+               *othercp        = t;
+               u        = *(ocp+1);
+               *(ocp+1) = *ocp;
+               *ocp     = u;
+               if ( cp != start )
+                  {
+                  -- cp;
+                  -- ocp;
+                  -- othercp;
+                  continue;
+                  }
+               }
+           ++ cp;
+           ++ ocp;
+           ++ othercp;
+           }
+        }
+       if ( ep != end )
+        {
+        cp  = ep;
+        ocp = oep;
+        othercp = otherep;
+        while ( cp != end )
+           {
+           if ( *ocp > *(ocp+1) )
+               {
+               t       = *(cp+1);
+               *(cp+1) = *cp;
+               *cp     = t;
+               t               = *(othercp+1);
+               *(othercp+1)    = *othercp;
+               *othercp        = t;
+               u        = *(ocp+1);
+               *(ocp+1) = *ocp;
+               *ocp     = u;
+               if ( cp != ep )
+                  {
+                  -- cp;
+                  -- ocp;
+                  -- othercp;
+                  continue;
+                  }
+               }
+           ++ cp;
+           ++ ocp;
+           ++ othercp;
+           }
+        }
+       return;
+       }
+    }
+ if ( sp != start )
+    sortstrs_block_oo ( start, sp, off, m, ostart, osp, otherstart, othersp );
+ if ( ep != end )
+    sortstrs_block_oo ( ep, end, off, m, oep, oend, otherep, otherend );
+}
+
+
+/*     Function Name: InitManual
+ *     Description: Initializes this manual section.
+ *     Arguments: l_manual - local copy of the manual structure.
+ *                 label - the button label for this section.
+ *     Returns: none.
+ */
+
+static void
+InitManual(Manual * l_manual, char * label)
+{
+  bzero( l_manual, sizeof(Manual) );           /* clear it. */
+  l_manual->blabel = label;                    /* set label. */
+}
+  
+#if defined(DEBUG)
+
+/*     Function Name: DumpManual
+ *     Description: Debugging function that dumps the entire manual page
+ *                   structure.
+ *     Arguments: number - the number of sections.
+ *     Returns: none.
+ */
+
+void
+DumpManual(int number)
+{
+  register int i,j;
+  
+  for ( i = 0; i < number; i++) {
+    printf("label: %s\n", manual[i].blabel);
+    for (j = 0; j < manual[i].nentries; j++) 
+      printf("%s\n", manual[i].entries[j]);
+  }
+}
+
+#endif /* DEBUG */
+
+
+
+#ifdef MANCONF
+
+#if defined(MANCONFIGSTYLE_FreeBSD)
+
+/*    Function Name: ReadManConfig
+ *    Description: Reads man.conf file used by FreeBSD man
+ *      Argument: manpath - char array to return path in.
+ *    Returns: TRUE if read was successful.
+ */
+
+Bool
+ReadManConfig(char manpath[])
+{
+  FILE        *fp;
+  char        line[BUFSIZ];
+  char        *path;
+  Bool  firstpath = TRUE;
+
+  if (!(fp = fopen(MANCONF, "r")))
+    return(FALSE);
+
+  while (fgets(line, sizeof(line), fp)) {
+    path = strtok(line, " \t\n");
+    if (!path || *path == '#')
+      continue;
+    if (strcmp(path, "MANPATH_MAP") == 0)
+      path = strtok((char *)NULL, " \t\n");
+    else if (strcmp(path, "MANDATORY_MANPATH") != 0 &&
+            strcmp(path, "OPTIONAL_MANPATH") != 0)
+      return(FALSE);
+    path = strtok((char *)NULL, " \t\n");
+    if (!path || *path == '#')
+      return FALSE;
+    if (firstpath) {
+      strcpy(manpath, path);
+      firstpath = FALSE;
+    }
+    else if (!strstr(manpath,path)) {
+      strcat(manpath, ":");
+      strcat(manpath, path);
+    }
+  }
+  fclose(fp);
+  return(!firstpath);
+}
+
+
+#elif defined(MANCONFIGSTYLE_Linux) /* not FreeBSD */
+
+/*    Function Name: ReadManConfig
+ *    Description: Reads man.conf file used by Linux man
+ *      Argument: manpath - char array to return path in.
+ *    Returns: TRUE if read was successful.
+ */
+
+
+Bool
+ReadManConfig(char manpath[])
+{
+  FILE        *fp;
+  char        line[BUFSIZ];
+  char        *path;
+  Bool  firstpath = TRUE;
+
+  if (!(fp = fopen(MANCONF, "r")))
+    return(FALSE);
+
+  while (fgets(line, sizeof(line), fp)) {
+    path = strtok(line, " \t\n");
+    if (!path || *path == '#' || (strcmp(path, "MANPATH") != 0))
+      continue;
+    path = strtok((char *)NULL, " \t\n");
+    if (!path || *path == '#')
+      return FALSE;
+    if (firstpath) {
+      strcpy(manpath, path);
+      firstpath = FALSE;
+    }
+    else {
+      strcat(manpath, ":");
+      strcat(manpath, path);
+    }
+  }
+  fclose(fp);
+  return(!firstpath);
+}
+
+#elif defined(MANCONFIGSTYLE_OpenBSD) /* not FreeBSD or Linux */
+
+/*    Function Name: ReadManConfig
+ *    Description: Reads man.conf file used by Open/NetBSD
+ *      Argument: manpath - char array to return path in.
+ *    Returns: TRUE if read was successful.
+ *
+ *     This version expands the glob pattern that can be found 
+ *     in man.conf
+ */
+#include <glob.h>
+
+Bool
+ReadManConfig(char manpath[])
+{
+    FILE        *fp;
+    char        line[BUFSIZ];
+    char        *path;
+    Bool        firstpath = TRUE;
+    glob_t      gs;
+    int         i;
+    
+    if (!(fp = fopen(MANCONF, "r")))
+       return(FALSE);
+    
+    while (fgets(line, sizeof(line), fp)) {
+       path = strtok(line, " \t\n");
+       if (!path || *path == '#')
+           continue;
+       if (strcmp(path, "_default")) {
+           /* for now */
+           continue;
+       }
+       memset(&gs, 0, sizeof(glob_t));
+       while ((path = strtok((char *)NULL, " \t\n"))) {
+           if (glob(path, GLOB_BRACE, NULL, &gs) < 0) {
+               fclose(fp);
+               return FALSE;
+           }
+       } /* while */
+       for (i = 0; i < gs.gl_pathc; i++) {
+           
+           if (firstpath) {
+               strcpy(manpath, gs.gl_pathv[i]);
+               firstpath = FALSE;
+           }
+           else {
+               strcat(manpath, ":");
+               strcat(manpath, gs.gl_pathv[i]);
+           }
+       } /* for */
+       globfree(&gs);
+    }
+    fclose(fp);
+    return(!firstpath);
+}
+
+#elif defined(MANCONFIGSTYLE_BSD) /* not FreeBSD, Linux, or OpenBSD */
+
+/*    Function Name: ReadManConfig
+ *    Description: Reads man.conf file used by BSD 4.4
+ *      Argument: manpath - char array to return path in.
+ *    Returns: TRUE if read was successful.
+ */
+
+Bool
+ReadManConfig(manpath)
+
+char  manpath[];
+
+{
+  FILE        *fp;
+  char        line[BUFSIZ];
+  char        *path;
+  Bool  firstpath = TRUE;
+
+  if (!(fp = fopen(MANCONF, "r")))
+    return(FALSE);
+
+  while (fgets(line, sizeof(line), fp)) {
+    path = strtok(line, " \t\n");
+    if (!path || *path == '#' || strcmp(path, "_default"))
+      continue;
+    while ((path = strtok((char *)NULL, " \t\n"))) {
+      if (firstpath) {
+        strcpy(manpath, path);
+        firstpath = FALSE;
+      }
+      else {
+        strcat(manpath, ":");
+        strcat(manpath, path);
+      }
+    }
+  }
+  fclose(fp);
+  return(!firstpath);
+}
+
+#else /* not BSD */
+
+#error "MANCONF defined (in vendor.h) for unknown operating system."
+
+#endif /* MANCONFIGSTYLE == FreeBSD ... BSD */
+
+#endif /* MANCONF */
diff --git a/xman/man.h b/xman/man.h
new file mode 100644 (file)
index 0000000..f7f04b4
--- /dev/null
@@ -0,0 +1,283 @@
+/* $XConsortium: man.h,v 1.31 94/12/16 21:36:53 gildea Exp $ */
+/* $XdotOrg: xc/programs/xman/man.h,v 1.6 2004/07/29 00:40:35 gisburn Exp $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86: xc/programs/xman/man.h,v 1.4 2001/07/25 15:05:27 dawes Exp $ */
+
+
+/* X toolkit header files */
+
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Shell.h>
+
+#include <X11/Xaw/Cardinals.h>
+
+/* Std system and C header files */
+
+#include <stdio.h>
+#include <limits.h>
+
+#include <X11/Xfuncs.h>
+#include <X11/Xos.h>
+
+/* X include files */
+
+#include <X11/Xatom.h>
+
+/* Widget header files. */
+
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/SmeBSB.h>
+#include <X11/Xaw/Box.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Dialog.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/List.h>
+#include <X11/Xaw/MenuButton.h>
+#include <X11/Xaw/SimpleMenu.h>
+#include <X11/Xaw/Paned.h>
+#include <X11/Xaw/Viewport.h>
+
+/* program specific header files. */
+
+#include "ScrollByL.h"
+
+#include "version.h"
+#include "defs.h"
+
+/* Turn a NULL pointer string into an empty string */
+#define NULLSTR(x) (((x)!=NULL)?(x):(""))
+
+#define Error(x) { printf x ; exit(EXIT_FAILURE); }
+#define Assertion(expr, msg) { if (!(expr)) { Error msg } }
+#ifdef DEBUG
+#  define Log(x)   { if(True)  printf x; }
+#else
+#  define Log(x)   { if(False) printf x; }
+#endif /* DEBUG */
+
+/* 
+ * Assigning values here allows the user of Bitwise Or.
+ */
+
+typedef struct _XmanFonts {
+  XFontStruct * directory;             /* The font for the directory.  */
+} XmanFonts;
+
+typedef struct _XmanCursors {
+  Cursor top,                  /* The top Cursor, default for xman. */
+    help,                      /* The top cursor for the help menu. */
+    manpage,                   /* The cursor for the Manpage. */
+    search_entry;              /* The cursor for the text widget in the
+                                  search box.*/
+  Pixel fg_color;              /* foreground color of cursors. */
+  Pixel bg_color;              /* background color of cursors. */
+} XmanCursors;
+
+typedef struct _ManPageWidgets {
+  Widget manpage,              /* The manual page window (scrolled) */
+    directory,                 /* The widget in which all directories will
+                                  appear. */
+    *box;                      /* The boxes containing the sections. */
+} ManPageWidgets;
+
+typedef struct _MenuStruct {
+  caddr_t data;
+  int number;
+  XrmQuark quark;
+} MenuStruct;
+
+/*
+ * The manual sections and entries
+ */
+
+typedef struct tManual {
+  char * blabel;               /* The button label. */
+  char ** entries;             /* The individual man page file names. */
+  char ** entries_less_paths;   /* Entry names only */
+  int nentries;                        /* how many (TOTAL)*/
+  int nalloc;                  /* how much space allocated */
+  int flags;                   /* suffix, fold */
+} Manual;
+   
+/* psuedo Globals that are specific to each manpage created. */
+
+typedef struct _ManpageGlobals{
+  int current_directory;       /* The directory currently being shown 
+                                  on this manpage. */
+  Boolean dir_shown,           /* True if the directory is then current
+                                  visable screen */
+    both_shown;                        /* If true then both the manpage and
+                                  the directory are to be shown.*/
+  Widget label,                        /* The label widget at the top of the page. */
+    standby,                   /* The please standby widget. */
+    save,                      /* The "would you like to save?" widget. */
+    search_widget,             /* The search widget popup. */
+    help_button,               /* The help button. */
+    option_menu,               /* The option menu. */
+    text_widget;               /* text widget containing search string. */
+  /* Widgets (Objects really) for the command menu entries. */ 
+  Widget dir_entry, manpage_entry, help_entry, 
+    search_entry, both_screens_entry, remove_entry, 
+    open_entry, print_entry, version_entry, quit_entry; 
+#ifdef INCLUDE_XPRINT_SUPPORT
+  /* Print objects and data */
+  Widget printdialog_shell;     /* Shell for the print dialog */
+  Widget printdialog;           /* Print dialog */
+#endif /*INCLUDE_XPRINT_SUPPORT */
+  /* Misc. */
+
+  char manpage_title[80];       /* The label to use for the current manpage. */
+
+  char save_file[80];          /* the name of the file to save fomatted 
+                                  page into. */
+  char tempfile[80];           /* the name of the file to copy the formatted
+                                  page from. */
+  Boolean compress;            /* Compress file on save? */
+  Boolean gzip;                        /* Gzip file on save? */
+  Boolean bzip2;               /* Bzip2 file on save? */
+  Boolean lzma;
+  Boolean deletetempfile;      /* Need to delete tempfile when done? */
+  char ** section_name;                /* The name of each of the sections */
+
+  ManPageWidgets manpagewidgets; /* The manpage widgets. */
+
+  /* Things to remember when cleaning up when killing manpage. */
+
+  Widget This_Manpage;         /* a pointer to the root of
+                                  this manpage. */
+
+  FILE  *curr_file;             /* Current file shown in manpage widget */
+} ManpageGlobals;
+
+
+/* Resource manager sets these. */
+
+typedef struct _Xman_Resources {
+  XmanFonts fonts;             /* The fonts used for the man pages. */
+  XmanCursors cursors;         /* The cursors for xman. */
+  Boolean show_help_syntax;    /* True if syntax message should be dumped to
+                                  stdout. */
+  Boolean both_shown_initial;  /* The initial state of the manual pages
+                                  show two screens or only one. */
+  Boolean top_box_active;      /* Put up the Top Box. */
+  Boolean clear_search_string; /* clear the search string each time it
+                                  is popped down? */
+  int directory_height;                /* The default height of directory in 
+                                  both_shown mode. */
+  char * help_file;            /* The name of the help file. */
+  char * title;                        /* The title for topBox */
+  Boolean iconic;              /* Should topBox come up in an iconic state */
+} Xman_Resources;
+
+/************************************************************
+ *
+ * Function Defintions 
+ * 
+ ************************************************************/
+
+/*
+ * This is easier than trying to find all calls to StrAlloc().
+ */
+
+#define StrAlloc(ptr) XtNewString(ptr)
+
+/* Standard library function definitions. */
+#include <stdlib.h>
+
+/* buttons.c */
+
+ManpageGlobals * InitPsuedoGlobals(void);
+Widget CreateManpage(FILE * file);
+void CreateManpageWidget(ManpageGlobals * man_globals, char * name, Boolean full_instance);
+void FormUpWidgets(Widget parent, char ** full_size, char ** half_size);
+void MakeDirectoryBox(ManpageGlobals *man_globals, Widget parent, Widget *dir_disp, int section);
+void MakeSaveWidgets(ManpageGlobals *man_globals, Widget parent);
+void MakeTopBox(void);
+
+/* handler.c */
+
+void DirPopupCallback(Widget w, XtPointer pointer, XtPointer junk);
+void DirectoryHandler(Widget w, XtPointer global_pointer, XtPointer ret_val);
+void OptionCallback(Widget w, XtPointer pointer, XtPointer junk);
+void Popup(Widget w, XtGrabKind grab_kind);
+
+/* Action Routines. */
+
+void CreateNewManpage(Widget w, XEvent * event, String * params, Cardinal * num_params);
+void GotoPage(Widget w, XEvent * event, String * params, Cardinal * num_params);
+void PopupHelp(Widget w, XEvent * event, String * params, Cardinal * num_params);
+void PopupSearch(Widget w, XEvent * event, String * params, Cardinal * num_params);
+void Quit(Widget w, XEvent * event, String * params, Cardinal * num_params);
+void RemoveThisManpage(Widget w, XEvent * event, String * params, Cardinal * num_params);
+void SaveFormattedPage(Widget w, XEvent * event, String * params, Cardinal * num_params);
+void Search(Widget w, XEvent * event, String * params, Cardinal * num_params);
+#ifdef INCLUDE_XPRINT_SUPPORT
+void PrintThisManpage(Widget w, XEvent * event, String * params, Cardinal * num_params);
+#endif /* INCLUDE_XPRINT_SUPPORT */
+void ShowVersion(Widget w, XEvent * event, String * params, Cardinal * num_params);
+
+/* help.c */
+
+Boolean MakeHelpWidget(void);
+Boolean OpenHelpfile(ManpageGlobals * man_globals);
+
+/* man.c */
+Bool ReadManConfig(char manpath[]);
+int Man(void);
+
+/* misc.c */
+FILE * FindManualFile(ManpageGlobals * man_globals, int section_num, int entry_num);
+ManpageGlobals * GetGlobals(Widget w);
+void AddCursor(Widget w, Cursor cursor);
+void ChangeLabel(Widget w, char * str);
+void OpenFile(ManpageGlobals * man_globals, FILE * file);
+void PopupWarning(ManpageGlobals * man_globals, char * string);
+void PositionCenter(Widget widget, int x, int y, int above, int left, int v_space, int h_space);
+void PrintError(char * string);
+void RemoveGlobals(Widget w);
+void SaveGlobals(Widget w, ManpageGlobals * globals);
+void ParseEntry(char *entry, char *path, char *sect, char *page);
+FILE * Format(ManpageGlobals * man_globals, char * entry);
+
+/* search */
+FILE * DoSearch(ManpageGlobals * man_globals, int type);
+void MakeSearchWidget(ManpageGlobals * man_globals, Widget parent);
+
+/* tkfunctions.c */
+
+int Width(Widget);
+int Height(Widget);
+int BorderWidth(Widget);
+char * Name(Widget);
diff --git a/xman/misc.c b/xman/misc.c
new file mode 100644 (file)
index 0000000..b5b9f07
--- /dev/null
@@ -0,0 +1,1285 @@
+/* $XConsortium: misc.c,v 1.31 94/12/16 21:36:53 gildea Exp $ */
+/* $XdotOrg: xc/programs/xman/misc.c,v 1.6 2004/09/02 08:40:33 kem Exp $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86: xc/programs/xman/misc.c,v 1.10 2003/08/02 17:35:48 herrb Exp $ */
+
+/*
+ * xman - X window system manual page display program.
+ * Author:    Chris D. Peterson, MIT Project Athena
+ * Created:   October 27, 1987
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "globals.h"
+#include "vendor.h"
+#include <X11/Xos.h>           /* sys/types.h and unistd.h included in here */
+#include <sys/stat.h>
+#include <errno.h>
+#include <X11/Xaw/Dialog.h>
+#include <X11/Shell.h>
+
+static FILE * Uncompress(ManpageGlobals * man_globals, char * filename);
+#ifndef HAS_MKSTEMP
+static Boolean UncompressNamed(ManpageGlobals * man_globals, char * filename,
+                              char * output);
+static Boolean UncompressUnformatted(ManpageGlobals * man_globals,
+                                    char * entry, char * filename);
+#else
+static Boolean UncompressNamed(ManpageGlobals * man_globals, char * filename,
+                              char * output, FILE ** output_fd);
+static Boolean UncompressUnformatted(ManpageGlobals * man_globals,
+                                    char * entry, char * filename,
+                                    FILE **file);
+#endif
+#ifdef HANDLE_ROFFSEQ
+static Boolean ConstructCommand(char * cmdbuf, char * path, char * filename, char * tempfile);
+#endif
+
+#if defined(ISC) || defined(__SCO__) || defined(__UNIXWARE__)
+static char *uncompress_format = NULL;
+static char *uncompress_formats[] =
+      {  UNCOMPRESS_FORMAT_1,
+         UNCOMPRESS_FORMAT_2,
+         UNCOMPRESS_FORMAT_3
+      };
+#endif
+
+/*     Function Name: PopupWarning
+ *     Description: This function pops upa warning message.
+ *     Arguments: string - the specific warning string.
+ *     Returns: none
+ */
+
+static Widget warnShell, warnDialog;
+
+static void
+PopdownWarning(Widget w, XtPointer client, XtPointer call)
+{
+  XtPopdown((Widget)client);
+}
+
+void
+PopupWarning(ManpageGlobals * man_globals, char * string)
+{
+  int n;
+  Arg wargs[3];
+  Dimension topX, topY;
+  char buffer[BUFSIZ];
+  Boolean hasPosition;
+
+  snprintf( buffer, sizeof(buffer), "Xman Warning: %s", string);
+  hasPosition = FALSE;
+  if (top)
+  {
+    n=0;
+    XtSetArg(wargs[n], XtNx, &topX); n++;
+    XtSetArg(wargs[n], XtNy, &topY); n++;
+    XtGetValues(top, wargs, n);
+    hasPosition = TRUE;
+  }
+
+  if (man_globals != NULL)
+    ChangeLabel(man_globals->label, buffer);
+  if (man_globals->label == NULL) {
+    n=0;
+    if (hasPosition)
+    {
+      XtSetArg(wargs[n], XtNx, topX); n++;
+      XtSetArg(wargs[n], XtNy, topY); n++;
+    }
+    XtSetArg(wargs[n], XtNtransientFor, top); n++;
+    warnShell = XtCreatePopupShell("warnShell", transientShellWidgetClass,
+                                  initial_widget, wargs, n);
+    XtSetArg(wargs[0], XtNlabel, buffer);
+    warnDialog = XtCreateManagedWidget("warnDialog", dialogWidgetClass,
+                                      warnShell, wargs, 1);
+    XawDialogAddButton(warnDialog, "dismiss", PopdownWarning,
+                      (XtPointer)warnShell);
+    XtRealizeWidget(warnShell);
+    Popup(warnShell, XtGrabNone);
+  }
+}
+
+/*     Function Name: PrintError
+ *     Description: This Function prints an error message and exits.
+ *     Arguments: string - the specific message.
+ *     Returns: none. - exits tho.
+ */
+
+void
+PrintError(char * string)
+{
+  fprintf(stderr,"Xman Error: %s\n",string);
+  exit(EXIT_FAILURE);
+}
+
+/*     Function Name: OpenFile
+ *     Description: Assignes a file to the manpage.
+ *     Arguments: man_globals - global structure.
+ *                 file        - the file pointer.
+ *     Returns: none
+ */
+
+void
+OpenFile(ManpageGlobals * man_globals, FILE * file)
+{
+  Arg arglist[1];
+  Cardinal num_args = 0;
+  
+  if (man_globals->curr_file) {
+#if 0 /* Ownership rules need to be fixed first */
+    fclose(man_globals->curr_file);
+#endif
+  }
+  man_globals->curr_file = file;
+
+  XtSetArg(arglist[num_args], XtNfile, man_globals->curr_file); num_args++;
+  XtSetValues(man_globals->manpagewidgets.manpage, arglist, num_args);
+}
+
+
+/*     Function Name: FindManualFile
+ *     Description: Opens the manual page file given the entry information.
+ *     Arguments: man_globals - the globals info for this manpage.
+ *                 section_num - section number of the man page.
+ *                 entry_num   - entry number of the man page.
+ *     Returns: fp - the file pointer
+ *
+ * NOTES:
+ *
+ * If there is a uncompressed section it will look there for uncompresed
+ * manual pages first and then for individually compressed file in the
+ * uncompressed section.
+ *
+ * If there is a compressed directory then it will also look there for
+ * the manual pages.
+ *
+ * If both of these fail then it will attempt to format the manual page.
+ */
+
+FILE *
+FindManualFile(ManpageGlobals * man_globals, int section_num, int entry_num)
+{
+  FILE * file;
+  char path[BUFSIZ], page[BUFSIZ], section[BUFSIZ], *temp;
+  char filename[BUFSIZ];
+  char * entry = manual[section_num].entries[entry_num];
+  int len_cat = strlen(CAT);
+#if defined(ISC) || defined(__SCO__) || defined(__UNIXWARE__)
+  int i;
+#endif
+
+  temp = CreateManpageName(entry, 0, 0);
+  snprintf(man_globals->manpage_title, sizeof(man_globals->manpage_title),
+    "The current manual page is: %s.", temp);
+  XtFree(temp);
+
+  ParseEntry(entry, path, section, page);
+
+/*
+ * Look for uncompressed files first.
+ */
+#if defined(__OpenBSD__) || defined(__NetBSD__)
+  /* look in machine subdir first */
+  snprintf(filename, sizeof(filename), "%s/%s%s/%s/%s", path, CAT,
+         section + len_cat, MACHINE, page);
+  if ( (file = fopen(filename,"r")) != NULL)
+    return(file);
+#endif
+
+  snprintf(filename, sizeof(filename), "%s/%s%s/%s", 
+    path, CAT, section + len_cat, page);
+  if ( (file = fopen(filename,"r")) != NULL)
+    return(file);
+
+/*
+ * Then for compressed files in an uncompressed directory.
+ */
+
+#if !defined(ISC) && !defined(__UNIXWARE__)
+#if defined(__OpenBSD__) || defined(__NetBSD__)
+  /* look in machine subdir first */
+  snprintf(filename, sizeof(filename), "%s/%s%s/%s/%s.%s", path, CAT,
+         section + len_cat, MACHINE, page, COMPRESSION_EXTENSION);
+  if ( (file = Uncompress(man_globals, filename)) != NULL)
+    return(file);
+#endif
+  snprintf(filename, sizeof(filename), "%s/%s%s/%s.%s", path, CAT,
+         section + len_cat, page, COMPRESSION_EXTENSION);
+  if ( (file = Uncompress(man_globals, filename)) != NULL)
+    return(file);
+#ifdef GZIP_EXTENSION
+  else {
+#if defined(__OpenBSD__) || defined(__NetBSD__)
+      /* look in machine subdir first */
+      snprintf(filename, sizeof(filename), "%s/%s%s/%s/%s.%s", path, CAT,
+             section + len_cat, MACHINE, page, GZIP_EXTENSION);
+      if ( (file = Uncompress(man_globals, filename)) != NULL)
+         return(file);
+#endif
+    snprintf(filename, sizeof(filename), "%s/%s%s/%s.%s", path, CAT,
+           section + len_cat, page, GZIP_EXTENSION);
+    if ( (file = Uncompress(man_globals, filename)) != NULL)
+      return(file);
+  }
+#endif
+#ifdef BZIP2_EXTENSION
+#if defined(__OpenBSD__) || defined(__NetBSD__)
+      /* look in machine subdir first */
+      snprintf(filename, sizeof(filename), "%s/%s%s/%s/%s.%s", path, CAT,
+             section + len_cat, MACHINE, page, BZIP2_EXTENSION);
+      if ( (file = Uncompress(man_globals, filename)) != NULL)
+         return(file);
+#endif
+  {
+    sprintf(filename, "%s/%s%s/%s.%s", path, CAT,
+           section + len_cat, page, BZIP2_EXTENSION);
+    if ( (file = Uncompress(man_globals, filename)) != NULL)
+      return(file);
+  }
+#endif
+#ifdef LZMA_EXTENSION
+  {
+    sprintf(filename, "%s/%s%s/%s.%s", path, CAT,
+           section + len_cat, page, LZMA_EXTENSION);
+    if ( (file = Uncompress(man_globals, filename)) != NULL)
+      return(file);
+  }
+#endif
+#else
+  for(i = 0; i < strlen(COMPRESSION_EXTENSIONS); i++) {
+      snprintf(filename, sizeof(filename), "%s/%s%s/%s.%c", path, CAT,
+            section + len_cat, page, COMPRESSION_EXTENSIONS[i]);
+      uncompress_format = uncompress_formats[i];
+#ifdef DEBUG
+      printf("Trying .%c ...\n", COMPRESSION_EXTENSIONS[i]);
+#endif
+      if ( (file = Uncompress(man_globals, filename)) != NULL)
+       return(file);
+  }
+#endif
+
+/*
+ * And lastly files in a compressed directory.
+ *
+ * The directory is not actually compressed it is just named man#.Z
+ * and all files in it are compressed without the .Z extension.
+ * HP does it this way (really :-).
+ */
+
+  snprintf(filename, sizeof(filename), "%s/%s%s.%s/%s", path, CAT, 
+          section + len_cat, COMPRESSION_EXTENSION, page);
+  if ( (file = Uncompress(man_globals, filename)) != NULL)
+    return(file);
+/*
+ * We did not find any preformatted manual pages, try to format it.
+ */
+
+  return(Format(man_globals, entry));
+}
+
+/*     Function Namecompress
+ *     Description: This function will attempt to find a compressed man
+ *                   page and uncompress it.
+ *     Arguments: man_globals - the psuedo global info.
+ *                 filename - name of file to uncompress.
+ *     Returns:; a pointer to the file or NULL.
+ */
+
+static FILE *
+Uncompress(ManpageGlobals * man_globals, char * filename)
+{
+  char tmp_file[BUFSIZ], error_buf[BUFSIZ];
+  FILE * file;
+
+#ifndef HAS_MKSTEMP
+  if ( !UncompressNamed(man_globals, filename, tmp_file) )
+    return(NULL);
+
+  else if ((file = fopen(tmp_file, "r")) == NULL) {
+      sprintf(error_buf, "Something went wrong in retrieving the %s",
+             "uncompressed manual page try cleaning up /tmp.");
+      PopupWarning(man_globals, error_buf);
+  }
+#else
+  if (!UncompressNamed(man_globals, filename, tmp_file, &file)) {
+      sprintf(error_buf, "Something went wrong in retrieving the %s",
+             "uncompressed manual page try cleaning up /tmp.");
+      PopupWarning(man_globals, error_buf);
+      return(NULL);
+  }
+#endif
+
+  unlink(tmp_file);            /* remove name in tree, it will remain
+                                  until we close the fd, however. */
+  return(file);
+}
+
+/*     Function Name: UncompressNamed
+ *     Description: This function will attempt to find a compressed man
+ *                   page and uncompress it.
+ *     Arguments: man_globals - the psuedo global info.
+ *                 filename - name of file to uncompress.
+ * RETURNED        output - the file name output (must be an allocated string).
+ *     Returns:; TRUE if the file was found.
+ */
+
+#ifndef HAS_MKSTEMP
+static Boolean
+UncompressNamed(ManpageGlobals * man_globals, char * filename, char * output)
+#else
+static Boolean
+UncompressNamed(ManpageGlobals * man_globals, char * filename, char * output,
+               FILE ** output_fd)
+#endif
+{
+  char tmp[BUFSIZ], cmdbuf[BUFSIZ], error_buf[BUFSIZ];
+  struct stat junk;
+#ifdef HAS_MKSTEMP
+  int fd;
+#endif
+
+  if (stat(filename, &junk) != 0) { /* Check for existance of the file. */
+    if (errno != ENOENT) {
+      snprintf(error_buf, sizeof(error_buf),
+              "Error while stating file %s, errno = %d", filename, errno);
+      PopupWarning(man_globals, error_buf);
+    }
+    return(FALSE);
+  }
+
+/*
+ * Using stdin is necessary to fool zcat since we cannot guarentee
+ * the .Z extension.
+ */
+
+  strcpy(tmp, MANTEMP);                /* get a temp file. */
+#ifndef HAS_MKSTEMP
+  (void) mktemp(tmp);
+#else
+  fd = mkstemp(tmp);
+  if (fd < 0) {
+      PopupWarning(man_globals, "Error creating a temp file");
+      return FALSE;
+  }
+  *output_fd = fdopen(fd, "r");
+#endif
+  strcpy(output, tmp);
+
+#ifdef GZIP_EXTENSION
+  if (streq(filename + strlen(filename) - strlen(GZIP_EXTENSION),
+           GZIP_EXTENSION))
+    snprintf(cmdbuf, sizeof(cmdbuf), GUNZIP_FORMAT, filename, output);
+  else
+#endif
+#ifdef BZIP2_EXTENSION
+  if (streq(filename + strlen(filename) - strlen(BZIP2_EXTENSION),
+           BZIP2_EXTENSION))
+    sprintf(cmdbuf, BUNZIP2_FORMAT, filename, output);
+  else
+#endif
+#ifdef LZMA_EXTENSION
+  if (streq(filename + strlen(filename) - strlen(LZMA_EXTENSION),
+           LZMA_EXTENSION))
+    sprintf(cmdbuf, UNLZMA_FORMAT, filename, output);
+  else
+#endif
+  snprintf(cmdbuf, sizeof(cmdbuf), UNCOMPRESS_FORMAT, filename, output);
+  if(system(cmdbuf) == 0)      /* execute search. */
+    return(TRUE);
+
+  snprintf(error_buf, sizeof(error_buf),
+          "Error while uncompressing, command was: %s", cmdbuf);
+  PopupWarning(man_globals, error_buf);
+  return(FALSE);
+}
+
+#if defined(SMAN) && defined(SFORMAT)
+/*     Function Name: SgmlToRoffNamed
+ *     Description: This function will attempt to find an SGML man
+ *                   page and convert it to roff format.
+ *     Arguments: man_globals - the psuedo global info.
+ *                 filename - name of file to uncompress.
+ * RETURNED        output - the file name output (must be an allocated string).
+ *     Returns:; TRUE if the file was found.
+ */
+
+#ifndef HAS_MKSTEMP
+static Boolean
+SgmlToRoffNamed(ManpageGlobals * man_globals, char * filename, char * output)
+#else
+static Boolean
+SgmlToRoffNamed(ManpageGlobals * man_globals, char * filename, char * output,
+               FILE ** output_fd)
+#endif
+{
+  char tmp[BUFSIZ], cmdbuf[BUFSIZ], error_buf[BUFSIZ];
+  struct stat junk;
+#ifdef HAS_MKSTEMP
+  int fd;
+#endif
+
+  if (stat(filename, &junk) != 0) { /* Check for existance of the file. */
+    if (errno != ENOENT) {
+      snprintf(error_buf, sizeof(error_buf),
+              "Error while stating file %s, errno = %d", filename, errno);
+      PopupWarning(man_globals, error_buf);
+    }
+    return(FALSE);
+  }
+
+  strcpy(tmp, MANTEMP);                /* get a temp file. */
+#ifndef HAS_MKSTEMP
+  (void) mktemp(tmp);
+#else
+  fd = mkstemp(tmp);
+  if (fd < 0) {
+      PopupWarning(man_globals, "Error creating a temp file");
+      return FALSE;
+  }
+  *output_fd = fdopen(fd, "r");
+#endif
+  strcpy(output, tmp);
+
+  snprintf(cmdbuf, sizeof(cmdbuf), "%s %s > %s", SFORMAT, filename, output);
+  if(system(cmdbuf) == 0)      /* execute search. */
+    return(TRUE);
+
+  snprintf(error_buf, sizeof(error_buf),
+          "Error while converting from sgml, command was: %s", cmdbuf);
+  PopupWarning(man_globals, error_buf);
+  return(FALSE);
+}
+#endif /* defined (SMAN) && defined(SFORMAT) */
+
+/*     Function Name: Format
+ *     Description: This funtion formats the manual pages and interfaces
+ *                   with the user.
+ *     Arguments: man_globals - the psuedo globals
+ *                 file - the file pointer to use and return
+ *                 entry - the current entry struct.
+ *                 current_box - The current directory being displayed.
+ *     Returns: none.
+ */
+
+/* ARGSUSED */
+
+FILE *
+Format(ManpageGlobals * man_globals, char * entry)
+{
+  FILE * file = NULL;
+#ifdef HAS_MKSTEMP
+  int fd;
+#endif
+  Widget manpage = man_globals->manpagewidgets.manpage;
+  char cmdbuf[BUFSIZ], tmp[BUFSIZ], filename[BUFSIZ], error_buf[BUFSIZ];
+  char path[BUFSIZ], sect[BUFSIZ];
+  XEvent event;
+  Position x,y;                        /* location to pop up the
+                                  "would you like to save" widget. */
+
+#ifndef HAS_MKSTEMP
+  if ( !UncompressUnformatted(man_globals, entry, filename) ) {
+#else
+  if ( !UncompressUnformatted(man_globals, entry, filename, &file) ) {
+#endif
+    /* We Really could not find it, this should never happen, yea right. */
+    snprintf(error_buf, sizeof(error_buf),
+            "Could not open manual page, %s", entry);
+    PopupWarning(man_globals, error_buf);
+    XtPopdown( XtParent(man_globals->standby) );
+    return(NULL);
+  }
+
+#ifndef HAS_MKSTEMP
+  if ((file = fopen(filename, "r")) != NULL) {
+#else
+  if (file != NULL) {
+#endif
+    char line[BUFSIZ];
+
+    if (fgets(line, sizeof(line), file) != NULL) {
+       if (strncmp(line, ".so ", 4) == 0) {
+         line[strlen(line) - 1] = '\0';
+         fclose(file);
+         unlink(filename);
+         if (line[4] != '/') {
+           char *ptr = NULL;
+
+           strcpy(tmp, entry);
+           if ((ptr = rindex(tmp, '/')) != NULL) {
+             *ptr = '\0';
+             if ((ptr = rindex(tmp, '/')) != NULL)
+               ptr[1] = '\0';
+           }
+         }
+         else
+           *tmp = '\0';
+         snprintf(filename, sizeof(filename), "%s%s", tmp, line + 4);
+
+         return (Format(man_globals, filename));
+       }
+    }
+    fclose(file);
+  }
+
+  Popup(XtParent(man_globals->standby), XtGrabExclusive);
+  while ( !XCheckTypedWindowEvent(XtDisplay(man_globals->standby),
+                                 XtWindow(man_globals->standby),
+                                 Expose, &event) );
+  XtDispatchEvent( &event );
+  XFlush(XtDisplay(man_globals->standby));
+
+  strcpy(tmp,MANTEMP);                   /* Get a temp file. */
+#ifndef HAS_MKSTEMP
+  (void) mktemp(tmp);
+#else
+  fd = mkstemp(tmp);
+  file = fdopen(fd, "r");
+#endif
+  strcpy(man_globals->tempfile, tmp);
+
+  ParseEntry(entry, path, sect, NULL);
+
+#ifndef HANDLE_ROFFSEQ
+#ifndef HAS_MKSTEMP
+  snprintf(cmdbuf, sizeof(cmdbuf), "cd %s ; %s %s %s > %s %s", path, TBL,
+         filename, FORMAT, man_globals->tempfile, "2> /dev/null");
+#else
+  snprintf(cmdbuf, sizeof(cmdbuf), "cd %s ; %s %s %s >> %s %s", path, TBL,
+         filename, FORMAT, man_globals->tempfile, "2> /dev/null");
+#endif
+#else
+  /* Handle more flexible way of specifying the formatting pipeline */
+  if (! ConstructCommand(cmdbuf, path, filename, man_globals->tempfile)) {
+     sprintf(error_buf, "Constructed command was too long!");
+     PopupWarning(man_globals, error_buf);
+     file = NULL;
+  }
+  else
+#endif /* HANDLE_ROFFSEQ */
+
+  if(system(cmdbuf) != 0) {    /* execute search. */
+    snprintf(error_buf, sizeof(error_buf),
+           "Something went wrong trying to run the command: %s", cmdbuf);
+    PopupWarning(man_globals, error_buf);
+    file = NULL;
+  }
+  else {
+#ifndef HAS_MKSTEMP
+    if ((file = fopen(man_globals->tempfile,"r")) == NULL) {
+      sprintf(error_buf, "Something went wrong in retrieving the %s",
+             "temp file, try cleaning up /tmp");
+      PopupWarning(man_globals, error_buf);
+    }
+    else {
+#endif
+
+      XtPopdown( XtParent(man_globals->standby) );
+
+      if ( (man_globals->save == NULL) ||
+          (man_globals->manpagewidgets.manpage == NULL) )
+       unlink(man_globals->tempfile);
+      else {
+       char * ptr, catdir[BUFSIZ];
+
+       /*
+        * If the catdir is writeable then ask the user if he/she wants to
+        * write the man page to it.
+        */
+
+       strcpy(catdir, man_globals->save_file);
+       if ( (ptr = rindex(catdir, '/')) != NULL) {
+         *ptr = '\0';
+
+         if ( access(catdir, W_OK) != 0 )
+           unlink(man_globals->tempfile);
+         else {
+           x = (Position) Width(man_globals->manpagewidgets.manpage)/2;
+           y = (Position) Height(man_globals->manpagewidgets.manpage)/2;
+           XtTranslateCoords(manpage, x, y, &x, &y);
+           PositionCenter( man_globals->save, (int) x, (int) y, 0, 0, 0, 0);
+           XtPopup( man_globals->save, XtGrabExclusive);
+         }
+       }
+       else
+         unlink(man_globals->tempfile);
+      }
+#ifndef HAS_MKSTEMP
+    }
+#endif
+  }
+
+ /*
+  * If the original was compressed or in another format, delete temporary file.
+  */
+  if (man_globals->deletetempfile) 
+    unlink(filename);
+
+  return(file);
+}
+
+#ifdef HANDLE_ROFFSEQ
+/*      Function Name: ConstructCommand
+ *      Description: Constructs the pipeline of commands necessary to format
+ *                   a manual page.
+ *      Arguments: cmdbuf - the buffer into which to write the command
+ *                 path - the directory in which the original man page resides
+ *                 filename - the (uncompressed) manpage source file
+ *                 tempfile - the name of a temporary file to direct the final
+ *                  output of the pipeline into
+ *      Returns: TRUE if the command fit into the buffer, FALSE if it would
+ *               be too long (more than BUFSIZ characters)
+ */
+static Boolean
+ConstructCommand(cmdbuf, path, filename, tempfile)
+   char *cmdbuf, *path, *filename, *tempfile;
+{
+   /* The original code did the following to produce a command line:
+    *   sprintf(cmdbuf,"cd %s ; %s %s %s > %s %s", path, TBL,
+    *      filename, FORMAT, man_globals->tempfile, "2> /dev/null");
+    * We are more flexible and follow more or less the algorithm used
+    * by the Linux man command:
+    *  + Obtain a string of letters from the following sources in order
+    *    of preference:
+    *    + a command line option (not implemented in xman; it's probably not
+    *      useful)
+    *    + the first line of the manpage source, if it is of the form:
+    *      '\" <string>
+    *    + the MANROFFSEQ environment variable
+    *    + a default string; this is "".
+    *  + Interpret the string as a pipeline of filters:
+    *    + e = eqn   g = grap   p = pic   t = tbl   v = vgrind   r = refer
+    *  + zsoelim is always run as the first preprocessor in any case.
+    *
+    * Strictly speaking we should save a catpage iff the string comes
+    * from the file or is the default.
+    *
+    * You'll notice that we format a man page into ASCII text output and then
+    * attempt to interpret things like L^HL as bold and so forth. This
+    * is so obviously the Wrong Thing it's untrue.
+    */
+   char *c = cmdbuf;           /* current posn in buffer */
+   int left = BUFSIZ;          /* space left in buffer */
+   int used;
+   char *fmt;
+   FILE *file;
+   char fmtbuf[128];
+   int gotfmt = 0;             /* set to 1 if we got a directive from source */
+   char *fname = NULL;
+#ifdef __UNIXOS2__
+   int i;
+#endif
+
+   fmt = NULL;
+   /* If you have a command line option that gives a setting for fmt,
+      set it here. */
+
+   if (!fmt) {
+      /* This is the tricky bit: extract a format string from the source file
+       * Annoyingly, filename might be relative or absolute. We cheat and
+       * use system to get the thing to a known absoute filename.
+       */
+      if (filename[0] == '/') {
+         fname = filename;
+      } else {
+         fname = malloc(strlen(path) + 1 + strlen(filename) + 1);
+         if (!fname)
+            return FALSE;
+         sprintf(fname, "%s/%s", path, filename);
+      }
+      if ((file = fopen(fname, "r")) &&
+          (fgets(fmtbuf, sizeof(fmtbuf), file)) &&
+          (!memcmp(fmtbuf, "'\\\" ", 4))) {
+                              /* that's squote-backslash-dquote-space */
+         int len;
+         fmt = fmtbuf + 3;
+         len = strlen(fmt);
+         if (len && (fmt[len-1] == '\n')) {
+            fmt[len-1] = 0;
+            gotfmt++;
+         }
+      }
+      if (fname && fname != filename)
+         free(fname);
+      if (!gotfmt)                                /* not there or some error */
+      {
+         fmt = getenv("MANROFFSEQ");
+      }
+   }
+
+   if (!fmt)
+   {
+      fmt = DEFAULT_MANROFFSEQ;
+   }
+
+
+   /* Start with the first fixed part of the command line */
+#ifdef __UNIXOS2__
+   for (i = 0; i < strlen(path); i++) {
+     if (path[i] == '/')
+       path[i] = '\\';
+   }
+   used = snprintf(c, left, "cd %s & %s %s ", path, ZSOELIM, filename);
+#else
+   used = snprintf(c, left, "cd %s; %s %s ", path, ZSOELIM, filename);
+#endif
+   left -= used;
+   c += used;
+   if (left <= 1)
+      return (FALSE);
+
+   /* Now add preprocessors of the form '| processor' */
+   for ( ; *fmt; fmt++)
+   {
+      char *filter;
+      switch (*fmt)
+      {
+         case 'e':
+            filter = EQN;
+            break;
+         case 'g':
+            filter = GRAP;
+            break;
+         case 'p':
+            filter = PIC;
+            break;
+         case 't':
+            filter = TBL;
+            break;
+         case 'v':
+            filter = VGRIND;
+            break;
+         case 'r':
+            filter = REFER;
+            break;
+         default:
+            filter = NULL;
+            break;
+      }
+      if (filter)
+      {
+         used = snprintf(c, left, " | %s ", filter);
+         left -= used;
+         c += used;
+         if (left <= 1)
+            return (FALSE);
+      }
+   }
+
+   /* Now add the fixed trailing part 'formatprog > tempfile 2> /dev/null' */
+#ifdef __UNIXOS2__
+   used = snprintf(c, left, " | %s > %s 2>NUL", FORMAT, tempfile);
+#else
+#ifndef HAS_MKSTEMP
+   used = snprintf(c, left, " | %s > %s 2>/dev/null", FORMAT, tempfile);
+#else
+   used = snprintf(c, left, " | %s >> %s 2>/dev/null", FORMAT, tempfile);
+#endif
+#endif /* __UNIXOS2__ */
+   left -= used;
+   if (left <= 1)
+      return (FALSE);
+
+   return (TRUE);
+}
+#endif /* HANDLE_ROFFSEQ */
+
+/*     Function Name: UncompressUnformatted
+ *     Description: Finds an uncompressed unformatted manual page.
+ *     Arguments: man_globals - the psuedo global structure.
+ *                 entry - the manual page entry.
+ * RETURNED        filename - location to put the name of the file.
+ *     Returns: TRUE if the file was found.
+ */
+
+static Boolean
+#ifndef HAS_MKSTEMP
+UncompressUnformatted(ManpageGlobals * man_globals, char * entry,
+                     char * filename)
+#else
+UncompressUnformatted(ManpageGlobals * man_globals, char * entry,
+                     char * filename, FILE **file)
+#endif
+{
+  char path[BUFSIZ], page[BUFSIZ], section[BUFSIZ], input[BUFSIZ];
+  int len_cat = strlen(CAT), len_man = strlen(MAN);
+#if defined(SMAN) && defined(SFORMAT)
+  int len_sman = strlen(SMAN);
+#endif
+
+  ParseEntry(entry, path, section, page);
+
+  man_globals->bzip2 = FALSE;
+  man_globals->lzma = FALSE;
+
+#if defined(__OpenBSD__) || defined(__NetBSD__)
+  /*
+   * look for uncompressed file in machine subdir first
+   */
+  snprintf(filename, BUFSIZ, "%s/%s%s/%s/%s", path, MAN,
+         section + len_cat, MACHINE, page);
+  if ( access( filename, R_OK ) == 0 ) {
+    man_globals->compress = FALSE;
+    man_globals->gzip = FALSE;
+    man_globals->deletetempfile = FALSE;
+    snprintf(man_globals->save_file, sizeof(man_globals->save_file),
+            "%s/%s%s/%s/%s", path, CAT, section + len_cat, MACHINE, page);
+    return(TRUE);
+  }
+ /*
+  * Then for compressed files in an uncompressed directory.
+  */
+  snprintf(input, sizeof(input), "%s.%s", filename, COMPRESSION_EXTENSION);
+#ifndef HAS_MKSTEMP
+  if ( UncompressNamed(man_globals, input, filename) ) {
+#else
+  if ( UncompressNamed(man_globals, input, filename, file) ) {
+#endif
+    man_globals->compress = TRUE;
+    man_globals->deletetempfile = TRUE;
+    snprintf(man_globals->save_file, sizeof(man_globals->save_file),
+            "%s/%s%s/%s.%s", path, CAT, section + len_cat, page, 
+            COMPRESSION_EXTENSION);
+    return(TRUE);
+  }
+#ifdef GZIP_EXTENSION
+  else {
+    snprintf(input, sizeof(input), "%s.%s", filename, GZIP_EXTENSION);
+#ifndef HAS_MKSTEMP
+    if ( UncompressNamed(man_globals, input, filename) ) {
+#else
+    if ( UncompressNamed(man_globals, input, filename, file) ) {
+#endif
+      man_globals->compress = TRUE;
+      man_globals->gzip = TRUE;
+      man_globals->deletetempfile = TRUE;
+      snprintf(man_globals->save_file, sizeof(man_globals->save_file),
+              "%s/%s%s/%s.%s", path, CAT, section + len_cat, page,
+              GZIP_EXTENSION);
+      return(TRUE);
+    }
+  }
+#endif /* GZIP_EXTENSION */
+#endif /* __OpenBSD__ || __NetBSD__ */
+
+#ifdef BZIP2_EXTENSION
+ {
+    sprintf(input, "%s.%s", filename, BZIP2_EXTENSION);
+#ifndef HAS_MKSTEMP
+    if ( UncompressNamed(man_globals, input, filename) ) {
+#else
+    if ( UncompressNamed(man_globals, input, filename, file) ) {
+#endif
+      man_globals->compress = TRUE;
+      man_globals->gzip = FALSE;
+      man_globals->bzip2 = TRUE;
+      sprintf(man_globals->save_file, "%s/%s%s/%s.%s", path,
+             CAT, section + len_cat, page, BZIP2_EXTENSION);
+      return(TRUE);
+    }
+  }
+#endif /* BZIP2_EXTENSION */
+
+#ifdef LZMA_EXTENSION
+ {
+    sprintf(input, "%s.%s", filename, LZMA_EXTENSION);
+#ifndef HAS_MKSTEMP
+    if ( UncompressNamed(man_globals, input, filename) ) {
+#else
+    if ( UncompressNamed(man_globals, input, filename, file) ) {
+#endif
+      man_globals->compress = TRUE;
+      man_globals->gzip = FALSE;
+      man_globals->lzma = TRUE;
+      sprintf(man_globals->save_file, "%s/%s%s/%s.%s", path,
+             CAT, section + len_cat, page, LZMA_EXTENSION);
+      return(TRUE);
+    }
+  }
+#endif /* LZMA_EXTENSION */
+
+/*
+ * Look for uncompressed file first.
+ */
+
+  snprintf(filename, BUFSIZ, "%s/%s%s/%s", path, MAN, section + len_man, page);
+  if ( access( filename, R_OK ) == 0 ) {
+    man_globals->compress = FALSE;
+    man_globals->gzip = FALSE;
+    man_globals->deletetempfile = FALSE;
+    snprintf(man_globals->save_file, sizeof(man_globals->save_file), 
+            "%s/%s%s/%s", path, CAT, section + len_cat, page);
+    return(TRUE);
+  }
+
+#if defined(SMAN) && defined(SFORMAT)
+ /*
+  * Look for uncompressed sgml file next.
+  */
+
+  snprintf(input, BUFSIZ, "%s/%s%s/%s", path, SMAN, section + len_sman, page);
+#ifndef HAS_MKSTEMP
+  if ( SgmlToRoffNamed(man_globals, input, filename) ) {
+#else
+  if ( SgmlToRoffNamed(man_globals, input, filename, file) ) {
+#endif
+    man_globals->compress = FALSE;
+    man_globals->gzip = FALSE;
+    man_globals->deletetempfile = TRUE;
+    snprintf(man_globals->save_file, sizeof(man_globals->save_file),
+            "%s/%s%s/%s", path, CAT, section + len_cat, page);
+    return(TRUE);
+  }
+#endif
+
+/*
+ * Then for compressed files in an uncompressed directory.
+ */
+
+  snprintf(input, sizeof(input), "%s.%s", filename, COMPRESSION_EXTENSION);
+#ifndef HAS_MKSTEMP
+  if ( UncompressNamed(man_globals, input, filename) ) {
+#else
+  if ( UncompressNamed(man_globals, input, filename, file) ) {
+#endif
+    man_globals->compress = TRUE;
+    man_globals->deletetempfile = TRUE;
+    snprintf(man_globals->save_file, sizeof(man_globals->save_file),
+            "%s/%s%s/%s.%s", path, CAT, section + len_cat, page, 
+            COMPRESSION_EXTENSION);
+    return(TRUE);
+  }
+#ifdef GZIP_EXTENSION
+  else {
+    snprintf(input, sizeof(input), "%s.%s", filename, GZIP_EXTENSION);
+#ifndef HAS_MKSTEMP
+    if ( UncompressNamed(man_globals, input, filename) ) {
+#else
+    if ( UncompressNamed(man_globals, input, filename, file) ) {
+#endif 
+      man_globals->compress = TRUE;
+      man_globals->gzip = TRUE;
+      man_globals->deletetempfile = TRUE;
+      snprintf(man_globals->save_file, sizeof(man_globals->save_file),
+              "%s/%s%s/%s.%s", path, CAT, section + len_cat, page, 
+              GZIP_EXTENSION);
+      return(TRUE);
+    }
+  }
+#endif
+
+#ifdef BZIP2_EXTENSION
+  {
+    sprintf(input, "%s.%s", filename, BZIP2_EXTENSION);
+#ifndef HAS_MKSTEMP
+    if ( UncompressNamed(man_globals, input, filename) ) {
+#else
+    if ( UncompressNamed(man_globals, input, filename, file) ) {
+#endif 
+      man_globals->compress = TRUE;
+      man_globals->gzip = TRUE;
+      sprintf(man_globals->save_file, "%s/%s%s/%s.%s", path,
+             CAT, section + len_cat, page, BZIP2_EXTENSION);
+      return(TRUE);
+    }
+  }
+#endif
+
+#ifdef LZMA_EXTENSION
+  {
+    sprintf(input, "%s.%s", filename, LZMA_EXTENSION);
+#ifndef HAS_MKSTEMP
+    if ( UncompressNamed(man_globals, input, filename) ) {
+#else
+    if ( UncompressNamed(man_globals, input, filename, file) ) {
+#endif 
+      man_globals->compress = TRUE;
+      man_globals->lzma = TRUE;
+      sprintf(man_globals->save_file, "%s/%s%s/%s.%s", path,
+             CAT, section + len_cat, page, LZMA_EXTENSION);
+      return(TRUE);
+    }
+  }
+#endif
+
+/*
+ * And lastly files in a compressed directory.
+ */
+
+  snprintf(input, sizeof(input), "%s/%s%s.%s/%s", path,
+         MAN, section + len_man, COMPRESSION_EXTENSION, page);
+#ifndef HAS_MKSTEMP
+  if ( UncompressNamed(man_globals, input, filename) ) {
+#else
+  if ( UncompressNamed(man_globals, input, filename, file) ) {
+#endif
+    man_globals->compress = TRUE;
+    man_globals->deletetempfile = TRUE;
+    snprintf(man_globals->save_file, sizeof(man_globals->save_file),
+            "%s/%s%s.%s/%s", path, CAT, section + len_cat, 
+            COMPRESSION_EXTENSION, page);
+    return(TRUE);
+  }
+  return(FALSE);
+}
+
+/*     Function Name: AddCursor
+ *     Description: This function adds the cursor to the window.
+ *     Arguments: w - the widget to add the cursor to.
+ *                 cursor - the cursor to add to this widget.
+ *     Returns: none
+ */
+
+void
+AddCursor(Widget w, Cursor cursor)
+{
+  XColor colors[2];
+  Arg args[10];
+  Cardinal num_args = 0;
+  Colormap c_map;
+
+  if (!XtIsRealized(w)) {
+    PopupWarning(NULL, "Widget is not realized, no cursor added.\n");
+    return;
+  }
+
+  XtSetArg( args[num_args], XtNcolormap, &c_map); num_args++;
+  XtGetValues( w, args, num_args);
+
+  colors[0].pixel = resources.cursors.fg_color;
+  colors[1].pixel = resources.cursors.bg_color;
+
+  XQueryColors (XtDisplay(w), c_map, colors, 2);
+  XRecolorCursor(XtDisplay(w), cursor, colors, colors+1);
+  XDefineCursor(XtDisplay(w),XtWindow(w),cursor);
+}
+
+/*     Function Name: ChangeLabel
+ *     Description: This function changes the label field of the
+ *                   given widget to the string in str.
+ *     Arguments: w - the widget.
+ *                 str - the string to change the label to.
+ *     Returns: none
+ */
+
+void
+ChangeLabel(Widget w, char * str)
+{
+  Arg arglist[3];              /* An argument list. */
+
+  if (w == NULL) return;
+
+  XtSetArg(arglist[0], XtNlabel, str);
+
+/* shouldn't really have to do this. */
+  XtSetArg(arglist[1], XtNwidth, 0);
+  XtSetArg(arglist[2], XtNheight, 0);
+
+  XtSetValues(w, arglist, (Cardinal) 1);
+}
+
+/*
+ * In an ideal world this would be part of the XToolkit, and I would not
+ * have to do it, but such is life sometimes.  Perhaps in X11R3.
+ */
+
+/*     Function Name: PositionCenter
+ *     Description: This function positions the given widgets center
+ *                   in the following location.
+ *     Arguments: widget - the widget widget to postion
+ *                 x,y - The location for the center of the widget
+ *                 above - number of pixels above center to locate this widget
+ *                 left - number of pixels left of center to locate this widget
+ *                 h_space, v_space - how close to get to the edges of the
+ *                                    parent window.
+ *     Returns: none
+ *      Note:  This should only be used with a popup widget that has override
+ *             redirect set.
+ */
+
+void
+PositionCenter(Widget widget, int x, int y, int above, int left, int v_space, int h_space)
+{
+  Arg wargs[2];
+  int x_temp,y_temp;           /* location of the new window. */
+  int parent_height,parent_width; /* Height and width of the parent widget or
+                                  the root window if it has no parent. */
+
+  x_temp = x - left - Width(widget) / 2 + BorderWidth(widget);
+  y_temp = y - above -  Height(widget) / 2 + BorderWidth(widget);
+
+  parent_height = HeightOfScreen(XtScreen(widget));
+  parent_width = WidthOfScreen(XtScreen(widget));
+
+/*
+ * Check to make sure that all edges are within the viewable part of the
+ * root window, and if not then force them to be.
+ */
+
+  if (x_temp < h_space)
+    x_temp = v_space;
+  if (y_temp < v_space)
+    (y_temp = 2);
+
+  if ( y_temp + Height(widget) + v_space > parent_height )
+      y_temp = parent_height - Height(widget) - v_space;
+
+  if ( x_temp + Width(widget) + h_space > parent_width )
+      x_temp = parent_width - Width(widget) - h_space;
+
+  XtSetArg(wargs[0], XtNx, x_temp);
+  XtSetArg(wargs[1], XtNy, y_temp);
+  XtSetValues(widget, wargs, 2);
+}
+
+/*     Function Name: ParseEntry(entry, path, sect, page)
+ *     Description: Parses the manual pages entry filenames.
+ *     Arguments: str - the full path name.
+ *                 path - the path name.      RETURNED
+ *                 sect - the section name.   RETURNED
+ *                 page - the page name.      RETURNED
+ *     Returns: none.
+ */
+
+void
+ParseEntry(char *entry, char *path, char *sect, char *page)
+{
+  char *c, temp[BUFSIZ];
+
+  strcpy(temp, entry);
+
+  c = rindex(temp, '/');
+  if (c == NULL)
+    PrintError("index failure in ParseEntry.");
+  *c++ = '\0';
+  if (page != NULL)
+    strcpy(page, c);
+
+  c = rindex(temp, '/');
+  if (c == NULL)
+    PrintError("index failure in ParseEntry.");
+  *c++ = '\0';
+#if defined(SFORMAT) && defined(SMAN)
+  /* sgmltoroff sometimes puts an extra ./ in the path to .so entries */
+  if (strcmp(c, ".") == 0) {
+      c = rindex(temp, '/');
+      if (c == NULL)
+         PrintError("index failure in ParseEntry.");
+      *c++ = '\0';
+  }
+#endif      
+#if defined(__OpenBSD__) || defined(__NetBSD__)
+  /* Skip machine subdirectory if present */
+  if (strcmp(c, MACHINE) == 0) {
+      c = rindex(temp, '/');
+      if (c == NULL)
+         PrintError("index failure in ParseEntry.");
+      *c++ = '\0';
+  }
+#endif
+  if (sect != NULL)
+    strcpy(sect, c);
+
+  if (path != NULL)
+    strcpy(path, temp);
+}
+
+/*      Function Name: GetGlobals
+ *      Description: Gets the psuedo globals associated with the
+ *                   manpage associated with this widget.
+ *      Arguments: w - a widget in the manpage.
+ *      Returns: the psuedo globals.
+ *      Notes: initial_widget is a globals variable.
+ *             manglobals_context is a global variable.
+ */
+
+ManpageGlobals *
+GetGlobals(Widget w)
+{
+  Widget temp;
+  caddr_t data;
+
+  while ( (temp = XtParent(w)) != initial_widget && (temp != NULL))
+    w = temp;
+
+  if (temp == NULL)
+    XtAppError(XtWidgetToApplicationContext(w),
+              "Xman: Could not locate widget in tree, exiting");
+
+  if (XFindContext(XtDisplay(w), XtWindow(w),
+                  manglobals_context, &data) != XCSUCCESS)
+    XtAppError(XtWidgetToApplicationContext(w),
+              "Xman: Could not find global data, exiting");
+
+  return( (ManpageGlobals *) data);
+}
+
+/*      Function Name: SaveGlobals
+ *      Description: Saves the psuedo globals on the widget passed
+ *                   to this function, although GetGlobals assumes that
+ *                   the data is associated with the popup child of topBox.
+ *      Arguments: w - the widget to associate the data with.
+ *                 globals - data to associate with this widget.
+ *      Returns: none.
+ *      Notes: WIDGET MUST BE REALIZED.
+ *             manglobals_context is a global variable.
+ */
+
+void
+SaveGlobals(Widget w, ManpageGlobals * globals)
+{
+  if (XSaveContext(XtDisplay(w), XtWindow(w), manglobals_context,
+                  (caddr_t) globals) != XCSUCCESS)
+    XtAppError(XtWidgetToApplicationContext(w),
+              "Xman: Could not save global data, are you out of memory?");
+}
+
+/*      Function Name: RemoveGlobals
+ *      Description: Removes the psuedo globals from the widget passed
+ *                   to this function.
+ *      Arguments: w - the widget to remove the data from.
+ *      Returns: none.
+ *      Notes: WIDGET MUST BE REALIZED.
+ *             manglobals_context is a global variable.
+ */
+
+void
+RemoveGlobals(Widget w)
+{
+  if (XDeleteContext(XtDisplay(w), XtWindow(w),
+                    manglobals_context) != XCSUCCESS)
+    XtAppError(XtWidgetToApplicationContext(w),
+              "Xman: Could not remove global data?");
+}
diff --git a/xman/missing b/xman/missing
new file mode 100755 (executable)
index 0000000..28055d2
--- /dev/null
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# 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=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+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'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  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]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
+# 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).  This is about non-GNU programs, so use $1 not
+# $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 $program 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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if test ! -f y.tab.h; then
+       echo >y.tab.h
+    fi
+    if test ! -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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if test ! -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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit $?
+    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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+       /^@setfilename/{
+         s/.* \([^ ]*\) *$/\1/
+         p
+         q
+       }' $infile`
+      # ... 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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xman/search.c b/xman/search.c
new file mode 100644 (file)
index 0000000..48c4efe
--- /dev/null
@@ -0,0 +1,401 @@
+/* $XConsortium: search.c,v 1.21 94/04/17 20:43:58 rws Exp $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86: xc/programs/xman/search.c,v 1.5 2001/01/27 17:24:27 herrb Exp $ */
+
+
+#include "globals.h"
+#include "vendor.h"
+
+/* Map <CR> and control-M to goto begining of file. */
+
+#define SEARCHARGS 10
+
+static FILE * DoManualSearch(ManpageGlobals *man_globals, char * string);
+static int BEntrySearch(char * string, char ** first, int number);
+
+/*     Function Name: MakeSearchWidget
+ *     Description: This Function Creates the Search Widget.
+ *     Arguments: man_globals - the pseudo globas for this manpage.
+ *                 w - the widgets parent
+ *     Returns: the search widget.
+ */
+
+void
+MakeSearchWidget(ManpageGlobals * man_globals, Widget parent)
+{
+  Widget dialog, command, text, cancel;
+  Arg arglist[2];
+  Cardinal num_args = 0;
+
+  XtSetArg(arglist[0], XtNtransientFor, parent); 
+  man_globals->search_widget = XtCreatePopupShell(SEARCHNAME, 
+                                                 transientShellWidgetClass, 
+                                                 parent,
+                                                 arglist, 1);
+
+  if (resources.clear_search_string) {
+    XtSetArg(arglist[0], XtNvalue, ""); num_args++;  
+  }
+
+  dialog = XtCreateManagedWidget(DIALOG, dialogWidgetClass,
+                                man_globals->search_widget, 
+                                arglist, num_args);
+
+  if ( (text = XtNameToWidget(dialog, "value")) == (Widget) NULL)
+    PopupWarning(NULL, "Could not find text widget in MakeSearchWidget.");
+  else
+    XtSetKeyboardFocus(dialog, text);
+
+  XawDialogAddButton(dialog, MANUALSEARCH, NULL, NULL);
+  XawDialogAddButton(dialog, APROPOSSEARCH, NULL, NULL);
+  XawDialogAddButton(dialog, CANCEL, NULL, NULL);
+
+/*
+ * This is a bit gross, but it get the cancel button underneath the 
+ * others, and forms them up to the right size..
+ */
+
+  if ( ((command = XtNameToWidget(dialog, MANUALSEARCH)) == (Widget) NULL) ||
+       ((cancel = XtNameToWidget(dialog, CANCEL)) == (Widget) NULL) )
+    PopupWarning(NULL,
+                "Could not find manual search widget in MakeSearchWidget.");
+  else {
+    static char * half_size[] = {
+      MANUALSEARCH, APROPOSSEARCH, NULL
+    };
+    static char * full_size[] = {
+      "label", "value", CANCEL, NULL
+    };
+
+    num_args = 0;
+    XtSetArg(arglist[num_args], XtNfromVert, command); num_args++;
+    XtSetArg(arglist[num_args], XtNfromHoriz, NULL); num_args++;
+    XtSetValues(cancel, arglist, num_args);
+    FormUpWidgets(dialog, full_size, half_size);
+  }
+
+}
+
+/*      Function Name: SearchString
+ *      Description: Returns the search string.
+ *      Arguments: man_globals - the globals.
+ *      Returns: the search string.
+ */
+
+static char *
+SearchString(
+ManpageGlobals * man_globals)
+{
+  Widget dialog;
+
+  dialog = XtNameToWidget(man_globals->search_widget, DIALOG);
+  if (dialog != NULL) 
+    return(XawDialogGetValueString(dialog));
+
+  PopupWarning(man_globals,
+             "Could not get the search string, no search will be preformed.");
+  return(NULL);
+}
+
+  
+/*     Function Name: DoSearch
+ *     Description: This function performs a search for a man page or apropos
+ *                   search upon search string.
+ *     Arguments: man_globals - the pseudo globas for this manpage.
+ *                 type - the type of search.
+ *     Returns: none.
+ */
+
+#define LOOKLINES 6
+
+/* 
+ * Manual searches look through the list of manual pages for the right one
+ * with a binary search.
+ *
+ * Apropos searches still exec man -k.
+ *
+ * If nothing is found then I send a warning message to the user, and do
+ * nothing.
+ */
+
+FILE *
+DoSearch(ManpageGlobals * man_globals, int type)
+{
+  char cmdbuf[BUFSIZ],*mantmp, *manpath;
+  char tmp[BUFSIZ],path[BUFSIZ];
+  char string_buf[BUFSIZ], cmp_str[BUFSIZ], error_buf[BUFSIZ];
+  char * search_string = SearchString(man_globals);
+  FILE * file;
+#ifdef HAS_MKSTEMP
+  int fd;
+#endif
+  int count;
+  Boolean flag;
+
+  if (search_string == NULL) return(NULL);
+
+  /* If the string is empty or starts with a space then do not search */
+
+  if ( streq(search_string,"") ) {
+    PopupWarning(man_globals, "Search string is empty.");
+    return(NULL);
+  }
+
+  if (strlen(search_string) >= BUFSIZ) {
+    PopupWarning(man_globals, "Search string too long.");
+    return(NULL);
+  }
+  if (search_string[0] == ' ') {
+    PopupWarning(man_globals, "First character cannot be a space.");
+    return(NULL);
+  }
+
+  if (type == APROPOS) {
+    char label[BUFSIZ];
+
+    strcpy(tmp, MANTEMP);              /* get a temp file. */
+#ifdef HAS_MKSTEMP
+    fd = mkstemp(tmp);
+    if (fd < 0) {
+      PopupWarning(man_globals, "Cant create temp file");
+      return NULL;
+    }
+#else
+    (void)mktemp(tmp);
+#endif
+    mantmp = tmp;
+
+    manpath=getenv("MANPATH");
+    if (manpath == NULL || streq(manpath,"") ) {
+#ifdef MANCONF
+      if (!ReadManConfig(path))
+#endif
+      {
+       strcpy(path,SYSMANPATH);
+#ifdef LOCALMANPATH
+       strcat(path,":");
+       strcat(path,LOCALMANPATH);
+#endif
+      }
+    } else {
+      strcpy(path,manpath);
+    }
+
+    snprintf(label, sizeof(label), 
+       "Results of apropos search on: %s", search_string);
+
+#ifdef NO_MANPATH_SUPPORT      /* not quite correct, but the best I can do. */
+    snprintf(cmdbuf, sizeof(cmdbuf), APROPOS_FORMAT, search_string, mantmp);
+#else
+    snprintf(cmdbuf, sizeof(cmdbuf), APROPOS_FORMAT, path, search_string, mantmp);
+#endif
+
+    if(system(cmdbuf) != 0) {  /* execute search. */
+       snprintf(error_buf, sizeof(error_buf), "Something went wrong trying to run %s\n",cmdbuf);
+      PopupWarning(man_globals, error_buf);
+    }
+
+#ifdef HAS_MKSTEMP
+    if ((file = fdopen(fd, "r")) == NULL) 
+#else
+    if((file = fopen(mantmp,"r")) == NULL)
+#endif
+      PrintError("lost temp file? out of temp space?");
+
+/* 
+ * Since we keep the FD open we can unlink the file safely, this
+ * will keep extra files out of /tmp. 
+ */
+
+    unlink(mantmp);
+
+    snprintf(string_buf, sizeof(string_buf), "%s: nothing appropriate", search_string);
+
+    /*
+     * Check first LOOKLINES lines for "nothing appropriate".
+     */
+  
+    count = 0;
+    flag = FALSE;
+    while ( (fgets(cmp_str, BUFSIZ, file) != NULL) && (count < LOOKLINES) ) {
+      if ( cmp_str[strlen(cmp_str) - 1] == '\n') /* strip off the '\n' */
+         cmp_str[strlen(cmp_str) - 1] = '\0';
+
+      if (streq(cmp_str, string_buf)) {
+       flag = TRUE;
+       break;
+      }
+      count++;
+    }
+
+    /*
+     * If the file is less than this number of lines then assume that there is
+     * nothing apropriate found. This does not confuse the apropos filter.
+     */
+
+    if (flag) {
+      fclose(file);
+      file = NULL;
+      ChangeLabel(man_globals->label,string_buf);
+      return(NULL);
+    }
+  
+    snprintf(man_globals->manpage_title, sizeof(man_globals->manpage_title), 
+            "%s", label);
+    ChangeLabel(man_globals->label,label);
+    fseek(file, 0L, SEEK_SET);         /* reset file to point at top. */
+  }
+  else {                       /* MANUAL SEACH */
+    file = DoManualSearch(man_globals, search_string);
+    if (file == NULL) {
+      snprintf(string_buf, sizeof(string_buf), "No manual entry for %s.", search_string);
+      ChangeLabel(man_globals->label, string_buf);
+      if (man_globals->label == NULL)
+       PopupWarning(man_globals, string_buf);
+      return(NULL);
+    }
+  }
+
+  if (resources.clear_search_string) {
+    Arg arglist[1];
+    Widget dialog;
+
+    dialog = XtNameToWidget(man_globals->search_widget, DIALOG);
+    if (dialog == NULL) 
+      PopupWarning(man_globals, "Could not clear the search string.");
+
+    XtSetArg(arglist[0], XtNvalue, "");
+    XtSetValues(dialog, arglist, (Cardinal) 1);
+  }
+
+  return(file);
+}
+
+/*     Function Name: DoManualSearch
+ *     Description: performs a manual search.
+ *     Arguments: man_globals - the manual page specific globals.
+ *     Returns: the filename of the man page.
+ */
+
+#define NO_ENTRY -100
+
+static FILE * 
+DoManualSearch(ManpageGlobals *man_globals, char * string)
+{
+  int e_num = NO_ENTRY;
+  int i;
+
+/* search current section first. */
+  
+  i = man_globals->current_directory;
+  e_num = BEntrySearch(string, manual[i].entries, manual[i].nentries);
+
+/* search other sections. */
+
+  if (e_num == NO_ENTRY) {
+    i = 0;                     /* At the exit of the loop i needs to
+                                  be the one we used. */
+    while ( TRUE ) {
+      if (i == man_globals->current_directory)
+       if (++i >= sections) return(NULL);
+      e_num = BEntrySearch(string, manual[i].entries, manual[i].nentries);
+      if (e_num != NO_ENTRY) break;
+      if (++i >= sections) return(NULL);
+    }
+
+/*
+ * Manual page found in some other section, unhighlight the current one.
+ */
+    if ( man_globals->manpagewidgets.box != NULL)
+      XawListUnhighlight(
+       man_globals->manpagewidgets.box[man_globals->current_directory]);
+  }
+  else {
+    /* 
+     * Highlight the element we are searching for if it is in the directory
+     * listing currently being shown.
+     */
+    if ( man_globals->manpagewidgets.box != NULL)
+      XawListHighlight(man_globals->manpagewidgets.box[i], e_num);
+  }
+  return(FindManualFile(man_globals, i, e_num));
+}
+
+/*     Function Name: BEntrySearch
+ *     Description: binary search through entries.
+ *     Arguments: string - the string to match.
+ *                 first - the first entry in the list.
+ *                 number - the number of entries.
+ *     Returns: a pointer to the entry found.
+ */
+
+static int
+BEntrySearch(
+char * string,
+char ** first,
+int number)
+{
+  int check, cmp, len_cmp, global_number;
+  char *head, *tail;
+  
+  global_number = 0;
+  while (TRUE) {
+
+    if (number == 0) {
+      return(NO_ENTRY);                /* didn't find it. */
+    }
+
+    check = number/2;
+
+    head = rindex(first[ global_number + check ], '/');
+    if (head == NULL) 
+      PrintError("index failure in BEntrySearch");
+    head++;
+
+    tail = rindex(head, '.');
+    if (tail == NULL) 
+      /* not an error, some systems (e.g. sgi) have only a .z suffix */
+      tail = head + strlen(head);
+
+    cmp = strncmp(string, head, (tail - head));
+    len_cmp = strlen(string) - (int) (tail - head);
+
+    if ( cmp == 0 && len_cmp == 0) {
+      return(global_number + check);
+    }
+    else if ( cmp < 0 || ((cmp == 0) && (len_cmp < 0)) ) 
+      number = check;
+    else /* cmp > 0 || ((cmp == 0) && (len_cmp > 0)) */ {
+      global_number += (check + 1);
+      number -= ( check + 1 );
+    }
+  }
+}
diff --git a/xman/tkfuncs.c b/xman/tkfuncs.c
new file mode 100644 (file)
index 0000000..0222e7c
--- /dev/null
@@ -0,0 +1,99 @@
+/* $XConsortium: tkfuncs.c,v 1.6 94/04/17 20:43:59 rws Exp $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86$ */
+
+#include <X11/X.h>
+#include <X11/Xos.h>
+#include <X11/Xlib.h>
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/IntrinsicP.h>
+
+#include "globals.h"
+
+/* 
+ * I am doing the "wrong" thing here by looking in the core field for the
+ * widget to get this info, the "right" thing to do is to do a XtGetValues
+ * to get this information.
+ */
+
+/*     Function Name: Width
+ *     Description: finds the width of a widget.
+ *     Arguments: w - the widget.
+ *     Returns: the width of that widget.
+ */
+
+int
+Width(Widget w)
+{
+  return( (int) w->core.width );
+}
+
+/*     Function Name: Height
+ *     Description: finds the height of a widget.
+ *     Arguments: w - the widget.
+ *     Returns: the height of that widget.
+ */
+
+int
+Height(Widget w)
+{
+  return( (int) w->core.height );
+}
+
+/*     Function Name: BorderWidth
+ *     Description: finds the BorderWidth of a widget.
+ *     Arguments: w - the widget.
+ *     Returns: the BorderWidth of that widget.
+ */
+
+int
+BorderWidth(Widget w)
+{
+  return( (int) w->core.border_width );
+}
+
+/* 
+ * These functions have got to be able to get at the widget tree, I don't see
+ * any way around this one.
+ */
+
+/*     Function Name: Name
+ *     Description: This function returns the correct popup child
+ *     Arguments: w - widget
+ *     Returns: the popup child.
+ */
+
+char * 
+Name(Widget w)
+{
+  return( w->core.name);
+}
diff --git a/xman/vendor.c b/xman/vendor.c
new file mode 100644 (file)
index 0000000..6ba5b0e
--- /dev/null
@@ -0,0 +1,318 @@
+/* $XConsortium: vendor.c,v 1.10 94/04/17 20:43:59 rws Exp $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86: xc/programs/xman/vendor.c,v 1.2 2000/03/03 20:02:25 dawes Exp $ */
+
+/* Vendor-specific data structures and operations */
+
+#include "globals.h"
+#include "vendor.h"
+
+typedef struct sectionName {
+    char *     name;
+    char *     suffix;
+} SectionNameRec;
+
+#if (defined(SYSV) || defined(__osf__) || defined(SVR4)) && !defined(sun)
+
+static SectionNameRec SectionNames[] = {
+    {"(1) User Commands",              "1"},
+    {"(1m) Sys, Administration",       "1m"},
+    {"(2) System Calls",               "2"},
+    {"(3) Subroutines",                        "3"},
+    {"(4) File Formats",               "4"},
+    {"(5) Miscellaneous",              "5"},
+    {"(6) Games",                      "6"},
+    {"(7) Devices",                    "7"},
+    {"(8) Sys. Administration",                "8"},
+    {"(l) Local",                      "l"},
+    {"(n) New",                                "n"},
+    {"(o) Old",                                "o"}
+#ifdef __SCO__
+      ,
+      { "(ADM) System Administration", "ADM" },
+      { "(ADMN) Network Administration", "ADMN" },
+      { "(ADMP) Protocol Administration", "ADMP" },
+      { "(C) Commands", "C" },
+      { "(CMD) DOS Commands", "CMD" },
+      { "(CP) Programming Commands", "CP" },
+      { "(DOS) DOS Subroutines and Libraries", "DOS" },
+      { "(F) File Formats", "F" },
+      { "(HW) Hardware Dependant", "HW" },
+      { "(K) Kernel Subroutines", "K" },
+      { "(LOCAL) Local utilities for your system", "LOCAL" },
+      { "(M) Miscellaneous", "M" },
+      { "(NADM) NFS Administration", "NADM" },
+      { "(NC) Network Commands", "NC" },
+      { "(NF) Network File Formats", "NF" },
+      { "(NS) Network Subroutines", "NS" },
+      { "(NSL) Network Services", "NSL" },
+      { "(S) Subroutines and Libraries", "S" },
+      { "(SCO) Product Engineering Toolkit", "SCO" },
+      { "(SFF) Socket File Formats", "SFF" },
+      { "(STR) Streams", "STR" },
+      { "(TC) Transport Layer Commands", "TC" },
+      { "(X) X Man pages", "X" },
+      { "(XNX) Xenix Subroutines, Commands and Libs", "XNX" },
+      { "(XS) X11 Subroutines and Libraries", "XS" },
+      { "(Xm) Motif Commands and Subroutines", "Xm" },
+      { "(Xt) X Intrinsics", "Xt" }
+#endif
+};
+
+#else
+
+#if defined(sun) && defined(SVR4)
+/* losing man.cf is useless because it has no section names */
+
+static SectionNameRec SectionNames[] = {
+    {"(1)  User Commands",                     "1"},
+    {"(1b) SunOS/BSD Compatibility Commands",  "1b"},
+    {"(1c) Communication Commands",            "1c"},
+    {"(1f) FMLI Commands",                     "1f"},
+    {"(1m) Maintenance Commands",              "1m"},
+    {"(1s) SunOS Specific Commands",           "1s"},
+    {"(2)  System Calls",                      "2"},
+    {"(3)  C Library Functions",               "3"},
+    {"(3b) SunOS/BSD Compatibility Functions", "3b"},
+    {"(3c) C Library Functions",               "3c"},
+    {"(3e) ELF Library Functions",             "3e"},
+    {"(3g) C Library Functions",               "3g"},
+    {"(3i) Wid Character Functions",           "3i"},
+    {"(3k) Kernel VM Library Functions",       "3k"},
+    {"(3m) Mathematical Library",              "3m"},
+    {"(3n) Network Functions",                 "3n"},
+    {"(3r) RPC Services Library",              "3r"},
+    {"(3s) Standard I/O Functions",            "3s"},
+#if OSMINORVERSION == 5
+    {"(3t) Threads Library",                   "3t"},
+#endif
+    {"(3x) Miscellaneous Library Functions",   "3x"},
+    {"(4)  File Formats",                      "4"},
+    {"(4b) Misc. Reference Manual Pages",      "4b"},
+    {"(5)  Environments, Tables, and TROFF Macros", "5"},
+    {"(6)  Games and Demos",                   "6"},
+    {"(7)  Special Files",                     "7"},
+#if OSMINORVERSION == 5
+    {"(7d)  Devices",                          "7d"},
+    {"(7fs) File Systems",                     "7fs"},
+    {"(7i)  Ioctl Requests",                   "7i"},
+    {"(7m)  STREAMS Modules",                  "7m"},
+    {"(7p)  Protocols",                                "7p"},
+#endif
+    {"(9)  Device Driver Information",         "9"},
+    {"(9e) DDI and DKI Driver Entry Points",   "9e"},
+    {"(9f) DDI and DKI Kernel Functions",      "9f"},
+    {"(9s) DDI and DKI Data Structures",       "9s"},
+    {"(l)  Local",                             "l"},
+    {"(n)  New",                               "n"},
+};
+
+#else
+
+static SectionNameRec SectionNames[] = {
+    {"(1) User Commands",              "1"},
+    {"(2) System Calls",               "2"},
+    {"(3) Subroutines",                        "3"},
+    {"(4) Devices",                    "4"},
+    {"(5) File Formats",               "5"},
+    {"(6) Games",                      "6"},
+    {"(7) Miscellaneous",              "7"},
+    {"(8) Sys. Administration",                "8"},
+#ifdef Lynx
+    {"(9) Device driver service calls",        "9"},
+#endif
+#if defined(__OpenBSD__) || defined(__NetBSD__)
+    {"(9) Kernel Manual",              "9"},
+#endif
+#if defined(__FreeBSD__)
+    {"(9) Kernel Interfaces",          "9"},
+#endif
+    {"(l) Local",                      "l"},
+    {"(n) New",                                "n"},
+    {"(o) Old",                                "o"},
+#ifdef sony
+    {"(p) Public Domain",              "p"},
+    {"(s) Sony Specific",              "s"},
+#endif
+};
+
+#endif
+#endif
+
+/*     Function Name: AddStandardSections
+ *     Description: Adds all the standard sections to the list for this path.
+ *     Arguments: list - a pointer to the section list.
+ *                 path - the path to these standard sections.
+ *     Returns: none.
+ */
+
+void AddStandardSections(
+SectionList **list,
+char * path)
+{
+#ifdef CRAY
+    AddStandardCraySections(list, path);
+    return;
+#else
+  register int i;
+  char file[BUFSIZ];
+  int numSections = sizeof(SectionNames) / sizeof(SectionNames[0]);
+
+  for (i=0; i < numSections; i++) {
+    sprintf(file, "%s%s", SEARCHDIR, SectionNames[i].suffix);
+    AddNewSection(list, path, file, SectionNames[i].name, TRUE);
+#ifdef SEARCHOTHER
+    sprintf(file, "%s%s", SEARCHOTHER, SectionNames[i].suffix);
+    AddNewSection(list, path, file, SectionNames[i].name, TRUE);
+#endif
+  }
+#endif
+}
+
+#ifdef CRAY
+/*     Function Name: AddStandardCraySections
+ *     Description: Add sections specific to the Cray.
+ *     Arguments: list - a pointer to the section list.
+ *                 path - the path to these standard sections.
+ *                 names - standard section names.
+ *     Returns: none.
+ */
+
+void AddStandardCraySections(
+SectionList **list,
+char *path)
+{
+  char file[BUFSIZ];
+  int i;
+#define NoSuf  (char *)0
+#define Suffix (char *)1
+#define Fold (char *)2
+#define FoldSuffix (char *)3
+  static char *cname[] = {
+    "(1) User Commands",       Suffix, "1",    "1bsd", NULL,
+    "(1) User Commands (instant)",     NoSuf,  "1r",   "1rb",  NULL,
+    "(1m) System Administration",      NoSuf,  "1m",   NULL,
+    "(2) System Calls",                Suffix, "2",    NULL,
+    "(3) Subroutines",         FoldSuffix,     "3",    "3bsd", "3c",   "3m",   "3mt",  "3s",   "3sl",  "3z",   NULL,
+    "(3) Subroutines (FORTRAN)", Fold, "3f",   NULL,
+    "(3) Subroutines (I/O)",   Fold,   "3io",  NULL,
+    "(3) Subroutines (X11)",   NoSuf,  "3X11", NULL,
+    "(3) Subroutines (Xt)",    NoSuf,  "3Xt",  NULL,
+    "(3) Subroutines (misc.)", Suffix, "3q",   NULL,
+    "(3) Subroutines (misc.)", Fold,   "3x",   NULL,
+    "(3) Subroutines (networking)",    Suffix, "3n",   "3rpc", "3svc", "3w",   "3yp",  NULL,
+    "(3) Subroutines (scientific)",    Fold,   "3sci", NULL,
+    "(3) Subroutines (utilities)",     FoldSuffix,     "3db",  "3u",   NULL,
+    "(4) Devices",             Suffix, "4",    "4d",   "4f",   "4n",   "4p",   "4s",   NULL,
+    "(5) File Formats",                Suffix, "5",    NULL,
+    "(6) Games",               Suffix, "6",    NULL,
+    "(7) Miscellaneous",       Suffix, "7",    NULL,
+    "(8) Sys. Administration", NoSuf,  "8",    NULL,
+    "(l) Local",               Suffix, "l",    NULL,
+    "(n) New",                 Suffix, "n",    NULL,
+    "(o) Old",                 Suffix, "o",    NULL,
+    "(info) Information",      NoSuf,  "info", NULL,
+    "(osi) Miscellaneous",     NoSuf,  "osi",  NULL,
+    "(sl) Miscellaneous",      NoSuf,  "sl",   NULL,
+    "(ultra) Miscellaneous",   NoSuf,  "ultra",        NULL,
+    NULL
+  };
+  char **p = cname;
+
+  while (*p != NULL) {
+    char *message = *p++;
+    int flags = (int) *p++;
+    while (*p != NULL) {
+      sprintf(file, "%s%s", SEARCHDIR, *p++);
+      AddNewSection(list, path, file, message, flags);
+    }
+    p++;
+  }
+}
+#endif /* CRAY */
+
+
+/*     Function Name: CreateManpageName
+ *     Description: Creates the manual page name for a given item.
+ *     Arguments: entry - the entry to convert.
+ *     Returns: the manual page properly allocated.
+ */
+
+/*
+ * If the filename is foo.3     - Create an entry of the form:  foo
+ * If the filename is foo.3X11  - Create an entry of the form:  foo(X11)
+ * IF the filename is a.out.1   - Create an entry of the form:  a.out
+ */
+
+char *
+CreateManpageName(
+char * entry,
+int section,   /* FIXME: unused */
+int flags)
+{
+  char * cp;
+  char page[BUFSIZ];
+  char sect[BUFSIZ];
+
+  ParseEntry(entry, NULL, sect, page);
+
+#ifndef CRAY
+  if ( (cp = rindex(page, '.')) != NULL) {
+    if ( (int)strlen(cp) > 2 ) {
+      *cp++ = '(';
+      while( (cp[1] != '\0') ) {
+       *cp = *(cp + 1); 
+       cp++;
+      }
+      *cp++ = ')';
+      *cp = '\0';
+    }
+    else
+      *cp = '\0';
+  }
+
+#else  /* CRAY - pick up the Cray name from the section */
+
+  if ( (cp = rindex(page, '.')) == NULL)
+    cp = page + strlen(page);
+  if ((flags & MSUFFIX) && strlen(sect) > 4) {
+    char *p = sect + 4;
+    *cp++ = '(';
+    while (*p)
+      *cp++ = *p++;
+    *cp++ = ')';
+  }
+  *cp = '\0';  
+
+#endif /* CRAY */
+  
+  return(StrAlloc(page));
+}
diff --git a/xman/vendor.h b/xman/vendor.h
new file mode 100644 (file)
index 0000000..21ff3ec
--- /dev/null
@@ -0,0 +1,258 @@
+/* $XConsortium: vendor.h,v 1.12 94/04/17 20:44:00 rws Exp $ */
+/* $XdotOrg: xc/programs/xman/vendor.h,v 1.4 2004/10/18 14:21:47 eich Exp $ */
+/*
+
+Copyright (c) 1991  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+/* $XFree86: xc/programs/xman/vendor.h,v 1.13 2003/07/29 21:16:56 dawes Exp $ */
+
+/* Vendor-specific definitions */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifdef CSRG_BASED
+#include <sys/param.h>
+#endif
+
+#define SUFFIX "suffix"
+#define FOLD "fold"
+#define FOLDSUFFIX "foldsuffix"
+#define MNULL 0
+#define MSUFFIX 1
+#define MFOLD 2
+#define MFOLDSUFFIX 3
+
+/*
+ * The directories to search.  Assume that the manual directories are more
+ * complete than the cat directories.
+ */
+
+#if ( defined(UTEK) || defined(apollo) || defined(Lynx) )
+#  define SEARCHDIR  CAT
+#else
+#  define SEARCHDIR  MAN
+#endif
+
+#if ( defined(sgi) || (defined(i386) && (defined(SYSV) || defined(SVR4))  && !defined(sun)) || (defined(BSD) && (BSD >= 199103)) || defined(linux) || defined(__CYGWIN__) )
+# define SEARCHOTHER CAT
+#endif
+
+/*
+ * The default manual page directory.
+ *
+ * The MANPATH enviornment variable will override this.
+ */
+
+#ifndef SYSMANPATH
+
+#if defined(macII)
+#  define SYSMANPATH "/usr/catman/u_man:/usr/catman/a_man"
+#elif defined(__bsdi__)
+#  define SYSMANPATH "/usr/share/man:/usr/contrib/man:/usr/contrib/isode/man:/usr/local/man"
+#elif defined(__OpenBSD__) || defined(__DARWIN__)
+#  define SYSMANPATH "/usr/share/man:/usr/local/man:/usr/X11R6/man"
+#elif defined(SVR4) && defined(sun)
+#  define SYSMANPATH "/usr/share/man:/usr/X11/man:/usr/openwin/share/man:/usr/dt/share/man:/usr/sfw/share/man"
+#elif defined(SVR4) || defined(__osf__) || (defined(BSD) && (BSD >= 199103))
+#  define SYSMANPATH "/usr/share/man"
+#elif defined(hcx)
+#  define SYSMANPATH "/usr/catman/local_man:/usr/catman/u_man:/usr/catman/a_man:/usr/catman/p_man:/usr/catman/ada_man"
+#elif defined(SYSV) && defined(i386) && !defined(__SCO__) && !defined(sun)
+#  define SYSMANPATH "/usr/catman/u_man:/usr/catman/p_man"
+#elif defined(sgi)
+#  define SYSMANPATH "/usr/catman/a_man:/usr/catman/g_man:/usr/catman/p_man:/usr/catman/u_man:/usr/man/p_man:/usr/man/u_man:/usr/man"
+#endif
+
+#ifndef SYSMANPATH
+#  define SYSMANPATH "/usr/man"
+#endif
+
+#endif
+
+/*
+ * Compression Definitions.
+ */
+
+#if defined( macII ) || defined( hcx ) || \
+       (defined(SYSV) && defined(i386) && !defined(ISC) && \
+       !defined(__UNIXWARE__) && !defined(__SCO__) && !defined(sun)) || defined(sgi)
+#  define COMPRESSION_EXTENSION   "z"
+#  define UNCOMPRESS_FORMAT       "pcat %s > %s"
+#  define NO_COMPRESS          /* mac can't handle using pack as a filter and
+                                  xman needs it to be done that way. */
+#elif defined(UTEK)
+#  define COMPRESSION_EXTENSION "C"
+#  define UNCOMPRESS_FORMAT     "ccat < %s > %s"
+#  define COMPRESS              "compact"
+#elif defined (ISC) || defined(__SCO__) || defined(__UNIXWARE__)
+#  define COMPRESSION_EXTENSION   "Z"     /* dummy */
+#  if !defined(__SCO__) && !defined(__UNIXWARE__)
+#    define COMPRESSION_EXTENSIONS  "zZF" /* pack, compress, freeze */
+#  else
+#    define COMPRESSION_EXTENSIONS  "zZ"  /* pack, compress */
+#  endif
+#  define UNCOMPRESS_FORMAT       uncompress_format
+#  define UNCOMPRESS_FORMAT_1     "pcat %s > %s"
+#  define UNCOMPRESS_FORMAT_2     "zcat < %s > %s"
+#  define UNCOMPRESS_FORMAT_3     "fcat < %s > %s"
+#  define NO_COMPRESS
+#else
+#  define COMPRESSION_EXTENSION "Z"
+#  ifndef HAS_MKSTEMP
+#    define UNCOMPRESS_FORMAT     "zcat < %s > %s"
+#  else
+#    define UNCOMPRESS_FORMAT     "zcat < %s >> %s"
+#  endif
+#  define COMPRESS              "compress"
+#  define GZIP_EXTENSION "gz"
+#  ifndef HAS_MKSTEMP
+#    define GUNZIP_FORMAT "gzip -c -d < %s > %s"
+#  else
+#    define GUNZIP_FORMAT "gzip -c -d < %s >> %s"
+#  endif
+#  define GZIP_COMPRESS "gzip"
+#  define BZIP2_EXTENSION "bz2"
+#  define LZMA_EXTENSION "lzma"
+#  ifndef HAS_MKSTEMP
+#    define BUNZIP2_FORMAT "bunzip2 -c -d < %s > %s"
+#    define UNLZMA_FORMAT "unlzma -c -d < %s > %s"
+#  else
+#    define BUNZIP2_FORMAT "bunzip2 -c -d < %s >> %s"
+#    define UNLZMA_FORMAT "unlzma -c -d < %s >> %s"
+#  endif
+#  define BZIP2_COMPRESS "bzip2"
+#  define LZMA_COMPRESS "lzma"
+#endif
+
+
+
+/*
+ * The command filters for the manual and apropos searches.
+ */
+
+#if (defined(hpux) || defined(macII) || defined(CRAY) || defined(ultrix) || \
+       defined(hcx) )
+#  define NO_MANPATH_SUPPORT
+#endif
+
+#ifndef HAS_MKSTEMP
+#  ifdef NO_MANPATH_SUPPORT
+#    define APROPOS_FORMAT ("man -k %s | pr -h Apropos > %s")
+#  else
+#    define APROPOS_FORMAT ("man -M %s -k %s | pr -h Apropos > %s")
+#  endif
+#else
+/* with mkstemp the temp output file is already created */
+#  ifdef NO_MANPATH_SUPPORT
+#    define APROPOS_FORMAT ("man -k %s | pr -h Apropos >> %s")
+#  else
+#    define APROPOS_FORMAT ("man -M %s -k %s | pr -h Apropos >> %s")
+#  endif
+#endif
+
+#ifndef HANDLE_ROFFSEQ
+# if defined(ultrix)
+#  define FORMAT "| nroff -man"             /* The format command. */
+# elif defined(CSRG_BASED)
+#  define FORMAT "| eqn | tbl | nroff -mandoc"
+# elif defined(BSD) && (BSD >= 199103)
+#  define FORMAT "| eqn | tbl | nroff -man"
+# elif defined(linux) || defined(__CYGWIN__)
+#  define FORMAT "| pic | eqn | tbl -Tlatin1 | GROFF_NO_SGR= groff -Tlatin1 -mandoc"
+# else
+#  define FORMAT "| neqn | nroff -man"      /* The format command. */
+# endif
+# define TBL "tbl"
+#else /* HANDLE_ROFFSEQ */
+# if defined(linux)
+#  define ZSOELIM      "zsoelim"
+# else
+#  define ZSOELIM      "soelim"
+#endif
+# define EQN           "eqn"
+# define TBL           "tbl"
+# define GRAP          "grap"
+# define PIC           "pic"
+# define VGRIND                "vgrind"
+# define REFER         "refer"
+# if defined(CSRG_BASED)
+#  define FORMAT       "nroff -mandoc"
+# elif defined(linux)
+#  define FORMAT       "GROFF_NO_SGR= groff -Tlatin1 -mandoc"
+# elif defined(__DARWIN__)
+#  define FORMAT       "nroff -man"
+# else
+#  define FORMAT       "groff -man"
+# endif
+# define DEFAULT_MANROFFSEQ "et"
+#endif /*HANDLE_ROFFSEQ */
+
+/*
+ * Names of the man and cat dirs.
+ */
+
+#ifdef __bsdi__
+#define MAN "cat"
+#else
+#define MAN "man"
+#endif
+
+/*
+ * The Apple, Cray,, SYSV386, and HCX folks put the preformatted pages in the
+ * "man" directories.
+ */
+#if (defined(macII) || defined(CRAY) || defined(hcx) || \
+       (defined(SYSV) && defined(i386))) && !defined(SCO) && !defined(sun)
+#  define CAT MAN
+#elif defined(SCO)
+#  define CAT "cat."
+#else
+#  define CAT "cat"
+#endif
+
+/* Solaris has nroff man pages in "man" and sgml man pages in "sman" */
+#if defined(sun) && defined(SVR4)
+#  define SFORMAT              "/usr/lib/sgml/sgml2roff"
+#  define SMAN                 "sman"
+#  undef SEARCHOTHER
+#  define SEARCHOTHER          SMAN
+#  define SGMLENT_EXTENSION    "ent"   /* SGML entity files end in ".ent" */
+#endif
+
+
+typedef struct _SectionList {
+  struct _SectionList * next;
+  char * label;                        /* section label */
+  char * directory;            /* section directory */
+  int flags;
+} SectionList;
+
+extern char * CreateManpageName(char * entry, int section, int flags);
+extern void AddStandardSections(SectionList **list, char * path);
+extern void AddNewSection(SectionList **list, char * path, char * file, char * label, int flags);
diff --git a/xman/version.h b/xman/version.h
new file mode 100644 (file)
index 0000000..f10367d
--- /dev/null
@@ -0,0 +1,32 @@
+/* $XConsortium: version.h,v 1.11 94/04/17 20:44:00 gildea Exp $ */
+/*
+
+Copyright (c) 1987, 1988  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 CONNECTION 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 dealings in this Software without prior written authorization
+from the X Consortium.
+
+*/
+
+#define XMAN_VERSION "Xman Version 3.2.0 - X11R7.0"
diff --git a/xman/xman.help b/xman/xman.help
new file mode 100644 (file)
index 0000000..247ed7c
--- /dev/null
@@ -0,0 +1,228 @@
+
+
+XMAN is an X Window System manual browsing tool.
+
+
+
+GETTING STARTED
+
+By default, xman starts by creating a small window that contains three
+"buttons" (places on which to click a pointer button).  Two of these
+buttons, Help and Quit, are self-explanatory.  The third, Manual Page,
+creates a new manual page browser window; you may use this button to
+open a new manual page any time xman is running.
+
+A new manual page starts up displaying this help information.  The
+manual page contains three sections.  In the upper left corner are two
+menu buttons.  When the mouse is clicked on either of these buttons a
+menu is popped up.  The contents of these menus is described below.
+Directly to the right of the menu buttons is an informational display.
+This display usually contains the name of the directory or manual page
+being displayed.  It is also used to display warning messages and the
+current version of xman.  The last and largest section is the
+information display.  This section of the application contains either a
+list of manual pages to choose from or the text of a manual page.
+
+To use xman pull down the Sections menu to select a manual section.
+When the section is displayed, click the left pointer button on the name
+of the manual page that you would like to see.  Xman will replace the
+directory listing with the manual page you selected.
+
+That should be enough to get you started.  Once you understand the
+basics of how to use xman, take a look at the rest of this file to see
+the advanced features that are available to make using xman fast and
+efficient.
+
+
+SCROLLING TEXT
+
+The scroll bars are similar to xterm and xmh scroll bars; clicking the
+left or right pointer button with the pointer at the bottom of the
+scroll bar will scroll the text down or up one page, respectively.
+Clicking with the pointer farther up the scroll bar scrolls
+proportionally less than one page.  Clicking the middle button a portion
+of the way down the scroll bar will move the text window that portion of
+the way down the text.  Holding the middle button and moving the pointer
+up and down allows the text to be scrolled dynamically.
+
+You may also type 'f' or <space bar> to scroll down one page, and 'b' to
+scroll up one page.
+
+
+RESIZING WINDOWS
+
+You can resize any of the windows in xman with your window manager, and
+xman will do the best it can to resize everything internally into a
+useful configuration.  The only control over the internal arrangement
+that you have is moving the border between the manual page and directory
+when both are displayed.  This is done by clicking and holding the any
+pointer button when the cursor is over the small square (grip) on the
+right side of the screen.  The grip is located on the horizontal line
+which separates the panes.  The grip may be moved up and down to resize
+the panes of the screen, and when the pointer button is released xman
+will move the pane boundary to the newly specified location.
+
+
+MENU COMMANDS
+
+There are two ways to activate the menus.  The first is to click any
+pointer button in the menu button corresponding to the menu you want to
+activate.  The second method is to hold down the "Control" key and click
+the left pointer button for the Options menu or the middle pointer
+button for the Sections menu.  Reguardless of how the menu was
+activated, selecting items is the same.
+
+Once a menu is activated, continue to hold down the pointer button and
+drag the pointer cursor over the item that you would like to activate.
+Once the item that you want to select is highlighted, select it by
+releasing the pointer button.  To avoid making a menu selection, move
+the pointer cursor outside the menu and release the button.
+
+Selecting one of the items in the Sections menu will display the named
+directory.
+
+The following commands are available through the Options menu:
+
+Display Directory      Show the current section directory.
+
+Display Manual Page    Show the current manual page.
+
+Help                   Create a help window with this text displayed.
+
+Search                 Pop up a dialogue box that allows the entire
+                       tree of manual pages to be searched for a
+                       specific name.  A keyword (apropos) search is
+                       also available through this dialogue box.
+
+Show Both Screens      Split the manual page display window to display
+                       both the current manual page and the directory. 
+Show One Screen                Return to a single screen display of either a 
+                       manual page or directory listing.
+
+Remove This Man Page   Remove this manual page, do not quit.
+
+Open New Man Page      Pop up a new manual page browser window.
+
+Show Version           Print the current version of xman to the
+                       information display window.  Please include the
+                       version number when reporting bugs.
+Quit                   Close all xman windows and quit xman.
+
+
+SUMMARY OF BASIC ACTIONS
+
+In a menu button:
+
+       CLICK:                  Pop up a menu
+
+In a directory, manual page, or scroll bar:
+
+       <CONTROL> CLICK LEFT:   Pop up the Options menu.
+       <CONTROL> CLICK MIDDLE: Pop up the Sections menu.
+
+In a  directory:
+
+       CLICK LEFT:             Bring up named manual page
+       <SHIFT> CLICK MIDDLE:   Go to manual page previously chosen.
+
+In a manual page or apropos listing:
+
+       <SHIFT> CLICK MIDDLE:   Go to directory of manual pages.
+
+In scroll bars:
+
+       CLICK LEFT:     Move down - more if pointer is near bottom
+                                   of window, less if at top.
+       CLICK MIDDLE:   Move top of page to current pointer position.
+       CLICK RIGHT:    Move up - more if pointer is near bottom
+                                 of window, less if at top.
+
+SEARCHING
+
+Xman has a built-in searching utility that allows the user to search the
+entire manual page tree for a specific topic (manual page search) or a
+keyword (apropos search).  The search dialogue box can be activated from
+the Options menu, or by the key Control-s.  If the search is started
+from the small initial topbox xman will open a new manual page if the
+search was successful, and fail silently if the search was unsuccessful.
+
+Manual page searches are performed starting in the currently displayed
+section.  If no match is found then the remaining sections are searched
+in the order that the sections appear in the Sections menu, starting at
+the top.  The current version of xman immediately displays the first
+manual page that it finds.  If the manual page cannot be found that fact
+is noted in the informational display.
+
+An apropos search will search a list of short descriptions for all
+manual pages on the system and return a list of all descriptions which
+contain the keyword specified.
+
+
+KEYBOARD ACCELERATORS
+
+Xman contains a set of preinstalled keyboard accelerators.  These are a
+set of key bindings that perform many of the same operations as the menu
+items.  Since it is not necessary to pull down the menu,  these actions
+can be performed more quickly, hence the name accelerators.  
+
+The default key bindings for xman are:
+
+Anywhere:
+
+       Control - c             Exit xman
+       Control - h             Create the help window
+       Control - n             Create a new man page
+       Control - q             Exit xman
+       Control - s             Create a search popup 
+
+In a manual page, directory, or help window:
+
+       Control - r             Remove this manual page or help display
+       Control - v             Show the current version of xman
+
+In a manual page or directory:
+
+       Control - d             Display Directory
+       Control - m             Display Man Page
+
+In a manual page only:
+
+       b                       Page Back
+       f                       Page forward
+       <Space>                 Page forward
+       1                       One line forward
+       2                       Two lines forward
+       3                       Three lines forward
+       4                       Four lines forward
+
+Note: Control-s does not have any effect in the help window.
+
+
+FURTHER INFORMATION
+
+Xman is highly customizable.  Through the X resource database a user can
+customize the look and feel of this application so that it meets a
+preferred style of interaction.  Almost any configuration that is
+available dynamically can be specified through resources.  This includes
+changing the size, color, and fonts, starting with no topbox, showing
+both screens, and rebinding the keyboard accelerators.
+
+The information on customizing xman is contained in the xman manual
+page, I will leave it to you to figure out how to find and display that
+information :-)
+
+
+                                       Chris D. Peterson MIT X
+                                       Consortium
+
+CREDITS
+
+Version:       Use 'Show Version' menu item.
+Written By:    Chris D. Peterson - formerly MIT X Consortium
+Based Upon:    Xman for X10 by Barry Shein - Boston University
+
+Copyright 1988, 1989 X Consortium
+Edited by Donna Converse and Dave Sternlicht
+
+
diff --git a/xman/xman.man b/xman/xman.man
new file mode 100644 (file)
index 0000000..4aaabc0
--- /dev/null
@@ -0,0 +1,387 @@
+.\" $XConsortium: xman.man,v 1.23 94/04/17 20:44:02 matt Exp $
+.\"
+.\" $XFree86: xc/programs/xman/xman.man,v 1.3 2001/01/27 18:21:18 dawes Exp $
+.\"
+.TH XMAN 1 __xorgversion__
+.SH NAME
+xman \- Manual page display program for the X Window System
+.SH SYNOPSIS
+.B xman
+[
+.I \-options
+\&.\|.\|. ]
+.SH DESCRIPTION
+.I Xman
+is a manual page browser.  The default size of the initial \fIxman\fP
+window is small so that you can leave it running throughout your entire login
+session.  In the initial window there are three options:
+\fIHelp\fP will pop up a window with on-line help, \fIQuit\fP will
+exit, and \fIManual Page\fP will pop up a window with a manual page
+browser in it.
+Typing Control-S will pop up a window prompting for a specific manual
+page to display.
+You may display more than one manual page browser window at a time
+from a single execution of \fIxman\fP.
+.PP
+For further information on using \fIxman\fP, please read the on-line
+help information.  Most of this manual will discuss
+customization of \fIxman\fP.
+.SH "OPTIONS"
+.PP
+Xman supports all standard Toolkit command line arguments (see
+\fIX\fP(1)).  The following additional arguments are supported.
+.sp
+.IP "\fB\-helpfile\fP \fIfilename\fP"
+Specifies a helpfile to use other than the default.
+.IP \fB\-bothshown\fP
+Allows both the manual page and manual directory to be on the screen at
+the same time.
+.IP \fB\-notopbox\fP
+Starts without the Top Menu with the three buttons in it.
+.IP "\fB\-geometry\fP \fIWxH+X+Y\fP"
+Sets the size and location of the Top Menu with the three buttons in it.
+.IP "\fB\-pagesize\fP \fIWxH+X+Y\fP"
+Sets the size and location of all the Manual Pages.
+.SH "CUSTOMIZING XMAN"
+.PP
+.I Xman
+allows customization of both the directories to be searched for manual pages,
+and the name that each directory will map to in the \fISections\fP
+menu.  Xman determines which directories it will
+search by reading the \fIMANPATH\fP environment variable.  If no
+\fIMANPATH\fP is found then the directory is /usr/man is searched on
+POSIX systems.  This environment
+is expected to be a colon-separated list of directories for xman to search.
+.sp
+.nf
+setenv MANPATH /mit/kit/man:/usr/man
+.fi
+.PP
+By default,
+.I xman
+will search each of the following directories (in each of the directories 
+specified in the users MANPATH) for manual pages.  If manual pages exist
+in that directory then they are added to list of manual pages for 
+the corresponding menu item.
+A menu item is only displayed for those sections that actually contain
+manual pages.
+.ta 1.5i
+.nf
+
+Directory      Section Name
+---------      ------------
+man1   (1) User Commands
+man2   (2) System Calls
+man3   (3) Subroutines
+man4   (4) Devices
+man5   (5) File Formats
+man6   (6) Games       
+man7   (7) Miscellaneous
+man8   (8) Sys. Administration
+manl   (l) Local
+mann   (n) New
+mano   (o) Old
+
+.fi     
+For instance, a user has three directories in her manual path and each
+contain a directory called \fIman3\fP.  All these manual pages will appear
+alphabetically sorted when the user selects the menu item called
+\fI(3) Subroutines\fP.  If there is no directory called \fImano\fP in
+any of the directories in her MANPATH, or there are no manual pages
+in any of the directories called \fImano\fP then no menu item will be
+displayed for the section called \fI(o) Old\fP.
+.SH "BSD AND LINUX SYSTEMS"        
+.PP
+In newer BSD and Linux systems, \fIXman\fP will search for a file named
+\fI/etc/man.conf\fP which will contain the list of directories containing
+manual pages. See \fIman.conf\fP(5) for a complete description of the file
+format.
+.SH "THE MANDESC FILE"        
+.PP
+By using the \fImandesc\fP file a user or system manager is able to 
+more closely control which manual pages will appear in each of the sections
+represented by menu items in the \fISections\fP menu.  This 
+functionality is only available on a section by section basis, and individual
+manual pages may not be handled in this manner.
+(Although generous use of 
+symbolic links \(em see \fIln\fP(1) \(em will allow
+almost any configuration you can imagine.)
+.PP
+The format of the mandesc file is a character followed by a label.  The
+character determines which of the sections will be added under this label.
+For instance suppose that you would like to create an extra menu item that 
+contains all programmer subroutines.  This label should contain all manual
+pages in both sections two and three.  The \fImandesc\fP file
+would look like this:
+.nf     
+        
+2Programmer Subroutines
+3Programmer Subroutines
+
+.fi
+This will add a menu item to the \fISections\fP menu that would
+bring up a listing of all manual pages in sections two and three of
+the Programmers Manual.  Since the label names are \fIexactly\fP the
+same they will be added to the same section. Note, however, that the
+original sections still exist.
+.PP
+If you want to completely ignore the default sections in a manual directory
+then add the line:
+.nf
+
+no default sections
+
+.fi
+anywhere in your mandesc file.  This keeps xman from searching
+the default manual sections \fIIn that directory only\fP.  As an example,
+suppose you want to do the same thing as above, but you don't think that
+it is useful to have the \fISystem Calls\fP or \fISubroutines\fP sections
+any longer.  You would need to duplicate the default entries, as well as
+adding your new one.
+.nf
+
+no default sections
+1(1) User Commands
+2Programmer Subroutines
+3Programmer Subroutines
+4(4) Devices
+5(5) File Formats
+6(6) Games
+7(7) Miscellaneous
+8(8) Sys. Administration
+l(l) Local
+n(n) New
+o(o) Old
+
+.fi
+Xman will read any section that is of the from \fIman<character>\fP, where
+<character> is an upper or lower case letter (they are treated distinctly) or
+a numeral (0-9).  Be warned, however, that man(1) and catman(8) will 
+not search directories that are non-standard.
+.SH WIDGETS
+In order to specify resources, it is useful to know the hierarchy of
+the widgets which compose \fIxman\fR.  In the notation below,
+indentation indicates hierarchical structure.  The widget class name
+is given first, followed by the widget instance name.
+.sp
+.nf
+.ta .5i 1.0i 1.5i 2.0i 2.5i 3.0i 3.5i
+Xman xman      \fI(This widget is never used)\fP
+       TopLevelShell  topBox
+               Form  form
+                       Label  topLabel
+                       Command  helpButton
+                       Command  quitButton
+                       Command  manpageButton
+               TransientShell  search
+                       DialogWidgetClass  dialog
+                               Label  label
+                               Text  value
+                               Command  manualPage
+                               Command  apropos
+                               Command  cancel
+               TransientShell  pleaseStandBy
+                       Label  label
+       TopLevelShell  manualBrowser
+               Paned  Manpage_Vpane
+                       Paned  horizPane
+                               MenuButton  options
+                               MenuButton  sections
+                               Label  manualBrowser
+                       Viewport  directory
+                               List  directory 
+                               List  directory 
+                               .
+                               . (one for each section, 
+                               .  created on the fly)
+                               .
+                       ScrollByLine  manualPage
+               SimpleMenu  optionMenu
+                       SmeBSB  displayDirectory
+                       SmeBSB  displayManualPage
+                       SmeBSB  help
+                       SmeBSB  search
+                       SmeBSB  showBothScreens
+                       SmeBSB  removeThisManpage
+                       SmeBSB  openNewManpage
+                       SmeBSB  showVersion
+                       SmeBSB  quit
+               SimpleMenu  sectionMenu
+                       SmeBSB  <name of section>
+                               .
+                               . (one for each section)
+                               .
+               TransientShell  search
+                       DialogWidgetClass  dialog
+                               Label  label
+                               Text  value
+                               Command  manualPage
+                               Command  apropos
+                               Command  cancel
+               TransientShell  pleaseStandBy
+                       Label  label
+               TransientShell  likeToSave
+                       Dialog  dialog
+                               Label  label
+                               Text  value
+                               Command  yes
+                               Command  no
+       TopLevelShell  help
+               Paned  Manpage_Vpane
+                       Paned  horizPane
+                               MenuButton  options
+                               MenuButton  sections
+                               Label  manualBrowser
+                       ScrollByLine  manualPage
+               SimpleMenu  optionMenu
+                       SmeBSB  displayDirectory
+                       SmeBSB  displayManualPage
+                       SmeBSB  help
+                       SmeBSB  search
+                       SmeBSB  showBothScreens
+                       SmeBSB  removeThisManpage
+                       SmeBSB  openNewManpage
+                       SmeBSB  showVersion
+                       SmeBSB  quit
+
+.fi
+.SH "APPLICATION RESOURCES"
+\fIxman\fP has the following application-specific resources which allow
+customizations unique to \fIxman\fP.
+.PP
+.TP 18
+\fBmanualFontNormal\fP (Class \fBFont\fP)
+The font to use for normal text in the manual pages.
+.TP 18
+\fBmanualFontBold\fP (Class \fBFont\fP)
+The font to use for bold text in the manual pages.
+.TP 18
+\fBmanualFontItalic\fP (Class \fBFont\fP)
+The font to use for italic text in the manual pages.
+.TP 18
+\fBdirectoryFontNormal\fP (Class \fBFont\fP)
+The font to use for the directory text.
+.TP 18
+\fBbothShown\fP (Class \fBBoolean\fP)
+Either `true' or `false,' specifies whether or not you want both the
+directory and the manual page shown at start up.
+.TP 18
+\fBdirectoryHeight\fP (Class \fBDirectoryHeight\fP)
+The height in pixels of the directory, when the directory and the manual page
+are shown simultaneously.
+.TP 18
+\fBtopCursor\fP (Class \fBCursor\fP)
+The cursor to use in the top box.
+.TP 18
+\fBhelpCursor\fP (Class \fBCursor\fP)
+The cursor to use in the help window.
+.TP 18
+\fBmanpageCursor\fP (Class \fBCursor\fP)
+The cursor to use in the manual page window.
+.TP 18
+\fBsearchEntryCursor\fP (Class \fBCursor\fP)
+The cursor to use in the search entry text widget.
+.TP 18
+\fBpointerColor\fP (Class \fBForeground\fP)
+This is the color of all the cursors (pointers) specified above.  The
+name was chosen to be compatible with xterm.
+.TP 18 
+\fBhelpFile\fP  (Class \fBFile\fP)
+Use this rather than the system default helpfile.
+.TP 18
+\fBtopBox\fP (Class \fBBoolean\fP)
+Either `true' or `false,' determines whether the top box (containing
+the help, quit and manual page buttons) or a manual page is put on the screen
+at start-up.  The default is true.
+.TP 18
+\fBverticalList\fP (Class \fBBoolean\fP)
+Either `true' or `false,' determines whether the directory listing is 
+vertically or horizontally organized.  The default is horizontal (false).
+.SH "GLOBAL ACTIONS"
+\fIXman\fP defines all user interaction through global actions.  This allows
+the user to modify the translation table of any widget, and bind any event
+to the new user action.  The list of actions supported by \fIxman\fP are:
+.TP 1.5i
+.B GotoPage(\fIpage\fB) 
+When used in a manual page display window this will allow the user to
+move between a directory and manual page display.  The \fIpage\fP argument can
+be either \fBDirectory\fP or \fBManualPage\fP.
+.TP 1.5i
+.B Quit()
+This action may be used anywhere, and will exit xman.
+.TP 1.5i
+.B Search(\fItype\fB, \fIaction\fB)
+Only useful when used in a search popup, this action will cause the search
+widget to perform the named search type on the string in the search popup's
+value widget. This action will also pop down the search widget. The
+\fItype\fP argument can be either \fBApropos\fP, \fBManpage\fP or
+\fBCancel\fP.  If an \fIaction\fP of \fBOpen\fP is specified then xman
+will open a new manual page to display the results of the search, otherwise
+xman will attempt to display the results in the parent of the search popup.
+.TP 1.5i
+.B PopupHelp()
+This action may be used anywhere, and will popup the help widget.
+.TP 1.5i
+.B PopupSearch()
+This action may be used anywhere except in a help window.  It will cause
+the search popup to become active and visible on the screen, allowing
+the user search for a manual page.
+.TP 1.5i
+.B CreateNewManpage()
+This action may be used anywhere, and will create a new manual page
+display window.
+.TP 1.5i
+.B RemoveThisManpage()
+This action may be used in any manual page or help display window.  When
+called it will remove the window, and clean up all resources
+associated with it.
+.TP 1.5i
+.B SaveFormattedPage(\fIaction\fP)
+This action can only be used in the \fBlikeToSave\fP popup widget, and
+tells xman whether to \fBSave\fP or \fBCancel\fP a save of the 
+manual page that has just been formatted.
+.TP 1.5i
+.B ShowVersion()
+This action may be called from any manual page or help display window, and
+will cause the informational display line to show the current version
+of xman.
+.SH FILES
+.IP "\fI<manpath directory>\fP/man<\fIcharacter\fP>" 2.5i
+.IP "\fI<manpath directory>\fP/cat<\fIcharacter\fP>"
+.IP "\fI<manpath directory>\fP/mandesc"
+.IP __apploaddir__/Xman
+specifies required resources.
+.IP /tmp
+.I Xman
+creates temporary files in /tmp for all unformatted man pages and all apropos
+searches.
+.SH "SEE ALSO"
+.IR X (__miscmansuffix__),
+.IR man (1),
+.IR apropos (1),
+.IR catman (8),
+.I "Athena Widget Set"
+.SH ENVIRONMENT
+.TP 1.5i
+.B DISPLAY 
+the default host and display to use.
+.TP 1.5i
+.B MANPATH
+the search path for manual pages.  Directories are separated by
+colons (e.g. /usr/man:/mit/kit/man:/foo/bar/man).
+.TP 1.5i
+.B XENVIRONMENT
+to get the name of a resource file that overrides the global resources
+stored in the RESOURCE_MANAGER property.
+.TP 1.5i
+.B XAPPLRESDIR
+A string that will have ``Xman'' appended to it.  This string will be
+the full path name of a user app-defaults file to be merged into the
+resource database after the system app-defaults file, and before
+the resources that are attached to the display.
+.br
+See \fIX(__miscmansuffix__)\fP for a full statement of rights and permissions.
+.SH AUTHORS
+Chris Peterson, MIT X Consortium from the V10 version written by Barry
+Shein formerly of Boston University.
+Bug fixes and Linux support by Carlos A M dos Santos, for The XFree86 Project.
diff --git a/xmore/AUTHORS b/xmore/AUTHORS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xmore/COPYING b/xmore/COPYING
new file mode 100644 (file)
index 0000000..7f33cbf
--- /dev/null
@@ -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/xmore/ChangeLog b/xmore/ChangeLog
new file mode 100644 (file)
index 0000000..186d566
--- /dev/null
@@ -0,0 +1,39 @@
+2005-12-20  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * configure.ac:
+       Update package version for X11R7 release.
+
+2005-12-14  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * configure.ac:
+       Update package version number for final X11R7 release candidate.
+
+2005-12-07  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * Makefile.am:
+       * configure.ac:
+       Change to use the app-defaults default dir configured in libXt.
+
+2005-12-06  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * Makefile.am:
+       Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+2005-12-03  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * configure.ac:
+       Update package version number for X11R7 RC3 release.
+
+2005-11-19  Alan Coopersmith  <alan.coopersmith@sun.com>
+
+       * configure.ac: 
+       Add dependency on xp module when building with Xprint support.
+
+2005-10-18  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * configure.ac:
+       Update package version number for RC1 release.
+
+2005-10-05  Kevin E. Martin  <kem-at-freedesktop-dot-org>
+
+       * Makefile.am: Add xmore.sgml to EXTRA_DIST
diff --git a/xmore/INSTALL b/xmore/INSTALL
new file mode 100644 (file)
index 0000000..23e5f25
--- /dev/null
@@ -0,0 +1,236 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
+Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+These are generic installation instructions.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  (Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.)
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.  If you're
+     using `csh' on an old version of System V, you might need to type
+     `sh ./configure' instead to prevent `csh' from trying to execute
+     `configure' itself.
+
+     Running `configure' takes awhile.  While running, it prints some
+     messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+Compilers and Options
+=====================
+
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about.  Run `./configure --help' for
+details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory.  After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
+
+Installation Names
+==================
+
+By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+There may be some features `configure' cannot figure out automatically,
+but needs to determine by the type of machine the package will run on.
+Usually, assuming the package is built to be run on the _same_
+architectures, `configure' can figure that out, but if it prints a
+message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).  Here is a another example:
+
+     /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
+configuration-related scripts to be executed by `/bin/bash'.
+
+`configure' Invocation
+======================
+
+`configure' recognizes the following options to control how it operates.
+
+`--help'
+`-h'
+     Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/xmore/Makefile.am b/xmore/Makefile.am
new file mode 100644 (file)
index 0000000..53c3ca6
--- /dev/null
@@ -0,0 +1,95 @@
+# 
+#  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 = xmore
+
+xmore_CFLAGS = $(XMORE_CFLAGS) -DXMORE
+xmore_LDADD = $(XMORE_LIBS)
+
+xmore_SOURCES =        \
+        xmore.c \
+        xmore.h
+
+if XAW_USE_XPRINT
+xmore_CFLAGS += -DUSE_XPRINT
+
+xmore_SOURCES += \
+        print.c \
+        printdialog.c \
+        printdialog.h \
+        printdialogprivates.h \
+        print.h
+endif
+
+appman_PRE = \
+        xmore.man
+
+# App default files  (*.ad)
+
+appdefaultdir = @appdefaultdir@
+
+
+APPDEFAULTFILES = \
+        XMore
+
+SUFFIXES = .ad
+
+.ad:
+       cp $< $@
+
+appdefault_DATA = $(APPDEFAULTFILES)
+
+EXTRA_DIST = $(APPDEFAULTFILES:%=%.ad)
+
+CLEANFILES = $(APPDEFAULTFILES)
+
+EXTRA_DIST += xmore.sgml
+
+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/xmore/Makefile.in b/xmore/Makefile.in
new file mode 100644 (file)
index 0000000..55b11e1
--- /dev/null
@@ -0,0 +1,738 @@
+# 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 = xmore$(EXEEXT)
+@XAW_USE_XPRINT_TRUE@am__append_1 = -DUSE_XPRINT
+@XAW_USE_XPRINT_TRUE@am__append_2 = \
+@XAW_USE_XPRINT_TRUE@        print.c \
+@XAW_USE_XPRINT_TRUE@        printdialog.c \
+@XAW_USE_XPRINT_TRUE@        printdialog.h \
+@XAW_USE_XPRINT_TRUE@        printdialogprivates.h \
+@XAW_USE_XPRINT_TRUE@        print.h
+
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+       $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
+       compile config.guess config.sub depcomp install-sh missing \
+       mkinstalldirs
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno configure.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appdefaultdir)" \
+       "$(DESTDIR)$(appmandir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am__xmore_SOURCES_DIST = xmore.c xmore.h print.c printdialog.c \
+       printdialog.h printdialogprivates.h print.h
+@XAW_USE_XPRINT_TRUE@am__objects_1 = xmore-print.$(OBJEXT) \
+@XAW_USE_XPRINT_TRUE@  xmore-printdialog.$(OBJEXT)
+am_xmore_OBJECTS = xmore-xmore.$(OBJEXT) $(am__objects_1)
+xmore_OBJECTS = $(am_xmore_OBJECTS)
+am__DEPENDENCIES_1 =
+xmore_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 = $(xmore_SOURCES)
+DIST_SOURCES = $(am__xmore_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|^.*/||'`;
+appdefaultDATA_INSTALL = $(INSTALL_DATA)
+appmanDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(appdefault_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@
+APPDEFS_CFLAGS = @APPDEFS_CFLAGS@
+APPDEFS_LIBS = @APPDEFS_LIBS@
+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@
+TMP_XAW_CFLAGS = @TMP_XAW_CFLAGS@
+TMP_XAW_LIBS = @TMP_XAW_LIBS@
+VERSION = @VERSION@
+XAW_USE_XPRINT_FALSE = @XAW_USE_XPRINT_FALSE@
+XAW_USE_XPRINT_TRUE = @XAW_USE_XPRINT_TRUE@
+XMORE_CFLAGS = @XMORE_CFLAGS@
+XMORE_LIBS = @XMORE_LIBS@
+XPRINT_UTIL_CFLAGS = @XPRINT_UTIL_CFLAGS@
+XPRINT_UTIL_LIBS = @XPRINT_UTIL_LIBS@
+ac_ct_CC = @ac_ct_CC@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+
+# App default files  (*.ad)
+appdefaultdir = @appdefaultdir@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+xmore_CFLAGS = $(XMORE_CFLAGS) -DXMORE $(am__append_1)
+xmore_LDADD = $(XMORE_LIBS)
+xmore_SOURCES = xmore.c xmore.h $(am__append_2)
+appman_PRE = \
+        xmore.man
+
+APPDEFAULTFILES = \
+        XMore
+
+SUFFIXES = .ad .$(APP_MAN_SUFFIX) .man
+appdefault_DATA = $(APPDEFAULTFILES)
+EXTRA_DIST = $(APPDEFAULTFILES:%=%.ad) xmore.sgml $(appman_PRE)
+CLEANFILES = $(APPDEFAULTFILES) $(appman_DATA)
+appmandir = $(APP_MAN_DIR)
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+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'
+
+all: config.h
+       $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .ad .$(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)
+xmore$(EXEEXT): $(xmore_OBJECTS) $(xmore_DEPENDENCIES) 
+       @rm -f xmore$(EXEEXT)
+       $(LINK) $(xmore_LDFLAGS) $(xmore_OBJECTS) $(xmore_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmore-print.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmore-printdialog.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmore-xmore.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) '$<'`
+
+xmore-xmore.o: xmore.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xmore_CFLAGS) $(CFLAGS) -MT xmore-xmore.o -MD -MP -MF "$(DEPDIR)/xmore-xmore.Tpo" -c -o xmore-xmore.o `test -f 'xmore.c' || echo '$(srcdir)/'`xmore.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xmore-xmore.Tpo" "$(DEPDIR)/xmore-xmore.Po"; else rm -f "$(DEPDIR)/xmore-xmore.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='xmore.c' object='xmore-xmore.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) $(xmore_CFLAGS) $(CFLAGS) -c -o xmore-xmore.o `test -f 'xmore.c' || echo '$(srcdir)/'`xmore.c
+
+xmore-xmore.obj: xmore.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xmore_CFLAGS) $(CFLAGS) -MT xmore-xmore.obj -MD -MP -MF "$(DEPDIR)/xmore-xmore.Tpo" -c -o xmore-xmore.obj `if test -f 'xmore.c'; then $(CYGPATH_W) 'xmore.c'; else $(CYGPATH_W) '$(srcdir)/xmore.c'; fi`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xmore-xmore.Tpo" "$(DEPDIR)/xmore-xmore.Po"; else rm -f "$(DEPDIR)/xmore-xmore.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='xmore.c' object='xmore-xmore.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) $(xmore_CFLAGS) $(CFLAGS) -c -o xmore-xmore.obj `if test -f 'xmore.c'; then $(CYGPATH_W) 'xmore.c'; else $(CYGPATH_W) '$(srcdir)/xmore.c'; fi`
+
+xmore-print.o: print.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xmore_CFLAGS) $(CFLAGS) -MT xmore-print.o -MD -MP -MF "$(DEPDIR)/xmore-print.Tpo" -c -o xmore-print.o `test -f 'print.c' || echo '$(srcdir)/'`print.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xmore-print.Tpo" "$(DEPDIR)/xmore-print.Po"; else rm -f "$(DEPDIR)/xmore-print.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='print.c' object='xmore-print.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) $(xmore_CFLAGS) $(CFLAGS) -c -o xmore-print.o `test -f 'print.c' || echo '$(srcdir)/'`print.c
+
+xmore-print.obj: print.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xmore_CFLAGS) $(CFLAGS) -MT xmore-print.obj -MD -MP -MF "$(DEPDIR)/xmore-print.Tpo" -c -o xmore-print.obj `if test -f 'print.c'; then $(CYGPATH_W) 'print.c'; else $(CYGPATH_W) '$(srcdir)/print.c'; fi`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xmore-print.Tpo" "$(DEPDIR)/xmore-print.Po"; else rm -f "$(DEPDIR)/xmore-print.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='print.c' object='xmore-print.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) $(xmore_CFLAGS) $(CFLAGS) -c -o xmore-print.obj `if test -f 'print.c'; then $(CYGPATH_W) 'print.c'; else $(CYGPATH_W) '$(srcdir)/print.c'; fi`
+
+xmore-printdialog.o: printdialog.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xmore_CFLAGS) $(CFLAGS) -MT xmore-printdialog.o -MD -MP -MF "$(DEPDIR)/xmore-printdialog.Tpo" -c -o xmore-printdialog.o `test -f 'printdialog.c' || echo '$(srcdir)/'`printdialog.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xmore-printdialog.Tpo" "$(DEPDIR)/xmore-printdialog.Po"; else rm -f "$(DEPDIR)/xmore-printdialog.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='printdialog.c' object='xmore-printdialog.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) $(xmore_CFLAGS) $(CFLAGS) -c -o xmore-printdialog.o `test -f 'printdialog.c' || echo '$(srcdir)/'`printdialog.c
+
+xmore-printdialog.obj: printdialog.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xmore_CFLAGS) $(CFLAGS) -MT xmore-printdialog.obj -MD -MP -MF "$(DEPDIR)/xmore-printdialog.Tpo" -c -o xmore-printdialog.obj `if test -f 'printdialog.c'; then $(CYGPATH_W) 'printdialog.c'; else $(CYGPATH_W) '$(srcdir)/printdialog.c'; fi`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/xmore-printdialog.Tpo" "$(DEPDIR)/xmore-printdialog.Po"; else rm -f "$(DEPDIR)/xmore-printdialog.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='printdialog.c' object='xmore-printdialog.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) $(xmore_CFLAGS) $(CFLAGS) -c -o xmore-printdialog.obj `if test -f 'printdialog.c'; then $(CYGPATH_W) 'printdialog.c'; else $(CYGPATH_W) '$(srcdir)/printdialog.c'; fi`
+uninstall-info-am:
+install-appdefaultDATA: $(appdefault_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appdefaultdir)" || $(mkdir_p) "$(DESTDIR)$(appdefaultdir)"
+       @list='$(appdefault_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(appdefaultDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(appdefaultdir)/$$f'"; \
+         $(appdefaultDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(appdefaultdir)/$$f"; \
+       done
+
+uninstall-appdefaultDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appdefault_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(appdefaultdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(appdefaultdir)/$$f"; \
+       done
+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)$(appdefaultdir)" "$(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-appdefaultDATA 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-appdefaultDATA 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-appdefaultDATA 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-appdefaultDATA uninstall-appmanDATA \
+       uninstall-binPROGRAMS uninstall-info-am
+
+
+.ad:
+       cp $< $@
+
+.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/xmore/NEWS b/xmore/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xmore/README b/xmore/README
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xmore/XMore.ad b/xmore/XMore.ad
new file mode 100644 (file)
index 0000000..98704d9
--- /dev/null
@@ -0,0 +1,130 @@
+! XMore.ad
+
+! keyboard translations
+*text.Translations: #override\n\
+        Ctrl<Key>S:     no-op(RingBell)\n\
+        Ctrl<Key>R:     no-op(RingBell)\n\
+        <Key>space:     next-page()\n\
+        <Key>F:         next-page()\n\
+        Ctrl<Key>B:     previous-page()\n\
+        <Key>B:         previous-page()\n\
+        <Key>K:         scroll-one-line-down()\n\
+        <Key>Y:         scroll-one-line-down()\n\
+        <Key>Return:    scroll-one-line-up()\n\
+        <Key>J:         scroll-one-line-up()\n\
+        <Key>E:         scroll-one-line-up()\n\
+        <Key>p:         print()\n\
+        <Key>q:         quit()\n
+*text.baseTranslations: #override\n\
+        <Key>space:     next-page()\n\
+        <Key>F:         next-page()\n\
+        Ctrl<Key>B:     previous-page()\n\
+        <Key>K:         scroll-one-line-down()\n\
+        <Key>Y:         scroll-one-line-down()\n\
+        <Key>Return:    scroll-one-line-up()\n\
+        <Key>J:         scroll-one-line-up()\n\
+        <Key>E:         scroll-one-line-up()\n\
+        <Key>p:         print()\n\
+        <Key>q:         quit()\n
+
+! tip messages
+*quit.tip:  Quit application
+*print.tip: Print file
+
+! Use "white" as background for printing
+*printshell*background:   white
+
+! Print dialog
+*printdialogshell*geometry:                       600x120
+*printdialogshell*title:                          Print
+*printdialogshell*main*ok.fromVert:               innerform
+*printdialogshell*main*ok.label:                  Print
+*printdialogshell*main*ok.tip:                    Print
+*printdialogshell*main*setup.fromHoriz:           ok
+*printdialogshell*main*setup.fromVert:            innerform
+*printdialogshell*main*setup.label:               Setup...
+*printdialogshell*main*setup.tip:                 Configure print job options (page size, orientation, etc.)
+*printdialogshell*main*cancel.fromHoriz:          setup
+*printdialogshell*main*cancel.fromVert:           innerform
+*printdialogshell*main*cancel.label:              Cancel
+*printdialogshell*main*cancel.tip:                Cancel printing
+*printdialogshell*main*desclabel.label:           Printer Description:
+*printdialogshell*main*desclabel.tip:             Short description of printer
+*printdialogshell*main*desc.fromHoriz:            desclabel
+*printdialogshell*main*desc.tip:                  Short description of printer
+*printdialogshell*main*info.fromHoriz:            desc
+*printdialogshell*main*info.label:                Printer info...
+*printdialogshell*main*info.tip:                  Display additional information about this printer
+*printdialogshell*main*namelabel.fromVert:        desclabel
+*printdialogshell*main*namelabel.label:           Printer Name:
+*printdialogshell*main*namelabel.tip:             Name of selected printer
+*printdialogshell*main*name.fromHoriz:            namelabel
+*printdialogshell*main*name.fromVert:             desclabel
+*printdialogshell*main*name.tip:                  Name of selected printer
+*printdialogshell*main*selectprinter.fromHoriz:   name
+*printdialogshell*main*selectprinter.fromVert:    desclabel
+*printdialogshell*main*selectprinter.label:       Select Printer...
+*printdialogshell*main*selectprinter.label:       Select Printer...
+*printdialogshell*main*selectprinter.tip:         Select a different printer
+*printdialogshell*main*filenamelabel.fromVert:    namelabel
+*printdialogshell*main*filenamelabel.label:       File Name:
+*printdialogshell*main*filenamelabel.tip:         File where the output should be stored
+*printdialogshell*main*filename.fromHoriz:        filenamelabel
+*printdialogshell*main*filename.fromVert:         namelabel
+*printdialogshell*main*filename.tip:              File where the output should be stored
+*printdialogshell*main*selectfile.fromHoriz:      filename
+*printdialogshell*main*selectfile.fromVert:       namelabel
+*printdialogshell*main*selectfile.label:          Select File...
+*printdialogshell*main*selectfile.tip:            Select file where the output should be stored
+*printdialogshell*main*printtoprinter.fromVert:   filenamelabel
+*printdialogshell*main*printtoprinter.label:      Print to Printer
+*printdialogshell*main*printtoprinter.tip:        Send print job to printer
+*printdialogshell*main*printtofile.fromVert:      filenamelabel
+*printdialogshell*main*printtofile.fromHoriz:     printtoprinter
+*printdialogshell*main*printtofile.label:         Print to File
+*printdialogshell*main*printtofile.tip:           Save print job in a file
+
+! Print job options dialog
+*printdialogshell*setup*geometry:                     600x400
+*printdialogshell*setup*title:                        Print: Print job options
+*printdialogshell*setup*ok.fromVert:                  list
+*printdialogshell*setup*ok.label:                     OK
+*printdialogshell*setup*ok.tip:                       Commit changes
+*printdialogshell*setup*cancel.fromHoriz:             ok
+*printdialogshell*setup*cancel.fromVert:              list
+*printdialogshell*setup*cancel.label:                 Cancel
+*printdialogshell*setup*cancel.tip:                   Cancel and reset to defaults
+*printdialogshell*setup*paperlist.tip:                Select paper size
+*printdialogshell*setup*resolutionlist.fromHoriz:     paperlist
+*printdialogshell*setup*resolutionlist.tip:           Select page resolution
+*printdialogshell*setup*orientationlist.fromHoriz:    resolutionlist
+*printdialogshell*setup*orientationlist.tip:          Select page orientation
+*printdialogshell*setup*plexlist.fromHoriz:           orientationlist
+*printdialogshell*setup*plexlist.tip:                 Select page plex mode (simplex, duplex, etc.)
+*printdialogshell*setup*colorspacelist.fromHoriz:     plexlist
+*printdialogshell*setup*colorspacelist.tip:           Select color space (color, grayscale, CYMK, etc.)
+*printdialogshell*setup*jobcopieslabel.fromVert:      paperlist
+*printdialogshell*setup*jobcopieslabel.tip:           Set number of job copies
+*printdialogshell*setup*jobcopieslabel.label:         Job Copies:
+*printdialogshell*setup*jobcopies.fromHoriz:          jobcopieslabel
+*printdialogshell*setup*jobcopies.fromVert:           paperlist
+*printdialogshell*setup*jobcopies.tip:                Set number of job copies
+
+! Printer selection
+*printdialogshell*printerselection*geometry:          400x150
+*printdialogshell*printerselection*title:             Print: Select printer
+*printdialogshell*printerselection*ok.fromVert:       list
+*printdialogshell*printerselection*ok.label:          OK
+*printdialogshell*printerselection*ok.tip:            Switch printer
+*printdialogshell*printerselection*cancel.fromHoriz:  ok
+*printdialogshell*printerselection*cancel.fromVert:   list
+*printdialogshell*printerselection*cancel.label:      Cancel
+*printdialogshell*printerselection*cancel.tip:        Cancel printer selection
+*printdialogshell*printerselection*list.tip:          Select printer name from list
+
+! Select job file
+*printdialogshell*selectfile*geometry:          400x80
+*printdialogshell*selectfile*title:             Print: Select job file
+*printdialogshell*selectfile*dialog.label:      Select Filename:
+
+! EOF.
diff --git a/xmore/aclocal.m4 b/xmore/aclocal.m4
new file mode 100644 (file)
index 0000000..103df10
--- /dev/null
@@ -0,0 +1,1581 @@
+# 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 <scott@netsplit.com>.
+#
+# 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 <http://www.freedesktop.org/software/pkgconfig>.])],
+               [$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 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 
+
+# XAW_CHECK_XPRINT_SUPPORT()
+# --------------------------
+# Adds --enable/disable-xprint and selects the appropriate version of the Xaw 
+# library. If neither --enable-xprint nor --disable-xprint are given, 
+# the presence of an Xaw with Xprint support will be auto detected
+
+AC_DEFUN([XAW_CHECK_XPRINT_SUPPORT],[
+       AC_ARG_ENABLE(xprint, AC_HELP_STRING([--enable-xprint], [Enable XPrint support]),
+                       [use_xprint=$enableval],[use_xprint=auto])
+       if test "x$use_xprint" = "xyes"; then
+               TMP_CHECK1=xaw8
+               TMP_CHECK2=
+               xaw_use_xprint=yes
+       elif test "x$use_xprint" = "xno"; then
+               TMP_CHECK1=xaw7
+               TMP_CHECK2=
+               xaw_use_xprint=no
+       else
+               TMP_CHECK1=xaw8
+               TMP_CHECK2=xaw7
+               xaw_use_xprint=yes
+       fi
+
+       PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK1, success=yes, success=no)
+       if [[ ! -z $TMP_CHECK2 ]] ; then
+               if test $success = no ; then
+                       PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK2, success=yes, success=no)
+                       xaw_use_xprint=no
+               fi
+       fi
+
+       if test "x$success" = "xyes"; then
+               $1_CFLAGS=$TMP_XAW_CFLAGS
+               $1_LIBS=$TMP_XAW_LIBS
+
+               AM_CONDITIONAL([XAW_USE_XPRINT], [test "x$xaw_use_xprint" = "xyes"])
+       else
+               AC_MSG_ERROR([No suitable version of Xaw found])
+       fi
+])
+
+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.2
+       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],[
+XORG_SGML_PATH=$prefix/share/sgml
+HAVE_DEFS_ENT=
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+AC_PATH_PROG(PS2PDF, ps2pdf)
+
+AC_MSG_CHECKING([Whether to build documentation])
+
+if test x$HAVE_DEFS_ENT != 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 && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+XORG_SGML_PATH=$prefix/share/sgml
+HAVE_DEFS_ENT=
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([Whether to build text documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([Whether to build PDF documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([Whether to build PostScript documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([Whether to build HTML documentation])
+if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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/xmore/compile b/xmore/compile
new file mode 100755 (executable)
index 0000000..1b1d232
--- /dev/null
@@ -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 <tromey@cygnus.com>.
+#
+# 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 <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+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 <bug-automake@gnu.org>.
+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/xmore/config.guess b/xmore/config.guess
new file mode 100755 (executable)
index 0000000..396482d
--- /dev/null
@@ -0,0 +1,1500 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
+
+timestamp='2006-07-02'
+
+# 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 <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+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 "$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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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 <stdlib.h>
+              #include <unistd.h>
+
+              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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       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*:[3456]*)
+       echo i586-pc-interix${UNAME_RELEASE}
+       exit ;;
+    EM64T:Interix*:[3456]*)
+       echo x86_64-unknown-interix${UNAME_RELEASE}
+       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*:*:* | x86_64: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 ;;
+    avr32*: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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       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 | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-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 ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-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 <features.h>
+       #ifdef __ELF__
+       # ifdef __GLIBC__
+       #  if __GLIBC__ >= 2
+       LIBC=gnu
+       #  else
+       LIBC=gnulibc1
+       #  endif
+       # else
+       LIBC=gnulibc1
+       # endif
+       #else
+       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+       LIBC=gnu
+       #else
+       LIBC=gnuaout
+       #endif
+       #endif
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^LIBC/{
+               s: ::g
+               p
+           }'`"
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/xmore/config.h.in b/xmore/config.h.in
new file mode 100644 (file)
index 0000000..c364eda
--- /dev/null
@@ -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/xmore/config.sub b/xmore/config.sub
new file mode 100755 (executable)
index 0000000..387c18d
--- /dev/null
@@ -0,0 +1,1608 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
+
+timestamp='2006-07-02'
+
+# 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 <config-patches@gnu.org>.  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 <config-patches@gnu.org>."
+
+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-newlib* | 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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | 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 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | 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 \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | 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 | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xscale | xscalee[bl] | 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)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | 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-* \
+       | m32c-* | 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-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | 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-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | 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-*)
+               ;;
+       # 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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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 | sparcv9v)
+               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* | -solidbsd* \
+             | -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-newlib* | -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* | -rdos* | -toppers*)
+       # 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
+        spu-*)
+               os=-elf
+               ;;
+       *-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/xmore/configure b/xmore/configure
new file mode 100755 (executable)
index 0000000..f535d80
--- /dev/null
@@ -0,0 +1,5534 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.61 for xmore 1.0.1.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+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) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&    (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    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=.
+  case $as_dir in
+        /*)
+          for as_base in sh bash ksh sh5; do
+            as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+          done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+        # Try only shells that exist, to save several forks.
+        if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+               { ("$as_shell") 2> /dev/null <<\_ASEOF
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+              as_have_required=yes
+              if { "$as_shell" 2> /dev/null <<\_ASEOF
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf@gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+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$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+       case $1 in
+        -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# 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`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='xmore'
+PACKAGE_TARNAME='xmore'
+PACKAGE_VERSION='1.0.1'
+PACKAGE_STRING='xmore 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
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+CYGPATH_W
+PACKAGE
+VERSION
+ACLOCAL
+AUTOCONF
+AUTOMAKE
+AUTOHEADER
+MAKEINFO
+install_sh
+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
+TMP_XAW_CFLAGS
+TMP_XAW_LIBS
+XAW_USE_XPRINT_TRUE
+XAW_USE_XPRINT_FALSE
+XPRINT_UTIL_CFLAGS
+XPRINT_UTIL_LIBS
+XMORE_CFLAGS
+XMORE_LIBS
+APPDEFS_CFLAGS
+APPDEFS_LIBS
+appdefaultdir
+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=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+PKG_CONFIG
+TMP_XAW_CFLAGS
+TMP_XAW_LIBS
+XPRINT_UTIL_CFLAGS
+XPRINT_UTIL_LIBS
+APPDEFS_CFLAGS
+APPDEFS_LIBS'
+
+
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)   ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$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 ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -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'`
+    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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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'`
+    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; }; }
+    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 directory names.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { echo "$as_me: error: Working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$0" ||
+$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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 xmore 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR          info documentation [DATAROOTDIR/info]
+  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR           man documentation [DATAROOTDIR/man]
+  --docdir=DIR           documentation root [DATAROOTDIR/doc/xmore]
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
+_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 xmore 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 build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-xprint         Enable XPrint 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<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  PKG_CONFIG  path to pkg-config utility
+  TMP_XAW_CFLAGS
+              C compiler flags for TMP_XAW, overriding pkg-config
+  TMP_XAW_LIBS
+              linker flags for TMP_XAW, overriding pkg-config
+  XPRINT_UTIL_CFLAGS
+              C compiler flags for XPRINT_UTIL, overriding pkg-config
+  XPRINT_UTIL_LIBS
+              linker flags for XPRINT_UTIL, overriding pkg-config
+  APPDEFS_CFLAGS
+              C compiler flags for APPDEFS, overriding pkg-config
+  APPDEFS_LIBS
+              linker flags for APPDEFS, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" || continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+xmore configure 1.0.1
+generated by GNU Autoconf 2.61
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 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
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by xmore $as_me 1.0.1, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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
+IFS=$as_save_IFS
+
+} >&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_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_arg'"
+      ;;
+    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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+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,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r 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 -f -r conftest* 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 -n "$CONFIG_SITE"; then
+  set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+  set x "$ac_default_prefix/share/config.site" \
+       "$ac_default_prefix/etc/config.site"
+fi
+shift
+for ac_site_file
+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 $ac_precious_vars; 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
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    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 -f 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$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='xmore'
+ 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"}
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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.exe
+  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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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.exe
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+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
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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[^ ]*//'`
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
+  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
+
+# Check that 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'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 that 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 { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 | *.map | *.inf | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+    *) 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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; 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 core 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
+{ 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
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       CFLAGS=""
+      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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+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 ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_c89=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 <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+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 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+  ;;
+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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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
+IFS=$as_save_IFS
+
+  ;;
+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
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+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
+
+       # Check whether --enable-xprint was given.
+if test "${enable_xprint+set}" = set; then
+  enableval=$enable_xprint; use_xprint=$enableval
+else
+  use_xprint=auto
+fi
+
+       if test "x$use_xprint" = "xyes"; then
+               TMP_CHECK1=xaw8
+               TMP_CHECK2=
+               xaw_use_xprint=yes
+       elif test "x$use_xprint" = "xno"; then
+               TMP_CHECK1=xaw7
+               TMP_CHECK2=
+               xaw_use_xprint=no
+       else
+               TMP_CHECK1=xaw8
+               TMP_CHECK2=xaw7
+               xaw_use_xprint=yes
+       fi
+
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for TMP_XAW" >&5
+echo $ECHO_N "checking for TMP_XAW... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$TMP_XAW_CFLAGS"; then
+        pkg_cv_TMP_XAW_CFLAGS="$TMP_XAW_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK1\"") >&5
+  ($PKG_CONFIG --exists --print-errors "$TMP_CHECK1") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_TMP_XAW_CFLAGS=`$PKG_CONFIG --cflags "$TMP_CHECK1" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$TMP_XAW_LIBS"; then
+        pkg_cv_TMP_XAW_LIBS="$TMP_XAW_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK1\"") >&5
+  ($PKG_CONFIG --exists --print-errors "$TMP_CHECK1") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_TMP_XAW_LIBS=`$PKG_CONFIG --libs "$TMP_CHECK1" 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
+               TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$TMP_CHECK1"`
+        else
+               TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$TMP_CHECK1"`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$TMP_XAW_PKG_ERRORS" >&5
+
+       { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+                success=no
+elif test $pkg_failed = untried; then
+       success=no
+else
+       TMP_XAW_CFLAGS=$pkg_cv_TMP_XAW_CFLAGS
+       TMP_XAW_LIBS=$pkg_cv_TMP_XAW_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       success=yes
+fi
+       if [ ! -z $TMP_CHECK2 ] ; then
+               if test $success = no ; then
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for TMP_XAW" >&5
+echo $ECHO_N "checking for TMP_XAW... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$TMP_XAW_CFLAGS"; then
+        pkg_cv_TMP_XAW_CFLAGS="$TMP_XAW_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK2\"") >&5
+  ($PKG_CONFIG --exists --print-errors "$TMP_CHECK2") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_TMP_XAW_CFLAGS=`$PKG_CONFIG --cflags "$TMP_CHECK2" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$TMP_XAW_LIBS"; then
+        pkg_cv_TMP_XAW_LIBS="$TMP_XAW_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$TMP_CHECK2\"") >&5
+  ($PKG_CONFIG --exists --print-errors "$TMP_CHECK2") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_TMP_XAW_LIBS=`$PKG_CONFIG --libs "$TMP_CHECK2" 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
+               TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$TMP_CHECK2"`
+        else
+               TMP_XAW_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$TMP_CHECK2"`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$TMP_XAW_PKG_ERRORS" >&5
+
+       { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+                success=no
+elif test $pkg_failed = untried; then
+       success=no
+else
+       TMP_XAW_CFLAGS=$pkg_cv_TMP_XAW_CFLAGS
+       TMP_XAW_LIBS=$pkg_cv_TMP_XAW_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       success=yes
+fi
+                       xaw_use_xprint=no
+               fi
+       fi
+
+       if test "x$success" = "xyes"; then
+               XMORE_CFLAGS=$TMP_XAW_CFLAGS
+               XMORE_LIBS=$TMP_XAW_LIBS
+
+
+
+if test "x$xaw_use_xprint" = "xyes"; then
+  XAW_USE_XPRINT_TRUE=
+  XAW_USE_XPRINT_FALSE='#'
+else
+  XAW_USE_XPRINT_TRUE='#'
+  XAW_USE_XPRINT_FALSE=
+fi
+
+       else
+               { { echo "$as_me:$LINENO: error: No suitable version of Xaw found" >&5
+echo "$as_me: error: No suitable version of Xaw found" >&2;}
+   { (exit 1); exit 1; }; }
+       fi
+
+if test "x$xaw_use_xprint" = "xyes" ; then
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for XPRINT_UTIL" >&5
+echo $ECHO_N "checking for XPRINT_UTIL... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$XPRINT_UTIL_CFLAGS"; then
+        pkg_cv_XPRINT_UTIL_CFLAGS="$XPRINT_UTIL_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xprintutil xp\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xprintutil xp") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_XPRINT_UTIL_CFLAGS=`$PKG_CONFIG --cflags "xprintutil xp" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$XPRINT_UTIL_LIBS"; then
+        pkg_cv_XPRINT_UTIL_LIBS="$XPRINT_UTIL_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xprintutil xp\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xprintutil xp") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_XPRINT_UTIL_LIBS=`$PKG_CONFIG --libs "xprintutil xp" 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
+               XPRINT_UTIL_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xprintutil xp"`
+        else
+               XPRINT_UTIL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xprintutil xp"`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XPRINT_UTIL_PKG_ERRORS" >&5
+
+       { { echo "$as_me:$LINENO: error: Package requirements (xprintutil xp) were not met:
+
+$XPRINT_UTIL_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 XPRINT_UTIL_CFLAGS
+and XPRINT_UTIL_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 (xprintutil xp) were not met:
+
+$XPRINT_UTIL_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 XPRINT_UTIL_CFLAGS
+and XPRINT_UTIL_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 XPRINT_UTIL_CFLAGS
+and XPRINT_UTIL_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+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 XPRINT_UTIL_CFLAGS
+and XPRINT_UTIL_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+       XPRINT_UTIL_CFLAGS=$pkg_cv_XPRINT_UTIL_CFLAGS
+       XPRINT_UTIL_LIBS=$pkg_cv_XPRINT_UTIL_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       :
+fi
+
+   XMORE_CFLAGS="$XMORE_CFLAGS $XPRINT_UTIL_CFLAGS"
+   XMORE_LIBS="$XMORE_LIBS $XPRINT_UTIL_LIBS"
+fi
+
+
+
+
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for APPDEFS" >&5
+echo $ECHO_N "checking for APPDEFS... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$APPDEFS_CFLAGS"; then
+        pkg_cv_APPDEFS_CFLAGS="$APPDEFS_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_APPDEFS_CFLAGS=`$PKG_CONFIG --cflags "xt" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$APPDEFS_LIBS"; then
+        pkg_cv_APPDEFS_LIBS="$APPDEFS_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xt\"") >&5
+  ($PKG_CONFIG --exists --print-errors "xt") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_APPDEFS_LIBS=`$PKG_CONFIG --libs "xt" 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
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xt"`
+        else
+               APPDEFS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xt"`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$APPDEFS_PKG_ERRORS" >&5
+
+       { { echo "$as_me:$LINENO: error: Package requirements (xt) were not met:
+
+$APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_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 (xt) were not met:
+
+$APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+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 APPDEFS_CFLAGS
+and APPDEFS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+       APPDEFS_CFLAGS=$pkg_cv_APPDEFS_CFLAGS
+       APPDEFS_LIBS=$pkg_cv_APPDEFS_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       :
+fi
+appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/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_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { 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=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_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; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ 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
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+
+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 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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     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 "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+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_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$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 "${XAW_USE_XPRINT_TRUE}" && test -z "${XAW_USE_XPRINT_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"XAW_USE_XPRINT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"XAW_USE_XPRINT\" 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+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+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+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) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+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$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+       case $1 in
+        -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by xmore $as_me 1.0.1, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+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 and configuration settings, 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 <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+xmore config.status 1.0.1
+configured by $0, generated by GNU Autoconf 2.61,
+  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2006 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+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
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --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;;
+  --he | --h)
+    # Conflict between --help and --header
+    { 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 ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { 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"
+     ac_need_defaults=false ;;
+
+  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 CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  CONFIG_SHELL=$SHELL
+  export CONFIG_SHELL
+  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) { { 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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+#
+# Set up the sed scripts for 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
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+CYGPATH_W!$CYGPATH_W$ac_delim
+PACKAGE!$PACKAGE$ac_delim
+VERSION!$VERSION$ac_delim
+ACLOCAL!$ACLOCAL$ac_delim
+AUTOCONF!$AUTOCONF$ac_delim
+AUTOMAKE!$AUTOMAKE$ac_delim
+AUTOHEADER!$AUTOHEADER$ac_delim
+MAKEINFO!$MAKEINFO$ac_delim
+install_sh!$install_sh$ac_delim
+STRIP!$STRIP$ac_delim
+INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
+mkdir_p!$mkdir_p$ac_delim
+AWK!$AWK$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+am__leading_dot!$am__leading_dot$ac_delim
+AMTAR!$AMTAR$ac_delim
+am__tar!$am__tar$ac_delim
+am__untar!$am__untar$ac_delim
+MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
+MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
+MAINT!$MAINT$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+DEPDIR!$DEPDIR$ac_delim
+am__include!$am__include$ac_delim
+am__quote!$am__quote$ac_delim
+AMDEP_TRUE!$AMDEP_TRUE$ac_delim
+AMDEP_FALSE!$AMDEP_FALSE$ac_delim
+AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
+CCDEPMODE!$CCDEPMODE$ac_delim
+am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
+am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
+PKG_CONFIG!$PKG_CONFIG$ac_delim
+TMP_XAW_CFLAGS!$TMP_XAW_CFLAGS$ac_delim
+TMP_XAW_LIBS!$TMP_XAW_LIBS$ac_delim
+XAW_USE_XPRINT_TRUE!$XAW_USE_XPRINT_TRUE$ac_delim
+XAW_USE_XPRINT_FALSE!$XAW_USE_XPRINT_FALSE$ac_delim
+XPRINT_UTIL_CFLAGS!$XPRINT_UTIL_CFLAGS$ac_delim
+XPRINT_UTIL_LIBS!$XPRINT_UTIL_LIBS$ac_delim
+XMORE_CFLAGS!$XMORE_CFLAGS$ac_delim
+XMORE_LIBS!$XMORE_LIBS$ac_delim
+APPDEFS_CFLAGS!$APPDEFS_CFLAGS$ac_delim
+APPDEFS_LIBS!$APPDEFS_LIBS$ac_delim
+appdefaultdir!$appdefaultdir$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+host_os!$host_os$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+APP_MAN_SUFFIX!$APP_MAN_SUFFIX$ac_delim
+LIB_MAN_SUFFIX!$LIB_MAN_SUFFIX$ac_delim
+FILE_MAN_SUFFIX!$FILE_MAN_SUFFIX$ac_delim
+MISC_MAN_SUFFIX!$MISC_MAN_SUFFIX$ac_delim
+DRIVER_MAN_SUFFIX!$DRIVER_MAN_SUFFIX$ac_delim
+ADMIN_MAN_SUFFIX!$ADMIN_MAN_SUFFIX$ac_delim
+APP_MAN_DIR!$APP_MAN_DIR$ac_delim
+LIB_MAN_DIR!$LIB_MAN_DIR$ac_delim
+FILE_MAN_DIR!$FILE_MAN_DIR$ac_delim
+MISC_MAN_DIR!$MISC_MAN_DIR$ac_delim
+DRIVER_MAN_DIR!$DRIVER_MAN_DIR$ac_delim
+ADMIN_MAN_DIR!$ADMIN_MAN_DIR$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 14; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_ACEOF
+
+
+# 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
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      ac_file_inputs="$ac_file_inputs $ac_f"
+    done
+
+    # 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.  */
+    configure_input="Generated from "`IFS=:
+         echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    fi
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin";;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$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'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+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&@top_builddir@&$ac_top_builddir_sub&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out"; rm -f "$tmp/out";;
+  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
+  esac
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+_ACEOF
+
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status.  If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless.  But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([  #]*\\)[^        ]*\\([  ]*'
+ac_dB='\\)[     (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
+
+uniq confdefs.h |
+  sed -n '
+       t rset
+       :rset
+       s/^[     ]*#[    ]*define[       ][      ]*//
+       t ok
+       d
+       :ok
+       s/[\\&,]/\\&/g
+       s/^\('"$ac_word_re"'\)\(([^()]*)\)[      ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+       s/^\('"$ac_word_re"'\)[  ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+  ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then replace #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.
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[    #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is:         sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is:        sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be:    sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
+do
+  # Write a here document:
+    cat >>$CONFIG_STATUS <<_ACEOF
+    # First, check the format of the line:
+    cat >"\$tmp/defines.sed" <<\\CEOF
+/^[     ]*#[    ]*undef[        ][      ]*$ac_word_re[  ]*\$/b def
+/^[     ]*#[    ]*define[       ][      ]*$ac_word_re[(         ]/b def
+b
+:def
+_ACEOF
+  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+  grep . conftest.tail >/dev/null || break
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines conftest.tail
+
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
+cat >>$CONFIG_STATUS <<\_ACEOF
+  if test x"$ac_file" != x-; then
+    echo "/* $configure_input  */" >"$tmp/config.h"
+    cat "$ac_result" >>"$tmp/config.h"
+    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
+      rm -f $ac_file
+      mv "$tmp/config.h" $ac_file
+    fi
+  else
+    echo "/* $configure_input  */"
+    cat "$ac_result"
+  fi
+  rm -f "$tmp/out12"
+# 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" >`$as_dirname -- $ac_file ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X$ac_file : 'X\(//\)[^/]' \| \
+        X$ac_file : 'X\(//\)$' \| \
+        X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
+echo X$ac_file |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) 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=`$as_dirname -- "$mf" ||
+$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=`$as_dirname -- "$file" ||
+$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'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$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'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (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/xmore/configure.ac b/xmore/configure.ac
new file mode 100644 (file)
index 0000000..5c233b6
--- /dev/null
@@ -0,0 +1,53 @@
+
+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(xmore,[1.0.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xmore)
+AM_INIT_AUTOMAKE([dist-bzip2])
+AM_MAINTAINER_MODE
+
+AM_CONFIG_HEADER(config.h)
+
+AC_PROG_CC
+AC_PROG_INSTALL
+
+# Checks for pkg-config packages
+XAW_CHECK_XPRINT_SUPPORT(XMORE)
+if test "x$xaw_use_xprint" = "xyes" ; then
+   PKG_CHECK_MODULES(XPRINT_UTIL, xprintutil xp)
+
+   XMORE_CFLAGS="$XMORE_CFLAGS $XPRINT_UTIL_CFLAGS"
+   XMORE_LIBS="$XMORE_LIBS $XPRINT_UTIL_LIBS"
+fi
+
+AC_SUBST(XMORE_CFLAGS)
+AC_SUBST(XMORE_LIBS)
+
+PKG_CHECK_MODULES(APPDEFS, xt)
+appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
+AC_SUBST(appdefaultdir)
+
+XORG_MANPAGE_SECTIONS
+XORG_RELEASE_VERSION
+
+AC_OUTPUT([Makefile])
diff --git a/xmore/depcomp b/xmore/depcomp
new file mode 100755 (executable)
index 0000000..04701da
--- /dev/null
@@ -0,0 +1,530 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2005-07-09.11
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+gcc)
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+  sed -e 's/^[^:]*: / /' \
+      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+  tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'.  On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like `#:fec' to the end of the
+    # dependency line.
+    tr ' ' '
+' < "$tmpdepfile" \
+    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+    tr '
+' ' ' >> $depfile
+    echo >> $depfile
+
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' '
+' < "$tmpdepfile" \
+   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+   >> $depfile
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+aix)
+  # The C for AIX Compiler uses -M and outputs the dependencies
+  # in a .u file.  In older versions, this file always lives in the
+  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # start of each line; $object doesn't have directory information.
+  # Version 6 uses the directory in both cases.
+  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+  tmpdepfile="$stripped.u"
+  if test "$libtool" = yes; then
+    "$@" -Wc,-M
+  else
+    "$@" -M
+  fi
+  stat=$?
+
+  if test -f "$tmpdepfile"; then :
+  else
+    stripped=`echo "$stripped" | sed 's,^.*/,,'`
+    tmpdepfile="$stripped.u"
+  fi
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+
+  if test -f "$tmpdepfile"; then
+    outname="$stripped.o"
+    # Each line is of the form `foo.o: dependent.h'.
+    # Do two passes, one to just change these to
+    # `$object: dependent.h' and one to simply `dependent.h:'.
+    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+icc)
+  # Intel's C compiler understands `-MD -MF file'.  However on
+  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+  # ICC 7.0 will fill foo.d with something like
+  #    foo.o: sub/foo.c
+  #    foo.o: sub/foo.h
+  # which is wrong.  We want:
+  #    sub/foo.o: sub/foo.c
+  #    sub/foo.o: sub/foo.h
+  #    sub/foo.c:
+  #    sub/foo.h:
+  # ICC 7.1 will output
+  #    foo.o: sub/foo.c sub/foo.h
+  # and will wrap long lines using \ :
+  #    foo.o: sub/foo.c ... \
+  #     sub/foo.h ... \
+  #     ...
+
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Do two passes, one to just change these to
+  # `$object: dependent.h' and one to simply `dependent.h:'.
+  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+    sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+   # dependencies in `foo.d' instead, so we check for that too.
+   # Subdirectories are respected.
+   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+   test "x$dir" = "x$object" && dir=
+   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+   if test "$libtool" = yes; then
+      # With Tru64 cc, shared objects can also be used to make a
+      # static library.  This mecanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in in $dir.libs/$base.o.d and
+      # in $dir$base.o.d.  We have to check for both files, because
+      # one of the two compilations can be disabled.  We should prefer
+      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+      # automatically cleaned when .libs/ is deleted, while ignoring
+      # the former would cause a distcleancheck panic.
+      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
+      tmpdepfile2=$dir$base.o.d          # libtool 1.5
+      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
+      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
+      "$@" -Wc,-MD
+   else
+      tmpdepfile1=$dir$base.o.d
+      tmpdepfile2=$dir$base.d
+      tmpdepfile3=$dir$base.d
+      tmpdepfile4=$dir$base.d
+      "$@" -MD
+   fi
+
+   stat=$?
+   if test $stat -eq 0; then :
+   else
+      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+      exit $stat
+   fi
+
+   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+   do
+     test -f "$tmpdepfile" && break
+   done
+   if test -f "$tmpdepfile"; then
+      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+      # That's a tab and a space in the [].
+      sed -e 's,^.*\.[a-z]*:[   ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+   else
+      echo "#dummy" > "$depfile"
+   fi
+   rm -f "$tmpdepfile"
+   ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  # Require at least two characters before searching for `:'
+  # in the target name.  This is to cope with DOS-style filenames:
+  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  "$@" $dashmflag |
+    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # Remove any Libtool call
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no
+  for arg in "$@"; do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    # Strip any option that makedepend may not understand.  Remove
+    # the object too, otherwise makedepend will parse it as a source file.
+    -*|$object)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix="`echo $object | sed 's/^.*\././'`"
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  "$@" -E |
+    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+    sed '$ s: \\$::' > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o,
+  # because we must use -o when running libtool.
+  "$@" || exit $?
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::   \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/xmore/install-sh b/xmore/install-sh
new file mode 100755 (executable)
index 0000000..4d4a951
--- /dev/null
@@ -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/xmore/missing b/xmore/missing
new file mode 100755 (executable)
index 0000000..894e786
--- /dev/null
@@ -0,0 +1,360 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2005-06-08.21
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
+#   Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try \`$0 --help' for more information"
+  exit 1
+fi
+
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+  configure_ac=configure.ac
+else
+  configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case "$1" in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  # Exit code 63 means version mismatch.  This often happens
+  # when the user try to use an ancient version of a tool on
+  # a file that requires a minimum version.  In this case we
+  # we should proceed has if the program had been absent, or
+  # if --run hadn't been passed.
+  if test $? = 63; then
+    run=:
+    msg="probably too old"
+  fi
+  ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+  aclocal      touch file \`aclocal.m4'
+  autoconf     touch file \`configure'
+  autoheader   touch file \`config.h.in'
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Now exit if we have it, but it failed.  Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case "$1" in
+  lex|yacc)
+    # Not GNU programs, they don't have --version.
+    ;;
+
+  tar)
+    if test -n "$run"; then
+       echo 1>&2 "ERROR: \`tar' requires --run"
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       exit 1
+    fi
+    ;;
+
+  *)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       # Could not run --version or --help.  This is probably someone
+       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # $TOOL exists and not knowing $TOOL uses missing.
+       exit 1
+    fi
+    ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+  aclocal*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
+         to install the \`Automake' and \`Perl' packages.  Grab them from
+         any GNU archive site."
+    touch aclocal.m4
+    ;;
+
+  autoconf)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`${configure_ac}'.  You might want to install the
+         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+         archive site."
+    touch configure
+    ;;
+
+  autoheader)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site."
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z "$files" && files="config.h"
+    touch_files=
+    for f in $files; do
+      case "$f" in
+      *:*) touch_files="$touch_files "`echo "$f" |
+                                      sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files="$touch_files $f.in";;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site."
+    find . -type f -name Makefile.am -print |
+          sed 's/\.am$/.in/' |
+          while read f; do touch "$f"; done
+    ;;
+
+  autom4te)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1' as part of \`Autoconf' from any GNU
+         archive site."
+
+    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo "#! /bin/sh"
+       echo "# Created by GNU Automake missing as a replacement of"
+       echo "#  $ $@"
+       echo "exit 0"
+       chmod +x $file
+       exit 1
+    fi
+    ;;
+
+  bison|yacc)
+    echo 1>&2 "\
+WARNING: \`$1' $msg.  You should only need it if
+         you modified a \`.y' file.  You may need the \`Bison' package
+         in order for those modifications to take effect.  You can get
+         \`Bison' from any GNU archive site."
+    rm -f y.tab.c y.tab.h
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+       case "$LASTARG" in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if [ -f "$SRCFILE" ]; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if [ -f "$SRCFILE" ]; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if [ ! -f y.tab.h ]; then
+       echo >y.tab.h
+    fi
+    if [ ! -f y.tab.c ]; then
+       echo 'main() { return 0; }' >y.tab.c
+    fi
+    ;;
+
+  lex|flex)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.l' file.  You may need the \`Flex' package
+         in order for those modifications to take effect.  You can get
+         \`Flex' from any GNU archive site."
+    rm -f lex.yy.c
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+       case "$LASTARG" in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if [ -f "$SRCFILE" ]; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if [ ! -f lex.yy.c ]; then
+       echo 'main() { return 0; }' >lex.yy.c
+    fi
+    ;;
+
+  help2man)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+        you modified a dependency of a manual page.  You may need the
+        \`Help2man' package in order for those modifications to take
+        effect.  You can get \`Help2man' from any GNU archive site."
+
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+       file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+    fi
+    if [ -f "$file" ]; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit 1
+    fi
+    ;;
+
+  makeinfo)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.texi' or \`.texinfo' file, or any other file
+         indirectly affecting the aspect of the manual.  The spurious
+         call might also be the consequence of using a buggy \`make' (AIX,
+         DU, IRIX).  You might want to install the \`Texinfo' package or
+         the \`GNU make' package.  Grab either from any GNU archive site."
+    # The file to touch is that specified with -o ...
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+      # ... or it is derived from the source name (dir/f.texi becomes f.info)
+      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+    fi
+    # If the file does not exist, the user really needs makeinfo;
+    # let's fail without touching anything.
+    test -f $file || exit 1
+    touch $file
+    ;;
+
+  tar)
+    shift
+
+    # We have already tried tar in the generic part.
+    # Look for gnutar/gtar before invocation to avoid ugly error
+    # messages.
+    if (gnutar --version > /dev/null 2>&1); then
+       gnutar "$@" && exit 0
+    fi
+    if (gtar --version > /dev/null 2>&1); then
+       gtar "$@" && exit 0
+    fi
+    firstarg="$1"
+    if shift; then
+       case "$firstarg" in
+       *o*)
+           firstarg=`echo "$firstarg" | sed s/o//`
+           tar "$firstarg" "$@" && exit 0
+           ;;
+       esac
+       case "$firstarg" in
+       *h*)
+           firstarg=`echo "$firstarg" | sed s/h//`
+           tar "$firstarg" "$@" && exit 0
+           ;;
+       esac
+    fi
+
+    echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         You may want to install GNU tar or Free paxutils, or check the
+         command line arguments."
+    exit 1
+    ;;
+
+  *)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.  Check the \`README' file,
+         it often tells you about the needed prerequisites for installing
+         this package.  You may also peek at any GNU archive site, in case
+         some other package would contain this missing \`$1' program."
+    exit 1
+    ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/xmore/mkinstalldirs b/xmore/mkinstalldirs
new file mode 100755 (executable)
index 0000000..259dbfc
--- /dev/null
@@ -0,0 +1,158 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+
+scriptversion=2005-06-29.22
+
+# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+errstatus=0
+dirmode=
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <bug-automake@gnu.org>."
+
+# process command line arguments
+while test $# -gt 0 ; do
+  case $1 in
+    -h | --help | --h*)         # -h for help
+      echo "$usage"
+      exit $?
+      ;;
+    -m)                         # -m PERM arg
+      shift
+      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+      dirmode=$1
+      shift
+      ;;
+    --version)
+      echo "$0 $scriptversion"
+      exit $?
+      ;;
+    --)                         # stop option processing
+      shift
+      break
+      ;;
+    -*)                         # unknown option
+      echo "$usage" 1>&2
+      exit 1
+      ;;
+    *)                          # first non-opt arg
+      break
+      ;;
+  esac
+done
+
+for file
+do
+  if test -d "$file"; then
+    shift
+  else
+    break
+  fi
+done
+
+case $# in
+  0) exit 0 ;;
+esac
+
+# Solaris 8's mkdir -p isn't thread-safe.  If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error.  This is a problem when calling mkinstalldirs
+# from a parallel make.  We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
+case $dirmode in
+  '')
+    if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+      echo "mkdir -p -- $*"
+      exec mkdir -p -- "$@"
+    else
+      # On NextStep and OpenStep, the `mkdir' command does not
+      # recognize any option.  It will interpret all options as
+      # directories to create, and then abort because `.' already
+      # exists.
+      test -d ./-p && rmdir ./-p
+      test -d ./--version && rmdir ./--version
+    fi
+    ;;
+  *)
+    if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+       test ! -d ./--version; then
+      echo "mkdir -m $dirmode -p -- $*"
+      exec mkdir -m "$dirmode" -p -- "$@"
+    else
+      # Clean up after NextStep and OpenStep mkdir.
+      for d in ./-m ./-p ./--version "./$dirmode";
+      do
+        test -d $d && rmdir $d
+      done
+    fi
+    ;;
+esac
+
+for file
+do
+  case $file in
+    /*) pathcomp=/ ;;
+    *)  pathcomp= ;;
+  esac
+  oIFS=$IFS
+  IFS=/
+  set fnord $file
+  shift
+  IFS=$oIFS
+
+  for d
+  do
+    test "x$d" = x && continue
+
+    pathcomp=$pathcomp$d
+    case $pathcomp in
+      -*) pathcomp=./$pathcomp ;;
+    esac
+
+    if test ! -d "$pathcomp"; then
+      echo "mkdir $pathcomp"
+
+      mkdir "$pathcomp" || lasterr=$?
+
+      if test ! -d "$pathcomp"; then
+       errstatus=$lasterr
+      else
+       if test ! -z "$dirmode"; then
+         echo "chmod $dirmode $pathcomp"
+         lasterr=
+         chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+         if test ! -z "$lasterr"; then
+           errstatus=$lasterr
+         fi
+       fi
+      fi
+    fi
+
+    pathcomp=$pathcomp/
+  done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/xmore/print.c b/xmore/print.c
new file mode 100644 (file)
index 0000000..fbb260b
--- /dev/null
@@ -0,0 +1,435 @@
+/*
+ * $Xorg: print.c,v 1.1 2004/04/30 02:05:54 gisburn Exp $
+ *
+Copyright 2004 Roland Mainz <roland.mainz@nrubsig.org>
+
+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.
+ *
+ */
+
+/* Turn a NULL pointer string into an empty string */
+#define NULLSTR(x) (((x)!=NULL)?(x):(""))
+
+#define Error(x) { printf x ; exit(EXIT_FAILURE); }
+#define Assertion(expr, msg) { if (!(expr)) { Error msg } }
+#define Log(x)   { if(True) printf x; }
+
+#ifdef XEDIT
+#include "xedit.h"
+#endif /* XEDIT */
+#include "print.h"
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/AsciiText.h> 
+#include <stdio.h>
+#include <stdlib.h>
+
+static Widget
+CreatePrintShell(Widget    videoshell,
+                 Screen   *pscreen,
+                 Visual   *pvisual,
+                 String    printshell_name,
+                 ArgList   args,
+                 Cardinal  numargs)
+{
+    String   videoname,
+             videoclass;
+    Widget   pappshell,
+             printshell;
+    Display *pdpy = XDisplayOfScreen(pscreen);
+    int      dummyc = 0;
+    String   dummys = "";
+    Cardinal shell_n;
+    Arg      shell_args[5];
+
+    XtGetApplicationNameAndClass(XtDisplay(videoshell), 
+                                 &videoname, &videoclass);
+
+    /* XXX: Why is the |dummyc|&&|dummys| stuff needed here ? */
+    XtDisplayInitialize(XtWidgetToApplicationContext(videoshell), pdpy,
+                        videoname, videoclass,
+                        NULL, 0,
+                        &dummyc, &dummys);
+
+    shell_n = 0;
+    XtSetArg(shell_args[shell_n], XtNscreen, pscreen); shell_n++;
+    if (pvisual) {
+        XtSetArg(shell_args[shell_n], XtNvisual, pvisual); shell_n++;
+    }
+    pappshell = XtAppCreateShell(videoname, videoclass,
+                                   applicationShellWidgetClass,
+                                   pdpy,
+                                   shell_args, shell_n);
+    printshell = XtCreatePopupShell(printshell_name,
+                                    xawPrintShellWidgetClass,
+                                    pappshell, args, numargs);
+                                
+
+    /* we're mapping/unmapping at start/end page time */
+    XtSetMappedWhenManaged(printshell, False);
+
+    /* We realise the widget when we're done with building the widget tree... */
+    
+    return printshell;
+}
+
+typedef struct
+{
+  const char       *programname;
+  Widget            toplevel;
+  Bool              isPrinting;
+  Widget            printshell;
+  struct
+  {
+      Widget  form;
+      Widget  pageheaderlabel;
+      Widget  text;
+  } content; /* content to print */
+  int               numpages;
+  Display          *pdpy;
+  Screen           *pscreen;
+  XPContext         pcontext;
+  XtCallbackProc    pdpyDestroyCallback;
+  void             *printtofile_handle;
+  const char       *jobtitle;
+} AppPrintData;
+
+static AppPrintData  apdx;
+static AppPrintData *apd = &apdx;
+
+/* Count pages in a text widget
+ * WARNING: This will reset the current position of the text widget
+ * back to the beginning */
+static
+long CountPages(Widget textWidget)
+{
+    long numpages = 0;
+
+    XawTextPosition prevpagepos = -1,
+                    currpos = 0;        
+
+    /* Move to the top of the file... */
+    XtCallActionProc(textWidget, "beginning-of-file", NULL, NULL, 0);
+    
+    /* ... count pages ...*/
+    do
+    {
+        prevpagepos = XawTextTopPosition(textWidget);
+        XtCallActionProc(textWidget, "next-page", NULL, NULL, 0);        
+        currpos     = XawTextTopPosition(textWidget);
+        numpages++;
+    } while(prevpagepos != currpos);            
+
+    /* ... and move to the top of the file... */
+    XtCallActionProc(textWidget, "beginning-of-file", NULL, NULL, 0);
+    
+    Log(("CountPages() found %ld pages.\n", numpages))
+
+    return numpages;
+}
+
+static void 
+PageSetupCB(Widget widget, XtPointer client_data, XtPointer call_data)
+{
+    Widget                       pshell = widget;
+    XawPrintShellCallbackStruct *psp    = (XawPrintShellCallbackStruct *)call_data;
+    AppPrintData                *p      = (AppPrintData *)client_data;
+   
+    Log(("--> PageSetupCB\n"));
+
+    if (!psp->last_page_in_job) {
+        int  currpage;
+        char buffer[256];
+
+        XtVaGetValues(pshell, XawNcurrPageNumInJob, &currpage, NULL);
+
+        sprintf(buffer, "Title: %s / Page: %d/%d", p->jobtitle, currpage, p->numpages);
+        XtVaSetValues(apd->content.pageheaderlabel, XtNlabel, buffer, NULL);
+
+        /* Note: XawPrintShell's pagecount starts with '1'
+         * (=first page is page no. '1') */
+        if (currpage > 1) {
+            Log(("pagedown %d\n", currpage));
+            XtCallActionProc(p->content.text, "next-page", NULL, NULL, 0);
+        }
+        else
+        {
+            Log(("first page\n"));
+        }              
+      
+        if (currpage >= p->numpages) {
+            psp->last_page_in_job = True;
+        }
+    }
+}
+
+static
+void FinishPrinting(AppPrintData *p)
+{
+    char *scr;
+
+    if (p->printtofile_handle) {
+        if (XpuWaitForPrintFileChild(p->printtofile_handle) != XPGetDocFinished) {
+            PrintMsg(("Error while printing to file.\n"));
+        }
+        p->printtofile_handle = NULL;
+    }
+    
+    /* Job completed, check if there are any messages from the spooler command */
+    scr = XpGetOneAttribute(p->pdpy, p->pcontext, XPJobAttr, "xp-spooler-command-results");
+    if( scr )
+    {
+      if( strlen(scr) > 0 )
+      {
+        const char *msg = XpuCompoundTextToXmb(p->pdpy, scr);
+        if( msg )
+        {
+          PrintMsg(("Spooler command returned:\n%s", msg));
+          XpuFreeXmbString(msg);
+        }
+        else
+        {
+          PrintMsg(("Spooler command returned (unconverted):\n%s", scr));
+        }
+      }
+
+      XFree((void *)scr);
+    }
+    
+    if (p->printshell) {
+        XtDestroyWidget(p->printshell);
+        p->printshell = NULL;
+    }
+  
+    /* Two issues here:
+     * 1. The print display connection is owned by the print dialog
+     *    To avoid any problems with that use a callback back to the main
+     *    application which calls
+     *    |XawPrintDialogClosePrinterConnection(w, False)| to ask the
+     *    print dialog widget to close all print display resources and
+     *    disown the object.
+     * 2. We have to use XpDestroyContext() and XtCloseDisplay()
+     *    instead of XpuClosePrinterDisplay() to make libXt happy...
+     *
+     * Call callback... */
+    (*apd->pdpyDestroyCallback)(NULL, NULL, NULL); /* HACK! */
+
+    /* ... and then get rid of the display */
+    if (p->pcontext != None) {
+        XpDestroyContext(p->pdpy, p->pcontext);
+    }
+    XtCloseDisplay(p->pdpy);
+
+    p->toplevel   = NULL;
+    p->isPrinting = False;
+    p->pdpy       = NULL;
+    p->pscreen    = NULL;
+    p->pcontext   = None;
+}
+
+static
+void PrintEndJobCB(Widget pshell, XtPointer client_data, XtPointer call_data)
+{
+    AppPrintData *p = (AppPrintData *)client_data;
+
+    Log(("--> PrintEndJobCB\n"));
+
+    /* Finish printing and destroy print shell (it's legal to destroy Xt
+     * widgets from within it's own callbacks) */
+    FinishPrinting(p);
+}
+
+static
+XFontSet GetPrintTextFontSet(const char *appname, Display *pdpy, long dpi_x, long dpi_y)
+{
+    XFontSet     fontset;
+    char         fontname[1024];
+    char       **missing_charset_list_return;
+    int          missing_charset_count_return;
+    char        *def_string_return;
+    int          i;
+    
+    sprintf(fontname, /* Default font for CDE */
+                      "-dt-interface user-medium-r-normal-s*-*-120-%ld-%ld-*-*,"
+                      /* Default font */
+                      "-adobe-courier-medium-r-normal--*-120-%ld-%ld-*-*,"
+                      /* Default font for Linux/Japanese locales (ja_JP.SJIS) */
+                      "-watanabe-mincho-medium-r-normal--*-120-%ld-%ld-*-*,"
+                      "-wadalab-gothic-medium-r-normal--*-120-%ld-%ld-*-*,"
+                      /* Fallback */
+                      "-*-*-*-*-*--*-120-%ld-%ld-*-*",
+                      dpi_x, dpi_y,
+                      dpi_x, dpi_y,
+                      dpi_x, dpi_y,
+                      dpi_x, dpi_y,
+                      dpi_x, dpi_y);
+    fontset = XCreateFontSet(pdpy, fontname,
+                             &missing_charset_list_return,
+                             &missing_charset_count_return,
+                             &def_string_return);
+
+    for( i=0 ; i < missing_charset_count_return ; i++ ) {
+        fprintf(stderr, "%s: warning: font for charset %s is lacking.\n",
+                appname, missing_charset_list_return[i]);
+    }
+
+    if (!fontset)
+        Error(("GetPrintTextFontSet: XCreateFontSet() failure.\n"));
+    return fontset;
+}
+
+void DoPrintTextSource(const char *programname,
+                       Widget textsource, Widget toplevel,
+                       Display *pdpy, XPContext pcontext,
+                       XpuColorspaceRec *colorspace,
+                       XtCallbackProc pdpyDestroyCB,
+                       const char *jobtitle, const char *toFile)
+{
+    long               dpi_x = 0L,
+                       dpi_y = 0L;
+    int                n;
+    Arg                args[20];
+    XFontSet           textfontset = NULL;
+    XFontSetExtents   *font_extents;
+    
+    apd->programname         = programname;
+    apd->pdpyDestroyCallback = pdpyDestroyCB;
+  
+    if (apd->isPrinting) {
+        PrintMsg(("Already busy with printing.\n"));
+        return;
+    } 
+        
+    /* Configure the print context (paper size, title etc.)
+     * We must do this before creating any Xt widgets - otherwise they will
+     * make wrong assuptions about fonts, resultions etc. ...
+     */
+    XpuSetJobTitle(pdpy, pcontext, jobtitle);
+    
+    /* Configuration done, set the context */
+    XpSetContext(pdpy, pcontext);   
+
+    /* Get default printer resolution */   
+    if (XpuGetResolution(pdpy, pcontext, &dpi_x, &dpi_y) != 1) {
+        PrintMsg(("No default resolution for printer.\n"));
+        XpuClosePrinterDisplay(pdpy, pcontext);
+        return;
+    }
+    
+    apd->toplevel = toplevel;
+    apd->pdpy     = pdpy;
+    apd->pcontext = pcontext;
+    apd->pscreen  = XpGetScreenOfContext(pdpy, pcontext);
+    apd->jobtitle = jobtitle;
+
+    n = 0;
+    /* Override any geometry resource settings as XawPrintShell adjusts it's size
+     * to the current page siue when |XawPrintLAYOUTMODE_DRAWABLEAREA| or
+     * |XawPrintLAYOUTMODE_PAGESIZE| are used. */
+    XtSetArg(args[n], XtNgeometry,    "+0+0");                          n++;
+    XtSetArg(args[n], XawNlayoutMode, XawPrintLAYOUTMODE_DRAWABLEAREA); n++;
+    if (colorspace) {
+        printf("Setting visual to id=0x%lx.\n", colorspace->visualinfo.visualid);
+    }
+    apd->printshell = CreatePrintShell(toplevel, apd->pscreen, 
+                                       (colorspace?(colorspace->visualinfo.visual):(NULL)),
+                                       "printshell", args, n);
+    n = 0;
+    XtSetArg(args[n], XtNresizable,            True);            n++;
+    XtSetArg(args[n], XtNright,                XtChainRight);    n++;
+    apd->content.form = XtCreateManagedWidget("form", formWidgetClass, apd->printshell, args, n);
+
+    textfontset = GetPrintTextFontSet(apd->programname, pdpy, dpi_x, dpi_y);
+
+    n = 0;
+    XtSetArg(args[n], XtNinternational,        True);            n++;
+    XtSetArg(args[n], XtNfromHoriz,            NULL);            n++;
+    XtSetArg(args[n], XtNfromVert,             NULL);            n++;
+    XtSetArg(args[n], XtNtop,                  XtChainTop);      n++;
+    XtSetArg(args[n], XtNright,                XtChainRight);    n++;
+    XtSetArg(args[n], XtNresizable,            True);            n++;
+    XtSetArg(args[n], XtNfontSet,              textfontset);     n++;
+    XtSetArg(args[n], XtNlabel,                "Page: n/n");     n++;
+    XtSetArg(args[n], XtNjustify,              XtJustifyRight);  n++;
+    apd->content.pageheaderlabel = XtCreateManagedWidget("pageinfo", labelWidgetClass, apd->content.form, args, n);
+
+    font_extents = XExtentsOfFontSet(textfontset);
+
+    n = 0;
+    XtSetArg(args[n], XtNinternational,    True);                         n++;
+    XtSetArg(args[n], XtNtextSource,       textsource);                   n++;
+    XtSetArg(args[n], XtNscrollHorizontal, XawtextScrollNever);           n++;
+    XtSetArg(args[n], XtNscrollVertical,   XawtextScrollNever);           n++;
+
+/* Usually I would expect that using |XtNfromVert, apd->content.pageheaderlabel|
+ * would be the correct way to place the text widget with the main content below
+ * the page header widget - but for an unknown reason this doesn not work: The
+ * text widget squishes itself into the bottom half of the page and only occupies
+ * 1/2 of the page's with... ;-(( */
+#define WORKAROUND_FOR_SOMETHING_IS_WRONG 1
+#ifdef WORKAROUND_FOR_SOMETHING_IS_WRONG
+    XtSetArg(args[n], XtNtop,              XtChainTop);                   n++;
+    XtSetArg(args[n], XtNright,            XtChainRight);                 n++;
+    XtSetArg(args[n], XtNvertDistance,     (font_extents->max_logical_extent.height+2)*2); n++;    
+#else
+    XtSetArg(args[n], XtNfromHoriz,        NULL);                         n++;
+    XtSetArg(args[n], XtNfromVert,         apd->content.pageheaderlabel); n++;
+#endif
+    XtSetArg(args[n], XtNfontSet,          textfontset);                  n++;
+    apd->content.text = XtCreateManagedWidget("text", asciiTextWidgetClass, apd->content.form, args, n);
+
+    /* Disable the caret - that is not needed for printing */
+    XawTextDisplayCaret(apd->content.text, False);
+    
+    XtAddCallback(apd->printshell, XawNpageSetupCallback, PageSetupCB,   (XtPointer)apd);
+    XtAddCallback(apd->printshell, XawNendJobCallback,    PrintEndJobCB, (XtPointer)apd);
+
+    /* Realise print shell (which will set position+size of the child
+     * widgets based on the current page size) */
+    XtRealizeWidget(apd->printshell);
+    
+    /* Count number of pages in the text widget */
+    apd->numpages = CountPages(apd->content.text);
+
+    /* Make sure that the Xt machinery is really using the right screen (assertion) */
+    if (XpGetScreenOfContext(XtDisplay(apd->printshell), apd->pcontext) != XtScreen(apd->printshell))
+        Error(("Widget's screen != print screen. BAD.\n"));
+
+    apd->isPrinting = True;
+
+    if (toFile) {
+        PrintMsg(("Printing to file '%s'...\n", toFile));
+        apd->printtofile_handle = XpuStartJobToFile(pdpy, pcontext, toFile);
+        if (!apd->printtofile_handle) {
+            perror("XpuStartJobToFile failure");
+            PrintMsg(("Printing failed: XpuStartJobToFile\n"));
+            apd->isPrinting = False;
+            return;
+        }
+    }
+    else
+    {
+        PrintMsg(("Printing to printer...\n"));
+        XpuStartJobToSpooler(pdpy);
+    }
+}
+
+
diff --git a/xmore/print.h b/xmore/print.h
new file mode 100644 (file)
index 0000000..a87779c
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * $Xorg: print.h,v 1.1 2004/04/30 02:05:54 gisburn Exp $
+ *
+Copyright 2004 Roland Mainz <roland.mainz@nrubsig.org>
+
+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.
+ *
+ */
+
+#ifndef XMORE_PRINT_H
+#define XMORE_PRINT_H 1
+
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Shell.h>
+#include <X11/Xaw/Print.h>
+#include <X11/Xaw/Cardinals.h>
+#include <X11/XprintUtil/xprintutil.h>
+
+#if defined(XMORE)
+#define PrintMsg(x) { printf("xmore: "); printf x ; }
+#elif defined(XEDIT)
+#define PrintMsg(x) { XeditPrintf x ; }
+#else
+#error unknown application
+#endif 
+
+/* Prototypes */
+void DoPrintTextSource(const char *programname,
+                       Widget textsource,
+                       Widget toplevel, 
+                       Display *pdpy, XPContext pcontext,
+                       XpuColorspaceRec *colorspace,
+                       XtCallbackProc printDisplayDestroyCallback,
+                       const char *jobTitle,
+                       const char *toFile);
+
+#endif /* !XMORE_PRINT_H */
diff --git a/xmore/printdialog.c b/xmore/printdialog.c
new file mode 100644 (file)
index 0000000..50d2a88
--- /dev/null
@@ -0,0 +1,1396 @@
+/*
+ * $Xorg: printdialog.c,v 1.1 2004/05/12 02:05:54 gisburn Exp $
+ *
+Copyright 2004 Roland Mainz <roland.mainz@nrubsig.org>
+
+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.
+ *
+ */
+
+/* Force ANSI C prototypes from X11 headers */
+#ifndef FUNCPROTO 
+#define FUNCPROTO 15
+#endif /* !FUNCPROTO */
+
+#include <X11/StringDefs.h> 
+#include <X11/Intrinsic.h> 
+#include <X11/Shell.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Toggle.h>
+#include <X11/Xaw/List.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Dialog.h>
+
+#ifdef XKB
+#include <X11/extensions/XKBbells.h>
+#endif /* XKB */
+
+#ifdef XEDIT
+#include "xedit.h"
+#endif /* XEDIT */
+#include "printdialog.h"
+#include "printdialogprivates.h"
+#include "print.h"
+
+#include <stdlib.h>
+#include <ctype.h>
+#include <stdio.h>
+
+/* Turn a NULL pointer string into an empty string */
+#define NULLSTR(x) (((x)!=NULL)?(x):(""))
+
+#define Error(x) { printf x ; exit(EXIT_FAILURE); }
+#define Assertion(expr, msg) { if (!(expr)) { Error msg } }
+#ifdef DEBUG
+#  define Log(x)   { if(True)  printf x; }
+#else
+#  define Log(x)   { if(False) printf x; }
+#endif /* DEBUG */
+
+/* Local prototypes */
+static void     do_beep(PrintDialogWidget pdw);
+static void     center_popup(Widget parent, Widget popup);
+static void     updateWidgetStates(PrintDialogWidget pdw);
+static void     printSetupClose(PrintDialogWidget pdw);
+static void     printSetupOKXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printSetupCancelXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printSetupJobCopiesXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printDialogDestXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printSelectFileXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printOKXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printSetupXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printFileSelectedXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     buildFileDialog(PrintDialogWidget pdw);
+static void     closePrinterConnection(PrintDialogWidget  pdw, Bool closeDisplay);
+static Bool     openPrinterConnection(PrintDialogWidget  pdw);
+static void     destroyPrintSetupDialog(PrintDialogWidget pdw);
+static Widget   buildPrintSetupDialog(PrintDialogWidget pdw);
+static String  *xpprinterlist_to_widget_printerlist(XPPrinterList printerlist, int num_printers);
+static String  *xppaperlist_to_widget_paperlist(XpuMediumSourceSizeList paperlist, int num_papers);
+static String  *xpresolutionlist_to_widget_resolutionlist(XpuResolutionList reslist, int num_resolutions);
+static String  *xporientationlist_to_widget_orientationlist(XpuOrientationList orientationlist, int num_orientations);
+static String  *xpplexlist_to_widget_plexlist(XpuPlexList plexlist, int num_plex);
+static String  *xpcolorspacelist_to_widget_colorspacelist(XpuColorspaceList colorspacelist, int num_colorspaces);
+static void     printerSelectionPrinterSelectedXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printSelectPrinterXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printerSelectionClose(PrintDialogWidget  pdw);
+static void     printerSelectionOKXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static void     printerSelectionCancelXtProc(Widget w, XtPointer client_data, XtPointer callData);
+static Bool     buildPrinterSelectionDialog(PrintDialogWidget  pdw);
+static void     destroyPrinterSelectionDialog(PrintDialogWidget pdw);
+static void     createprintdialogchildren(Widget w);
+
+static
+void do_beep(PrintDialogWidget pdw)
+{
+    Log(("*** Beep!\n"));
+#ifdef XKB
+    XkbStdBell(XtDisplay((Widget)pdw), XtWindow((Widget)pdw), 0, XkbBI_MinorError);
+#else
+    XBell(XtDisplay((Widget)pdw), 0);
+#endif /* XKB */
+}
+
+/* Center popup (on parent, not on screen - which would be a bad idea
+ * in the Xinerama case) */
+static
+void center_popup(Widget parent, Widget popup)
+{
+    Dimension width,
+              height;
+    Position  x,
+              y;
+
+    XtVaGetValues(parent,
+        XtNx,  &x,
+        XtNy,  &y,
+        NULL);
+    XtVaGetValues(popup,
+        XtNwidth,  &width,
+        XtNheight, &height,
+        NULL);
+
+    x += (Position)width  / 2;
+    y += (Position)height / 3;
+
+    XtVaSetValues(popup,
+        XtNx, x,
+        XtNy, y,
+        NULL);
+}
+
+static
+void updateWidgetStates(PrintDialogWidget pdw)
+{
+    PrintDialogPart *pdp = &pdw->printdialog;
+    
+    /* Do not update anything if we will be destroyed */
+    if (pdw->core.being_destroyed)
+        return;
+
+    if (pdp->printToFile == False) {  
+        XtVaSetValues(pdp->main.printtoprinter, XtNstate,     True,  NULL);
+        XtVaSetValues(pdp->main.printtofile,    XtNstate,     False, NULL);
+        /* Disable the widgets which depend on print-to-file */
+        XtVaSetValues(pdp->main.filenamelabel,  XtNsensitive, False, NULL);
+        XtVaSetValues(pdp->main.filename,       XtNsensitive, False, NULL);
+        XtVaSetValues(pdp->main.selectfile,     XtNsensitive, False, NULL);
+    }
+    else
+    {
+        XtVaSetValues(pdp->main.printtoprinter, XtNstate, False, NULL);
+        XtVaSetValues(pdp->main.printtofile,    XtNstate, True,  NULL);
+        /* Enable the widgets which depend on print-to-file */
+        XtVaSetValues(pdp->main.filenamelabel,  XtNsensitive, True, NULL);
+        XtVaSetValues(pdp->main.filename,       XtNsensitive, True, NULL);
+        XtVaSetValues(pdp->main.selectfile,     XtNsensitive, True, NULL);
+    }
+
+    /* Update file name */
+    XtVaSetValues(pdp->main.filename, XtNlabel, pdp->filename?pdp->filename:"-", NULL);
+    
+    /* General check whether we can print... */
+    pdp->canPrint = True;
+    if (pdp->printer_name == NULL) {
+        pdp->canPrint = False;
+    }
+    else if (strlen(pdp->printer_name) == 0) {
+        pdp->canPrint = False;
+    }
+
+    pdp->canReallyPrint = pdp->canPrint;
+
+    /* Some extra checks for print-to-file */
+    if (pdp->printToFile) {
+        if (pdp->filename == NULL) {
+            pdp->canReallyPrint = False;
+        }
+        else if (strlen(pdp->filename) == 0) {
+            pdp->canReallyPrint = False;
+        }
+    }
+
+    XtVaSetValues(pdp->main.ok,    XtNsensitive, pdp->canReallyPrint, NULL);
+    XtVaSetValues(pdp->main.setup, XtNsensitive, pdp->canPrint,       NULL);
+}
+
+static void
+printSetupClose(PrintDialogWidget pdw)
+{ 
+    PrintDialogPart *pdp = &pdw->printdialog;
+    if (pdp->setup.popup) {
+        XtPopdown(pdp->setup.popup);
+    }
+}
+
+static void
+printSetupOKXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget    pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart     *pdp = &pdw->printdialog;
+    char                *s;
+    XawListReturnStruct *lrs;    
+    Log(("## printSetupOK: closing print setup!\n"));
+    
+    /* Set copy count (if the value is invalid beep and return to the user ) */
+    XtVaGetValues(pdp->setup.jobcopies, XtNstring, &s, NULL);
+    if (s) {
+        int c = atoi(s);
+        if (c < 1 || c > 999) {
+            do_beep(pdw);
+            XtVaSetValues(pdp->setup.jobcopies, XtNstring, "1", NULL);
+            Log(("## printSetupOKXtProc: not a valid copy count value\n"));
+            return;
+        }
+        
+        /* Fix me: We should set the number of _job_ copies here, not _doc_ copies */
+        XpuSetDocumentCopies(pdp->pdpy, pdp->pcontext, c);
+    }
+    
+    /* Set paper size */
+    lrs = XawListShowCurrent(pdp->setup.paperlist);
+    if (lrs->list_index != XAW_LIST_NONE) {
+        Log(("selected paper is '%s'/'%d'\n", lrs->string, lrs->list_index));
+        Assertion(lrs->list_index < pdp->num_papers, (("Error: lrs->list_index < pdp->num_papers\n")));
+        XpuSetDocMediumSourceSize(pdp->pdpy, pdp->pcontext, &pdp->paperlist[lrs->list_index]);
+    }
+    XtFree((char *)lrs);
+
+    /* Set resolution */
+    lrs = XawListShowCurrent(pdp->setup.resolutionlist);
+    if (lrs->list_index != XAW_LIST_NONE) {
+        Log(("selected resolution is '%s'/'%d'\n", lrs->string, lrs->list_index));
+        Assertion(lrs->list_index < pdp->num_resolutions, (("Error: lrs->list_index < pdp->num_resolutions\n")));
+        XpuSetDocResolution(pdp->pdpy, pdp->pcontext, &pdp->resolutionlist[lrs->list_index]);
+    }
+    XtFree((char *)lrs);
+
+    /* Set orientation */
+    lrs = XawListShowCurrent(pdp->setup.orientationlist);
+    if (lrs->list_index != XAW_LIST_NONE) {
+        Log(("selected orientation is '%s'/'%d'\n", lrs->string, lrs->list_index));
+        Assertion(lrs->list_index < pdp->num_orientations, (("Error: lrs->list_index < pdp->num_orientations\n")));
+        XpuSetDocOrientation(pdp->pdpy, pdp->pcontext, &pdp->orientationlist[lrs->list_index]);
+    }
+    XtFree((char *)lrs);
+
+    /* Set plex mode */
+    lrs = XawListShowCurrent(pdp->setup.plexlist);
+    if (lrs->list_index != XAW_LIST_NONE) {
+        Log(("selected plex is '%s'/'%d'\n", lrs->string, lrs->list_index));
+        Assertion(lrs->list_index < pdp->num_plex, (("Error: lrs->list_index < pdp->num_plex\n")));
+        XpuSetDocPlex(pdp->pdpy, pdp->pcontext, &pdp->plexlist[lrs->list_index]);
+    }
+    XtFree((char *)lrs);
+
+    /* Set colorspace */
+    lrs = XawListShowCurrent(pdp->setup.colorspacelist);
+    if (lrs->list_index != XAW_LIST_NONE) {
+        Log(("selected colorspace is '%s'/'%d'\n", lrs->string, lrs->list_index));
+        Assertion(lrs->list_index < pdp->num_colorspaces, (("Error: lrs->list_index < pdp->num_colorspaces\n")));
+        pdp->selected_colorspace = &pdp->colorspacelist[lrs->list_index];
+    }
+    XtFree((char *)lrs);
+    
+    printSetupClose(pdw);
+}
+
+static void
+printSetupCancelXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget  pdw = (PrintDialogWidget)client_data;
+    Log(("## printSetupCancel: closing print setup!\n"));
+
+    printSetupClose(pdw);
+}
+
+static void
+printSetupJobCopiesXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget pdw    = (PrintDialogWidget)client_data;
+    PrintDialogPart  *pdp    = &pdw->printdialog;
+    char             *string = NULL;
+    
+    Log(("## printSetupJobCopiesXtProc!\n"));
+
+    /* Check whether the input is a valid number - and in the case of invalid input reset the value */    
+    XtVaGetValues(pdp->setup.jobcopies, XtNstring, &string, NULL);
+    if (string) {
+        char *s;
+        int   i;
+        Bool  isValidNumber = True;
+
+        /* First check for invalid characters... */
+        for( s = string ; *s != '\0' ; s++ ) {
+            if (!isdigit(*s)) {
+                isValidNumber = False;
+                break;
+            }
+        }
+        
+        /* .. and the do a range check... */
+        i = atoi(string);
+        if (i < 1 || i > 999) {
+            isValidNumber = False;
+        }
+        
+        if (!isValidNumber) {
+            do_beep(pdw);
+            XtVaSetValues(pdp->setup.jobcopies, XtNstring, "1", NULL);
+            Log(("## printSetupJobCopiesXtProc: not a valid number\n"));
+        }
+    }
+}
+
+static void
+printCancelXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart  *pdp = &pdw->printdialog;
+
+    printSetupClose(pdw);
+
+    if (pdp->cancel_callback) {
+        Log(("printCancelXtProc: calling callback\n"));
+        XtCallCallbackList((Widget)pdw, pdp->cancel_callback, NULL);
+    }
+}
+
+static void
+printDialogDestXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget  pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart   *pdp = &pdw->printdialog;
+
+    if (w == pdp->main.printtoprinter) {  
+        pdp->printToFile = False;
+    }
+    else if (w == pdp->main.printtofile) {
+        pdp->printToFile = True;
+    }
+    else
+    {
+        Log(("printDialogDestXtProc: ERROR: Unknown widget.\n"));
+    }
+
+    updateWidgetStates(pdw);
+}
+
+static void
+printSelectFileXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget   pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart    *pdp = &pdw->printdialog;
+
+    Log(("## printSelectFileXtProc!\n"));
+
+    if (!pdp->selectFile.shell) {
+        buildFileDialog(pdw);
+    }
+    
+    center_popup((Widget)pdw, pdp->selectFile.shell);
+
+    XtPopup(pdp->selectFile.shell, XtGrabExclusive);
+}
+
+static void
+printOKXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget  pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart   *pdp = &pdw->printdialog;
+    Log(("## printing!\n"));
+    
+    if (!pdp->pdpy) {
+        Log(("printOKXtProc: no printer connection, opening one....\n"));
+        openPrinterConnection(pdw);
+
+        if (!pdp->pdpy) {
+            Log(("printOKXtProc: still no printer connection - BAD (this should never happen).\n"));
+            do_beep(pdw);
+            return;
+        }
+    }    
+
+    if (pdp->ok_callback) {
+        XawPrintDialogCallbackStruct pdcs;
+
+        Log(("printOKXtProc: calling callbacks...\n"));
+        memset(&pdcs, 0, sizeof(pdcs));
+        pdcs.pdpy            = pdp->pdpy;
+        pdcs.pcontext        = pdp->pcontext;
+        pdcs.printToFile     = pdp->printToFile;
+        pdcs.printToFileName = (const char *)pdp->filename;
+        pdcs.colorspace      = pdp->selected_colorspace;
+        XtCallCallbackList((Widget)pdw, pdp->ok_callback, &pdcs);
+    }
+
+    printSetupClose(pdw);
+}
+
+static void
+printSetupXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget   pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart    *pdp = &pdw->printdialog;
+
+    Log(("## setup!\n"));
+
+    if (!pdp->setup.popup) {
+        if (buildPrintSetupDialog(pdw) == NULL) {
+            Log(("printSetupXtProc: buildPrintSetupDialog failure.\n"));
+            return;
+        }
+    }
+
+    center_popup((Widget)pdw, pdp->setup.popup);
+
+    XtPopup(pdp->setup.popup, XtGrabExclusive);
+}
+
+static void
+printFileSelectedXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget  pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart   *pdp = &pdw->printdialog;
+    const char        *filename;
+    
+    Log(("printFileSelectedXtProc: User selected file.\n"));
+    filename = XawDialogGetValueString(pdp->selectFile.dialog);
+    
+    if (pdp->filename)
+        free(pdp->filename);
+    pdp->filename = strdup(filename);
+    
+    XtPopdown(pdp->selectFile.shell);
+    
+    updateWidgetStates(pdw);
+}
+
+static
+void buildFileDialog(PrintDialogWidget pdw)
+{
+    PrintDialogPart *pdp = &pdw->printdialog;
+    int              n;
+    Arg              args[20];
+
+    pdp->selectFile.shell = XtCreatePopupShell("selectfile",
+                                               transientShellWidgetClass,
+                                               (Widget)pdw, NULL, 0);
+    n = 0;
+    XtSetArg(args[n], XtNvalue, pdp->filename?pdp->filename:""); n++;  
+    pdp->selectFile.dialog = XtCreateManagedWidget("dialog", dialogWidgetClass,
+                                                   pdp->selectFile.shell, args, n);
+    XawDialogAddButton(pdp->selectFile.dialog, "Accept", printFileSelectedXtProc, pdw);
+
+    XtRealizeWidget(pdp->selectFile.shell);
+}
+
+static
+void closePrinterConnection(PrintDialogWidget pdw, Bool closeDisplay)
+{ 
+    PrintDialogPart *pdp = &pdw->printdialog;
+    
+    Log(("# closePrinterConnection\n"));
+
+    destroyPrintSetupDialog(pdw);
+
+    if (pdp->paperlist) {
+        XpuFreeMediumSourceSizeList(pdp->paperlist);
+        pdp->paperlist = NULL;
+    }
+
+    if (pdp->widget_paperlist) {
+        free(pdp->widget_paperlist);
+        pdp->widget_paperlist = NULL;
+    }
+
+    if (pdp->resolutionlist) {
+        XpuFreeResolutionList(pdp->resolutionlist);
+        pdp->resolutionlist = NULL;
+    }
+
+    if (pdp->widget_resolutionlist) {
+        free(pdp->widget_resolutionlist);
+        pdp->widget_resolutionlist = NULL;
+    }
+
+
+    if (pdp->orientationlist) {
+        XpuFreeOrientationList(pdp->orientationlist);
+        pdp->orientationlist = NULL;
+    }  
+
+    if (pdp->widget_orientationlist) {
+        free(pdp->widget_orientationlist);
+        pdp->widget_orientationlist = NULL;
+    }
+
+    if (pdp->plexlist) {
+        XpuFreePlexList(pdp->plexlist);
+        pdp->plexlist = NULL;
+    }  
+
+    if (pdp->widget_plexlist) {
+        free(pdp->widget_plexlist);
+        pdp->widget_plexlist = NULL;
+    }
+
+    if (pdp->colorspacelist) {
+        XpuFreeColorspaceList(pdp->colorspacelist);
+        pdp->colorspacelist = NULL;
+    }  
+
+    if (pdp->widget_colorspacelist) {
+        free(pdp->widget_colorspacelist);
+        pdp->widget_colorspacelist = NULL;
+    }
+    pdp->selected_colorspace = NULL;
+
+    if (pdp->pdpy) {
+        if (closeDisplay) {
+            XpuClosePrinterDisplay(pdp->pdpy, pdp->pcontext);
+        }
+        pdp->pdpy     = NULL;
+        pdp->pcontext = None;
+    }
+
+    updateWidgetStates(pdw);
+}
+
+static
+Bool openPrinterConnection(PrintDialogWidget pdw)
+{
+    PrintDialogPart   *pdp = &pdw->printdialog;
+
+    Log(("# openPrinterConnection\n"));
+
+    /* Close any outstanding connection first... */
+    closePrinterConnection(pdw, True);
+
+    if (!pdp->printer_name) {
+        Log(("# error: openPrinterConnection: No printer name.\n"));
+        return False;
+    }
+
+    if (XpuGetPrinter(pdp->printer_name, &pdp->pdpy, &pdp->pcontext) == False) {
+        Log(("openPrinterConnection: could not open printer.\n"));
+        return False;
+    }
+
+    pdp->paperlist       = XpuGetMediumSourceSizeList(pdp->pdpy, pdp->pcontext, &pdp->num_papers);
+    pdp->resolutionlist  =       XpuGetResolutionList(pdp->pdpy, pdp->pcontext, &pdp->num_resolutions);
+    pdp->orientationlist =      XpuGetOrientationList(pdp->pdpy, pdp->pcontext, &pdp->num_orientations);
+    pdp->plexlist        =             XpuGetPlexList(pdp->pdpy, pdp->pcontext, &pdp->num_plex);  
+    pdp->colorspacelist  =       XpuGetColorspaceList(pdp->pdpy, pdp->pcontext, &pdp->num_colorspaces);  
+
+    pdp->widget_paperlist       = xppaperlist_to_widget_paperlist(pdp->paperlist, pdp->num_papers);
+    pdp->widget_resolutionlist  = xpresolutionlist_to_widget_resolutionlist(pdp->resolutionlist, pdp->num_resolutions);
+    pdp->widget_orientationlist = xporientationlist_to_widget_orientationlist(pdp->orientationlist, pdp->num_orientations);
+    pdp->widget_plexlist        = xpplexlist_to_widget_plexlist(pdp->plexlist, pdp->num_plex);
+    pdp->widget_colorspacelist  = xpcolorspacelist_to_widget_colorspacelist(pdp->colorspacelist, pdp->num_colorspaces);
+
+    updateWidgetStates(pdw);
+
+    return True;
+}
+
+#undef DEFAULT_WIDTH
+#define DEFAULT_WIDTH 120
+#undef DEFAULT_INFOLABEL_WIDTH
+#define DEFAULT_INFOLABEL_WIDTH 250
+
+static
+void destroyPrintSetupDialog(PrintDialogWidget pdw)
+{
+    PrintDialogPart *pdp = &pdw->printdialog;
+
+    if (pdp->setup.popup) {
+        XtDestroyWidget(pdp->setup.popup);
+    }
+
+    /* |XtDestroyWidget(pdp->setup.popup);| above will recursively destroy
+     * all children so we only have to reset the pointers here... */
+    pdp->setup.popup            = NULL;
+    pdp->setup.form             = NULL;
+    pdp->setup.paperlist        = NULL;
+    pdp->setup.resolutionlist   = NULL;
+    pdp->setup.orientationlist  = NULL;
+    pdp->setup.plexlist         = NULL;
+    pdp->setup.colorspacelist   = NULL;
+    pdp->setup.ok               = NULL;
+    pdp->setup.cancel           = NULL;
+}
+
+static
+Widget buildPrintSetupDialog(PrintDialogWidget pdw)
+{
+    PrintDialogPart  *pdp = &pdw->printdialog;
+    int               n;
+    Arg               args[20];
+    Widget            listform;
+    XpuSupportedFlags jobflags,
+                      docflags;
+    Bool              canChangeJobCopies,
+                      canChangePaperSize,
+                      canChangeResolution,
+                      canChangeOrientation,
+                      canChangePlex;
+
+    if (!pdp->pdpy) {
+        Log(("buildPrintSetupDialog: no printer connection, opening one....\n"));
+        openPrinterConnection(pdw);
+
+        if (!pdp->pdpy) {
+            Log(("buildPrintSetupDialog: still no printer connection - BAD.\n"));
+            do_beep(pdw);
+            return NULL;
+        }
+    }
+
+    /* Get flags which types of attributes can be modified */
+    jobflags = XpuGetSupportedDocAttributes(pdp->pdpy, pdp->pcontext);
+    docflags = XpuGetSupportedDocAttributes(pdp->pdpy, pdp->pcontext);
+    canChangeJobCopies   = (jobflags & XPUATTRIBUTESUPPORTED_COPY_COUNT) == XPUATTRIBUTESUPPORTED_COPY_COUNT;
+    canChangePaperSize   = (docflags & XPUATTRIBUTESUPPORTED_DEFAULT_MEDIUM) == XPUATTRIBUTESUPPORTED_DEFAULT_MEDIUM;
+    canChangeResolution  = (docflags & XPUATTRIBUTESUPPORTED_DEFAULT_PRINTER_RESOLUTION) == XPUATTRIBUTESUPPORTED_DEFAULT_PRINTER_RESOLUTION;
+    canChangeOrientation = (docflags & XPUATTRIBUTESUPPORTED_CONTENT_ORIENTATION) == XPUATTRIBUTESUPPORTED_CONTENT_ORIENTATION;
+    canChangePlex        = (docflags & XPUATTRIBUTESUPPORTED_PLEX) == XPUATTRIBUTESUPPORTED_PLEX;
+
+    n = 0;
+    XtSetArg(args[n], XtNallowShellResize, True); n++;
+    pdp->setup.popup = XtCreatePopupShell("setup", transientShellWidgetClass, (Widget)pdw, args, n);
+
+    n = 0;
+    pdp->setup.form = XtCreateManagedWidget("form", formWidgetClass, pdp->setup.popup, args, n);
+
+    n = 0;
+    listform = XtCreateManagedWidget("list", formWidgetClass, pdp->setup.form, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNresizable,           True);                        n++;
+    XtSetArg(args[n], XtNforceColumns,        True);                        n++;
+    XtSetArg(args[n], XtNdefaultColumns,      1);                           n++;
+    XtSetArg(args[n], XtNsensitive,           canChangePaperSize);          n++;
+    XtSetArg(args[n], XtNlist,                pdp->widget_paperlist);       n++;
+    XtSetArg(args[n], XtNwidth,               DEFAULT_WIDTH);               n++;
+    pdp->setup.paperlist = XtCreateManagedWidget("paperlist", listWidgetClass, listform, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNresizable,           True);                        n++;
+    XtSetArg(args[n], XtNforceColumns,        True);                        n++;
+    XtSetArg(args[n], XtNdefaultColumns,      1);                           n++;
+    XtSetArg(args[n], XtNsensitive,           canChangeResolution);         n++;
+    XtSetArg(args[n], XtNlist,                pdp->widget_resolutionlist);  n++;
+    XtSetArg(args[n], XtNwidth,               DEFAULT_WIDTH);               n++;
+    pdp->setup.resolutionlist = XtCreateManagedWidget("resolutionlist", listWidgetClass, listform, args, n);
+    
+    n = 0;
+    XtSetArg(args[n], XtNresizable,           True);                        n++;
+    XtSetArg(args[n], XtNforceColumns,        True);                        n++;
+    XtSetArg(args[n], XtNdefaultColumns,      1);                           n++;
+    XtSetArg(args[n], XtNsensitive,           canChangeOrientation);        n++;
+    XtSetArg(args[n], XtNlist,                pdp->widget_orientationlist); n++;
+    XtSetArg(args[n], XtNwidth,               DEFAULT_WIDTH);               n++;
+    pdp->setup.orientationlist = XtCreateManagedWidget("orientationlist", listWidgetClass, listform, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNresizable,           True);                        n++;
+    XtSetArg(args[n], XtNforceColumns,        True);                        n++;
+    XtSetArg(args[n], XtNdefaultColumns,      1);                           n++;
+    XtSetArg(args[n], XtNsensitive,           canChangePlex);               n++;
+    XtSetArg(args[n], XtNlist,                pdp->widget_plexlist);        n++;
+    XtSetArg(args[n], XtNwidth,               DEFAULT_WIDTH);               n++;
+    pdp->setup.plexlist = XtCreateManagedWidget("plexlist", listWidgetClass, listform, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNresizable,           True);                        n++;
+    XtSetArg(args[n], XtNforceColumns,        True);                        n++;
+    XtSetArg(args[n], XtNdefaultColumns,      1);                           n++;
+    XtSetArg(args[n], XtNsensitive,           True);                        n++;
+    XtSetArg(args[n], XtNlist,                pdp->widget_colorspacelist);  n++;
+    XtSetArg(args[n], XtNwidth,               DEFAULT_WIDTH);               n++;
+    pdp->setup.colorspacelist = XtCreateManagedWidget("colorspacelist", listWidgetClass, listform, args, n);
+    
+    n = 0;
+    XtSetArg(args[n], XtNborderWidth,         0);                           n++;
+    XtSetArg(args[n], XtNresizable,           False);                       n++;
+    XtSetArg(args[n], XtNjustify,             XtJustifyRight);              n++;
+    XtSetArg(args[n], XtNwidth,               DEFAULT_WIDTH);               n++;
+    XtSetArg(args[n], XtNsensitive,           canChangeJobCopies);          n++;
+    pdp->setup.jobcopieslabel = XtCreateManagedWidget("jobcopieslabel", labelWidgetClass, listform, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNstring,              "1");                         n++;
+    XtSetArg(args[n], XtNresizable,           True);                        n++;
+    XtSetArg(args[n], XtNeditType,            XawtextEdit);                 n++;
+    XtSetArg(args[n], XtNsensitive,           canChangeJobCopies);          n++;
+    pdp->setup.jobcopies = XtCreateManagedWidget("jobcopies", asciiTextWidgetClass, listform, args, n);
+    XtAddCallback(pdp->setup.jobcopies, XtNpositionCallback, printSetupJobCopiesXtProc, pdw);
+
+    n = 0;
+    pdp->setup.ok = XtCreateManagedWidget("ok", commandWidgetClass, pdp->setup.form, args, n);
+    XtAddCallback(pdp->setup.ok, XtNcallback, printSetupOKXtProc, pdw);
+
+    n = 0;
+    pdp->setup.cancel = XtCreateManagedWidget("cancel", commandWidgetClass, pdp->setup.form, args, n);
+    XtAddCallback(pdp->setup.cancel, XtNcallback, printSetupCancelXtProc, pdw);
+
+    XtRealizeWidget(pdp->setup.popup); 
+
+    return pdp->setup.popup;
+}
+
+#undef DEFAULT_WIDTH
+#define DEFAULT_WIDTH 150
+
+static
+String *xpprinterlist_to_widget_printerlist(XPPrinterList printerlist, int num_printers)
+{
+    int     i;
+    String *names;
+
+    names = malloc(sizeof(String *) * (num_printers+1));
+    if(!names)
+      return NULL;
+
+    for(i = 0 ; i < num_printers ; i++)
+        names[i] = printerlist[i].name;
+
+    names[i] = NULL; /* Terminate the list */
+
+    return names;
+}
+
+static
+String *xppaperlist_to_widget_paperlist(XpuMediumSourceSizeList paperlist, int num_papers)
+{
+    int     i;
+    String *names;
+
+    names = malloc(sizeof(String *) * (num_papers+1));
+    if (!names)
+      return NULL;
+
+    for(i = 0 ; i < num_papers ; i++)
+        names[i] = (char *)paperlist[i].medium_name; /* FixMe: tray selection missing */
+
+    names[i] = NULL; /* Terminate the list */
+
+    return names;
+}
+
+static
+String *xpresolutionlist_to_widget_resolutionlist(XpuResolutionList reslist, int num_resolutions)
+{
+    int     i;
+    String *names;
+
+    names = malloc(sizeof(String *) * (num_resolutions+1));
+    if (!names)
+        return NULL;
+
+    for(i = 0 ; i < num_resolutions ; i++)
+        names[i] = (char *)reslist[i].name;
+
+    names[i] = NULL; /* Terminate the list */
+
+    return names;
+}
+
+static
+String *xporientationlist_to_widget_orientationlist(XpuOrientationList orientationlist, int num_orientations)
+{
+    int     i;
+    String *names;
+
+    names = malloc(sizeof(String *) * (num_orientations+1));
+    if (!names)
+        return NULL;
+
+    for(i = 0 ; i < num_orientations ; i++)
+        names[i] = (char *)orientationlist[i].orientation;
+
+    names[i] = NULL; /* Terminate the list */
+
+    return names;
+}
+
+static
+String *xpplexlist_to_widget_plexlist(XpuPlexList plexlist, int num_plex)
+{
+    int     i;
+    String *names;
+
+    names = malloc(sizeof(String *) * (num_plex+1));
+    if(!names)
+      return NULL;
+
+    for(i = 0 ; i < num_plex ; i++)
+      names[i] = (char *)plexlist[i].plex;
+
+    names[i] = NULL; /* Terminate the list */
+
+    return names;
+}
+
+static
+String *xpcolorspacelist_to_widget_colorspacelist(XpuColorspaceList colorspacelist, int num_colorspaces)
+{
+    int     i;
+    String *names;
+
+    names = malloc(sizeof(String *) * (num_colorspaces+1));
+    if(!names)
+      return NULL;
+
+    for(i = 0 ; i < num_colorspaces ; i++)
+      names[i] = (char *)colorspacelist[i].name;
+
+    names[i] = NULL; /* Terminate the list */
+
+    return names;
+}
+
+static void
+printerSelectionPrinterSelectedXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget    pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart     *pdp = &pdw->printdialog;
+    XawListReturnStruct *lrs = (XawListReturnStruct *)callData;
+    int                  list_index;
+
+    Log(("## user selected a printer\n"));
+
+    list_index = lrs->list_index;
+    if (list_index == XAW_LIST_NONE) {
+        Log(("printerSelectionPrinterSelectedXtProc: Nothing selected.\n"));
+        return;
+    }
+    
+    Log(("selected printer is '%d'/'%s'/'%s'\n", 
+        list_index, lrs->string, NULLSTR(pdp->printerlist[list_index].name)));
+
+    /* Enable OK button */
+    XtVaSetValues(pdp->selectPrinter.ok, XtNsensitive, True, NULL);
+}
+
+static void
+printSelectPrinterXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget   pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart    *pdp = &pdw->printdialog;
+
+    Log(("## select printer!\n"));
+
+    if (!pdp->selectPrinter.popup) {
+        if (!buildPrinterSelectionDialog(pdw)) {
+            Log(("printSelectPrinterXtProc: buildPrinterSelectionDialog failure.\n"));
+            return;
+        }
+    }
+
+    center_popup((Widget)pdw, pdp->selectPrinter.popup);
+
+    XtPopup(pdp->selectPrinter.popup, XtGrabExclusive);
+}
+
+static void
+printerSelectionClose(PrintDialogWidget  pdw)
+{ 
+    PrintDialogPart *pdp = &pdw->printdialog;
+
+    if (pdp->selectPrinter.popup) {
+        XtPopdown(pdp->selectPrinter.popup);
+    }
+}
+
+static void
+printerSelectionOKXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget    pdw = (PrintDialogWidget)client_data;
+    PrintDialogPart     *pdp = &pdw->printdialog;
+    XawListReturnStruct *lrs;
+    int                  list_index;
+
+    Log(("## printerSelectionOKXtProc: closing printer selection!\n"));
+
+    /* Copy current selection in printer list widget and open a printer connection */
+    lrs = XawListShowCurrent(pdp->selectPrinter.list);
+    if (!lrs) {
+        Log(("printerSelectionOKXtProc: |lrs|==NULL\n"));
+        return;
+    }
+
+    list_index = lrs->list_index;
+    if (lrs->list_index == XAW_LIST_NONE) {
+        Log(("printerSelectionOKXtProc: rs->list_index == XAW_LIST_NONE\n"));
+        XtFree((char *)lrs);
+        return;
+    }
+
+    /* Set printer name and description in main dialog */
+    XtVaSetValues(pdp->main.name, XtNlabel, NULLSTR(pdp->printerlist[list_index].name), NULL);
+    XtVaSetValues(pdp->main.desc, XtNlabel, NULLSTR(pdp->printerlist[list_index].desc), NULL);
+
+    if (pdp->printer_name)
+        free(pdp->printer_name);
+    pdp->printer_name = strdup(lrs->string);
+
+    /* Close any outstanding printer connection since user has selected
+     * a different printer */
+    closePrinterConnection(pdw, True);
+
+    printerSelectionClose(pdw);
+    
+    XtFree((char *)lrs);
+}
+
+static void
+printerSelectionCancelXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    PrintDialogWidget  pdw = (PrintDialogWidget)client_data;
+    Log(("## printerSelectionCancelXtProc: closing printer selection!\n"));
+
+    printerSelectionClose(pdw);
+}
+
+static
+Bool buildPrinterSelectionDialog(PrintDialogWidget  pdw)
+{
+    PrintDialogPart   *pdp = &pdw->printdialog;
+
+    int  n;
+    Arg  args[20];
+
+    n = 0;
+    XtSetArg(args[n], XtNallowShellResize, True);                    n++;
+    pdp->selectPrinter.popup = XtCreatePopupShell("printerselection", transientShellWidgetClass, (Widget)pdw, args, n);
+
+    n = 0;
+    pdp->selectPrinter.form = XtCreateManagedWidget("form", formWidgetClass, pdp->selectPrinter.popup, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNresizable,        True);                    n++;
+    XtSetArg(args[n], XtNforceColumns,     True);                    n++;
+    XtSetArg(args[n], XtNdefaultColumns,   1);                       n++;
+    XtSetArg(args[n], XtNlist,             pdp->widget_printerlist); n++;
+    XtSetArg(args[n], XtNwidth,            DEFAULT_WIDTH);           n++;
+    pdp->selectPrinter.list = XtCreateManagedWidget("list", listWidgetClass, pdp->selectPrinter.form, args, n);
+    XtAddCallback(pdp->selectPrinter.list, XtNcallback, printerSelectionPrinterSelectedXtProc, pdw);
+
+    n = 0;
+    XtSetArg(args[n], XtNsensitive,        False);                   n++;
+    pdp->selectPrinter.ok = XtCreateManagedWidget("ok", commandWidgetClass, pdp->selectPrinter.form, args, n);
+    XtAddCallback(pdp->selectPrinter.ok, XtNcallback, printerSelectionOKXtProc, pdw);
+
+    n = 0;
+    pdp->selectPrinter.cancel = XtCreateManagedWidget("cancel", commandWidgetClass, pdp->selectPrinter.form, args, n);
+    XtAddCallback(pdp->selectPrinter.cancel, XtNcallback, printerSelectionCancelXtProc, pdw);
+
+    XtRealizeWidget(pdp->selectPrinter.popup);
+
+    return True;
+}
+
+static
+void destroyPrinterSelectionDialog(PrintDialogWidget pdw)
+{
+    PrintDialogPart *pdp = &pdw->printdialog;
+
+    if (pdp->selectPrinter.popup) {
+        XtDestroyWidget(pdp->selectPrinter.popup);
+    }
+
+    /* |XtDestroyWidget(pdp->setup.popup);| above will recursively destroy
+     * all children so we only have to reset the pointers here... */
+    pdp->selectPrinter.popup   = NULL;
+    pdp->selectPrinter.form    = NULL;
+    pdp->selectPrinter.list    = NULL;
+    pdp->selectPrinter.popup   = NULL;
+    pdp->selectPrinter.cancel  = NULL;
+}
+
+/*
+ * Function:
+ *      createprintdialogchildren
+ *
+ * Parameters:
+ *      w - print dialog widget
+ *
+ * Description:
+ *      Creates the print dialog widgets.
+ *
+ * Note
+ *      -
+ */
+static void
+createprintdialogchildren(Widget w)
+{
+    int                n;
+    Arg                args[20];
+    PrintDialogWidget  pdw = (PrintDialogWidget)w;
+    PrintDialogPart   *pdp = &pdw->printdialog;
+    const char        *default_printername = NULL,
+                      *default_printerdesc = NULL;
+    Bool               has_default_printer = False;
+
+    pdp->printerlist = XpuGetPrinterList(NULL, &pdp->num_printers);
+    pdp->widget_printerlist = xpprinterlist_to_widget_printerlist(pdp->printerlist, pdp->num_printers);
+
+    if (pdp->num_printers > 0) {
+        if (pdp->printerlist[0].name && strlen(pdp->printerlist[0].name)) {
+            /* XprintUtils moves the default printer to the top */
+            default_printername = pdp->printerlist[0].name;
+            default_printerdesc = pdp->printerlist[0].desc;
+            pdp->printer_name   = strdup(pdp->printerlist[0].name);
+            has_default_printer = True;
+        }
+    }
+    else
+    {
+      PrintMsg(("No Xprint servers could be found.\n"
+                "Check whether the XPSERVERLIST environment variable contains any valid Xprint server(s).\n"));
+    }
+    
+    n = 0;
+    XtSetArg(args[n], XtNborderWidth,     0);                        n++;
+    pdp->main.form = XtCreateManagedWidget("main", formWidgetClass, (Widget)pdw, args, n);
+
+    n = 0;
+    pdp->main.innerform = XtCreateManagedWidget("innerform", formWidgetClass, pdp->main.form, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNborderWidth,     0);                        n++;
+    XtSetArg(args[n], XtNresizable,       False);                    n++;
+    XtSetArg(args[n], XtNjustify,         XtJustifyRight);           n++;
+    XtSetArg(args[n], XtNwidth,           DEFAULT_WIDTH);            n++;
+    pdp->main.desclabel = XtCreateManagedWidget("desclabel", labelWidgetClass, pdp->main.innerform, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNborderWidth,     0);                        n++;
+    XtSetArg(args[n], XtNresizable,       False);                    n++;
+    XtSetArg(args[n], XtNjustify,         XtJustifyLeft);            n++;
+    XtSetArg(args[n], XtNwidth,           DEFAULT_INFOLABEL_WIDTH);  n++;
+    XtSetArg(args[n], XtNlabel,           default_printerdesc?default_printerdesc:"-"); n++;
+    pdp->main.desc = XtCreateManagedWidget("desc", labelWidgetClass, pdp->main.innerform, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNsensitive,       has_default_printer);      n++;
+    pdp->main.info = XtCreateManagedWidget("info", commandWidgetClass, pdp->main.innerform, args, n);
+  /*
+    XtAddCallback(pdp->main.info, XtNcallback, printerInfoXtProc, pdw);
+  */
+    n = 0;
+    XtSetArg(args[n], XtNborderWidth,     0);                        n++;
+    XtSetArg(args[n], XtNresizable,       False);                    n++;
+    XtSetArg(args[n], XtNjustify,         XtJustifyRight);           n++;
+    XtSetArg(args[n], XtNwidth,           DEFAULT_WIDTH);            n++;
+    pdp->main.namelabel = XtCreateManagedWidget("namelabel", labelWidgetClass, pdp->main.innerform, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNborderWidth,     0);                        n++;
+    XtSetArg(args[n], XtNresizable,       False);                    n++;
+    XtSetArg(args[n], XtNjustify,         XtJustifyLeft);            n++;
+    XtSetArg(args[n], XtNlabel,           default_printername?default_printername:"-"); n++;
+    XtSetArg(args[n], XtNwidth,           DEFAULT_INFOLABEL_WIDTH);  n++;
+    pdp->main.name = XtCreateManagedWidget("name", labelWidgetClass, pdp->main.innerform, args, n);
+
+    n = 0;
+    pdp->main.selectprinter = XtCreateManagedWidget("selectprinter", commandWidgetClass, pdp->main.innerform, args, n);
+    XtAddCallback(pdp->main.selectprinter, XtNcallback, printSelectPrinterXtProc, pdw);
+
+    /* Line: "File selection" */
+
+    n = 0;
+    XtSetArg(args[n], XtNborderWidth,     0);                        n++;
+    XtSetArg(args[n], XtNresizable,       False);                    n++;
+    XtSetArg(args[n], XtNjustify,         XtJustifyRight);           n++;
+    XtSetArg(args[n], XtNwidth,           DEFAULT_WIDTH);            n++;
+    XtSetArg(args[n], XtNsensitive,       False);                    n++;
+    pdp->main.filenamelabel = XtCreateManagedWidget("filenamelabel", labelWidgetClass, pdp->main.innerform, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNborderWidth,     0);                        n++;
+    XtSetArg(args[n], XtNresizable,       False);                    n++;
+    XtSetArg(args[n], XtNjustify,         XtJustifyLeft);            n++;
+    XtSetArg(args[n], XtNlabel,           "-");                      n++;
+    XtSetArg(args[n], XtNwidth,           DEFAULT_INFOLABEL_WIDTH);  n++;
+    XtSetArg(args[n], XtNsensitive,       False);                    n++;
+    pdp->main.filename = XtCreateManagedWidget("filename", labelWidgetClass, pdp->main.innerform, args, n);
+
+    n = 0;
+    XtSetArg(args[n], XtNsensitive,       False);                    n++;
+    pdp->main.selectfile = XtCreateManagedWidget("selectfile", commandWidgetClass, pdp->main.innerform, args, n);
+    XtAddCallback(pdp->main.selectfile, XtNcallback, printSelectFileXtProc, pdw);
+
+    /* Line: Misc (Print destination toggles, copy-count etc.)*/
+    n = 0;
+    XtSetArg(args[n], XtNstate,           True);                     n++;
+    pdp->main.printtoprinter = XtCreateManagedWidget("printtoprinter", toggleWidgetClass, pdp->main.innerform, args, n);
+    XtAddCallback(pdp->main.printtoprinter, XtNcallback, printDialogDestXtProc, pdw);
+
+    n = 0;
+    XtSetArg(args[n], XtNstate,           False);                    n++;
+    pdp->main.printtofile = XtCreateManagedWidget("printtofile", toggleWidgetClass, pdp->main.innerform, args, n);
+    XtAddCallback(pdp->main.printtofile, XtNcallback, printDialogDestXtProc, pdw);
+
+    /* End-of-Inner-Form-Content */
+
+    n = 0;
+    XtSetArg(args[n], XtNsensitive,       has_default_printer);       n++;
+    pdp->main.ok = XtCreateManagedWidget("ok", commandWidgetClass, pdp->main.form, args, n);
+    XtAddCallback(pdp->main.ok, XtNcallback, printOKXtProc, pdw);
+
+    n = 0;
+    XtSetArg(args[n], XtNsensitive,       has_default_printer);       n++;
+    pdp->main.setup = XtCreateManagedWidget("setup", commandWidgetClass, pdp->main.form, args, n);
+    XtAddCallback(pdp->main.setup, XtNcallback, printSetupXtProc, pdw);
+
+    n = 0;
+    pdp->main.cancel = XtCreateManagedWidget("cancel", commandWidgetClass, pdp->main.form, args, n);
+    XtAddCallback(pdp->main.cancel, XtNcallback, printCancelXtProc, pdw);
+}
+
+/*
+ * Class Methods
+ */
+static void    XawPrintDialogConstraintInitialize(Widget, Widget, ArgList, Cardinal *);
+static void    XawPrintDialogGetValuesHook(Widget, ArgList, Cardinal*);
+static void    XawPrintDialogInitialize(Widget, Widget, ArgList, Cardinal*);
+static void    XawPrintDialogDestroy(Widget);
+static Boolean XawPrintDialogSetValues(Widget, Widget, Widget, ArgList, Cardinal *);
+
+/*
+ * Initialization
+ */
+static XtResource resources[] = {
+  {
+    XtNicon,
+    XtCIcon,
+    XtRBitmap,
+    sizeof(Pixmap),
+    XtOffsetOf(PrintDialogRec, printdialog.icon),
+    XtRImmediate,
+    0
+  },
+  {
+    XawNOkCallback, XtCCallback, XtRCallback,
+    sizeof(XtCallbackList), XtOffsetOf(PrintDialogRec, printdialog.ok_callback),
+    XtRImmediate, (XtPointer)NULL
+  },
+  {
+    XawNCancelCallback, XtCCallback, XtRCallback,
+    sizeof(XtCallbackList), XtOffsetOf(PrintDialogRec, printdialog.cancel_callback),
+    XtRImmediate, (XtPointer)NULL
+  },
+};
+
+PrintDialogClassRec printdialogClassRec = {
+  /* core */
+  {
+    (WidgetClass)&formClassRec,         /* superclass */
+    "PrintDialog",                      /* class_name */
+    sizeof(PrintDialogRec),             /* widget_size */
+    XawInitializeWidgetSet,             /* class_initialize */
+    NULL,                               /* class_part init */
+    False,                              /* class_inited */
+    XawPrintDialogInitialize,           /* initialize */
+    NULL,                               /* initialize_hook */
+    XtInheritRealize,                   /* realize */
+    NULL,                               /* actions */
+    0,                                  /* num_actions */
+    resources,                          /* resources */
+    XtNumber(resources),                /* num_resources */
+    NULLQUARK,                          /* xrm_class */
+    True,                               /* compress_motion */
+    True,                               /* compress_exposure */
+    True,                               /* compress_enterleave */
+    False,                              /* visible_interest */
+    XawPrintDialogDestroy,              /* destroy */
+    XtInheritResize,                    /* resize */
+    XtInheritExpose,                    /* expose */
+    XawPrintDialogSetValues,            /* set_values */
+    NULL,                               /* set_values_hook */
+    XtInheritSetValuesAlmost,           /* set_values_almost */
+    XawPrintDialogGetValuesHook,        /* get_values_hook */
+    NULL,                               /* accept_focus */
+    XtVersion,                          /* version */
+    NULL,                               /* callback_private */
+    NULL,                               /* tm_table */
+    XtInheritQueryGeometry,             /* query_geometry */
+    XtInheritDisplayAccelerator,        /* display_accelerator */
+    NULL,                               /* extension */
+  },
+  /* composite */
+  {
+    XtInheritGeometryManager,           /* geometry_manager */
+    XtInheritChangeManaged,             /* change_managed */
+    XtInheritInsertChild,               /* insert_child */
+    XtInheritDeleteChild,               /* delete_child */
+    NULL,                               /* extension */
+  },
+  /* constraint */
+  {
+    NULL,                               /* subresourses */
+    0,                                  /* subresource_count */
+    sizeof(PrintDialogConstraintsRec),  /* constraint_size */
+    XawPrintDialogConstraintInitialize, /* initialize */
+    NULL,                               /* destroy */
+    NULL,                               /* set_values */
+    NULL,                               /* extension */
+  },
+  /* form */
+  {
+    XtInheritLayout,                    /* layout */
+  },
+  /* printdialog */
+  {
+    NULL,                               /* extension */
+  }
+};
+
+WidgetClass printDialogWidgetClass = (WidgetClass)&printdialogClassRec;
+
+/*
+ * Implementation
+ */
+/*ARGSUSED*/
+static void
+XawPrintDialogInitialize(Widget request, Widget cnew, ArgList args, Cardinal *num_args)
+{
+    PrintDialogWidget dw = (PrintDialogWidget)cnew;
+    Arg               arglist[9];
+    Cardinal          arg_cnt = 0;
+
+    XtSetArg(arglist[arg_cnt], XtNborderWidth, 0);     arg_cnt++;
+    XtSetArg(arglist[arg_cnt], XtNleft, XtChainLeft);  arg_cnt++;
+
+    if (dw->printdialog.icon != (Pixmap)0) {
+        XtSetArg(arglist[arg_cnt], XtNbitmap, dw->printdialog.icon);     arg_cnt++;
+        XtSetArg(arglist[arg_cnt], XtNright, XtChainLeft);               arg_cnt++;
+        dw->printdialog.iconW = XtCreateManagedWidget("icon", labelWidgetClass,
+                                                      cnew, arglist, arg_cnt);
+        arg_cnt = 2;
+        XtSetArg(arglist[arg_cnt], XtNfromHoriz, dw->printdialog.iconW); arg_cnt++;
+    }
+    else {
+        dw->printdialog.iconW = NULL;
+    }
+    
+    createprintdialogchildren((Widget)dw);
+}
+
+/*ARGSUSED*/
+static void
+XawPrintDialogConstraintInitialize(Widget request, Widget cnew,
+                                   ArgList args, Cardinal *num_args)
+{
+    PrintDialogWidget dw = (PrintDialogWidget)cnew->core.parent;
+    PrintDialogConstraints constraint = (PrintDialogConstraints)cnew->core.constraints;
+
+    if (!XtIsSubclass(cnew, commandWidgetClass)) /* if not a button */
+        return;                                  /* then just use defaults */
+
+    constraint->form.left = constraint->form.right = XtChainLeft;
+    constraint->form.vert_base = dw->printdialog.main.form;
+
+    if (dw->composite.num_children > 1) {
+        WidgetList  children = dw->composite.children;
+        Widget     *childP;
+
+        for (childP = children + dw->composite.num_children - 1;
+           childP >= children; childP-- ) {
+            if (*childP == dw->printdialog.main.form)
+                break;
+            if (XtIsManaged(*childP) &&
+                XtIsSubclass(*childP, commandWidgetClass)) {
+                constraint->form.horiz_base = *childP;
+                break;
+            }
+        }
+    }
+}
+
+#define ICON       0
+#define NUM_CHECKS 1
+/*ARGSUSED*/
+static Boolean
+XawPrintDialogSetValues(Widget current, Widget request, Widget cnew,
+                        ArgList in_args, Cardinal *in_num_args)
+{
+    PrintDialogWidget w   = (PrintDialogWidget)cnew;
+    PrintDialogWidget old = (PrintDialogWidget)current;
+    Arg               args[5];
+    unsigned int      i;
+    Bool              checks[NUM_CHECKS];
+
+    for (i = 0; i < NUM_CHECKS; i++)
+        checks[i] = False;
+
+    for (i = 0; i < *in_num_args; i++) {
+        if (!strcmp(XtNicon, in_args[i].name))
+            checks[ICON]  = True;
+    }
+
+    if (checks[ICON]) {
+        if (w->printdialog.icon != 0) {
+            XtSetArg(args[0], XtNbitmap, w->printdialog.icon);
+            if (old->printdialog.iconW != NULL) {
+                XtSetValues(old->printdialog.iconW, args, 1);
+            }
+            else {
+                XtSetArg(args[1], XtNborderWidth, 0);
+                XtSetArg(args[2], XtNleft,        XtChainLeft);
+                XtSetArg(args[3], XtNright,       XtChainLeft);
+                w->printdialog.iconW = XtCreateWidget("icon", labelWidgetClass,
+                                                      cnew, args, 4);
+                XtManageChild(w->printdialog.iconW);
+            }
+        }
+        else if (old->printdialog.icon != 0) {
+            XtDestroyWidget(old->printdialog.iconW);
+            w->printdialog.iconW = NULL;
+        }
+    }
+
+    return True;
+}
+
+/*
+ * Function:
+ *      XawPrintDialogGetValuesHook
+ *
+ * Parameters:
+ *      w        - Print Dialog Widget
+ *      args     - argument list
+ *      num_args - number of args
+ *
+ * Description:
+ *      This is a get values hook routine that gets the values in the dialog.
+ */
+static void
+XawPrintDialogGetValuesHook(Widget w, ArgList args, Cardinal *num_args)
+{
+    /* NO-OP for now */
+}
+
+static void 
+XawPrintDialogDestroy(Widget w)
+{
+    PrintDialogWidget pdw = (PrintDialogWidget)w;
+    Log(("# XawPrintDialogDestroy: start.\n"));
+
+    destroyPrintSetupDialog(pdw);
+    destroyPrinterSelectionDialog(pdw);
+    closePrinterConnection(pdw, True);
+    
+    Log(("# XawPrintDialogDestroy: done.\n"));
+}
+
+/*
+ * Function:
+ *      XawPrintDialogClosePrinterConnection
+ *
+ * Parameters:
+ *      w            - Print Dialog Widget
+ *      closeDisplay - Boolean which decides whether |Display *|
+ *                     and |XPContext| should be disposed, too.
+ *
+ * Description:
+ *      The print display connection is owned by the print dialog
+ *      by default.
+ *      If the application wishes to close the display connection
+ *      to the print server, either to close it itself or force
+ *      a disconnection for other reasons this function can be used.
+ *
+ * Notes
+ *      1. PUBLIC API
+ *      2. After this function returns all resources returned by the
+ *         print dialog which are related to the status of the printer
+ *         connection are stale.
+ */
+void
+XawPrintDialogClosePrinterConnection(Widget w, Bool closeDisplay)
+{
+    closePrinterConnection((PrintDialogWidget)w, closeDisplay);
+}
+
diff --git a/xmore/printdialog.h b/xmore/printdialog.h
new file mode 100644 (file)
index 0000000..f166a27
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * $Xorg: printdialog.h,v 1.1 2004/04/30 02:05:54 gisburn Exp $
+ *
+Copyright 2004 Roland Mainz <roland.mainz@nrubsig.org>
+
+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.
+ *
+ */
+
+#ifndef XMORE_PRINTDIALOG_H
+#define XMORE_PRINTDIALOG_H 1
+
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Shell.h>
+#include <X11/Xaw/Print.h>
+#include <X11/Xaw/Cardinals.h>
+#include <X11/Xaw/Form.h>
+#include <X11/XprintUtil/xprintutil.h>
+
+/* Resources:
+   NOT WRITTEN YET
+*/
+
+#define XtCIcon "Icon"
+#define XtNicon "icon"
+
+#define XawNOkCallback             "okCallback"
+#define XawNCancelCallback         "cancelCallback"
+
+typedef struct
+{
+    Display            *pdpy;
+    XPContext           pcontext;
+    const char         *printToFileName;
+    Boolean             printToFile;
+    XpuColorspaceRec   *colorspace;
+} XawPrintDialogCallbackStruct;
+
+typedef struct _PrintDialogClassRec *PrintDialogWidgetClass;
+typedef struct _PrintDialogRec      *PrintDialogWidget;
+
+extern WidgetClass printDialogWidgetClass;
+
+_XFUNCPROTOBEGIN
+
+/* Prototypes */
+void XawPrintDialogClosePrinterConnection(Widget w, Bool closeDisplay);
+
+_XFUNCPROTOEND
+
+#endif /* !XMORE_PRINTDIALOG_H */
diff --git a/xmore/printdialogprivates.h b/xmore/printdialogprivates.h
new file mode 100644 (file)
index 0000000..1e66eb8
--- /dev/null
@@ -0,0 +1,182 @@
+/*
+ * $Xorg: printdialogprivates.h,v 1.1 2004/05/12 02:05:54 gisburn Exp $
+ *
+Copyright 2004 Roland Mainz <roland.mainz@nrubsig.org>
+
+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.
+ *
+ */
+
+#ifndef _XawPrintDialogP_h
+#define _XawPrintDialogP_h 1
+
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <X11/Xos.h>
+#include <X11/Xmu/Misc.h>
+#include <X11/CoreP.h>
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Cardinals.h>
+#include <X11/Xaw/Command.h>    
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/DialogP.h>
+#include <X11/Xaw/XawInit.h>
+#include <X11/Xaw/Dialog.h>
+#include <X11/Xaw/FormP.h>
+
+/* From Xaw/Privates.h */
+#ifndef XtWidth
+#define XtWidth(w)        (((RectObj)w)->rectangle.width)
+#endif
+#ifndef XtHeight
+#define XtHeight(w)       (((RectObj)w)->rectangle.height)
+#endif
+
+
+typedef struct {
+    XtPointer extension;
+} PrintDialogClassPart;
+
+typedef struct _PrintDialogClassRec {
+    CoreClassPart         core_class;
+    CompositeClassPart    composite_class;
+    ConstraintClassPart   constraint_class;
+    FormClassPart         form_class;
+    PrintDialogClassPart  print_dialog_class;
+} PrintDialogClassRec;
+
+extern PrintDialogClassRec printDialogClassRec;
+
+typedef struct _PrintDialogPart {
+    /* resources */
+    String        label;               /* description of the dialog     */
+    String        value;               /* for the user response         */
+    Pixmap        icon;                /* icon bitmap                   */
+    XtCallbackList ok_callback,
+                   cancel_callback;
+        
+    /* private */
+    Widget     iconW;          /* widget to display the icon    */
+    
+    struct
+    {
+        Widget form,
+               innerform,
+               desclabel,
+               desc,
+               info,
+               namelabel,
+               name,
+               selectprinter,
+               filenamelabel,
+               filename,
+               selectfile,
+               printtoprinter,
+               printtofile,
+               ok,
+               setup,
+               cancel;
+    } main;
+
+    Bool   printToFile;
+    char  *filename;
+    Bool   canPrint,       /* can we print ? */
+           canReallyPrint; /* is it really save to print ? */
+    XpuColorspaceRec *selected_colorspace;
+
+    struct
+    {
+        Widget popup,
+               form,
+               list,
+               ok,
+               cancel;
+    } selectPrinter;
+
+    struct
+    {
+      Widget popup,
+             form,
+             paperlist,
+             resolutionlist,
+             orientationlist,
+             plexlist,
+             colorspacelist,
+             jobcopieslabel,
+             jobcopies,
+             ok,
+             cancel;
+    } setup;
+
+    struct
+    {
+        Widget dialog,
+               shell;
+    } selectFile;
+
+    XPPrinterList  printerlist;
+    int            num_printers;
+    String        *widget_printerlist;
+
+    String     printer_name;
+    Display   *pdpy;
+    XPContext  pcontext;
+
+    XpuMediumSourceSizeList  paperlist;
+    int                      num_papers;
+    String                  *widget_paperlist;
+    
+    XpuResolutionList        resolutionlist;
+    int                      num_resolutions;
+    String                  *widget_resolutionlist;
+
+    XpuOrientationList       orientationlist;
+    int                      num_orientations;
+    String                  *widget_orientationlist;
+
+    XpuPlexList              plexlist;
+    int                      num_plex;
+    String                  *widget_plexlist;
+
+    XpuColorspaceList        colorspacelist;
+    int                      num_colorspaces;
+    String                  *widget_colorspacelist;
+} PrintDialogPart;
+
+typedef struct _PrintDialogRec {
+    CorePart            core;
+    CompositePart       composite;
+    ConstraintPart      constraint;
+    FormPart            form;
+    PrintDialogPart     printdialog;
+} PrintDialogRec;
+
+typedef struct {
+    XtPointer extension;
+} PrintDialogConstraintsPart;
+
+typedef struct _PrintDialogConstraintsRec {
+    FormConstraintsPart        form;
+    PrintDialogConstraintsPart printdialog;
+} PrintDialogConstraintsRec, *PrintDialogConstraints;
+
+#endif /* !_XawPrintDialogP_h */
+
diff --git a/xmore/xmore.c b/xmore/xmore.c
new file mode 100644 (file)
index 0000000..4ed6e23
--- /dev/null
@@ -0,0 +1,320 @@
+/*
+ * $Xorg: xmore.c,v 1.1 2004/04/30 02:05:54 gisburn Exp $
+ *
+Copyright 2004 Roland Mainz <roland.mainz@nrubsig.org>
+
+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.
+ *
+ */
+
+/* Force ANSI C prototypes from X11 headers */
+#ifndef FUNCPROTO 
+#define FUNCPROTO 15
+#endif /* !FUNCPROTO */
+
+#include <X11/StringDefs.h> 
+#include <X11/Intrinsic.h> 
+#include <X11/Shell.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/List.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/AsciiText.h> 
+#include <X11/Xaw/Cardinals.h>
+
+#include "xmore.h"
+
+#ifdef USE_XPRINT
+
+#include "printdialog.h"
+#include "print.h"
+
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <limits.h>
+
+/* Turn a NULL pointer string into an empty string */
+#define NULLSTR(x) (((x)!=NULL)?(x):(""))
+
+#define Error(x) { printf x ; exit(EXIT_FAILURE); }
+#define Assertion(expr, msg) { if (!(expr)) { Error msg } }
+#define Log(x)   { if (userOptions.verbose) printf x; }
+
+/* Global vars */
+static Widget        printdialog_shell = NULL;
+static Widget        printdialog       = NULL;
+static Widget        toplevel          = NULL;
+static Widget        text              = NULL;
+static char          printJobNameBuffer[PATH_MAX+256];
+static const char   *ProgramName;  /* program name   (from argv[0]) */
+static const char   *viewFileName; /* file to browse (from argv[1]) */
+
+/* prototypes */
+static void quitAction(Widget w,  XEvent *event, String *params, Cardinal *num_params);
+static void quitXtProc(Widget w, XtPointer client_data, XtPointer callData);
+#ifdef USE_XPRINT
+static void printAction(Widget w, XEvent *event, String *params, Cardinal *num_params);
+static void printXtProc(Widget w, XtPointer client_data, XtPointer callData);
+#endif
+
+static XrmOptionDescRec options[] = {
+{
+  "-v", "*verbose", XrmoptionNoArg, (XPointer) "on" },
+};
+
+
+static XtActionsRec actions[] = {
+    { "quit",          quitAction      },
+#ifdef USE_XPRINT
+    { "print",         printAction     }
+#endif
+};
+
+/* See xmore.h */
+XMoreResourceData userOptions;
+
+#define Offset(field) XtOffsetOf(XMoreResourceData, field)
+
+XtResource resources[] = {
+  {"verbose", "Verbose", XtRBoolean, sizeof(Boolean),  Offset(verbose),  XtRImmediate, (XtPointer)False},
+  {"textfont", XtCFont,  XtRFontSet, sizeof(XFontSet), Offset(textfont), XtRString,    STANDARDFONT},
+};
+
+
+String fallback_resources[] = {
+#ifdef NOTYET
+    "*iconPixmap:    xmore32",
+    "*iconMask:      xmore32",
+#endif /* NOTYET */
+    "*textfont: " STANDARDFONT,
+    "*international: True", /* set this globally for ALL widgets to avoid wiered crashes */
+    "*text.Translations: #override \\n\\"
+        "\tCtrl<Key>S:     no-op(RingBell)\\n\\"
+        "\tCtrl<Key>R:     no-op(RingBell)\\n\\"
+        "\t<Key>space:     next-page()\\n\\"
+        "\t<Key>F:         next-page()\\n\\"
+        "\tCtrl<Key>B:     previous-page()\\n\\"
+        "\t<Key>B:         previous-page()\\n\\"
+        "\t<Key>K:         scroll-one-line-down()\\n\\"
+        "\t<Key>Y:         scroll-one-line-down()\\n\\"
+        "\t<Key>Return:    scroll-one-line-up()\\n\\"
+        "\t<Key>J:         scroll-one-line-up()\\n\\"
+        "\t<Key>E:         scroll-one-line-up()\\n\\"
+        "\t<Key>p:         print()\\n\\"
+        "\t<Key>q:         quit()\\n",
+    "*text.baseTranslations: #override \\n\\"
+        "\t<Key>space:     next-page()\\n\\"
+        "\t<Key>F:         next-page()\\n\\"
+        "\tCtrl<Key>B:     previous-page()\\n\\"
+        "\t<Key>K:         scroll-one-line-down()\\n\\"
+        "\t<Key>Y:         scroll-one-line-down()\\n\\"
+        "\t<Key>Return:    scroll-one-line-up()\\n\\"
+        "\t<Key>J:         scroll-one-line-up()\\n\\"
+        "\t<Key>E:         scroll-one-line-up()\\n\\"
+        "\t<Key>p:         print()\\n\\"
+        "\t<Key>q:         quit()\\n",
+    NULL,
+};
+
+static void
+quitAction(Widget w,  XEvent *event, String *params, Cardinal *num_params)
+{
+    XtAppSetExitFlag(XtWidgetToApplicationContext(w));
+}
+
+static void
+quitXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    XtCallActionProc(w, "quit", NULL, NULL, 0);
+}
+
+static void
+printshellDestroyXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    XawPrintDialogClosePrinterConnection(printdialog, False);
+}
+
+#ifdef USE_XPRINT
+
+static void
+printOKXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    XawPrintDialogCallbackStruct *pdcs = (XawPrintDialogCallbackStruct *)callData;
+    Cardinal                      n;
+    Arg                           args[2];
+    Widget                        textsource;
+
+    Log(("printOKXtProc: OK.\n"));
+    
+    /* Get TextSource object */
+    n = 0;
+    XtSetArg(args[n], XtNtextSource, &textsource); n++;
+    XtGetValues(text, args, n);
+    
+    Assertion(textsource != NULL, (("printOKXtProc: textsource == NULL.\n")));
+   
+    /* ||printJobNameBuffer| must live as long the print job prints
+     * because it is used for the job title AND the page headers... */
+    sprintf(printJobNameBuffer, "XMore print job %s", viewFileName);
+
+    DoPrintTextSource(ProgramName,
+                      textsource, toplevel,
+                      pdcs->pdpy, pdcs->pcontext, pdcs->colorspace,
+                      printshellDestroyXtProc,
+                      printJobNameBuffer,
+                      pdcs->printToFile?pdcs->printToFileName:NULL);
+
+    XtPopdown(printdialog_shell);
+}
+
+static void
+printCancelXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    Log(("printCancelXtProc: cancel.\n"));
+    XtPopdown(printdialog_shell);
+    
+    Log(("destroying print dialog shell...\n"));
+    XtDestroyWidget(printdialog_shell);
+    printdialog_shell = NULL;
+    printdialog       = NULL;
+    Log(("... done\n"));
+}
+
+static void
+printXtProc(Widget w, XtPointer client_data, XtPointer callData)
+{
+    XtCallActionProc(toplevel, "print", NULL, NULL, 0);
+}
+
+static void
+printAction(Widget w,  XEvent *event, String *params, Cardinal *num_params)
+{
+  Dimension   width, height;
+  Position    x, y;
+  Widget      parent = toplevel;
+  Log(("print!\n"));
+  
+  if (!printdialog) {
+    int n;
+    Arg args[20];
+
+    n = 0;
+    XtSetArg(args[n], XtNallowShellResize, True); n++;
+    printdialog_shell = XtCreatePopupShell("printdialogshell",
+                                           transientShellWidgetClass,
+                                           toplevel, args, n);
+    n = 0;
+    printdialog = XtCreateManagedWidget("printdialog", printDialogWidgetClass,
+                                        printdialog_shell, args, n);
+    XtAddCallback(printdialog, XawNOkCallback,     printOKXtProc,     NULL);
+    XtAddCallback(printdialog, XawNCancelCallback, printCancelXtProc, NULL);
+
+    XtRealizeWidget(printdialog_shell);
+  }
+
+  /* Center dialog */
+  XtVaGetValues(printdialog_shell,
+      XtNwidth,  &width,
+      XtNheight, &height,
+      NULL);
+
+  x = (Position)(XWidthOfScreen( XtScreen(parent)) - width)  / 2;
+  y = (Position)(XHeightOfScreen(XtScreen(parent)) - height) / 3;
+
+  XtVaSetValues(printdialog_shell,
+      XtNx, x,
+      XtNy, y,
+      NULL);
+        
+  XtPopup(printdialog_shell, XtGrabNonexclusive);
+}
+
+#endif
+
+int main( int argc, char *argv[] )
+{
+  XtAppContext app;
+  Widget       form;
+  Widget       printbutton;
+  Widget       quitbutton;
+  int          n;
+  Arg          args[8];
+
+  ProgramName = argv[0];
+
+  XtSetLanguageProc(NULL, NULL, NULL);
+  toplevel = XtOpenApplication(&app, "XMore",
+                               options, XtNumber(options), 
+                               &argc, argv, fallback_resources,
+                               sessionShellWidgetClass, NULL, ZERO);
+
+  if (argc != 2)
+  {
+    printf("usage: %s [ x options ] filename\n", argv[0]);
+    exit(EXIT_FAILURE);
+  }
+
+  XtGetApplicationResources(toplevel, (XtPointer)&userOptions, resources, 
+                            XtNumber(resources), NULL, 0);
+  XtAppAddActions(app, actions, XtNumber(actions));
+
+  viewFileName = argv[1];
+
+  form = XtCreateManagedWidget("form", formWidgetClass, toplevel, NULL, 0);
+
+  n = 0;
+  XtSetArg(args[n], XtNtype,             XawAsciiFile);            n++;
+  XtSetArg(args[n], XtNstring,           viewFileName);            n++;
+  XtSetArg(args[n], XtNwidth,            700);                     n++;
+  XtSetArg(args[n], XtNheight,           300);                     n++;
+  XtSetArg(args[n], XtNscrollHorizontal, XawtextScrollAlways);     n++;
+  XtSetArg(args[n], XtNscrollVertical,   XawtextScrollAlways);     n++;
+  XtSetArg(args[n], XtNfontSet,          userOptions.textfont);    n++;
+  text = XtCreateManagedWidget("text", asciiTextWidgetClass, form, args, n);
+
+#ifdef USE_XPRINT
+  n = 0;
+  XtSetArg(args[n], XtNfromHoriz,       NULL);            n++;
+  XtSetArg(args[n], XtNfromVert,        text);            n++;
+  XtSetArg(args[n], XtNlabel,           "Print...");      n++;
+  printbutton = XtCreateManagedWidget("print", commandWidgetClass, form, args, n);
+  XtAddCallback(printbutton, XtNcallback, printXtProc, 0);        
+#endif
+  
+  n = 0;
+  XtSetArg(args[n], XtNfromHoriz,       printbutton);            n++;
+  XtSetArg(args[n], XtNfromVert,        text);                   n++;
+  XtSetArg(args[n], XtNlabel,           "Quit");      n++;
+  quitbutton = XtCreateManagedWidget("quit", commandWidgetClass, form, args, n);
+  XtAddCallback(quitbutton, XtNcallback, quitXtProc, 0);
+  
+  printdialog_shell = NULL;
+  printdialog       = NULL;
+
+  XtRealizeWidget(toplevel);
+  
+  XtAppMainLoop(app);
+
+  return EXIT_SUCCESS;
+}
+         
diff --git a/xmore/xmore.h b/xmore/xmore.h
new file mode 100644 (file)
index 0000000..101f73a
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * $Xorg: xmore.h,v 1.1 2004/04/30 02:05:54 gisburn Exp $
+ *
+Copyright 2004 Roland Mainz <roland.mainz@nrubsig.org>
+
+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.
+ *
+ */
+
+#ifndef XMORE_XMORE_H
+#define XMORE_XMORE_H 1
+
+#include <X11/Intrinsic.h>
+
+typedef struct {
+  Boolean  verbose;
+  XFontSet textfont;
+} XMoreResourceData, *XMoreResourceDataPtr;
+
+#define STANDARDFONT "-adobe-courier-medium-r-normal--12-*-*-*-*-*," \
+                      "-*-*-*-*-*-*-12-*-*-*-*-*"
+
+#endif /* !XMORE_XMORE_H */
diff --git a/xmore/xmore.man b/xmore/xmore.man
new file mode 100644 (file)
index 0000000..2936397
--- /dev/null
@@ -0,0 +1,23 @@
+.\" -*- coding: us-ascii -*-
+.TH xmore __appmansuffix__ "1 February 2005"  
+.SH NAME
+xmore \- plain text display program for the X Window System
+.SH SYNOPSIS
+.ad l
+\fBxmore\fR \kx
+.if (\nxu > (\n(.lu / 2)) .nr x (\n(.lu / 5)
+'in \n(.iu+\nxu
+[\fB\fBfilename\fR\fR]
+'in \n(.iu-\nxu
+.ad b
+.SH DESCRIPTION
+xmore is a plain text browser.
+.SH ENVIRONMENT
+.TP 
+\fBXPSERVERLIST\fR 
+\fB${XPSERVERLIST}\fR must be set,
+identifying the available Xprint servers.
+See \fBXprint\fR(__miscmansuffix__)
+for more details.
+.SH "SEE ALSO"
+\fBX11\fR(__miscmansuffix__), \fBxman\fR(__appmansuffix__)
diff --git a/xmore/xmore.sgml b/xmore/xmore.sgml
new file mode 100644 (file)
index 0000000..ec766c0
--- /dev/null
@@ -0,0 +1,83 @@
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.2//EN" 'http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd'>
+
+<!-- Process this file with DocBook tools to generate the output format
+(such as manual pages or HTML documents).
+
+Note that strings like __appmansuffix__, __filemansuffix__, __libmansuffix__,
+__miscmansuffix__ etc. have to be replaced first (in theory that's the
+job of ENTITIES but some XML tools are highly allergic to such stuff... ;-().
+A quick way to do that is to filter this document via
+/usr/bin/sed "s/__appmansuffix__/${MANSUFFIX}/g;s/__filemansuffix__/${FILEMANSUFFIX}/g;s/__libmansuffix__/${LIBMANSUFFIX}/g;s/__misc
+mansuffix__/${MISCMANSUFFIX}/g"
+assuming that env vars like MANSUFFIX etc. have been set to the matching
+manual volume numbers.
+  -->
+
+<refentry>
+  <refmeta>
+    <refentrytitle>xmore</refentrytitle>
+    <manvolnum>__appmansuffix__</manvolnum>
+  </refmeta>
+  <refnamediv>
+    <refname>xmore</refname>
+
+    <refpurpose>plain text display program for the X Window System</refpurpose>
+  </refnamediv>
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>xmore</command>
+
+      <arg><option><replaceable>filename</replaceable></option></arg>     
+    </cmdsynopsis>
+  </refsynopsisdiv>
+  <refsect1>
+    <title>DESCRIPTION</title>
+
+    <para><command>xmore</command> is a plain text browser.
+    </para>
+
+  </refsect1>
+
+  <refsect1>
+    <title>ENVIRONMENT</title>
+    <variablelist>
+      <varlistentry>
+        <term><envar>XPSERVERLIST</envar>
+        </term>
+        <listitem>
+           <para>
+              <envar>${XPSERVERLIST}</envar> must be set,
+             identifying the available Xprint servers.
+              See <citerefentry><refentrytitle>Xprint</refentrytitle><manvolnum>__miscmansuffix__</manvolnum></citerefentry>
+             for more details.
+         </para>
+       </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsect1>
+
+<!-- not yet
+  <refsect1>
+    <title>KNOWN BUGS</title>
+    <para>
+    </para>
+  </refsect1>
+-->
+
+  <refsect1>
+    <title>SEE ALSO</title>
+    <para>
+      <simplelist type="inline">
+        <!-- specific references -->
+        <!-- none -->
+        
+        <!-- Xprint general references -->
+        <member><citerefentry><refentrytitle>X11</refentrytitle><manvolnum>__miscmansuffix__</manvolnum></citerefentry></member>
+        <member><citerefentry><refentrytitle>xman</refentrytitle><manvolnum>__appmansuffix__</manvolnum></citerefentry></member>
+      </simplelist>
+    </para>
+  </refsect1>
+
+</refentry>
+
+
diff --git a/xwd/AUTHORS b/xwd/AUTHORS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xwd/COPYING b/xwd/COPYING
new file mode 100755 (executable)
index 0000000..b957451
--- /dev/null
@@ -0,0 +1,44 @@
+Copyright 1987, 1988, 1993, 1994, 1996, 1998  The Open Group
+Copyright 1994 Hewlett-Packard Co.
+
+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 2007 Kim woelders
+
+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 the copyright holders not be used in advertising or
+publicity pertaining to distribution of the software without specific,
+written prior permission.  The copyright holders make no representations
+about the suitability of this software for any purpose.  It is provided "as
+is" without express or implied warranty.
+
+THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL THE COPYRIGHT HOLDERS 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.
diff --git a/xwd/ChangeLog b/xwd/ChangeLog
new file mode 100755 (executable)
index 0000000..8b7d030
--- /dev/null
@@ -0,0 +1,402 @@
+commit d58fa4c8f990abbb12df3cca34ed413683604470
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Sun Nov 7 10:17:48 2010 -0800
+
+    xwd 1.0.4
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 5f10318237d4327d429db6d94527278466452de2
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Sun Nov 7 10:16:29 2010 -0800
+
+    config: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS
+    
+    Regroup AC statements under the Autoconf initialization section.
+    Regroup AM sttaements under the Automake initialization section.
+    Add missing AC_CONFIG_SRCDIR
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit ee07a99593b89559e3f77c301fce245da3bcd21f
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Sun Nov 7 10:13:24 2010 -0800
+
+    config: Remove unnecessary calls from configure.ac
+    
+    AC_PROG_CC & AC_PROG_INSTALL are provided by XORG_DEFAULT_OPTIONS now
+    PKG_CONFIG_MODULES handles AC_SUBST of the CFLAGS & LIBS variables
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 78ff57bae1a7cfa3f650ed1bd25e48e1b690a30b
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Sun Nov 7 10:11:24 2010 -0800
+
+    config: upgrade to util-macros 1.8 for additional man page support
+    
+    Use MAN_SUBST now supplied in XORG_MANPAGE_SECTIONS
+    The value of MAN_SUBST is the same for all X.Org packages.
+    
+    Use AC_PROG_SED now supplied by XORG_DEFAULT_OPTIONS
+    Enables use of platform appropriate version of sed.
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit a9371f05f4c63a7c68ff97a1ef06c82c8fc78b6d
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Nov 7 10:10:39 2010 -0800
+
+    config: update AC_PREREQ statement to 2.60
+    
+    Unrelated to the previous patches, the new value simply reflects
+    the reality that the minimum level for autoconf to configure
+    all x.org modules is 2.60 dated June 2006.
+    
+    ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit e5edfc867b49b785e7859823047f19e4af9c465d
+Author: Jesse Adkins <jesserayadkins@gmail.com>
+Date:   Tue Sep 28 13:29:50 2010 -0700
+
+    Purge cvs tags.
+    
+    Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 6bb4b240be83cb0074d10602b2532de062ac7966
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Nov 26 09:19:55 2009 -0500
+
+    Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES
+    
+    Now that the INSTALL file is generated.
+    Allows running make maintainer-clean.
+
+commit a8fbe89bbcccf29964e108f5c113c4b1ce094670
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Wed Oct 28 14:09:09 2009 -0400
+
+    INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206
+    
+    Add missing INSTALL file. Use standard GNU file on building tarball
+    README may have been updated
+    Remove AUTHORS file as it is empty and no content available yet.
+    Remove NEWS file as it is empty and no content available yet.
+
+commit 4ecee142fb9641b0a165816bf7a26e9bb32b3639
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Mon Oct 26 22:08:39 2009 -0400
+
+    Makefile.am: ChangeLog not required: EXTRA_DIST or *CLEANFILES #24432
+    
+    ChangeLog filename is known to Automake and requires no further
+    coding in the makefile.
+
+commit 0f7c35e98702dbe2249eb0beeb3419c2b8905fdb
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Oct 22 12:34:16 2009 -0400
+
+    .gitignore: use common defaults with custom section # 24239
+    
+    Using common defaults will reduce errors and maintenance.
+    Only the very small or inexistent custom section need periodic maintenance
+    when the structure of the component changes. Do not edit defaults.
+
+commit d42b2891295ef8d58dee73d9c37ca3a22a81dc3a
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Wed Oct 21 12:47:22 2009 -0700
+
+    This is not a GNU project, so declare it foreign.
+    
+    On Wed, 2009-10-21 at 13:36 +1000, Peter Hutterer wrote:
+    > On Tue, Oct 20, 2009 at 08:23:55PM -0700, Jeremy Huddleston wrote:
+    > > I noticed an INSTALL file in xlsclients and libXvMC today, and it
+    > > was quite annoying to work around since 'autoreconf -fvi' replaces
+    > > it and git wants to commit it.  Should these files even be in git?
+    > > Can I nuke them for the betterment of humanity and since they get
+    > > created by autoreconf anyways?
+    >
+    > See https://bugs.freedesktop.org/show_bug.cgi?id=24206
+    
+    As an interim measure, replace AM_INIT_AUTOMAKE([dist-bzip2]) with
+    AM_INIT_AUTOMAKE([foreign dist-bzip2]). This will prevent the generation
+    of the INSTALL file. It is also part of the 24206 solution.
+    
+    Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
+
+commit 5ba93bf07a4ffb84d86f6d4fad419e81a57358c6
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Oct 16 19:59:20 2009 -0700
+
+    xwd 1.0.3
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 06525a61829053f5aed23efb61046b1a1efb5b79
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Oct 16 19:58:59 2009 -0700
+
+    Migrate to xorg macros 1.3 & XORG_DEFAULT_OPTIONS
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit ff06ff5f6eadfa1a6b4c25198b8965e38a260e63
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Oct 16 19:58:08 2009 -0700
+
+    Fill in COPYING file with copyright/license notices from code & docs
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit b744604c550dadb04fd773e207626db4fbe6a460
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Oct 1 14:54:32 2009 -0700
+
+    Add README with pointers to mailing lists, bugzilla, & git
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 5d82f32cac19af013c48d01b66aa9f14add30f42
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Thu Jan 15 15:43:08 2009 -0200
+
+    Ansification and compile warning fixes.
+    
+      This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects
+    make distcheck and most gcc 4.3 and sparse warnings.
+
+commit a27df6ee496a1b2df678242cf514490924f44027
+Author: Branden Robinson <branden@debian.org>
+Date:   Fri Feb 11 02:14:27 2005 -0500
+
+    Do not spew usage on connection error
+    
+    General philosophy:
+    
+    The user should only be shown a usage message when:
+      * it is asked for with a --help option or the like.
+      * the command line is syntactically invalid.
+
+commit 37401df6799722d16bc02c52b241cf2ef5070b7d
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Sun Jun 29 10:47:22 2008 -0400
+
+    xwd 1.0.2
+
+commit f9725928e875035bd2a96621aa8f861160e85dd7
+Author: Kim Woelders <kim@woelders.dk>
+Date:   Sun Jun 22 01:17:12 2008 -0400
+
+    Remove unused code, ANSIfy, add const.
+    
+    Signed-off-by: James Cloos <cloos@jhcloos.com>
+
+commit 3dcc66bbbc74c41c2b4509a785c3688fd75387a1
+Author: Kim Woelders <kim@woelders.dk>
+Date:   Sun Jun 22 01:16:31 2008 -0400
+
+    Fix window selection by pointer.
+    
+    This should fix things in WM’s using virtual roots as well as in tabbing WM’s.
+    
+    Signed-off-by: James Cloos <cloos@jhcloos.com>
+
+commit 23b60f871f76878572b2acec59dd6c47e3acd0e0
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Sun Apr 13 22:30:44 2008 -0700
+
+    Added missing AM_PROG_CC_C_O
+
+commit f686dfebf0816630664d5fe024fae3710ac8c103
+Author: Niveditha Rau <niveditha.rau@sun.com>
+Date:   Fri Feb 15 16:41:33 2008 -0800
+
+    Add -silent to options in man page synopsis
+
+commit 2e522aa858ded39209036ebb956c9ea3257d3668
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Dec 6 16:37:34 2007 -0500
+
+    Replace static ChangeLog with dist-hook to generate from git log
+
+commit e5d381ba7a3d06090c5352bd5c39601ec1abcfbe
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Mon Sep 3 05:51:57 2007 -0400
+
+    Add *~ to .gitignore to skip patch/emacs droppings
+
+commit a905f2d72bc3b09a4a2eb3046771dc4331b920c9
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Aug 23 19:25:16 2007 -0400
+
+    Rename .cvsignore to .gitignore
+
+commit 1a6550aebfd3c675c0d75c8a23aaa94baca6761a
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 21 02:29:54 2005 +0000
+
+    Update package version for X11R7 release.
+
+commit b840d879c0e514728da5f6aad94723c87e17f294
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Dec 19 16:22:47 2005 +0000
+
+    Stub COPYING files
+
+commit 9023b24530ccaf71c2375dc1031baf743f1610c2
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:24:12 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+commit 7e0ff968e8dab09792ff802b1433c68d4e3f6d2d
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 6 22:48:27 2005 +0000
+
+    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit e63fca21475fc1a99937388883868f3d61edfc9d
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Dec 3 05:49:29 2005 +0000
+
+    Update package version number for X11R7 RC3 release.
+
+commit 750b3f6469c060a3c2826530714183667992d61f
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Nov 28 22:01:48 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 31f96dce7b65f6879f9cac3302352b45f8b17b56
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Mon Nov 21 10:35:09 2005 +0000
+
+    Another pass at .cvsignores for apps.
+
+commit e1ce2fee75109d460db19ea9bc259c993306ffba
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Nov 21 03:14:17 2005 +0000
+
+    Change dependency from xmu to xmuu since the full xmu (with all its baggage
+        like Xt) is not needed here.
+
+commit f2872124b38058973d90a9e00490a16ab855eb74
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Sun Nov 20 22:08:56 2005 +0000
+
+    Add/improve .cvsignore files for apps.
+
+commit 70f962e49566a2f5187ce94150ced0dcadcee517
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:47:58 2005 +0000
+
+    Update package version number for RC1 release.
+
+commit a1be690262901ca063d1bbfbdedfd15e8a434b85
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Oct 17 23:56:25 2005 +0000
+
+    Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to
+        work better with BSD make
+
+commit ca2bc3fb574ad4ac5a3de6d591b5046a2548d257
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Fri Oct 14 00:25:48 2005 +0000
+
+    Use sed to fill in variables in man page
+
+commit 9f14a8229938ddb5d78adb84f1c73eaa2d399e61
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Aug 1 20:25:33 2005 +0000
+
+    Install man pages to section 1 instead of section m (Patch from Donnie
+        Berkholz)
+
+commit 1ddc8445cc15cd5202de51bdf89b6f9072b44a5c
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Jul 29 21:22:38 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 754d3311ce2773c4eda374fd97f8f326d845a3ca
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed Jul 20 19:32:05 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 504daf4567c93ac5ec425ab122cd88f29089ea7d
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Fri Jul 8 20:59:16 2005 +0000
+
+    Add build system for xwd
+
+commit a26e8f8a7974255f834535976f45de85050845ba
+Author: Roland Mainz <roland.mainz@nrubsig.org>
+Date:   Wed Oct 6 19:29:59 2004 +0000
+
+    Fix for https://freedesktop.org/bugzilla/show_bug.cgi?id=1518 - Add filter
+        support to "xlsfonts" that it can filter builtin-, glyph- and/or other
+        kinds of printer fonts (controlled by the xp-listfonts-modes attribute
+        as described in the CDE DtPrint and Xprint specifications).
+
+commit 9d55223b5ae27e8745bec57385a72126ecb8f8f2
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 19:55:09 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+commit 965e88073aa8c5c4affc0ba934d70f75866aafd8
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:35:54 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit 04bed4e3e41764a41016fa7a3d1dd6189e4ebd4d
+Author: Egbert Eich <eich@suse.de>
+Date:   Wed Mar 3 12:13:20 2004 +0000
+
+    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit 7fb18f8136d988a305b3a55a584701b8a5d2d620
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:36:32 2004 +0000
+
+    readding XFree86's cvs IDs
+
+commit f6983fb7f571b827ad5ea1e3e81ee24c65547e1b
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 09:24:18 2004 +0000
+
+    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit f8547075b021b392855041018de02fdbf84b252c
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:29:23 2003 +0000
+
+    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit 5c3c7501aceec68da15fda13ab4efb0c5f82ef99
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:49:24 2003 +0000
+
+    XFree86 4.3.0.1
+
+commit f7cb26f3488672da827d30962b940f3e11e49b4a
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 15:54:55 2003 +0000
+
+    R6.6 is the Xorg base-line
diff --git a/xwd/INSTALL b/xwd/INSTALL
new file mode 100755 (executable)
index 0000000..8b82ade
--- /dev/null
@@ -0,0 +1,291 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008 Free Software Foundation, Inc.
+
+   This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+   Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package.  The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.
+
+     Running `configure' might take a while.  While running, it prints
+     some messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+  6. Often, you can also type `make uninstall' to remove the installed
+     files again.
+
+Compilers and Options
+=====================
+
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+   You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you can use GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory.  After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+   On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor.  Like
+this:
+
+     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CPP="gcc -E" CXXCPP="g++ -E"
+
+   This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+   By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+   Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Particular systems
+==================
+
+   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+     ./configure CC="cc -Ae"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
+a workaround.  If GNU CC is not installed, it is therefore recommended
+to try
+
+     ./configure CC="cc"
+
+and if that doesn't work, try
+
+     ./configure CC="cc -nodtk"
+
+Specifying the System Type
+==========================
+
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+   Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug.  Until the bug is fixed you can use this workaround:
+
+     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+   `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+     Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+     Print a summary of the options unique to this package's
+     `configure', and exit.  The `short' variant lists options used
+     only in the top level, while the `recursive' variant lists options
+     also present in any nested packages.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+     Use DIR as the installation prefix.  *Note Installation Names::
+     for more details, including other options available for fine-tuning
+     the installation locations.
+
+`--no-create'
+`-n'
+     Run the configure checks, but stop before creating any output
+     files.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/xwd/Makefile.am b/xwd/Makefile.am
new file mode 100755 (executable)
index 0000000..311425b
--- /dev/null
@@ -0,0 +1,66 @@
+# 
+#  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 = xwd
+
+AM_CFLAGS = $(CWARNFLAGS) $(XWD_CFLAGS)
+xwd_LDADD = $(XWD_LIBS)
+
+xwd_SOURCES =  \
+        clientwin.c \
+        clientwin.h \
+        dsimple.c \
+        dsimple.h \
+        list.c \
+        list.h \
+        multiVis.c \
+        multiVis.h \
+        wsutils.h \
+        xwd.c
+
+appman_PRE = \
+        xwd.man
+
+
+appmandir = $(APP_MAN_DIR)
+
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+
+EXTRA_DIST = $(appman_PRE)
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+CLEANFILES = $(appman_DATA)
+
+SUFFIXES = .$(APP_MAN_SUFFIX) .man
+
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
+.man.$(APP_MAN_SUFFIX):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/xwd/Makefile.in b/xwd/Makefile.in
new file mode 100755 (executable)
index 0000000..ee473cc
--- /dev/null
@@ -0,0 +1,768 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = xwd$(EXEEXT)
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+       $(top_srcdir)/configure COPYING ChangeLog INSTALL config.guess \
+       config.sub depcomp install-sh missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_xwd_OBJECTS = clientwin.$(OBJEXT) dsimple.$(OBJEXT) list.$(OBJEXT) \
+       multiVis.$(OBJEXT) xwd.$(OBJEXT)
+xwd_OBJECTS = $(am_xwd_OBJECTS)
+am__DEPENDENCIES_1 =
+xwd_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(xwd_SOURCES)
+DIST_SOURCES = $(xwd_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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+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@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+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@
+CHANGELOG_CMD = @CHANGELOG_CMD@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
+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@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_CMD = @INSTALL_CMD@
+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@
+MAKEINFO = @MAKEINFO@
+MAN_SUBSTS = @MAN_SUBSTS@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XORG_MAN_PAGE = @XORG_MAN_PAGE@
+XWD_CFLAGS = @XWD_CFLAGS@
+XWD_LIBS = @XWD_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__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@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CFLAGS = $(CWARNFLAGS) $(XWD_CFLAGS)
+xwd_LDADD = $(XWD_LIBS)
+xwd_SOURCES = \
+        clientwin.c \
+        clientwin.h \
+        dsimple.c \
+        dsimple.h \
+        list.c \
+        list.h \
+        multiVis.c \
+        multiVis.h \
+        wsutils.h \
+        xwd.c
+
+appman_PRE = \
+        xwd.man
+
+appmandir = $(APP_MAN_DIR)
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+EXTRA_DIST = $(appman_PRE)
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+CLEANFILES = $(appman_DATA)
+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) --foreign'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign 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)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+       @if test ! -f $@; then \
+         rm -f stamp-h1; \
+         $(MAKE) $(AM_MAKEFLAGS) 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) 
+       ($(am__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)'; test -n "$(bindir)" || list=; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p; \
+         then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+xwd$(EXEEXT): $(xwd_OBJECTS) $(xwd_DEPENDENCIES) 
+       @rm -f xwd$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(xwd_OBJECTS) $(xwd_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clientwin.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsimple.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multiVis.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xwd.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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) '$<'`
+install-appmanDATA: $(appman_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)"
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \
+       done
+
+uninstall-appmanDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appmandir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appmandir)" && rm -f $$files
+
+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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       set x; \
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       $(am__remove_distdir)
+       test -d "$(distdir)" || mkdir "$(distdir)"
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$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
+       -test -n "$(am__skip_mode_fix)" \
+       || find "$(distdir)" -type d ! -perm -755 \
+               -exec chmod u+rwx,go+rx {} \; -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 $(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-lzma: distdir
+       tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+       $(am__remove_distdir)
+
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+       $(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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+       *.tar.bz2*) \
+         bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.lzma*) \
+         lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+       *.tar.Z*) \
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+       *.shar.gz*) \
+         GZIP=$(GZIP_ENV) gzip -dc $(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)
+       test -d $(distdir)/_build || exit 0; \
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && am__cwd=`pwd` \
+         && $(am__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 \
+         && cd "$$am__cwd" \
+         || exit 1
+       $(am__remove_distdir)
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+       @$(am__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)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-appmanDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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
+
+.MAKE: all install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+       clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
+       dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \
+       dist-zip distcheck distclean distclean-compile \
+       distclean-generic distclean-hdr distclean-tags distcleancheck \
+       distdir distuninstallcheck dvi dvi-am html html-am info \
+       info-am install install-am install-appmanDATA \
+       install-binPROGRAMS install-data install-data-am install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+       tags uninstall uninstall-am uninstall-appmanDATA \
+       uninstall-binPROGRAMS
+
+
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
+.man.$(APP_MAN_SUFFIX):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
+
+# 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/xwd/NEWS b/xwd/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xwd/README b/xwd/README
new file mode 100755 (executable)
index 0000000..fd85d64
--- /dev/null
@@ -0,0 +1,25 @@
+xwd - dump an image of an X window
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+        http://lists.freedesktop.org/mailman/listinfo/xorg
+
+Please submit bug reports to the Xorg bugzilla:
+
+        https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+The master development code repository can be found at:
+
+        git://anongit.freedesktop.org/git/xorg/app/xwd
+
+        http://cgit.freedesktop.org/xorg/app/xwd
+
+For patch submission instructions, see:
+
+       http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
+For more information on the git code manager, see:
+
+        http://wiki.x.org/wiki/GitPage
+
diff --git a/xwd/aclocal.m4 b/xwd/aclocal.m4
new file mode 100755 (executable)
index 0000000..641b5d9
--- /dev/null
@@ -0,0 +1,2371 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009  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.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
+[m4_warning([this file was generated for autoconf 2.68.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11.1], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# 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, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# 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])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+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, 2006, 2009
+# 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 10
+
+# 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], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$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
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    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"])
+])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008, 2009 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 16
+
+# 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.62])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
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+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
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_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)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+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
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_AM_DEPENDENCIES(OBJC)],
+                 [define([AC_PROG_OBJC],
+                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# 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_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
+                         (and sometimes confusing) to the casual installer],
+      [USE_MAINTAINER_MODE=$enableval],
+      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  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, 2009  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_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.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
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+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, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# 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
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# 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, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _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],
+[m4_foreach_w([_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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# 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
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# 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) 2009  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 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# 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="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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
+
+dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
+dnl
+dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. 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 "Software"),
+dnl to deal in the Software without restriction, including without limitation
+dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
+dnl and/or sell copies of the Software, and to permit persons to whom the
+dnl Software is furnished to do so, subject to the following conditions:
+dnl
+dnl The above copyright notice and this permission notice (including the next
+dnl paragraph) shall be included in all copies or substantial portions of the
+dnl Software.
+dnl
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+dnl DEALINGS IN THE SOFTWARE.
+
+# 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 ensure that this macro is defined, also add:
+# m4_ifndef([XORG_MACROS_VERSION],
+#     [m4_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.
+m4_defun([XORG_MACROS_VERSION],[
+m4_define([vers_have], [1.11.0])
+m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
+m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
+m4_if(m4_cmp(maj_have, maj_needed), 0,,
+    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
+m4_if(m4_version_compare(vers_have, [$1]), -1,
+    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
+m4_undefine([vers_have])
+m4_undefine([maj_have])
+m4_undefine([maj_needed])
+]) # 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])
+       # under Cygwin unix is still defined even with -undef
+       elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+               RAWCPPFLAGS="-undef -ansi"
+               AC_MSG_RESULT([yes, with -ansi])
+       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
+# Added MAN_SUBSTS in version 1.8
+# Added AC_PROG_SED in version 1.8
+
+AC_DEFUN([XORG_MANPAGE_SECTIONS],[
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_SED])
+
+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_MAN_PAGE="X Version 11"
+AC_SUBST([XORG_MAN_PAGE])
+MAN_SUBSTS="\
+       -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xservername__|Xorg|g' \
+       -e 's|__xconfigfile__|xorg.conf|g' \
+       -e 's|__projectroot__|\$(prefix)|g' \
+       -e 's|__apploaddir__|\$(appdefaultdir)|g' \
+       -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
+       -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
+       -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
+       -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
+       -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
+       -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
+AC_SUBST([MAN_SUBSTS])
+
+]) # XORG_MANPAGE_SECTIONS
+
+# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
+# ------------------------
+# Minimum version: 1.7.0
+#
+# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
+# provided by xorg-sgml-doctools, if installed.
+AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
+AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
+XORG_SGML_PATH=
+PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
+    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
+    [m4_ifval([$1],[:],
+        [if test x"$cross_compiling" != x"yes" ; then
+            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
+                          [XORG_SGML_PATH=$prefix/share/sgml])
+         fi])
+    ])
+
+# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
+# the path and the name of the doc stylesheet
+if test "x$XORG_SGML_PATH" != "x" ; then
+   AC_MSG_RESULT([$XORG_SGML_PATH])
+   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
+   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
+else
+   AC_MSG_RESULT([no])
+fi
+
+AC_SUBST(XORG_SGML_PATH)
+AC_SUBST(STYLESHEET_SRCDIR)
+AC_SUBST(XSL_STYLESHEET)
+AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
+]) # XORG_CHECK_SGML_DOCTOOLS
+
+# 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_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
+AC_REQUIRE([XORG_WITH_PS2PDF])
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+
+AC_MSG_CHECKING([whether to build documentation])
+
+if test x$XORG_SGML_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$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
+
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([whether to build text documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([whether to build PDF documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([whether to build PostScript documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([whether to build HTML documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
+# ----------------
+# Minimum version: 1.5.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-xmlto option, it allows maximum flexibilty in making decisions
+# as whether or not to use the xmlto package. When DEFAULT is not specified,
+# --with-xmlto assumes 'auto'.
+#
+# Interface to module:
+# HAVE_XMLTO:  used in makefiles to conditionally generate documentation
+# XMLTO:       returns the path of the xmlto program found
+#              returns the path set by the user in the environment
+# --with-xmlto:        'yes' user instructs the module to use xmlto
+#              'no' user instructs the module not to use xmlto
+#
+# Added in version 1.10.0
+# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
+#                  xmlto for text output requires either lynx, links, or w3m browsers
+#
+# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_XMLTO],[
+AC_ARG_VAR([XMLTO], [Path to xmlto command])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(xmlto,
+       AS_HELP_STRING([--with-xmlto],
+          [Use xmlto to regenerate documentation (default: ]_defopt[)]),
+          [use_xmlto=$withval], [use_xmlto=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_xmlto" = x"auto"; then
+   AC_PATH_PROG([XMLTO], [xmlto])
+   if test "x$XMLTO" = "x"; then
+        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
+       have_xmlto=no
+   else
+        have_xmlto=yes
+   fi
+elif test "x$use_xmlto" = x"yes" ; then
+   AC_PATH_PROG([XMLTO], [xmlto])
+   if test "x$XMLTO" = "x"; then
+        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
+   fi
+   have_xmlto=yes
+elif test "x$use_xmlto" = x"no" ; then
+   if test "x$XMLTO" != "x"; then
+      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
+   fi
+   have_xmlto=no
+else
+   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
+fi
+
+# Test for a minimum version of xmlto, if provided.
+m4_ifval([$1],
+[if test "$have_xmlto" = yes; then
+    # scrape the xmlto version
+    AC_MSG_CHECKING([the xmlto version])
+    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
+    AC_MSG_RESULT([$xmlto_version])
+    AS_VERSION_COMPARE([$xmlto_version], [$1],
+        [if test "x$use_xmlto" = xauto; then
+            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
+            have_xmlto=no
+        else
+            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
+        fi])
+fi])
+
+# Test for the ability of xmlto to generate a text target
+have_xmlto_text=no
+cat > conftest.xml << "EOF"
+EOF
+AS_IF([test "$have_xmlto" = yes],
+      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
+             [have_xmlto_text=yes],
+             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
+rm -f conftest.xml
+AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
+AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
+]) # XORG_WITH_XMLTO
+
+# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
+# ----------------
+# Minimum version: 1.5.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-asciidoc option, it allows maximum flexibilty in making decisions
+# as whether or not to use the asciidoc package. When DEFAULT is not specified,
+# --with-asciidoc assumes 'auto'.
+#
+# Interface to module:
+# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
+# ASCIIDOC:     returns the path of the asciidoc program found
+#               returns the path set by the user in the environment
+# --with-asciidoc: 'yes' user instructs the module to use asciidoc
+#                'no' user instructs the module not to use asciidoc
+#
+# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_ASCIIDOC],[
+AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(asciidoc,
+       AS_HELP_STRING([--with-asciidoc],
+          [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
+          [use_asciidoc=$withval], [use_asciidoc=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_asciidoc" = x"auto"; then
+   AC_PATH_PROG([ASCIIDOC], [asciidoc])
+   if test "x$ASCIIDOC" = "x"; then
+        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
+       have_asciidoc=no
+   else
+        have_asciidoc=yes
+   fi
+elif test "x$use_asciidoc" = x"yes" ; then
+   AC_PATH_PROG([ASCIIDOC], [asciidoc])
+   if test "x$ASCIIDOC" = "x"; then
+        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
+   fi
+   have_asciidoc=yes
+elif test "x$use_asciidoc" = x"no" ; then
+   if test "x$ASCIIDOC" != "x"; then
+      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
+   fi
+   have_asciidoc=no
+else
+   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
+fi
+m4_ifval([$1],
+[if test "$have_asciidoc" = yes; then
+    # scrape the asciidoc version
+    AC_MSG_CHECKING([the asciidoc version])
+    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
+    AC_MSG_RESULT([$asciidoc_version])
+    AS_VERSION_COMPARE([$asciidoc_version], [$1],
+        [if test "x$use_asciidoc" = xauto; then
+            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
+            have_asciidoc=no
+        else
+            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
+        fi])
+fi])
+AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
+]) # XORG_WITH_ASCIIDOC
+
+# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
+# --------------------------------
+# Minimum version: 1.5.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-doxygen option, it allows maximum flexibilty in making decisions
+# as whether or not to use the doxygen package. When DEFAULT is not specified,
+# --with-doxygen assumes 'auto'.
+#
+# Interface to module:
+# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
+# DOXYGEN:      returns the path of the doxygen program found
+#               returns the path set by the user in the environment
+# --with-doxygen: 'yes' user instructs the module to use doxygen
+#                'no' user instructs the module not to use doxygen
+#
+# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_DOXYGEN],[
+AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(doxygen,
+       AS_HELP_STRING([--with-doxygen],
+          [Use doxygen to regenerate documentation (default: ]_defopt[)]),
+          [use_doxygen=$withval], [use_doxygen=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_doxygen" = x"auto"; then
+   AC_PATH_PROG([DOXYGEN], [doxygen])
+   if test "x$DOXYGEN" = "x"; then
+        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
+       have_doxygen=no
+   else
+        have_doxygen=yes
+   fi
+elif test "x$use_doxygen" = x"yes" ; then
+   AC_PATH_PROG([DOXYGEN], [doxygen])
+   if test "x$DOXYGEN" = "x"; then
+        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
+   fi
+   have_doxygen=yes
+elif test "x$use_doxygen" = x"no" ; then
+   if test "x$DOXYGEN" != "x"; then
+      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
+   fi
+   have_doxygen=no
+else
+   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
+fi
+m4_ifval([$1],
+[if test "$have_doxygen" = yes; then
+    # scrape the doxygen version
+    AC_MSG_CHECKING([the doxygen version])
+    doxygen_version=`$DOXYGEN --version 2>/dev/null`
+    AC_MSG_RESULT([$doxygen_version])
+    AS_VERSION_COMPARE([$doxygen_version], [$1],
+        [if test "x$use_doxygen" = xauto; then
+            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
+            have_doxygen=no
+        else
+            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
+        fi])
+fi])
+AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
+]) # XORG_WITH_DOXYGEN
+
+# XORG_WITH_GROFF([DEFAULT])
+# ----------------
+# Minimum version: 1.6.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-groff option, it allows maximum flexibilty in making decisions
+# as whether or not to use the groff package. When DEFAULT is not specified,
+# --with-groff assumes 'auto'.
+#
+# Interface to module:
+# HAVE_GROFF:   used in makefiles to conditionally generate documentation
+# HAVE_GROFF_MM: the memorandum macros (-mm) package
+# HAVE_GROFF_MS: the -ms macros package
+# GROFF:        returns the path of the groff program found
+#               returns the path set by the user in the environment
+# --with-groff:         'yes' user instructs the module to use groff
+#               'no' user instructs the module not to use groff
+#
+# Added in version 1.9.0:
+# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
+#                 pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
+#                 psselect from the psutils package.
+#                 the ghostcript package. Refer to the grohtml man pages
+#
+# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
+#
+# OS and distros often splits groff in a basic and full package, the former
+# having the groff program and the later having devices, fonts and macros
+# Checking for the groff executable is not enough.
+#
+# If macros are missing, we cannot assume that groff is useless, so we don't
+# unset HAVE_GROFF or GROFF env variables.
+# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
+#
+AC_DEFUN([XORG_WITH_GROFF],[
+AC_ARG_VAR([GROFF], [Path to groff command])
+m4_define([_defopt], m4_default([$1], [auto]))
+AC_ARG_WITH(groff,
+       AS_HELP_STRING([--with-groff],
+          [Use groff to regenerate documentation (default: ]_defopt[)]),
+          [use_groff=$withval], [use_groff=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_groff" = x"auto"; then
+   AC_PATH_PROG([GROFF], [groff])
+   if test "x$GROFF" = "x"; then
+        AC_MSG_WARN([groff not found - documentation targets will be skipped])
+       have_groff=no
+   else
+        have_groff=yes
+   fi
+elif test "x$use_groff" = x"yes" ; then
+   AC_PATH_PROG([GROFF], [groff])
+   if test "x$GROFF" = "x"; then
+        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
+   fi
+   have_groff=yes
+elif test "x$use_groff" = x"no" ; then
+   if test "x$GROFF" != "x"; then
+      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
+   fi
+   have_groff=no
+else
+   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
+fi
+
+# We have groff, test for the presence of the macro packages
+if test "x$have_groff" = x"yes"; then
+    AC_MSG_CHECKING([for ${GROFF} -ms macros])
+    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
+        groff_ms_works=yes
+    else
+        groff_ms_works=no
+    fi
+    AC_MSG_RESULT([$groff_ms_works])
+    AC_MSG_CHECKING([for ${GROFF} -mm macros])
+    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
+        groff_mm_works=yes
+    else
+        groff_mm_works=no
+    fi
+    AC_MSG_RESULT([$groff_mm_works])
+fi
+
+# We have groff, test for HTML dependencies, one command per package
+if test "x$have_groff" = x"yes"; then
+   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
+   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
+   AC_PATH_PROG(PSSELECT_PATH, [psselect])
+   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
+      have_groff_html=yes
+   else
+      have_groff_html=no
+      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
+   fi
+fi
+
+# Set Automake conditionals for Makefiles
+AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
+AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
+AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
+AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
+]) # XORG_WITH_GROFF
+
+# XORG_WITH_FOP([DEFAULT])
+# ----------------
+# Minimum version: 1.6.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-fop option, it allows maximum flexibilty in making decisions
+# as whether or not to use the fop package. When DEFAULT is not specified,
+# --with-fop assumes 'auto'.
+#
+# Interface to module:
+# HAVE_FOP:    used in makefiles to conditionally generate documentation
+# FOP:         returns the path of the fop program found
+#              returns the path set by the user in the environment
+# --with-fop:  'yes' user instructs the module to use fop
+#              'no' user instructs the module not to use fop
+#
+# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_FOP],[
+AC_ARG_VAR([FOP], [Path to fop command])
+m4_define([_defopt], m4_default([$1], [auto]))
+AC_ARG_WITH(fop,
+       AS_HELP_STRING([--with-fop],
+          [Use fop to regenerate documentation (default: ]_defopt[)]),
+          [use_fop=$withval], [use_fop=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_fop" = x"auto"; then
+   AC_PATH_PROG([FOP], [fop])
+   if test "x$FOP" = "x"; then
+        AC_MSG_WARN([fop not found - documentation targets will be skipped])
+       have_fop=no
+   else
+        have_fop=yes
+   fi
+elif test "x$use_fop" = x"yes" ; then
+   AC_PATH_PROG([FOP], [fop])
+   if test "x$FOP" = "x"; then
+        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
+   fi
+   have_fop=yes
+elif test "x$use_fop" = x"no" ; then
+   if test "x$FOP" != "x"; then
+      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
+   fi
+   have_fop=no
+else
+   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
+fi
+AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
+]) # XORG_WITH_FOP
+
+# XORG_WITH_PS2PDF([DEFAULT])
+# ----------------
+# Minimum version: 1.6.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
+# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
+# --with-ps2pdf assumes 'auto'.
+#
+# Interface to module:
+# HAVE_PS2PDF:         used in makefiles to conditionally generate documentation
+# PS2PDF:      returns the path of the ps2pdf program found
+#              returns the path set by the user in the environment
+# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
+#               'no' user instructs the module not to use ps2pdf
+#
+# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_PS2PDF],[
+AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
+m4_define([_defopt], m4_default([$1], [auto]))
+AC_ARG_WITH(ps2pdf,
+       AS_HELP_STRING([--with-ps2pdf],
+          [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
+          [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_ps2pdf" = x"auto"; then
+   AC_PATH_PROG([PS2PDF], [ps2pdf])
+   if test "x$PS2PDF" = "x"; then
+        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
+       have_ps2pdf=no
+   else
+        have_ps2pdf=yes
+   fi
+elif test "x$use_ps2pdf" = x"yes" ; then
+   AC_PATH_PROG([PS2PDF], [ps2pdf])
+   if test "x$PS2PDF" = "x"; then
+        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
+   fi
+   have_ps2pdf=yes
+elif test "x$use_ps2pdf" = x"no" ; then
+   if test "x$PS2PDF" != "x"; then
+      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
+   fi
+   have_ps2pdf=no
+else
+   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
+fi
+AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
+]) # XORG_WITH_PS2PDF
+
+# XORG_ENABLE_DOCS (enable_docs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a builder to skip all
+# documentation targets except traditional man pages.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO         --with-xmlto
+# XORG_WITH_ASCIIDOC      --with-asciidoc
+# XORG_WITH_DOXYGEN       --with-doxygen
+# XORG_WITH_FOP           --with-fop
+# XORG_WITH_GROFF         --with-groff
+# XORG_WITH_PS2PDF        --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_DOCS:           used in makefiles to conditionally generate documentation
+# --enable-docs: 'yes' user instructs the module to generate docs
+#               'no' user instructs the module not to generate docs
+# parm1:       specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_DOCS],[
+m4_define([default], m4_default([$1], [yes]))
+AC_ARG_ENABLE(docs,
+       AS_HELP_STRING([--enable-docs],
+          [Enable building the documentation (default: ]default[)]),
+          [build_docs=$enableval], [build_docs=]default)
+m4_undefine([default])
+AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
+AC_MSG_CHECKING([whether to build documentation])
+AC_MSG_RESULT([$build_docs])
+]) # XORG_ENABLE_DOCS
+
+# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# This macro enables a builder to skip all developer documentation.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO         --with-xmlto
+# XORG_WITH_ASCIIDOC      --with-asciidoc
+# XORG_WITH_DOXYGEN       --with-doxygen
+# XORG_WITH_FOP           --with-fop
+# XORG_WITH_GROFF         --with-groff
+# XORG_WITH_PS2PDF        --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_DEVEL_DOCS:   used in makefiles to conditionally generate developer docs
+# --enable-devel-docs: 'yes' user instructs the module to generate developer docs
+#                      'no' user instructs the module not to generate developer docs
+# parm1:               specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
+m4_define([devel_default], m4_default([$1], [yes]))
+AC_ARG_ENABLE(devel-docs,
+       AS_HELP_STRING([--enable-devel-docs],
+          [Enable building the developer documentation (default: ]devel_default[)]),
+          [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
+m4_undefine([devel_default])
+AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
+AC_MSG_CHECKING([whether to build developer documentation])
+AC_MSG_RESULT([$build_devel_docs])
+]) # XORG_ENABLE_DEVEL_DOCS
+
+# XORG_ENABLE_SPECS (enable_specs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# This macro enables a builder to skip all functional specification targets.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO         --with-xmlto
+# XORG_WITH_ASCIIDOC      --with-asciidoc
+# XORG_WITH_DOXYGEN       --with-doxygen
+# XORG_WITH_FOP           --with-fop
+# XORG_WITH_GROFF         --with-groff
+# XORG_WITH_PS2PDF        --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_SPECS:                used in makefiles to conditionally generate specs
+# --enable-specs:      'yes' user instructs the module to generate specs
+#                      'no' user instructs the module not to generate specs
+# parm1:               specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_SPECS],[
+m4_define([spec_default], m4_default([$1], [yes]))
+AC_ARG_ENABLE(specs,
+       AS_HELP_STRING([--enable-specs],
+          [Enable building the specs (default: ]spec_default[)]),
+          [build_specs=$enableval], [build_specs=]spec_default)
+m4_undefine([spec_default])
+AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
+AC_MSG_CHECKING([whether to build functional specifications])
+AC_MSG_RESULT([$build_specs])
+]) # XORG_ENABLE_SPECS
+
+# 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,
+       AS_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],
+               [MALLOC_ZERO_RETURNS_NULL=yes])
+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
+#
+# This macro enables the use of a tool that flags some suspicious and
+# non-portable constructs (likely to be bugs) in C language source code.
+# It will attempt to locate the tool and use appropriate options.
+# There are various lint type tools on different platforms.
+#
+# Interface to module:
+# LINT:                returns the path to the tool found on the platform
+#              or the value set to LINT on the configure cmd line
+#              also an Automake conditional
+# LINT_FLAGS:  an Automake variable with appropriate flags
+#
+# --with-lint: 'yes' user instructs the module to use lint
+#              'no' user instructs the module not to use lint (default)
+#
+# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
+# If the user sets the value of LINT_FLAGS, they are used verbatim.
+#
+AC_DEFUN([XORG_WITH_LINT],[
+
+AC_ARG_VAR([LINT], [Path to a lint-style command])
+AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
+AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
+               [Use a lint-style source code checker (default: disabled)])],
+               [use_lint=$withval], [use_lint=no])
+
+# Obtain platform specific info like program name and options
+# The lint program on FreeBSD and NetBSD is different from the one on Solaris
+case $host_os in
+  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
+       lint_name=splint
+       lint_options="-badflag"
+       ;;
+  *freebsd* | *netbsd*)
+       lint_name=lint
+       lint_options="-u -b"
+       ;;
+  *solaris*)
+       lint_name=lint
+       lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
+       ;;
+esac
+
+# Test for the presence of the program (either guessed by the code or spelled out by the user)
+if test "x$use_lint" = x"yes" ; then
+   AC_PATH_PROG([LINT], [$lint_name])
+   if test "x$LINT" = "x"; then
+        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
+   fi
+elif test "x$use_lint" = x"no" ; then
+   if test "x$LINT" != "x"; then
+      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
+   fi
+else
+   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
+fi
+
+# User supplied flags override default flags
+if test "x$LINT_FLAGS" != "x"; then
+   lint_options=$LINT_FLAGS
+fi
+
+AC_SUBST([LINT_FLAGS],[$lint_options])
+AM_CONDITIONAL(LINT, [test "x$LINT" != x])
+
+]) # 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.
+#
+# Interface to module:
+# LINTLIB              - Automake variable with the name of lint library file to make
+# MAKE_LINT_LIB                - Automake conditional
+#
+# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
+#                        - 'no' user instructs the module not to create a lint library (default)
+
+AC_DEFUN([XORG_LINT_LIBRARY],[
+AC_REQUIRE([XORG_WITH_LINT])
+AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
+       [Create lint library (default: disabled)])],
+       [make_lint_lib=$enableval], [make_lint_lib=no])
+
+if test "x$make_lint_lib" = x"yes" ; then
+   LINTLIB=llib-l$1.ln
+   if test "x$LINT" = "x"; then
+        AC_MSG_ERROR([Cannot make lint library without --with-lint])
+   fi
+elif test "x$make_lint_lib" != x"no" ; then
+   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
+fi
+
+AC_SUBST(LINTLIB)
+AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
+
+]) # XORG_LINT_LIBRARY
+
+# XORG_CWARNFLAGS
+# ---------------
+# Minimum version: 1.2.0
+#
+# Defines CWARNFLAGS to enable C compiler warnings.
+#
+AC_DEFUN([XORG_CWARNFLAGS], [
+AC_REQUIRE([AC_PROG_CC_C99])
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast -Wformat=2"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+AC_SUBST(CWARNFLAGS)
+]) # XORG_CWARNFLAGS
+
+# XORG_STRICT_OPTION
+# -----------------------
+# Minimum version: 1.3.0
+#
+# Add configure option to enable strict compilation
+AC_DEFUN([XORG_STRICT_OPTION], [
+# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
+AC_REQUIRE([AC_PROG_CC_C99])
+AC_REQUIRE([XORG_CWARNFLAGS])
+
+AC_ARG_ENABLE(strict-compilation,
+                         AS_HELP_STRING([--enable-strict-compilation],
+                         [Enable all warnings from compiler and make them errors (default: disabled)]),
+                         [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
+if test "x$STRICT_COMPILE" = "xyes"; then
+       AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+       AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+AC_SUBST([CWARNFLAGS])
+]) # XORG_STRICT_OPTION
+
+# XORG_DEFAULT_OPTIONS
+# --------------------
+# Minimum version: 1.3.0
+#
+# Defines default options for X.Org modules.
+#
+AC_DEFUN([XORG_DEFAULT_OPTIONS], [
+AC_REQUIRE([AC_PROG_INSTALL])
+XORG_CWARNFLAGS
+XORG_STRICT_OPTION
+XORG_RELEASE_VERSION
+XORG_CHANGELOG
+XORG_INSTALL
+XORG_MANPAGE_SECTIONS
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
+    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
+]) # XORG_DEFAULT_OPTIONS
+
+# XORG_INSTALL()
+# ----------------
+# Minimum version: 1.4.0
+#
+# Defines the variable INSTALL_CMD as the command to copy
+# INSTALL from $prefix/share/util-macros.
+#
+AC_DEFUN([XORG_INSTALL], [
+AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
+INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+AC_SUBST([INSTALL_CMD])
+]) # XORG_INSTALL
+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
+# --------------------
+# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+AC_DEFUN([XORG_RELEASE_VERSION],[
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+               [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+               [Major version of this package])
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+               [$PVM],
+               [Minor version of this package])
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+               [$PVP],
+               [Patch version of this package])
+])
+
+# XORG_CHANGELOG()
+# ----------------
+# Minimum version: 1.2.0
+#
+# Defines the variable CHANGELOG_CMD as the command to generate
+# ChangeLog from git.
+#
+#
+AC_DEFUN([XORG_CHANGELOG], [
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+AC_SUBST([CHANGELOG_CMD])
+]) # XORG_CHANGELOG
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# 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 "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _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 --print-errors "$2" 2>&1`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       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 <http://pkg-config.freedesktop.org/>.])],
+               [$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
+
diff --git a/xwd/clientwin.c b/xwd/clientwin.c
new file mode 100755 (executable)
index 0000000..cce35ad
--- /dev/null
@@ -0,0 +1,216 @@
+/*
+ * Copyright 2007 Kim woelders
+ *
+ * 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 the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS 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 <X11/Xatom.h>
+#include <X11/Xlib.h>
+
+#include "clientwin.h"
+
+static Atom atom_wm_state = None;
+
+/*
+ * Check if window has given property
+ */
+static Bool
+Window_Has_Property(Display * dpy, Window win, Atom atom)
+{
+    Atom type_ret;
+    int format_ret;
+    unsigned char *prop_ret;
+    unsigned long bytes_after, num_ret;
+
+    type_ret = None;
+    prop_ret = NULL;
+    XGetWindowProperty(dpy, win, atom, 0, 0, False, AnyPropertyType,
+                       &type_ret, &format_ret, &num_ret,
+                       &bytes_after, &prop_ret);
+    if (prop_ret)
+        XFree(prop_ret);
+
+    return (type_ret != None) ? True : False;
+}
+
+/*
+ * Check if window is viewable
+ */
+static Bool
+Window_Is_Viewable(Display * dpy, Window win)
+{
+    Bool ok;
+    XWindowAttributes xwa;
+
+    XGetWindowAttributes(dpy, win, &xwa);
+
+    ok = (xwa.class == InputOutput) && (xwa.map_state == IsViewable);
+
+    return ok;
+}
+
+/*
+ * Find a window that has WM_STATE set in the window tree below win.
+ * Unmapped/unviewable windows are not considered valid matches.
+ * Children are searched in top-down stacking order.
+ * The first matching window is returned, None if no match is found.
+ */
+static Window
+Find_Client_In_Children(Display * dpy, Window win)
+{
+    Window root, parent;
+    Window *children;
+    unsigned int n_children;
+    int i;
+
+    if (!XQueryTree(dpy, win, &root, &parent, &children, &n_children))
+        return None;
+    if (!children)
+        return None;
+
+    /* Check each child for WM_STATE and other validity */
+    win = None;
+    for (i = (int) n_children - 1; i >= 0; i--) {
+        if (!Window_Is_Viewable(dpy, children[i])) {
+            children[i] = None; /* Don't bother descending into this one */
+            continue;
+        }
+        if (!Window_Has_Property(dpy, children[i], atom_wm_state))
+            continue;
+
+        /* Got one */
+        win = children[i];
+        goto done;
+    }
+
+    /* No children matched, now descend into each child */
+    for (i = (int) n_children - 1; i >= 0; i--) {
+        if (children[i] == None)
+            continue;
+        win = Find_Client_In_Children(dpy, children[i]);
+        if (win != None)
+            break;
+    }
+
+  done:
+    XFree(children);
+
+    return win;
+}
+
+/*
+ * Find virtual roots (_NET_VIRTUAL_ROOTS)
+ */
+static unsigned long *
+Find_Roots(Display * dpy, Window root, unsigned int *num)
+{
+    Atom type_ret;
+    int format_ret;
+    unsigned char *prop_ret;
+    unsigned long bytes_after, num_ret;
+    Atom atom;
+
+    *num = 0;
+    atom = XInternAtom(dpy, "_NET_VIRTUAL_ROOTS", False);
+    if (!atom)
+        return NULL;
+
+    type_ret = None;
+    prop_ret = NULL;
+    if (XGetWindowProperty(dpy, root, atom, 0, 0x7fffffff, False,
+                           XA_WINDOW, &type_ret, &format_ret, &num_ret,
+                           &bytes_after, &prop_ret) != Success)
+        return NULL;
+
+    if (prop_ret && type_ret == XA_WINDOW && format_ret == 32) {
+        *num = num_ret;
+        return ((unsigned long *) prop_ret);
+    }
+    if (prop_ret)
+        XFree(prop_ret);
+
+    return NULL;
+}
+
+/*
+ * Find child window at pointer location
+ */
+static Window
+Find_Child_At_Pointer(Display * dpy, Window win)
+{
+    Window root_return, child_return;
+    int dummyi;
+    unsigned int dummyu;
+
+    XQueryPointer(dpy, win, &root_return, &child_return,
+                  &dummyi, &dummyi, &dummyi, &dummyi, &dummyu);
+
+    return child_return;
+}
+
+/*
+ * Find client window at pointer location
+ *
+ * root   is the root window.
+ * subwin is the subwindow reported by a ButtonPress event on root.
+ *
+ * If the WM uses virtual roots subwin may be a virtual root.
+ * If so, we descend the window stack at the pointer location and assume the
+ * child is the client or one of its WM frame windows.
+ * This will of course work only if the virtual roots are children of the real
+ * root.
+ */
+Window
+Find_Client(Display * dpy, Window root, Window subwin)
+{
+    unsigned long *roots;
+    unsigned int i, n_roots;
+    Window win;
+
+    /* Check if subwin is a virtual root */
+    roots = Find_Roots(dpy, root, &n_roots);
+    for (i = 0; i < n_roots; i++) {
+        if (subwin != roots[i])
+            continue;
+        win = Find_Child_At_Pointer(dpy, subwin);
+        if (win == None)
+            return subwin;      /* No child - Return virtual root. */
+        subwin = win;
+        break;
+    }
+    if (roots)
+        XFree(roots);
+
+    if (atom_wm_state == None) {
+        atom_wm_state = XInternAtom(dpy, "WM_STATE", False);
+        if (!atom_wm_state)
+            return subwin;
+    }
+
+    /* Check if subwin has WM_STATE */
+    if (Window_Has_Property(dpy, subwin, atom_wm_state))
+        return subwin;
+
+    /* Attempt to find a client window in subwin's children */
+    win = Find_Client_In_Children(dpy, subwin);
+    if (win != None)
+        return win;             /* Found a client */
+
+    /* Did not find a client */
+    return subwin;
+}
diff --git a/xwd/clientwin.h b/xwd/clientwin.h
new file mode 100755 (executable)
index 0000000..9fc59b5
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2007 Kim woelders
+ *
+ * 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 the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS 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.
+ */
+#ifndef _CLIENTWIN_H_
+#define _CLIENTWIN_H_
+
+#include <X11/Xlib.h>
+
+extern Window Find_Client(Display * dpy, Window root, Window target_win);
+
+#endif
diff --git a/xwd/config.guess b/xwd/config.guess
new file mode 100755 (executable)
index 0000000..2852378
--- /dev/null
@@ -0,0 +1,1505 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+#   Free Software Foundation, Inc.
+
+timestamp='2010-08-21'
+
+# 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 (context
+# diff format) to <config-patches@gnu.org> and include a 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.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+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 <config-patches@gnu.org>."
+
+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, 2006, 2007, 2008, 2009, 2010 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' HUP INT TERM
+
+# 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" HUP INT PIPE TERM ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$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 ;;
+           sh5el) machine=sh5le-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 -q __ELF__
+               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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+       echo i386-pc-auroraux${UNAME_RELEASE}
+       exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+       eval $set_cc_for_build
+       SUN_ARCH="i386"
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       echo ${SUN_ARCH}-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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:*:[4567])
+       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 <stdlib.h>
+              #include <unistd.h>
+
+              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 -q __LP64__
+           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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       exit ;;
+    i*:CYGWIN*:*)
+       echo ${UNAME_MACHINE}-pc-cygwin
+       exit ;;
+    *: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 ;;
+    *:Interix*:*)
+       case ${UNAME_MACHINE} in
+           x86)
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           authenticamd | genuineintel | EM64T)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+           IA64)
+               echo ia64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+       esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       exit ;;
+    8664:Windows_NT:*)
+       echo x86_64-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*:*:* | x86_64: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 ;;
+    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 -q ld.so.1
+       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+       exit ;;
+    arm*:Linux:*:*)
+       eval $set_cc_for_build
+       if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_EABI__
+       then
+           echo ${UNAME_MACHINE}-unknown-linux-gnu
+       else
+           echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+       fi
+       exit ;;
+    avr32*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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 ;;
+    i*86:Linux:*:*)
+       LIBC=gnu
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+       echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+       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:*:* | mips64:Linux:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #undef CPU
+       #undef ${UNAME_MACHINE}
+       #undef ${UNAME_MACHINE}el
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=${UNAME_MACHINE}el
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       CPU=${UNAME_MACHINE}
+       #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; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-unknown-linux-gnu
+       exit ;;
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-gnu
+       exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+       echo hppa64-unknown-linux-gnu
+       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 ;;
+    ppc64:Linux:*:*)
+       echo powerpc64-unknown-linux-gnu
+       exit ;;
+    ppc:Linux:*:*)
+       echo powerpc-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 ;;
+    tile*:Linux:*:*)
+       echo ${UNAME_MACHINE}-tilera-linux-gnu
+       exit ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-gnu
+       exit ;;
+    x86_64:Linux:*:*)
+       echo x86_64-unknown-linux-gnu
+       exit ;;
+    xtensa*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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.[02]*:*)
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-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; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       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; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; 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.[02]*:*)
+       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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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 ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       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 ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-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
+           i386)
+               eval $set_cc_for_build
+               if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+                 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+                     (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+                     grep IS_64BIT_ARCH >/dev/null
+                 then
+                     UNAME_PROCESSOR="x86_64"
+                 fi
+               fi ;;
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/xwd/config.h.in b/xwd/config.h.in
new file mode 100755 (executable)
index 0000000..7c9cfb1
--- /dev/null
@@ -0,0 +1,64 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* 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 home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
diff --git a/xwd/config.sub b/xwd/config.sub
new file mode 100755 (executable)
index 0000000..320e303
--- /dev/null
@@ -0,0 +1,1739 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+#   Free Software Foundation, Inc.
+
+timestamp='2010-09-11'
+
+# 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 <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted GNU 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.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# 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 <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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-android* | linux-dietlibc | linux-newlib* | \
+  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-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 | -microblaze)
+               os=
+               basic_machine=$1
+               ;;
+        -bluegene*)
+               os=-cnk
+               ;;
+       -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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | bfin \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fido | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | lm32 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore | mep | metag \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64octeon | mips64octeonel \
+       | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | moxie \
+       | mt \
+       | msp430 \
+       | nds32 | nds32le | nds32be \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | rx \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+       | ubicom32 \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | z8k | z80)
+               basic_machine=$basic_machine-unknown
+               ;;
+       c54x)
+               basic_machine=tic54x-unknown
+               ;;
+       c55x)
+               basic_machine=tic55x-unknown
+               ;;
+       c6x)
+               basic_machine=tic6x-unknown
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12 | picochip)
+               # Motorola 68HC11/12.
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* \
+       | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64octeon-* | mips64octeonel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nds32-* | nds32le-* | nds32be-* \
+       | nios-* | nios2-* \
+       | none-* | np1-* | ns16k-* | ns32k-* \
+       | orion-* \
+       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+       | pyramid-* \
+       | romp-* | rs6000-* | rx-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tile-* | tilegx-* \
+       | tron-* \
+       | ubicom32-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa*-* \
+       | ymp-* \
+       | z8k-* | z80-*)
+               ;;
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               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
+               ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       bluegene*)
+               basic_machine=powerpc-ibm
+               os=-cnk
+               ;;
+       c54x-*)
+               basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c55x-*)
+               basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c6x-*)
+               basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+        cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
+       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
+               ;;
+       cr16)
+               basic_machine=cr16-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
+               ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
+       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
+               ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       m88k-omron*)
+               basic_machine=m88k-omron
+               ;;
+       magnum | m3230)
+               basic_machine=mips-mips
+               os=-sysv
+               ;;
+       merlin)
+               basic_machine=ns32k-utek
+               os=-sysv
+               ;;
+        microblaze)
+               basic_machine=microblaze-xilinx
+               ;;
+       mingw32)
+               basic_machine=i386-pc
+               os=-mingw32
+               ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
+       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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+        neo-tandem)
+               basic_machine=neo-tandem
+               ;;
+        nse-tandem)
+               basic_machine=nse-tandem
+               ;;
+       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
+               ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       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
+               ;;
+        # This must be matched before tile*.
+        tilegx*)
+               basic_machine=tilegx-unknown
+               os=-linux-gnu
+               ;;
+       tile*)
+               basic_machine=tile-unknown
+               os=-linux-gnu
+               ;;
+       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
+               ;;
+       z80-*-coff)
+               basic_machine=z80-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[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+               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.
+        -auroraux)
+               os=-auroraux
+               ;;
+       -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* | -cnk* | -sunos | -sunos[34]*\
+             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+             | -sym* | -kopensolaris* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* | -aros* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
+             | -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* | -cegcc* \
+             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -linux-android* \
+             | -linux-newlib* | -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* | -rdos* | -toppers* | -drops* | -es*)
+       # 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
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+        -nacl*)
+               ;;
+       -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
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
+       *-acorn)
+               os=-riscix1.2
+               ;;
+       arm*-rebel)
+               os=-linux
+               ;;
+       arm*-semi)
+               os=-aout
+               ;;
+        c4x-* | tic4x-*)
+               os=-coff
+               ;;
+       tic54x-*)
+               os=-coff
+               ;;
+       tic55x-*)
+               os=-coff
+               ;;
+       tic6x-*)
+               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
+               ;;
+        mep-*)
+               os=-elf
+               ;;
+       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
+                               ;;
+                       -cnk*|-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/xwd/configure b/xwd/configure
new file mode 100755 (executable)
index 0000000..2beb5e8
--- /dev/null
@@ -0,0 +1,6133 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.68 for xwd 1.0.4.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+        /*)
+          for as_base in sh bash ksh sh5; do
+            # Try only shells that exist, to save several forks.
+            as_shell=$as_dir/$as_base
+            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+          done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+       # neutralization value for shells without unset; and this also
+       # works around shells that cannot unset nonexistent variables.
+       # Preserve -v and -x to the replacement shell.
+       BASH_ENV=/dev/null
+       ENV=/dev/null
+       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+       export CONFIG_SHELL
+       case $- in # ((((
+         *v*x* | *x*v* ) as_opts=-vx ;;
+         *v* ) as_opts=-v ;;
+         *x* ) as_opts=-x ;;
+         * ) as_opts= ;;
+       esac
+       exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='xwd'
+PACKAGE_TARNAME='xwd'
+PACKAGE_VERSION='1.0.4'
+PACKAGE_STRING='xwd 1.0.4'
+PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
+PACKAGE_URL=''
+
+ac_unique_file="Makefile.am"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+XWD_LIBS
+XWD_CFLAGS
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+MAN_SUBSTS
+XORG_MAN_PAGE
+ADMIN_MAN_DIR
+DRIVER_MAN_DIR
+MISC_MAN_DIR
+FILE_MAN_DIR
+LIB_MAN_DIR
+APP_MAN_DIR
+ADMIN_MAN_SUFFIX
+DRIVER_MAN_SUFFIX
+MISC_MAN_SUFFIX
+FILE_MAN_SUFFIX
+LIB_MAN_SUFFIX
+APP_MAN_SUFFIX
+SED
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+INSTALL_CMD
+PKG_CONFIG
+CHANGELOG_CMD
+CWARNFLAGS
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_strict_compilation
+enable_silent_rules
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+PKG_CONFIG
+XWD_CFLAGS
+XWD_LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=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 ;;
+
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_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'`
+  as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+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
+    $as_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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 xwd 1.0.4 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/xwd]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_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 xwd 1.0.4:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --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
+  --enable-strict-compilation
+                          Enable all warnings from compiler and make them
+                          errors (default: disabled)
+  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  PKG_CONFIG  path to pkg-config utility
+  XWD_CFLAGS  C compiler flags for XWD, overriding pkg-config
+  XWD_LIBS    linker flags for XWD, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+xwd configure 1.0.4
+generated by GNU Autoconf 2.68
+
+Copyright (C) 2010 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
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by xwd $as_me 1.0.4, which was
+generated by GNU Autoconf 2.68.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append 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
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > 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
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+  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.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_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 $ac_precious_vars; 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,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_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
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_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.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+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
+
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+# Initialize Automake
+am__api_version='1.11'
+
+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
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$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'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# 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".
+      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "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 $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if ${ac_cv_path_mkdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+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='xwd'
+ VERSION='1.0.4'
+
+
+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"}
+
+# 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 -'
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-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
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$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
+
+
+
+# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
+
+
+
+
+
+
+
+
+
+
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-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
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+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
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM 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.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+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
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&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
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$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
+
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if ${ac_cv_prog_cc_c99+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+       {
+       case 's': // string
+         str = va_arg (args_copy, const char *);
+         break;
+       case 'd': // int
+         number = va_arg (args_copy, int);
+         break;
+       case 'f': // float
+         fnumber = va_arg (args_copy, double);
+         break;
+       default:
+         break;
+       }
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+         || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+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
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  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_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+
+
+
+
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast -Wformat=2"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default"
+if test "x$ac_cv_have_decl___SUNPRO_C" = xyes; then :
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+
+
+
+# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
+
+
+
+# Check whether --enable-strict-compilation was given.
+if test "${enable_strict_compilation+set}" = set; then :
+  enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval
+else
+  STRICT_COMPILE=no
+fi
+
+if test "x$STRICT_COMPILE" = "xyes"; then
+       ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default"
+if test "x$ac_cv_have_decl___SUNPRO_C" = xyes; then :
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+       ac_fn_c_check_decl "$LINENO" "__INTEL_COMPILER" "ac_cv_have_decl___INTEL_COMPILER" "$ac_includes_default"
+if test "x$ac_cv_have_decl___INTEL_COMPILER" = xyes; then :
+  INTELCC="yes"
+else
+  INTELCC="no"
+fi
+
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+
+
+
+
+macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
+INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+XORG_MAN_PAGE="X Version 11"
+
+MAN_SUBSTS="\
+       -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xservername__|Xorg|g' \
+       -e 's|__xconfigfile__|xorg.conf|g' \
+       -e 's|__projectroot__|\$(prefix)|g' \
+       -e 's|__apploaddir__|\$(appdefaultdir)|g' \
+       -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
+       -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
+       -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
+       -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
+       -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
+       -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
+
+
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=0;;
+esac
+AM_BACKSLASH='\'
+
+
+
+# Checks for pkg-config packages
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XWD" >&5
+$as_echo_n "checking for XWD... " >&6; }
+
+if test -n "$XWD_CFLAGS"; then
+    pkg_cv_XWD_CFLAGS="$XWD_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "x11") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XWD_CFLAGS=`$PKG_CONFIG --cflags "x11" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XWD_LIBS"; then
+    pkg_cv_XWD_LIBS="$XWD_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "x11") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XWD_LIBS=`$PKG_CONFIG --libs "x11" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               XWD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "x11" 2>&1`
+        else
+               XWD_PKG_ERRORS=`$PKG_CONFIG --print-errors "x11" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XWD_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (x11) were not met:
+
+$XWD_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 XWD_CFLAGS
+and XWD_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 XWD_CFLAGS
+and XWD_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+       XWD_CFLAGS=$pkg_cv_XWD_CFLAGS
+       XWD_LIBS=$pkg_cv_XWD_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+       cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+         mv -f confcache "$cache_file"$$ &&
+         mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+         mv -f confcache "$cache_file" ;;
+       esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $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}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by xwd $as_me 1.0.4, which was
+generated by GNU Autoconf 2.68.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+xwd config.status 1.0.4
+configured by $0, generated by GNU Autoconf 2.68,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+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=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  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 || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp= ac_tmp=
+  trap 'exit_status=$?
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries 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[        ]*=[    ]*/{
+h
+s///
+s/^/:/
+s/[     ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[  ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[      ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #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.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$ac_tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # 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.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$ac_tmp/stdin"
+  case $ac_file in
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$ac_tmp/config.h" "$ac_file" \
+       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$_am_arg" : 'X\(//\)[^/]' \| \
+        X"$_am_arg" : 'X\(//\)$' \| \
+        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_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=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# 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 || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/xwd/configure.ac b/xwd/configure.ac
new file mode 100755 (executable)
index 0000000..ddd1466
--- /dev/null
@@ -0,0 +1,44 @@
+
+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.
+
+# Initialize Autoconf
+AC_PREREQ([2.60])
+AC_INIT([xwd], [1.0.4],
+        [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xwd])
+AC_CONFIG_SRCDIR([Makefile.am])
+AC_CONFIG_HEADERS([config.h])
+
+# Initialize Automake
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+         [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.8)
+XORG_DEFAULT_OPTIONS
+
+# Checks for pkg-config packages
+PKG_CHECK_MODULES(XWD, x11)
+
+AC_OUTPUT([Makefile])
diff --git a/xwd/depcomp b/xwd/depcomp
new file mode 100755 (executable)
index 0000000..df8eea7
--- /dev/null
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s,\\\\\\\\,/,g"
+   depmode=msvisualcpp
+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.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    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.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[     ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "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"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${
+              s/^ *//
+              s/ \\*$//
+              s/$/:/
+              p
+            }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # 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 mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $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 "X$1" != 'X--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 "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    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.
+    -arch)
+      eat=yes ;;
+    -*|$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 "X$1" != 'X--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.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::     \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # 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
+  ;;
+
+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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xwd/dsimple.c b/xwd/dsimple.c
new file mode 100755 (executable)
index 0000000..a7e0d4c
--- /dev/null
@@ -0,0 +1,349 @@
+/*
+
+Copyright 1993, 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.
+
+*/
+
+#include <X11/Xos.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/cursorfont.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+/*
+ * Other_stuff.h: Definitions of routines in other_stuff.
+ *
+ * Written by Mark Lillibridge.   Last updated 7/1/87
+ */
+
+#include "clientwin.h"
+#include "dsimple.h"
+
+/*
+ * Just_display: A group of routines designed to make the writting of simple
+ *               X11 applications which open a display but do not open
+ *               any windows much faster and easier.  Unless a routine says
+ *               otherwise, it may be assumed to require program_name, dpy,
+ *               and screen already defined on entry.
+ *
+ * Written by Mark Lillibridge.   Last updated 7/1/87
+ */
+
+
+/* This stuff is defined in the calling program by just_display.h */
+char    *program_name = "unknown_program";
+Display *dpy = NULL;
+int      screen = 0;
+
+
+/*
+ * Get_Display_Name (argc, argv) Look for -display, -d, or host:dpy (obselete)
+ * If found, remove it from command line.  Don't go past a lone -.
+ */
+char *Get_Display_Name(
+    int *pargc,  /* MODIFIED */
+    char **argv) /* MODIFIED */
+{
+    int argc = *pargc;
+    char **pargv = argv+1;
+    char *displayname = NULL;
+    int i;
+
+    for (i = 1; i < argc; i++) {
+       char *arg = argv[i];
+
+       if (!strcmp (arg, "-display") || !strcmp (arg, "-d")) {
+           if (++i >= argc) usage ();
+
+           displayname = argv[i];
+           *pargc -= 2;
+           continue;
+       }
+       if (!strcmp(arg,"-")) {
+               while (i<argc)
+                       *pargv++ = argv[i++];
+               break;
+       }
+       *pargv++ = arg;
+    }
+
+    *pargv = NULL;
+    return (displayname);
+}
+
+
+/*
+ * Open_Display: Routine to open a display with correct error handling.
+ *               Does not require dpy or screen defined on entry.
+ */
+Display *Open_Display(const char *display_name)
+{
+       Display *d;
+
+       d = XOpenDisplay(display_name);
+       if (d == NULL) {
+           fprintf (stderr, "%s:  unable to open display '%s'\n",
+                    program_name, XDisplayName (display_name));
+           exit(1);
+       }
+
+       return(d);
+}
+
+
+/*
+ * Setup_Display_And_Screen: This routine opens up the correct display (i.e.,
+ *                           it calls Get_Display_Name) and then stores a
+ *                           pointer to it in dpy.  The default screen
+ *                           for this display is then stored in screen.
+ *                           Does not require dpy or screen defined.
+ */
+void Setup_Display_And_Screen(
+    int *argc,      /* MODIFIED */
+    char **argv)    /* MODIFIED */
+{
+        char *displayname = NULL;
+
+        displayname = Get_Display_Name(argc, argv);
+       dpy = Open_Display (displayname);
+       screen = XDefaultScreen(dpy);
+}
+
+/*
+ * Close_Display: Close display
+ */
+void Close_Display(void)
+{
+    if (dpy == NULL)
+      return;
+      
+    XCloseDisplay(dpy);
+    dpy = NULL;
+}
+
+
+/*
+ * Select_Window_Args: a rountine to provide a common interface for
+ *                     applications that need to allow the user to select one
+ *                     window on the screen for special consideration.
+ *                     This routine implements the following command line
+ *                     arguments:
+ *
+ *                       -root            Selects the root window.
+ *                       -id <id>         Selects window with id <id>. <id> may
+ *                                        be either in decimal or hex.
+ *                       -name <name>     Selects the window with name <name>.
+ *
+ *                     Call as Select_Window_Args(&argc, argv) in main before
+ *                     parsing any of your program's command line arguments.
+ *                     Select_Window_Args will remove its arguments so that
+ *                     your program does not have to worry about them.
+ *                     The window returned is the window selected or 0 if
+ *                     none of the above arguments was present.  If 0 is
+ *                     returned, Select_Window should probably be called after
+ *                     all command line arguments, and other setup is done.
+ *                     For examples of usage, see xwininfo, xwd, or xprop.
+ */
+Window Select_Window_Args(
+    int *rargc,
+    char **argv)
+#define ARGC (*rargc)
+{
+       int nargc=1;
+       int argc;
+       char **nargv;
+       Window w=0;
+
+       nargv = argv+1; argc = ARGC;
+#define OPTION argv[0]
+#define NXTOPTP ++argv, --argc>0
+#define NXTOPT if (++argv, --argc==0) usage()
+#define COPYOPT nargv++[0]=OPTION, nargc++
+
+       while (NXTOPTP) {
+               if (!strcmp(OPTION, "-")) {
+                       COPYOPT;
+                       while (NXTOPTP)
+                         COPYOPT;
+                       break;
+               }
+               if (!strcmp(OPTION, "-root")) {
+                       w=RootWindow(dpy, screen);
+                       continue;
+               }
+               if (!strcmp(OPTION, "-name")) {
+                       NXTOPT;
+                       w = Window_With_Name(dpy, RootWindow(dpy, screen),
+                                            OPTION);
+                       if (!w)
+                         Fatal_Error("No window with name %s exists!",OPTION);
+                       continue;
+               }
+               if (!strcmp(OPTION, "-id")) {
+                       NXTOPT;
+                       w=0;
+                       sscanf(OPTION, "0x%lx", &w);
+                       if (!w)
+                         sscanf(OPTION, "%lu", &w);
+                       if (!w)
+                         Fatal_Error("Invalid window id format: %s.", OPTION);
+                       continue;
+               }
+               COPYOPT;
+       }
+       ARGC = nargc;
+       
+       return(w);
+}
+
+/*
+ * Other_stuff: A group of routines which do common X11 tasks.
+ *
+ * Written by Mark Lillibridge.   Last updated 7/1/87
+ */
+
+
+/*
+ * Routine to let user select a window using the mouse
+ */
+
+Window Select_Window(Display *dpy, int descend)
+{
+  int status;
+  Cursor cursor;
+  XEvent event;
+  Window target_win = None, root = RootWindow(dpy,screen);
+  int buttons = 0;
+
+  /* Make the target cursor */
+  cursor = XCreateFontCursor(dpy, XC_crosshair);
+
+  /* Grab the pointer using target cursor, letting it room all over */
+  status = XGrabPointer(dpy, root, False,
+                       ButtonPressMask|ButtonReleaseMask, GrabModeSync,
+                       GrabModeAsync, root, cursor, CurrentTime);
+  if (status != GrabSuccess) Fatal_Error("Can't grab the mouse.");
+
+  /* Let the user select a window... */
+  while ((target_win == None) || (buttons != 0)) {
+    /* allow one more event */
+    XAllowEvents(dpy, SyncPointer, CurrentTime);
+    XWindowEvent(dpy, root, ButtonPressMask|ButtonReleaseMask, &event);
+    switch (event.type) {
+    case ButtonPress:
+      if (target_win == None) {
+       target_win = event.xbutton.subwindow; /* window selected */
+       if (target_win == None) target_win = root;
+      }
+      buttons++;
+      break;
+    case ButtonRelease:
+      if (buttons > 0) /* there may have been some down before we started */
+       buttons--;
+       break;
+    }
+  } 
+
+  XUngrabPointer(dpy, CurrentTime);      /* Done with pointer */
+
+  if (!descend || (target_win == root))
+    return(target_win);
+
+  target_win = Find_Client(dpy, root, target_win);
+
+  return(target_win);
+}
+
+
+/*
+ * Window_With_Name: routine to locate a window with a given name on a display.
+ *                   If no window with the given name is found, 0 is returned.
+ *                   If more than one window has the given name, the first
+ *                   one found will be returned.  Only top and its subwindows
+ *                   are looked at.  Normally, top should be the RootWindow.
+ */
+Window Window_With_Name(
+    Display *dpy,
+    Window top,
+    const char *name)
+{
+       Window *children, dummy;
+       unsigned int nchildren;
+       int i;
+       Window w=0;
+       char *window_name;
+
+       if (XFetchName(dpy, top, &window_name) && !strcmp(window_name, name))
+         return(top);
+
+       if (!XQueryTree(dpy, top, &dummy, &dummy, &children, &nchildren))
+         return(0);
+
+       for (i=0; i<nchildren; i++) {
+               w = Window_With_Name(dpy, children[i], name);
+               if (w)
+                 break;
+       }
+       if (children) XFree ((char *)children);
+       return(w);
+}
+
+/*
+ * outl: a debugging routine.  Flushes stdout then prints a message on stderr
+ *       and flushes stderr.  Used to print messages when past certain points
+ *       in code so we can tell where we are.  Outl may be invoked like
+ *       printf with up to 7 arguments.
+ */
+void
+outl(char *msg, ...)
+{
+       va_list args;
+       fflush(stdout);
+       va_start(args, msg);
+       vfprintf(stderr, msg, args);
+       va_end(args);
+       fprintf(stderr, "\n");
+       fflush(stderr);
+}
+
+
+/*
+ * Standard fatal error routine - call like printf but maximum of 7 arguments.
+ * Does not require dpy or screen defined.
+ */
+void Fatal_Error(char *msg, ...)
+{
+       va_list args;
+       fflush(stdout);
+       fflush(stderr);
+       fprintf(stderr, "%s: error: ", program_name);
+       va_start(args, msg);
+       vfprintf(stderr, msg, args);
+       va_end(args);
+       fprintf(stderr, "\n");
+        Close_Display();
+       exit(EXIT_FAILURE);
+}
diff --git a/xwd/dsimple.h b/xwd/dsimple.h
new file mode 100755 (executable)
index 0000000..1c7fb5a
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+
+Copyright 1993, 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.
+
+*/
+
+/*
+ * Just_display.h: This file contains the definitions needed to use the
+ *                 functions in just_display.c.  It also declares the global
+ *                 variables dpy, screen, and program_name which are needed to
+ *                 use just_display.c.
+ *
+ * Written by Mark Lillibridge.   Last updated 7/1/87
+ *
+ * Send bugs, etc. to chariot@athena.mit.edu.
+ */
+
+    /* Simple helper macros */
+#ifndef MAX
+#define MAX(a,b) (((a)>(b))?(a):(b))
+#endif /* MAX */
+#ifndef MIN
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#endif /* MIN */
+
+    /* Global variables used by routines in just_display.c */
+
+extern char *program_name;                   /* Name of this program */
+extern Display *dpy;                         /* The current display */
+extern int screen;                           /* The current screen */
+
+#define INIT_NAME program_name=argv[0]        /* use this in main to setup
+                                                 program_name */
+
+    /* Declaritions for functions in just_display.c */
+
+char *Get_Display_Name(int *, char **);
+Display *Open_Display(const char *);
+void Setup_Display_And_Screen(int *, char **);
+void Close_Display(void);
+Window Select_Window_Args(int *, char **);
+void usage(void);
+
+#define X_USAGE "[host:display]"              /* X arguments handled by
+                                                Get_Display_Name */
+
+/*
+ * Other_stuff.h: Definitions of routines in other_stuff.
+ *
+ * Written by Mark Lillibridge.   Last updated 7/1/87
+ *
+ * Send bugs, etc. to chariot@athena.mit.edu.
+ */
+
+Window Select_Window(Display *, int);
+Window Window_With_Name(Display *, Window, const char *);
+#ifdef __GNUC__
+void Fatal_Error(char *, ...) __attribute__((__noreturn__));
+#else
+void Fatal_Error(char *, ...);
+#endif
+void outl(char *, ...);
diff --git a/xwd/install-sh b/xwd/install-sh
new file mode 100755 (executable)
index 0000000..6781b98
--- /dev/null
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# 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.
+
+nl='
+'
+IFS=" ""       $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+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:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+       shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+       case $mode in
+         *' '* | *'    '* | *'
+'*       | *'*'* | *'?'* | *'['*)
+           echo "$0: invalid mode: $mode" >&2
+           exit 1;;
+       esac
+       shift;;
+
+    -o) chowncmd="$chownprog $2"
+       shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+       shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)        shift
+       break;;
+
+    -*)        echo "$0: invalid option: $1" >&2
+       exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # 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: $dst_arg: Is a directory" >&2
+       exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+       (dirname "$dst") 2>/dev/null ||
+       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+            X"$dst" : 'X\(//\)[^/]' \| \
+            X"$dst" : 'X\(//\)$' \| \
+            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+       echo X"$dst" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+       # Create intermediate dirs using mode 755 as modified by the umask.
+       # This is like FreeBSD 'install' as of 1997-10-28.
+       umask=`umask`
+       case $stripcmd.$umask in
+         # Optimize common cases.
+         *[2367][2367]) mkdir_umask=$umask;;
+         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+         *[0-7])
+           mkdir_umask=`expr $umask + 22 \
+             - $umask % 100 % 40 + $umask % 20 \
+             - $umask % 10 % 4 + $umask % 2
+           `;;
+         *) mkdir_umask=$umask,go-w;;
+       esac
+
+       # With -d, create the new directory with the user-specified mode.
+       # Otherwise, rely on $mkdir_umask.
+       if test -n "$dir_arg"; then
+         mkdir_mode=-m$mode
+       else
+         mkdir_mode=
+       fi
+
+       posix_mkdir=false
+       case $umask in
+         *[123567][0-7][0-7])
+           # POSIX mkdir -p sets u+wx bits regardless of umask, which
+           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+           ;;
+         *)
+           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+           if (umask $mkdir_umask &&
+               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+           then
+             if test -z "$dir_arg" || {
+                  # Check for POSIX incompatibilities with -m.
+                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                  # other-writeable bit of parent directory when it shouldn't.
+                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                  case $ls_ld_tmpdir in
+                    d????-?r-*) different_mode=700;;
+                    d????-?--*) different_mode=755;;
+                    *) false;;
+                  esac &&
+                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                  }
+                }
+             then posix_mkdir=:
+             fi
+             rmdir "$tmpdir/d" "$tmpdir"
+           else
+             # Remove any dirs left behind by ancient mkdir implementations.
+             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+           fi
+           trap '' 0;;
+       esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+       umask $mkdir_umask &&
+       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+       /*) prefix='/';;
+       -*) prefix='./';;
+       *)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+       test -z "$d" && continue
+
+       prefix=$prefix$d
+       if test -d "$prefix"; then
+         prefixes=
+       else
+         if $posix_mkdir; then
+           (umask=$mkdir_umask &&
+            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+           # Don't fail if two instances are running concurrently.
+           test -d "$prefix" || exit 1
+         else
+           case $prefix in
+             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+             *) qprefix=$prefix;;
+           esac
+           prefixes="$prefixes '$qprefix'"
+         fi
+       fi
+       prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+       # Don't fail if two instances are running concurrently.
+       (umask $mkdir_umask &&
+        eval "\$doit_exec \$mkdirprog $prefixes") ||
+         test -d "$dstdir" || exit 1
+       obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # 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
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"    2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+       # Now remove or move aside any old file at destination location.
+       # We try this two ways since rm can't unlink itself on some
+       # systems and the destination file might be busy for other
+       # reasons.  In this case, the final cleanup might fail but the new
+       # file should still install successfully.
+       {
+         test ! -f "$dst" ||
+         $doit $rmcmd -f "$dst" 2>/dev/null ||
+         { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+           { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+         } ||
+         { echo "$0: cannot unlink or rename $dst" >&2
+           (exit 1); exit 1
+         }
+       } &&
+
+       # Now rename the file to the real destination.
+       $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xwd/list.c b/xwd/list.c
new file mode 100755 (executable)
index 0000000..c1caff6
--- /dev/null
@@ -0,0 +1,239 @@
+/** ------------------------------------------------------------------------
+       This file contains routines for manipulating generic lists.
+       Lists are implemented with a "harness".  In other words, each
+       node in the list consists of two pointers, one to the data item
+       and one to the next node in the list.  The head of the list is
+       the same struct as each node, but the "item" ptr is used to point
+       to the current member of the list (used by the first_in_list and
+       next_in_list functions).
+
+Copyright 1994 Hewlett-Packard Co.
+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.
+
+  ----------------------------------------------------------------------- **/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "list.h"
+
+
+/** ------------------------------------------------------------------------
+       Sets the pointers of the specified list to NULL.
+    --------------------------------------------------------------------- **/
+void zero_list(list_ptr lp)
+{
+    lp->next = NULL;
+    lp->ptr.item = NULL;
+}
+
+
+/** ------------------------------------------------------------------------
+       Adds item to the list pointed to by lp.  Finds the end of the
+       list, then mallocs a new list node onto the end of the list.
+       The item pointer in the new node is set to "item" passed in,
+       and the next pointer in the new node is set to NULL.
+       Returns 1 if successful, 0 if the malloc failed.
+    -------------------------------------------------------------------- **/
+int add_to_list(list_ptr lp, void *item)
+{
+    while (lp->next) {
+       lp = lp->next;
+    }
+    if ((lp->next = (list_ptr) malloc( sizeof( list_item))) == NULL) {
+
+       return 0;
+    }
+    lp->next->ptr.item = item;
+    lp->next->next = NULL;
+
+    return 1;
+}
+
+
+/** ------------------------------------------------------------------------
+       Creates a new list and sets its pointers to NULL.  
+       Returns a pointer to the new list.
+    -------------------------------------------------------------------- **/
+list_ptr new_list (void)
+{
+    list_ptr lp;
+
+    if ((lp = (list_ptr) malloc( sizeof( list_item)))) {
+       lp->next = NULL;
+       lp->ptr.item = NULL;
+    }
+
+    return lp;
+}
+
+
+/** ------------------------------------------------------------------------
+       Creates a new list head, pointing to the same list as the one
+       passed in.  If start_at_curr is TRUE, the new list's first item
+       is the "current" item (as set by calls to first/next_in_list()).
+       If start_at_curr is FALSE, the first item in the new list is the
+       same as the first item in the old list.  In either case, the
+       curr pointer in the new list is the same as in the old list.
+       Returns a pointer to the new list head.
+    -------------------------------------------------------------------- **/
+list_ptr dup_list_head(list_ptr lp, int start_at_curr)
+{
+    list_ptr new_list;
+
+    if ((new_list = (list_ptr) malloc( sizeof( list_item))) == NULL) {
+
+        return (list_ptr)NULL;
+    }
+    new_list->next = start_at_curr ? lp->ptr.curr : lp->next;
+    new_list->ptr.curr = lp->ptr.curr;
+
+    return new_list;
+}
+
+
+/** ------------------------------------------------------------------------
+       Returns the number of items in the list.
+    -------------------------------------------------------------------- **/
+unsigned int list_length(list_ptr lp)
+{
+    unsigned int count = 0;
+
+    while (lp->next) {
+       count++;
+       lp = lp->next;
+    }
+
+    return count;
+}
+
+
+/** ------------------------------------------------------------------------
+       Scans thru list, looking for a node whose ptr.item is equal to
+       the "item" passed in.  "Equal" here means the same address - no
+       attempt is made to match equivalent values stored in different
+       locations.  If a match is found, that node is deleted from the
+       list.  Storage for the node is freed, but not for the item itself.
+       Returns a pointer to the item, so the caller can free it if it
+       so desires.  If a match is not found, returns NULL.
+    -------------------------------------------------------------------- **/
+void *delete_from_list(list_ptr lp, void *item)
+{
+    list_ptr new_next;
+
+    while (lp->next) {
+       if (lp->next->ptr.item == item) {
+           new_next = lp->next->next;
+           free (lp->next);
+           lp->next = new_next;
+
+           return item;
+       }
+       lp = lp->next;
+    }
+
+    return NULL;
+}
+
+
+/** ------------------------------------------------------------------------
+       Deletes each node in the list *except the head*.  This allows
+       the deletion of lists where the head is not malloced or created
+       with new_list().  If free_items is true, each item pointed to 
+       from the node is freed, in addition to the node itself.
+    -------------------------------------------------------------------- **/
+void delete_list(list_ptr lp, int free_items)
+{
+    list_ptr del_node;
+    void *item;
+
+    while (lp->next) {
+       del_node = lp->next;
+       item = del_node->ptr.item;
+       lp->next = del_node->next;
+       free (del_node);
+       if (free_items) {
+           free( item);
+       }
+    }
+}
+
+void delete_list_destroying(list_ptr lp, void destructor(void *item))
+{
+    list_ptr del_node;
+    void *item;
+
+    while (lp->next) {
+       del_node = lp->next;
+       item = del_node->ptr.item;
+       lp->next = del_node->next;
+       free( del_node);
+       if (destructor) {
+           destructor( item);
+       }
+    }
+}
+
+
+/** ------------------------------------------------------------------------
+       Returns a ptr to the first *item* (not list node) in the list.
+       Sets the list head node's curr ptr to the first node in the list.
+       Returns NULL if the list is empty.
+    -------------------------------------------------------------------- **/
+void * first_in_list(list_ptr lp)
+{
+    if (! lp) {
+
+       return NULL;
+    }
+    lp->ptr.curr = lp->next;
+
+    return lp->ptr.curr ? lp->ptr.curr->ptr.item : NULL;
+}
+
+/** ------------------------------------------------------------------------
+       Returns a ptr to the next *item* (not list node) in the list.
+       Sets the list head node's curr ptr to the next node in the list.
+       first_in_list must have been called prior.
+       Returns NULL if no next item.
+    -------------------------------------------------------------------- **/
+void * next_in_list(list_ptr lp)
+{
+    if (! lp) {
+
+       return NULL;
+    }
+    if (lp->ptr.curr) {
+       lp->ptr.curr = lp->ptr.curr->next;
+    }
+
+    return lp->ptr.curr ? lp->ptr.curr->ptr.item : NULL;
+}
+
+int list_is_empty(list_ptr lp)
+{
+    return (lp == NULL || lp->next == NULL);
+}
+
diff --git a/xwd/list.h b/xwd/list.h
new file mode 100755 (executable)
index 0000000..a2b3622
--- /dev/null
@@ -0,0 +1,93 @@
+/** ------------------------------------------------------------------------
+       This file contains routines for manipulating generic lists.
+       Lists are implemented with a "harness".  In other words, each
+       node in the list consists of two pointers, one to the data item
+       and one to the next node in the list.  The head of the list is
+       the same struct as each node, but the "item" ptr is used to point
+       to the current member of the list (used by the first_in_list and
+       next_in_list functions).
+
+Copyright 1994 Hewlett-Packard Co.
+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.
+
+    -------------------------------------------------------------------- **/
+
+#ifndef LIST_DEF
+#define LIST_DEF
+
+#include <X11/Xfuncproto.h>
+#define LESS   -1
+#define EQUAL  0
+#define GREATER        1
+#define DUP_WHOLE_LIST 0
+#define START_AT_CURR  1
+
+typedef struct _list_item {
+    struct _list_item *next;
+    union {
+       void *item;              /* in normal list node, pts to data */
+       struct _list_item *curr; /* in list head, pts to curr for 1st, next */
+    } ptr;
+} list, list_item, *list_ptr;
+
+typedef void (*DESTRUCT_FUNC_PTR)(
+void *
+);
+
+void zero_list( 
+          list_ptr 
+    );
+int add_to_list (
+          list_ptr , void *
+    );
+list_ptr new_list (
+          void
+    );
+list_ptr dup_list_head (
+          list_ptr , int 
+    );
+unsigned int list_length( 
+          list_ptr 
+    );
+void *delete_from_list (
+          list_ptr , void *
+    );
+void delete_list( 
+          list_ptr , int 
+    );
+void delete_list_destroying (
+          list_ptr , DESTRUCT_FUNC_PTR
+    );
+void *first_in_list (
+          list_ptr 
+    );
+void *next_in_list (
+          list_ptr 
+    );
+int list_is_empty (
+          list_ptr 
+    );
+
+#endif
diff --git a/xwd/missing b/xwd/missing
new file mode 100755 (executable)
index 0000000..28055d2
--- /dev/null
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# 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=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+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'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  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]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
+# 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).  This is about non-GNU programs, so use $1 not
+# $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 $program 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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if test ! -f y.tab.h; then
+       echo >y.tab.h
+    fi
+    if test ! -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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if test ! -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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit $?
+    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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+       /^@setfilename/{
+         s/.* \([^ ]*\) *$/\1/
+         p
+         q
+       }' $infile`
+      # ... 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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xwd/multiVis.c b/xwd/multiVis.c
new file mode 100755 (executable)
index 0000000..7ac5780
--- /dev/null
@@ -0,0 +1,1174 @@
+/** ------------------------------------------------------------------------
+       This file contains functions to create a list of regions which
+       tile a specified window.  Each region contains all visible 
+       portions of the window which are drawn with the same visual.
+       If the window consists of subwindows of two different visual types,
+       there will be two regions in the list.  The list can be traversed
+       to correctly pull an image of the window using XGetImage or the
+       Image Library.
+
+Copyright 1994 Hewlett-Packard Co.
+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.
+
+    ------------------------------------------------------------------------ **/
+
+#include <stdlib.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/X.h>
+#include <stdio.h>
+#include "list.h"
+#include "wsutils.h"
+#include "multiVis.h"
+/* These structures are copied from X11/region.h.  For some reason
+ * they're invisible from the outside.
+ */
+typedef struct {
+    short x1, x2, y1, y2;
+} myBox, myBOX, myBoxRec, *myBoxPtr;
+
+typedef struct my_XRegion {
+    long size;
+    long numRects;
+    myBOX *rects;
+    myBOX extents;
+} myREGION;
+
+/* Items in long list of windows that have some part in the grabbed area */
+typedef struct {
+    Window win;
+    Visual *vis;
+    Colormap cmap;
+    int x_rootrel, y_rootrel;  /* root relative location of window */
+    int x_vis, y_vis;                  /* rt rel x,y of vis part, not parent clipped */
+    int width, height;                 /* width and height of visible part */
+    int border_width;          /* border width of the window */
+    Window parent;             /* id of parent (for debugging) */
+} image_win_type;
+
+/*  Items in short list of regions that tile the grabbed area.  May have 
+    multiple windows in the region.
+*/
+typedef struct {
+    Window win;                        /* lowest window of this visual */
+    Visual *vis;
+    Colormap cmap;
+    int x_rootrel, y_rootrel;  /* root relative location of bottom window */
+    int x_vis, y_vis;                  /* rt rel x,y of vis part, not parent clipped */
+    int width, height;         /* w & h of visible rect of bottom window */
+    int border;                        /* border width of the window */
+    Region visible_region;
+} image_region_type;
+
+/** ------------------------------------------------------------------------
+       Returns TRUE if the two structs pointed to have the same "vis" & 
+       "cmap" fields and s2 lies completely within s1.  s1 and s2 can
+       point to structs of image_win_type or image_region_type.
+    ------------------------------------------------------------------------ **/
+#define SAME_REGIONS( s1, s2)  \
+       ((s1)->vis == (s2)->vis && (s1)->cmap == (s2)->cmap &&          \
+        (s1)->x_vis <= (s2)->x_vis &&                              \
+        (s1)->y_vis <= (s2)->y_vis &&                              \
+        (s1)->x_vis + (s1)->width  >= (s2)->x_vis + (s2)->width && \
+        (s1)->y_vis + (s1)->height >= (s2)->y_vis + (s2)->height)
+
+#ifndef MIN
+#define MIN( a, b)     ((a) < (b) ? a : b)
+#define MAX( a, b)     ((a) > (b) ? a : b)
+#endif
+
+#define        RED_SHIFT        16
+#define GREEN_SHIFT       8
+#define BLUE_SHIFT        0
+
+/*
+extern list_ptr        new_list();
+extern list_ptr        dup_list_head();
+extern void *  first_in_list();
+extern void *  next_in_list();
+extern int     add_to_list();
+extern void    zero_list();
+extern void    delete_list();
+extern void    delete_list_destroying();
+extern unsigned int list_length();
+*/
+
+/* Prototype Declarations for Static Functions */
+static int QueryColorMap(
+           Display *, Colormap , Visual *, 
+           XColor **, int *, int *, int *
+          );
+static void TransferImage(
+           Display *, XImage *,int, int , image_region_type*,
+           XImage *,int ,int 
+          );
+static XImage * ReadRegionsInList(
+           Display *, Visual *, int ,int ,int ,
+           int , XRectangle, list_ptr 
+           );
+
+static list_ptr make_region_list( 
+                  Display*, Window, XRectangle*,
+                  int*, int, XVisualInfo**, int        *
+         );
+
+static void destroy_region_list( 
+            list_ptr 
+            ) ;
+static void subtr_rect_from_image_region( 
+           image_region_type *, int , int , int , int 
+     );
+static void add_rect_to_image_region( 
+           image_region_type *,
+           int , int , int , int 
+     );
+static int src_in_region_list( 
+    image_win_type *, list_ptr 
+    );
+static void add_window_to_list(
+    list_ptr, Window, int, int ,
+    int        , int , int , int, int,
+    Visual*, Colormap, Window
+    );
+static int src_in_image( 
+    image_win_type     *, int  , XVisualInfo**
+    );
+static int src_in_overlay( 
+    image_region_type *, int, OverlayInfo *, int*, int*
+    );
+static void make_src_list(
+    Display *, list_ptr, XRectangle *, Window,
+    int, int, XWindowAttributes *, XRectangle *
+);
+static void destroy_image_region(
+    image_region_type *
+);
+
+/* End of Prototype Declarations */
+
+void initFakeVisual(Visual *Vis)
+{
+    Vis->ext_data=NULL;
+    Vis->class = DirectColor ;
+    Vis->red_mask =   0x00FF0000;
+    Vis->green_mask = 0x0000FF00 ;
+    Vis->blue_mask  = 0x000000FF ;
+    Vis->map_entries = 256 ;
+    Vis->bits_per_rgb = 8 ;
+}
+
+static int
+QueryColorMap(Display *disp, Colormap src_cmap, Visual *src_vis,
+             XColor **src_colors, int *rShift, int *gShift, int *bShift)
+{
+     int ncolors,i ;
+     unsigned long       redMask, greenMask, blueMask;
+     int                 redShift, greenShift, blueShift;
+     XColor *colors ;
+
+     ncolors = src_vis->map_entries ;
+     *src_colors = colors = (XColor *)malloc(ncolors * sizeof(XColor) ) ;
+
+     if(src_vis->class != TrueColor && src_vis->class != DirectColor)
+     {
+         for(i=0 ; i < ncolors ; i++)
+         {
+               colors[i].pixel = i ;
+                colors[i].pad = 0;
+                colors[i].flags = DoRed|DoGreen|DoBlue;
+         }
+     }
+     else /** src is decomposed rgb ***/
+     {
+        /* Get the X colormap */
+        redMask = src_vis->red_mask;
+        greenMask = src_vis->green_mask;
+        blueMask = src_vis->blue_mask;
+        redShift = 0; while (!(redMask&0x1)) {
+                redShift++;
+                redMask = redMask>>1;
+        }
+        greenShift = 0; while (!(greenMask&0x1)) {
+                greenShift++;
+                greenMask = greenMask>>1;
+        }
+        blueShift = 0; while (!(blueMask&0x1)) {
+                blueShift++;
+                blueMask = blueMask>>1;
+        }
+       *rShift = redShift ;
+       *gShift = greenShift ;
+       *bShift = blueShift ;
+        for (i=0; i<ncolors; i++) {
+               if( i <= redMask)colors[i].pixel = (i<<redShift) ;
+               if( i <= greenMask)colors[i].pixel |= (i<<greenShift) ;
+               if( i <= blueMask)colors[i].pixel |= (i<<blueShift) ;
+               /***** example :for gecko's 3-3-2 map, blue index should be <= 3.
+                colors[i].pixel = (i<<redShift)|(i<<greenShift)|(i<<blueShift);
+               *****/
+                colors[i].pad = 0;
+                colors[i].flags = DoRed|DoGreen|DoBlue;
+        }
+      }
+
+
+      XQueryColors(disp, src_cmap, colors, ncolors);
+      return ncolors ;
+}
+
+int
+GetMultiVisualRegions(Display *disp,
+                     /* root win on which grab was done */
+                     Window srcRootWinid,
+                     /* root rel UL corner of bounding box of grab */
+                     int x, int y,
+                     /* size of bounding box of grab */
+                     unsigned int width, unsigned int height,
+                     int *transparentOverlays, int *numVisuals,
+                     XVisualInfo **pVisuals, int *numOverlayVisuals,
+                     OverlayInfo **pOverlayVisuals,
+                     int *numImageVisuals, XVisualInfo ***pImageVisuals,
+                     /* list of regions to read from */
+                     list_ptr *vis_regions,
+                     list_ptr *vis_image_regions, int *allImage)
+{
+    int                 hasNonDefault;
+    XRectangle          bbox;           /* bounding box of grabbed area */
+
+
+    bbox.x = x;                 /* init X rect for bounding box */
+    bbox.y = y;
+    bbox.width = width;
+    bbox.height = height;
+
+    GetXVisualInfo(disp,DefaultScreen(disp),
+                    transparentOverlays,
+                    numVisuals, pVisuals,
+                    numOverlayVisuals, pOverlayVisuals,
+                    numImageVisuals, pImageVisuals);
+
+    *vis_regions = *vis_image_regions = NULL ;
+    if ((*vis_regions = make_region_list( disp, srcRootWinid, &bbox,
+                                         &hasNonDefault, *numImageVisuals,
+                                         *pImageVisuals, allImage)) == NULL) 
+       return 0 ;
+   
+    if (*transparentOverlays)
+    {
+        *allImage = 1; /* until proven otherwise,
+                         this flags that it to be an image only list */
+        *vis_image_regions =
+                make_region_list( disp, srcRootWinid, &bbox, &hasNonDefault,
+                                        *numImageVisuals, *pImageVisuals, allImage);
+    }
+
+    /* if there is a second region in any of the two lists return 1 **/
+    if ( ( *vis_regions && (*vis_regions)->next && (*vis_regions)->next->next ) ||
+         ( *vis_image_regions && (*vis_image_regions)->next && 
+           (*vis_image_regions)->next->next ) ) return 1 ;
+    else return 0 ;
+
+}
+
+static void TransferImage(Display *disp, XImage *reg_image,
+                         int srcw, int srch,
+                         image_region_type *reg, XImage *target_image,
+                         int dst_x, int dst_y)
+{
+    int i,j,old_pixel,new_pixel,red_ind,green_ind,blue_ind ;
+    XColor *colors;
+    int rShift,gShift,bShift;
+
+    (void) QueryColorMap(disp,reg->cmap,reg->vis,&colors,
+        &rShift,&gShift,&bShift) ;
+
+    switch (reg->vis->class) {
+    case TrueColor : 
+       for(i=0 ; i < srch ; i++)
+       {
+         for(j=0 ; j < srcw ;  j++)
+         {
+          old_pixel = XGetPixel(reg_image,j,i) ;
+
+           if( reg->vis->map_entries == 16) {
+       
+                 red_ind = (old_pixel & reg->vis->red_mask) >> rShift ;
+                green_ind = (old_pixel & reg->vis->green_mask) >> gShift ;
+                blue_ind = (old_pixel & reg->vis->blue_mask) >> bShift ;
+
+                new_pixel = ( 
+                             ((colors[red_ind].red >> 8) << RED_SHIFT)
+                             |((colors[green_ind].green >> 8) << GREEN_SHIFT)
+                             |((colors[blue_ind].blue >> 8) << BLUE_SHIFT)
+                             );
+           }
+          else  
+               new_pixel = old_pixel;
+
+           XPutPixel(target_image,dst_x+j, dst_y+i,new_pixel);
+          
+         }
+       }
+       break;
+    case DirectColor :
+       for(i=0 ; i < srch ; i++)
+       {
+        
+         for(j=0 ; j < srcw ;  j++)
+         {
+          old_pixel = XGetPixel(reg_image,j,i) ;
+           red_ind = (old_pixel & reg->vis->red_mask) >> rShift ;
+          green_ind = (old_pixel & reg->vis->green_mask) >> gShift ;
+          blue_ind = (old_pixel & reg->vis->blue_mask) >> bShift ;
+       
+          new_pixel = ( 
+                        ((colors[red_ind].red >> 8) << RED_SHIFT)
+                       |((colors[green_ind].green >> 8) << GREEN_SHIFT)
+                       |((colors[blue_ind].blue >> 8) << BLUE_SHIFT)
+                       );
+           XPutPixel(target_image,dst_x+j, dst_y+i,new_pixel);
+          
+         }
+       }
+       break;
+    default :
+       for(i=0 ; i < srch ; i++)
+       {
+         for(j=0 ; j < srcw ;  j++)
+         {
+           old_pixel = XGetPixel(reg_image,j,i) ;
+       
+          new_pixel = ( 
+                        ((colors[old_pixel].red >> 8) << RED_SHIFT)
+                       |((colors[old_pixel].green >> 8) << GREEN_SHIFT)
+                       |((colors[old_pixel].blue >> 8) << BLUE_SHIFT)
+                       );
+           XPutPixel(target_image,dst_x+j, dst_y+i,new_pixel);
+         
+         }
+       }
+       break;
+    }
+}
+
+static XImage *
+ReadRegionsInList(Display *disp, Visual *fakeVis, int depth, int format,
+                 int width,int height,
+                 XRectangle bbox,      /* bounding box of grabbed area */
+                 list_ptr regions)     /* list of regions to read from */
+{
+    image_region_type  *reg;
+    int                        dst_x, dst_y;   /* where in pixmap to write (UL) */
+    int                        diff;
+
+    XImage             *reg_image,*ximage ;
+    int                        srcRect_x,srcRect_y,srcRect_width,srcRect_height ;
+    int                 rem ;  
+    int                 bytes_per_line;   
+    int                 bitmap_unit; 
+    
+    bitmap_unit = sizeof (long);
+    if (format == ZPixmap)
+       bytes_per_line = width*depth/8;
+    else
+       bytes_per_line = width/8;
+   
+
+    /* Find out how many more bytes are required for padding so that
+    ** bytes per scan line will be multiples of bitmap_unit bits */
+    if (format == ZPixmap) {
+       rem = (bytes_per_line*8)%bitmap_unit; 
+    if (rem)
+       bytes_per_line += (rem/8 + 1);
+    }
+
+    ximage = XCreateImage(disp,fakeVis,depth,format,0,NULL,width,height,
+                8,0) ;
+    bytes_per_line = ximage->bytes_per_line;
+
+    if (format == ZPixmap)
+         ximage->data = malloc(height*bytes_per_line);
+    else
+        ximage->data = malloc(height*bytes_per_line*depth);
+
+    ximage->bits_per_pixel = depth; /** Valid only if format is ZPixmap ***/
+    
+    for (reg = (image_region_type *) first_in_list( regions); reg;
+        reg = (image_region_type *) next_in_list( regions)) 
+    {
+               int rect;
+               struct my_XRegion *vis_reg;
+               vis_reg = (struct my_XRegion *)(reg->visible_region);
+               for (rect = 0; 
+                    rect < vis_reg->numRects;
+                    rect++)
+               {
+               /** ------------------------------------------------------------------------
+                       Intersect bbox with visible part of region giving src rect & output 
+                       location.  Width is the min right side minus the max left side.
+                       Similar for height.  Offset src rect so x,y are relative to
+                       origin of win, not the root-relative visible rect of win.
+                   ------------------------------------------------------------------------ **/
+                   srcRect_width  = MIN( vis_reg->rects[rect].x2, bbox.width + bbox.x) - 
+                                    MAX( vis_reg->rects[rect].x1, bbox.x);
+                   srcRect_height = MIN( vis_reg->rects[rect].y2, bbox.height + bbox.y) - 
+                                    MAX( vis_reg->rects[rect].y1, bbox.y);
+                   diff = bbox.x - vis_reg->rects[rect].x1;
+                   srcRect_x = MAX( 0, diff)  + (vis_reg->rects[rect].x1 - reg->x_rootrel - reg->border);
+                   dst_x     = MAX( 0, -diff) ;
+                   diff = bbox.y - vis_reg->rects[rect].y1;
+                   srcRect_y = MAX( 0, diff)  + (vis_reg->rects[rect].y1 - reg->y_rootrel - reg->border);
+                   dst_y     = MAX( 0, -diff) ;
+                    reg_image = XGetImage(disp,reg->win,srcRect_x,srcRect_y,
+                               srcRect_width,srcRect_height,AllPlanes,format) ;
+                   TransferImage(disp,reg_image,srcRect_width,
+                                srcRect_height,reg,ximage,dst_x,dst_y) ;
+           }
+    }
+    return ximage ;
+}
+
+
+/** ------------------------------------------------------------------------
+    ------------------------------------------------------------------------ **/
+
+XImage *ReadAreaToImage(Display *disp,
+                       /* root win on which grab was done */
+                       Window srcRootWinid,
+                       /* root rel UL corner of bounding box of grab */
+                       int x, int y,
+                       /* size of bounding box of grab */
+                       unsigned int width, unsigned int height, 
+                       int numVisuals, XVisualInfo *pVisuals,
+                       int numOverlayVisuals, OverlayInfo *pOverlayVisuals,
+                       int numImageVisuals, XVisualInfo **pImageVisuals,
+                       /* list of regions to read from */
+                       list_ptr vis_regions,
+                       /* list of regions to read from */
+                       list_ptr vis_image_regions,
+                       int format, int allImage)
+{
+    image_region_type  *reg;
+    XRectangle         bbox;           /* bounding box of grabbed area */
+    int                depth ;
+    XImage             *ximage, *ximage_ipm = NULL;
+    Visual             fakeVis ;
+    int        x1, y1;
+    XImage     *image;
+#if 0
+    unsigned char      *pmData ,  *ipmData ;
+#endif
+    int                 transparentColor, transparentType;
+    int                        srcRect_x,srcRect_y,srcRect_width,srcRect_height ;
+    int                        diff ;
+    int                        dst_x, dst_y;   /* where in pixmap to write (UL) */
+    int                        pixel;
+
+    bbox.x = x;                        /* init X rect for bounding box */
+    bbox.y = y;
+    bbox.width = width;
+    bbox.height = height;
+
+
+    initFakeVisual(&fakeVis) ;
+
+    depth = 24 ;
+    ximage = ReadRegionsInList(disp,&fakeVis,depth,format,width,height,
+            bbox,vis_regions) ;
+#if 0
+    pmData = (unsigned char *)ximage -> data ;
+#endif
+
+/* if transparency possible do it again, but this time for image planes only */
+    if (vis_image_regions && (vis_image_regions->next) && !allImage)
+    {
+       ximage_ipm = ReadRegionsInList(disp,&fakeVis,depth,format,width,height,
+                    bbox,vis_image_regions) ;
+#if 0
+        ipmData = (unsigned char *)ximage_ipm -> data ;
+#endif
+    }
+/* Now tranverse the overlay visual windows and test for transparency index.  */
+/* If you find one, subsitute the value from the matching image plane pixmap. */
+
+    for (reg = (image_region_type *) first_in_list( vis_regions); reg;
+        reg = (image_region_type *) next_in_list( vis_regions))
+    {
+
+       if (src_in_overlay( reg, numOverlayVisuals, pOverlayVisuals,
+                                &transparentColor, &transparentType))
+       {
+       int test = 0 ;
+            srcRect_width  = MIN( reg->width + reg->x_vis, bbox.width + bbox.x)
+                                - MAX( reg->x_vis, bbox.x);
+            srcRect_height = MIN( reg->height + reg->y_vis, bbox.height 
+                                + bbox.y) - MAX( reg->y_vis, bbox.y);
+             diff = bbox.x - reg->x_vis;
+             srcRect_x = MAX( 0, diff)  + (reg->x_vis - reg->x_rootrel - reg->border);
+             dst_x     = MAX( 0, -diff) ;
+            diff = bbox.y - reg->y_vis;
+            srcRect_y = MAX( 0, diff)  + (reg->y_vis - reg->y_rootrel - reg->border);
+            dst_y     = MAX( 0, -diff) ;
+       /* let's test some pixels for transparency */
+             image = XGetImage(disp, reg->win, srcRect_x, srcRect_y, 
+                srcRect_width, srcRect_height, 0xffffffff, ZPixmap);
+
+        /* let's assume byte per pixel for overlay image for now */
+            if ((image->depth == 8) && (transparentType == TransparentPixel))
+            {
+                unsigned char *pixel_ptr;
+                unsigned char *start_of_line = (unsigned char *) image->data;
+
+                for (y1 = 0; y1 < srcRect_height; y1++) {
+                   pixel_ptr = start_of_line;
+                   for (x1 = 0; x1 < srcRect_width; x1++)
+                   {
+                       if (*pixel_ptr++ == transparentColor)
+                       {
+#if 0
+                           *pmData++ = *ipmData++;
+                           *pmData++ = *ipmData++;
+                           *pmData++ = *ipmData++;
+#endif
+                       pixel = XGetPixel(ximage_ipm,dst_x+x1,dst_y+y1) ;
+                        XPutPixel(ximage,dst_x+x1, dst_y+y1,pixel);
+                           
+                       if(!test){
+                          test = 1 ;
+                       }
+                       }
+#if 0
+                       else {
+                           pmData +=3;
+                           ipmData +=3;
+                       }
+#endif
+                   }
+                   start_of_line += image->bytes_per_line;
+               }
+       } else {
+               if (transparentType == TransparentPixel) {
+               for (y1 = 0; y1 < srcRect_height; y1++) {
+                     for (x1 = 0; x1 < srcRect_width; x1++)
+                     {
+                           int pixel_value = XGetPixel(image, x1, y1);
+                           if (pixel_value == transparentColor)
+                           {
+#if 0
+                               *pmData++ = *ipmData++;
+                               *pmData++ = *ipmData++;
+                               *pmData++ = *ipmData++;
+#endif
+                       pixel = XGetPixel(ximage_ipm,dst_x+x1,dst_y+y1) ;
+                        XPutPixel(ximage,dst_x+x1, dst_y+y1,pixel);
+                       if(!test){
+                          test = 1 ;
+                       }
+                           }
+#if 0
+                           else {
+                               pmData +=3;
+                               ipmData +=3;
+                           }
+#endif
+                       }
+                   }
+               } else {
+                   for (y1 = 0; y1 < srcRect_height; y1++) {
+                       for (x1 = 0; x1 < srcRect_width; x1++)
+                       {
+                           int pixel_value = XGetPixel(image, x1, y1);
+                           if (pixel_value & transparentColor)
+                           {
+#if 0
+                               *pmData++ = *ipmData++;
+                               *pmData++ = *ipmData++;
+                               *pmData++ = *ipmData++;
+#endif
+                               pixel = XGetPixel(ximage_ipm,dst_x+x1,dst_y+y1) ;
+                                XPutPixel(ximage,dst_x+x1, dst_y+y1,pixel);
+                       if(!test){
+                          test = 1 ;
+                       }
+                           }
+#if 0
+                           else {
+                               pmData +=3;
+                               ipmData +=3;
+                           }
+#endif
+                       }
+                   }
+               }
+       }
+        XDestroyImage (image);
+      }        /* end of src_in_overlay */
+    } /** end transparency **/
+    destroy_region_list( vis_regions);
+    if (vis_image_regions) destroy_region_list( vis_image_regions );
+    FreeXVisualInfo(pVisuals, pOverlayVisuals, pImageVisuals);
+    XSync(disp, 0);
+
+    return ximage;
+}
+
+/** ------------------------------------------------------------------------
+       Creates a list of the subwindows of a given window which have a
+       different visual than their parents.  The function is recursive.
+       This list is used in make_region_list(), which coalesces the
+       windows with the same visual into a region.
+       image_wins must point to an existing list struct that's already
+       been zeroed (zero_list()).
+    ------------------------------------------------------------------------ **/
+static void make_src_list(Display *disp, list_ptr image_wins,
+                         /* bnding box of area we want */
+                         XRectangle *bbox,
+                         Window curr,
+                         /* pos of curr WRT root */
+                         int x_rootrel, int y_rootrel,
+                         XWindowAttributes *curr_attrs,
+                         /* visible part of curr, not obscurred by ancestors */
+                         XRectangle *pclip)
+{
+    XWindowAttributes child_attrs;
+    Window root, parent, *child;       /* variables for XQueryTree() */
+    Window *save_child_list;           /* variables for XQueryTree() */
+    unsigned int nchild;               /* variables for XQueryTree() */
+    XRectangle child_clip;             /* vis part of child */
+    int curr_clipX, curr_clipY, curr_clipRt, curr_clipBt;
+
+    /* check that win is mapped & not outside bounding box */
+    if (curr_attrs->map_state == IsViewable &&
+       curr_attrs->class == InputOutput &&
+       !( pclip->x >= (int) (bbox->x + bbox->width)    ||
+          pclip->y >= (int) (bbox->y + bbox->height)   ||
+          (int) (pclip->x + pclip->width)  <= bbox->x  ||
+          (int) (pclip->y + pclip->height) <= bbox->y)) {
+
+       XQueryTree( disp, curr, &root, &parent, &child, &nchild );
+       save_child_list = child;      /* so we can free list when we're done */
+       add_window_to_list( image_wins, curr, x_rootrel, y_rootrel, 
+                           pclip->x, pclip->y, 
+                           pclip->width, pclip->height, 
+                           curr_attrs->border_width,curr_attrs->visual, 
+                           curr_attrs->colormap, parent);
+
+       
+/** ------------------------------------------------------------------------
+       set RR coords of right (Rt), left (X), bottom (Bt) and top (Y)
+       of rect we clip all children by.  This is our own clip rect (pclip)
+       inflicted on us by our parent plus our own borders.  Within the
+       child loop, we figure the clip rect for each child by adding in
+       it's rectangle (not taking into account the child's borders).
+    ------------------------------------------------------------------------ **/
+       curr_clipX = MAX( pclip->x, x_rootrel + (int) curr_attrs->border_width);
+       curr_clipY = MAX( pclip->y, y_rootrel + (int) curr_attrs->border_width);
+       curr_clipRt = MIN( pclip->x + (int) pclip->width,
+                          x_rootrel + (int) curr_attrs->width + 
+                          2 * (int) curr_attrs->border_width);
+       curr_clipBt = MIN( pclip->y + (int) pclip->height,
+                          y_rootrel + (int) curr_attrs->height + 
+                          2 * (int) curr_attrs->border_width);
+
+       while (nchild--) {
+           int new_width, new_height;
+           int child_xrr, child_yrr;   /* root relative x & y of child */
+
+           XGetWindowAttributes( disp, *child, &child_attrs);
+
+           /* intersect parent & child clip rects */
+           child_xrr = x_rootrel + child_attrs.x + curr_attrs->border_width;
+           child_clip.x = MAX( curr_clipX, child_xrr);
+           new_width = MIN( curr_clipRt, child_xrr + (int) child_attrs.width
+                            + 2 * child_attrs.border_width)
+                       - child_clip.x;
+           if (new_width >= 0) {
+               child_clip.width = new_width;
+
+               child_yrr = y_rootrel + child_attrs.y + 
+                           curr_attrs->border_width;
+               child_clip.y = MAX( curr_clipY, child_yrr);
+               new_height = MIN( curr_clipBt, 
+                                 child_yrr + (int) child_attrs.height + 
+                                     2 * child_attrs.border_width) 
+                            - child_clip.y;
+               if (new_height >= 0) {
+                   child_clip.height = new_height;
+                   make_src_list( disp, image_wins, bbox, *child, 
+                                  child_xrr, child_yrr, 
+                                  &child_attrs, &child_clip);
+               }
+           }
+           child++;
+       }
+       XFree( save_child_list);
+    }
+}
+
+
+/** ------------------------------------------------------------------------
+       This function creates a list of regions which tile a specified
+       window.  Each region contains all visible portions of the window
+       which are drawn with the same visual.  For example, if the
+       window consists of subwindows of two different visual types,
+       there will be two regions in the list.  
+       Returns a pointer to the list.
+    ------------------------------------------------------------------------ **/
+static list_ptr make_region_list(Display *disp, Window win, XRectangle *bbox,
+                                int *hasNonDefault, int numImageVisuals,
+                                XVisualInfo **pImageVisuals, int *allImage)
+{
+    XWindowAttributes  win_attrs;
+    list               image_wins;
+    list_ptr           image_regions;
+    list_ptr           srcs_left;
+    image_region_type  *new_reg;
+    image_win_type     *base_src, *src;
+    Region             bbox_region = XCreateRegion();
+    XRectangle         clip;
+    int                        image_only;
+
+    int                 count=0 ; 
+    
+    *hasNonDefault = False;
+    XUnionRectWithRegion( bbox, bbox_region, bbox_region);
+    XGetWindowAttributes( disp, win, &win_attrs);
+
+    zero_list( &image_wins);
+    clip.x = 0;
+    clip.y = 0;
+    clip.width  = win_attrs.width;
+    clip.height = win_attrs.height;
+    make_src_list( disp, &image_wins, bbox, win, 
+                  0 /* x_rootrel */, 0 /* y_rootrel */, &win_attrs, &clip);
+
+    image_regions = new_list();
+    image_only = (*allImage) ? True:False; 
+
+    for (base_src = (image_win_type *) first_in_list( &image_wins); base_src;
+        base_src = (image_win_type *) next_in_list( &image_wins)) 
+    {
+       /* test for image visual */
+       if (!image_only || src_in_image(base_src, numImageVisuals, pImageVisuals))
+       {
+           /* find a window whose visual hasn't been put in list yet */
+           if (!src_in_region_list( base_src, image_regions))
+           {
+               if (! (new_reg = (image_region_type *) 
+                                       malloc( sizeof( image_region_type)))) {
+                   return (list_ptr) NULL;
+               }
+               count++;  
+               
+               new_reg->visible_region = XCreateRegion();
+               new_reg->win            = base_src->win;
+               new_reg->vis            = base_src->vis;
+               new_reg->cmap           = base_src->cmap;
+               new_reg->x_rootrel      = base_src->x_rootrel;
+               new_reg->y_rootrel      = base_src->y_rootrel;
+               new_reg->x_vis          = base_src->x_vis;
+               new_reg->y_vis          = base_src->y_vis;
+               new_reg->width          = base_src->width;
+               new_reg->height         = base_src->height;
+               new_reg->border         = base_src->border_width;
+               
+               srcs_left = (list_ptr) dup_list_head( &image_wins, START_AT_CURR);
+               for (src = (image_win_type *) first_in_list( srcs_left); src;
+                    src = (image_win_type *) next_in_list( srcs_left)) {
+                   if (SAME_REGIONS( base_src, src)) {
+                       add_rect_to_image_region( new_reg, src->x_vis, src->y_vis, 
+                                                 src->width, src->height);
+                   }
+                   else {
+                       if (!image_only || src_in_image(src, numImageVisuals, pImageVisuals))
+                       { 
+                           subtr_rect_from_image_region( new_reg, src->x_vis,
+                                         src->y_vis, src->width, src->height);
+                       } 
+                   }
+               }
+               XIntersectRegion( bbox_region, new_reg->visible_region, 
+                                 new_reg->visible_region);
+               if (! XEmptyRegion( new_reg->visible_region)) {
+                   add_to_list( image_regions, new_reg);
+                   if (new_reg->vis != DefaultVisualOfScreen( win_attrs.screen) ||
+                       new_reg->cmap != DefaultColormapOfScreen( 
+                                                           win_attrs.screen)) {
+                       *hasNonDefault = True;
+                   }
+               }
+               else {
+                   XDestroyRegion( new_reg->visible_region);
+                   free( (void *) new_reg);
+               }
+           }
+       } else *allImage = 0;
+    }
+    delete_list( &image_wins, True);
+    XDestroyRegion( bbox_region);
+    return image_regions;
+}
+/** ------------------------------------------------------------------------
+       Destructor called from destroy_region_list().
+    ------------------------------------------------------------------------ **/
+static void destroy_image_region(image_region_type *image_region)
+{
+    XDestroyRegion( image_region->visible_region);
+    free( (void *) image_region);
+}
+
+/** ------------------------------------------------------------------------
+       Destroys the region list, destroying all the regions contained in it.
+    ------------------------------------------------------------------------ **/
+static void destroy_region_list(list_ptr rlist)
+{
+    delete_list_destroying( rlist, (DESTRUCT_FUNC_PTR)destroy_image_region);
+}
+
+
+/** ------------------------------------------------------------------------
+       Subtracts the specified rectangle from the region in image_region.
+       First converts the rectangle to a region of its own, since X
+       only provides a way to subtract one region from another, not a
+       rectangle from a region.
+    ------------------------------------------------------------------------ **/
+static void subtr_rect_from_image_region(image_region_type *image_region,
+                                        int x, int y, int width, int height)
+{
+    XRectangle rect;
+    Region rect_region;
+
+    rect_region = XCreateRegion();
+    rect.x = x;
+    rect.y = y;
+    rect.width = width;
+    rect.height = height;
+    XUnionRectWithRegion( &rect, rect_region, rect_region);
+    XSubtractRegion( image_region->visible_region, rect_region, 
+                    image_region->visible_region);
+    XDestroyRegion( rect_region);
+}
+
+
+/** ------------------------------------------------------------------------
+       Adds the specified rectangle to the region in image_region.
+    ------------------------------------------------------------------------ **/
+static void add_rect_to_image_region(image_region_type *image_region,
+                                    int x, int y, int width, int height)
+{
+    XRectangle rect;
+
+    rect.x = x;
+    rect.y = y;
+    rect.width = width;
+    rect.height = height;
+    XUnionRectWithRegion( &rect, image_region->visible_region, 
+                         image_region->visible_region);
+}
+
+
+/** ------------------------------------------------------------------------
+       Returns TRUE if the given src's visual is already represented in
+       the image_regions list, FALSE otherwise.
+    ------------------------------------------------------------------------ **/
+static int src_in_region_list(image_win_type *src, list_ptr image_regions)
+{
+    image_region_type  *ir;
+
+    for (ir = (image_region_type *) first_in_list( image_regions); ir;
+        ir = (image_region_type *) next_in_list( image_regions)) {
+       if (SAME_REGIONS( ir, src)) {
+
+           return 1;
+       }
+    }
+
+    return 0;
+}
+
+
+/** ------------------------------------------------------------------------
+       Makes a new entry in image_wins with the given fields filled in.
+    ------------------------------------------------------------------------ **/
+static void add_window_to_list(list_ptr image_wins, Window w,
+                              int xrr, int yrr, int x_vis, int y_vis, 
+                              int width, int height, int border_width,
+                              Visual *vis, Colormap cmap, Window parent)
+{
+    image_win_type     *new_src;
+
+    if ((new_src = (image_win_type *) malloc( sizeof( image_win_type))) == NULL)
+
+       return;
+
+    new_src->win = w;
+    new_src->x_rootrel = xrr;
+    new_src->y_rootrel = yrr;
+    new_src->x_vis = x_vis;
+    new_src->y_vis = y_vis;
+    new_src->width = width;
+    new_src->height = height;
+    new_src->border_width = border_width;
+    new_src->vis = vis;
+    new_src->cmap = cmap;
+    new_src->parent = parent;
+    add_to_list( image_wins, new_src);
+}
+
+/** ------------------------------------------------------------------------
+       Returns TRUE if the given src's visual is in the image planes,
+       FALSE otherwise.
+    ------------------------------------------------------------------------ **/
+static int src_in_image(image_win_type *src, int numImageVisuals,
+                       XVisualInfo **pImageVisuals)
+{
+    int                i;
+
+    for (i = 0 ; i < numImageVisuals ; i++)
+    {
+       if (pImageVisuals[i]->visual == src->vis)
+           return 1;
+    }
+    return 0;
+}
+
+
+/** ------------------------------------------------------------------------
+       Returns TRUE if the given src's visual is in the overlay planes
+       and transparency is possible, FALSE otherwise.
+    ------------------------------------------------------------------------ **/
+static int src_in_overlay(image_region_type *src, int numOverlayVisuals,
+                         OverlayInfo *pOverlayVisuals, 
+                         int *transparentColor, int *transparentType)
+{
+    int                i;
+
+    for (i = 0 ; i < numOverlayVisuals ; i++)
+    {
+       if (((pOverlayVisuals[i].pOverlayVisualInfo)->visual == src->vis)
+               && (pOverlayVisuals[i].transparentType != None))
+       {
+           *transparentColor = pOverlayVisuals[i].value;
+           *transparentType = pOverlayVisuals[i].transparentType;
+           return 1;
+       }
+       
+       else {
+       }
+       
+    }
+    return 0;
+}
+
+
+/********************** from wsutils.c ******************************/
+
+/******************************************************************************
+ *
+ * This file contains a set of example utility procedures; procedures that can
+ * help a "window-smart" Starbase or PHIGS program determine information about
+ * a device, and create image and overlay plane windows.  To use these
+ * utilities, #include "wsutils.h" and compile this file and link the results
+ * with your program.
+ *
+ ******************************************************************************/
+
+
+
+#define STATIC_GRAY    0x01
+#define GRAY_SCALE     0x02
+#define PSEUDO_COLOR   0x04
+#define TRUE_COLOR     0x10
+#define DIRECT_COLOR   0x11
+
+
+static int     weCreateServerOverlayVisualsProperty = False;
+
+
+/******************************************************************************
+ *
+ * GetXVisualInfo()
+ *
+ * This routine takes an X11 Display, screen number, and returns whether the
+ * screen supports transparent overlays and three arrays:
+ *
+ *     1) All of the XVisualInfo struct's for the screen.
+ *     2) All of the OverlayInfo struct's for the screen.
+ *     3) An array of pointers to the screen's image plane XVisualInfo
+ *        structs.
+ *
+ * The code below obtains the array of all the screen's visuals, and obtains
+ * the array of all the screen's overlay visual information.  It then processes
+ * the array of the screen's visuals, determining whether the visual is an
+ * overlay or image visual.
+ *
+ * If the routine sucessfully obtained the visual information, it returns zero.
+ * If the routine didn't obtain the visual information, it returns non-zero.
+ *
+ ******************************************************************************/
+
+int GetXVisualInfo(/* Which X server (aka "display"). */
+                  Display *display,
+                  /* Which screen of the "display". */
+                  int screen,
+                  /* Non-zero if there's at least one overlay visual and
+                   * if at least one of those supports a transparent pixel. */
+                  int *transparentOverlays,
+                  /* Number of XVisualInfo struct's pointed to by pVisuals. */
+                  int *numVisuals,
+                  /* All of the device's visuals. */
+                  XVisualInfo **pVisuals,
+                  /* Number of OverlayInfo's pointed to by pOverlayVisuals.
+                   * If this number is zero, the device does not have
+                   * overlay planes. */
+                  int *numOverlayVisuals,
+                  /* The device's overlay plane visual information. */
+                  OverlayInfo  **pOverlayVisuals,
+                  /* Number of XVisualInfo's pointed to by pImageVisuals. */
+                  int *numImageVisuals,
+                  /* The device's image visuals. */
+                  XVisualInfo ***pImageVisuals)
+{
+    XVisualInfo        getVisInfo;             /* Paramters of XGetVisualInfo */
+    int                mask;
+    XVisualInfo        *pVis, **pIVis;         /* Faster, local copies */
+    OverlayInfo        *pOVis;
+    OverlayVisualPropertyRec   *pOOldVis;
+    int                nVisuals, nOVisuals;
+    Atom       overlayVisualsAtom;     /* Parameters for XGetWindowProperty */
+    Atom       actualType;
+    unsigned long numLongs, bytesAfter;
+    int                actualFormat; 
+    int                nImageVisualsAlloced;   /* Values to process the XVisualInfo */
+    int                imageVisual;            /* array */
+
+
+    /* First, get the list of visuals for this screen. */
+    getVisInfo.screen = screen;
+    mask = VisualScreenMask; 
+
+    *pVisuals = XGetVisualInfo(display, mask, &getVisInfo, numVisuals);
+    if ((nVisuals = *numVisuals) <= 0)
+    {
+       /* Return that the information wasn't sucessfully obtained: */
+       return(1);
+    }
+    pVis = *pVisuals;
+
+
+    /* Now, get the overlay visual information for this screen.  To obtain
+     * this information, get the SERVER_OVERLAY_VISUALS property.
+     */
+    overlayVisualsAtom = XInternAtom(display, "SERVER_OVERLAY_VISUALS", True);
+    if (overlayVisualsAtom != None)
+    {
+       /* Since the Atom exists, we can request the property's contents.  The
+        * do-while loop makes sure we get the entire list from the X server.
+        */
+       bytesAfter = 0;
+       numLongs = sizeof(OverlayVisualPropertyRec) / 4;
+       do
+       {
+           numLongs += bytesAfter * 4;
+           XGetWindowProperty(display, RootWindow(display, screen),
+                              overlayVisualsAtom, 0, numLongs, False,
+                              overlayVisualsAtom, &actualType, &actualFormat,
+                              &numLongs, &bytesAfter, (unsigned char**) pOverlayVisuals);
+       } while (bytesAfter > 0);
+
+
+       /* Calculate the number of overlay visuals in the list. */
+       *numOverlayVisuals = numLongs / (sizeof(OverlayVisualPropertyRec) / 4);
+    }
+    else
+    {
+       /* This screen doesn't have overlay planes. */
+       *numOverlayVisuals = 0;
+       *pOverlayVisuals = NULL;
+       *transparentOverlays = 0;
+    }
+
+
+    /* Process the pVisuals array. */
+    *numImageVisuals = 0;
+    nImageVisualsAlloced = 1;
+    pIVis = *pImageVisuals = (XVisualInfo **) malloc(sizeof(XVisualInfo *));
+    while (--nVisuals >= 0)
+    {
+       nOVisuals = *numOverlayVisuals;
+       pOVis = *pOverlayVisuals;
+       imageVisual = True;
+       while (--nOVisuals >= 0)
+       {
+           pOOldVis = (OverlayVisualPropertyRec *) pOVis;
+           if (pVis->visualid == pOOldVis->visualID)
+           {
+               imageVisual = False;
+               pOVis->pOverlayVisualInfo = pVis;
+               if (pOVis->transparentType == TransparentPixel)
+                   *transparentOverlays = 1;
+           }
+           pOVis++;
+       }
+       if (imageVisual)
+       {
+           if ((*numImageVisuals += 1) > nImageVisualsAlloced)
+           {
+               nImageVisualsAlloced++;
+               *pImageVisuals = (XVisualInfo **)
+                   realloc(*pImageVisuals, (nImageVisualsAlloced * sizeof(XVisualInfo *)));
+               pIVis = *pImageVisuals + (*numImageVisuals - 1);
+           }
+           *pIVis++ = pVis;
+       }
+       pVis++;
+    }
+
+
+    /* Return that the information was sucessfully obtained: */
+    return(0);
+
+} /* GetXVisualInfo() */
+
+
+/******************************************************************************
+ *
+ * FreeXVisualInfo()
+ *
+ * This routine frees the data that was allocated by GetXVisualInfo().
+ *
+ ******************************************************************************/
+
+void FreeXVisualInfo(XVisualInfo *pVisuals, OverlayInfo *pOverlayVisuals,
+                    XVisualInfo **pImageVisuals)
+{
+    XFree(pVisuals);
+    if (weCreateServerOverlayVisualsProperty)
+       free(pOverlayVisuals);
+    else
+       XFree(pOverlayVisuals);
+    free(pImageVisuals);
+
+} /* FreeXVisualInfo() */
diff --git a/xwd/multiVis.h b/xwd/multiVis.h
new file mode 100755 (executable)
index 0000000..271d787
--- /dev/null
@@ -0,0 +1,53 @@
+/** ------------------------------------------------------------------------
+       This file contains routines for manipulating generic lists.
+       Lists are implemented with a "harness".  In other words, each
+       node in the list consists of two pointers, one to the data item
+       and one to the next node in the list.  The head of the list is
+       the same struct as each node, but the "item" ptr is used to point
+       to the current member of the list (used by the first_in_list and
+       next_in_list functions).
+
+Copyright 1994 Hewlett-Packard Co.
+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.
+
+ ------------------------------------------------------------------------ **/
+
+extern int GetMultiVisualRegions(
+    Display *, Window, int, int, unsigned int,
+    unsigned int, int *, int *, XVisualInfo **, int *,
+    OverlayInfo  **, int *, XVisualInfo ***, list_ptr *,
+    list_ptr *, int *
+); 
+
+extern XImage *ReadAreaToImage(
+    Display *, Window, int, int, unsigned int,
+    unsigned int, int, XVisualInfo *, int,
+    OverlayInfo        *, int, XVisualInfo **, list_ptr,
+    list_ptr, int, int
+);
+
+extern void initFakeVisual(
+    Visual *
+);
diff --git a/xwd/wsutils.h b/xwd/wsutils.h
new file mode 100755 (executable)
index 0000000..26b4469
--- /dev/null
@@ -0,0 +1,338 @@
+/** ------------------------------------------------------------------------
+       This file contains routines for manipulating generic lists.
+       Lists are implemented with a "harness".  In other words, each
+       node in the list consists of two pointers, one to the data item
+       and one to the next node in the list.  The head of the list is
+       the same struct as each node, but the "item" ptr is used to point
+       to the current member of the list (used by the first_in_list and
+       next_in_list functions).
+
+Copyright 1994 Hewlett-Packard Co.
+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 file contains various typedef's, macros and procedure declarations for
+ * a set of example utility procedures contained in the file "wsutils.c".
+ *
+ ******************************************************************************/
+
+/* This is the actual structure returned by the X server describing the
+ * SERVER_OVERLAY_VISUAL property.
+ */
+typedef struct
+{
+  VisualID     visualID;               /* The VisualID of the overlay visual */
+  int          transparentType;        /* Can be None, TransparentPixel or
+                                        * TransparentMask */
+  int          value;                  /* Pixel value */
+  int          layer;                  /* Overlay planes will always be in
+                                        * layer 1 */
+} OverlayVisualPropertyRec;
+
+
+/* This is structure also describes the SERVER_OVERLAY_VISUAL property, but
+ * should be more useful than the one actually returned by the X server
+ * because it actually points to the visual's XVisualInfo struct rather than
+ * refering to the visual's ID.
+ */
+typedef struct
+{
+  XVisualInfo  *pOverlayVisualInfo;    /* Pointer to the XVisualInfo struct */
+  int          transparentType;        /* Can be None, TransparentPixel or
+                                        * TransparentMask */
+  int          value;                  /* Pixel value */
+  int          layer;                  /* Overlay planes will always be in
+                                        * layer 1 */
+} OverlayInfo;
+
+
+/* These macros are the values of the "transparentType" above: */
+#ifndef None
+#define None 0
+#endif
+#ifndef TransparentPixel
+#define TransparentPixel       1
+#endif
+
+
+/* These macros define how flexible a program is when it requests a window's
+ * creation with either the CreateImagePlanesWindow() or
+ * CreateOverlayPlanesWindow():
+ */
+#ifndef NOT_FLEXIBLE
+#define NOT_FLEXIBLE           0
+#define FLEXIBLE               1
+#endif
+
+
+/* These macros define the values of the "sbCmapHint" parameter of the
+ * CreateImagePlanesWindow():
+ */
+#ifndef SB_CMAP_TYPE_NORMAL
+#define SB_CMAP_TYPE_NORMAL    1
+#endif
+
+#ifndef SB_CMAP_TYPE_MONOTONIC
+#define SB_CMAP_TYPE_MONOTONIC 2
+#endif
+
+#ifndef SB_CMAP_TYPE_FULL
+#define SB_CMAP_TYPE_FULL      4
+#endif
+
+
+/******************************************************************************
+ *
+ * GetXVisualInfo()
+ *
+ * This routine takes an X11 Display, screen number, and returns whether the
+ * screen supports transparent overlays and three arrays:
+ *
+ *     1) All of the XVisualInfo struct's for the screen.
+ *     2) All of the OverlayInfo struct's for the screen.
+ *     3) An array of pointers to the screen's image plane XVisualInfo
+ *        structs.
+ *
+ * The code below obtains the array of all the screen's visuals, and obtains
+ * the array of all the screen's overlay visual information.  It then processes
+ * the array of the screen's visuals, determining whether the visual is an
+ * overlay or image visual.
+ *
+ * If the routine sucessfully obtained the visual information, it returns zero.
+ * If the routine didn't obtain the visual information, it returns non-zero.
+ *
+ ******************************************************************************/
+
+extern int GetXVisualInfo(
+    Display    *display,               /* Which X server (aka "display"). */
+    int                screen,                 /* Which screen of the "display". */
+    int                *transparentOverlays,   /* Non-zero if there's at least one
+                                        * overlay visual and if at least one
+                                        * of those supports a transparent
+                                        * pixel. */
+    int                *numVisuals,            /* Number of XVisualInfo struct's
+                                        * pointed to to by pVisuals. */
+    XVisualInfo        **pVisuals,             /* All of the device's visuals. */
+    int                *numOverlayVisuals,     /* Number of OverlayInfo's pointed
+                                        * to by pOverlayVisuals.  If this
+                                        * number is zero, the device does
+                                        * not have overlay planes. */
+    OverlayInfo        **pOverlayVisuals,      /* The device's overlay plane visual
+                                        * information. */
+    int                *numImageVisuals,       /* Number of XVisualInfo's pointed
+                                        * to by pImageVisuals. */
+    XVisualInfo        ***pImageVisuals        /* The device's image visuals. */
+                   );
+
+
+/******************************************************************************
+ *
+ * FreeXVisualInfo()
+ *
+ * This routine frees the data that was allocated by GetXVisualInfo().
+ *
+ ******************************************************************************/
+
+extern void FreeXVisualInfo(
+    XVisualInfo        *pVisuals,
+    OverlayInfo        *pOverlayVisuals,
+    XVisualInfo        **pImageVisuals
+                    );
+
+
+/******************************************************************************
+ *
+ * FindImagePlanesVisual()
+ *
+ * This routine attempts to find a visual to use to create an image planes
+ * window based upon the information passed in.
+ *
+ * The "Hint" values give guides to the routine as to what the program wants.
+ * The "depthFlexibility" value tells the routine how much the program wants
+ * the actual "depthHint" specified.  If the program can't live with the
+ * screen's image planes visuals, the routine returns non-zero, and the
+ * "depthObtained" and "pImageVisualToUse" return parameters are NOT valid.
+ * Otherwise, the "depthObtained" and "pImageVisualToUse" return parameters
+ * are valid and the routine returns zero.
+ *
+ * NOTE: This is just an example of what can be done.  It may or may not be
+ * useful for any specific application.
+ *
+ ******************************************************************************/
+
+extern int FindImagePlanesVisual(
+    Display    *display,               /* Which X server (aka "display"). */
+    int                screen,                 /* Which screen of the "display". */
+    int                numImageVisuals,        /* Number of XVisualInfo's pointed
+                                        * to by pImageVisuals. */
+    XVisualInfo        **pImageVisuals,        /* The device's image visuals. */
+    int                sbCmapHint,             /* What Starbase cmap modes will be
+                                        * used with the visual.  NOTE: This
+                                        * is a mask of the possible values. */
+    int                depthHint,              /* Desired depth. */
+    int                depthFlexibility,       /* How much the actual value in
+                                        * "depthHint" is desired. */
+    Visual     **pImageVisualToUse,    /* The screen's image visual to use. */
+    int                *depthObtained          /* Actual depth of the visual. */
+                                    );
+
+
+/******************************************************************************
+ *
+ * FindOverlayPlanesVisual()
+ *
+ * This routine attempts to find a visual to use to create an overlay planes
+ * window based upon the information passed in.
+ *
+ * While the CreateImagePlanesWindow() routine took a sbCmapHint, this
+ * routine doesn't.  Starbase's CMAP_FULL shouldn't be used in overlay planes
+ * windows.  This is partially because this functionality is better suited in
+ * the image planes where there are generally more planes, and partially
+ * because the overlay planes generally have PseudoColor visuals with one
+ * color being transparent (the transparent normally being the "white" color
+ * for CMAP_FULL).
+ *
+ * The "depthHint" values give guides to the routine as to what depth the
+ * program wants the window to be.  The "depthFlexibility" value tells the
+ * routine how much the program wants the actual "depthHint" specified.  If
+ * the program can't live with the screen's overlay planes visuals, the
+ * routine returns non-zero, and the "depthObtained" and "pOverlayVisualToUse"
+ * return parameters are NOT valid.  Otherwise, the "depthObtained" and
+ * "pOverlayVisualToUse" return parameters are valid and the routine returns
+ * zero.
+ *
+ * NOTE: This is just an example of what can be done.  It may or may not be
+ * useful for any specific application.
+ *
+ ******************************************************************************/
+
+extern int FindOverlayPlanesVisual(
+    Display    *display,               /* Which X server (aka "display"). */
+    int                screen,                 /* Which screen of the "display". */
+    int                numOverlayVisuals,      /* Number of OverlayInfo's pointed
+                                        * to by pOverlayVisuals. */
+    OverlayInfo        *pOverlayVisuals,       /* The device's overlay plane visual
+                                        * information. */
+    int                depthHint,              /* Desired depth. */
+    int                depthFlexibility,       /* How much the actual value in
+                                        * "depthHint" is desired. */
+    int                transparentBackground,  /* Non-zero if the visual must have
+                                        * a transparent color. */
+    Visual     **pOverlayVisualToUse,  /* The screen's overlay visual to
+                                        * use. */
+    int                *depthObtained,         /* Actual depth of the visual. */
+    int                *transparentColor       /* The transparent color the program
+                                        * can use with the visual. */
+                               );
+
+
+/******************************************************************************
+ *
+ * CreateImagePlanesWindow()
+ *
+ * This routine creates an image planes window, potentially creates a colormap
+ * for the window to use, and sets the window's standard properties, based
+ * upon the information passed in to the routine.  While "created," the window
+ * has not been mapped.
+ *
+ * If the routine suceeds, it returns zero and the return parameters
+ * "imageWindow", "imageColormap" and "mustFreeImageColormap" are valid.
+ * Otherwise, the routine returns non-zero and the return parameters are
+ * NOT valid.
+ *
+ * NOTE: This is just an example of what can be done.  It may or may not be
+ * useful for any specific application.
+ *
+ ******************************************************************************/
+
+extern int CreateImagePlanesWindow(
+    Display    *display,               /* Which X server (aka "display"). */
+    int                screen,                 /* Which screen of the "display". */
+    Window     parentWindow,           /* Window ID of the parent window for
+                                        * the created window. */
+    int                windowX,                /* Desired X coord. of the window. */
+    int                windowY,                /* Desired Y coord of the window. */
+    int                windowWidth,            /* Desired width of the window. */
+    int                windowHeight,           /* Desired height of the window. */
+    int                windowDepth,            /* Desired depth of the window. */
+    Visual     *pImageVisualToUse,     /* The window's image planes visual. */
+    int                argc,                   /* Program's argc parameter. */
+    char       *argv[],                /* Program's argv parameter. */
+    char       *windowName,            /* Name to put on window's border. */
+    char       *iconName,              /* Name to put on window's icon. */
+    Window     *imageWindow,           /* Window ID of the created window. */
+    Colormap   *imageColormap,         /* The window's colormap. */
+    int                *mustFreeImageColormap  /* Non-zero if the program must call
+                                        * XFreeColormap() for imageColormap. */
+                               );
+
+
+/******************************************************************************
+ *
+ * CreateOverlayPlanesWindow()
+ *
+ * This routine creates an overlay planes window, potentially creates a colormap
+ * for the window to use, and sets the window's standard properties, based
+ * upon the information passed in to the routine.  While "created," the window
+ * has not been mapped.
+ *
+ * If the routine suceeds, it returns zero and the return parameters
+ * "overlayWindow", "overlayColormap" and "mustFreeOverlayColormap" are valid.
+ * Otherwise, the routine returns non-zero and the return parameters are
+ * NOT valid.
+ *
+ * NOTE: This is just an example of what can be done.  It may or may not be
+ * useful for any specific application.
+ *
+ ******************************************************************************/
+
+int CreateOverlayPlanesWindow(
+    Display    *display,               /* Which X server (aka "display"). */
+    int                screen,                 /* Which screen of the "display". */
+    Window     parentWindow,           /* Window ID of the parent window for
+                                        * the created window. */
+    int                windowX,                /* Desired X coord. of the window. */
+    int                windowY,                /* Desired Y coord of the window. */
+    int                windowWidth,            /* Desired width of the window. */
+    int                windowHeight,           /* Desired height of the window. */
+    int                windowDepth,            /* Desired depth of the window. */
+    Visual     *pOverlayVisualToUse,   /* The window's overlay planes visual.*/
+    int                argc,                   /* Program's argc parameter. */
+    char       *argv[],                /* Program's argv parameter. */
+    char       *windowName,            /* Name to put on window's border. */
+    char       *iconName,              /* Name to put on window's icon. */
+    int                transparentBackground,  /* Non-zero if the window's background
+                                        * should be a transparent color. */
+    int                *transparentColor,      /* The transparent color to use as the
+                                        * window's background. */
+    Window     *overlayWindow,         /* Window ID of the created window. */
+    Colormap   *overlayColormap,       /* The window's colormap. */
+    int                *mustFreeOverlayColormap/* Non-zero if the program must call
+                                         * XFreeColormap() for
+                                         * overlayColormap. */
+                               );
diff --git a/xwd/xwd.c b/xwd/xwd.c
new file mode 100755 (executable)
index 0000000..5132432
--- /dev/null
+++ b/xwd/xwd.c
@@ -0,0 +1,627 @@
+/*
+
+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.
+
+*/
+
+/*
+ * xwd.c MIT Project Athena, X Window system window raster image dumper.
+ *
+ * This program will dump a raster image of the contents of a window into a 
+ * file for output on graphics printers or for other uses.
+ *
+ *  Author:    Tony Della Fera, DEC
+ *             17-Jun-85
+ * 
+ *  Modification history:
+ *
+ *  11/14/86 Bill Wyatt, Smithsonian Astrophysical Observatory
+ *    - Removed Z format option, changing it to an XY option. Monochrome 
+ *      windows will always dump in XY format. Color windows will dump
+ *      in Z format by default, but can be dumped in XY format with the
+ *      -xy option.
+ *
+ *  11/18/86 Bill Wyatt
+ *    - VERSION 6 is same as version 5 for monchrome. For colors, the 
+ *      appropriate number of Color structs are dumped after the header,
+ *      which has the number of colors (=0 for monochrome) in place of the
+ *      V5 padding at the end. Up to 16-bit displays are supported. I
+ *      don't yet know how 24- to 32-bit displays will be handled under
+ *      the Version 11 protocol.
+ *
+ *  6/15/87 David Krikorian, MIT Project Athena
+ *    - VERSION 7 runs under the X Version 11 servers, while the previous
+ *      versions of xwd were are for X Version 10.  This version is based
+ *      on xwd version 6, and should eventually have the same color
+ *      abilities. (Xwd V7 has yet to be tested on a color machine, so
+ *      all color-related code is commented out until color support
+ *      becomes practical.)
+ */
+
+/*%
+ *%    This is the format for commenting out color-related code until
+ *%  color can be supported.
+%*/
+
+#include <stdio.h>
+#include <errno.h>
+#include <X11/Xos.h>
+#include <stdlib.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+typedef unsigned long Pixel;
+#include "X11/XWDFile.h"
+
+#define FEEP_VOLUME 0
+
+/* Include routines to do parsing */
+#include "dsimple.h"
+#include "list.h"
+#include "wsutils.h"
+#include "multiVis.h"
+
+#ifdef XKB
+#include <X11/extensions/XKBbells.h>
+#endif
+
+/* Setable Options */
+
+static int format = ZPixmap;
+static Bool nobdrs = False;
+static Bool on_root = False;
+static Bool standard_out = True;
+static Bool debug = False;
+static Bool silent = False;
+static Bool use_installed = False;
+static long add_pixel_value = 0;
+
+
+extern int main(int, char **);
+extern void Window_Dump(Window, FILE *);
+extern int Image_Size(XImage *);
+extern int Get_XColors(XWindowAttributes *, XColor **);
+extern void _swapshort(register char *, register unsigned);
+extern void _swaplong(register char *, register unsigned);
+static long parse_long(char *);
+static int Get24bitDirectColors(XColor **);
+static int ReadColors(Visual *, Colormap, XColor **);
+
+
+static long parse_long (char *s)
+{
+    char *fmt = "%lu";
+    long retval = 0L;
+    int thesign = 1;
+
+    if (s && s[0]) {
+       if (s[0] == '-') s++, thesign = -1;
+       if (s[0] == '0') s++, fmt = "%lo";
+       if (s[0] == 'x' || s[0] == 'X') s++, fmt = "%lx";
+       (void) sscanf (s, fmt, &retval);
+    }
+    return (thesign * retval);
+}
+
+int
+main(int argc, char **argv)
+{
+    register int i;
+    Window target_win;
+    FILE *out_file = stdout;
+    Bool frame_only = False;
+
+    INIT_NAME;
+
+    Setup_Display_And_Screen(&argc, argv);
+
+    /* Get window select on command line, if any */
+    target_win = Select_Window_Args(&argc, argv);
+
+    for (i = 1; i < argc; i++) {
+       if (!strcmp(argv[i], "-nobdrs")) {
+           nobdrs = True;
+           continue;
+       }
+       if (!strcmp(argv[i], "-debug")) {
+           debug = True;
+           continue;
+       }
+       if (!strcmp(argv[i], "-help"))
+         usage();
+       if (!strcmp(argv[i], "-out")) {
+           if (++i >= argc) usage();
+           if (!(out_file = fopen(argv[i], "wb")))
+             Fatal_Error("Can't open output file as specified.");
+           standard_out = False;
+           continue;
+       }
+       if (!strcmp(argv[i], "-xy")) {
+           format = XYPixmap;
+           continue;
+       }
+       if (!strcmp(argv[i], "-screen")) {
+           on_root = True;
+           continue;
+       }
+       if (!strcmp(argv[i], "-icmap")) {
+           use_installed = True;
+           continue;
+       }
+       if (!strcmp(argv[i], "-add")) {
+           if (++i >= argc) usage();
+           add_pixel_value = parse_long (argv[i]);
+           continue;
+       }
+       if (!strcmp(argv[i], "-frame")) {
+           frame_only = True;
+           continue;
+       }
+       if (!strcmp(argv[i], "-silent")) {
+           silent = True;
+           continue;
+       }
+       usage();
+    }
+#ifdef WIN32
+    if (standard_out)
+       _setmode(fileno(out_file), _O_BINARY);
+#endif
+    
+    /*
+     * Let the user select the target window.
+     */
+    if (target_win == None)
+       target_win = Select_Window(dpy, !frame_only);
+
+    /*
+     * Dump it!
+     */
+    Window_Dump(target_win, out_file);
+
+    XCloseDisplay(dpy);
+    if (fclose(out_file)) {
+       perror("xwd");
+       exit(1);
+    }
+    exit(0);
+}
+
+static int
+Get24bitDirectColors(XColor **colors)
+{
+    int i , ncolors = 256 ;
+    XColor *tcol ;
+
+    *colors = tcol = (XColor *)malloc(sizeof(XColor) * ncolors) ;
+
+    for(i=0 ; i < ncolors ; i++)
+    {
+       tcol[i].pixel = i << 16 | i << 8 | i ;
+       tcol[i].red = tcol[i].green = tcol[i].blue = i << 8   | i ;
+    }
+
+    return ncolors ;
+}
+
+
+/*
+ * Window_Dump: dump a window to a file which must already be open for
+ *              writting.
+ */
+
+void
+Window_Dump(Window window, FILE *out)
+{
+    unsigned long swaptest = 1;
+    XColor *colors;
+    unsigned buffer_size;
+    int win_name_size;
+    int header_size;
+    int ncolors, i;
+    char *win_name;
+    Bool got_win_name;
+    XWindowAttributes win_info;
+    XImage *image;
+    int absx, absy, x, y;
+    unsigned width, height;
+    int dwidth, dheight;
+    int bw;
+    Window dummywin;
+    XWDFileHeader header;
+    XWDColor xwdcolor;
+    
+    int                 transparentOverlays , multiVis;
+    int                 numVisuals;
+    XVisualInfo         *pVisuals;
+    int                 numOverlayVisuals;
+    OverlayInfo         *pOverlayVisuals;
+    int                 numImageVisuals;
+    XVisualInfo         **pImageVisuals;
+    list_ptr            vis_regions;    /* list of regions to read from */
+    list_ptr            vis_image_regions ;
+    Visual             vis_h,*vis ;
+    int                        allImage = 0 ;
+
+    /*
+     * Inform the user not to alter the screen.
+     */
+    if (!silent) {
+#ifdef XKB
+       XkbStdBell(dpy,None,50,XkbBI_Wait);
+#else
+       XBell(dpy,FEEP_VOLUME);
+#endif
+       XFlush(dpy);
+    }
+
+    /*
+     * Get the parameters of the window being dumped.
+     */
+    if (debug) outl("xwd: Getting target window information.\n");
+    if(!XGetWindowAttributes(dpy, window, &win_info)) 
+      Fatal_Error("Can't get target window attributes.");
+
+    /* handle any frame window */
+    if (!XTranslateCoordinates (dpy, window, RootWindow (dpy, screen), 0, 0,
+                               &absx, &absy, &dummywin)) {
+       fprintf (stderr, 
+                "%s:  unable to translate window coordinates (%d,%d)\n",
+                program_name, absx, absy);
+       exit (1);
+    }
+    win_info.x = absx;
+    win_info.y = absy;
+    width = win_info.width;
+    height = win_info.height;
+    bw = 0;
+
+    if (!nobdrs) {
+       absx -= win_info.border_width;
+       absy -= win_info.border_width;
+       bw = win_info.border_width;
+       width += (2 * bw);
+       height += (2 * bw);
+    }
+    dwidth = DisplayWidth (dpy, screen);
+    dheight = DisplayHeight (dpy, screen);
+
+
+    /* clip to window */
+    if (absx < 0) width += absx, absx = 0;
+    if (absy < 0) height += absy, absy = 0;
+    if (absx + width > dwidth) width = dwidth - absx;
+    if (absy + height > dheight) height = dheight - absy;
+
+    XFetchName(dpy, window, &win_name);
+    if (!win_name || !win_name[0]) {
+       win_name = "xwdump";
+       got_win_name = False;
+    } else {
+       got_win_name = True;
+    }
+
+    /* sizeof(char) is included for the null string terminator. */
+    win_name_size = strlen(win_name) + sizeof(char);
+
+    /*
+     * Snarf the pixmap with XGetImage.
+     */
+
+    x = absx - win_info.x;
+    y = absy - win_info.y;
+
+    multiVis = GetMultiVisualRegions(dpy,RootWindow(dpy, screen), 
+               absx, absy, 
+              width, height,&transparentOverlays,&numVisuals, &pVisuals,
+               &numOverlayVisuals,&pOverlayVisuals,&numImageVisuals,
+               &pImageVisuals,&vis_regions,&vis_image_regions,&allImage) ;
+
+#ifdef _F_BLOCK_MULTI_VIS_
+       multiVis = 0;
+#endif
+
+       if (on_root || multiVis)
+    {
+       if(!multiVis)
+           image = XGetImage (dpy, RootWindow(dpy, screen), absx, absy, 
+                    width, height, AllPlanes, format);
+       else
+           image = ReadAreaToImage(dpy, RootWindow(dpy, screen), absx, absy, 
+                width, height,
+               numVisuals,pVisuals,numOverlayVisuals,pOverlayVisuals,
+                numImageVisuals, pImageVisuals,vis_regions,
+                vis_image_regions,format,allImage);
+    }
+    else
+       image = XGetImage (dpy, window, x, y, width, height, AllPlanes, format);
+    if (!image) {
+       fprintf (stderr, "%s:  unable to get image at %dx%d+%d+%d\n",
+                program_name, width, height, x, y);
+       exit (1);
+    }
+
+    if (add_pixel_value != 0) XAddPixel (image, add_pixel_value);
+
+    /*
+     * Determine the pixmap size.
+     */
+    buffer_size = Image_Size(image);
+
+    if (debug) outl("xwd: Getting Colors.\n");
+
+    if( !multiVis)
+    {
+       ncolors = Get_XColors(&win_info, &colors);
+       vis = win_info.visual ;
+    }
+    else
+    {
+       ncolors = Get24bitDirectColors(&colors) ;
+       initFakeVisual(&vis_h) ;
+       vis = &vis_h ;
+    }
+    /*
+     * Inform the user that the image has been retrieved.
+     */
+    if (!silent) {
+#ifdef XKB
+       XkbStdBell(dpy,window,FEEP_VOLUME,XkbBI_Proceed);
+       XkbStdBell(dpy,window,FEEP_VOLUME,XkbBI_RepeatingLastBell);
+#else
+       XBell(dpy, FEEP_VOLUME);
+       XBell(dpy, FEEP_VOLUME);
+#endif
+       XFlush(dpy);
+    }
+
+    /*
+     * Calculate header size.
+     */
+    if (debug) outl("xwd: Calculating header size.\n");
+    header_size = SIZEOF(XWDheader) + win_name_size;
+
+    /*
+     * Write out header information.
+     */
+    if (debug) outl("xwd: Constructing and dumping file header.\n");
+    header.header_size = (CARD32) header_size;
+    header.file_version = (CARD32) XWD_FILE_VERSION;
+    header.pixmap_format = (CARD32) format;
+    header.pixmap_depth = (CARD32) image->depth;
+    header.pixmap_width = (CARD32) image->width;
+    header.pixmap_height = (CARD32) image->height;
+    header.xoffset = (CARD32) image->xoffset;
+    header.byte_order = (CARD32) image->byte_order;
+    header.bitmap_unit = (CARD32) image->bitmap_unit;
+    header.bitmap_bit_order = (CARD32) image->bitmap_bit_order;
+    header.bitmap_pad = (CARD32) image->bitmap_pad;
+    header.bits_per_pixel = (CARD32) image->bits_per_pixel;
+    header.bytes_per_line = (CARD32) image->bytes_per_line;
+    /****
+    header.visual_class = (CARD32) win_info.visual->class;
+    header.red_mask = (CARD32) win_info.visual->red_mask;
+    header.green_mask = (CARD32) win_info.visual->green_mask;
+    header.blue_mask = (CARD32) win_info.visual->blue_mask;
+    header.bits_per_rgb = (CARD32) win_info.visual->bits_per_rgb;
+    header.colormap_entries = (CARD32) win_info.visual->map_entries;
+    *****/
+    header.visual_class = (CARD32) vis->class;
+    header.red_mask = (CARD32) vis->red_mask;
+    header.green_mask = (CARD32) vis->green_mask;
+    header.blue_mask = (CARD32) vis->blue_mask;
+    header.bits_per_rgb = (CARD32) vis->bits_per_rgb;
+    header.colormap_entries = (CARD32) vis->map_entries;
+
+    header.ncolors = ncolors;
+    header.window_width = (CARD32) win_info.width;
+    header.window_height = (CARD32) win_info.height;
+    header.window_x = absx;
+    header.window_y = absy;
+    header.window_bdrwidth = (CARD32) win_info.border_width;
+
+    if (*(char *) &swaptest) {
+       _swaplong((char *) &header, sizeof(header));
+       for (i = 0; i < ncolors; i++) {
+           _swaplong((char *) &colors[i].pixel, sizeof(CARD32));
+           _swapshort((char *) &colors[i].red, 3 * sizeof(short));
+       }
+    }
+
+    if (fwrite((char *)&header, SIZEOF(XWDheader), 1, out) != 1 ||
+       fwrite(win_name, win_name_size, 1, out) != 1) {
+       perror("xwd");
+       exit(1);
+    }
+
+    /*
+     * Write out the color maps, if any
+     */
+
+    if (debug) outl("xwd: Dumping %d colors.\n", ncolors);
+    for (i = 0; i < ncolors; i++) {
+       xwdcolor.pixel = colors[i].pixel;
+       xwdcolor.red = colors[i].red;
+       xwdcolor.green = colors[i].green;
+       xwdcolor.blue = colors[i].blue;
+       xwdcolor.flags = colors[i].flags;
+       if (fwrite((char *) &xwdcolor, SIZEOF(XWDColor), 1, out) != 1) {
+           perror("xwd");
+           exit(1);
+       }
+    }
+
+    /*
+     * Write out the buffer.
+     */
+    if (debug) outl("xwd: Dumping pixmap.  bufsize=%d\n",buffer_size);
+
+    /*
+     *    This copying of the bit stream (data) to a file is to be replaced
+     *  by an Xlib call which hasn't been written yet.  It is not clear
+     *  what other functions of xwd will be taken over by this (as yet)
+     *  non-existant X function.
+     */
+    if (fwrite(image->data, (int) buffer_size, 1, out) != 1) {
+       perror("xwd");
+       exit(1);
+    }
+
+    /*
+     * free the color buffer.
+     */
+
+    if(debug && ncolors > 0) outl("xwd: Freeing colors.\n");
+    if(ncolors > 0) free(colors);
+
+    /*
+     * Free window name string.
+     */
+    if (debug) outl("xwd: Freeing window name string.\n");
+    if (got_win_name) XFree(win_name);
+
+    /*
+     * Free image
+     */
+    XDestroyImage(image);
+}
+
+/*
+ * Report the syntax for calling xwd.
+ */
+void
+usage(void)
+{
+    fprintf (stderr,
+"usage: %s [-display host:dpy] [-debug] [-help] %s [-nobdrs] [-out <file>]",
+          program_name, "[{-root|-id <id>|-name <name>}]");
+    fprintf (stderr, " [-xy] [-add value] [-frame]\n");
+    exit(1);
+}
+
+
+/*
+ * Determine the pixmap size.
+ */
+
+int Image_Size(XImage *image)
+{
+    if (image->format != ZPixmap)
+      return(image->bytes_per_line * image->height * image->depth);
+
+    return(image->bytes_per_line * image->height);
+}
+
+#define lowbit(x) ((x) & (~(x) + 1))
+
+static int
+ReadColors(Visual *vis, Colormap cmap, XColor **colors)
+{
+    int i,ncolors ;
+
+    ncolors = vis->map_entries;
+
+    if (!(*colors = (XColor *) malloc (sizeof(XColor) * ncolors)))
+      Fatal_Error("Out of memory!");
+
+    if (vis->class == DirectColor ||
+       vis->class == TrueColor) {
+       Pixel red, green, blue, red1, green1, blue1;
+
+       red = green = blue = 0;
+       red1 = lowbit(vis->red_mask);
+       green1 = lowbit(vis->green_mask);
+       blue1 = lowbit(vis->blue_mask);
+       for (i=0; i<ncolors; i++) {
+         (*colors)[i].pixel = red|green|blue;
+         (*colors)[i].pad = 0;
+         red += red1;
+         if (red > vis->red_mask)
+           red = 0;
+         green += green1;
+         if (green > vis->green_mask)
+           green = 0;
+         blue += blue1;
+         if (blue > vis->blue_mask)
+           blue = 0;
+       }
+    } else {
+       for (i=0; i<ncolors; i++) {
+         (*colors)[i].pixel = i;
+         (*colors)[i].pad = 0;
+       }
+    }
+
+    XQueryColors(dpy, cmap, *colors, ncolors);
+    
+    return(ncolors);
+}
+
+/*
+ * Get the XColors of all pixels in image - returns # of colors
+ */
+int Get_XColors(XWindowAttributes *win_info, XColor **colors)
+{
+    int i, ncolors;
+    Colormap cmap = win_info->colormap;
+
+    if (use_installed)
+       /* assume the visual will be OK ... */
+       cmap = XListInstalledColormaps(dpy, win_info->root, &i)[0];
+    if (!cmap)
+       return(0);
+    ncolors = ReadColors(win_info->visual,cmap,colors) ;
+    return ncolors ;
+}
+
+void
+_swapshort (register char *bp, register unsigned n)
+{
+    register char c;
+    register char *ep = bp + n;
+
+    while (bp < ep) {
+       c = *bp;
+       *bp = *(bp + 1);
+       bp++;
+       *bp++ = c;
+    }
+}
+
+void
+_swaplong (register char *bp, register unsigned n)
+{
+    register char c;
+    register char *ep = bp + n;
+
+    while (bp < ep) {
+        c = bp[3];
+        bp[3] = bp[0];
+        bp[0] = c;
+        c = bp[2];
+        bp[2] = bp[1];
+        bp[1] = c;
+        bp += 4;
+    }
+}
diff --git a/xwd/xwd.man b/xwd/xwd.man
new file mode 100755 (executable)
index 0000000..d3de9d9
--- /dev/null
@@ -0,0 +1,130 @@
+.\" Copyright 1988, 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.
+.\"
+.TH XWD 1 __xorgversion__
+.SH NAME
+xwd - dump an image of an X window
+.SH SYNOPSIS
+.B "xwd"
+[-debug] [-help] [-nobdrs] [-out \fIfile\fP] [-xy] [-frame] [-add \fIvalue\fP]
+[-root | -id \fIid\fP | -name \fIname\fP ] [-icmap] [-screen] [-silent]
+[-display \fIdisplay\fP]
+.SH DESCRIPTION
+.PP
+.I Xwd
+is an X Window System window dumping utility.
+.I Xwd
+allows X users to store window images in a specially formatted dump
+file.  This file can then be read by various other X utilities for
+redisplay, printing, editing, formatting, archiving, image processing, etc.
+The target window is selected by clicking the pointer in the desired window.
+The keyboard bell is rung once at the beginning of the dump and twice when
+the dump is completed.
+.SH OPTIONS
+.PP
+.TP 8
+.B "-display \fIdisplay\fP"
+This argument allows you to specify the server to connect to; see \fIX(__miscmansuffix__)\fP.
+.PP
+.TP 8
+.B "-help"
+Print out the `Usage:' command syntax summary.
+.PP
+.TP 8
+.B "-nobdrs"
+This argument specifies that the window dump should not include the
+pixels that compose the X window border.  This is useful in situations
+where you may wish to include the window contents in a document 
+as an illustration.
+.PP
+.TP 8
+.B "-out \fIfile\fP"
+This argument allows the user to explicitly specify the output
+file on the command line.  The default is to output to standard out.
+.PP
+.TP 8
+.B "-xy"
+This option applies to color displays only. It selects `XY' format dumping
+instead of the default `Z' format.
+.PP
+.TP 8
+.B "-add \fIvalue\fP"
+This option specifies an signed value to be added to every pixel.
+.PP
+.TP 8
+.B "-frame"
+This option indicates that the window manager frame should be included when
+manually selecting a window.
+.PP
+.TP 8
+.B "-root"
+This option indicates that the root window should be selected for the
+window dump, without requiring the user to select a window with the pointer.
+.PP
+.TP 8
+.B "-id \fIid\fP"
+This option indicates that the window with the specified resource id
+should be selected for the window dump, without requiring the user to
+select a window with the pointer.
+.PP
+.TP 8
+.B "-name \fIname\fP"
+This option indicates that the window with the specified WM_NAME property
+should be selected for the window dump, without requiring the user to
+select a window with the pointer.
+.PP
+.TP 8
+.B "-icmap"
+Normally the colormap of the chosen window is used to obtain RGB values.
+This option forces the first installed colormap of the screen to be used
+instead.
+.PP
+.TP 8
+.B "-screen"
+This option indicates that the GetImage request used to obtain the image
+should be done on the root window, rather than directly on the specified
+window.  In this way, you can obtain pieces of other windows that overlap
+the specified window, and more importantly, you can capture menus or other
+popups that are independent windows but appear over the specified window.
+.PP
+.TP 8
+.B "-silent"
+Operate silently, i.e. don't ring any bells before and after dumping
+the window.
+.SH ENVIRONMENT
+.PP
+.TP 8
+.B DISPLAY
+To get default host and display number.
+.SH FILES
+.PP
+.TP 8
+.B XWDFile.h
+X Window Dump File format definition file.
+.SH SEE ALSO
+xwud(1), X(__miscmansuffix__)
+.SH AUTHORS
+Tony Della Fera, Digital Equipment Corp., MIT Project Athena
+.br
+William F. Wyatt, Smithsonian Astrophysical Observatory
diff --git a/xwud/AUTHORS b/xwud/AUTHORS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xwud/COPYING b/xwud/COPYING
new file mode 100755 (executable)
index 0000000..48bca40
--- /dev/null
@@ -0,0 +1,23 @@
+Copyright 1985, 1986, 1988, 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.
diff --git a/xwud/ChangeLog b/xwud/ChangeLog
new file mode 100755 (executable)
index 0000000..c1d37c0
--- /dev/null
@@ -0,0 +1,355 @@
+commit 1693c1bba2c03acd151329fb8ecc3f5c267f9576
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Sun Nov 7 10:40:46 2010 -0800
+
+    xwud 1.0.3
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit f78df83d15e7b159617de3850b313d3f9850f643
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Sun Nov 7 10:39:49 2010 -0800
+
+    config: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS
+    
+    Regroup AC statements under the Autoconf initialization section.
+    Regroup AM sttaements under the Automake initialization section.
+    Add missing AC_CONFIG_SRCDIR
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 60c96d9b2add63684c8e28a3221fee3d807f3926
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Sun Nov 7 10:38:07 2010 -0800
+
+    config: Remove unnecessary calls from configure.ac
+    
+    AC_PROG_CC & AC_PROG_INSTALL are provided by XORG_DEFAULT_OPTIONS now
+    PKG_CONFIG_MODULES handles AC_SUBST of the CFLAGS & LIBS variables
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 81777e705aab605d1f92edd01c3712033f7ee1cc
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date:   Sun Nov 7 10:37:23 2010 -0800
+
+    config: upgrade to util-macros 1.8 for additional man page support
+    
+    Use MAN_SUBST now supplied in XORG_MANPAGE_SECTIONS
+    The value of MAN_SUBST is the same for all X.Org packages.
+    
+    Use AC_PROG_SED now supplied by XORG_DEFAULT_OPTIONS
+    Enables use of platform appropriate version of sed.
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 0258e0ff9d6d56d2edc1c3287533771a0c3f08c3
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Nov 7 10:36:55 2010 -0800
+
+    config: update AC_PREREQ statement to 2.60
+    
+    Unrelated to the previous patches, the new value simply reflects
+    the reality that the minimum level for autoconf to configure
+    all x.org modules is 2.60 dated June 2006.
+    
+    ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 7bc31bddc140fdccefa6de2e8ae27ce6b28871ff
+Author: Jesse Adkins <jesserayadkins@gmail.com>
+Date:   Tue Sep 28 13:29:50 2010 -0700
+
+    Purge cvs tags.
+    
+    Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 1a06eb65df2f13497ac2327cd847a393d3f3d0fc
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Nov 26 09:19:55 2009 -0500
+
+    Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES
+    
+    Now that the INSTALL file is generated.
+    Allows running make maintainer-clean.
+
+commit e1e912bb1474aaa3268c86e414d92260f80eaafc
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Wed Oct 28 14:09:09 2009 -0400
+
+    INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206
+    
+    Add missing INSTALL file. Use standard GNU file on building tarball
+    README may have been updated
+    Remove AUTHORS file as it is empty and no content available yet.
+    Remove NEWS file as it is empty and no content available yet.
+
+commit 38bc3567f7134b74160dc3096e31643c93bc3198
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Mon Oct 26 22:08:40 2009 -0400
+
+    Makefile.am: ChangeLog not required: EXTRA_DIST or *CLEANFILES #24432
+    
+    ChangeLog filename is known to Automake and requires no further
+    coding in the makefile.
+
+commit 55e770684fe1bb3de4174a33fecf8f10698d9d5d
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Oct 22 12:34:16 2009 -0400
+
+    .gitignore: use common defaults with custom section # 24239
+    
+    Using common defaults will reduce errors and maintenance.
+    Only the very small or inexistent custom section need periodic maintenance
+    when the structure of the component changes. Do not edit defaults.
+
+commit 86a450a54c878e8b3e235d17557d6d8e81a31caa
+Author: Jeremy Huddleston <jeremyhu@freedesktop.org>
+Date:   Wed Oct 21 12:47:22 2009 -0700
+
+    This is not a GNU project, so declare it foreign.
+    
+    On Wed, 2009-10-21 at 13:36 +1000, Peter Hutterer wrote:
+    > On Tue, Oct 20, 2009 at 08:23:55PM -0700, Jeremy Huddleston wrote:
+    > > I noticed an INSTALL file in xlsclients and libXvMC today, and it
+    > > was quite annoying to work around since 'autoreconf -fvi' replaces
+    > > it and git wants to commit it.  Should these files even be in git?
+    > > Can I nuke them for the betterment of humanity and since they get
+    > > created by autoreconf anyways?
+    >
+    > See https://bugs.freedesktop.org/show_bug.cgi?id=24206
+    
+    As an interim measure, replace AM_INIT_AUTOMAKE([dist-bzip2]) with
+    AM_INIT_AUTOMAKE([foreign dist-bzip2]). This will prevent the generation
+    of the INSTALL file. It is also part of the 24206 solution.
+    
+    Signed-off-by: Jeremy Huddleston <jeremyhu@freedesktop.org>
+
+commit f4e1d310f6c421434c4f1101d08907de16fc855c
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Oct 12 21:41:45 2009 -0700
+
+    xwud 1.0.2
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit a71d3b986cb4f8b88928c28a1986e913a954f503
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Oct 12 21:39:27 2009 -0700
+
+    Fill in COPYING with copyright/license notices from code
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 1da3e9b8ecd537546cb82d857b81704153a68621
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Mon Oct 12 21:38:52 2009 -0700
+
+    Migrate to xorg macros 1.3 & XORG_DEFAULT_OPTIONS
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit d49722c555eedf47eeb039e3e4bd7a5b4143fc75
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Thu Oct 1 14:54:32 2009 -0700
+
+    Add README with pointers to mailing lists, bugzilla, & git
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit a619bad7e2782594e608d1b1c890a2ef46e59659
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Sun May 3 16:19:38 2009 -0700
+
+    Plug leaks of color conversion arrays in Do_Direct
+    
+    [This bug was found by the Parfait bug checking tool.
+     For more information see http://research.sun.com/projects/parfait ]
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit 5a9ab7d199e399872bd197c6b2de59f52e197efd
+Author: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date:   Fri Jan 30 11:58:40 2009 +0100
+
+    Add more input checks. From "nobody@example.com" through OpenBSD bug list.
+
+commit 11d54146e412a726807b8c0d5df8eb584084325d
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Thu Jan 15 16:22:28 2009 -0200
+
+    Ansification and compile warning fixes.
+    
+      This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects
+    make distcheck and all gcc 4.3 and sparse warnings.
+
+commit f20c704dd2962fabaea95a1c118ceffe0898d572
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Dec 6 16:37:35 2007 -0500
+
+    Replace static ChangeLog with dist-hook to generate from git log
+
+commit 566fbfbf01b95de257414f936fb31447f82671de
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Mon Sep 3 05:51:57 2007 -0400
+
+    Add *~ to .gitignore to skip patch/emacs droppings
+
+commit bd24795253bdae758bba7ae76a31c8024222ceb8
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Thu Aug 23 19:25:18 2007 -0400
+
+    Rename .cvsignore to .gitignore
+
+commit 41afbe4346cf615f18b9f7536a3a4f7b71588e26
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 21 02:29:55 2005 +0000
+
+    Update package version for X11R7 release.
+
+commit 64a9fc88c3b8386a2ee3c924cf5ed6d1faf95fda
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Dec 19 16:22:48 2005 +0000
+
+    Stub COPYING files
+
+commit 1abccb01ea285b6dcee662cc6c7e9fcb44517c51
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:24:12 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+commit fa7c02b03c22461caa3d6405e8a229a9c30dc917
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 6 22:48:27 2005 +0000
+
+    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit 5701442309db899c9cfeebafc4a583a613bb46f0
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Dec 3 05:49:29 2005 +0000
+
+    Update package version number for X11R7 RC3 release.
+
+commit 5898d50e437e95fe43da28da84a9f7746547ffd0
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Nov 28 22:01:48 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 e2b49239bc7eadb51ffab09a177aeccf6c61e888
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Mon Nov 21 10:35:09 2005 +0000
+
+    Another pass at .cvsignores for apps.
+
+commit 6540c58fa278c3501cb7e8a00db3d517bdf13d93
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Sun Nov 20 22:08:56 2005 +0000
+
+    Add/improve .cvsignore files for apps.
+
+commit 5f443db03b3f4fb230e7eef41ecd37e79506d20d
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:47:58 2005 +0000
+
+    Update package version number for RC1 release.
+
+commit d71e00abb4917244ad0e3fa8137780e76ea4a30e
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Oct 17 23:56:25 2005 +0000
+
+    Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to
+        work better with BSD make
+
+commit 3eff021e932202e1f2aadd7d07adb9717c414f22
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Fri Oct 14 00:25:48 2005 +0000
+
+    Use sed to fill in variables in man page
+
+commit 1eeb5a74483ae0d3f1e1dc2705a8f1448e97b109
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Aug 1 20:25:33 2005 +0000
+
+    Install man pages to section 1 instead of section m (Patch from Donnie
+        Berkholz)
+
+commit f3b1e56ce3838f2e022557e119f470c31c319081
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Jul 29 21:22:39 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 3175d21d65f84e0fb8f845df4ca7bf0e18ade4ff
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed Jul 20 19:32:05 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 78c7fa573ce8acc58820ef0f8b587cb49bc285b2
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Fri Jul 1 20:16:57 2005 +0000
+
+    Build system for xwud
+
+commit 110dc6336ccefd0657e662b5d58874d1e25de5f7
+Author: Egbert Eich <eich@suse.de>
+Date:   Fri Apr 23 19:55:10 2004 +0000
+
+    Merging XORG-CURRENT into trunk
+
+commit 0a9f2be7f0b51123127a4171a73d2ec9336f05fa
+Author: Egbert Eich <eich@suse.de>
+Date:   Sun Mar 14 08:35:54 2004 +0000
+
+    Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
+
+commit d89402e5ee8afc8581356c17b04d3c53d4eb87fb
+Author: Egbert Eich <eich@suse.de>
+Date:   Wed Mar 3 12:13:20 2004 +0000
+
+    Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
+
+commit 42e4f6fc5373db981509e0702fe2a25808938a7c
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 13:36:32 2004 +0000
+
+    readding XFree86's cvs IDs
+
+commit e00f6f921149cc0e2d2ba317b40bbf395cdece24
+Author: Egbert Eich <eich@suse.de>
+Date:   Thu Feb 26 09:24:18 2004 +0000
+
+    Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
+
+commit bfca9b37987a37138cbf7a1da98bc48675ff28ab
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Tue Nov 25 19:29:23 2003 +0000
+
+    XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
+
+commit 3160fb8048b7ecd003548d4424e012a8b600c65b
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 16:49:24 2003 +0000
+
+    XFree86 4.3.0.1
+
+commit da8d015481ebcb0a7605afee041fdbe29adf4183
+Author: Kaleb Keithley <kaleb@freedesktop.org>
+Date:   Fri Nov 14 15:54:55 2003 +0000
+
+    R6.6 is the Xorg base-line
diff --git a/xwud/INSTALL b/xwud/INSTALL
new file mode 100755 (executable)
index 0000000..8b82ade
--- /dev/null
@@ -0,0 +1,291 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008 Free Software Foundation, Inc.
+
+   This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+   Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package.  The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.
+
+     Running `configure' might take a while.  While running, it prints
+     some messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+  6. Often, you can also type `make uninstall' to remove the installed
+     files again.
+
+Compilers and Options
+=====================
+
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+   You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you can use GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory.  After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+   On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor.  Like
+this:
+
+     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CPP="gcc -E" CXXCPP="g++ -E"
+
+   This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+   By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+   Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Particular systems
+==================
+
+   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+     ./configure CC="cc -Ae"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
+a workaround.  If GNU CC is not installed, it is therefore recommended
+to try
+
+     ./configure CC="cc"
+
+and if that doesn't work, try
+
+     ./configure CC="cc -nodtk"
+
+Specifying the System Type
+==========================
+
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+   Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug.  Until the bug is fixed you can use this workaround:
+
+     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+   `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+     Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+     Print a summary of the options unique to this package's
+     `configure', and exit.  The `short' variant lists options used
+     only in the top level, while the `recursive' variant lists options
+     also present in any nested packages.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+     Use DIR as the installation prefix.  *Note Installation Names::
+     for more details, including other options available for fine-tuning
+     the installation locations.
+
+`--no-create'
+`-n'
+     Run the configure checks, but stop before creating any output
+     files.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/xwud/Makefile.am b/xwud/Makefile.am
new file mode 100755 (executable)
index 0000000..e2eb5b0
--- /dev/null
@@ -0,0 +1,57 @@
+# 
+#  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 = xwud
+
+AM_CFLAGS = $(CWARNFLAGS) $(XWUD_CFLAGS)
+xwud_LDADD = $(XWUD_LIBS)
+
+xwud_SOURCES = \
+        xwud.c
+
+appman_PRE = \
+        xwud.man
+
+
+appmandir = $(APP_MAN_DIR)
+
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+
+EXTRA_DIST = $(appman_PRE)
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+CLEANFILES = $(appman_DATA)
+
+SUFFIXES = .$(APP_MAN_SUFFIX) .man
+
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
+.man.$(APP_MAN_SUFFIX):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/xwud/Makefile.in b/xwud/Makefile.in
new file mode 100755 (executable)
index 0000000..8068882
--- /dev/null
@@ -0,0 +1,754 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = xwud$(EXEEXT)
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+       $(top_srcdir)/configure COPYING ChangeLog INSTALL config.guess \
+       config.sub depcomp install-sh missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_xwud_OBJECTS = xwud.$(OBJEXT)
+xwud_OBJECTS = $(am_xwud_OBJECTS)
+am__DEPENDENCIES_1 =
+xwud_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo "  CC    " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo "  CCLD  " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo "  GEN   " $@;
+SOURCES = $(xwud_SOURCES)
+DIST_SOURCES = $(xwud_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 = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+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@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+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@
+CHANGELOG_CMD = @CHANGELOG_CMD@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CWARNFLAGS = @CWARNFLAGS@
+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@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FILE_MAN_DIR = @FILE_MAN_DIR@
+FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_CMD = @INSTALL_CMD@
+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@
+MAKEINFO = @MAKEINFO@
+MAN_SUBSTS = @MAN_SUBSTS@
+MISC_MAN_DIR = @MISC_MAN_DIR@
+MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XORG_MAN_PAGE = @XORG_MAN_PAGE@
+XWUD_CFLAGS = @XWUD_CFLAGS@
+XWUD_LIBS = @XWUD_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__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@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CFLAGS = $(CWARNFLAGS) $(XWUD_CFLAGS)
+xwud_LDADD = $(XWUD_LIBS)
+xwud_SOURCES = \
+        xwud.c
+
+appman_PRE = \
+        xwud.man
+
+appmandir = $(APP_MAN_DIR)
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+EXTRA_DIST = $(appman_PRE)
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+CLEANFILES = $(appman_DATA)
+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) --foreign'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign 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)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+       @if test ! -f $@; then \
+         rm -f stamp-h1; \
+         $(MAKE) $(AM_MAKEFLAGS) 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) 
+       ($(am__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)'; test -n "$(bindir)" || list=; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p; \
+         then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-binPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+xwud$(EXEEXT): $(xwud_OBJECTS) $(xwud_DEPENDENCIES) 
+       @rm -f xwud$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(xwud_OBJECTS) $(xwud_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xwud.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
+@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) '$<'`
+install-appmanDATA: $(appman_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(appmandir)" || $(MKDIR_P) "$(DESTDIR)$(appmandir)"
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \
+       done
+
+uninstall-appmanDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(appmandir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(appmandir)" && rm -f $$files
+
+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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       set x; \
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       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; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       $(am__remove_distdir)
+       test -d "$(distdir)" || mkdir "$(distdir)"
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$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
+       -test -n "$(am__skip_mode_fix)" \
+       || find "$(distdir)" -type d ! -perm -755 \
+               -exec chmod u+rwx,go+rx {} \; -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 $(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-lzma: distdir
+       tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+       $(am__remove_distdir)
+
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+       $(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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+       *.tar.bz2*) \
+         bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.lzma*) \
+         lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+       *.tar.Z*) \
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+       *.shar.gz*) \
+         GZIP=$(GZIP_ENV) gzip -dc $(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)
+       test -d $(distdir)/_build || exit 0; \
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && am__cwd=`pwd` \
+         && $(am__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 \
+         && cd "$$am__cwd" \
+         || exit 1
+       $(am__remove_distdir)
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+       @$(am__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)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-appmanDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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
+
+.MAKE: all install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
+       clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
+       dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \
+       dist-zip distcheck distclean distclean-compile \
+       distclean-generic distclean-hdr distclean-tags distcleancheck \
+       distdir distuninstallcheck dvi dvi-am html html-am info \
+       info-am install install-am install-appmanDATA \
+       install-binPROGRAMS install-data install-data-am install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+       tags uninstall uninstall-am uninstall-appmanDATA \
+       uninstall-binPROGRAMS
+
+
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
+.man.$(APP_MAN_SUFFIX):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
+
+# 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/xwud/NEWS b/xwud/NEWS
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/xwud/README b/xwud/README
new file mode 100755 (executable)
index 0000000..8f7a152
--- /dev/null
@@ -0,0 +1,26 @@
+xwud allows X users to display in a window an image saved in a
+specially formatted dump file, such as produced by xwd.
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+        http://lists.freedesktop.org/mailman/listinfo/xorg
+
+Please submit bug reports to the Xorg bugzilla:
+
+        https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+The master development code repository can be found at:
+
+        git://anongit.freedesktop.org/git/xorg/app/xwud
+
+        http://cgit.freedesktop.org/xorg/app/xwud
+
+For patch submission instructions, see:
+
+       http://www.x.org/wiki/Development/Documentation/SubmittingPatches
+
+For more information on the git code manager, see:
+
+        http://wiki.x.org/wiki/GitPage
+
diff --git a/xwud/aclocal.m4 b/xwud/aclocal.m4
new file mode 100755 (executable)
index 0000000..641b5d9
--- /dev/null
@@ -0,0 +1,2371 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009  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.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
+[m4_warning([this file was generated for autoconf 2.68.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11.1], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# 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, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# 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])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+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, 2006, 2009
+# 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 10
+
+# 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], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$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
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    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"])
+])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008, 2009 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 16
+
+# 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.62])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
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+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
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_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)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+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
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_AM_DEPENDENCIES(OBJC)],
+                 [define([AC_PROG_OBJC],
+                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# 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_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
+                         (and sometimes confusing) to the casual installer],
+      [USE_MAINTAINER_MODE=$enableval],
+      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  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, 2009  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_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.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
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+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, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# 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
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# 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, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _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],
+[m4_foreach_w([_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, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# 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
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# 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) 2009  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 1
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# (`yes' being less verbose, `no' or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules],
+[  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')])
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# 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="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# 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 <conftest.tar])
+    grep GrepMe conftest.dir/file >/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
+
+dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
+dnl
+dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. 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 "Software"),
+dnl to deal in the Software without restriction, including without limitation
+dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
+dnl and/or sell copies of the Software, and to permit persons to whom the
+dnl Software is furnished to do so, subject to the following conditions:
+dnl
+dnl The above copyright notice and this permission notice (including the next
+dnl paragraph) shall be included in all copies or substantial portions of the
+dnl Software.
+dnl
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+dnl DEALINGS IN THE SOFTWARE.
+
+# 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 ensure that this macro is defined, also add:
+# m4_ifndef([XORG_MACROS_VERSION],
+#     [m4_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.
+m4_defun([XORG_MACROS_VERSION],[
+m4_define([vers_have], [1.11.0])
+m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
+m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
+m4_if(m4_cmp(maj_have, maj_needed), 0,,
+    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
+m4_if(m4_version_compare(vers_have, [$1]), -1,
+    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
+m4_undefine([vers_have])
+m4_undefine([maj_have])
+m4_undefine([maj_needed])
+]) # 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])
+       # under Cygwin unix is still defined even with -undef
+       elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+               RAWCPPFLAGS="-undef -ansi"
+               AC_MSG_RESULT([yes, with -ansi])
+       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
+# Added MAN_SUBSTS in version 1.8
+# Added AC_PROG_SED in version 1.8
+
+AC_DEFUN([XORG_MANPAGE_SECTIONS],[
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_SED])
+
+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_MAN_PAGE="X Version 11"
+AC_SUBST([XORG_MAN_PAGE])
+MAN_SUBSTS="\
+       -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xservername__|Xorg|g' \
+       -e 's|__xconfigfile__|xorg.conf|g' \
+       -e 's|__projectroot__|\$(prefix)|g' \
+       -e 's|__apploaddir__|\$(appdefaultdir)|g' \
+       -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
+       -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
+       -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
+       -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
+       -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
+       -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
+AC_SUBST([MAN_SUBSTS])
+
+]) # XORG_MANPAGE_SECTIONS
+
+# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
+# ------------------------
+# Minimum version: 1.7.0
+#
+# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
+# provided by xorg-sgml-doctools, if installed.
+AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
+AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
+XORG_SGML_PATH=
+PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
+    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
+    [m4_ifval([$1],[:],
+        [if test x"$cross_compiling" != x"yes" ; then
+            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
+                          [XORG_SGML_PATH=$prefix/share/sgml])
+         fi])
+    ])
+
+# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
+# the path and the name of the doc stylesheet
+if test "x$XORG_SGML_PATH" != "x" ; then
+   AC_MSG_RESULT([$XORG_SGML_PATH])
+   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
+   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
+else
+   AC_MSG_RESULT([no])
+fi
+
+AC_SUBST(XORG_SGML_PATH)
+AC_SUBST(STYLESHEET_SRCDIR)
+AC_SUBST(XSL_STYLESHEET)
+AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
+]) # XORG_CHECK_SGML_DOCTOOLS
+
+# 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_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
+AC_REQUIRE([XORG_WITH_PS2PDF])
+
+AC_PATH_PROG(LINUXDOC, linuxdoc)
+
+AC_MSG_CHECKING([whether to build documentation])
+
+if test x$XORG_SGML_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$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
+   BUILDPDFDOC=yes
+else
+   BUILDPDFDOC=no
+fi
+
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
+MAKE_PDF="$PS2PDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_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_DOCBOOK
+# -------------------
+# Minimum version: 1.0.0
+#
+# Checks for the ability to build output formats from SGML DocBook source.
+# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
+# indicates whether the necessary tools and files are found and, if set,
+# $(MAKE_XXX) blah.sgml will produce blah.xxx.
+AC_DEFUN([XORG_CHECK_DOCBOOK],[
+AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
+
+BUILDTXTDOC=no
+BUILDPDFDOC=no
+BUILDPSDOC=no
+BUILDHTMLDOC=no
+
+AC_PATH_PROG(DOCBOOKPS, docbook2ps)
+AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
+AC_PATH_PROG(DOCBOOKHTML, docbook2html)
+AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
+
+AC_MSG_CHECKING([whether to build text documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
+   test x$BUILD_TXTDOC != xno; then
+       BUILDTXTDOC=yes
+fi
+AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
+AC_MSG_RESULT([$BUILDTXTDOC])
+
+AC_MSG_CHECKING([whether to build PDF documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
+   test x$BUILD_PDFDOC != xno; then
+       BUILDPDFDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
+AC_MSG_RESULT([$BUILDPDFDOC])
+
+AC_MSG_CHECKING([whether to build PostScript documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
+   test x$BUILD_PSDOC != xno; then
+       BUILDPSDOC=yes
+fi
+AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
+AC_MSG_RESULT([$BUILDPSDOC])
+
+AC_MSG_CHECKING([whether to build HTML documentation])
+if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
+   test x$BUILD_HTMLDOC != xno; then
+       BUILDHTMLDOC=yes
+fi
+AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
+AC_MSG_RESULT([$BUILDHTMLDOC])
+
+MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
+MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
+MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
+MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
+
+AC_SUBST(MAKE_TEXT)
+AC_SUBST(MAKE_PS)
+AC_SUBST(MAKE_PDF)
+AC_SUBST(MAKE_HTML)
+]) # XORG_CHECK_DOCBOOK
+
+# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
+# ----------------
+# Minimum version: 1.5.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-xmlto option, it allows maximum flexibilty in making decisions
+# as whether or not to use the xmlto package. When DEFAULT is not specified,
+# --with-xmlto assumes 'auto'.
+#
+# Interface to module:
+# HAVE_XMLTO:  used in makefiles to conditionally generate documentation
+# XMLTO:       returns the path of the xmlto program found
+#              returns the path set by the user in the environment
+# --with-xmlto:        'yes' user instructs the module to use xmlto
+#              'no' user instructs the module not to use xmlto
+#
+# Added in version 1.10.0
+# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
+#                  xmlto for text output requires either lynx, links, or w3m browsers
+#
+# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_XMLTO],[
+AC_ARG_VAR([XMLTO], [Path to xmlto command])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(xmlto,
+       AS_HELP_STRING([--with-xmlto],
+          [Use xmlto to regenerate documentation (default: ]_defopt[)]),
+          [use_xmlto=$withval], [use_xmlto=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_xmlto" = x"auto"; then
+   AC_PATH_PROG([XMLTO], [xmlto])
+   if test "x$XMLTO" = "x"; then
+        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
+       have_xmlto=no
+   else
+        have_xmlto=yes
+   fi
+elif test "x$use_xmlto" = x"yes" ; then
+   AC_PATH_PROG([XMLTO], [xmlto])
+   if test "x$XMLTO" = "x"; then
+        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
+   fi
+   have_xmlto=yes
+elif test "x$use_xmlto" = x"no" ; then
+   if test "x$XMLTO" != "x"; then
+      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
+   fi
+   have_xmlto=no
+else
+   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
+fi
+
+# Test for a minimum version of xmlto, if provided.
+m4_ifval([$1],
+[if test "$have_xmlto" = yes; then
+    # scrape the xmlto version
+    AC_MSG_CHECKING([the xmlto version])
+    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
+    AC_MSG_RESULT([$xmlto_version])
+    AS_VERSION_COMPARE([$xmlto_version], [$1],
+        [if test "x$use_xmlto" = xauto; then
+            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
+            have_xmlto=no
+        else
+            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
+        fi])
+fi])
+
+# Test for the ability of xmlto to generate a text target
+have_xmlto_text=no
+cat > conftest.xml << "EOF"
+EOF
+AS_IF([test "$have_xmlto" = yes],
+      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
+             [have_xmlto_text=yes],
+             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
+rm -f conftest.xml
+AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
+AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
+]) # XORG_WITH_XMLTO
+
+# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
+# ----------------
+# Minimum version: 1.5.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-asciidoc option, it allows maximum flexibilty in making decisions
+# as whether or not to use the asciidoc package. When DEFAULT is not specified,
+# --with-asciidoc assumes 'auto'.
+#
+# Interface to module:
+# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
+# ASCIIDOC:     returns the path of the asciidoc program found
+#               returns the path set by the user in the environment
+# --with-asciidoc: 'yes' user instructs the module to use asciidoc
+#                'no' user instructs the module not to use asciidoc
+#
+# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_ASCIIDOC],[
+AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(asciidoc,
+       AS_HELP_STRING([--with-asciidoc],
+          [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
+          [use_asciidoc=$withval], [use_asciidoc=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_asciidoc" = x"auto"; then
+   AC_PATH_PROG([ASCIIDOC], [asciidoc])
+   if test "x$ASCIIDOC" = "x"; then
+        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
+       have_asciidoc=no
+   else
+        have_asciidoc=yes
+   fi
+elif test "x$use_asciidoc" = x"yes" ; then
+   AC_PATH_PROG([ASCIIDOC], [asciidoc])
+   if test "x$ASCIIDOC" = "x"; then
+        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
+   fi
+   have_asciidoc=yes
+elif test "x$use_asciidoc" = x"no" ; then
+   if test "x$ASCIIDOC" != "x"; then
+      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
+   fi
+   have_asciidoc=no
+else
+   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
+fi
+m4_ifval([$1],
+[if test "$have_asciidoc" = yes; then
+    # scrape the asciidoc version
+    AC_MSG_CHECKING([the asciidoc version])
+    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
+    AC_MSG_RESULT([$asciidoc_version])
+    AS_VERSION_COMPARE([$asciidoc_version], [$1],
+        [if test "x$use_asciidoc" = xauto; then
+            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
+            have_asciidoc=no
+        else
+            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
+        fi])
+fi])
+AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
+]) # XORG_WITH_ASCIIDOC
+
+# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
+# --------------------------------
+# Minimum version: 1.5.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-doxygen option, it allows maximum flexibilty in making decisions
+# as whether or not to use the doxygen package. When DEFAULT is not specified,
+# --with-doxygen assumes 'auto'.
+#
+# Interface to module:
+# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
+# DOXYGEN:      returns the path of the doxygen program found
+#               returns the path set by the user in the environment
+# --with-doxygen: 'yes' user instructs the module to use doxygen
+#                'no' user instructs the module not to use doxygen
+#
+# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_DOXYGEN],[
+AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
+m4_define([_defopt], m4_default([$2], [auto]))
+AC_ARG_WITH(doxygen,
+       AS_HELP_STRING([--with-doxygen],
+          [Use doxygen to regenerate documentation (default: ]_defopt[)]),
+          [use_doxygen=$withval], [use_doxygen=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_doxygen" = x"auto"; then
+   AC_PATH_PROG([DOXYGEN], [doxygen])
+   if test "x$DOXYGEN" = "x"; then
+        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
+       have_doxygen=no
+   else
+        have_doxygen=yes
+   fi
+elif test "x$use_doxygen" = x"yes" ; then
+   AC_PATH_PROG([DOXYGEN], [doxygen])
+   if test "x$DOXYGEN" = "x"; then
+        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
+   fi
+   have_doxygen=yes
+elif test "x$use_doxygen" = x"no" ; then
+   if test "x$DOXYGEN" != "x"; then
+      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
+   fi
+   have_doxygen=no
+else
+   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
+fi
+m4_ifval([$1],
+[if test "$have_doxygen" = yes; then
+    # scrape the doxygen version
+    AC_MSG_CHECKING([the doxygen version])
+    doxygen_version=`$DOXYGEN --version 2>/dev/null`
+    AC_MSG_RESULT([$doxygen_version])
+    AS_VERSION_COMPARE([$doxygen_version], [$1],
+        [if test "x$use_doxygen" = xauto; then
+            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
+            have_doxygen=no
+        else
+            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
+        fi])
+fi])
+AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
+]) # XORG_WITH_DOXYGEN
+
+# XORG_WITH_GROFF([DEFAULT])
+# ----------------
+# Minimum version: 1.6.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-groff option, it allows maximum flexibilty in making decisions
+# as whether or not to use the groff package. When DEFAULT is not specified,
+# --with-groff assumes 'auto'.
+#
+# Interface to module:
+# HAVE_GROFF:   used in makefiles to conditionally generate documentation
+# HAVE_GROFF_MM: the memorandum macros (-mm) package
+# HAVE_GROFF_MS: the -ms macros package
+# GROFF:        returns the path of the groff program found
+#               returns the path set by the user in the environment
+# --with-groff:         'yes' user instructs the module to use groff
+#               'no' user instructs the module not to use groff
+#
+# Added in version 1.9.0:
+# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
+#                 pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
+#                 psselect from the psutils package.
+#                 the ghostcript package. Refer to the grohtml man pages
+#
+# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
+#
+# OS and distros often splits groff in a basic and full package, the former
+# having the groff program and the later having devices, fonts and macros
+# Checking for the groff executable is not enough.
+#
+# If macros are missing, we cannot assume that groff is useless, so we don't
+# unset HAVE_GROFF or GROFF env variables.
+# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
+#
+AC_DEFUN([XORG_WITH_GROFF],[
+AC_ARG_VAR([GROFF], [Path to groff command])
+m4_define([_defopt], m4_default([$1], [auto]))
+AC_ARG_WITH(groff,
+       AS_HELP_STRING([--with-groff],
+          [Use groff to regenerate documentation (default: ]_defopt[)]),
+          [use_groff=$withval], [use_groff=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_groff" = x"auto"; then
+   AC_PATH_PROG([GROFF], [groff])
+   if test "x$GROFF" = "x"; then
+        AC_MSG_WARN([groff not found - documentation targets will be skipped])
+       have_groff=no
+   else
+        have_groff=yes
+   fi
+elif test "x$use_groff" = x"yes" ; then
+   AC_PATH_PROG([GROFF], [groff])
+   if test "x$GROFF" = "x"; then
+        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
+   fi
+   have_groff=yes
+elif test "x$use_groff" = x"no" ; then
+   if test "x$GROFF" != "x"; then
+      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
+   fi
+   have_groff=no
+else
+   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
+fi
+
+# We have groff, test for the presence of the macro packages
+if test "x$have_groff" = x"yes"; then
+    AC_MSG_CHECKING([for ${GROFF} -ms macros])
+    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
+        groff_ms_works=yes
+    else
+        groff_ms_works=no
+    fi
+    AC_MSG_RESULT([$groff_ms_works])
+    AC_MSG_CHECKING([for ${GROFF} -mm macros])
+    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
+        groff_mm_works=yes
+    else
+        groff_mm_works=no
+    fi
+    AC_MSG_RESULT([$groff_mm_works])
+fi
+
+# We have groff, test for HTML dependencies, one command per package
+if test "x$have_groff" = x"yes"; then
+   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
+   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
+   AC_PATH_PROG(PSSELECT_PATH, [psselect])
+   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
+      have_groff_html=yes
+   else
+      have_groff_html=no
+      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
+   fi
+fi
+
+# Set Automake conditionals for Makefiles
+AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
+AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
+AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
+AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
+]) # XORG_WITH_GROFF
+
+# XORG_WITH_FOP([DEFAULT])
+# ----------------
+# Minimum version: 1.6.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-fop option, it allows maximum flexibilty in making decisions
+# as whether or not to use the fop package. When DEFAULT is not specified,
+# --with-fop assumes 'auto'.
+#
+# Interface to module:
+# HAVE_FOP:    used in makefiles to conditionally generate documentation
+# FOP:         returns the path of the fop program found
+#              returns the path set by the user in the environment
+# --with-fop:  'yes' user instructs the module to use fop
+#              'no' user instructs the module not to use fop
+#
+# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_FOP],[
+AC_ARG_VAR([FOP], [Path to fop command])
+m4_define([_defopt], m4_default([$1], [auto]))
+AC_ARG_WITH(fop,
+       AS_HELP_STRING([--with-fop],
+          [Use fop to regenerate documentation (default: ]_defopt[)]),
+          [use_fop=$withval], [use_fop=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_fop" = x"auto"; then
+   AC_PATH_PROG([FOP], [fop])
+   if test "x$FOP" = "x"; then
+        AC_MSG_WARN([fop not found - documentation targets will be skipped])
+       have_fop=no
+   else
+        have_fop=yes
+   fi
+elif test "x$use_fop" = x"yes" ; then
+   AC_PATH_PROG([FOP], [fop])
+   if test "x$FOP" = "x"; then
+        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
+   fi
+   have_fop=yes
+elif test "x$use_fop" = x"no" ; then
+   if test "x$FOP" != "x"; then
+      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
+   fi
+   have_fop=no
+else
+   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
+fi
+AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
+]) # XORG_WITH_FOP
+
+# XORG_WITH_PS2PDF([DEFAULT])
+# ----------------
+# Minimum version: 1.6.0
+# Minimum version for optional DEFAULT argument: 1.11.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
+# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
+# --with-ps2pdf assumes 'auto'.
+#
+# Interface to module:
+# HAVE_PS2PDF:         used in makefiles to conditionally generate documentation
+# PS2PDF:      returns the path of the ps2pdf program found
+#              returns the path set by the user in the environment
+# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
+#               'no' user instructs the module not to use ps2pdf
+#
+# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_PS2PDF],[
+AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
+m4_define([_defopt], m4_default([$1], [auto]))
+AC_ARG_WITH(ps2pdf,
+       AS_HELP_STRING([--with-ps2pdf],
+          [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
+          [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
+m4_undefine([_defopt])
+
+if test "x$use_ps2pdf" = x"auto"; then
+   AC_PATH_PROG([PS2PDF], [ps2pdf])
+   if test "x$PS2PDF" = "x"; then
+        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
+       have_ps2pdf=no
+   else
+        have_ps2pdf=yes
+   fi
+elif test "x$use_ps2pdf" = x"yes" ; then
+   AC_PATH_PROG([PS2PDF], [ps2pdf])
+   if test "x$PS2PDF" = "x"; then
+        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
+   fi
+   have_ps2pdf=yes
+elif test "x$use_ps2pdf" = x"no" ; then
+   if test "x$PS2PDF" != "x"; then
+      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
+   fi
+   have_ps2pdf=no
+else
+   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
+fi
+AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
+]) # XORG_WITH_PS2PDF
+
+# XORG_ENABLE_DOCS (enable_docs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a builder to skip all
+# documentation targets except traditional man pages.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO         --with-xmlto
+# XORG_WITH_ASCIIDOC      --with-asciidoc
+# XORG_WITH_DOXYGEN       --with-doxygen
+# XORG_WITH_FOP           --with-fop
+# XORG_WITH_GROFF         --with-groff
+# XORG_WITH_PS2PDF        --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_DOCS:           used in makefiles to conditionally generate documentation
+# --enable-docs: 'yes' user instructs the module to generate docs
+#               'no' user instructs the module not to generate docs
+# parm1:       specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_DOCS],[
+m4_define([default], m4_default([$1], [yes]))
+AC_ARG_ENABLE(docs,
+       AS_HELP_STRING([--enable-docs],
+          [Enable building the documentation (default: ]default[)]),
+          [build_docs=$enableval], [build_docs=]default)
+m4_undefine([default])
+AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
+AC_MSG_CHECKING([whether to build documentation])
+AC_MSG_RESULT([$build_docs])
+]) # XORG_ENABLE_DOCS
+
+# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# This macro enables a builder to skip all developer documentation.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO         --with-xmlto
+# XORG_WITH_ASCIIDOC      --with-asciidoc
+# XORG_WITH_DOXYGEN       --with-doxygen
+# XORG_WITH_FOP           --with-fop
+# XORG_WITH_GROFF         --with-groff
+# XORG_WITH_PS2PDF        --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_DEVEL_DOCS:   used in makefiles to conditionally generate developer docs
+# --enable-devel-docs: 'yes' user instructs the module to generate developer docs
+#                      'no' user instructs the module not to generate developer docs
+# parm1:               specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
+m4_define([devel_default], m4_default([$1], [yes]))
+AC_ARG_ENABLE(devel-docs,
+       AS_HELP_STRING([--enable-devel-docs],
+          [Enable building the developer documentation (default: ]devel_default[)]),
+          [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
+m4_undefine([devel_default])
+AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
+AC_MSG_CHECKING([whether to build developer documentation])
+AC_MSG_RESULT([$build_devel_docs])
+]) # XORG_ENABLE_DEVEL_DOCS
+
+# XORG_ENABLE_SPECS (enable_specs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# This macro enables a builder to skip all functional specification targets.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO         --with-xmlto
+# XORG_WITH_ASCIIDOC      --with-asciidoc
+# XORG_WITH_DOXYGEN       --with-doxygen
+# XORG_WITH_FOP           --with-fop
+# XORG_WITH_GROFF         --with-groff
+# XORG_WITH_PS2PDF        --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_SPECS:                used in makefiles to conditionally generate specs
+# --enable-specs:      'yes' user instructs the module to generate specs
+#                      'no' user instructs the module not to generate specs
+# parm1:               specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_SPECS],[
+m4_define([spec_default], m4_default([$1], [yes]))
+AC_ARG_ENABLE(specs,
+       AS_HELP_STRING([--enable-specs],
+          [Enable building the specs (default: ]spec_default[)]),
+          [build_specs=$enableval], [build_specs=]spec_default)
+m4_undefine([spec_default])
+AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
+AC_MSG_CHECKING([whether to build functional specifications])
+AC_MSG_RESULT([$build_specs])
+]) # XORG_ENABLE_SPECS
+
+# 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,
+       AS_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],
+               [MALLOC_ZERO_RETURNS_NULL=yes])
+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
+#
+# This macro enables the use of a tool that flags some suspicious and
+# non-portable constructs (likely to be bugs) in C language source code.
+# It will attempt to locate the tool and use appropriate options.
+# There are various lint type tools on different platforms.
+#
+# Interface to module:
+# LINT:                returns the path to the tool found on the platform
+#              or the value set to LINT on the configure cmd line
+#              also an Automake conditional
+# LINT_FLAGS:  an Automake variable with appropriate flags
+#
+# --with-lint: 'yes' user instructs the module to use lint
+#              'no' user instructs the module not to use lint (default)
+#
+# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
+# If the user sets the value of LINT_FLAGS, they are used verbatim.
+#
+AC_DEFUN([XORG_WITH_LINT],[
+
+AC_ARG_VAR([LINT], [Path to a lint-style command])
+AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
+AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
+               [Use a lint-style source code checker (default: disabled)])],
+               [use_lint=$withval], [use_lint=no])
+
+# Obtain platform specific info like program name and options
+# The lint program on FreeBSD and NetBSD is different from the one on Solaris
+case $host_os in
+  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
+       lint_name=splint
+       lint_options="-badflag"
+       ;;
+  *freebsd* | *netbsd*)
+       lint_name=lint
+       lint_options="-u -b"
+       ;;
+  *solaris*)
+       lint_name=lint
+       lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
+       ;;
+esac
+
+# Test for the presence of the program (either guessed by the code or spelled out by the user)
+if test "x$use_lint" = x"yes" ; then
+   AC_PATH_PROG([LINT], [$lint_name])
+   if test "x$LINT" = "x"; then
+        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
+   fi
+elif test "x$use_lint" = x"no" ; then
+   if test "x$LINT" != "x"; then
+      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
+   fi
+else
+   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
+fi
+
+# User supplied flags override default flags
+if test "x$LINT_FLAGS" != "x"; then
+   lint_options=$LINT_FLAGS
+fi
+
+AC_SUBST([LINT_FLAGS],[$lint_options])
+AM_CONDITIONAL(LINT, [test "x$LINT" != x])
+
+]) # 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.
+#
+# Interface to module:
+# LINTLIB              - Automake variable with the name of lint library file to make
+# MAKE_LINT_LIB                - Automake conditional
+#
+# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
+#                        - 'no' user instructs the module not to create a lint library (default)
+
+AC_DEFUN([XORG_LINT_LIBRARY],[
+AC_REQUIRE([XORG_WITH_LINT])
+AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
+       [Create lint library (default: disabled)])],
+       [make_lint_lib=$enableval], [make_lint_lib=no])
+
+if test "x$make_lint_lib" = x"yes" ; then
+   LINTLIB=llib-l$1.ln
+   if test "x$LINT" = "x"; then
+        AC_MSG_ERROR([Cannot make lint library without --with-lint])
+   fi
+elif test "x$make_lint_lib" != x"no" ; then
+   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
+fi
+
+AC_SUBST(LINTLIB)
+AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
+
+]) # XORG_LINT_LIBRARY
+
+# XORG_CWARNFLAGS
+# ---------------
+# Minimum version: 1.2.0
+#
+# Defines CWARNFLAGS to enable C compiler warnings.
+#
+AC_DEFUN([XORG_CWARNFLAGS], [
+AC_REQUIRE([AC_PROG_CC_C99])
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast -Wformat=2"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+AC_SUBST(CWARNFLAGS)
+]) # XORG_CWARNFLAGS
+
+# XORG_STRICT_OPTION
+# -----------------------
+# Minimum version: 1.3.0
+#
+# Add configure option to enable strict compilation
+AC_DEFUN([XORG_STRICT_OPTION], [
+# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
+AC_REQUIRE([AC_PROG_CC_C99])
+AC_REQUIRE([XORG_CWARNFLAGS])
+
+AC_ARG_ENABLE(strict-compilation,
+                         AS_HELP_STRING([--enable-strict-compilation],
+                         [Enable all warnings from compiler and make them errors (default: disabled)]),
+                         [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
+if test "x$STRICT_COMPILE" = "xyes"; then
+       AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+       AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+AC_SUBST([CWARNFLAGS])
+]) # XORG_STRICT_OPTION
+
+# XORG_DEFAULT_OPTIONS
+# --------------------
+# Minimum version: 1.3.0
+#
+# Defines default options for X.Org modules.
+#
+AC_DEFUN([XORG_DEFAULT_OPTIONS], [
+AC_REQUIRE([AC_PROG_INSTALL])
+XORG_CWARNFLAGS
+XORG_STRICT_OPTION
+XORG_RELEASE_VERSION
+XORG_CHANGELOG
+XORG_INSTALL
+XORG_MANPAGE_SECTIONS
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
+    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
+]) # XORG_DEFAULT_OPTIONS
+
+# XORG_INSTALL()
+# ----------------
+# Minimum version: 1.4.0
+#
+# Defines the variable INSTALL_CMD as the command to copy
+# INSTALL from $prefix/share/util-macros.
+#
+AC_DEFUN([XORG_INSTALL], [
+AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
+INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+AC_SUBST([INSTALL_CMD])
+]) # XORG_INSTALL
+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
+# --------------------
+# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
+AC_DEFUN([XORG_RELEASE_VERSION],[
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
+               [`echo $PACKAGE_VERSION | cut -d . -f 1`],
+               [Major version of this package])
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
+               [$PVM],
+               [Minor version of this package])
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+       AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
+               [$PVP],
+               [Patch version of this package])
+])
+
+# XORG_CHANGELOG()
+# ----------------
+# Minimum version: 1.2.0
+#
+# Defines the variable CHANGELOG_CMD as the command to generate
+# ChangeLog from git.
+#
+#
+AC_DEFUN([XORG_CHANGELOG], [
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+AC_SUBST([CHANGELOG_CMD])
+]) # XORG_CHANGELOG
+
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# 
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# 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 "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _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 --print-errors "$2" 2>&1`
+        else 
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       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 <http://pkg-config.freedesktop.org/>.])],
+               [$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
+
diff --git a/xwud/config.guess b/xwud/config.guess
new file mode 100755 (executable)
index 0000000..2852378
--- /dev/null
@@ -0,0 +1,1505 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+#   Free Software Foundation, Inc.
+
+timestamp='2010-08-21'
+
+# 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 (context
+# diff format) to <config-patches@gnu.org> and include a 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.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+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 <config-patches@gnu.org>."
+
+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, 2006, 2007, 2008, 2009, 2010 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' HUP INT TERM
+
+# 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" HUP INT PIPE TERM ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$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 ;;
+           sh5el) machine=sh5le-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 -q __ELF__
+               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 ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-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 ;;
+    s390x:SunOS:*:*)
+       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+       echo i386-pc-auroraux${UNAME_RELEASE}
+       exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+       eval $set_cc_for_build
+       SUN_ARCH="i386"
+       # If there is a compiler, see if it is configured for 64-bit objects.
+       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+       # This test works for both compilers.
+       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH="x86_64"
+           fi
+       fi
+       echo ${SUN_ARCH}-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 <stdio.h>  /* 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 <sys/systemcfg.h>
+
+               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:*:[4567])
+       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 <stdlib.h>
+              #include <unistd.h>
+
+              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 -q __LP64__
+           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 <unistd.h>
+       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:*:*)
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           amd64)
+               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       exit ;;
+    i*:CYGWIN*:*)
+       echo ${UNAME_MACHINE}-pc-cygwin
+       exit ;;
+    *: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 ;;
+    *:Interix*:*)
+       case ${UNAME_MACHINE} in
+           x86)
+               echo i586-pc-interix${UNAME_RELEASE}
+               exit ;;
+           authenticamd | genuineintel | EM64T)
+               echo x86_64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+           IA64)
+               echo ia64-unknown-interix${UNAME_RELEASE}
+               exit ;;
+       esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       exit ;;
+    8664:Windows_NT:*)
+       echo x86_64-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*:*:* | x86_64: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 ;;
+    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 -q ld.so.1
+       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+       exit ;;
+    arm*:Linux:*:*)
+       eval $set_cc_for_build
+       if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_EABI__
+       then
+           echo ${UNAME_MACHINE}-unknown-linux-gnu
+       else
+           echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+       fi
+       exit ;;
+    avr32*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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 ;;
+    i*86:Linux:*:*)
+       LIBC=gnu
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+       echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+       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:*:* | mips64:Linux:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #undef CPU
+       #undef ${UNAME_MACHINE}
+       #undef ${UNAME_MACHINE}el
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=${UNAME_MACHINE}el
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       CPU=${UNAME_MACHINE}
+       #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; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-unknown-linux-gnu
+       exit ;;
+    padre:Linux:*:*)
+       echo sparc-unknown-linux-gnu
+       exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+       echo hppa64-unknown-linux-gnu
+       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 ;;
+    ppc64:Linux:*:*)
+       echo powerpc64-unknown-linux-gnu
+       exit ;;
+    ppc:Linux:*:*)
+       echo powerpc-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 ;;
+    tile*:Linux:*:*)
+       echo ${UNAME_MACHINE}-tilera-linux-gnu
+       exit ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-gnu
+       exit ;;
+    x86_64:Linux:*:*)
+       echo x86_64-unknown-linux-gnu
+       exit ;;
+    xtensa*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       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.[02]*:*)
+       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' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/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 i586.
+       # Note: whatever this is, it MUST be the same as what config.sub
+       # prints for the "djgpp" host, or else GDB configury will decide that
+       # this is a cross-build.
+       echo i586-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; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       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; }
+       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+           && { echo i586-ncr-sysv4.3${OS_REL}; 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.[02]*:*)
+       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 <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # 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 ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       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 ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       echo sx8r-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
+           i386)
+               eval $set_cc_for_build
+               if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+                 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+                     (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+                     grep IS_64BIT_ARCH >/dev/null
+                 then
+                     UNAME_PROCESSOR="x86_64"
+                 fi
+               fi ;;
+           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 ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
+    i*86:AROS:*:*)
+       echo ${UNAME_MACHINE}-pc-aros
+       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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+  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 <sys/param.h>
+#  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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/xwud/config.h.in b/xwud/config.h.in
new file mode 100755 (executable)
index 0000000..7c9cfb1
--- /dev/null
@@ -0,0 +1,64 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* 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 home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
diff --git a/xwud/config.sub b/xwud/config.sub
new file mode 100755 (executable)
index 0000000..320e303
--- /dev/null
@@ -0,0 +1,1739 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+#   Free Software Foundation, Inc.
+
+timestamp='2010-09-11'
+
+# 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 <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted GNU 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.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# 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 <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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-android* | linux-dietlibc | linux-newlib* | \
+  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-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 | -microblaze)
+               os=
+               basic_machine=$1
+               ;;
+        -bluegene*)
+               os=-cnk
+               ;;
+       -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
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -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/'`
+               ;;
+       -sco5v6*)
+               # 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 | avr32 \
+       | bfin \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fido | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | lm32 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | mcore | mep | metag \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64octeon | mips64octeonel \
+       | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | moxie \
+       | mt \
+       | msp430 \
+       | nds32 | nds32le | nds32be \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | rx \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu | strongarm \
+       | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+       | ubicom32 \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | z8k | z80)
+               basic_machine=$basic_machine-unknown
+               ;;
+       c54x)
+               basic_machine=tic54x-unknown
+               ;;
+       c55x)
+               basic_machine=tic55x-unknown
+               ;;
+       c6x)
+               basic_machine=tic6x-unknown
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12 | picochip)
+               # Motorola 68HC11/12.
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       # 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-* | avr32-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* \
+       | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64octeon-* | mips64octeonel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nds32-* | nds32le-* | nds32be-* \
+       | nios-* | nios2-* \
+       | none-* | np1-* | ns16k-* | ns32k-* \
+       | orion-* \
+       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+       | pyramid-* \
+       | romp-* | rs6000-* | rx-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tile-* | tilegx-* \
+       | tron-* \
+       | ubicom32-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa*-* \
+       | ymp-* \
+       | z8k-* | z80-*)
+               ;;
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               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
+               ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       bluegene*)
+               basic_machine=powerpc-ibm
+               os=-cnk
+               ;;
+       c54x-*)
+               basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c55x-*)
+               basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c6x-*)
+               basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+        cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
+       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
+               ;;
+       cr16)
+               basic_machine=cr16-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
+               ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
+       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
+               ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       m88k-omron*)
+               basic_machine=m88k-omron
+               ;;
+       magnum | m3230)
+               basic_machine=mips-mips
+               os=-sysv
+               ;;
+       merlin)
+               basic_machine=ns32k-utek
+               os=-sysv
+               ;;
+        microblaze)
+               basic_machine=microblaze-xilinx
+               ;;
+       mingw32)
+               basic_machine=i386-pc
+               os=-mingw32
+               ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
+       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
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       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
+               ;;
+        neo-tandem)
+               basic_machine=neo-tandem
+               ;;
+        nse-tandem)
+               basic_machine=nse-tandem
+               ;;
+       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
+               ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       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
+               ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       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
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       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
+               ;;
+        # This must be matched before tile*.
+        tilegx*)
+               basic_machine=tilegx-unknown
+               os=-linux-gnu
+               ;;
+       tile*)
+               basic_machine=tile-unknown
+               os=-linux-gnu
+               ;;
+       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
+               ;;
+       z80-*-coff)
+               basic_machine=z80-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[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+               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.
+        -auroraux)
+               os=-auroraux
+               ;;
+       -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* | -cnk* | -sunos | -sunos[34]*\
+             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+             | -sym* | -kopensolaris* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* | -aros* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
+             | -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* | -cegcc* \
+             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -linux-android* \
+             | -linux-newlib* | -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* | -rdos* | -toppers* | -drops* | -es*)
+       # 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
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+        -nacl*)
+               ;;
+       -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
+        score-*)
+               os=-elf
+               ;;
+        spu-*)
+               os=-elf
+               ;;
+       *-acorn)
+               os=-riscix1.2
+               ;;
+       arm*-rebel)
+               os=-linux
+               ;;
+       arm*-semi)
+               os=-aout
+               ;;
+        c4x-* | tic4x-*)
+               os=-coff
+               ;;
+       tic54x-*)
+               os=-coff
+               ;;
+       tic55x-*)
+               os=-coff
+               ;;
+       tic6x-*)
+               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
+               ;;
+        mep-*)
+               os=-elf
+               ;;
+       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
+                               ;;
+                       -cnk*|-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/xwud/configure b/xwud/configure
new file mode 100755 (executable)
index 0000000..40d397d
--- /dev/null
@@ -0,0 +1,6133 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.68 for xwud 1.0.3.
+#
+# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+        /*)
+          for as_base in sh bash ksh sh5; do
+            # Try only shells that exist, to save several forks.
+            as_shell=$as_dir/$as_base
+            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+          done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+       # neutralization value for shells without unset; and this also
+       # works around shells that cannot unset nonexistent variables.
+       # Preserve -v and -x to the replacement shell.
+       BASH_ENV=/dev/null
+       ENV=/dev/null
+       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+       export CONFIG_SHELL
+       case $- in # ((((
+         *v*x* | *x*v* ) as_opts=-vx ;;
+         *v* ) as_opts=-v ;;
+         *x* ) as_opts=-x ;;
+         * ) as_opts= ;;
+       esac
+       exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='xwud'
+PACKAGE_TARNAME='xwud'
+PACKAGE_VERSION='1.0.3'
+PACKAGE_STRING='xwud 1.0.3'
+PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
+PACKAGE_URL=''
+
+ac_unique_file="Makefile.am"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+XWUD_LIBS
+XWUD_CFLAGS
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+MAN_SUBSTS
+XORG_MAN_PAGE
+ADMIN_MAN_DIR
+DRIVER_MAN_DIR
+MISC_MAN_DIR
+FILE_MAN_DIR
+LIB_MAN_DIR
+APP_MAN_DIR
+ADMIN_MAN_SUFFIX
+DRIVER_MAN_SUFFIX
+MISC_MAN_SUFFIX
+FILE_MAN_SUFFIX
+LIB_MAN_SUFFIX
+APP_MAN_SUFFIX
+SED
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+INSTALL_CMD
+PKG_CONFIG
+CHANGELOG_CMD
+CWARNFLAGS
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_strict_compilation
+enable_silent_rules
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+PKG_CONFIG
+XWUD_CFLAGS
+XWUD_LIBS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=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 ;;
+
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_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'`
+  as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+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
+    $as_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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 xwud 1.0.3 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/xwud]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_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 xwud 1.0.3:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --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
+  --enable-strict-compilation
+                          Enable all warnings from compiler and make them
+                          errors (default: disabled)
+  --enable-silent-rules          less verbose build output (undo: `make V=1')
+  --disable-silent-rules         verbose build output (undo: `make V=0')
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  PKG_CONFIG  path to pkg-config utility
+  XWUD_CFLAGS C compiler flags for XWUD, overriding pkg-config
+  XWUD_LIBS   linker flags for XWUD, 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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+xwud configure 1.0.3
+generated by GNU Autoconf 2.68
+
+Copyright (C) 2010 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
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by xwud $as_me 1.0.3, which was
+generated by GNU Autoconf 2.68.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&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_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append 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
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > 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
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+  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.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_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 $ac_precious_vars; 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,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_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
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_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.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+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
+
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+# Initialize Automake
+am__api_version='1.11'
+
+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
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$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'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# 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".
+      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "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 $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if ${ac_cv_path_mkdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+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='xwud'
+ VERSION='1.0.3'
+
+
+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"}
+
+# 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 -'
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-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
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$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
+
+
+
+# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
+
+
+
+
+
+
+
+
+
+
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-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
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+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
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM 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.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* 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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+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
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&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
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$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
+
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if ${ac_cv_prog_cc_c99+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+       {
+       case 's': // string
+         str = va_arg (args_copy, const char *);
+         break;
+       case 'd': // int
+         number = va_arg (args_copy, int);
+         break;
+       case 'f': // float
+         fnumber = va_arg (args_copy, double);
+         break;
+       default:
+         break;
+       }
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+         || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+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
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+
+fi
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  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_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+
+
+
+
+if  test "x$GCC" = xyes ; then
+    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast -Wformat=2"
+    case `$CC -dumpversion` in
+    3.4.* | 4.*)
+       CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+       ;;
+    esac
+else
+    ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default"
+if test "x$ac_cv_have_decl___SUNPRO_C" = xyes; then :
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+    if test "x$SUNCC" = "xyes"; then
+       CWARNFLAGS="-v"
+    fi
+fi
+
+
+
+# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
+
+
+
+# Check whether --enable-strict-compilation was given.
+if test "${enable_strict_compilation+set}" = set; then :
+  enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval
+else
+  STRICT_COMPILE=no
+fi
+
+if test "x$STRICT_COMPILE" = "xyes"; then
+       ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default"
+if test "x$ac_cv_have_decl___SUNPRO_C" = xyes; then :
+  SUNCC="yes"
+else
+  SUNCC="no"
+fi
+
+       ac_fn_c_check_decl "$LINENO" "__INTEL_COMPILER" "ac_cv_have_decl___INTEL_COMPILER" "$ac_includes_default"
+if test "x$ac_cv_have_decl___INTEL_COMPILER" = xyes; then :
+  INTELCC="yes"
+else
+  INTELCC="no"
+fi
+
+       if test "x$GCC" = xyes ; then
+               STRICT_CFLAGS="-pedantic -Werror"
+       elif test "x$SUNCC" = "xyes"; then
+               STRICT_CFLAGS="-errwarn"
+    elif test "x$INTELCC" = "xyes"; then
+               STRICT_CFLAGS="-Werror"
+       fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+       PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+       if test "x$PVM" = "x"; then
+               PVM="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+       PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+       if test "x$PVP" = "x"; then
+               PVP="0"
+       fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+
+
+
+
+macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
+INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+XORG_MAN_PAGE="X Version 11"
+
+MAN_SUBSTS="\
+       -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
+       -e 's|__xservername__|Xorg|g' \
+       -e 's|__xconfigfile__|xorg.conf|g' \
+       -e 's|__projectroot__|\$(prefix)|g' \
+       -e 's|__apploaddir__|\$(appdefaultdir)|g' \
+       -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
+       -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
+       -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
+       -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
+       -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
+       -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
+
+
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in
+yes) AM_DEFAULT_VERBOSITY=0;;
+no)  AM_DEFAULT_VERBOSITY=1;;
+*)   AM_DEFAULT_VERBOSITY=0;;
+esac
+AM_BACKSLASH='\'
+
+
+
+# Checks for pkg-config packages
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XWUD" >&5
+$as_echo_n "checking for XWUD... " >&6; }
+
+if test -n "$XWUD_CFLAGS"; then
+    pkg_cv_XWUD_CFLAGS="$XWUD_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "x11") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XWUD_CFLAGS=`$PKG_CONFIG --cflags "x11" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$XWUD_LIBS"; then
+    pkg_cv_XWUD_LIBS="$XWUD_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "x11") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_XWUD_LIBS=`$PKG_CONFIG --libs "x11" 2>/dev/null`
+else
+  pkg_failed=yes
+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
+               XWUD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "x11" 2>&1`
+        else
+               XWUD_PKG_ERRORS=`$PKG_CONFIG --print-errors "x11" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$XWUD_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (x11) were not met:
+
+$XWUD_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 XWUD_CFLAGS
+and XWUD_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_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 XWUD_CFLAGS
+and XWUD_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+       XWUD_CFLAGS=$pkg_cv_XWUD_CFLAGS
+       XWUD_LIBS=$pkg_cv_XWUD_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+       cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+         mv -f confcache "$cache_file"$$ &&
+         mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+         mv -f confcache "$cache_file" ;;
+       esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $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}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# 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
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+       test -d "$1/.";
+      else
+       case $1 in #(
+       -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by xwud $as_me 1.0.3, which was
+generated by GNU Autoconf 2.68.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   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 <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+xwud config.status 1.0.3
+configured by $0, generated by GNU Autoconf 2.68,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+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=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  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 || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  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 against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp= ac_tmp=
+  trap 'exit_status=$?
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries 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[        ]*=[    ]*/{
+h
+s///
+s/^/:/
+s/[     ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[  ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[      ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #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.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$ac_tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # 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.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$ac_tmp/stdin"
+  case $ac_file in
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$ac_tmp/config.h" "$ac_file" \
+       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$_am_arg" : 'X\(//\)[^/]' \| \
+        X"$_am_arg" : 'X\(//\)$' \| \
+        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_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=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# 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 || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/xwud/configure.ac b/xwud/configure.ac
new file mode 100755 (executable)
index 0000000..43b0ae8
--- /dev/null
@@ -0,0 +1,44 @@
+
+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.
+
+# Initialize Autoconf
+AC_PREREQ([2.60])
+AC_INIT([xwud], [1.0.3],
+        [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xwud])
+AC_CONFIG_SRCDIR([Makefile.am])
+AC_CONFIG_HEADERS([config.h])
+
+# Initialize Automake
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+         [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.8)
+XORG_DEFAULT_OPTIONS
+
+# Checks for pkg-config packages
+PKG_CHECK_MODULES(XWUD, x11)
+
+AC_OUTPUT([Makefile])
diff --git a/xwud/depcomp b/xwud/depcomp
new file mode 100755 (executable)
index 0000000..df8eea7
--- /dev/null
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s,\\\\\\\\,/,g"
+   depmode=msvisualcpp
+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.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    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.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    # 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,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[     ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "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"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${
+              s/^ *//
+              s/ \\*$//
+              s/$/:/
+              p
+            }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # 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 mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $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 "X$1" != 'X--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 "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    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.
+    -arch)
+      eat=yes ;;
+    -*|$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 "X$1" != 'X--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.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+       set fnord "$@"
+       shift
+       shift
+       ;;
+    *)
+       set fnord "$@" "$arg"
+       shift
+       shift
+       ;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::     \1 \\:p' >> "$depfile"
+  echo "       " >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # 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
+  ;;
+
+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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xwud/install-sh b/xwud/install-sh
new file mode 100755 (executable)
index 0000000..6781b98
--- /dev/null
@@ -0,0 +1,520 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2009-04-28.21; # UTC
+
+# 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.
+
+nl='
+'
+IFS=" ""       $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+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:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+       shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+       case $mode in
+         *' '* | *'    '* | *'
+'*       | *'*'* | *'?'* | *'['*)
+           echo "$0: invalid mode: $mode" >&2
+           exit 1;;
+       esac
+       shift;;
+
+    -o) chowncmd="$chownprog $2"
+       shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+       shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)        shift
+       break;;
+
+    -*)        echo "$0: invalid option: $1" >&2
+       exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+       u_plus_rw=
+      else
+       u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # 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: $dst_arg: Is a directory" >&2
+       exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+       (dirname "$dst") 2>/dev/null ||
+       expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+            X"$dst" : 'X\(//\)[^/]' \| \
+            X"$dst" : 'X\(//\)$' \| \
+            X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+       echo X"$dst" |
+           sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)[^/].*/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\/\)$/{
+                  s//\1/
+                  q
+                }
+                /^X\(\/\).*/{
+                  s//\1/
+                  q
+                }
+                s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+       # Create intermediate dirs using mode 755 as modified by the umask.
+       # This is like FreeBSD 'install' as of 1997-10-28.
+       umask=`umask`
+       case $stripcmd.$umask in
+         # Optimize common cases.
+         *[2367][2367]) mkdir_umask=$umask;;
+         .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+         *[0-7])
+           mkdir_umask=`expr $umask + 22 \
+             - $umask % 100 % 40 + $umask % 20 \
+             - $umask % 10 % 4 + $umask % 2
+           `;;
+         *) mkdir_umask=$umask,go-w;;
+       esac
+
+       # With -d, create the new directory with the user-specified mode.
+       # Otherwise, rely on $mkdir_umask.
+       if test -n "$dir_arg"; then
+         mkdir_mode=-m$mode
+       else
+         mkdir_mode=
+       fi
+
+       posix_mkdir=false
+       case $umask in
+         *[123567][0-7][0-7])
+           # POSIX mkdir -p sets u+wx bits regardless of umask, which
+           # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+           ;;
+         *)
+           tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+           trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+           if (umask $mkdir_umask &&
+               exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+           then
+             if test -z "$dir_arg" || {
+                  # Check for POSIX incompatibilities with -m.
+                  # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                  # other-writeable bit of parent directory when it shouldn't.
+                  # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                  ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                  case $ls_ld_tmpdir in
+                    d????-?r-*) different_mode=700;;
+                    d????-?--*) different_mode=755;;
+                    *) false;;
+                  esac &&
+                  $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                    ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                    test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                  }
+                }
+             then posix_mkdir=:
+             fi
+             rmdir "$tmpdir/d" "$tmpdir"
+           else
+             # Remove any dirs left behind by ancient mkdir implementations.
+             rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+           fi
+           trap '' 0;;
+       esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+       umask $mkdir_umask &&
+       $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+       /*) prefix='/';;
+       -*) prefix='./';;
+       *)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+       test -z "$d" && continue
+
+       prefix=$prefix$d
+       if test -d "$prefix"; then
+         prefixes=
+       else
+         if $posix_mkdir; then
+           (umask=$mkdir_umask &&
+            $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+           # Don't fail if two instances are running concurrently.
+           test -d "$prefix" || exit 1
+         else
+           case $prefix in
+             *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+             *) qprefix=$prefix;;
+           esac
+           prefixes="$prefixes '$qprefix'"
+         fi
+       fi
+       prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+       # Don't fail if two instances are running concurrently.
+       (umask $mkdir_umask &&
+        eval "\$doit_exec \$mkdirprog $prefixes") ||
+         test -d "$dstdir" || exit 1
+       obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # 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
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $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 $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"    2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+       # Now remove or move aside any old file at destination location.
+       # We try this two ways since rm can't unlink itself on some
+       # systems and the destination file might be busy for other
+       # reasons.  In this case, the final cleanup might fail but the new
+       # file should still install successfully.
+       {
+         test ! -f "$dst" ||
+         $doit $rmcmd -f "$dst" 2>/dev/null ||
+         { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+           { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+         } ||
+         { echo "$0: cannot unlink or rename $dst" >&2
+           (exit 1); exit 1
+         }
+       } &&
+
+       # Now rename the file to the real destination.
+       $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xwud/missing b/xwud/missing
new file mode 100755 (executable)
index 0000000..28055d2
--- /dev/null
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# 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=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+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'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  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]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
+# 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).  This is about non-GNU programs, so use $1 not
+# $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 $program 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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.y)
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.c
+           fi
+           SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" y.tab.h
+           fi
+         ;;
+       esac
+    fi
+    if test ! -f y.tab.h; then
+       echo >y.tab.h
+    fi
+    if test ! -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 test $# -ne 1; then
+        eval LASTARG="\${$#}"
+       case $LASTARG in
+       *.l)
+           SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+           if test -f "$SRCFILE"; then
+                cp "$SRCFILE" lex.yy.c
+           fi
+         ;;
+       esac
+    fi
+    if test ! -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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+       touch $file
+    else
+       test -z "$file" || exec >$file
+       echo ".ab help2man is required to generate this page"
+       exit $?
+    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 "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+       /^@setfilename/{
+         s/.* \([^ ]*\) *$/\1/
+         p
+         q
+       }' $infile`
+      # ... 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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/xwud/xwud.c b/xwud/xwud.c
new file mode 100755 (executable)
index 0000000..134f062
--- /dev/null
@@ -0,0 +1,1224 @@
+/*
+
+Copyright 1985, 1986, 1988, 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.
+
+*/
+
+/* xwud - marginally useful raster image undumper */
+
+
+#include <X11/Xos.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Xatom.h>
+#include <stdio.h>
+#include <X11/XWDFile.h>
+#define  XK_LATIN1
+#include <X11/keysymdef.h>
+#include <errno.h>
+#include <stdlib.h>
+
+static Atom wm_protocols;
+static Atom wm_delete_window;
+static int split;
+
+static char *progname;
+
+static void usage(void);
+static Bool Read(char *ptr, int size, int nitems, FILE *stream);
+static void putImage(Display *dpy, Window image_win, GC gc, 
+                    XImage *out_image, int x, int y, int w, int h);
+static void putScaledImage(Display *display, Drawable d, GC gc, 
+                          XImage *src_image, int exp_x, int exp_y, 
+                          unsigned int exp_width, unsigned int exp_height, 
+                          unsigned int dest_width, unsigned dest_height);
+static void Latin1Upper(char *s);
+static void Extract_Plane(XImage *in_image, XImage *out_image, int plane);
+static int EffectiveSize(XVisualInfo *vinfo);
+static int VisualRank(int class);
+static int IsGray(Display *dpy, XStandardColormap *stdmap);
+static void Do_StdGray(Display *dpy, XStandardColormap *stdmap, int ncolors, 
+                      XColor *colors, XImage *in_image, XImage *out_image);
+static void Do_StdCol(Display *dpy, XStandardColormap *stdmap, int ncolors, 
+                     XColor *colors, XImage *in_image, XImage *out_image);
+static Colormap CopyColormapAndFree(Display *dpy, Colormap colormap);
+static void Do_Pseudo(Display *dpy, Colormap *colormap, int ncolors, 
+                     XColor *colors, XImage *in_image, XImage *out_image);
+static void Do_Direct(Display *dpy, XWDFileHeader *header, Colormap *colormap, 
+                     int ncolors, XColor *colors, 
+                     XImage *in_image, XImage *out_image, XVisualInfo *vinfo);
+static unsigned int Image_Size(XImage *image);
+static void Error(char *string);
+static void _swapshort(char *bp, unsigned int n);
+static void _swaplong(char *bp, unsigned int n);
+static void DumpHeader(const XWDFileHeader *header, const char *win_name);
+
+static void
+usage(void)
+{
+    fprintf(stderr, "usage: %s [-in <file>] [-noclick] [-geometry <geom>] [-display <display>]\n", progname);
+    fprintf(stderr, "            [-new] [-std <maptype>] [-raw] [-vis <vis-type-or-id>]\n");
+    fprintf(stderr, "            [-help] [-rv] [-plane <number>] [-fg <color>] [-bg <color>]\n");
+    fprintf(stderr, "            [-scale]\n");
+    exit(1);
+}
+
+static Bool
+Read(char *ptr, int size, int nitems, FILE *stream)
+{
+    size *= nitems;
+    while (size) {
+       nitems = fread(ptr, 1, size, stream);
+       if (nitems <= 0)
+           return False;
+       size -= nitems;
+       ptr += nitems;
+    }
+    return True;
+}
+
+int 
+main(int argc, char *argv[])
+{
+    Display *dpy;
+    int screen;
+    register int i;
+    XImage in_image_struct;
+    XImage *in_image, *out_image;
+    XSetWindowAttributes attributes;
+    XVisualInfo vinfo, *vinfos;
+    long mask;
+    register char *buffer;
+    unsigned long swaptest = 1;
+    int count, stdcnt;
+    unsigned buffer_size;
+    int win_name_size;
+    int ncolors;
+    char *file_name = NULL;
+    char *win_name;
+    Bool inverse = False, rawbits = False, newmap = False;
+    Bool onclick = True;
+    Bool scale = False;
+    int plane = -1;
+    char *std = NULL;
+    char *vis = NULL;
+    char *display_name = NULL;
+    char *fgname = NULL;
+    char *bgname = NULL;
+    char *geom = NULL;
+    int gbits = 0;
+    XSizeHints hints;
+    XTextProperty textprop;
+    XClassHint class_hint;
+    XColor *colors = NULL, color, igncolor;
+    Window image_win;
+    Colormap colormap;
+    XEvent event;
+    register XExposeEvent *expose = (XExposeEvent *)&event;
+    GC gc;
+    XGCValues gc_val;
+    XWDFileHeader header;
+    XWDColor xwdcolor;
+    FILE *in_file = stdin;
+    char *map_name;
+    Atom map_prop;
+    XStandardColormap *stdmaps, *stdmap = NULL;
+    char c;
+    int win_width, win_height;
+    Bool dump_header = False;
+
+    progname = argv[0];
+
+    for (i = 1; i < argc; i++) {
+       if (strcmp(argv[i], "-bg") == 0) {
+           if (++i >= argc) usage();
+           bgname = argv[i];
+           continue;
+       }
+       if (strcmp(argv[i], "-display") == 0) {
+           if (++i >= argc) usage();
+           display_name = argv[i];
+           continue;
+       }
+       if (strcmp(argv[i], "-dumpheader") == 0) {
+           dump_header = True;
+           continue;
+       }
+       if (strcmp(argv[i], "-fg") == 0) {
+           if (++i >= argc) usage();
+           fgname = argv[i];
+           continue;
+       }
+       if (strcmp(argv[i], "-geometry") == 0) {
+           if (++i >= argc) usage();
+           geom = argv[i];
+           continue;
+       }
+       if (strcmp(argv[i], "-help") == 0) {
+           usage();
+       }
+       if (strcmp(argv[i], "-in") == 0) {
+           if (++i >= argc) usage();
+           file_name = argv[i];
+           continue;
+       }
+       if (strcmp(argv[i], "-inverse") == 0) { /* for compatibility */
+           inverse = True;
+           continue;
+       }
+       if (strcmp(argv[i], "-new") == 0) {
+           newmap = True;
+           if (std) usage();
+           continue;
+       }
+       if (strcmp(argv[i], "-noclick") == 0) {
+           onclick = False;
+           continue;
+       }
+       if (strcmp(argv[i], "-plane") == 0) {
+           if (++i >= argc) usage();
+           plane = atoi(argv[i]);
+           continue;
+       }
+       if (strcmp(argv[i], "-raw") == 0) {
+           rawbits = True;
+           if (std) usage();
+           continue;
+       }
+       if (strcmp(argv[i], "-rv") == 0) {
+           inverse = True;
+           continue;
+       }
+       if (strcmp(argv[i], "-scale") == 0) {
+           scale = True;
+           continue;
+       }
+       if (strcmp(argv[i], "-split") == 0) {
+           split = True;
+           continue;
+       }
+       if (strcmp(argv[i], "-std") == 0) {
+           if (++i >= argc) usage();
+           std = argv[i];
+           if (newmap || rawbits) usage();
+           continue;
+       }
+       if (strcmp(argv[i], "-vis") == 0) {
+           if (++i >= argc) usage();
+           vis = argv[i];
+           continue;
+       }
+       usage();
+    }
+    
+    if (file_name) {
+       in_file = fopen(file_name, "rb");
+       if (in_file == NULL)
+           Error("Can't open input file as specified.");
+    }
+#ifdef WIN32
+    else
+       _setmode(fileno(in_file), _O_BINARY);
+#endif
+    
+    dpy = XOpenDisplay(display_name);
+    if (dpy == NULL) {
+       fprintf(stderr, "%s:  unable to open display \"%s\"\n",
+               progname, XDisplayName(display_name));
+       exit(1);
+    }
+    screen = DefaultScreen(dpy);
+
+    /*
+     * Read in header information.
+     */
+    if(!Read((char *)&header, SIZEOF(XWDheader), 1, in_file))
+      Error("Unable to read dump file header.");
+
+    if (*(char *) &swaptest)
+       _swaplong((char *) &header, SIZEOF(XWDheader));
+
+    /* check to see if the dump file is in the proper format */
+    if (header.file_version != XWD_FILE_VERSION) {
+       fprintf(stderr,"xwud: XWD file format version mismatch.");
+       Error("exiting.");
+    }
+    if (header.header_size < SIZEOF(XWDheader)) {
+       fprintf(stderr,"xwud: XWD header size is too small.");
+       Error("exiting.");
+    }
+
+    /* alloc window name */
+    win_name_size = (header.header_size - SIZEOF(XWDheader));
+    if (win_name_size < 1)
+      Error("win_name_size");
+    if((win_name = malloc((unsigned) win_name_size + 6)) == NULL)
+      Error("Can't malloc window name storage.");
+    strcpy(win_name, "xwud: ");
+
+     /* read in window name */
+    if(!Read(win_name + 6, sizeof(char), win_name_size, in_file))
+      Error("Unable to read window name from dump file.");
+    (win_name + 6)[win_name_size - 1] = 0;
+
+    if (dump_header) {
+       DumpHeader(&header, win_name);
+       exit(0);
+    }
+   
+    /* initialize the input image */
+
+    in_image = &in_image_struct;
+    in_image->depth = header.pixmap_depth;
+    in_image->format = header.pixmap_format;
+    in_image->xoffset = header.xoffset;
+    in_image->data = NULL;
+    in_image->width = header.pixmap_width;
+    in_image->height = header.pixmap_height;
+    in_image->bitmap_pad = header.bitmap_pad;
+    in_image->bytes_per_line = header.bytes_per_line;
+    in_image->byte_order = header.byte_order;
+    in_image->bitmap_unit = header.bitmap_unit;
+    in_image->bitmap_bit_order = header.bitmap_bit_order;
+    in_image->bits_per_pixel = header.bits_per_pixel;
+    in_image->red_mask = header.red_mask;
+    in_image->green_mask = header.green_mask;
+    in_image->blue_mask = header.blue_mask;
+    if (!XInitImage(in_image))
+       Error("Invalid input image header data.");
+
+    /* read in the color map buffer */
+    if((ncolors = header.ncolors)) {
+       colors = (XColor *)malloc((unsigned) ncolors * sizeof(XColor));
+       if (!colors)
+           Error("Can't malloc color table");
+       for (i = 0; i < ncolors; i++) {
+           if(!Read((char *) &xwdcolor, SIZEOF(XWDColor), 1, in_file))
+               Error("Unable to read color map from dump file.");
+           colors[i].pixel = xwdcolor.pixel;
+           colors[i].red = xwdcolor.red;
+           colors[i].green = xwdcolor.green;
+           colors[i].blue = xwdcolor.blue;
+           colors[i].flags = xwdcolor.flags;
+       }
+       if (*(char *) &swaptest) {
+           for (i = 0; i < ncolors; i++) {
+               _swaplong((char *) &colors[i].pixel, sizeof(long));
+               _swapshort((char *) &colors[i].red, 3 * sizeof(short));
+           }
+       }
+    }
+    else
+       /* no color map exists, turn on the raw option */
+       rawbits = True;
+
+    /* alloc the pixel buffer */
+    buffer_size = Image_Size(in_image);
+    if((buffer = malloc(buffer_size)) == NULL)
+      Error("Can't malloc data buffer.");
+
+    /* read in the image data */
+    if (!Read(buffer, sizeof(char), (int)buffer_size, in_file))
+        Error("Unable to read pixmap from dump file.");
+
+     /* close the input file */
+    (void) fclose(in_file);
+
+    if (plane >= in_image->depth)
+       Error("plane number exceeds image depth");
+    if ((in_image->format == XYPixmap) && (plane >= 0)) {
+       buffer += in_image->bytes_per_line * in_image->height *
+                 (in_image->depth - (plane + 1));
+       in_image->depth = 1;
+       ncolors = 0;
+    }
+    if (in_image->bits_per_pixel == 1 && in_image->depth == 1) {
+       in_image->format = XYBitmap;
+       newmap = False;
+       rawbits = True;
+    }
+    in_image->data = buffer;
+
+    if (std) {
+       map_name = malloc(strlen(std) + 9);
+       strcpy(map_name, "RGB_");
+       strcat(map_name, std);
+       strcat(map_name, "_MAP");
+       Latin1Upper(map_name);
+       map_prop = XInternAtom(dpy, map_name, True);
+       if (!map_prop || !XGetRGBColormaps(dpy, RootWindow(dpy, screen),
+                                          &stdmaps, &stdcnt, map_prop))
+           Error("specified standard colormap does not exist");
+    }
+    vinfo.screen = screen;
+    mask = VisualScreenMask;
+    if (vis)
+    {
+       char *vt;
+       vt = malloc(strlen(vis) + 1);
+       strcpy(vt, vis);
+       Latin1Upper(vt);
+       if (strcmp(vt, "STATICGRAY") == 0) {
+           vinfo.class = StaticGray;
+           mask |= VisualClassMask;
+       } else if (strcmp(vt, "GRAYSCALE") == 0) {
+           vinfo.class = GrayScale;
+           mask |= VisualClassMask;
+       } else if (strcmp(vt, "STATICCOLOR") == 0) {
+           vinfo.class = StaticColor;
+           mask |= VisualClassMask;
+       } else if (strcmp(vt, "PSEUDOCOLOR") == 0) {
+           vinfo.class = PseudoColor;
+           mask |= VisualClassMask;
+       } else if (strcmp(vt, "DIRECTCOLOR") == 0) {
+           vinfo.class = DirectColor;
+           mask |= VisualClassMask;
+       } else if (strcmp(vt, "TRUECOLOR") == 0) {
+           vinfo.class = TrueColor;
+           mask |= VisualClassMask;
+       } else if (strcmp(vt, "MATCH") == 0) {
+           vinfo.class = header.visual_class;
+           mask |= VisualClassMask;
+       } else if (strcmp(vt, "DEFAULT") == 0) {
+           vinfo.visualid= XVisualIDFromVisual(DefaultVisual(dpy, screen));
+           mask |= VisualIDMask;
+       } else {
+           vinfo.visualid = 0;
+           mask |= VisualIDMask;
+           sscanf(vis, "0x%lx", &vinfo.visualid);
+           if (!vinfo.visualid)
+             sscanf(vis, "%lu", &vinfo.visualid);
+           if (!vinfo.visualid)
+             Error("invalid visual specifier");
+       }
+    }
+    if (rawbits && (in_image->depth > 1) && (plane < 0)) {
+       vinfo.depth = in_image->depth;
+       mask |= VisualDepthMask;
+    }
+    vinfos = XGetVisualInfo(dpy, mask, &vinfo, &count);
+    if (count == 0)
+       Error("no matching visual found");
+
+    /* find a workable visual */
+    if (std) {
+       stdmap = &stdmaps[0];
+       if (mask & VisualIDMask) {
+           for (i = 0; i < stdcnt; i++) {
+               if (stdmaps[i].visualid == vinfo.visualid) {
+                   stdmap = &stdmaps[i];
+                   break;
+               }
+           }
+           if (stdmap->visualid != vinfo.visualid)
+               Error("no standard colormap matching specified visual");
+       }
+       for (i = 0; i < count; i++) {
+           if (stdmap->visualid == vinfos[i].visualid) {
+               vinfo = vinfos[i];
+               break;
+           }
+       }
+    } else if ((in_image->depth == 1) ||
+              ((in_image->format == ZPixmap) && (plane >= 0)) ||
+              rawbits) {
+       vinfo = vinfos[0];
+       if (!(mask & VisualIDMask)) {
+           for (i = 0; i < count; i++) {
+               if ((vinfos[i].visualid ==
+                    XVisualIDFromVisual(DefaultVisual(dpy, screen))) &&
+                   (vinfos[i].depth == DefaultDepth(dpy, screen))) {
+                   vinfo = vinfos[i];
+                   break;
+               }
+           }
+       }
+    } else {
+       /* get best visual */
+       vinfo = vinfos[0];
+       for (i = 0; i < count; i++) {
+           int z1, z2;
+           z2 = EffectiveSize(&vinfos[i]);
+           if ((z2 >= ncolors) &&
+               (vinfos[i].depth == in_image->depth) &&
+               (vinfos[i].class == header.visual_class))
+           {
+               vinfo = vinfos[i];
+               break;
+           }
+           z1 = EffectiveSize(&vinfo);
+           if ((z2 > z1) ||
+               ((z2 == z1) &&
+                (VisualRank(vinfos[i].class) >= VisualRank(vinfo.class))))
+               vinfo = vinfos[i];
+       }
+       if ((newmap || (vinfo.visual != DefaultVisual(dpy, screen))) &&
+           (vinfo.class != StaticGray) &&
+           (vinfo.class != StaticColor) &&
+           (vinfo.class == header.visual_class) &&
+           (vinfo.depth == in_image->depth) &&
+           ((vinfo.class == PseudoColor) ||
+            (vinfo.class == GrayScale) ||
+            ((vinfo.red_mask == header.red_mask) &&
+             (vinfo.green_mask == header.green_mask) &&
+             (vinfo.blue_mask == header.blue_mask)))) {
+           rawbits = True;
+           newmap = True;
+       }
+    }
+
+    /* get the appropriate colormap */
+    if (newmap && (vinfo.class & 1) &&
+       (vinfo.depth == in_image->depth) &&
+       (vinfo.class == header.visual_class) &&
+       (vinfo.colormap_size >= ncolors) &&
+       (vinfo.red_mask == header.red_mask) &&
+       (vinfo.green_mask == header.green_mask) &&
+       (vinfo.blue_mask == header.blue_mask)) {
+       colormap = XCreateColormap(dpy, RootWindow(dpy, screen), vinfo.visual,
+                                  AllocAll);
+       if (ncolors) {
+           for (i = 0; i < ncolors; i++)
+               colors[i].flags = DoRed|DoGreen|DoBlue;
+           XStoreColors(dpy, colormap, colors, ncolors);
+       }
+    } else if (std) {
+       colormap = stdmap->colormap;
+    } else {
+       if (!newmap && (vinfo.visual == DefaultVisual(dpy, screen)))
+           colormap = DefaultColormap(dpy, screen);
+       else
+           colormap = XCreateColormap(dpy, RootWindow(dpy, screen),
+                                      vinfo.visual, AllocNone);
+       newmap = False;
+    }
+
+    /* create the output image */
+    if ((in_image->format == ZPixmap) && (plane >= 0)) {
+       out_image = XCreateImage(dpy, vinfo.visual, 1,
+                                XYBitmap, 0, NULL,
+                                in_image->width, in_image->height,
+                                XBitmapPad(dpy), 0);
+       out_image->data = malloc(Image_Size(out_image));
+       Extract_Plane(in_image, out_image, plane);
+       ncolors = 0;
+    } else if (rawbits || newmap) {
+       out_image = in_image;
+    } else {
+       out_image = XCreateImage(dpy, vinfo.visual, vinfo.depth,
+                                (vinfo.depth == 1) ? XYBitmap :
+                                                     in_image->format,
+                                in_image->xoffset, NULL,
+                                in_image->width, in_image->height,
+                                XBitmapPad(dpy), 0);
+       out_image->data = malloc(Image_Size(out_image));
+       if (std) {
+           if (!stdmap->green_max && !stdmap->blue_max && IsGray(dpy, stdmap))
+               Do_StdGray(dpy, stdmap, ncolors, colors, in_image, out_image);
+           else
+               Do_StdCol(dpy, stdmap, ncolors, colors, in_image, out_image);
+       } else if ((header.visual_class == TrueColor) ||
+                  (header.visual_class == DirectColor))
+           Do_Direct(dpy, &header, &colormap, ncolors, colors,
+                     in_image, out_image, &vinfo);
+       else
+           Do_Pseudo(dpy, &colormap, ncolors, colors, in_image, out_image);
+    }
+
+    if (out_image->depth == 1) {
+       if (fgname &&
+           XAllocNamedColor(dpy, colormap, fgname, &color, &igncolor))
+           gc_val.foreground = color.pixel;
+       else if ((ncolors == 2) && XAllocColor(dpy, colormap, &colors[1]))
+           gc_val.foreground = colors[1].pixel;
+       else
+           gc_val.foreground = BlackPixel (dpy, screen);
+       if (bgname &&
+           XAllocNamedColor(dpy, colormap, bgname, &color, &igncolor))
+           gc_val.background = color.pixel;
+       else if ((ncolors == 2) && XAllocColor(dpy, colormap, &colors[0]))
+           gc_val.background = colors[0].pixel;
+       else
+           gc_val.background = WhitePixel (dpy, screen);
+       if (inverse) {
+           unsigned long tmp;
+           tmp = gc_val.foreground;
+           gc_val.foreground = gc_val.background;
+           gc_val.background = tmp;
+       }
+    } else {
+       gc_val.background = XGetPixel(out_image, 0, 0);
+       gc_val.foreground = 0;
+    }
+
+    attributes.background_pixel = gc_val.background;
+    attributes.border_pixel = gc_val.background;
+    if (scale)
+       attributes.bit_gravity = ForgetGravity;
+    else
+       attributes.bit_gravity = NorthWestGravity;
+    attributes.event_mask = ButtonPressMask|ButtonReleaseMask|KeyPressMask|
+                           ExposureMask;
+    if (scale)
+       attributes.event_mask |= StructureNotifyMask;
+    attributes.colormap = colormap;
+
+    hints.x = header.window_x;
+    hints.y = header.window_y;
+    hints.width = out_image->width;
+    hints.height = out_image->height;
+    if (geom)
+       gbits = XParseGeometry(geom, &hints.x, &hints.y,
+                              (unsigned int *)&hints.width,
+                              (unsigned int *)&hints.height);
+    hints.flags = ((gbits & (XValue|YValue)) ? USPosition : 0) |
+                 ((gbits & (HeightValue|WidthValue)) ? USSize : PSize);
+    if (!scale) {
+       hints.flags |= PMaxSize;
+       hints.max_width = (hints.width > out_image->width) ?
+           hints.width : out_image->width;
+       hints.max_height = (hints.height > out_image->height) ?
+           hints.height : out_image->height;
+    }
+    if ((gbits & XValue) && (gbits & XNegative))
+       hints.x += DisplayWidth(dpy, screen) - hints.width; 
+    if ((gbits & YValue) && (gbits & YNegative))
+       hints.y += DisplayHeight(dpy, screen) - hints.height;
+
+    /* create the image window */
+    image_win = XCreateWindow(dpy, RootWindow(dpy, screen),
+                             hints.x, hints.y, hints.width, hints.height,
+                             0, vinfo.depth, InputOutput, vinfo.visual,
+                             CWBorderPixel|CWBackPixel|CWColormap|CWEventMask|CWBitGravity,
+                             &attributes);
+    win_width = hints.width;
+    win_height = hints.height;
+
+    /* Setup for ICCCM delete window. */
+    wm_protocols = XInternAtom(dpy, "WM_PROTOCOLS", False);
+    wm_delete_window = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
+    (void) XSetWMProtocols (dpy, image_win, &wm_delete_window, 1);
+     
+    textprop.value = (unsigned char *) win_name;
+    textprop.encoding = XA_STRING;
+    textprop.format = 8;
+    textprop.nitems = strlen(win_name);
+    class_hint.res_name = (char *)NULL;
+    class_hint.res_class = "Xwud";
+    /* set standard properties */
+    XSetWMProperties(dpy, image_win, &textprop, (XTextProperty *)NULL,
+                    argv, argc, &hints, (XWMHints *)NULL, &class_hint);
+
+    /* map the image window */
+    XMapWindow(dpy, image_win);
+
+    gc = XCreateGC (dpy, image_win, GCForeground|GCBackground, &gc_val);
+
+    while (1) {
+       /* wait on mouse input event to terminate */
+       XNextEvent(dpy, &event);
+       switch(event.type) {
+       case ClientMessage:
+         if (event.xclient.message_type == wm_protocols && 
+             event.xclient.data.l[0] == wm_delete_window)  {
+           XCloseDisplay(dpy);
+           exit(0);            /* ICCCM delete window */
+         }
+           break;
+       case ButtonPress:
+           break;
+       case ButtonRelease:
+           if (onclick) {
+               XCloseDisplay(dpy);
+               exit(0);
+           }
+           break;
+       case KeyPress:
+           i = XLookupString(&event.xkey, &c, 1, NULL, NULL);
+           if ((i == 1) && ((c == 'q') || (c == 'Q') || (c == '\03'))) {
+               XCloseDisplay(dpy);
+               exit(0);
+           }
+           break;
+       case ConfigureNotify:
+           win_width = event.xconfigure.width;
+           win_height = event.xconfigure.height;
+           break;
+       case Expose:
+           if (scale)
+               putScaledImage(dpy, image_win, gc, out_image,
+                              expose->x, expose->y,
+                              expose->width, expose->height,
+                              win_width, win_height);
+           else if ((expose->x < out_image->width) &&
+                    (expose->y < out_image->height)) {
+               if ((out_image->width - expose->x) < expose->width)
+                   expose->width = out_image->width - expose->x;
+               if ((out_image->height - expose->y) < expose->height)
+                   expose->height = out_image->height - expose->y;
+               putImage(dpy, image_win, gc, out_image,
+                         expose->x, expose->y,
+                         expose->width, expose->height);
+           }
+           break;
+       }
+    }
+    exit(0);
+}
+
+static void
+putImage(Display *dpy, Window image_win, GC gc, XImage *out_image, 
+        int x, int y, int w, int h)
+{
+#define SPLIT_SIZE  100
+    int        t_x, t_y, t_w, t_h;
+    if (split) {
+       for (t_y = y; t_y < y + h; t_y += t_h) {
+           t_h = SPLIT_SIZE;
+           if (t_y + t_h > y + h)
+               t_h = y + h - t_y;
+           for (t_x = x; t_x < x + w; t_x += t_w) {
+               t_w = SPLIT_SIZE;
+               if (t_x + t_w > x + w)
+                   t_w = x + w - t_x;
+               XPutImage(dpy, image_win, gc, out_image,
+                         t_x, t_y, t_x, t_y, t_w, t_h);
+           }
+       }
+    } else {
+       XPutImage (dpy, image_win, gc, out_image, x, y, x, y, w, h);
+    }
+}
+
+typedef short Position;
+typedef unsigned short Dimension;
+typedef unsigned long Pixel;
+
+#define roundint(x)                   (int)((x) + 0.5)
+
+typedef struct {
+  Position *x, *y;
+  Dimension *width, *height;
+} Table;
+
+static void
+putScaledImage(Display *display, Drawable d, GC gc, XImage *src_image, 
+              int exp_x, int exp_y,
+              unsigned int exp_width, unsigned int exp_height, 
+              unsigned int dest_width, unsigned dest_height)
+{
+    XImage *dest_image;
+    Position x, y, min_y, max_y, exp_max_y, src_x, src_max_x, src_y;
+    Dimension w, h, strip_height;
+    Table table;    
+    Pixel pixel;
+    double ratio_x, ratio_y;
+    Bool fast8;
+
+    if (dest_width == src_image->width && dest_height == src_image->height) {
+       /* same for x and y, just send it out */
+       XPutImage(display, d, gc, src_image, exp_x, exp_y, 
+                 exp_x, exp_y, exp_width, exp_height); 
+       return;
+    }
+
+    ratio_x = (double)dest_width / (double)src_image->width;
+    ratio_y = (double)dest_height / (double)src_image->height;
+    src_x = exp_x / ratio_x;
+    if (src_x >= src_image->width)
+       src_x = src_image->width - 1;
+    src_y = exp_y / ratio_y;
+    if (src_y >= src_image->height)
+       src_y = src_image->height - 1;
+    exp_max_y = exp_y + exp_height;
+    src_max_x = roundint((exp_x + exp_width) / ratio_x) + 1;
+    if (src_max_x > src_image->width)
+       src_max_x = src_image->width;
+
+    strip_height = 65536 / roundint(ratio_x * src_image->bytes_per_line);
+    if (strip_height == 0)
+       strip_height = 1;
+    if (strip_height > exp_height)
+       strip_height = exp_height;
+
+    h = strip_height + roundint(ratio_y);
+    dest_image = XCreateImage(display,
+                             DefaultVisualOfScreen(
+                                            DefaultScreenOfDisplay(display)),
+                             src_image->depth, src_image->format, 
+                             0, NULL,
+                             dest_width, h,
+                             src_image->bitmap_pad, 0);
+    dest_image->data = malloc(dest_image->bytes_per_line * h);
+    fast8 = (src_image->depth == 8 && src_image->bits_per_pixel == 8 &&
+            dest_image->bits_per_pixel == 8 && src_image->format == ZPixmap);
+
+    table.x = (Position *) malloc(sizeof(Position) * (src_image->width + 1));
+    table.y = (Position *) malloc(sizeof(Position) * (src_image->height + 1));
+    table.width = (Dimension *) malloc(sizeof(Dimension) * src_image->width);
+    table.height = (Dimension *) malloc(sizeof(Dimension)*src_image->height);
+    
+    table.x[0] = 0;
+    for (x = 1; x <= src_image->width; x++) {
+       table.x[x] = roundint(ratio_x * x);
+       table.width[x - 1] = table.x[x] - table.x[x - 1];
+    }
+
+    table.y[0] = 0;
+    for (y = 1; y <= src_image->height; y++) {
+       table.y[y] = roundint(ratio_y * y);
+       table.height[y - 1] = table.y[y] - table.y[y - 1];
+    }
+
+    for (min_y = table.y[src_y]; min_y < exp_max_y; min_y = table.y[y]) {
+       max_y = min_y + strip_height;
+       if (max_y > exp_max_y) {
+           strip_height = exp_max_y - min_y;
+           max_y = exp_max_y;
+       }
+       for (y = src_y; table.y[y] < max_y; y++) {
+           if (table.y[y] < min_y)
+               continue;
+           if (fast8) {
+               for (x = src_x; x < src_max_x; x++) {
+                   pixel = ((unsigned char *)src_image->data)
+                       [y * src_image->bytes_per_line + x];
+                   for (h = 0; h < table.height[y]; h++) {
+                       memset(dest_image->data +
+                              (table.y[y] + h - min_y) *
+                              dest_image->bytes_per_line + table.x[x],
+                              pixel, table.width[x]);
+                   }
+               }
+           } else {
+               for (x = src_x; x < src_max_x; x++) {
+                   pixel = XGetPixel(src_image, x, y);
+                   for (h = 0; h < table.height[y]; h++) {
+                       for (w = 0; w < table.width[x]; w++)
+                           XPutPixel(dest_image,
+                                     table.x[x] + w,
+                                     table.y[y] + h - min_y,
+                                     pixel);
+                   }
+               }
+           }
+       }
+       XPutImage(display, d, gc, dest_image, exp_x, 0,
+                 exp_x, min_y, exp_width, table.y[y] - min_y);
+       if (y >= src_image->height)
+           break;
+    }
+    
+    XFree((char *)table.x);
+    XFree((char *)table.y);
+    XFree((char *)table.width);
+    XFree((char *)table.height);
+
+    XDestroyImage(dest_image);
+}
+
+static void
+Latin1Upper(char *s)
+{
+    unsigned char *str = (unsigned char *)s;
+    unsigned char c;
+
+    for (; (c = *str); str++)
+    {
+       if ((c >= XK_a) && (c <= XK_z))
+           *str = c - (XK_a - XK_A);
+       else if ((c >= XK_agrave) && (c <= XK_odiaeresis))
+           *str = c - (XK_agrave - XK_Agrave);
+       else if ((c >= XK_oslash) && (c <= XK_thorn))
+           *str = c - (XK_oslash - XK_Ooblique);
+    }
+}
+
+static void
+Extract_Plane(XImage *in_image, XImage *out_image, int plane)
+{
+    register int x, y;
+
+    for (y = 0; y < in_image->height; y++)
+       for (x = 0; x < in_image->width; x++)
+           XPutPixel(out_image, x, y,
+                     (XGetPixel(in_image, x, y) >> plane) & 1);
+}
+
+static int
+EffectiveSize(XVisualInfo *vinfo)
+{
+    if ((vinfo->class == DirectColor) || (vinfo->class == TrueColor))
+       return (vinfo->red_mask | vinfo->green_mask | vinfo->blue_mask) + 1;
+    else
+       return vinfo->colormap_size;
+}
+
+static int
+VisualRank(int class)
+{
+    switch (class) {
+    case PseudoColor:
+       return 5;
+    case TrueColor:
+       return 4;
+    case DirectColor:
+       return 3;
+    case StaticColor:
+       return 2;
+    case GrayScale:
+       return 1;
+    case StaticGray:
+       return 0;
+    }
+    /* NOTREACHED */
+    return -1;
+}
+
+static int
+IsGray(Display *dpy, XStandardColormap *stdmap)
+{
+    XColor color;
+
+    color.pixel = stdmap->base_pixel + (stdmap->red_max * stdmap->red_mult);
+    XQueryColor(dpy, stdmap->colormap, &color);
+    return (color.green || color.blue);
+}
+
+static void 
+Do_StdGray(Display *dpy, XStandardColormap *stdmap, 
+          int ncolors, XColor *colors, XImage *in_image, XImage *out_image)
+{
+    register int i, x, y;
+    register XColor *color;
+    unsigned lim;
+
+    lim = stdmap->red_max + 1;
+    for (i = 0, color = colors; i < ncolors; i++, color++)
+       color->pixel = stdmap->base_pixel +
+                      (((((int)(30L * color->red +
+                                59L * color->green +
+                                11L * color->blue) / 100)
+                         * lim) >> 16) * stdmap->red_mult);
+    for (y = 0; y < in_image->height; y++) {
+       for (x = 0; x < in_image->width; x++) {
+           XPutPixel(out_image, x, y,
+                     colors[XGetPixel(in_image, x, y)].pixel);
+       }
+    }
+}
+
+#define MapVal(val,lim,mult) ((((val * lim) + 32768) / 65535) * mult)
+
+static void
+Do_StdCol(Display *dpy, XStandardColormap *stdmap, 
+         int ncolors, XColor *colors, XImage *in_image, XImage *out_image)
+{
+    register int i, x, y;
+    register XColor *color;
+    unsigned limr, limg, limb;
+
+    limr = stdmap->red_max;
+    limg = stdmap->green_max;
+    limb = stdmap->blue_max;
+    for (i = 0, color = colors; i < ncolors; i++, color++)
+       color->pixel = stdmap->base_pixel +
+                      MapVal(color->red, limr, stdmap->red_mult) +
+                      MapVal(color->green, limg, stdmap->green_mult) +
+                      MapVal(color->blue, limb, stdmap->blue_mult);
+    for (y = 0; y < in_image->height; y++) {
+       for (x = 0; x < in_image->width; x++) {
+           XPutPixel(out_image, x, y,
+                     colors[XGetPixel(in_image, x, y)].pixel);
+       }
+    }
+}
+
+static Colormap
+CopyColormapAndFree(Display *dpy, Colormap colormap)
+{
+    if (colormap == DefaultColormap(dpy, DefaultScreen(dpy)))
+       return XCopyColormapAndFree(dpy, colormap);
+    Error("Visual type is not large enough to hold all colors of the image.");
+    /*NOTREACHED*/
+    return (Colormap)0;
+}
+
+static void
+Do_Pseudo(Display *dpy, Colormap *colormap, 
+         int ncolors, XColor *colors, XImage *in_image, XImage *out_image)
+{
+    register int i, x, y;
+    register XColor *color;
+
+    for (i = 0; i < ncolors; i++)
+       colors[i].flags = 0;
+    for (y = 0; y < in_image->height; y++) {
+       for (x = 0; x < in_image->width; x++) {
+           color = &colors[XGetPixel(in_image, x, y)];
+           if (!color->flags) {
+               color->flags = DoRed | DoGreen | DoBlue;
+               if (!XAllocColor(dpy, *colormap, color)) {
+                   *colormap = CopyColormapAndFree(dpy, *colormap);
+                   XAllocColor(dpy, *colormap, color);
+               }
+           }
+           XPutPixel(out_image, x, y, color->pixel);
+       }
+    }
+}
+
+static void
+Do_Direct(Display *dpy, XWDFileHeader *header, Colormap *colormap, 
+         int ncolors, XColor *colors, XImage *in_image, XImage *out_image,
+          XVisualInfo *vinfo)
+{
+    register int x, y;
+    XColor color;
+    unsigned long rmask, gmask, bmask;
+    unsigned long ormask, ogmask, obmask;
+    unsigned long  rshift = 0, gshift = 0, bshift = 0;
+    unsigned long  orshift = 0, ogshift = 0, obshift = 0;
+    int i;
+    unsigned long pix, xpix;
+    unsigned long *pixels, *rpixels;
+
+    rmask = header->red_mask;
+    while (!(rmask & 1)) {
+       rmask >>= 1;
+       rshift++;
+    }
+    gmask = header->green_mask;
+    while (!(gmask & 1)) {
+       gmask >>= 1;
+       gshift++;
+    }
+    bmask = header->blue_mask;
+    while (!(bmask & 1)) {
+       bmask >>= 1;
+       bshift++;
+    }
+    if (in_image->depth <= 12) {
+       pix = 1 << in_image->depth;
+       pixels = (unsigned long *)malloc(sizeof(unsigned long) * pix);
+       if (pixels == NULL)
+           Error("Unable to allocate memory for pixel conversion");
+       for (i = 0; i < pix; i++)
+           pixels[i] = ~0L;
+       color.flags = DoRed | DoGreen | DoBlue;
+       for (y = 0; y < in_image->height; y++) {
+           for (x = 0; x < in_image->width; x++) {
+               pix = XGetPixel(in_image, x, y);
+               if ((color.pixel = pixels[pix]) == ~0L) {
+                   color.red = (pix >> rshift) & rmask;
+                   color.green = (pix >> gshift) & gmask;
+                   color.blue = (pix >> bshift) & bmask;
+                   if (ncolors) {
+                       color.red = colors[color.red].red;
+                       color.green = colors[color.green].green;
+                       color.blue = colors[color.blue].blue;
+                   } else {
+                       color.red = (((unsigned long)color.red * 65535) /
+                                    rmask);
+                       color.green = (((unsigned long)color.green * 65535) /
+                                      gmask);
+                       color.blue = (((unsigned long)color.blue * 65535) /
+                                     bmask);
+                   }
+                   if (!XAllocColor(dpy, *colormap, &color)) {
+                       *colormap = CopyColormapAndFree(dpy, *colormap);
+                       XAllocColor(dpy, *colormap, &color);
+                   }
+                   pixels[pix] = color.pixel;
+               }
+               XPutPixel(out_image, x, y, color.pixel);
+           }
+       }
+       free(pixels);
+    } else if (header->visual_class == TrueColor &&
+              vinfo->class == TrueColor) {
+       ormask = vinfo->red_mask;
+       while (!(ormask & 1)) {
+           ormask >>= 1;
+           orshift++;
+       }
+       ogmask = vinfo->green_mask;
+       while (!(ogmask & 1)) {
+           ogmask >>= 1;
+           ogshift++;
+       }
+       obmask = vinfo->blue_mask;
+       while (!(obmask & 1)) {
+           obmask >>= 1;
+           obshift++;
+       }
+       for (y = 0; y < in_image->height; y++) {
+           for (x = 0; x < in_image->width; x++) {
+               pix = XGetPixel(in_image, x, y);
+               xpix = (((((pix >> rshift) & rmask) * 65535 / rmask)
+                        * ormask / 65535) << orshift) |
+                      (((((pix >> gshift) & gmask) * 65535 / gmask)
+                        * ogmask / 65535) << ogshift) |
+                      (((((pix >> bshift) & bmask) * 65535 / bmask)
+                        * obmask / 65535) << obshift);
+               XPutPixel(out_image, x, y, xpix);
+           }
+       }
+    } else {
+       if (header->visual_class == TrueColor)
+           ncolors = 0;
+       pix = 1 << 12;
+       pixels = (unsigned long *)malloc(sizeof(unsigned long) * pix);
+       rpixels = (unsigned long *)malloc(sizeof(unsigned long) * pix);
+       if ((pixels == NULL) || (rpixels == NULL))
+           Error("Unable to allocate memory for pixel conversion");
+       for (i = 0; i < pix; i++) {
+           pixels[i] = ~0L;
+           rpixels[i] = ~0L;
+       }
+       color.flags = DoRed | DoGreen | DoBlue;
+       for (y = 0; y < in_image->height; y++) {
+           for (x = 0; x < in_image->width; x++) {
+               pix = XGetPixel(in_image, x, y);
+               xpix = ((pix >> 12) ^ pix) & ((1 << 12) - 1);
+               if (((color.pixel = pixels[xpix]) == ~0L) ||
+                   (rpixels[xpix] != pix)) {
+                   color.red = (pix >> rshift) & rmask;
+                   color.green = (pix >> gshift) & gmask;
+                   color.blue = (pix >> bshift) & bmask;
+                   if (ncolors) {
+                       color.red = colors[color.red].red;
+                       color.green = colors[color.green].green;
+                       color.blue = colors[color.blue].blue;
+                   } else {
+                       color.red = (((unsigned long)color.red * 65535) /
+                                    rmask);
+                       color.green = (((unsigned long)color.green * 65535) /
+                                      gmask);
+                       color.blue = (((unsigned long)color.blue * 65535) /
+                                     bmask);
+                   }
+                   if (!XAllocColor(dpy, *colormap, &color)) {
+                       *colormap = CopyColormapAndFree(dpy, *colormap);
+                       XAllocColor(dpy, *colormap, &color);
+                   }
+                   pixels[xpix] = color.pixel;
+                   rpixels[xpix] = pix;
+               }
+               XPutPixel(out_image, x, y, color.pixel);
+           }
+       }
+       free(pixels);
+       free(rpixels);
+    }
+}
+
+static unsigned int 
+Image_Size(XImage *image)
+{
+    if (image->format != ZPixmap)
+      return(image->bytes_per_line * image->height * image->depth);
+
+    return((unsigned)image->bytes_per_line * image->height);
+}
+
+static void
+Error(char *string)
+{
+       fprintf(stderr, "xwud: Error => %s\n", string);
+       if (errno != 0) {
+               perror("xwud");
+               fprintf(stderr, "\n");
+       }
+       exit(1);
+}
+
+static void
+_swapshort(char *bp, unsigned int n)
+{
+    register char c;
+    register char *ep = bp + n;
+
+    while (bp < ep) {
+       c = *bp;
+       *bp = *(bp + 1);
+       bp++;
+       *bp++ = c;
+    }
+}
+
+static void
+_swaplong(char *bp, unsigned int n)
+{
+    register char c;
+    register char *ep = bp + n;
+    register char *sp;
+
+    while (bp < ep) {
+       sp = bp + 3;
+       c = *sp;
+       *sp = *bp;
+       *bp++ = c;
+       sp = bp + 1;
+       c = *sp;
+       *sp = *bp;
+       *bp++ = c;
+       bp += 2;
+    }
+}
+
+static void
+DumpHeader(const XWDFileHeader *header, const char *win_name)
+{
+       printf("window name:        %s\n", win_name);
+       printf("sizeof(XWDheader):  %d\n", (int)sizeof(*header));
+       printf("header size:        %d\n", (int)header->header_size);
+       printf("file version:       %d\n", (int)header->file_version);
+       printf("pixmap format:      %d\n", (int)header->pixmap_format);
+       printf("pixmap depth:       %d\n", (int)header->pixmap_depth);
+       printf("pixmap width:       %d\n", (int)header->pixmap_width);
+       printf("pixmap height:      %d\n", (int)header->pixmap_height);
+       printf("x offset:           %d\n", (int)header->xoffset);
+       printf("byte order:         %d\n", (int)header->byte_order);
+       printf("bitmap unit:        %d\n", (int)header->bitmap_unit);
+       printf("bitmap bit order:   %d\n", (int)header->bitmap_bit_order);
+       printf("bitmap pad:         %d\n", (int)header->bitmap_pad);
+       printf("bits per pixel:     %d\n", (int)header->bits_per_pixel);
+       printf("bytes per line:     %d\n", (int)header->bytes_per_line);
+       printf("visual class:       %d\n", (int)header->visual_class);
+       printf("red mask:           %d\n", (int)header->red_mask);
+       printf("green mask:         %d\n", (int)header->green_mask);
+       printf("blue mask:          %d\n", (int)header->blue_mask);
+       printf("bits per rgb:       %d\n", (int)header->bits_per_rgb);
+       printf("colormap entries:   %d\n", (int)header->colormap_entries);
+       printf("num colors:         %d\n", (int)header->ncolors);
+       printf("window width:       %d\n", (int)header->window_width);
+       printf("window height:      %d\n", (int)header->window_height);
+       printf("window x:           %d\n", (int)header->window_x);
+       printf("window y:           %d\n", (int)header->window_y);
+       printf("border width:       %d\n", (int)header->window_bdrwidth);
+}
+
diff --git a/xwud/xwud.man b/xwud/xwud.man
new file mode 100755 (executable)
index 0000000..f70d93d
--- /dev/null
@@ -0,0 +1,154 @@
+.\" Copyright 1988, 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.
+.\"
+.TH XWUD 1 __xorgversion__
+.SH NAME
+xwud - image displayer for X
+.SH SYNOPSIS
+.B "xwud"
+[\-in \fIfile\fP] [\-noclick] [\-geometry \fIgeom\fP] [\-display \fIdisplay\fP]
+[\-new] [\-std <maptype>] [\-raw] [\-vis <vis-type-or-id>] [\-scale]
+[\-help] [\-rv] [\-plane \fInumber\fP] [\-fg \fIcolor\fP] [\-bg \fIcolor\fP]
+[\-dumpheader]
+.SH DESCRIPTION
+.PP
+.I Xwud
+is an X Window System image undumping utility.
+.I Xwud
+allows X users to display in a window an image saved
+in a specially formatted dump file, such as produced by \fIxwd(1)\fP.
+.SH OPTIONS
+.PP
+.TP 8
+.B "\-bg \fIcolor\fP"
+If a bitmap image (or a single plane of an image) is displayed, this option
+can be used to specify the color to display for the "0" bits in the image.
+.PP
+.TP 8
+.B "\-display \fIdisplay\fP"
+This option allows you to specify the server to connect to; see \fIX(__miscmansuffix__)\fP.
+.PP
+.TP 8
+.B \-dumpheader
+This option prints out the XWD header information only.  Nothing is displayed.
+.PP
+.TP 8
+.B "\-fg \fIcolor\fP"
+If a bitmap image (or a single plane of an image) is displayed, this option
+can be used to specify the color to display for the "1" bits in the image.
+.PP
+.TP 8
+.B "\-geometry \fIgeom\fP"
+This option allows you to specify the size and position of the window.
+Typically you will only want to specify the position, and let the size
+default to the actual size of the image.
+.PP
+.TP 8
+.B "\-help"
+Print out a short description of the allowable options.
+.PP
+.TP 8
+.B "\-in \fIfile\fP"
+This option allows the user to explicitly specify the input 
+file on the command line.  If no input file is given, the standard input
+is assumed.
+.PP
+.TP 8
+.B \-new
+This option forces creation of a new colormap for displaying the image.
+If the image characteristics happen to match those of the display, this
+can get the image on the screen faster, but at the cost of using a new
+colormap (which on most displays will cause other windows to go
+technicolor).
+.PP
+.TP 8
+.B "\-noclick"
+Clicking any button in the window will terminate the application,
+unless this option is specified.  Termination can always be achieved
+by typing 'q', 'Q', or ctrl-c.
+.PP
+.TP 8
+.B "\-plane \fInumber\fP"
+You can select a single bit plane of the image to display
+with this option.  Planes are numbered with zero being the least
+significant bit.
+.PP
+.TP 8
+.B \-raw
+This option forces the image to be displayed with whatever color values
+happen to currently exist on the screen.  This option is mostly useful when
+undumping an image back onto the same screen that the image originally
+came from, while the original windows are still on the screen, and results
+in getting the image on the screen faster.
+.PP
+.TP 8
+.B \-rv
+If a bitmap image (or a single plane of an image) is displayed, this option
+forces the foreground and background colors to be swapped.  This may be
+needed when displaying a bitmap image which has the color sense of pixel
+values "0" and "1" reversed from what they are on your display.
+.PP
+.TP 8
+.B \-scale
+Allow the window to be resized, and scale the image to the size of the window.
+.PP
+.TP 8
+.B "\-std \fImaptype\fP"
+This option causes the image to be displayed using the specified
+Standard Colormap.  The property name is obtained by converting the
+type to upper case, prepending "RGB_", and appending "_MAP".
+Typical types are "best", "default", and "gray".  See \fIxstdcmap(1)\fP
+for one way of creating Standard Colormaps.
+.PP
+.TP 8
+.B "\-vis \fIvis-type-or-id\fP"
+This option allows you to specify a particular visual or visual class.
+The default is to pick the "best" one.  A particular class can be
+specified: "StaticGray", "GrayScale", "StaticColor", "PseudoColor",
+"DirectColor", or "TrueColor".  Or "Match" can be specified, meaning
+use the same class as the source image.  Alternatively, an exact
+visual id (specific to the server) can be specified, either as a
+hexadecimal number (prefixed with "0x") or as a decimal number.
+Finally, "default" can be specified, meaning to use the same class
+as the colormap of the root window.  Case is not significant in
+any of these strings.
+.SH ENVIRONMENT
+.PP
+.TP 8
+.B DISPLAY
+To get default display.
+.SH FILES
+.PP
+.TP 8
+.B XWDFile.h
+X Window Dump File format definition file.
+.SH BUGS
+xwud doesn't handle big/deep images very well on servers that don't 
+have the BIG-REQUESTS extension.
+.SH SEE ALSO
+xwd(1), xstdcmap(1), X(__miscmansuffix__)
+.SH AUTHOR
+Bob Scheifler, MIT X Consortium
+
+